Section 1
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2CircleDef extends b2ShapeDef {
public var radius:Number;
public var localPosition:b2Vec2;
public function b2CircleDef(){
localPosition = new b2Vec2(0, 0);
super();
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 2
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_localPosition:b2Vec2;
public var m_radius:Number;
public function b2CircleShape(_arg1:b2ShapeDef){
m_localPosition = new b2Vec2();
super(_arg1);
var _local2:b2CircleDef = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local10:Number;
var _local6:b2Mat22 = _arg1.R;
var _local7:Number = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
var _local8:Number = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
var _local9:Number = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
var _local11:Number = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
return (false);
};
var _local12:Number = (_arg4.p2.x - _arg4.p1.x);
var _local13:Number = (_arg4.p2.y - _arg4.p1.y);
var _local14:Number = ((_local9 * _local12) + (_local10 * _local13));
var _local15:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local16:Number = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (false);
};
var _local17:Number = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (true);
};
return (false);
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
public function GetRadius():Number{
return (m_radius);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
_local4 = _arg2.R;
var _local5:Number = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local6:Number = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
var _local7:Number = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local8:Number = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number = (m_localPosition.x - _arg1.x);
var _local3:Number = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22 = _arg2.R;
var _local4:Number = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22 = _arg1.R;
var _local4:Number = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function Copy():b2FilterData{
var _local1:b2FilterData = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
center = new b2Vec2(0, 0);
super();
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertices:Array;
public var vertexCount:int;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
var _local1:int;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 6
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_coreVertices:Array;
public var m_vertices:Array;
private var s_supportVec:b2Vec2;
public var m_centroid:b2Vec2;
public var m_normals:Array;
public var m_obb:b2OBB;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local3:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
var _local2:b2PolygonDef = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
var _local4:int = _local3;
var _local5:int = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB = s_sweptAABB1;
var _local5:b2AABB = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local20:Number;
var _local21:Number;
var _local6:Number = 0;
var _local7:Number = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
var _local12:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local13:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
var _local14:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local15:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
var _local16:Number = (_local14 - _local12);
var _local17:Number = (_local15 - _local13);
var _local18 = -1;
var _local19:int;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (false);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (true);
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
var _local7:Number = 0;
var _local8:Number = (1 / 3);
var _local9:int;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function GetNormals():Array{
return (m_normals);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local11:Number;
_local5 = _arg1.R;
var _local6:Number = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
var _local7:Number = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
var _local8:int;
_local4 = m_coreVertices[0];
var _local9:Number = ((_local4.x * _local6) + (_local4.y * _local7));
var _local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
var _local6:b2Mat22 = _local5;
_local4 = m_obb.extents;
var _local7:Number = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
var _local8:Number = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
var _local9:Number = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
var _local10:Number = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
var _local3:int;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local10:Number;
var _local4:b2Mat22 = _arg1.R;
var _local5:Number = (_arg2.x - _arg1.position.x);
var _local6:Number = (_arg2.y - _arg1.position.y);
var _local7:Number = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
var _local8:Number = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
var _local9:int;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local7:Number;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
_local7 = (1 / 3);
var _local8:int;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
var _local5:Array = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
var _local6:Number = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2Shape {
public var m_next:b2Shape;
public var m_type:int;
public var m_sweepRadius:Number;
public var m_density:Number;
public var m_filter:b2FilterData;
public var m_friction:Number;
public var m_isSensor:Boolean;
public var m_restitution:Number;
public var m_userData;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
return (false);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
var _local3:b2AABB = s_resetAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
var _local4:b2AABB = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB = s_proxyAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var friction:Number;// = 0.2
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var type:int;// = -1
public function b2ShapeDef(){
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number = (upperBound.x - lowerBound.x);
var _local2:Number = (upperBound.y - lowerBound.y);
var _local3:Boolean = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var value:uint;
public var proxyId:uint;
public var stabbingCount:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint = value;
var _local3:uint = proxyId;
var _local4:uint = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues)
package Box2D.Collision {
public class b2BoundValues {
public var lowerValues:Array;
public var upperValues:Array;
public function b2BoundValues(){
lowerValues = [0, 0];
upperValues = [0, 0];
super();
}
}
}//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_bounds:Array;
public var m_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = 0xFFFF;
public static const b2_invalid:uint = 0xFFFF;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
var _local4:Number = (_arg1.upperBound.x - _arg1.lowerBound.x);
_local5 = (_arg1.upperBound.y - _arg1.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local6:uint;
var _local7:uint;
var _local12:b2Proxy;
var _local4:Array = new Array();
var _local5:Array = new Array();
ComputeBounds(_local4, _local5, _arg1);
var _local8:Array = [_local6];
var _local9:Array = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
var _local10:int;
var _local11:int;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local10:b2Bound;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
var _local8:uint = BinarySearch(_arg5, _arg6, _arg3);
var _local9:uint = BinarySearch(_arg5, _arg6, _arg4);
var _local11:uint = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
var _local3:int;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number = _arg3.lowerBound.x;
var _local5:Number = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
var _local6:Number = _arg3.upperBound.x;
var _local7:Number = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
var _local5:uint = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
var _local6:uint = (2 * m_proxyCount);
var _local7:Array = new Array();
var _local8:Array = new Array();
ComputeBounds(_local7, _local8, _arg1);
var _local9:int;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
var _local10:int;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
var _local4:b2Proxy = m_proxyPool[_arg1];
var _local5:int = (2 * m_proxyCount);
var _local6:int;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
var _local7:int;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local4:Array;
var _local5:b2Bound;
var _local3:int;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local5:int;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
var _local12:uint = (2 * m_proxyCount);
var _local13:b2Proxy = m_proxyPool[_arg1];
var _local14:b2BoundValues = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
var _local15:b2BoundValues = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local6:int;
var _local7:b2Bound;
var _local4:int;
var _local5:int = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local25:Number;
var _local6:int = _arg1.m_vertexCount;
var _local7:Array = _arg1.m_vertices;
var _local8:Array = _arg1.m_normals;
var _local9:int = _arg4.m_vertexCount;
var _local10:Array = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
var _local13:Number = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
var _local14:Number = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
var _local15:Number = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
var _local16:Number = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
var _local20:Number = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local21:Number = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
var _local22:Number = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local23:Number = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
var _local24:Number = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2 = _arg2.lowerBound;
var _local4:b2Vec2 = _arg1.upperBound;
var _local5:Number = (_local3.x - _local4.x);
var _local6:Number = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
var _local7:Number = (_local3.x - _local4.x);
var _local8:Number = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local20:ClipVertex;
var _local23:Number;
var _local7:int = _arg2.m_vertexCount;
var _local8:Array = _arg2.m_normals;
var _local9:int = _arg5.m_vertexCount;
var _local10:Array = _arg5.m_vertices;
var _local11:Array = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
var _local14:Number = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
var _local15:Number = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
var _local16:Number = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
var _local21:int = _local17;
var _local22:int = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local17:int;
var _local18:uint;
var _local34:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
var _local7:int;
var _local8:Array = [_local7];
var _local9:Number = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
var _local10:int;
var _local11:Array = [_local10];
var _local12:Number = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
var _local15:b2XForm = new b2XForm();
var _local16:b2XForm = new b2XForm();
var _local19:Number = 0.98;
var _local20:Number = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
var _local21:Array = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
var _local22:int = _local13.m_vertexCount;
var _local23:Array = _local13.m_vertices;
var _local24:b2Vec2 = _local23[_local17];
var _local25:b2Vec2 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
var _local26:b2Vec2 = b2Math.SubtractVV(_local37, _local25);
var _local27:b2Vec2 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
var _local28:b2Vec2 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
var _local29:Number = b2Math.b2Dot(_local28, _local25);
var _local30:Number = -(b2Math.b2Dot(_local27, _local25));
var _local31:Number = b2Math.b2Dot(_local27, _local37);
var _local32:Array = [new ClipVertex(), new ClipVertex()];
var _local33:Array = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
var _local35:int;
var _local36:int;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
var _local6:int = _arg2.m_vertexCount;
var _local7:Array = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
var _local10:Number = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
var _local11:Number = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
var _local12:Number = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
var _local13:Number = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
var _local14:int;
var _local15:Number = -(Number.MAX_VALUE);
var _local16:int;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
var _local17:Number = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
var _local18:int = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
var _local19:Number = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
var _local20:int = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
var _local21:Number = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
var _local10:Number = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local18:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
var _local8:Number = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local9:Number = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
var _local10:Number = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local11:Number = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
var _local12:Number = (_local10 - _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local15:Number = _arg2.m_radius;
var _local16:Number = _arg4.m_radius;
var _local17:Number = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
var _local19:b2ManifoldPoint = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
var _local20:Number = (0.5 * (_local8 + _local10));
var _local21:Number = (0.5 * (_local9 + _local11));
var _local22:Number = (_local20 - _arg3.position.x);
var _local23:Number = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local17:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
var _local13:Number = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
var _local14:Number = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
var _local15:Number = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
var _local16:Number = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
var _local18:int;
var _local19:Number = -(Number.MAX_VALUE);
var _local20:Number = _arg4.m_radius;
var _local21:int = _arg2.m_vertexCount;
var _local22:Array = _arg2.m_vertices;
var _local23:Array = _arg2.m_normals;
var _local24:int;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
var _local25:int = _local18;
var _local26:int = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
var _local27:b2Vec2 = _local22[_local26];
var _local28:Number = (_local27.x - _local11.x);
var _local29:Number = (_local27.y - _local11.y);
var _local30:Number = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
var _local31:Number = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = 0;
};
};
_local7 = (_local15 - _local32);
_local8 = (_local16 - _local33);
_local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local17);
_local8 = (_local8 / _local17);
if (_local17 > _local20){
return;
};
_arg1.pointCount = 1;
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8));
_arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8));
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local17 - _local20);
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
public function get key():uint{
return (_key);
}
}
}//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2ContactPoint {
public var friction:Number;
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 17
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Distance {
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local4:Number = (100 * Number.MIN_VALUE);
var _local5:int;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
var _local8:Array = s_p1s;
var _local9:Array = s_p2s;
var _local10:Array = s_points;
var _local11:int;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
var _local12:Number = 0;
var _local13 = 20;
var _local14:int;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - ((_local15 * _local19) + (_local16 * _local20))) <= (0.01 * _local12)){
if (_local11 == 0){
_arg1.SetV(_local17);
_arg2.SetV(_local18);
};
g_GJK_Iterations = _local14;
return (Math.sqrt(_local12));
};
switch (_local11){
case 0:
_local7 = _local8[0];
_local7.SetV(_local17);
_local7 = _local9[0];
_local7.SetV(_local18);
_local7 = _local10[0];
_local7.x = _local19;
_local7.y = _local20;
_arg1.SetV(_local8[0]);
_arg2.SetV(_local9[0]);
_local11++;
break;
case 1:
_local7 = _local8[1];
_local7.SetV(_local17);
_local7 = _local9[1];
_local7.SetV(_local18);
_local7 = _local10[1];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10);
break;
case 2:
_local7 = _local8[2];
_local7.SetV(_local17);
_local7 = _local9[2];
_local7.SetV(_local18);
_local7 = _local10[2];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10);
break;
};
if (_local11 == 3){
g_GJK_Iterations = _local14;
return (0);
};
_local22 = -(Number.MAX_VALUE);
_local23 = 0;
while (_local23 < _local11) {
_local7 = _local10[_local23];
_local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y)));
_local23++;
};
if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){
g_GJK_Iterations = _local14;
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local12 = ((_local15 * _local15) + (_local16 * _local16));
return (Math.sqrt(_local12));
};
_local14++;
};
g_GJK_Iterations = _local13;
return (Math.sqrt(_local12));
}
public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
var _local9:Number = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
var _local10:Number = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
var _local11:Number = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
var _local12:Number = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
var _local13:Number = (_local11 - _local9);
var _local14:Number = (_local12 - _local10);
var _local15:Number = ((_local13 * _local13) + (_local14 * _local14));
var _local16:Number = (_arg3.m_radius - b2Settings.b2_toiSlop);
var _local17:Number = (_arg5.m_radius - b2Settings.b2_toiSlop);
var _local18:Number = (_local16 + _local17);
if (_local15 > (_local18 * _local18)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_local20 = (_local19 - _local18);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = (_local11 - (_local17 * _local13));
_arg2.y = (_local12 - (_local17 * _local14));
return (_local20);
};
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
};
_arg1.x = _local9;
_arg1.y = _local10;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
}
public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local35:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
var _local14:b2Vec2 = _arg4[2];
var _local15:Number = _local6.x;
var _local16:Number = _local6.y;
var _local17:Number = _local7.x;
var _local18:Number = _local7.y;
var _local19:Number = _local8.x;
var _local20:Number = _local8.y;
var _local21:Number = (_local17 - _local15);
var _local22:Number = (_local18 - _local16);
var _local23:Number = (_local19 - _local15);
var _local24:Number = (_local20 - _local16);
var _local25:Number = (_local19 - _local17);
var _local26:Number = (_local20 - _local18);
var _local27:Number = -(((_local15 * _local21) + (_local16 * _local22)));
var _local28:Number = ((_local17 * _local21) + (_local18 * _local22));
var _local29:Number = -(((_local15 * _local23) + (_local16 * _local24)));
var _local30:Number = ((_local19 * _local23) + (_local20 * _local24));
var _local31:Number = -(((_local17 * _local25) + (_local18 * _local26)));
var _local32:Number = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
var _local33:Number = ((_local21 * _local24) - (_local22 * _local23));
var _local34:Number = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
var _local36:Number = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
var _local37:Number = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
var _local38:Number = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
var _local39:Number = (_local36 * _local38);
var _local40:Number = (_local37 * _local38);
var _local41:Number = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local9:b2Point = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
var _local10:Number = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
var _local11:Number = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int = _arg3.m_type;
var _local8:int = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local17:Number;
var _local6:b2Vec2 = _arg5[0];
var _local7:b2Vec2 = _arg5[1];
var _local8:b2Vec2 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
var _local12:Number = -(_local7.x);
var _local13:Number = -(_local7.y);
var _local14:Number = (_local6.x - _local7.x);
var _local15:Number = (_local6.y - _local7.y);
var _local16:Number = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var pointCount:int;// = 0
public var normal:b2Vec2;
public var points:Array;
public function b2Manifold(){
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
pointCount = _arg1.pointCount;
var _local2:int;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var separation:Number;
public var localPoint2:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localPoint1:b2Vec2;
public var id:b2ContactID;
public function b2ManifoldPoint(){
localPoint1 = new b2Vec2();
localPoint2 = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 20
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 21
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
public class b2Pair {
public var proxyId1:uint;
public var userData;// = null
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = 0xFFFF;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = 0xFFFF;
public static var b2_tableCapacity:int = 4096;
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_hashTable:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
var _local3:int;
var _local4:Array = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
var _local4:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local5:uint = m_hashTable[_local4];
var _local6:b2Pair;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
var _local5:uint = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var userData;// = null
public var lowerBounds:Array;
public var upperBounds:Array;
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Segment {
public var p1:b2Vec2;
public var p2:b2Vec2;
public function b2Segment(){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
}
public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local5:b2Vec2 = _arg3.p1;
var _local6:Number = (_arg3.p2.x - _local5.x);
var _local7:Number = (_arg3.p2.y - _local5.y);
var _local8:Number = (p2.x - p1.x);
var _local9:Number = (p2.y - p1.y);
var _local10:Number = _local9;
var _local11:Number = -(_local8);
var _local12:Number = (100 * Number.MIN_VALUE);
var _local13:Number = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_local7) * _local15) + (_local7 * _local14));
if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){
_local16 = (_local16 / _local13);
_local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local18);
_local11 = (_local11 / _local18);
_arg1[0] = _local16;
_arg2.Set(_local10, _local11);
return (true);
};
};
};
return (false);
}
}
}//package Box2D.Collision
Section 27
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2TimeOfImpact {
public static var s_xf1:b2XForm = new b2XForm();
public static var s_xf2:b2XForm = new b2XForm();
public static var s_p1:b2Vec2 = new b2Vec2();
public static var s_p2:b2Vec2 = new b2Vec2();
public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local7:Number = _arg1.m_sweepRadius;
var _local8:Number = _arg3.m_sweepRadius;
var _local9:Number = _arg2.t0;
var _local10:Number = (_arg2.c.x - _arg2.c0.x);
var _local11:Number = (_arg2.c.y - _arg2.c0.y);
var _local12:Number = (_arg4.c.x - _arg4.c0.x);
var _local13:Number = (_arg4.c.y - _arg4.c0.y);
var _local14:Number = (_arg2.a - _arg2.a0);
var _local15:Number = (_arg4.a - _arg4.a0);
var _local16:Number = 0;
var _local17:b2Vec2 = s_p1;
var _local18:b2Vec2 = s_p2;
var _local19 = 20;
var _local20:int;
var _local21:Number = 0;
var _local22:Number = 0;
var _local23:Number = 0;
var _local24:Number = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 28
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var id:b2ContactID;
public var v:b2Vec2;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 29
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceEdge:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 30
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function Set(_arg1:Number):void{
var _local2:Number;
_local2 = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local4:Number;
var _local6:Number;
_local2 = col1.x;
var _local3:Number = col2.x;
_local4 = col1.y;
var _local5:Number = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number = col1.x;
var _local5:Number = col2.x;
var _local6:Number = col1.y;
var _local7:Number = col2.y;
var _local8:Number = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity);
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:* = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
var _local4:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
var _local5:b2Mat22 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var a:Number;
public var c:b2Vec2;
public var a0:Number;
public var c0:b2Vec2;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
var _local3:b2Mat22 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var y:Number;
public var x:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function Normalize():Number{
var _local1:Number = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
var _local2:Number = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function CrossVF(_arg1:Number):void{
var _local2:Number = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossFV(_arg1:Number):void{
var _local2:Number = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 34
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var position:b2Vec2;
public var R:b2Mat22;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _r:uint;// = 0
private var _g:uint;// = 0
private var _b:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_angularSlop:Number = ((2 / 180) * b2_pi);
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = Math.PI;
public static const b2_maxProxies:int = 0x0200;
public static const b2_maxAngularVelocitySquared:Number = 62500;
public static const b2_maxPolygonVertices:int = 8;
public static const b2_velocityThreshold:Number = 1;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxPairs:int = 4096;
public static const b2_maxTOIContactsPerIsland:int = 32;
public static const b2_timeToSleep:Number = 0.5;
public static const b2_maxManifoldPoints:int = 2;
public static const b2_maxAngularVelocity:Number = 250;
public static const b2_maxAngularCorrection:Number = ((8 / 180) * b2_pi);
public static const USHRT_MAX:int = 0xFFFF;
public static const b2_maxLinearVelocity:Number = 200;
public static const b2_maxLinearCorrection:Number = 0.2;
public static const b2_toiSlop:Number = 0.04;
public static const b2_maxLinearVelocitySquared:Number = 40000;
public static function b2Assert(_arg1:Boolean):void{
var _local2:b2Vec2;
if (!_arg1){
_local2.x++;
};
}
}
}//package Box2D.Common
Section 37
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local8:b2ManifoldPoint;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
var _local7:b2ContactPoint = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function GetManifolds():Array{
return (null);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int = m_manifoldCount;
Evaluate(_arg1);
var _local3:int = m_manifoldCount;
var _local4:b2Body = m_shape1.m_body;
var _local5:b2Body = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
var _local1:int;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
var _local3:int = _arg1.m_shape1.m_type;
var _local4:int = _arg1.m_shape2.m_type;
var _local5:b2ContactRegister = s_registers[_local3][_local4];
var _local6:Function = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
var _local4:int = _arg1.m_type;
var _local5:int = _arg2.m_type;
var _local6:b2ContactRegister = s_registers[_local4][_local5];
var _local7:Function = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 39
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var normal:b2Vec2;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var tangentMass:Number;
public var equalizedMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var other:b2Body;
public var prev:b2ContactEdge;
public var contact:b2Contact;
public var next:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2ContactResult {
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var normal:b2Vec2;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
var _local9:int;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
var _local5:int;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local2:Number = 0;
var _local5:int;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
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;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
var _local19:int;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
var _local1:int;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function Evaluate(_arg1:b2ContactListener):void{
}
override public function GetManifolds():Array{
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local6:b2Body = m_shape1.m_body;
var _local7:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
var _local8:Array = [false, false];
var _local9:b2ContactPoint = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local7:b2ContactPoint;
var _local8:int;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
var _local9:Array = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 48
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_u:b2Vec2;
public var m_mass:Number;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
m_inv_dt = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local8:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
m_inv_dt = _arg1.inv_dt;
_local4 = m_body1;
_local5 = m_body2;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
var _local10:Number = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
var _local11:Number = ((_local6 * m_u.y) - (_local7 * m_u.x));
var _local12:Number = ((_local8 * m_u.y) - (_local9 * m_u.x));
var _local13:Number = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = (1 / _local13);
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17))));
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (1 / (_local13 + m_gamma));
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
if (m_frequencyHz > 0){
return (true);
};
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local1 = _local2.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local6:Number = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8));
_local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8));
_local7 = _local6;
var _local9:Number = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
var _local10:Number = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
var _local11:Number = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
var _local12:Number = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var _local13:Number = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
var _local14:Number = (_local13 * m_u.x);
var _local15:Number = (_local13 * m_u.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
_local2 = _local3.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local7:Number = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
var _local10:Number = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
var _local11:Number = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
var _local12:Number = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
var _local13:Number = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
var _local14:Number = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
var _local15:Number = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
var _local16:Number = (_local15 * m_u.x);
var _local17:Number = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
}
}//package Box2D.Dynamics.Joints
Section 49
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2DistanceJointDef extends b2JointDef {
public var localAnchor1:b2Vec2;
public var length:Number;
public var dampingRatio:Number;
public var localAnchor2:b2Vec2;
public var frequencyHz:Number;
public function b2DistanceJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
var _local5:Number = (_arg4.x - _arg3.x);
var _local6:Number = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 50
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_ground2:b2Body;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_ratio:Number;
public var m_revolute2:b2RevoluteJoint;
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_revolute1:b2RevoluteJoint;
public var m_prismatic1:b2PrismaticJoint;
public var m_constant:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
var _local2:int = _arg1.joint1.m_type;
var _local3:int = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_force = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local15:Number;
var _local2:b2Body = m_ground1;
var _local3:b2Body = m_ground2;
var _local4:b2Body = m_body1;
var _local5:b2Body = m_body2;
var _local14:Number = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear1.Set(-(_local6), -(_local7));
m_J.angular1 = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angular2 = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = (1 / _local14);
if (_arg1.warmStarting){
_local15 = (_arg1.dt * m_force);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var _local1:b2Mat22 = m_body2.m_xf.R;
var _local2:Number = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
var _local3:Number = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
var _local4:Number = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3));
_local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3));
_local2 = _local4;
_local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x))));
return (_local4);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local4:Number;
var _local5:Number;
var _local1:Number = 0;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
var _local6:Number = (m_constant - (_local4 + (m_ratio * _local5)));
var _local7:Number = (-(m_mass) * _local6);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((_local1 < b2Settings.b2_linearSlop));
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
var _local4:Number = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
var _local5:Number = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
var _local6:Number = (_arg1.dt * _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 51
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint1:b2Joint;
public var joint2:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 52
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var linear1:b2Vec2;
public var linear2:b2Vec2;
public var angular1:Number;
public var angular2:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 53
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2Joint {
public var m_islandFlag:Boolean;
public var m_body1:b2Body;
public var m_prev:b2Joint;
public var m_next:b2Joint;
public var m_type:int;
public var m_collideConnected:Boolean;
public var m_node1:b2JointEdge;
public var m_node2:b2JointEdge;
public var m_inv_dt:Number;
public var m_userData;
public var m_body2:b2Body;
public static const e_unknownJoint:int = 0;
public static const e_inactiveLimit:int = 0;
public static const e_atUpperLimit:int = 2;
public static const e_atLowerLimit:int = 1;
public static const e_gearJoint:int = 6;
public static const e_revoluteJoint:int = 1;
public static const e_equalLimits:int = 3;
public static const e_distanceJoint:int = 3;
public static const e_pulleyJoint:int = 4;
public static const e_prismaticJoint:int = 2;
public static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_node1 = new b2JointEdge();
m_node2 = new b2JointEdge();
super();
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_body1 = _arg1.body1;
m_body2 = _arg1.body2;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
public function GetBody2():b2Body{
return (m_body2);
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetType():int{
return (m_type);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetReactionTorque():Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce():b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 54
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var body2:b2Body;
public var type:int;
public var userData;
public var collideConnected:Boolean;
public var body1:b2Body;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
public var joint:b2Joint;
}
}//package Box2D.Dynamics.Joints
Section 56
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
private var K1:b2Mat22;
private var K:b2Mat22;
public var m_beta:Number;
public var m_mass:b2Mat22;
private var K2:b2Mat22;
public var m_target:b2Vec2;
public var m_gamma:Number;
public var m_impulse:b2Vec2;
public var m_C:b2Vec2;
public var m_localAnchor:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local3:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
var _local2:Number = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
var _local4:b2Mat22 = m_body2.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
var _local5:Number = m_body2.m_mass;
var _local6:Number = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
var _local7:Number = (((2 * _local5) * _arg1.dampingRatio) * _local6);
var _local8:Number = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local7:Number;
var _local8:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local7 = _local2.m_invMass;
_local8 = _local2.m_invI;
K1.col1.x = _local7;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local7;
K2.col1.x = ((_local8 * _local5) * _local5);
K2.col2.x = ((-(_local8) * _local4) * _local5);
K2.col1.y = ((-(_local8) * _local4) * _local5);
K2.col2.y = ((_local8 * _local4) * _local4);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
var _local9:Number = (_arg1.dt * m_impulse.x);
var _local10:Number = (_arg1.dt * m_impulse.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9))));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetReactionTorque():Number{
return (0);
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local2:b2Body = m_body2;
_local3 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
var _local8:Number = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
var _local9:Number = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x));
_local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y));
var _local10:Number = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
var _local11:Number = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
var _local12:Number = m_impulse.x;
var _local13:Number = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
var _local14:Number = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
var _local15:Number = (_arg1.dt * _local10);
var _local16:Number = (_arg1.dt * _local11);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
}
}
}//package Box2D.Dynamics.Joints
Section 57
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var timeStep:Number;
public var target:b2Vec2;
public var maxForce:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 58
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_refAngle:Number;
public var m_torque:Number;
public var m_motorForce:Number;
public var m_enableLimit:Boolean;
public var m_angularMass:Number;
public var m_maxMotorForce:Number;
public var m_localYAxis1:b2Vec2;
public var m_force:Number;
public var m_motorMass:Number;
public var m_upperTranslation:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_linearJacobian:b2Jacobian;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_localXAxis1.SetV(_arg1.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_linearJacobian.SetZero();
m_linearMass = 0;
m_force = 0;
m_angularMass = 0;
m_torque = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local8:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
var _local4:Number = _local2.m_invMass;
var _local5:Number = _local3.m_invMass;
var _local6:Number = _local2.m_invI;
var _local7:Number = _local3.m_invI;
var _local9:Number = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
var _local10:Number = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
var _local11:Number = (_arg1.dt * _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2));
var _local12:Number = (_local3.m_angularVelocity - _local2.m_angularVelocity);
var _local13:Number = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
var _local14:Number = (_arg1.dt * _local13);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15);
_local17 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce);
_local16 = (m_motorForce - _local17);
_local11 = (_arg1.dt * _local16);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local19);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
};
};
};
_local11 = (_arg1.dt * _local19);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetJointTranslation():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
var _local4:b2Vec2 = _local1.GetWorldPoint(m_localAnchor1);
var _local5:b2Vec2 = _local2.GetWorldPoint(m_localAnchor2);
var _local6:Number = (_local5.x - _local4.x);
var _local7:Number = (_local5.y - _local4.y);
var _local8:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local9:Number = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22 = m_body1.m_xf.R;
var _local2:Number = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
var _local3:Number = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
var _local4:Number = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
var _local5:Number = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5))));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
var _local5:Number = _local3.m_invMass;
var _local6:Number = _local4.m_invMass;
var _local7:Number = _local3.m_invI;
var _local8:Number = _local4.m_invI;
_local9 = _local3.m_xf.R;
var _local11:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local12:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
var _local13:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local14:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
var _local15:Number = (_local3.m_sweep.c.x + _local11);
var _local16:Number = (_local3.m_sweep.c.y + _local12);
var _local17:Number = (_local4.m_sweep.c.x + _local13);
var _local18:Number = (_local4.m_sweep.c.y + _local14);
var _local19:Number = (_local17 - _local15);
var _local20:Number = (_local18 - _local16);
_local9 = _local3.m_xf.R;
var _local21:Number = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
var _local22:Number = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
var _local23:Number = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var _local24:Number = (-(m_linearMass) * _local23);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2));
var _local25:Number = b2Math.b2Abs(_local23);
var _local26:Number = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
var _local27:Number = (-(m_angularMass) * _local26);
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
var _local28:Number = b2Math.b2Abs(_local26);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local31 = ((_local29 * _local19) + (_local30 * _local20));
_local32 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local31 - m_lowerTranslation);
_local25 = b2Math.b2Max(_local25, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local31 - m_upperTranslation);
_local25 = b2Math.b2Max(_local25, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
_local3 = _local1.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
var _local9:Number = (_local1.m_sweep.c.x + _local4);
var _local10:Number = (_local1.m_sweep.c.y + _local5);
var _local11:Number = (_local2.m_sweep.c.x + _local7);
var _local12:Number = (_local2.m_sweep.c.y + _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = (_local12 - _local10);
var _local15:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local16:b2Vec2 = _local1.m_linearVelocity;
var _local17:b2Vec2 = _local2.m_linearVelocity;
var _local18:Number = _local1.m_angularVelocity;
var _local19:Number = _local2.m_angularVelocity;
var _local20:Number = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
var _local10:Number = _local2.m_invMass;
var _local11:Number = _local3.m_invMass;
var _local12:Number = _local2.m_invI;
var _local13:Number = _local3.m_invI;
_local4 = _local2.m_xf.R;
var _local14:Number = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
var _local15:Number = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
var _local16:Number = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
var _local17:Number = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y);
m_linearJacobian.linear1.x = -(_local14);
m_linearJacobian.linear1.y = -(_local15);
m_linearJacobian.linear2.x = _local14;
m_linearJacobian.linear2.y = _local15;
m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14)));
m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14));
m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
_local4 = _local2.m_xf.R;
_local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y));
_local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local18);
m_motorJacobian.linear1.y = -(_local19);
m_motorJacobian.linear2.x = _local18;
m_motorJacobian.linear2.y = _local19;
m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18)));
m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18));
m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local20 = (_local16 - _local6);
_local21 = (_local17 - _local7);
_local22 = ((_local18 * _local20) + (_local19 * _local21));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local22 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local22 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit == false){
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
_local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
_local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
_local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
_local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
_local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28));
} else {
m_force = 0;
m_torque = 0;
m_limitForce = 0;
m_motorForce = 0;
};
m_limitPositionImpulse = 0;
}
public function GetMotorForce():Number{
return (m_motorForce);
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 59
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PrismaticJointDef extends b2JointDef {
public var motorSpeed:Number;
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var maxMotorForce:Number;
public var lowerTranslation:Number;
public function b2PrismaticJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
localAxis1 = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxis1.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
localAxis1 = body1.GetLocalVector(_arg4);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 60
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_limitState1:int;
public var m_limitState2:int;
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_maxLength1:Number;
public var m_limitPositionImpulse1:Number;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_constant:Number;
public var m_positionImpulse:Number;
public var m_state:int;
public var m_ratio:Number;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_limitMass1:Number;
public var m_limitMass2:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_limitForce1:Number;
public var m_limitForce2:Number;
public var m_u2:b2Vec2;
public static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_ratio = _arg1.ratio;
m_constant = (_arg1.length1 + (m_ratio * _arg1.length2));
m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var _local1:b2Vec2 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local3:b2Mat22;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
var _local4:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local5:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local6:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local7:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local23:Number = 0;
if (m_state == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_pulleyMass) * _local18);
_local20 = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19));
_local19 = (m_positionImpulse - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.SynchronizeTransform();
_local2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local21 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local21);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local21 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local21);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.SynchronizeTransform();
};
return ((_local23 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
var _local10:Number = (_local2.m_sweep.c.x + _local5);
var _local11:Number = (_local2.m_sweep.c.y + _local6);
var _local12:Number = (_local3.m_sweep.c.x + _local8);
var _local13:Number = (_local3.m_sweep.c.y + _local9);
var _local14:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local15:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local16:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local17:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
var _local18:Number = m_u1.Length();
var _local19:Number = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
var _local20:Number = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
var _local21:Number = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
var _local22:Number = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
_local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
_local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
_local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
_local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18);
_local20 = m_force;
m_force = b2Math.b2Max(0, (m_force + _local19));
_local19 = (m_force - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x);
_local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18);
_local20 = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19));
_local19 = (m_limitForce1 - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18);
_local20 = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19));
_local19 = (m_limitForce2 - _local20);
_local16 = ((-(_arg1.dt) * _local19) * m_u2.x);
_local17 = ((-(_arg1.dt) * _local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2 = m_body1.GetWorldPoint(m_localAnchor1);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetLength2():Number{
var _local1:b2Vec2 = m_body2.GetWorldPoint(m_localAnchor2);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 61
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength1:Number;
public var maxLength2:Number;
public var length1:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var ratio:Number;
public var length2:Number;
public function b2PulleyJointDef(){
groundAnchor1 = new b2Vec2();
groundAnchor2 = new b2Vec2();
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchor1.Set(-1, 1);
groundAnchor2.Set(1, 1);
localAnchor1.Set(-1, 0);
localAnchor2.Set(1, 0);
length1 = 0;
maxLength1 = 0;
length2 = 0;
maxLength2 = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
var _local8:Number = (_arg5.x - _arg3.x);
var _local9:Number = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
var _local10:Number = (_arg6.x - _arg4.x);
var _local11:Number = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
var _local12:Number = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 62
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_pivotMass:b2Mat22;
public var m_motorForce:Number;
public var m_enableLimit:Boolean;
public var m_limitState:int;
public var m_motorMass:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
public var m_pivotForce:b2Vec2;
public var m_enableMotor:Boolean;
public var m_referenceAngle:Number;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_upperAngle:Number;
public var m_lowerAngle:Number;
public var m_maxMotorTorque:Number;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_pivotForce = new b2Vec2();
m_pivotMass = new b2Mat22();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_referenceAngle = _arg1.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local10:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
var _local11:Number = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
var _local12:Number = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
var _local13:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
var _local14:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12)));
m_pivotForce.x = (m_pivotForce.x + _local13);
m_pivotForce.y = (m_pivotForce.y + _local14);
var _local15:Number = (_arg1.dt * _local13);
_local16 = (_arg1.dt * _local14);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17);
_local19 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque);
_local18 = (m_motorForce - _local19);
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local21);
} else {
if (m_limitState == e_atLowerLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
} else {
if (m_limitState == e_atUpperLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21));
};
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local6:b2Mat22;
var _local25:Number;
var _local26:Number;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
var _local5:Number = 0;
_local6 = _local3.m_xf.R;
var _local7:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local9:Number = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
var _local10:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local11:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11));
_local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11));
_local10 = _local9;
var _local12:Number = (_local3.m_sweep.c.x + _local7);
var _local13:Number = (_local3.m_sweep.c.y + _local8);
var _local14:Number = (_local4.m_sweep.c.x + _local10);
var _local15:Number = (_local4.m_sweep.c.y + _local11);
var _local16:Number = (_local14 - _local12);
var _local17:Number = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
var _local18:Number = _local3.m_invMass;
var _local19:Number = _local4.m_invMass;
var _local20:Number = _local3.m_invI;
var _local21:Number = _local4.m_invI;
K1.col1.x = (_local18 + _local19);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local18 + _local19);
K2.col1.x = ((_local20 * _local8) * _local8);
K2.col2.x = ((-(_local20) * _local7) * _local8);
K2.col1.y = ((-(_local20) * _local7) * _local8);
K2.col2.y = ((_local20 * _local7) * _local7);
K3.col1.x = ((_local21 * _local11) * _local11);
K3.col2.x = ((-(_local21) * _local10) * _local11);
K3.col1.y = ((-(_local21) * _local10) * _local11);
K3.col2.y = ((_local21 * _local10) * _local10);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
var _local22:Number = tImpulse.x;
var _local23:Number = tImpulse.y;
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
var _local24:Number = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local24 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local25 - m_lowerAngle);
_local24 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local25 - m_upperAngle);
_local24 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle));
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local7:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
var _local10:Number = _local2.m_invMass;
var _local11:Number = _local3.m_invMass;
var _local12:Number = _local2.m_invI;
var _local13:Number = _local3.m_invI;
K1.col1.x = (_local10 + _local11);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local10 + _local11);
K2.col1.x = ((_local12 * _local7) * _local7);
K2.col2.x = ((-(_local12) * _local6) * _local7);
K2.col1.y = ((-(_local12) * _local6) * _local7);
K2.col2.y = ((_local12 * _local6) * _local6);
K3.col1.x = ((_local13 * _local9) * _local9);
K3.col2.x = ((-(_local13) * _local8) * _local9);
K3.col1.y = ((-(_local13) * _local8) * _local9);
K3.col2.y = ((_local13 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
} else {
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 63
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2RevoluteJointDef extends b2JointDef {
public var upperAngle:Number;
public var enableMotor:Boolean;
public var referenceAngle:Number;
public var motorSpeed:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var lowerAngle:Number;
public var maxMotorTorque:Number;
public function b2RevoluteJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchor1.Set(0, 0);
localAnchor2.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 64
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class b2Body {
public var m_next:b2Body;
public var m_xf:b2XForm;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_type:int;
public var m_linearDamping:Number;
public var m_shapeCount:int;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
m_xf.R.Set(m_sweep.a);
var _local1:b2Mat22 = m_xf.R;
var _local2:b2Vec2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:b2MassData = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
var _local5:b2Mat22 = m_xf.R;
var _local6:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
var _local7:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
var _local4:b2Mat22 = m_xf.R;
var _local5:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
var _local6:Boolean;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local4:b2Shape;
var _local1:b2XForm = s_xf1;
_local1.R.Set(m_sweep.a0);
var _local2:b2Mat22 = _local1.R;
var _local3:b2Vec2 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
var _local5:Boolean;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
var _local5:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
var _local2:b2Shape = m_shapeList;
var _local3:b2Shape;
var _local4:Boolean;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_shapeList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2BodyDef {
public var angularDamping:Number;
public var angle:Number;
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var fixedRotation:Boolean;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData = _arg1.GetFilterData();
var _local4:b2FilterData = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
var _local5:Boolean = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 68
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
if (_arg3 == null){
return;
};
var _local4:b2Contact = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local2:b2Shape = _arg1.m_shape1;
var _local3:b2Shape = _arg1.m_shape2;
var _local4:int = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_shape1;
_local10.friction = _arg1.m_friction;
_local10.restitution = _arg1.m_restitution;
_local11 = 0;
while (_local11 < _local4) {
_local12 = _local9[_local11];
_local10.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local10.position = _local7.GetWorldPoint(_local14.localPoint1);
_local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1);
_local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2);
_local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y));
_local10.separation = _local14.separation;
_local10.id.key = _local14.id._key;
m_world.m_contactListener.Remove(_local10);
_local13++;
};
_local11++;
};
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
var _local5:b2Body = _local2.m_body;
var _local6:b2Body = _local3.m_body;
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local5.m_contactList){
_local5.m_contactList = _arg1.m_node1.next;
};
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local6.m_contactList){
_local6.m_contactList = _arg1.m_node2.next;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape = (_arg1 as b2Shape);
var _local4:b2Shape = (_arg2 as b2Shape);
var _local5:b2Body = _local3.m_body;
var _local6:b2Body = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
var _local7:b2Contact = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
public function Collide():void{
var _local2:b2Body;
var _local3:b2Body;
var _local1:b2Contact = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 70
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import flash.display.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_drawFlags:uint;
public var m_lineThickness:Number;// = 1
public var m_drawScale:Number;// = 1
public var m_sprite:Sprite;
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawFlags = 0;
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 71
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
public class b2Island {
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_joints:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
var _local4:int;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
var _local8:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local5:b2Body;
var _local6:Boolean;
var _local3:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
var _local4:Number = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_allowSleep:Boolean;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_debugDraw:b2DebugDraw;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
var _local4:b2BodyDef = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local2:b2Body = _arg1.m_body1;
var _local3:b2Body = _arg1.m_body2;
var _local4:b2XForm = _local2.m_xf;
var _local5:b2XForm = _local3.m_xf;
var _local6:b2Vec2 = _local4.position;
var _local7:b2Vec2 = _local5.position;
var _local8:b2Vec2 = _arg1.GetAnchor1();
var _local9:b2Vec2 = _arg1.GetAnchor2();
var _local10:b2Color = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local11:b2XForm;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
var _local1:uint = m_debugDraw.GetFlags();
var _local7:b2Vec2 = new b2Vec2();
var _local8:b2Vec2 = new b2Vec2();
var _local9:b2Vec2 = new b2Vec2();
var _local10:b2Color = new b2Color(0, 0, 0);
var _local12:b2AABB = new b2AABB();
var _local13:b2AABB = new b2AABB();
var _local14:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.1, 0.1, 0.1), _local15);
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local5 = m_jointList;
while (_local5) {
DrawJoint(_local5);
_local5 = _local5.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local6 = m_broadPhase;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.9, 0.3);
_local2 = 0;
while (_local2 < b2Pair.b2_tableCapacity) {
_local16 = _local6.m_pairManager.m_hashTable[_local2];
while (_local16 != b2Pair.b2_nullPair) {
_local17 = _local6.m_pairManager.m_pairs[_local16];
_local18 = _local6.m_proxyPool[_local17.proxyId1];
_local19 = _local6.m_proxyPool[_local17.proxyId2];
_local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value));
_local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value));
_local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value));
_local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value));
_local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value));
_local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value));
_local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value));
_local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value));
_local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x));
_local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y));
_local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x));
_local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y));
m_debugDraw.DrawSegment(_local8, _local9, _local10);
_local16 = _local17.next;
};
_local2++;
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local6 = m_broadPhase;
_local20 = _local6.m_worldAABB.lowerBound;
_local21 = _local6.m_worldAABB.upperBound;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.3, 0.9);
_local2 = 0;
while (_local2 < b2Settings.b2_maxProxies) {
_local22 = _local6.m_proxyPool[_local2];
if (_local22.IsValid() == false){
} else {
_local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value));
_local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value));
_local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value));
_local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value));
_local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y);
_local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y);
_local14[2].Set(_local12.upperBound.x, _local12.upperBound.y);
_local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local2++;
};
_local14[0].Set(_local20.x, _local20.y);
_local14[1].Set(_local21.x, _local20.y);
_local14[2].Set(_local21.x, _local21.y);
_local14[3].Set(_local20.x, _local21.y);
m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((_local1 & b2DebugDraw.e_obbBit)){
_local10.Set(0.5, 0.3, 0.5);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local4.m_type != b2Shape.e_polygonShape){
} else {
_local23 = (_local4 as b2PolygonShape);
_local24 = _local23.GetOBB();
_local25 = _local24.extents;
_local14[0].Set(-(_local25.x), -(_local25.y));
_local14[1].Set(_local25.x, -(_local25.y));
_local14[2].Set(_local25.x, _local25.y);
_local14[3].Set(-(_local25.x), _local25.y);
_local2 = 0;
while (_local2 < 4) {
_local26 = _local24.R;
_local27 = _local14[_local2];
_local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local26 = _local11.R;
_local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local2++;
};
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawXForm(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
var _local2:b2JointEdge = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
var _local3:b2Shape = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
var _local5:b2Color = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetContactCount():int{
return (m_contactCount);
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
var _local3:b2Island = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
var _local4:b2Contact = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
var _local5:b2Joint = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
var _local6:int = m_bodyCount;
var _local7:Array = new Array(_local6);
var _local8:b2Body = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array = new Array(_arg3);
var _local5:int = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
var _local6:int;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
var _local8:b2Island = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
var _local9:int = m_bodyCount;
var _local10:Array = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function Validate():void{
m_broadPhase.Validate();
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local3:b2Body;
var _local4:b2Shape;
var _local2:b2Joint = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local5:b2Body;
var _local6:b2Shape;
var _local2:Boolean = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
var _local3:b2Body = _arg1.m_body1;
var _local4:b2Body = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
if (m_lock == true){
return (null);
};
var _local2:b2Body = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
m_lock = true;
var _local3:b2TimeStep = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 75
//BitString (com.adobe.images.BitString)
package com.adobe.images {
public class BitString {
public var val:int;// = 0
public var len:int;// = 0
}
}//package com.adobe.images
Section 76
//JPGEncoder (com.adobe.images.JPGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class JPGEncoder {
private var fdtbl_UV:Array;
private var std_ac_chrominance_values:Array;
private var std_dc_chrominance_values:Array;
private var ZigZag:Array;
private var YDC_HT:Array;
private var YAC_HT:Array;
private var bytenew:int;// = 0
private var fdtbl_Y:Array;
private var std_ac_chrominance_nrcodes:Array;
private var DU:Array;
private var std_ac_luminance_values:Array;
private var std_dc_chrominance_nrcodes:Array;
private var UVTable:Array;
private var YDU:Array;
private var UDU:Array;
private var byteout:ByteArray;
private var UVAC_HT:Array;
private var UVDC_HT:Array;
private var bytepos:int;// = 7
private var VDU:Array;
private var std_ac_luminance_nrcodes:Array;
private var std_dc_luminance_values:Array;
private var YTable:Array;
private var std_dc_luminance_nrcodes:Array;
private var bitcode:Array;
private var category:Array;
public function JPGEncoder(_arg1:Number=50){
ZigZag = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63];
YTable = new Array(64);
UVTable = new Array(64);
fdtbl_Y = new Array(64);
fdtbl_UV = new Array(64);
std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0];
std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125];
std_ac_luminance_values = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250];
std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0];
std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119];
std_ac_chrominance_values = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
bitcode = new Array(0xFFFF);
category = new Array(0xFFFF);
DU = new Array(64);
YDU = new Array(64);
UDU = new Array(64);
VDU = new Array(64);
super();
if (_arg1 <= 0){
_arg1 = 1;
};
if (_arg1 > 100){
_arg1 = 100;
};
var _local2:int;
if (_arg1 < 50){
_local2 = int((5000 / _arg1));
} else {
_local2 = int((200 - (_arg1 * 2)));
};
initHuffmanTbl();
initCategoryNumber();
initQuantTables(_local2);
}
private function initHuffmanTbl():void{
YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes, std_dc_luminance_values);
UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes, std_dc_chrominance_values);
YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes, std_ac_luminance_values);
UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes, std_ac_chrominance_values);
}
private function RGB2YUV(_arg1:BitmapData, _arg2:int, _arg3:int):void{
var _local6:int;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local4:int;
var _local5:int;
while (_local5 < 8) {
_local6 = 0;
while (_local6 < 8) {
_local7 = _arg1.getPixel32((_arg2 + _local6), (_arg3 + _local5));
_local8 = Number(((_local7 >> 16) & 0xFF));
_local9 = Number(((_local7 >> 8) & 0xFF));
_local10 = Number((_local7 & 0xFF));
YDU[_local4] = ((((0.299 * _local8) + (0.587 * _local9)) + (0.114 * _local10)) - 128);
UDU[_local4] = (((-0.16874 * _local8) + (-0.33126 * _local9)) + (0.5 * _local10));
VDU[_local4] = (((0.5 * _local8) + (-0.41869 * _local9)) + (-0.08131 * _local10));
_local4++;
_local6++;
};
_local5++;
};
}
private function writeBits(_arg1:BitString):void{
var _local2:int = _arg1.val;
var _local3:int = (_arg1.len - 1);
while (_local3 >= 0) {
if ((_local2 & uint((1 << _local3)))){
bytenew = (bytenew | uint((1 << bytepos)));
};
_local3--;
bytepos--;
if (bytepos < 0){
if (bytenew == 0xFF){
writeByte(0xFF);
writeByte(0);
} else {
writeByte(bytenew);
};
bytepos = 7;
bytenew = 0;
};
};
}
private function writeWord(_arg1:int):void{
writeByte(((_arg1 >> 8) & 0xFF));
writeByte((_arg1 & 0xFF));
}
private function writeByte(_arg1:int):void{
byteout.writeByte(_arg1);
}
private function writeDHT():void{
var _local1:int;
writeWord(65476);
writeWord(418);
writeByte(0);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_luminance_values[_local1]);
_local1++;
};
writeByte(16);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_luminance_values[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_chrominance_values[_local1]);
_local1++;
};
writeByte(17);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_chrominance_values[_local1]);
_local1++;
};
}
public function encode(_arg1:BitmapData):ByteArray{
var _local6:int;
var _local7:BitString;
byteout = new ByteArray();
bytenew = 0;
bytepos = 7;
writeWord(65496);
writeAPP0();
writeDQT();
writeSOF0(_arg1.width, _arg1.height);
writeDHT();
writeSOS();
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
bytenew = 0;
bytepos = 7;
var _local5:int;
while (_local5 < _arg1.height) {
_local6 = 0;
while (_local6 < _arg1.width) {
RGB2YUV(_arg1, _local6, _local5);
_local2 = processDU(YDU, fdtbl_Y, _local2, YDC_HT, YAC_HT);
_local3 = processDU(UDU, fdtbl_UV, _local3, UVDC_HT, UVAC_HT);
_local4 = processDU(VDU, fdtbl_UV, _local4, UVDC_HT, UVAC_HT);
_local6 = (_local6 + 8);
};
_local5 = (_local5 + 8);
};
if (bytepos >= 0){
_local7 = new BitString();
_local7.len = (bytepos + 1);
_local7.val = ((1 << (bytepos + 1)) - 1);
writeBits(_local7);
};
writeWord(65497);
return (byteout);
}
private function initCategoryNumber():void{
var _local3:int;
var _local1 = 1;
var _local2 = 2;
var _local4 = 1;
while (_local4 <= 15) {
_local3 = _local1;
while (_local3 < _local2) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = _local3;
_local3++;
};
_local3 = -((_local2 - 1));
while (_local3 <= -(_local1)) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = ((_local2 - 1) + _local3);
_local3++;
};
_local1 = (_local1 << 1);
_local2 = (_local2 << 1);
_local4++;
};
}
private function writeDQT():void{
var _local1:int;
writeWord(65499);
writeWord(132);
writeByte(0);
_local1 = 0;
while (_local1 < 64) {
writeByte(YTable[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 64) {
writeByte(UVTable[_local1]);
_local1++;
};
}
private function writeAPP0():void{
writeWord(65504);
writeWord(16);
writeByte(74);
writeByte(70);
writeByte(73);
writeByte(70);
writeByte(0);
writeByte(1);
writeByte(1);
writeByte(0);
writeWord(1);
writeWord(1);
writeByte(0);
writeByte(0);
}
private function writeSOS():void{
writeWord(65498);
writeWord(12);
writeByte(3);
writeByte(1);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(3);
writeByte(17);
writeByte(0);
writeByte(63);
writeByte(0);
}
private function processDU(_arg1:Array, _arg2:Array, _arg3:Number, _arg4:Array, _arg5:Array):Number{
var _local8:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local6:BitString = _arg5[0];
var _local7:BitString = _arg5[240];
var _local9:Array = fDCTQuant(_arg1, _arg2);
_local8 = 0;
while (_local8 < 64) {
DU[ZigZag[_local8]] = _local9[_local8];
_local8++;
};
var _local10:int = (DU[0] - _arg3);
_arg3 = DU[0];
if (_local10 == 0){
writeBits(_arg4[0]);
} else {
writeBits(_arg4[category[(32767 + _local10)]]);
writeBits(bitcode[(32767 + _local10)]);
};
var _local11 = 63;
while ((((_local11 > 0)) && ((DU[_local11] == 0)))) {
_local11--;
};
if (_local11 == 0){
writeBits(_local6);
return (_arg3);
};
_local8 = 1;
while (_local8 <= _local11) {
_local12 = _local8;
while ((((DU[_local8] == 0)) && ((_local8 <= _local11)))) {
_local8++;
};
_local13 = (_local8 - _local12);
if (_local13 >= 16){
_local14 = 1;
while (_local14 <= (_local13 / 16)) {
writeBits(_local7);
_local14++;
};
_local13 = int((_local13 & 15));
};
writeBits(_arg5[((_local13 * 16) + category[(32767 + DU[_local8])])]);
writeBits(bitcode[(32767 + DU[_local8])]);
_local8++;
};
if (_local11 != 63){
writeBits(_local6);
};
return (_arg3);
}
private function initQuantTables(_arg1:int):void{
var _local2:int;
var _local3:Number;
var _local8:int;
var _local4:Array = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local4[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
YTable[ZigZag[_local2]] = _local3;
_local2++;
};
var _local5:Array = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local5[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
UVTable[ZigZag[_local2]] = _local3;
_local2++;
};
var _local6:Array = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379];
_local2 = 0;
var _local7:int;
while (_local7 < 8) {
_local8 = 0;
while (_local8 < 8) {
fdtbl_Y[_local2] = (1 / (((YTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
fdtbl_UV[_local2] = (1 / (((UVTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
_local2++;
_local8++;
};
_local7++;
};
}
private function writeSOF0(_arg1:int, _arg2:int):void{
writeWord(65472);
writeWord(17);
writeByte(8);
writeWord(_arg2);
writeWord(_arg1);
writeByte(3);
writeByte(1);
writeByte(17);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(1);
writeByte(3);
writeByte(17);
writeByte(1);
}
private function computeHuffmanTbl(_arg1:Array, _arg2:Array):Array{
var _local7:int;
var _local3:int;
var _local4:int;
var _local5:Array = new Array();
var _local6 = 1;
while (_local6 <= 16) {
_local7 = 1;
while (_local7 <= _arg1[_local6]) {
_local5[_arg2[_local4]] = new BitString();
_local5[_arg2[_local4]].val = _local3;
_local5[_arg2[_local4]].len = _local6;
_local4++;
_local3++;
_local7++;
};
_local3 = (_local3 * 2);
_local6++;
};
return (_local5);
}
private function fDCTQuant(_arg1:Array, _arg2:Array):Array{
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;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:int;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 7)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 7)]);
_local4 = (_arg1[(_local23 + 1)] + _arg1[(_local23 + 6)]);
_local9 = (_arg1[(_local23 + 1)] - _arg1[(_local23 + 6)]);
_local5 = (_arg1[(_local23 + 2)] + _arg1[(_local23 + 5)]);
_local8 = (_arg1[(_local23 + 2)] - _arg1[(_local23 + 5)]);
_local6 = (_arg1[(_local23 + 3)] + _arg1[(_local23 + 4)]);
_local7 = (_arg1[(_local23 + 3)] - _arg1[(_local23 + 4)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 4)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 2)] = (_local14 + _local15);
_arg1[(_local23 + 6)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 5)] = (_local21 + _local16);
_arg1[(_local23 + 3)] = (_local21 - _local16);
_arg1[(_local23 + 1)] = (_local20 + _local18);
_arg1[(_local23 + 7)] = (_local20 - _local18);
_local23 = (_local23 + 8);
_local22++;
};
_local23 = 0;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 56)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 56)]);
_local4 = (_arg1[(_local23 + 8)] + _arg1[(_local23 + 48)]);
_local9 = (_arg1[(_local23 + 8)] - _arg1[(_local23 + 48)]);
_local5 = (_arg1[(_local23 + 16)] + _arg1[(_local23 + 40)]);
_local8 = (_arg1[(_local23 + 16)] - _arg1[(_local23 + 40)]);
_local6 = (_arg1[(_local23 + 24)] + _arg1[(_local23 + 32)]);
_local7 = (_arg1[(_local23 + 24)] - _arg1[(_local23 + 32)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 32)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 16)] = (_local14 + _local15);
_arg1[(_local23 + 48)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 40)] = (_local21 + _local16);
_arg1[(_local23 + 24)] = (_local21 - _local16);
_arg1[(_local23 + 8)] = (_local20 + _local18);
_arg1[(_local23 + 56)] = (_local20 - _local18);
_local23++;
_local22++;
};
_local22 = 0;
while (_local22 < 64) {
_arg1[_local22] = Math.round((_arg1[_local22] * _arg2[_local22]));
_local22++;
};
return (_arg1);
}
}
}//package com.adobe.images
Section 77
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function isEmpty():Boolean{
return (_empty);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 78
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
}
}//package com.google.analytics.campaign
Section 79
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local4:CampaignTracker;
var _local8:CampaignTracker;
var _local9:int;
var _local3:CampaignInfo = new CampaignInfo();
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
var _local3:Variables = new Variables(_arg1);
var _local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker = getOrganicCampaign();
var _local3:CampaignTracker = new CampaignTracker();
var _local4:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
var _local5:Variables = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3:String = _local2.hostName;
var _local4:String = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 80
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){
this.id = _arg1;
this.source = _arg2;
this.clickId = _arg3;
this.name = _arg4;
this.medium = _arg5;
this.term = _arg6;
this.content = _arg7;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var _local1:Array = [];
_addIfNotEmpty(_local1, "utmcsr=", source);
_addIfNotEmpty(_local1, "utmccn=", name);
_addIfNotEmpty(_local1, "utmcmd=", medium);
_addIfNotEmpty(_local1, "utmctr=", term);
_addIfNotEmpty(_local1, "utmcct=", content);
_addIfNotEmpty(_local1, "utmcid=", id);
_addIfNotEmpty(_local1, "utmgclid=", clickId);
return (_local1.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{
if (_arg3 != ""){
_arg3 = _arg3.split("+").join("%20");
_arg3 = _arg3.split(" ").join("%20");
_arg1.push((_arg2 + _arg3));
};
}
public function fromTrackerString(_arg1:String):void{
var _local2:String = _arg1.split(CampaignManager.trackingDelimiter).join("&");
var _local3:Variables = new Variables(_local2);
if (_local3.hasOwnProperty("utmcid")){
this.id = _local3["utmcid"];
};
if (_local3.hasOwnProperty("utmcsr")){
this.source = _local3["utmcsr"];
};
if (_local3.hasOwnProperty("utmccn")){
this.name = _local3["utmccn"];
};
if (_local3.hasOwnProperty("utmcmd")){
this.medium = _local3["utmcmd"];
};
if (_local3.hasOwnProperty("utmctr")){
this.term = _local3["utmctr"];
};
if (_local3.hasOwnProperty("utmcct")){
this.content = _local3["utmcct"];
};
if (_local3.hasOwnProperty("utmgclid")){
this.clickId = _local3["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 81
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 82
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import flash.net.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _OBJ:Object;
private var _utma:UTMA;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){
var _local5:Boolean;
var _local6:String;
super();
_config = _arg1;
_debug = _arg2;
UTMB.defaultTimespan = _config.sessionTimeout;
UTMZ.defaultTimespan = _config.conversionTimeout;
if (!_arg3){
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
_local5 = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
_local5 = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
_local5 = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
_local5 = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
_local5 = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
_local5 = true;
};
};
if (_local5){
save();
};
} else {
_OBJ = new Object();
if (_arg4){
for (_local6 in _arg4) {
_OBJ[_local6] = _arg4[_local6];
};
};
};
_volatile = _arg3;
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
try {
flushStatus = _SO.flush();
} catch(e:Error) {
_debug.warning("Error...Could not write SharedObject to disk");
};
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function generateCookiesHash():Number{
var _local1 = "";
_local1 = (_local1 + utma.valueOf());
_local1 = (_local1 + utmb.valueOf());
_local1 = (_local1 + utmc.valueOf());
_local1 = (_local1 + utmz.valueOf());
_local1 = (_local1 + utmv.valueOf());
return (Utils.generateHash(_local1));
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _onFlushStatus(_arg1:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(_arg1:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = _arg1;
};
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(_arg1:String, _arg2):void{
if (isVolatile()){
_OBJ[_arg1] = _arg2;
} else {
_SO.data[_arg1] = _arg2;
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 83
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
public class DocumentInfo {
private var _pageURL:String;
private var _utmr:String;
private var _config:Configuration;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String = _info.locationPath;
var _local3:String = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 84
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){
_debug = _arg3;
if (_arg1 == null){
_arg1 = DomainNameMode.auto;
};
_mode = _arg1;
if (_arg1 == DomainNameMode.custom){
this.name = _arg2;
} else {
_name = _arg2;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(_arg1:DomainNameMode):void{
_mode = _arg1;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(_arg1:String):void{
if (((!((_arg1.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek);
};
_name = _arg1;
}
}
}//package com.google.analytics.core
Section 85
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 86
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.data.*;
import com.google.analytics.utils.*;
public class EventInfo {
private var _ext10:X10;
private var _isEventHit:Boolean;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 87
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 88
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 89
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_info = _arg4;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(_arg1:IOErrorEvent):void{
var _local2:String = _lastRequest.url;
var _local3:String = String((_requests.length - 1));
var _local4 = (("Gif Request #" + _local3) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local2.indexOf("?") > -1){
_local2 = _local2.split("?")[0];
};
_local2 = _shortenURL(_local2);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable"));
};
_debug.failure(_local4);
} else {
_debug.warning(_local4);
};
_removeListeners(_arg1.target);
}
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:String;
var _local6:URLRequest;
var _local7:URLRequest;
_utmac = _arg1;
if (!_arg2){
_arg2 = new Variables();
};
_arg2.URIencode = false;
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
_arg2.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){
if (_arg4){
updateToken();
};
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){
if (((!(_arg3)) && (_arg4))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
_arg2.utmwv = utmwv;
_arg2.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
_arg2.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
_arg2.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
_local5 = _info.locationSWFPath;
if (_local5.lastIndexOf("/") > 0){
_local5 = _local5.substring(0, _local5.lastIndexOf("/"));
};
_local6 = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
_local6.url = _config.localGIFpath;
} else {
_local6.url = (_local5 + _config.localGIFpath);
};
_local6.url = (_local6.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local6);
} else {
sendRequest(_local6);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
_local7 = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
_local7.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
_local7.url = _config.remoteGIFpath;
} else {
_local7.url = _config.remoteGIFpath;
};
};
_arg2.utmac = utmac;
_arg2.utmcc = encodeURIComponent(utmcc);
_local7.url = (_local7.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local7);
} else {
sendRequest(_local7);
};
};
};
};
}
public function onSecurityError(_arg1:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(_arg1.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var _local1:Array = [];
if (_buffer.hasUTMA()){
_local1.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
_local1.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
_local1.push((_buffer.utmv.toURLString() + ";"));
};
return (_local1.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(_arg1:URLRequest):void{
var request = _arg1;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
try {
loader.load(request, context);
} catch(e:Error) {
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
};
}
private function _removeListeners(_arg1:Object):void{
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_arg1.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var _local2:Number;
var _local1:Number = new Date().getTime();
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek);
};
if (_local2 >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity);
_buffer.utmb.lastTime = _local1;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(_arg1:String):String{
var _local2:Array;
if (_arg1.length > 60){
_local2 = _arg1.split("/");
while (_arg1.length > 60) {
_local2.shift();
_arg1 = ("../" + _local2.join("/"));
};
};
return (_arg1);
}
private function _debugSend(_arg1:URLRequest):void{
var _local3:String;
var _local2 = "";
switch (_debug.mode){
case VisualDebugMode.geek:
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url);
break;
case VisualDebugMode.advanced:
_local3 = _arg1.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(_local2, _arg1, this);
_alertcount++;
}
public function onComplete(_arg1:Event):void{
var _local2:String = _arg1.target.loader.name;
_requests[_local2].complete();
var _local3 = (("Gif Request #" + _local2) + " sent");
var _local4:String = _requests[_local2].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local4.indexOf("?") > -1){
_local4 = _local4.split("?")[0];
};
_local4 = _shortenURL(_local4);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local3 = (_local3 + ((" to \"" + _local4) + "\""));
};
_debug.success(_local3);
} else {
_debug.info(_local3);
};
_removeListeners(_arg1.target);
}
}
}//package com.google.analytics.core
Section 90
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.utils.*;
public class IdleTimer {
private var _stage:Stage;
private var _loop:Timer;
private var _lastMove:int;
private var _inactivity:Number;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number = _arg1.idleLoop;
var _local6:Number = _arg1.idleTimeout;
var _local7:Number = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 91
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get count():int{
return (_sources.length);
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 92
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 93
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var end:int;
public var request:URLRequest;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var _local1:Array = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function complete():void{
end = getTimer();
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
}
}//package com.google.analytics.core
Section 94
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 95
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){
this.tracker = _arg1;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:int;
if (tracker == null){
return;
};
if (size() > 0){
_local4 = _ar.length;
while (_local5 < _local4) {
_local1 = _ar.shift();
_local2 = (_local1.name as String);
_local3 = (_local1.args as Array);
if (((!((_local2 == null))) && ((_local2 in tracker)))){
(tracker[_local2] as Function).apply(tracker, _local3);
};
_local5++;
};
};
}
public function enqueue(_arg1:String, ... _args):Boolean{
if (_arg1 == null){
return (false);
};
_ar.push({name:_arg1, args:_args});
return (true);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
enqueue("link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
enqueue("addOrganic", _arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
enqueue("setAllowLinker", _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4);
return (true);
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(_arg1:String=""):void{
enqueue("trackPageview", _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
enqueue("setClientInfo", _arg1);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
enqueue("linkByPost", _arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
enqueue("setCookieTimeout", _arg1);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(_arg1:Boolean):void{
enqueue("setDetectFlash", _arg1);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(_arg1:String):void{
enqueue("setCampNameKey", _arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function createEventTracker(_arg1:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function setVar(_arg1:String):void{
enqueue("setVar", _arg1);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setDomainName(_arg1:String):void{
enqueue("setDomainName", _arg1);
}
public function setCampSourceKey(_arg1:String):void{
enqueue("setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
return (null);
}
public function setCampContentKey(_arg1:String):void{
enqueue("setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(_arg1:Boolean):void{
enqueue("setAllowAnchor", _arg1);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(_arg1:String):void{
enqueue("setLocalGifPath", _arg1);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(_arg1:String):void{
enqueue("setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
enqueue("setSampleRate", _arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
enqueue("setDetectTitle", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
enqueue("setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
enqueue("addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
enqueue("setCampNOKey", _arg1);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(_arg1:String):void{
enqueue("cookiePathCopy", _arg1);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(_arg1:Boolean):void{
enqueue("setCampaignTrack", _arg1);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
enqueue("setCampTermKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
enqueue("addIgnoredRef", _arg1);
}
public function setCampMediumKey(_arg1:String):void{
enqueue("setCampMediumKey", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
enqueue("setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 96
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 97
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
var _local3:Array = [" ", "\n", "\r", "\t"];
var _local4:String = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local4:int;
var _local5:int;
var _local2 = 1;
var _local3:int;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 98
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(_arg1:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(_arg1:Date):void;
function set expiration(_arg1:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 99
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.sessionId = _arg2;
this.firstTime = _arg3;
this.lastTime = _arg4;
this.currentTime = _arg5;
this.sessionCount = _arg6;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function set currentTime(_arg1:Number):void{
_currentTime = _arg1;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set sessionId(_arg1:Number):void{
_sessionId = _arg1;
update();
}
public function set sessionCount(_arg1:Number):void{
_sessionCount = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(_arg1:Number):void{
_firstTime = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 100
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.trackCount = _arg2;
this.token = _arg3;
this.lastTime = _arg4;
}
public function set token(_arg1:Number):void{
_token = _arg1;
update();
}
public function set trackCount(_arg1:Number):void{
_trackCount = _arg1;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 101
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 102
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
protected var fields:Array;
private var _timespan:Number;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local2:String;
var _local1:int;
var _local3:int;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var _local1:String;
var _local2:int;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int = fields.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date = new Date();
var _local2:Number = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var _local2:String;
var _local3:*;
var _local1:Array = [];
var _local4:int;
while (_local4 < fields.length) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local4++;
};
return (("" + _local1.join(".")));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toSharedObject():Object{
var _local2:String;
var _local3:*;
var _local1:Object = {};
var _local4:int;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local3:String;
var _local4:*;
var _local2:Array = [];
var _local5:int = fields.length;
var _local6:int;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
var _local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 103
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(_arg1:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = _arg1;
}
public function set hash(_arg1:Number):void{
_hash = _arg1;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 104
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(_arg1:Number=NaN, _arg2:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.value = _arg2;
}
override public function toURLString():String{
return (((inURL + "=") + encodeURI(valueOf())));
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set value(_arg1:String):void{
_value = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 105
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.campaignCreation = _arg2;
this.campaignSessions = _arg3;
this.responseCount = _arg4;
this.campaignTracking = _arg5;
}
public function set responseCount(_arg1:Number):void{
_responseCount = _arg1;
update();
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set campaignCreation(_arg1:Number):void{
_campaignCreation = _arg1;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(_arg1:Number):void{
_campaignSessions = _arg1;
update();
}
public function set campaignTracking(_arg1:String):void{
_campaignTracking = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 106
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _minimum:int;
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _projectData:Object;
private var _value:String;// = "v"
public function X10(){
_set = [_key, _value];
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
private function _renderProject(_arg1:Object):String{
var _local4:int;
var _local5:Array;
var _local2 = "";
var _local3:Boolean;
var _local6:int = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local3:String;
var _local4:int;
var _local2:Array = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
var _local2:Array = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local2:String;
var _local1:Array = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:* = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local3:int;
var _local4:String;
var _local5:String;
var _local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 107
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.text.*;
import flash.net.*;
public class _Style {
public var failureColor:uint;
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var warningColor:uint;
public var infoColor:uint;
public var alertColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
private var _defaultSheet:String;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 108
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var autoClose:Boolean;// = true
public var actionOnNextLine:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
var _local8:int;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
private function _defineActions():void{
var _local3:AlertAction;
var _local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
var _local2:Array = [];
var _local4:int;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
protected function spaces(_arg1:int):String{
var _local2 = "";
var _local3 = " ";
var _local4:int;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 109
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var activator:String;
public var name:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 110
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 111
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 112
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint = 0;
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){
if (_arg2 == null){
_arg2 = Align.bottom;
};
super("", "uiLabel", _arg1, _arg2, _arg3);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(_arg1:String):void{
write(_arg1, true);
}
private function _getLinesToDisplay(_arg1:int=0):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + _arg1);
} else {
if ((((_linediff > 0)) && ((_arg1 < 0)))){
_linediff = (_linediff + _arg1);
};
};
_local3 = ((_lines.length - maxLines) + _linediff);
_local4 = (_local3 + maxLines);
_local2 = _lines.slice(_local3, _local4);
} else {
_local2 = _lines;
};
return (_local2);
}
private function onKey(_arg1:KeyboardEvent=null):void{
var _local2:Array;
switch (_arg1.keyCode){
case Keyboard.DOWN:
_local2 = _getLinesToDisplay(1);
break;
case Keyboard.UP:
_local2 = _getLinesToDisplay(-1);
break;
default:
_local2 = null;
};
if (_local2 == null){
return;
};
text = _local2.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
//unresolved jump
};
return (super.forcedWidth);
}
public function write(_arg1:String, _arg2:Boolean=false):void{
var _local3:Array;
if (_arg1.indexOf("") > -1){
_local3 = _arg1.split("\n");
} else {
_local3 = [_arg1];
};
var _local4 = "";
var _local5 = "";
if (_arg2){
_local4 = "<b>";
_local5 = "</b>";
};
var _local6:int;
while (_local6 < _local3.length) {
_lines.push(((_local4 + _local3[_local6]) + _local5));
_local6++;
};
var _local7:Array = _getLinesToDisplay();
text = _local7.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 113
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import flash.net.*;
import com.google.analytics.core.*;
import flash.utils.*;
import flash.ui.*;
public class DebugConfiguration {
public var showHideKey:Number;
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
showHideKey = Keyboard.SPACE;
destroyKey = Keyboard.BACKSPACE;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(_arg1:Boolean):void{
_verbose = _arg1;
}
public function set mode(_arg1):void{
if ((_arg1 is String)){
switch (_arg1){
case "geek":
_arg1 = VisualDebugMode.geek;
break;
case "advanced":
_arg1 = VisualDebugMode.advanced;
break;
case "basic":
default:
_arg1 = VisualDebugMode.basic;
};
};
_mode = _arg1;
}
public function success(_arg1:String):void{
if (layout){
layout.createSuccessAlert(_arg1);
};
if (traceOutput){
trace((("[+] " + _arg1) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(_arg1);
};
if (traceOutput){
trace((("## " + _arg1) + " ##"));
};
}
private function _filter(_arg1:VisualDebugMode=null):Boolean{
return (((_arg1) && ((int(_arg1) >= int(this.mode)))));
}
public function failure(_arg1:String):void{
if (layout){
layout.createFailureAlert(_arg1);
};
if (traceOutput){
trace((("[-] " + _arg1) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(_arg1:String):void{
var _local7:Array;
var _local8:int;
var _local2:Array = [];
var _local3 = "";
var _local4 = "";
if (this.mode == VisualDebugMode.geek){
_local3 = (getTimer() + " - ");
_local4 = (new Array(_local3.length).join(" ") + " ");
};
if (_arg1.indexOf("\n") > -1){
_local7 = _arg1.split("\n");
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] == ""){
} else {
if (_local8 == 0){
_local2.push((_local3 + _local7[_local8]));
} else {
_local2.push((_local4 + _local7[_local8]));
};
};
_local8++;
};
} else {
_local2.push((_local3 + _arg1));
};
var _local5:int = _local2.length;
var _local6:int;
while (_local6 < _local5) {
trace(_local2[_local6]);
_local6++;
};
}
public function alert(_arg1:String):void{
if (layout){
layout.createAlert(_arg1);
};
if (traceOutput){
trace((("!! " + _arg1) + " !!"));
};
}
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(_arg1);
};
if (traceOutput){
trace(_arg1);
};
}
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(_arg1, _arg2, _arg3);
};
if (traceOutput){
trace(((">> " + _arg1) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 114
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 115
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 116
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import flash.net.*;
import com.google.analytics.core.*;
public interface ILayout {
function createAlert(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(_arg1:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 117
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 118
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = _arg1;
_tag = _arg2;
if (_arg4 == null){
_arg4 = Align.none;
};
this.alignement = _arg4;
this.stickToEdge = _arg5;
if (_arg3 == 0){
_arg3 = Style.backgroundColor;
};
_color = _arg3;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var _local1:Graphics = _background.graphics;
_local1.clear();
_local1.beginFill(_color);
var _local2:uint = _textField.width;
var _local3:uint = _textField.height;
if (forcedWidth > 0){
_local2 = forcedWidth;
};
Background.drawRounded(this, _local1, _local2, _local3);
_local1.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(_arg1:String, _arg2:String=""):void{
if (_arg1 == ""){
return;
};
if (_arg2 == ""){
_arg2 = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>"));
_text = (_text + _arg1);
_draw();
resize();
}
public function set text(_arg1:String):void{
if (_arg1 == ""){
_arg1 = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>");
_text = _arg1;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(_arg1:String):void{
_tag = _arg1;
text = "";
}
public function onLink(_arg1:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 119
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import com.google.analytics.core.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){
_display = _arg2;
_debug = _arg1;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(_arg1:KeyboardEvent=null):void{
switch (_arg1.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(_arg1:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasWarning = true;
var _local2:Warning = new Warning(_arg1, _debug.warningTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function bringToFront(_arg1:DisplayObject):void{
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1));
}
public function createFailureAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new FailureAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function init():void{
var _local1 = 10;
var _local2:uint = (_display.stage.stageWidth - (_local1 * 2));
var _local3:uint = (_display.stage.stageHeight - (_local1 * 2));
var _local4:Panel = new Panel("analytics", _local2, _local3);
_local4.alignement = Align.top;
_local4.stickToEdge = false;
_local4.title = ("Google Analytics v" + GATracker.version);
_mainPanel = _local4;
addToStage(_local4);
bringToFront(_local4);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{
var _local4:Panel;
var _local3:DisplayObject = _display.stage.getChildByName(_arg1);
if (_local3){
_local4 = (_local3 as Panel);
_local4.addData(_arg2);
} else {
trace((("panel \"" + _arg1) + "\" not found"));
};
}
private function _clearInfo(_arg1:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{
var _local6:String;
var _local3 = "\n";
var _local4:Array = [];
var _local5:Array = _arg1.split(_local3);
if (_arg2 == 0){
_arg2 = _maxCharPerLine;
};
var _local7:int;
while (_local7 < _local5.length) {
_local6 = _local5[_local7];
while (_local6.length > _arg2) {
_local4.push(_local6.substr(0, _arg2));
_local6 = _local6.substring(_arg2);
};
_local4.push(_local6);
_local7++;
};
return (_local4.join(_local3));
}
private function _clearGRAlert(_arg1:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new SuccessAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(_arg1:String):void{
_arg1 = _filterMaxChars(_arg1);
var _local2:Alert = new Alert(_arg1, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", _local2);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function createInfo(_arg1:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasInfo = true;
var _local2:Info = new Info(_arg1, _debug.infoTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(_arg1);
};
}
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
var message = _arg1;
var request = _arg2;
var ref = _arg3;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(_arg1:DisplayObject):void{
_display.stage.addChild(_arg1);
}
private function _clearWarning(_arg1:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{
var _local4:Panel = new Panel(_arg1, _arg2, _arg3);
_local4.alignement = Align.center;
_local4.stickToEdge = false;
addToStage(_local4);
bringToFront(_local4);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 120
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var top:int;
public var left:int;
public var bottom:int;
public var right:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 121
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){
_name = _arg1;
this.name = _arg1;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = _arg2;
forcedHeight = _arg3;
this.baseAlpha = _arg6;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = _arg2;
_data.forcedHeight = _arg3;
_data.mouseEnabled = false;
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (_arg7 == null){
_arg7 = Align.none;
};
this.alignement = _arg7;
this.stickToEdge = _arg8;
if (_arg4 == 0){
_arg4 = Style.backgroundColor;
};
_backgroundColor = _arg4;
if (_arg5 == 0){
_arg5 = Style.borderColor;
};
_borderColor = _arg5;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(_arg1:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(_arg1:Boolean):void{
_stickToEdge = _arg1;
_title.stickToEdge = _arg1;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var _local1:uint;
var _local2:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
_local1 = forcedWidth;
_local2 = forcedHeight;
} else {
_local1 = _title.width;
_local2 = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = _local1;
forcedHeight = _local2;
};
var _local3:Graphics = _background.graphics;
_local3.clear();
_local3.beginFill(_backgroundColor);
Background.drawRounded(this, _local3, _local1, _local2);
_local3.endFill();
var _local4:Graphics = _data.graphics;
_local4.clear();
_local4.beginFill(_backgroundColor, 0);
Background.drawRounded(this, _local4, _local1, _local2);
_local4.endFill();
var _local5:Graphics = _border.graphics;
_local5.clear();
_local5.lineStyle(0.1, _borderColor);
Background.drawRounded(this, _local5, _local1, _local2);
_local5.endFill();
var _local6:Graphics = _mask.graphics;
_local6.clear();
_local6.beginFill(_backgroundColor);
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1));
_local6.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(_arg1:DisplayObject):void{
_data.addChild(_arg1);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(_arg1:String):void{
_title.text = _arg1;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 122
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 123
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 124
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class UISprite extends Sprite {
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedHeight:uint;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
protected function onResize(_arg1:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 125
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 126
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 127
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 128
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 129
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _language:String;
private var _host:String;
private var _pathname:String;
private var _location:String;
private var _search:String;
private var _characterSet:String;
private var _title:String;
private var _protocol:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function cacheProperties():void{
if (!isAvailable()){
return;
};
var _local1:Object = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
}
}//package com.google.analytics.external
Section 130
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.system.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 131
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
var _local2:String = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local4:String;
var _local5:String;
var _local1:Protocols = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _local2:String = _dom.protocol;
var _local3:String = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String = _dom.language;
var _local2:String = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 132
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 133
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
}
}//package com.google.analytics.utils
Section 134
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(_arg1:String=""){
_url = _arg1.toLowerCase();
}
public function get domain():String{
var _local1:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
_local1 = hostName.split(".");
switch (_local1.length){
case 2:
return (hostName);
case 3:
if (_local1[1] == "co"){
return (hostName);
};
_local1.shift();
return (_local1.join("."));
case 4:
_local1.shift();
return (_local1.join("."));
};
};
return ("");
}
public function get path():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if (_local1.charAt(0) != "/"){
_local1 = ("/" + _local1);
};
return (_local1);
}
public function get protocol():Protocols{
var _local1:String = _url.split("://")[0];
switch (_local1){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf("/") > -1){
_local1 = _local1.split("/")[0];
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (_local1);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[1];
} else {
_local1 = "";
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 135
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _localInfo:Environment;
private var _applicationProduct:String;
private var _version:Version;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get vendorProductToken():String{
var _local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProductToken():String{
var _local1:String = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 136
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){
pre = [];
post = [];
super();
if (_arg1){
decode(_arg1);
};
if (_arg2){
this.pre = _arg2;
};
if (_arg3){
this.post = _arg3;
};
}
private function _join(_arg1:Variables):void{
var _local2:String;
if (!_arg1){
return;
};
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function join(... _args):void{
var _local2:int = _args.length;
var _local3:int;
while (_local3 < _local2) {
if (!(_args[_local3] is Variables)){
} else {
_join(_args[_local3]);
};
_local3++;
};
}
public function toString():String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local1:Array = [];
for (_local3 in this) {
_local2 = this[_local3];
if (URIencode){
_local2 = encodeURI(_local2);
};
_local1.push(((_local3 + "=") + _local2));
};
if (sort){
_local1.sort();
};
if (pre.length > 0){
pre.reverse();
_local5 = 0;
while (_local5 < pre.length) {
_local7 = pre[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local7) == 0){
_local1.unshift(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
pre.reverse();
};
if (post.length > 0){
_local5 = 0;
while (_local5 < post.length) {
_local8 = post[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local8) == 0){
_local1.push(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
};
return (_local1.join("&"));
}
public function decode(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Array;
if (_arg1 == ""){
return;
};
if (_arg1.indexOf("&") > -1){
_local2 = _arg1.split("&");
} else {
_local2 = [_arg1];
};
var _local7:int;
while (_local7 < _local2.length) {
_local3 = _local2[_local7];
if (_local3.indexOf("=") > -1){
_local6 = _local3.split("=");
_local4 = _local6[0];
_local5 = decodeURI(_local6[1]);
this[_local4] = _local5;
};
_local7++;
};
}
public function toURLVariables():URLVariables{
var _local2:String;
var _local1:URLVariables = new URLVariables();
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 137
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _revision:uint;
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _major:uint;
private var _minor:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var _local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local4:Array;
var _local3:Version = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 138
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){
var _local4:String;
var _local5:String;
var _local6:String;
super();
_account = _arg1;
_debug = _arg2;
_proxy = _arg3;
if (!_checkGAJS()){
_local4 = "";
_local4 = (_local4 + "ga.js not found, be sure to check if\n");
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
_local4 = (_local4 + "is included in the HTML.");
_debug.warning(_local4);
throw (new Error(_local4));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
_local5 = "";
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n");
_local5 = (_local5 + "we create it");
_debug.info(_local5, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(_arg1)){
_createTrackingObject(_arg1);
} else {
if (_checkTrackingObject(_arg1)){
_linkTrackingObject(_arg1);
} else {
_local6 = "";
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n"));
_local6 = (_local6 + "Bridge object not created.");
_debug.warning(_local6);
throw (new Error(_local6));
};
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )"));
_call("_link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_call("_addOrganic", _arg1);
}
public function setAllowLinker(_arg1:Boolean):void{
_debug.info((("setAllowLinker( " + _arg1) + " )"));
_call("_setAllowLinker", _arg1);
}
private function _linkTrackingObject(_arg1:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5 = 2;
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = 3;
};
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){
_local5 = 4;
};
switch (_local5){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4));
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3));
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2));
};
}
public function setClientInfo(_arg1:Boolean):void{
_debug.info((("setClientInfo( " + _arg1) + " )"));
_call("_setClientInfo", _arg1);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function setCookieTimeout(_arg1:int):void{
_debug.info((("setCookieTimeout( " + _arg1) + " )"));
_call("_setCookieTimeout", _arg1);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
_call("_trackPageview", _arg1);
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _checkValidTrackingObject(_arg1:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, _arg1));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented"));
}
private function _call(_arg1:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(_arg1:String):Boolean{
var _local2:Boolean = _proxy.hasProperty(_arg1);
var _local3:Boolean = _proxy.hasProperty((_arg1 + "._getAccount"));
return (((_local2) && (_local3)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(_arg1:String):void{
_debug.info((("setCampNameKey( " + _arg1) + " )"));
_call("_setCampNameKey", _arg1);
}
public function setDetectFlash(_arg1:Boolean):void{
_debug.info((("setDetectFlash( " + _arg1) + " )"));
_call("_setDetectFlash", _arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(_arg1:String):void{
_debug.info((("setVar( " + _arg1) + " )"));
_call("_setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
_debug.info((("setDomainName( " + _arg1) + " )"));
_call("_setDomainName", _arg1);
}
public function hasTrackingAccount(_arg1:String):Boolean{
if (Utils.validateAccount(_arg1)){
return (_checkValidTrackingObject(_arg1));
};
return (_checkTrackingObject(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_debug.info((("setCampSourceKey( " + _arg1) + " )"));
_call("_setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )"));
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
return (null);
}
public function setCampContentKey(_arg1:String):void{
_debug.info((("setCampContentKey( " + _arg1) + " )"));
_call("_setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(_arg1:Boolean):void{
_debug.info((("setAllowAnchor( " + _arg1) + " )"));
_call("_setAllowAnchor", _arg1);
}
public function setLocalGifPath(_arg1:String):void{
_debug.info((("setLocalGifPath( " + _arg1) + " )"));
_call("_setLocalGifPath", _arg1);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(_arg1:String):void{
_debug.info((("setCookiePath( " + _arg1) + " )"));
_call("_setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
_debug.info((("setSampleRate( " + _arg1) + " )"));
_call("_setSampleRate", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_debug.info((("setAllowHash( " + _arg1) + " )"));
_call("_setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_call("_addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
_debug.info((("setCampNOKey( " + _arg1) + " )"));
_call("_setCampNOKey", _arg1);
}
public function cookiePathCopy(_arg1:String):void{
_debug.info((("cookiePathCopy( " + _arg1) + " )"));
_call("_cookiePathCopy", _arg1);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(_arg1:Boolean):void{
_debug.info((("setDetectTitle( " + _arg1) + " )"));
_call("_setDetectTitle", _arg1);
}
private function _createTrackingObject(_arg1:String):void{
_proxy.call(_createTrackingObject_js, _arg1);
}
public function setCampaignTrack(_arg1:Boolean):void{
_debug.info((("setCampaignTrack( " + _arg1) + " )"));
_call("_setCampaignTrack", _arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
_debug.info((("setCampTermKey( " + _arg1) + " )"));
_call("_setCampTermKey", _arg1);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(_arg1:String):void{
_debug.info((("setCampMediumKey( " + _arg1) + " )"));
_call("_setCampMediumKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_call("_addIgnoredRef", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
_debug.info((("setSessionTimeout( " + _arg1) + " )"));
_call("_setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 139
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var hasSiteOverlay:Boolean;// = false
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
public var allowAnchor:Boolean;// = false
private var _domain:Domain;
private var _trackingLimitPerSession:int;// = 500
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get cookieName():String{
return (_cookieName);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 140
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(_arg1:String):void;
function getServiceMode():ServerOperationMode;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(_arg1:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(_arg1:Boolean):void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(_arg1:String):void;
function setCampNameKey(_arg1:String):void;
function addIgnoredOrganic(_arg1:String):void;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function setAllowLinker(_arg1:Boolean):void;
function getClientInfo():Boolean;
function getDetectFlash():Boolean;
function setCampaignTrack(_arg1:Boolean):void;
function createEventTracker(_arg1:String):EventTracker;
function setCookieTimeout(_arg1:int):void;
function setAllowAnchor(_arg1:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(_arg1:String=""):void;
function setLocalGifPath(_arg1:String):void;
function getVersion():String;
function getLocalGifPath():String;
function setVar(_arg1:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(_arg1:String):void;
function addIgnoredRef(_arg1:String):void;
function setClientInfo(_arg1:Boolean):void;
function setCookiePath(_arg1:String):void;
function setSampleRate(_arg1:Number):void;
function setSessionTimeout(_arg1:int):void;
function setRemoteServerMode():void;
function clearIgnoredRef():void;
function setDomainName(_arg1:String):void;
function setDetectTitle(_arg1:Boolean):void;
function setAllowHash(_arg1:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(_arg1:String):void;
function setLocalRemoteServerMode():void;
function cookiePathCopy(_arg1:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 141
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.data.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _account:String;
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals){
var _local8:String;
super();
_account = _arg1;
_config = _arg2;
_debug = _arg3;
_info = _arg4;
_buffer = _arg5;
_gifRequest = _arg6;
_adSense = _arg7;
if (!Utils.validateAccount(_arg1)){
_local8 = (("Account \"" + _arg1) + "\" is not valid.");
_debug.warning(_local8);
throw (new Error(_local8));
};
_initData();
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_config.organic.addSource(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_config.allowLinker = _arg1;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5:Boolean;
var _local6 = 2;
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2);
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3);
_local6 = 3;
if (!isNaN(_arg4)){
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4);
_local6 = 4;
};
};
if (_local5){
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_local5 = false;
};
switch (_local6){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
};
return (_local5);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(_arg1);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + _arg1) + " ) failed"));
};
}
public function setCookieTimeout(_arg1:int):void{
_config.conversionTimeout = _arg1;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
_debug.warning("trackTrans() not implemented");
}
public function setClientInfo(_arg1:Boolean):void{
_config.detectClientInfo = _arg1;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((("linkByPost( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
private function _initData():void{
var _local1:String;
var _local2:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "_initData 0");
_local1 = (_local1 + ("\ndomain name: " + _config.domainName));
_local1 = (_local1 + ("\ndomain hash: " + _domainHash));
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "_initData (misc)");
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4)));
_local2 = (_local2 + ("\nprotocol: " + _info.protocol));
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
_local2 = (_local2 + ("\nlanguage: " + _info.language));
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash()));
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent));
_debug.info(_local2, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(_arg1:X10=null):void{
var _local2:Variables;
var _local3:EventInfo;
var _local4:Variables;
var _local5:Variables;
_initData();
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
_local3 = new EventInfo(true, _x10Module, _arg1);
_local4 = _local3.toVariables();
_local5 = _renderMetricsSearchVariables();
_local2.join(_local4, _local5);
_gifRequest.send(_account, _local2, false, true);
};
}
public function setDetectFlash(_arg1:Boolean):void{
_config.detectFlash = _arg1;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(_arg1:String):void{
_config.campaignKey.UCCN = _arg1;
var _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCN]"));
} else {
_debug.info(_local2);
};
}
private function _formatReferrer():String{
var _local2:String;
var _local3:URL;
var _local4:URL;
var _local1:String = _info.referrer;
if ((((_local1 == "")) || ((_local1 == "localhost")))){
_local1 = "-";
} else {
_local2 = _info.domainName;
_local3 = new URL(_local1);
_local4 = new URL(("http://" + _local2));
if (_local3.hostName == _local2){
return ("-");
};
if (_local4.domain == _local3.domain){
if (_local4.subDomain != _local3.subDomain){
_local1 = "0";
};
};
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){
_local1 = "-";
};
};
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced);
return (_local1);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.warning((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " ) not implemented"));
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(_arg1:String):void{
var _local2:Variables;
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = _arg1;
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + _arg1) + " )"));
if (_takeSample()){
_local2 = new Variables();
_local2.utmt = "var";
_gifRequest.send(_account, _local2);
};
} else {
_debug.warning((("setVar \"" + _arg1) + "\" is ignored"));
};
}
public function setDomainName(_arg1:String):void{
if (_arg1 == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (_arg1 == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = _arg1;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var _local1:String;
if (_config.domain.mode == DomainNameMode.auto){
_local1 = _info.domainName;
if (_local1.substring(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_config.domain.name = _local1;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.warning((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " ) not implemented"));
return (null);
}
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{
var _local4:Variables;
var _local2:Variables = new Variables();
_local2.URIencode = true;
var _local3:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense);
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
_local4 = _campaignInfo.toVariables();
};
var _local5:Variables = _browserInfo.toVariables();
_local2.join(_local3.toVariables(), _local5, _local4);
return (_local2);
}
public function setCampContentKey(_arg1:String):void{
_config.campaignKey.UCCT = _arg1;
var _local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCT]"));
} else {
_debug.info(_local2);
};
}
private function _handleCookie():void{
var _local1:String;
var _local2:String;
var _local3:Array;
var _local4:String;
if (_config.allowLinker){
};
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "AdSense sid found\n");
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "AdSense sid found (new visitor)\n");
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local2, VisualDebugMode.geek);
};
};
if (_adSense.vid){
_local3 = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(_local3[0]);
_buffer.utma.firstTime = Number(_local3[1]);
if (_debug.verbose){
_local4 = "";
_local4 = (_local4 + "AdSense vid found (new visitor)\n");
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n"));
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")"));
_debug.info(_local4, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(_arg1:String):void{
_config.campaignKey.UCSR = _arg1;
var _local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCSR]"));
} else {
_debug.info(_local2);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(_arg1:String):void{
_config.localGIFpath = _arg1;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(_arg1:Boolean):void{
_config.allowAnchor = _arg1;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var _local1:String = _config.domainName;
var _local2 = (_local1.indexOf("www.google.") < 0);
var _local3 = (_local1.indexOf(".google.") < 0);
var _local4 = (_local1.indexOf("google.") < 0);
var _local5 = (_local1.indexOf("google.org") > -1);
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5)));
}
public function setSampleRate(_arg1:Number):void{
if (_arg1 < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = _arg1;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(_arg1:String):void{
_config.cookiePath = _arg1;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(_arg1:Boolean):void{
_config.allowDomainHash = _arg1;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var _local1 = "";
_local1 = (_local1 + _info.appName);
_local1 = (_local1 + _info.appVersion);
_local1 = (_local1 + _info.language);
_local1 = (_local1 + _info.platform);
_local1 = (_local1 + _info.userAgent.toString());
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
_local1 = (_local1 + _info.referrer);
return (Utils.generateHash(_local1));
}
public function setCampNOKey(_arg1:String):void{
_config.campaignKey.UCNO = _arg1;
var _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCNO]"));
} else {
_debug.info(_local2);
};
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_config.organic.addIgnoredKeyword(_arg1);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(_arg1:String):void{
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented"));
}
public function setDetectTitle(_arg1:Boolean):void{
_config.detectTitle = _arg1;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(_arg1:String):void{
_config.campaignKey.UCTR = _arg1;
var _local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCTR]"));
} else {
_debug.info(_local2);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(_arg1:String=""):void{
var _local2:Variables;
var _local3:Variables;
var _local4:Variables;
var _local5:EventInfo;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
_local5 = new EventInfo(false, _x10Module);
_local3 = _local5.toVariables();
};
_local4 = _renderMetricsSearchVariables(_arg1);
_local2.join(_local3, _local4);
_gifRequest.send(_account, _local2);
};
}
public function setCampaignTrack(_arg1:Boolean):void{
_config.campaignTracking = _arg1;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_config.organic.addIgnoredReferral(_arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(_arg1:String):void{
_config.campaignKey.UCMD = _arg1;
var _local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCMD]"));
} else {
_debug.info(_local2);
};
}
private function _getUniqueSessionId():Number{
var _local1:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek);
return (_local1);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(_arg1:int):void{
_config.sessionTimeout = _arg1;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.warning((("link( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 142
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set account(_arg1:String):void;
function get config():Configuration;
function get mode():String;
function set config(_arg1:Configuration):void;
function set mode(_arg1:String):void;
function set debug(_arg1:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(_arg1:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 143
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 144
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
return (_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8));
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function isReady():Boolean{
return (_ready);
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var _local2:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense));
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 145
//ColorMatrix (com.gskinner.geom.ColorMatrix)
package com.gskinner.geom {
public dynamic class ColorMatrix extends Array {
private static const IDENTITY_MATRIX:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
private static const LENGTH:Number = IDENTITY_MATRIX.length;
private static const DELTA_INDEX:Array = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10];
public function ColorMatrix(_arg1:Array=null){
_arg1 = fixMatrix(_arg1);
copyMatrix(((_arg1.length)==LENGTH) ? _arg1 : IDENTITY_MATRIX);
}
public function adjustBrightness(_arg1:Number):void{
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
multiplyMatrix([1, 0, 0, 0, _arg1, 0, 1, 0, 0, _arg1, 0, 0, 1, 0, _arg1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustSaturation(_arg1:Number):void{
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
var _local2:Number = (1 + ((_arg1)>0) ? ((3 * _arg1) / 100) : (_arg1 / 100));
var _local3:Number = 0.3086;
var _local4:Number = 0.6094;
var _local5:Number = 0.082;
multiplyMatrix([((_local3 * (1 - _local2)) + _local2), (_local4 * (1 - _local2)), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), ((_local4 * (1 - _local2)) + _local2), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), (_local4 * (1 - _local2)), ((_local5 * (1 - _local2)) + _local2), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
protected function multiplyMatrix(_arg1:Array):void{
var _local4:uint;
var _local5:Number;
var _local6:Number;
var _local2:Array = [];
var _local3:uint;
while (_local3 < 5) {
_local4 = 0;
while (_local4 < 5) {
_local2[_local4] = this[(_local4 + (_local3 * 5))];
_local4++;
};
_local4 = 0;
while (_local4 < 5) {
_local5 = 0;
_local6 = 0;
while (_local6 < 5) {
_local5 = (_local5 + (_arg1[(_local4 + (_local6 * 5))] * _local2[_local6]));
_local6++;
};
this[(_local4 + (_local3 * 5))] = _local5;
_local4++;
};
_local3++;
};
}
protected function cleanValue(_arg1:Number, _arg2:Number):Number{
return (Math.min(_arg2, Math.max(-(_arg2), _arg1)));
}
public function adjustHue(_arg1:Number):void{
_arg1 = ((cleanValue(_arg1, 180) / 180) * Math.PI);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
var _local2:Number = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
var _local4:Number = 0.213;
var _local5:Number = 0.715;
var _local6:Number = 0.072;
multiplyMatrix([((_local4 + (_local2 * (1 - _local4))) + (_local3 * -(_local4))), ((_local5 + (_local2 * -(_local5))) + (_local3 * -(_local5))), ((_local6 + (_local2 * -(_local6))) + (_local3 * (1 - _local6))), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * 0.143)), ((_local5 + (_local2 * (1 - _local5))) + (_local3 * 0.14)), ((_local6 + (_local2 * -(_local6))) + (_local3 * -0.283)), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * -((1 - _local4)))), ((_local5 + (_local2 * -(_local5))) + (_local3 * _local5)), ((_local6 + (_local2 * (1 - _local6))) + (_local3 * _local6)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function toString():String{
return ((("ColorMatrix [ " + this.join(" , ")) + " ]"));
}
protected function fixMatrix(_arg1:Array=null):Array{
if (_arg1 == null){
return (IDENTITY_MATRIX);
};
if ((_arg1 is ColorMatrix)){
_arg1 = _arg1.slice(0);
};
if (_arg1.length < LENGTH){
_arg1 = _arg1.slice(0, _arg1.length).concat(IDENTITY_MATRIX.slice(_arg1.length, LENGTH));
} else {
if (_arg1.length > LENGTH){
_arg1 = _arg1.slice(0, LENGTH);
};
};
return (_arg1);
}
public function reset():void{
var _local1:uint;
while (_local1 < LENGTH) {
this[_local1] = IDENTITY_MATRIX[_local1];
_local1++;
};
}
public function adjustContrast(_arg1:Number):void{
var _local2:Number;
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
if (_arg1 < 0){
_local2 = (127 + ((_arg1 / 100) * 127));
} else {
_local2 = (_arg1 % 1);
if (_local2 == 0){
_local2 = DELTA_INDEX[_arg1];
} else {
_local2 = ((DELTA_INDEX[(_arg1 << 0)] * (1 - _local2)) + (DELTA_INDEX[((_arg1 << 0) + 1)] * _local2));
};
_local2 = ((_local2 * 127) + 127);
};
multiplyMatrix([(_local2 / 127), 0, 0, 0, (0.5 * (127 - _local2)), 0, (_local2 / 127), 0, 0, (0.5 * (127 - _local2)), 0, 0, (_local2 / 127), 0, (0.5 * (127 - _local2)), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustColor(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
adjustHue(_arg4);
adjustContrast(_arg2);
adjustBrightness(_arg1);
adjustSaturation(_arg3);
}
protected function copyMatrix(_arg1:Array):void{
var _local2:Number = LENGTH;
var _local3:uint;
while (_local3 < _local2) {
this[_local3] = _arg1[_local3];
_local3++;
};
}
public function concat(_arg1:Array):void{
_arg1 = fixMatrix(_arg1);
if (_arg1.length != LENGTH){
return;
};
multiplyMatrix(_arg1);
}
public function clone():ColorMatrix{
return (new ColorMatrix(this));
}
public function toArray():Array{
return (slice(0, 20));
}
}
}//package com.gskinner.geom
Section 146
//Rndm (com.gskinner.utils.Rndm)
package com.gskinner.utils {
public class Rndm {
protected var _currentSeed:uint;// = 0
protected var _seed:uint;// = 0
protected static var _instance:Rndm;
public function Rndm(_arg1:uint=1){
_seed = (_currentSeed = _arg1);
}
public function set seed(_arg1:uint):void{
_seed = (_currentSeed = _arg1);
}
public function random():Number{
return ((((_currentSeed = ((_currentSeed * 16807) % 2147483647)) / 2147483647) + 2.33E-10));
}
public function boolean(_arg1:Number=0.5):Boolean{
return ((random() < _arg1));
}
public function get currentSeed():uint{
return (_currentSeed);
}
public function bit(_arg1:Number=0.5):int{
return (((random())<_arg1) ? 1 : 0);
}
public function reset():void{
_seed = _currentSeed;
}
public function get seed():uint{
return (_seed);
}
public function float(_arg1:Number, _arg2:Number=NaN):Number{
if (isNaN(_arg2)){
_arg2 = _arg1;
_arg1 = 0;
};
return (((random() * (_arg2 - _arg1)) + _arg1));
}
public function sign(_arg1:Number=0.5):int{
return (((random())<_arg1) ? 1 : -1);
}
public function integer(_arg1:Number, _arg2:Number=NaN):int{
if (isNaN(_arg2)){
_arg2 = _arg1;
_arg1 = 0;
};
return (Math.floor(float(_arg1, _arg2)));
}
public static function random():Number{
return (instance.random());
}
public static function set seed(_arg1:uint):void{
instance.seed = _arg1;
}
public static function get currentSeed():uint{
return (instance.currentSeed);
}
public static function bit(_arg1:Number=0.5):int{
return (instance.bit(_arg1));
}
public static function boolean(_arg1:Number=0.5):Boolean{
return (instance.boolean(_arg1));
}
public static function get seed():uint{
return (instance.seed);
}
public static function get instance():Rndm{
if (_instance == null){
_instance = new (Rndm);
};
return (_instance);
}
public static function reset():void{
instance.reset();
}
public static function float(_arg1:Number, _arg2:Number=NaN):Number{
return (instance.float(_arg1, _arg2));
}
public static function sign(_arg1:Number=0.5):int{
return (instance.sign(_arg1));
}
public static function integer(_arg1:Number, _arg2:Number=NaN):int{
return (instance.integer(_arg1, _arg2));
}
}
}//package com.gskinner.utils
Section 147
//SpilGamesServices (com.spilgames.api.SpilGamesServices)
package com.spilgames.api {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class SpilGamesServices extends MovieClip {
private var _connected:Boolean;// = false
private var ERR_LOADCOMP:String;// = "Failed to load Spil Social Component."
private var _loader:Loader;
private var ERR_DOWNLOAD:String;// = "Failed downloading Spil Games Social configurator component."
private var _connecting:Boolean;// = false
private var DEFAULT_CONNECTION_LOCATION:String;// = "http://www8.agame.com/games/flash/services/ServicesConnection.swf"
private var ERR_INITCOMP:String;// = "Failed to communication with a Spil Social Component."
private var ERR_SPILCALL:String;// = "Failed processing a Spil call."
private var ERR_NOPARENT:String;// = "Failed creating Spil Games connector: No parent provided."
private var _showDebug:Boolean;// = false
private var _servicesConnection;// = null
private var _alwaysInFront:Boolean;// = false
public static const INVALID_TYPE:int = -1;
public static const INVALID_ID:int = -1;
private static var _instance:SpilGamesServices = null;
public function SpilGamesServices(){
if (_instance){
throw (new Error("Only a single instance can be created."));
};
_instance = this;
}
private function handleServicesFailed(_arg1:ErrorEvent):void{
_servicesConnection.removeEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.removeEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.removeEventListener("serviceError", handleServiceError);
_servicesConnection = null;
if (hasEventListener("servicesFailed")){
dispatchEvent(new ErrorEvent("servicesFailed", false, false, _arg1.text));
};
}
private function handleLoadComplete(_arg1:Event):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_servicesConnection = LoaderInfo(_arg1.target).content;
_servicesConnection.addEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.addEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.addEventListener("serviceError", handleServiceError);
addChild(_servicesConnection);
}
public function send(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null):int{
if (_connected){
return (_servicesConnection.send(_arg1, _arg2, _arg3, _arg4));
};
return (INVALID_ID);
}
public function get connected():Boolean{
return (_connected);
}
public function showErrorMessage(_arg1:String):void{
if (((_servicesConnection) && (_servicesConnection.hasOwnProperty("showErrorMessage")))){
_servicesConnection.showErrorMessage(_arg1);
};
}
public function isSWFReady():Boolean{
return (isReady());
}
public function getSiteID():int{
if (_servicesConnection != null){
return (_servicesConnection.getSiteID());
};
return (INVALID_ID);
}
public function isReady():Boolean{
return (((!((_servicesConnection == null))) && (_servicesConnection.isReady())));
}
private function handleServiceError(_arg1:Event):void{
var _local2 = "";
if ((_arg1 is ErrorEvent)){
_local2 = ErrorEvent(_arg1).text;
} else {
_local2 = _arg1.toString();
};
if (hasEventListener("serviceError")){
dispatchEvent(new ErrorEvent("serviceError", false, false, _local2));
};
}
public function disconnect():void{
if (_connected){
_servicesConnection.removeEventListener();
_servicesConnection.removeEventListener();
_servicesConnection.removeEventListener();
_servicesConnection.disconnect();
_servicesConnection = null;
};
if (_loader){
try {
_loader.close();
} catch(e:Error) {
} finally {
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
};
};
removeEventListener(Event.ENTER_FRAME, bringToFront);
if (parent){
parent.removeChild(this);
};
}
private function handleServicesReady(_arg1:Event):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_connected = true;
_connecting = false;
dispatchEvent(new Event("servicesReady"));
}
public function getChannelID():int{
if (_servicesConnection != null){
return (_servicesConnection.getChannelID());
};
return (INVALID_ID);
}
public function set showDebug(_arg1:Boolean):void{
if (_showDebug != _arg1){
_showDebug = _arg1;
if (_showDebug){
bringToFront();
};
};
}
public function hasValidUserData():Boolean{
return (isGuest());
}
public function isDomainAllowed():Boolean{
return (((!((_servicesConnection == null))) && (_servicesConnection.isDomainValid())));
}
public function isGuest():Boolean{
var _local1:Object;
if (_servicesConnection != null){
return (_servicesConnection.isGuest());
};
trace("WARNING: SpilGamesServices connection not ready yet");
if (root.loaderInfo != null){
_local1 = root.loaderInfo.parameters;
return (((((((!(_local1.username)) || ((_local1.username == "")))) || (!(_local1.hash)))) || ((_local1.hash == ""))));
};
return (false);
}
public function get showDebug():Boolean{
return (_showDebug);
}
private function handleIOError(_arg1:IOErrorEvent):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
if (hasEventListener(_arg1.type)){
dispatchEvent(_arg1);
};
}
public function getItemType():int{
if (_servicesConnection != null){
return (_servicesConnection.getItemType());
};
return (INVALID_TYPE);
}
public function set alwaysInFront(_arg1:Boolean):void{
if (_alwaysInFront != _arg1){
_alwaysInFront = _arg1;
if (_alwaysInFront){
addEventListener(Event.ENTER_FRAME, bringToFront);
} else {
removeEventListener(Event.ENTER_FRAME, bringToFront);
};
};
}
public function getItemID():int{
if (_servicesConnection != null){
return (_servicesConnection.getItemID());
};
return (INVALID_ID);
}
public function getUserName():String{
if (_servicesConnection != null){
return (_servicesConnection.getUserName());
};
return ("");
}
public function allowDomain(_arg1:String):void{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
}
public function getUserHash():String{
if (_servicesConnection != null){
return (_servicesConnection.getUserHash());
};
return ("");
}
public function connect(_arg1:DisplayObjectContainer):void{
var _local2:String;
var _local3:URLRequest;
if (((!(_connecting)) && (!(_connected)))){
if (!_arg1.stage){
trace("ERROR: The given clip must be present in the display list (added to stage)");
return;
};
_connecting = true;
_arg1.stage.addChild(this);
_local2 = DEFAULT_CONNECTION_LOCATION;
if (((root.loaderInfo.parameters["servicesLoc"]) && ((root.loaderInfo.parameters["servicesLoc"].length > 0)))){
_local2 = root.loaderInfo.parameters["servicesLoc"];
};
allowDomain(_local2);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_local3 = new URLRequest(_local2);
_loader.load(_local3);
};
}
public function get alwaysInFront():Boolean{
return (_alwaysInFront);
}
public function bringToFront(_arg1:Event=null):void{
var e = _arg1;
if (parent){
try {
parent.setChildIndex(this, (parent.numChildren - 1));
} catch(e:Error) {
removeEventListener(Event.ENTER_FRAME, bringToFront);
};
};
}
public static function getInstance():SpilGamesServices{
if (!_instance){
_instance = new (SpilGamesServices);
};
return (_instance);
}
}
}//package com.spilgames.api
Section 148
//Symbol1_4 (debug_fla.Symbol1_4)
package debug_fla {
import flash.display.*;
public dynamic class Symbol1_4 extends MovieClip {
public var smoke:MovieClip;
public function Symbol1_4(){
addFrameScript(0, frame1);
}
function frame1(){
smoke.rotation = (Math.random() * 360);
}
}
}//package debug_fla
Section 149
//Symbol3_2 (debug_fla.Symbol3_2)
package debug_fla {
import flash.display.*;
public dynamic class Symbol3_2 extends MovieClip {
public var fire:MovieClip;
public function Symbol3_2(){
addFrameScript(0, frame1);
}
function frame1(){
fire.rotation = (Math.random() * 360);
}
}
}//package debug_fla
Section 150
//IndeterminateBar (fl.controls.progressBarClasses.IndeterminateBar)
package fl.controls.progressBarClasses {
import flash.events.*;
import flash.display.*;
import fl.core.*;
public class IndeterminateBar extends UIComponent {
protected var bar:Sprite;
protected var barMask:Sprite;
protected var patternBmp:BitmapData;
protected var animationCount:uint;// = 0
private static var defaultStyles:Object = {indeterminateSkin:"ProgressBar_indeterminateSkin"};
public function IndeterminateBar(){
animationCount = 0;
super();
setSize(0, 0);
startAnimation();
}
protected function drawBar():void{
var _local1:Graphics;
if (patternBmp == null){
return;
};
_local1 = bar.graphics;
_local1.clear();
_local1.beginBitmapFill(patternBmp);
_local1.drawRect(0, 0, (_width + patternBmp.width), _height);
_local1.endFill();
}
protected function drawMask():void{
var _local1:Graphics;
_local1 = barMask.graphics;
_local1.clear();
_local1.beginFill(0, 0);
_local1.drawRect(0, 0, _width, _height);
_local1.endFill();
}
override public function get visible():Boolean{
return (super.visible);
}
override public function set visible(_arg1:Boolean):void{
if (_arg1){
startAnimation();
} else {
stopAnimation();
};
super.visible = _arg1;
}
protected function startAnimation():void{
addEventListener(Event.ENTER_FRAME, handleEnterFrame, false, 0, true);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
drawPattern();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawBar();
drawMask();
};
super.draw();
}
override protected function configUI():void{
bar = new Sprite();
addChild(bar);
barMask = new Sprite();
addChild(barMask);
bar.mask = barMask;
}
protected function stopAnimation():void{
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
protected function drawPattern():void{
var _local1:DisplayObject;
_local1 = getDisplayObjectInstance(getStyleValue("indeterminateSkin"));
if (patternBmp){
patternBmp.dispose();
};
patternBmp = new BitmapData((_local1.width << 0), (_local1.height << 0), true, 0);
patternBmp.draw(_local1);
}
protected function handleEnterFrame(_arg1:Event):void{
if (patternBmp == null){
return;
};
animationCount = ((animationCount + 2) % patternBmp.width);
bar.x = -(animationCount);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.progressBarClasses
Section 151
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import fl.core.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 152
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.managers.*;
import fl.core.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 153
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 154
//CheckBox (fl.controls.CheckBox)
package fl.controls {
import flash.display.*;
public class CheckBox extends LabelButton {
private static var defaultStyles:Object = {icon:null, upIcon:"CheckBox_upIcon", downIcon:"CheckBox_downIcon", overIcon:"CheckBox_overIcon", disabledIcon:"CheckBox_disabledIcon", selectedDisabledIcon:"CheckBox_selectedDisabledIcon", focusRectSkin:null, focusRectPadding:null, selectedUpIcon:"CheckBox_selectedUpIcon", selectedDownIcon:"CheckBox_selectedDownIcon", selectedOverIcon:"CheckBox_selectedOverIcon", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public static var createAccessibilityImplementation:Function;
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = (background.x - _local2);
uiFocusRect.y = (background.y - _local2);
uiFocusRect.width = (background.width + (_local2 << 1));
uiFocusRect.height = (background.height + (_local2 << 1));
};
}
override public function get autoRepeat():Boolean{
return (false);
}
override public function set autoRepeat(_arg1:Boolean):void{
}
override public function set toggle(_arg1:Boolean):void{
throw (new Error("Warning: You cannot change a CheckBox's toggle."));
}
override public function get toggle():Boolean{
return (true);
}
override protected function configUI():void{
var _local1:Shape;
var _local2:Graphics;
super.configUI();
super.toggle = true;
_local1 = new Shape();
_local2 = _local1.graphics;
_local2.beginFill(0, 0);
_local2.drawRect(0, 0, 100, 100);
_local2.endFill();
background = (_local1 as DisplayObject);
addChildAt(background, 0);
}
override protected function drawLayout():void{
var _local1:Number;
super.drawLayout();
_local1 = Number(getStyleValue("textPadding"));
switch (_labelPlacement){
case ButtonLabelPlacement.RIGHT:
icon.x = _local1;
textField.x = (icon.x + (icon.width + _local1));
background.width = ((textField.x + textField.width) + _local1);
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.LEFT:
icon.x = ((width - icon.width) - _local1);
textField.x = (((width - icon.width) - (_local1 * 2)) - textField.width);
background.width = ((textField.width + icon.width) + (_local1 * 3));
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.TOP:
case ButtonLabelPlacement.BOTTOM:
background.width = (Math.max(textField.width, icon.width) + (_local1 * 2));
background.height = ((textField.height + icon.height) + (_local1 * 3));
break;
};
background.x = Math.min((icon.x - _local1), (textField.x - _local1));
background.y = Math.min((icon.y - _local1), (textField.y - _local1));
}
override protected function drawBackground():void{
}
override protected function initializeAccessibility():void{
if (CheckBox.createAccessibilityImplementation != null){
CheckBox.createAccessibilityImplementation(this);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 155
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.managers.*;
import fl.core.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 156
//ProgressBar (fl.controls.ProgressBar)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.controls.progressBarClasses.*;
public class ProgressBar extends UIComponent {
protected var _direction:String;// = "right"
protected var _mode:String;// = "event"
protected var _value:Number;// = 0
protected var _indeterminate:Boolean;// = true
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 0
protected var determinateBar:DisplayObject;
protected var _loaded:Number;
protected var _source:Object;
protected var track:DisplayObject;
protected var indeterminateBar:UIComponent;
private static var defaultStyles:Object = {trackSkin:"ProgressBar_trackSkin", barSkin:"ProgressBar_barSkin", indeterminateSkin:"ProgressBar_indeterminateSkin", indeterminateBar:IndeterminateBar, barPadding:0};
public function ProgressBar(){
_direction = ProgressBarDirection.RIGHT;
_indeterminate = true;
_mode = ProgressBarMode.EVENT;
_minimum = 0;
_maximum = 0;
_value = 0;
super();
}
public function get minimum():Number{
return (_minimum);
}
public function get source():Object{
return (_source);
}
public function set minimum(_arg1:Number):void{
if (_mode != ProgressBarMode.MANUAL){
return;
};
_minimum = _arg1;
invalidate(InvalidationType.DATA);
}
public function get maximum():Number{
return (_maximum);
}
protected function drawBars():void{
var _local1:DisplayObject;
var _local2:DisplayObject;
_local1 = determinateBar;
_local2 = indeterminateBar;
determinateBar = getDisplayObjectInstance(getStyleValue("barSkin"));
addChild(determinateBar);
indeterminateBar = (getDisplayObjectInstance(getStyleValue("indeterminateBar")) as UIComponent);
indeterminateBar.setStyle("indeterminateSkin", getStyleValue("indeterminateSkin"));
addChild(indeterminateBar);
if (((!((_local1 == null))) && (!((_local1 == determinateBar))))){
removeChild(_local1);
};
if (((!((_local2 == null))) && (!((_local2 == determinateBar))))){
removeChild(_local2);
};
}
protected function setupSourceEvents():void{
_source.addEventListener(ProgressEvent.PROGRESS, handleProgress, false, 0, true);
_source.addEventListener(Event.COMPLETE, handleComplete, false, 0, true);
}
public function set maximum(_arg1:Number):void{
setProgress(_value, _arg1);
}
public function set source(_arg1:Object):void{
if (_source == _arg1){
return;
};
if (_mode != ProgressBarMode.MANUAL){
resetProgress();
};
_source = _arg1;
if (_source == null){
return;
};
if (_mode == ProgressBarMode.EVENT){
setupSourceEvents();
} else {
if (_mode == ProgressBarMode.POLLED){
addEventListener(Event.ENTER_FRAME, pollSource, false, 0, true);
};
};
}
protected function drawTrack():void{
var _local1:DisplayObject;
_local1 = track;
track = getDisplayObjectInstance(getStyleValue("trackSkin"));
addChildAt(track, 0);
if (((!((_local1 == null))) && (!((_local1 == track))))){
removeChild(_local1);
};
}
protected function handleProgress(_arg1:ProgressEvent):void{
_setProgress(_arg1.bytesLoaded, _arg1.bytesTotal, true);
}
public function set sourceName(_arg1:String):void{
var _local2:DisplayObject;
if (!componentInspectorSetting){
return;
};
if (_arg1 == ""){
return;
};
_local2 = (parent.getChildByName(_arg1) as DisplayObject);
if (_local2 == null){
throw (new Error((("Source clip '" + _arg1) + "' not found on parent.")));
};
source = _local2;
}
protected function resetProgress():void{
if ((((_mode == ProgressBarMode.EVENT)) && (!((_source == null))))){
cleanupSourceEvents();
} else {
if (_mode == ProgressBarMode.POLLED){
removeEventListener(Event.ENTER_FRAME, pollSource);
} else {
if (_source != null){
_source = null;
};
};
};
_minimum = (_maximum = (_value = 0));
}
public function get percentComplete():Number{
return (((((_maximum <= _minimum)) || ((_value <= _minimum)))) ? 0 : Math.max(0, Math.min(100, (((_value - _minimum) / (_maximum - _minimum)) * 100))));
}
public function setProgress(_arg1:Number, _arg2:Number):void{
if (_mode != ProgressBarMode.MANUAL){
return;
};
_setProgress(_arg1, _arg2);
}
protected function pollSource(_arg1:Event):void{
if (_source == null){
return;
};
_setProgress(_source.bytesLoaded, _source.bytesTotal, true);
if ((((_maximum > 0)) && ((_maximum == _value)))){
removeEventListener(Event.ENTER_FRAME, pollSource);
dispatchEvent(new Event(Event.COMPLETE));
};
}
public function get indeterminate():Boolean{
return (_indeterminate);
}
public function set value(_arg1:Number):void{
setProgress(_arg1, _maximum);
}
public function set direction(_arg1:String):void{
_direction = _arg1;
invalidate(InvalidationType.DATA);
}
protected function _setProgress(_arg1:Number, _arg2:Number, _arg3:Boolean=false):void{
if ((((_arg1 == _value)) && ((_arg2 == _maximum)))){
return;
};
_value = _arg1;
_maximum = _arg2;
if (((!((_value == _loaded))) && (_arg3))){
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, _value, _maximum));
_loaded = _value;
};
if (_mode != ProgressBarMode.MANUAL){
setIndeterminate((_arg2 == 0));
};
invalidate(InvalidationType.DATA);
}
public function set mode(_arg1:String):void{
if (_mode == _arg1){
return;
};
resetProgress();
_mode = _arg1;
if ((((_arg1 == ProgressBarMode.EVENT)) && (!((_source == null))))){
setupSourceEvents();
} else {
if (_arg1 == ProgressBarMode.POLLED){
addEventListener(Event.ENTER_FRAME, pollSource, false, 0, true);
};
};
setIndeterminate(!((_mode == ProgressBarMode.MANUAL)));
}
public function reset():void{
var _local1:Object;
_setProgress(0, 0);
_local1 = _source;
_source = null;
source = _local1;
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
drawTrack();
drawBars();
invalidate(InvalidationType.STATE, false);
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.STATE)){
indeterminateBar.visible = _indeterminate;
determinateBar.visible = !(_indeterminate);
invalidate(InvalidationType.DATA, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
invalidate(InvalidationType.DATA, false);
};
if (((isInvalid(InvalidationType.DATA)) && (!(_indeterminate)))){
drawDeterminateBar();
};
super.draw();
}
override protected function configUI():void{
super.configUI();
}
protected function drawDeterminateBar():void{
var _local1:Number;
var _local2:Number;
_local1 = (percentComplete / 100);
_local2 = Number(getStyleValue("barPadding"));
determinateBar.width = Math.round(((width - (_local2 * 2)) * _local1));
determinateBar.x = ((_direction)==ProgressBarDirection.LEFT) ? ((width - _local2) - determinateBar.width) : _local2;
}
public function get value():Number{
return (_value);
}
public function set indeterminate(_arg1:Boolean):void{
if (((!((_mode == ProgressBarMode.MANUAL))) || ((_indeterminate == _arg1)))){
return;
};
setIndeterminate(_arg1);
}
protected function setIndeterminate(_arg1:Boolean):void{
if (_indeterminate == _arg1){
return;
};
_indeterminate = _arg1;
invalidate(InvalidationType.STATE);
}
protected function handleComplete(_arg1:Event):void{
_setProgress(_maximum, _maximum, true);
dispatchEvent(_arg1);
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("barPadding"));
track.width = width;
track.height = height;
indeterminateBar.setSize((width - (_local1 * 2)), (height - (_local1 * 2)));
indeterminateBar.move(_local1, _local1);
indeterminateBar.drawNow();
determinateBar.height = (height - (_local1 * 2));
determinateBar.y = _local1;
}
public function get direction():String{
return (_direction);
}
public function get mode():String{
return (_mode);
}
protected function cleanupSourceEvents():void{
_source.removeEventListener(ProgressEvent.PROGRESS, handleProgress);
_source.removeEventListener(Event.COMPLETE, handleComplete);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 157
//ProgressBarDirection (fl.controls.ProgressBarDirection)
package fl.controls {
public class ProgressBarDirection {
public static const RIGHT:String = "right";
public static const LEFT:String = "left";
}
}//package fl.controls
Section 158
//ProgressBarMode (fl.controls.ProgressBarMode)
package fl.controls {
public class ProgressBarMode {
public static const MANUAL:String = "manual";
public static const EVENT:String = "event";
public static const POLLED:String = "polled";
}
}//package fl.controls
Section 159
//Slider (fl.controls.Slider)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.managers.*;
import fl.core.*;
import fl.events.*;
import flash.ui.*;
public class Slider extends UIComponent implements IFocusManagerComponent {
protected var _direction:String;
protected var _liveDragging:Boolean;// = false
protected var _value:Number;// = 0
protected var _snapInterval:Number;// = 0
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var track:BaseButton;
protected var _tickInterval:Number;// = 0
protected var tickContainer:Sprite;
protected var thumb:BaseButton;
protected static const TICK_STYLES:Object = {upSkin:"tickSkin"};
protected static const TRACK_STYLES:Object = {upSkin:"sliderTrackSkin", overSkin:"sliderTrackSkin", downSkin:"sliderTrackSkin", disabledSkin:"sliderTrackDisabledSkin"};
protected static const THUMB_STYLES:Object = {upSkin:"thumbUpSkin", overSkin:"thumbOverSkin", downSkin:"thumbDownSkin", disabledSkin:"thumbDisabledSkin"};
protected static var defaultStyles:Object = {thumbUpSkin:"SliderThumb_upSkin", thumbOverSkin:"SliderThumb_overSkin", thumbDownSkin:"SliderThumb_downSkin", thumbDisabledSkin:"SliderThumb_disabledSkin", sliderTrackSkin:"SliderTrack_skin", sliderTrackDisabledSkin:"SliderTrack_disabledSkin", tickSkin:"SliderTick_skin", focusRectSkin:null, focusRectPadding:null};
public function Slider(){
_direction = SliderDirection.HORIZONTAL;
_minimum = 0;
_maximum = 10;
_value = 0;
_tickInterval = 0;
_snapInterval = 0;
_liveDragging = false;
super();
setStyles();
}
public function get minimum():Number{
return (_minimum);
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
this.value = Math.max(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get maximum():Number{
return (_maximum);
}
protected function positionThumb():void{
thumb.x = ((((_direction)==SliderDirection.VERTICAL) ? ((maximum - minimum) - value) : (value - minimum) / (maximum - minimum)) * _width);
}
protected function clearTicks():void{
if (((!(tickContainer)) || (!(tickContainer.parent)))){
return;
};
removeChild(tickContainer);
}
protected function onTrackClick(_arg1:MouseEvent):void{
calculateValue(track.mouseX, InteractionInputType.MOUSE, SliderEventClickTarget.TRACK);
if (!liveDragging){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.TRACK, InteractionInputType.MOUSE));
};
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
this.value = Math.min(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get liveDragging():Boolean{
return (_liveDragging);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_width / snapInterval);
_local3 = track.mouseX;
calculateValue(_local3, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:Number;
var _local4:Boolean;
if (!enabled){
return;
};
_local2 = ((snapInterval)>0) ? snapInterval : 1;
_local4 = (direction == SliderDirection.HORIZONTAL);
if ((((((_arg1.keyCode == Keyboard.DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.LEFT)) && (_local4))))){
_local3 = (value - _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.RIGHT)) && (_local4))))){
_local3 = (value + _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.HOME)) && (_local4))))){
_local3 = minimum;
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.END)) && (_local4))))){
_local3 = maximum;
};
};
};
};
if (!isNaN(_local3)){
_arg1.stopPropagation();
doSetValue(_local3, InteractionInputType.KEYBOARD, null, _arg1.keyCode);
};
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
super.enabled = _arg1;
track.enabled = (thumb.enabled = _arg1);
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_PRESS, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
}
public function get snapInterval():Number{
return (_snapInterval);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_RELEASE, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
public function set liveDragging(_arg1:Boolean):void{
_liveDragging = _arg1;
}
public function set value(_arg1:Number):void{
doSetValue(_arg1);
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
_direction = _arg1;
_local2 = (_direction == SliderDirection.VERTICAL);
if (isLivePreview){
if (_local2){
setScaleY(-1);
y = track.height;
} else {
setScaleY(1);
y = 0;
};
positionThumb();
return;
};
if (((_local2) && (componentInspectorSetting))){
if ((rotation % 90) == 0){
setScaleY(-1);
};
};
if (!componentInspectorSetting){
rotation = (_local2) ? 90 : 0;
};
}
public function set tickInterval(_arg1:Number):void{
_tickInterval = _arg1;
invalidate(InvalidationType.SIZE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
track.setSize(_width, track.height);
track.drawNow();
thumb.drawNow();
};
if (tickInterval > 0){
drawTicks();
} else {
clearTicks();
};
positionThumb();
super.draw();
}
override protected function configUI():void{
super.configUI();
thumb = new BaseButton();
thumb.setSize(13, 13);
thumb.autoRepeat = false;
addChild(thumb);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
track = new BaseButton();
track.move(0, 0);
track.setSize(80, 4);
track.autoRepeat = false;
track.useHandCursor = false;
track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true);
addChildAt(track, 0);
}
public function set snapInterval(_arg1:Number):void{
_snapInterval = _arg1;
}
public function get value():Number{
return (_value);
}
public function get direction():String{
return (_direction);
}
public function get tickInterval():Number{
return (_tickInterval);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if ((((_direction == SliderDirection.VERTICAL)) && (!(isLivePreview)))){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
invalidate(InvalidationType.SIZE);
}
protected function drawTicks():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:DisplayObject;
clearTicks();
tickContainer = new Sprite();
_local1 = ((maximum)<1) ? (tickInterval / 100) : tickInterval;
_local2 = ((maximum - minimum) / _local1);
_local3 = (_width / _local2);
_local4 = 0;
while (_local4 <= _local2) {
_local5 = getDisplayObjectInstance(getStyleValue("tickSkin"));
_local5.x = (_local3 * _local4);
_local5.y = ((track.y - _local5.height) - 2);
tickContainer.addChild(_local5);
_local4++;
};
addChild(tickContainer);
}
protected function calculateValue(_arg1:Number, _arg2:String, _arg3:String, _arg4:int=undefined):void{
var _local5:Number;
_local5 = ((_arg1 / _width) * (maximum - minimum));
if (_direction == SliderDirection.VERTICAL){
_local5 = (maximum - _local5);
} else {
_local5 = (minimum + _local5);
};
doSetValue(_local5, _arg2, _arg3, _arg4);
}
protected function getPrecision(_arg1:Number):Number{
var _local2:String;
_local2 = _arg1.toString();
if (_local2.indexOf(".") == -1){
return (0);
};
return (_local2.split(".").pop().length);
}
protected function doSetValue(_arg1:Number, _arg2:String=null, _arg3:String=null, _arg4:int=undefined):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = _value;
if (((!((_snapInterval == 0))) && (!((_snapInterval == 1))))){
_local6 = Math.pow(10, getPrecision(snapInterval));
_local7 = (_snapInterval * _local6);
_local8 = Math.round((_arg1 * _local6));
_local9 = (Math.round((_local8 / _local7)) * _local7);
_arg1 = (_local9 / _local6);
_value = Math.max(minimum, Math.min(maximum, _arg1));
} else {
_value = Math.max(minimum, Math.min(maximum, Math.round(_arg1)));
};
if (((!((_local5 == _value))) && (((((liveDragging) && (!((_arg3 == null))))) || ((_arg2 == InteractionInputType.KEYBOARD)))))){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, _arg3, _arg2, _arg4));
};
positionThumb();
}
protected function setStyles():void{
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 160
//SliderDirection (fl.controls.SliderDirection)
package fl.controls {
public class SliderDirection {
public static var HORIZONTAL:String = "horizontal";
public static var VERTICAL:String = "vertical";
}
}//package fl.controls
Section 161
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 162
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 163
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 164
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 165
//InteractionInputType (fl.events.InteractionInputType)
package fl.events {
public class InteractionInputType {
public static const MOUSE:String = "mouse";
public static const KEYBOARD:String = "keyboard";
}
}//package fl.events
Section 166
//SliderEvent (fl.events.SliderEvent)
package fl.events {
import flash.events.*;
public class SliderEvent extends Event {
protected var _triggerEvent:String;
protected var _keyCode:Number;
protected var _value:Number;
protected var _clickTarget:String;
public static const CHANGE:String = "change";
public static const THUMB_PRESS:String = "thumbPress";
public static const THUMB_DRAG:String = "thumbDrag";
public static const THUMB_RELEASE:String = "thumbRelease";
public function SliderEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:int=0){
_value = _arg2;
_keyCode = _arg5;
_triggerEvent = _arg4;
_clickTarget = _arg3;
super(_arg1);
}
public function get clickTarget():String{
return (_clickTarget);
}
override public function clone():Event{
return (new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode));
}
override public function toString():String{
return (formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget"));
}
public function get triggerEvent():String{
return (_triggerEvent);
}
public function get value():Number{
return (_value);
}
public function get keyCode():Number{
return (_keyCode);
}
}
}//package fl.events
Section 167
//SliderEventClickTarget (fl.events.SliderEventClickTarget)
package fl.events {
public class SliderEventClickTarget {
public static const TRACK:String = "track";
public static const THUMB:String = "thumb";
}
}//package fl.events
Section 168
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import fl.controls.*;
import fl.core.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 169
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import flash.display.*;
import fl.controls.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 170
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 171
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 172
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import flash.utils.*;
import fl.core.*;
import flash.text.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 173
//Quadratic (fl.motion.easing.Quadratic)
package fl.motion.easing {
public class Quadratic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.motion.easing
Section 174
//Fade (fl.transitions.Fade)
package fl.transitions {
import flash.display.*;
public class Fade extends Transition {
protected var _alphaFinal:Number;
public function Fade(_arg1:MovieClip, _arg2:Object, _arg3:TransitionManager){
super(_arg1, _arg2, _arg3);
this._alphaFinal = this.manager.contentAppearance.alpha;
}
override public function get type():Class{
return (Fade);
}
override protected function _render(_arg1:Number):void{
this._content.alpha = (this._alphaFinal * _arg1);
}
}
}//package fl.transitions
Section 175
//Squeeze (fl.transitions.Squeeze)
package fl.transitions {
import flash.display.*;
public class Squeeze extends Transition {
protected var _scaleFinal:Number;// = 1
protected var _scaleProp:String;// = "scaleX"
public function Squeeze(_arg1:MovieClip, _arg2:Object, _arg3:TransitionManager){
super(_arg1, _arg2, _arg3);
if (_arg2.dimension){
this._scaleProp = "scaleY";
this._scaleFinal = this.manager.contentAppearance.scaleY;
} else {
this._scaleProp = "scaleX";
this._scaleFinal = this.manager.contentAppearance.scaleX;
};
}
override protected function _render(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0;
};
this._content[this._scaleProp] = (_arg1 * this._scaleFinal);
}
override public function get type():Class{
return (_slot1);
}
}
}//package fl.transitions
Section 176
//Transition (fl.transitions.Transition)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Transition extends EventDispatcher {
protected var _direction:uint;// = 0
protected var _height:Number;// = NAN
protected var _easing:Function;
protected var _twn:Tween;
protected var _width:Number;// = NAN
protected var _outerBounds:Rectangle;
protected var _progress:Number;
public var ID:int;
protected var _innerBounds:Rectangle;
protected var _manager:TransitionManager;
protected var _duration:Number;// = 2
protected var _content:MovieClip;
public static const IN:uint = 0;
public static const OUT:uint = 1;
public function Transition(_arg1:MovieClip, _arg2:Object, _arg3:TransitionManager){
this.content = _arg1;
this.direction = _arg2.direction;
this.duration = _arg2.duration;
this.easing = _arg2.easing;
this.manager = _arg3;
this._innerBounds = this.manager._innerBounds;
this._outerBounds = this.manager._outerBounds;
this._width = this.manager._width;
this._height = this.manager._height;
this._resetTween();
}
public function get type():Class{
return (Transition);
}
public function cleanUp():void{
this.removeEventListener("transitionInDone", this._manager.transitionInDone);
this.removeEventListener("transitionOutDone", this._manager.transitionOutDone);
this.stop();
}
public function stop():void{
this._twn.fforward();
this._twn.stop();
}
public function onMotionFinished(_arg1:Object):void{
if (this.direction == Transition.OUT){
this.dispatchEvent(new Event("transitionOutDone"));
} else {
this.dispatchEvent(new Event("transitionInDone"));
};
}
public function set easing(_arg1:Function):void{
this._easing = _arg1;
if (this._twn){
this._twn.func = _arg1;
};
}
public function set manager(_arg1:TransitionManager):void{
if (this._manager){
this.removeEventListener("transitionInDone", this._manager.transitionInDone);
this.removeEventListener("transitionOutDone", this._manager.transitionOutDone);
};
this._manager = _arg1;
this.addEventListener("transitionInDone", this._manager.transitionInDone);
this.addEventListener("transitionOutDone", this._manager.transitionOutDone);
}
private function _resetTween():void{
if (this._twn){
this._twn.stop();
this._twn.removeEventListener(TweenEvent.MOTION_FINISH, this.onMotionFinished);
};
this._twn = new Tween(this, "", this.easing, 0, 1, this.duration, true);
this._twn.stop();
this._twn.prop = "progress";
this._twn.addEventListener(TweenEvent.MOTION_FINISH, this.onMotionFinished, false, 0, true);
}
public function drawBox(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
_arg1.graphics.moveTo(_arg2, _arg3);
_arg1.graphics.lineTo((_arg2 + _arg4), _arg3);
_arg1.graphics.lineTo((_arg2 + _arg4), (_arg3 + _arg5));
_arg1.graphics.lineTo(_arg2, (_arg3 + _arg5));
_arg1.graphics.lineTo(_arg2, _arg3);
}
public function set progress(_arg1:Number):void{
if (this._progress == _arg1){
return;
};
this._progress = _arg1;
if (this._direction){
this._render((1 - _arg1));
} else {
this._render(_arg1);
};
this.dispatchEvent(new Event("transitionProgress"));
}
public function get duration():Number{
return (this._duration);
}
public function set duration(_arg1:Number):void{
if (_arg1){
this._duration = _arg1;
if (this._twn){
this._twn.duration = _arg1;
};
};
}
public function start():void{
this.content.visible = true;
this._twn.start();
}
public function get easing():Function{
return (this._easing);
}
public function get manager():TransitionManager{
return (this._manager);
}
public function set content(_arg1:MovieClip):void{
if (_arg1){
this._content = _arg1;
if (this._twn){
this._twn.obj = _arg1;
};
};
}
protected function _render(_arg1:Number):void{
}
public function get content():MovieClip{
return (this._content);
}
public function drawCircle(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number):void{
_arg1.graphics.moveTo((_arg2 + _arg4), _arg3);
_arg1.graphics.curveTo((_arg4 + _arg2), ((Math.tan((Math.PI / 8)) * _arg4) + _arg3), ((Math.sin((Math.PI / 4)) * _arg4) + _arg2), ((Math.sin((Math.PI / 4)) * _arg4) + _arg3));
_arg1.graphics.curveTo(((Math.tan((Math.PI / 8)) * _arg4) + _arg2), (_arg4 + _arg3), _arg2, (_arg4 + _arg3));
_arg1.graphics.curveTo(((-(Math.tan((Math.PI / 8))) * _arg4) + _arg2), (_arg4 + _arg3), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg2), ((Math.sin((Math.PI / 4)) * _arg4) + _arg3));
_arg1.graphics.curveTo((-(_arg4) + _arg2), ((Math.tan((Math.PI / 8)) * _arg4) + _arg3), (-(_arg4) + _arg2), _arg3);
_arg1.graphics.curveTo((-(_arg4) + _arg2), ((-(Math.tan((Math.PI / 8))) * _arg4) + _arg3), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg2), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg3));
_arg1.graphics.curveTo(((-(Math.tan((Math.PI / 8))) * _arg4) + _arg2), (-(_arg4) + _arg3), _arg2, (-(_arg4) + _arg3));
_arg1.graphics.curveTo(((Math.tan((Math.PI / 8)) * _arg4) + _arg2), (-(_arg4) + _arg3), ((Math.sin((Math.PI / 4)) * _arg4) + _arg2), ((-(Math.sin((Math.PI / 4))) * _arg4) + _arg3));
_arg1.graphics.curveTo((_arg4 + _arg2), ((-(Math.tan((Math.PI / 8))) * _arg4) + _arg3), (_arg4 + _arg2), _arg3);
}
public function get progress():Number{
return (this._progress);
}
private function _noEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public function set direction(_arg1:Number):void{
this._direction = (_arg1) ? 1 : 0;
}
public function get direction():Number{
return (this._direction);
}
}
}//package fl.transitions
Section 177
//TransitionManager (fl.transitions.TransitionManager)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class TransitionManager extends EventDispatcher {
public var type:Object;
public var _width:Number;// = NAN
public var _height:Number;// = NAN
public var _outerBounds:Rectangle;
private var _visualPropList:Object;
private var _triggerEvent:String;
public var className:String;// = "TransitionManager"
public var _innerBounds:Rectangle;
private var _content:MovieClip;
private var _contentAppearance:Object;
private var _transitions:Object;
private static var IDCount:int = 0;
public function TransitionManager(_arg1:MovieClip){
type = TransitionManager;
_visualPropList = {x:null, y:null, scaleX:null, scaleY:null, alpha:null, rotation:null};
super();
this.content = _arg1;
this._transitions = {};
}
public function removeTransition(_arg1:Transition):Boolean{
if (((((!(_arg1)) || (!(this._transitions)))) || (!(this._transitions[_arg1.ID])))){
return (false);
};
_arg1.cleanUp();
return (delete this._transitions[_arg1.ID]);
}
public function saveContentAppearance():void{
var _local2:Object;
var _local3:String;
var _local1:MovieClip = this._content;
if (!this._contentAppearance){
_local2 = (this._contentAppearance = {});
for (_local3 in this._visualPropList) {
_local2[_local3] = _local1[_local3];
};
_local2.colorTransform = _local1.transform.colorTransform;
};
this._innerBounds = _local1.getBounds(_local1);
this._outerBounds = _local1.getBounds(_local1.parent);
this._width = _local1.width;
this._height = _local1.height;
}
public function removeAllTransitions():void{
var _local1:Transition;
for each (_local1 in this._transitions) {
_local1.cleanUp();
this.removeTransition(_local1);
};
}
function transitionInDone(_arg1:Object):void{
var _local2:Boolean;
this.removeTransition(_arg1.target);
if (this.numInTransitions == 0){
_local2 = this._content.visible;
if ((((this._triggerEvent == "hide")) || ((this._triggerEvent == "hideChild")))){
this._content.visible = false;
};
if (_local2){
this.dispatchEvent(new Event("allTransitionsInDone"));
};
};
}
public function addTransition(_arg1:Transition):Transition{
_arg1.ID = ++TransitionManager.IDCount;
this._transitions[_arg1.ID] = _arg1;
return (_arg1);
}
public function startTransition(_arg1:Object):Transition{
this.removeTransition(this.findTransition(_arg1));
var _local2:Class = _arg1.type;
var _local3:Transition = new _local2(this._content, _arg1, this);
this.addTransition(_local3);
_local3.start();
return (_local3);
}
function transitionOutDone(_arg1:Object):void{
var _local2:Boolean;
this.removeTransition(_arg1.target);
if (this.numOutTransitions == 0){
this.restoreContentAppearance();
_local2 = this._content.visible;
if (((_local2) && ((((_triggerEvent == "hide")) || ((_triggerEvent == "hideChild")))))){
this._content.visible = false;
};
if (_local2){
this.dispatchEvent(new Event("allTransitionsOutDone"));
};
};
}
public function restoreContentAppearance():void{
var _local3:String;
var _local1:MovieClip = this._content;
var _local2:Object = this._contentAppearance;
for (_local3 in this._visualPropList) {
_local1[_local3] = _local2[_local3];
};
_local1.transform.colorTransform = _local2.colorTransform;
}
public function get numTransitions():Number{
var _local2:Transition;
var _local1:Number = 0;
for each (_local2 in this._transitions) {
_local1++;
};
return (_local1);
}
public function findTransition(_arg1:Object):Transition{
var _local2:Transition;
for each (_local2 in this._transitions) {
if (_local2.type == _arg1.type){
return (_local2);
};
};
return (null);
}
public function set content(_arg1:MovieClip):void{
this._content = _arg1;
this.saveContentAppearance();
}
public function get numInTransitions():Number{
var _local3:Transition;
var _local1:Number = 0;
var _local2:Object = this._transitions;
for each (_local3 in _local2) {
if (!_local3.direction){
_local1++;
};
};
return (_local1);
}
public function get numOutTransitions():Number{
var _local3:Transition;
var _local1:Number = 0;
var _local2:Object = this._transitions;
for each (_local3 in _local2) {
if (_local3.direction){
_local1++;
};
};
return (_local1);
}
public function get content():MovieClip{
return (this._content);
}
public function get transitionsList():Object{
return (this._transitions);
}
public function get contentAppearance():Object{
return (this._contentAppearance);
}
public static function start(_arg1:MovieClip, _arg2:Object):Transition{
if (!_arg1.__transitionManager){
_arg1.__transitionManager = new TransitionManager(_arg1);
};
if (_arg2.direction == 1){
_arg1.__transitionManager._triggerEvent = "hide";
} else {
_arg1.__transitionManager._triggerEvent = "reveal";
};
return (_arg1.__transitionManager.startTransition(_arg2));
}
}
}//package fl.transitions
Section 178
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 179
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 180
//barrel (gfx.Turret_mc.barrel)
package gfx.Turret_mc {
import flash.display.*;
import gfx.*;
public dynamic class barrel extends MovieClip {
public var fire:BarrelFire;
public function barrel(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package gfx.Turret_mc
Section 181
//barrel (gfx.Turret2_mc.barrel)
package gfx.Turret2_mc {
import flash.display.*;
public dynamic class barrel extends MovieClip {
public function barrel(){
addFrameScript(0, frame1, 6, frame7);
}
function frame7(){
stop();
}
function frame1(){
stop();
}
}
}//package gfx.Turret2_mc
Section 182
//barrel (gfx.Turret3_mc.barrel)
package gfx.Turret3_mc {
import flash.display.*;
public dynamic class barrel extends MovieClip {
public function barrel(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package gfx.Turret3_mc
Section 183
//Background_In_Game (gfx.ui.Background_In_Game)
package gfx.ui {
import flash.display.*;
public dynamic class Background_In_Game extends MovieClip {
}
}//package gfx.ui
Section 184
//btn_Iphone (gfx.ui.btn_Iphone)
package gfx.ui {
import flash.display.*;
public dynamic class btn_Iphone extends MovieClip {
}
}//package gfx.ui
Section 185
//DamageDisplay_mc (gfx.ui.DamageDisplay_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class DamageDisplay_mc extends MovieClip {
public var __id9_:LocalizedTextField;
public var __id10_:LocalizedTextField;
public var damageMeter:DamageMeter_mc;
public var damageText:TextField;
public var targetText:TextField;
public var targetMeter:DamageMeter_mc;
public function DamageDisplay_mc(){
__setProp___id9__gfx();
__setProp___id10__gfx();
}
function __setProp___id10__gfx(){
try {
__id10_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id10_.text = "{Damage}";
__id10_.textColor = 0xFFFFFF;
__id10_.textSize = 14;
__id10_.bold = false;
__id10_.embedFonts = true;
__id10_.font = "Myriad Pro Light";
__id10_.hAlign = "left";
__id10_.multiline = false;
__id10_.vAlign = "top";
__id10_.antiAliasType = "advanced";
__id10_.glowBlur = 3;
__id10_.glowColor = 0;
__id10_.useGlowFilter = false;
__id10_.glowQuality = 1;
__id10_.glowStrength = 5;
__id10_.gridFitType = "pixel";
__id10_.italic = false;
__id10_.selectable = false;
__id10_.underline = false;
try {
__id10_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id9__gfx(){
try {
__id9_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id9_.text = "{Target}";
__id9_.textColor = 0xFFFFFF;
__id9_.textSize = 14;
__id9_.bold = false;
__id9_.embedFonts = true;
__id9_.font = "Myriad Pro Light";
__id9_.hAlign = "left";
__id9_.multiline = false;
__id9_.vAlign = "top";
__id9_.antiAliasType = "advanced";
__id9_.glowBlur = 3;
__id9_.glowColor = 0;
__id9_.useGlowFilter = false;
__id9_.glowQuality = 1;
__id9_.glowStrength = 5;
__id9_.gridFitType = "pixel";
__id9_.italic = false;
__id9_.selectable = false;
__id9_.underline = false;
try {
__id9_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 186
//DamageMeter_mc (gfx.ui.DamageMeter_mc)
package gfx.ui {
import flash.display.*;
public dynamic class DamageMeter_mc extends MovieClip {
public var bars:MovieClip;
}
}//package gfx.ui
Section 187
//GameCompleteScreen_mc (gfx.ui.GameCompleteScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class GameCompleteScreen_mc extends MovieClip {
public var __id46_:LocalizedTextField;
public var titleText:LocalizedTextField;
public var submitScoreButton:MovieClip;
public var background:Background_In_Game;
public var backButton:MovieClip;
public var gore:MovieClip;
public var scoreText:LocalizedTextField;
public function GameCompleteScreen_mc(){
__setProp_titleText_gfx();
__setProp___id46__gfx();
__setProp_scoreText_gfx();
}
function __setProp_scoreText_gfx(){
try {
scoreText["componentInspectorSetting"] = true;
} catch(e:Error) {
};
scoreText.text = "$9999";
scoreText.textColor = 15822392;
scoreText.textSize = 50;
scoreText.bold = true;
scoreText.embedFonts = true;
scoreText.font = "Myriad Pro";
scoreText.hAlign = "center";
scoreText.multiline = false;
scoreText.vAlign = "middle";
scoreText.antiAliasType = "advanced";
scoreText.glowBlur = 4;
scoreText.glowColor = 0;
scoreText.useGlowFilter = true;
scoreText.glowQuality = 1;
scoreText.glowStrength = 5;
scoreText.gridFitType = "pixel";
scoreText.italic = false;
scoreText.selectable = false;
scoreText.underline = false;
try {
scoreText["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id46__gfx(){
try {
__id46_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id46_.text = "{Your_Score} :";
__id46_.textColor = 15822392;
__id46_.textSize = 40;
__id46_.bold = true;
__id46_.embedFonts = true;
__id46_.font = "Myriad Pro";
__id46_.hAlign = "center";
__id46_.multiline = false;
__id46_.vAlign = "middle";
__id46_.antiAliasType = "advanced";
__id46_.glowBlur = 4;
__id46_.glowColor = 0;
__id46_.useGlowFilter = true;
__id46_.glowQuality = 1;
__id46_.glowStrength = 5;
__id46_.gridFitType = "pixel";
__id46_.italic = false;
__id46_.selectable = false;
__id46_.underline = false;
try {
__id46_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_titleText_gfx(){
try {
titleText["componentInspectorSetting"] = true;
} catch(e:Error) {
};
titleText.text = "{Game_Complete}";
titleText.textColor = 15822392;
titleText.textSize = 70;
titleText.bold = true;
titleText.embedFonts = true;
titleText.font = "Myriad Pro";
titleText.hAlign = "center";
titleText.multiline = false;
titleText.vAlign = "middle";
titleText.antiAliasType = "advanced";
titleText.glowBlur = 4;
titleText.glowColor = 0;
titleText.useGlowFilter = true;
titleText.glowQuality = 1;
titleText.glowStrength = 5;
titleText.gridFitType = "pixel";
titleText.italic = false;
titleText.selectable = false;
titleText.underline = false;
try {
titleText["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 188
//LevelComplete_mc (gfx.ui.LevelComplete_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LevelComplete_mc extends MovieClip {
public var mines:WeaponCategory;
public var retryButton:MovieClip;
public var __id12_:LocalizedTextField;
public var missiles:WeaponCategory;
public var profitText:TextField;
public var brandingButton:MovieClip;
public var __id20_:LocalizedTextField;
public var legDamage:MovieClip;
public var __id17_:LocalizedTextField;
public var totalDamageText:TextField;
public var improvementText:TextField;
public var moneyEarnedText:TextField;
public var __id21_:LocalizedTextField;
public var levelCompleteText:LocalizedTextField;
public var spikes:WeaponCategory;
public var background:Background_In_Game;
public var __id13_:LocalizedTextField;
public var sendToFriendButton:MovieClip;
public var guns:WeaponCategory;
public var __id18_:LocalizedTextField;
public var __id14_:LocalizedTextField;
public var torsoDamage:MovieClip;
public var __id22_:LocalizedTextField;
public var targetDamageText:TextField;
public var improvementMessage:LocalizedTextField;
public var totalDamage:MovieClip;
public var moneySpentText:TextField;
public var __id19_:LocalizedTextField;
public var __id15_:LocalizedTextField;
public var specials:WeaponCategory;
public var nextLevelButton:MovieClip;
public var __id11_:LocalizedTextField;
public var targetDamage:MovieClip;
public var __id23_:LocalizedTextField;
public var headDamage:MovieClip;
public var armDamage:MovieClip;
public var platforms:WeaponCategory;
public var __id16_:LocalizedTextField;
public function LevelComplete_mc(){
__setProp___id11__gfx();
__setProp___id12__gfx();
__setProp_levelCompleteText_gfx();
__setProp___id13__gfx();
__setProp___id14__gfx();
__setProp___id15__gfx();
__setProp___id16__gfx();
__setProp___id17__gfx();
__setProp___id18__gfx();
__setProp___id19__gfx();
__setProp___id20__gfx();
__setProp___id21__gfx();
__setProp___id22__gfx();
__setProp_improvementMessage_gfx();
__setProp___id23__gfx();
}
function __setProp_improvementMessage_gfx(){
try {
improvementMessage["componentInspectorSetting"] = true;
} catch(e:Error) {
};
improvementMessage.text = "{Improved}";
improvementMessage.textColor = 0xEEEEEE;
improvementMessage.textSize = 16;
improvementMessage.bold = false;
improvementMessage.embedFonts = true;
improvementMessage.font = "Myriad Pro";
improvementMessage.hAlign = "center";
improvementMessage.multiline = false;
improvementMessage.vAlign = "middle";
improvementMessage.antiAliasType = "advanced";
improvementMessage.glowBlur = 3;
improvementMessage.glowColor = 0;
improvementMessage.useGlowFilter = false;
improvementMessage.glowQuality = 1;
improvementMessage.glowStrength = 5;
improvementMessage.gridFitType = "pixel";
improvementMessage.italic = false;
improvementMessage.selectable = false;
improvementMessage.underline = false;
try {
improvementMessage["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id19__gfx(){
try {
__id19_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id19_.text = "{Profit}:";
__id19_.textColor = 0xEEEEEE;
__id19_.textSize = 24;
__id19_.bold = false;
__id19_.embedFonts = true;
__id19_.font = "Myriad Pro";
__id19_.hAlign = "left";
__id19_.multiline = false;
__id19_.vAlign = "top";
__id19_.antiAliasType = "advanced";
__id19_.glowBlur = 3;
__id19_.glowColor = 0;
__id19_.useGlowFilter = false;
__id19_.glowQuality = 1;
__id19_.glowStrength = 5;
__id19_.gridFitType = "pixel";
__id19_.italic = false;
__id19_.selectable = false;
__id19_.underline = false;
try {
__id19_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id12__gfx(){
try {
__id12_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id12_.text = "{Damage}";
__id12_.textColor = 0xFFFFFF;
__id12_.textSize = 20;
__id12_.bold = true;
__id12_.embedFonts = true;
__id12_.font = "Myriad Pro Light";
__id12_.hAlign = "left";
__id12_.multiline = false;
__id12_.vAlign = "top";
__id12_.antiAliasType = "advanced";
__id12_.glowBlur = 3;
__id12_.glowColor = 0;
__id12_.useGlowFilter = false;
__id12_.glowQuality = 1;
__id12_.glowStrength = 5;
__id12_.gridFitType = "pixel";
__id12_.italic = false;
__id12_.selectable = false;
__id12_.underline = true;
try {
__id12_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id16__gfx(){
try {
__id16_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id16_.text = "{Torso}";
__id16_.textColor = 0xEEEEEE;
__id16_.textSize = 14;
__id16_.bold = false;
__id16_.embedFonts = true;
__id16_.font = "Myriad Pro";
__id16_.hAlign = "center";
__id16_.multiline = false;
__id16_.vAlign = "top";
__id16_.antiAliasType = "advanced";
__id16_.glowBlur = 3;
__id16_.glowColor = 0;
__id16_.useGlowFilter = false;
__id16_.glowQuality = 1;
__id16_.glowStrength = 5;
__id16_.gridFitType = "pixel";
__id16_.italic = false;
__id16_.selectable = false;
__id16_.underline = false;
try {
__id16_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id15__gfx(){
try {
__id15_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id15_.text = "{Arms}";
__id15_.textColor = 0xEEEEEE;
__id15_.textSize = 14;
__id15_.bold = false;
__id15_.embedFonts = true;
__id15_.font = "Myriad Pro";
__id15_.hAlign = "center";
__id15_.multiline = false;
__id15_.vAlign = "top";
__id15_.antiAliasType = "advanced";
__id15_.glowBlur = 3;
__id15_.glowColor = 0;
__id15_.useGlowFilter = false;
__id15_.glowQuality = 1;
__id15_.glowStrength = 5;
__id15_.gridFitType = "pixel";
__id15_.italic = false;
__id15_.selectable = false;
__id15_.underline = false;
try {
__id15_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id20__gfx(){
try {
__id20_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id20_.text = "{Spent} :";
__id20_.textColor = 0xEEEEEE;
__id20_.textSize = 14;
__id20_.bold = false;
__id20_.embedFonts = true;
__id20_.font = "Myriad Pro";
__id20_.hAlign = "left";
__id20_.multiline = false;
__id20_.vAlign = "top";
__id20_.antiAliasType = "advanced";
__id20_.glowBlur = 3;
__id20_.glowColor = 0;
__id20_.useGlowFilter = false;
__id20_.glowQuality = 1;
__id20_.glowStrength = 5;
__id20_.gridFitType = "pixel";
__id20_.italic = false;
__id20_.selectable = false;
__id20_.underline = false;
try {
__id20_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id21__gfx(){
try {
__id21_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id21_.text = "{Earned} :";
__id21_.textColor = 0xEEEEEE;
__id21_.textSize = 14;
__id21_.bold = false;
__id21_.embedFonts = true;
__id21_.font = "Myriad Pro";
__id21_.hAlign = "left";
__id21_.multiline = false;
__id21_.vAlign = "top";
__id21_.antiAliasType = "advanced";
__id21_.glowBlur = 3;
__id21_.glowColor = 0;
__id21_.useGlowFilter = false;
__id21_.glowQuality = 1;
__id21_.glowStrength = 5;
__id21_.gridFitType = "pixel";
__id21_.italic = false;
__id21_.selectable = false;
__id21_.underline = false;
try {
__id21_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_levelCompleteText_gfx(){
try {
levelCompleteText["componentInspectorSetting"] = true;
} catch(e:Error) {
};
levelCompleteText.text = "{Level_Complete}";
levelCompleteText.textColor = 0xFFFFFF;
levelCompleteText.textSize = 30;
levelCompleteText.bold = true;
levelCompleteText.embedFonts = true;
levelCompleteText.font = "Myriad Pro";
levelCompleteText.hAlign = "left";
levelCompleteText.multiline = false;
levelCompleteText.vAlign = "top";
levelCompleteText.antiAliasType = "advanced";
levelCompleteText.glowBlur = 3;
levelCompleteText.glowColor = 0;
levelCompleteText.useGlowFilter = false;
levelCompleteText.glowQuality = 1;
levelCompleteText.glowStrength = 5;
levelCompleteText.gridFitType = "pixel";
levelCompleteText.italic = false;
levelCompleteText.selectable = false;
levelCompleteText.underline = false;
try {
levelCompleteText["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id18__gfx(){
try {
__id18_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id18_.text = "{Total_Damage}";
__id18_.textColor = 0xEEEEEE;
__id18_.textSize = 16;
__id18_.bold = false;
__id18_.embedFonts = true;
__id18_.font = "Myriad Pro";
__id18_.hAlign = "left";
__id18_.multiline = false;
__id18_.vAlign = "top";
__id18_.antiAliasType = "advanced";
__id18_.glowBlur = 3;
__id18_.glowColor = 0;
__id18_.useGlowFilter = false;
__id18_.glowQuality = 1;
__id18_.glowStrength = 5;
__id18_.gridFitType = "pixel";
__id18_.italic = false;
__id18_.selectable = false;
__id18_.underline = false;
try {
__id18_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id14__gfx(){
try {
__id14_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id14_.text = "{Head}";
__id14_.textColor = 0xEEEEEE;
__id14_.textSize = 14;
__id14_.bold = false;
__id14_.embedFonts = true;
__id14_.font = "Myriad Pro";
__id14_.hAlign = "center";
__id14_.multiline = false;
__id14_.vAlign = "top";
__id14_.antiAliasType = "advanced";
__id14_.glowBlur = 3;
__id14_.glowColor = 0;
__id14_.useGlowFilter = false;
__id14_.glowQuality = 1;
__id14_.glowStrength = 5;
__id14_.gridFitType = "pixel";
__id14_.italic = false;
__id14_.selectable = false;
__id14_.underline = false;
try {
__id14_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id13__gfx(){
try {
__id13_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id13_.text = "{Target_Damage}";
__id13_.textColor = 0xEEEEEE;
__id13_.textSize = 16;
__id13_.bold = false;
__id13_.embedFonts = true;
__id13_.font = "Myriad Pro";
__id13_.hAlign = "left";
__id13_.multiline = false;
__id13_.vAlign = "top";
__id13_.antiAliasType = "advanced";
__id13_.glowBlur = 3;
__id13_.glowColor = 0;
__id13_.useGlowFilter = false;
__id13_.glowQuality = 1;
__id13_.glowStrength = 5;
__id13_.gridFitType = "pixel";
__id13_.italic = false;
__id13_.selectable = false;
__id13_.underline = false;
try {
__id13_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id17__gfx(){
try {
__id17_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id17_.text = "{Legs}";
__id17_.textColor = 0xEEEEEE;
__id17_.textSize = 14;
__id17_.bold = false;
__id17_.embedFonts = true;
__id17_.font = "Myriad Pro";
__id17_.hAlign = "center";
__id17_.multiline = false;
__id17_.vAlign = "top";
__id17_.antiAliasType = "advanced";
__id17_.glowBlur = 3;
__id17_.glowColor = 0;
__id17_.useGlowFilter = false;
__id17_.glowQuality = 1;
__id17_.glowStrength = 5;
__id17_.gridFitType = "pixel";
__id17_.italic = false;
__id17_.selectable = false;
__id17_.underline = false;
try {
__id17_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id22__gfx(){
try {
__id22_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id22_.text = "{Finance}";
__id22_.textColor = 0xFFFFFF;
__id22_.textSize = 20;
__id22_.bold = true;
__id22_.embedFonts = true;
__id22_.font = "Myriad Pro Light";
__id22_.hAlign = "left";
__id22_.multiline = false;
__id22_.vAlign = "top";
__id22_.antiAliasType = "advanced";
__id22_.glowBlur = 3;
__id22_.glowColor = 0;
__id22_.useGlowFilter = false;
__id22_.glowQuality = 1;
__id22_.glowStrength = 5;
__id22_.gridFitType = "pixel";
__id22_.italic = false;
__id22_.selectable = false;
__id22_.underline = true;
try {
__id22_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id11__gfx(){
try {
__id11_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id11_.text = "{Weapons_Unlocked}";
__id11_.textColor = 0xFFFFFF;
__id11_.textSize = 18;
__id11_.bold = false;
__id11_.embedFonts = true;
__id11_.font = "Myriad Pro";
__id11_.hAlign = "center";
__id11_.multiline = false;
__id11_.vAlign = "top";
__id11_.antiAliasType = "advanced";
__id11_.glowBlur = 3;
__id11_.glowColor = 0;
__id11_.useGlowFilter = false;
__id11_.glowQuality = 1;
__id11_.glowStrength = 5;
__id11_.gridFitType = "pixel";
__id11_.italic = false;
__id11_.selectable = false;
__id11_.underline = false;
try {
__id11_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id23__gfx(){
try {
__id23_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id23_.text = "{More_Games_Text}";
__id23_.textColor = 0xFFFFFF;
__id23_.textSize = 12;
__id23_.bold = false;
__id23_.embedFonts = true;
__id23_.font = "Myriad Pro Light";
__id23_.hAlign = "center";
__id23_.multiline = false;
__id23_.vAlign = "top";
__id23_.antiAliasType = "normal";
__id23_.glowBlur = 3;
__id23_.glowColor = 0;
__id23_.useGlowFilter = false;
__id23_.glowQuality = 1;
__id23_.glowStrength = 5;
__id23_.gridFitType = "pixel";
__id23_.italic = false;
__id23_.selectable = false;
__id23_.underline = false;
try {
__id23_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 189
//LevelFailed_mc (gfx.ui.LevelFailed_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LevelFailed_mc extends MovieClip {
public var __id26_:LocalizedTextField;
public var back_btn:MovieClip;
public var retry_btn:MovieClip;
public var background:Background_In_Game;
public function LevelFailed_mc(){
__setProp___id26__gfx();
}
function __setProp___id26__gfx(){
try {
__id26_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id26_.text = "{Level_Failed}";
__id26_.textColor = 0xFFFFFF;
__id26_.textSize = 30;
__id26_.bold = true;
__id26_.embedFonts = true;
__id26_.font = "Myriad Pro";
__id26_.hAlign = "center";
__id26_.multiline = false;
__id26_.vAlign = "top";
__id26_.antiAliasType = "normal";
__id26_.glowBlur = 3;
__id26_.glowColor = 0;
__id26_.useGlowFilter = false;
__id26_.glowQuality = 1;
__id26_.glowStrength = 5;
__id26_.gridFitType = "pixel";
__id26_.italic = false;
__id26_.selectable = false;
__id26_.underline = false;
try {
__id26_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 190
//LevelFailedMessage_mc (gfx.ui.LevelFailedMessage_mc)
package gfx.ui {
import flash.display.*;
public dynamic class LevelFailedMessage_mc extends MovieClip {
public function LevelFailedMessage_mc(){
addFrameScript(76, frame77);
}
function frame77(){
stop();
parent.removeChild(this);
}
}
}//package gfx.ui
Section 191
//LevelSelectionButton (gfx.ui.LevelSelectionButton)
package gfx.ui {
import flash.display.*;
import flash.text.*;
public dynamic class LevelSelectionButton extends MovieClip {
public var profitText:TextField;
public var levelText:TextField;
}
}//package gfx.ui
Section 192
//LevelSelectionScreen_mc (gfx.ui.LevelSelectionScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LevelSelectionScreen_mc extends MovieClip {
public var locked:MovieClip;
public var b0:LevelSelectionButton;
public var b1:LevelSelectionButton;
public var b2:LevelSelectionButton;
public var profitText:TextField;
public var b4:LevelSelectionButton;
public var b5:LevelSelectionButton;
public var b6:LevelSelectionButton;
public var b7:LevelSelectionButton;
public var b3:LevelSelectionButton;
public var __id29_:LocalizedTextField;
public var scoreImprovedText:LocalizedTextField;
public var submitScoreButton:MovieClip;
public var background:Background_In_Game;
public var backButton:MovieClip;
public var __id28_:LocalizedTextField;
public function LevelSelectionScreen_mc(){
__setProp___id28__gfx();
__setProp___id29__gfx();
__setProp_scoreImprovedText_gfx();
}
function __setProp_scoreImprovedText_gfx(){
try {
scoreImprovedText["componentInspectorSetting"] = true;
} catch(e:Error) {
};
scoreImprovedText.text = "{Score_Improved}";
scoreImprovedText.textColor = 0xEEEEEE;
scoreImprovedText.textSize = 16;
scoreImprovedText.bold = false;
scoreImprovedText.embedFonts = true;
scoreImprovedText.font = "Myriad Pro";
scoreImprovedText.hAlign = "center";
scoreImprovedText.multiline = false;
scoreImprovedText.vAlign = "top";
scoreImprovedText.antiAliasType = "advanced";
scoreImprovedText.glowBlur = 3;
scoreImprovedText.glowColor = 0;
scoreImprovedText.useGlowFilter = false;
scoreImprovedText.glowQuality = 1;
scoreImprovedText.glowStrength = 5;
scoreImprovedText.gridFitType = "pixel";
scoreImprovedText.italic = false;
scoreImprovedText.selectable = false;
scoreImprovedText.underline = false;
try {
scoreImprovedText["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id28__gfx(){
try {
__id28_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id28_.text = "{Total_Profit}:";
__id28_.textColor = 0xEEEEEE;
__id28_.textSize = 30;
__id28_.bold = false;
__id28_.embedFonts = true;
__id28_.font = "Myriad Pro";
__id28_.hAlign = "right";
__id28_.multiline = false;
__id28_.vAlign = "top";
__id28_.antiAliasType = "advanced";
__id28_.glowBlur = 3;
__id28_.glowColor = 0;
__id28_.useGlowFilter = false;
__id28_.glowQuality = 1;
__id28_.glowStrength = 5;
__id28_.gridFitType = "pixel";
__id28_.italic = false;
__id28_.selectable = false;
__id28_.underline = false;
try {
__id28_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id29__gfx(){
try {
__id29_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id29_.text = "{Select_Level}";
__id29_.textColor = 0xFFFFFF;
__id29_.textSize = 40;
__id29_.bold = true;
__id29_.embedFonts = true;
__id29_.font = "Myriad Pro";
__id29_.hAlign = "center";
__id29_.multiline = false;
__id29_.vAlign = "top";
__id29_.antiAliasType = "advanced";
__id29_.glowBlur = 3;
__id29_.glowColor = 0;
__id29_.useGlowFilter = false;
__id29_.glowQuality = 1;
__id29_.glowStrength = 5;
__id29_.gridFitType = "pixel";
__id29_.italic = false;
__id29_.selectable = false;
__id29_.underline = false;
try {
__id29_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 193
//OptionsScreen_mc (gfx.ui.OptionsScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class OptionsScreen_mc extends MovieClip {
public var achievementButton:MovieClip;
public var backToMainButton:MovieClip;
public var __id42_:LocalizedTextField;
public var volumeControl:VolumeControl_mc;
public var background:Background_In_Game;
public var sendToFriendButton:MovieClip;
public var levelSelectButton:MovieClip;
public var backButton:MovieClip;
public var qualityControl:QualityControl_mc;
public function OptionsScreen_mc(){
__setProp___id42__gfx();
}
function __setProp___id42__gfx(){
try {
__id42_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id42_.text = "{Quality}";
__id42_.textColor = 0xFFFFFF;
__id42_.textSize = 12;
__id42_.bold = false;
__id42_.embedFonts = true;
__id42_.font = "Myriad Pro Light";
__id42_.hAlign = "center";
__id42_.multiline = false;
__id42_.vAlign = "top";
__id42_.antiAliasType = "advanced";
__id42_.glowBlur = 3;
__id42_.glowColor = 0;
__id42_.useGlowFilter = false;
__id42_.glowQuality = 1;
__id42_.glowStrength = 5;
__id42_.gridFitType = "pixel";
__id42_.italic = false;
__id42_.selectable = false;
__id42_.underline = false;
try {
__id42_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 194
//PlaybackDamageDisplay (gfx.ui.PlaybackDamageDisplay)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class PlaybackDamageDisplay extends MovieClip {
public var __id8_:LocalizedTextField;
public var damageMeter:DamageMeter_mc;
public var damageText:TextField;
public function PlaybackDamageDisplay(){
__setProp___id8__gfx();
}
function __setProp___id8__gfx(){
try {
__id8_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id8_.text = "{Damage}";
__id8_.textColor = 0xFFFFFF;
__id8_.textSize = 14;
__id8_.bold = false;
__id8_.embedFonts = true;
__id8_.font = "Myriad Pro Light";
__id8_.hAlign = "left";
__id8_.multiline = false;
__id8_.vAlign = "top";
__id8_.antiAliasType = "advanced";
__id8_.glowBlur = 3;
__id8_.glowColor = 0;
__id8_.useGlowFilter = false;
__id8_.glowQuality = 1;
__id8_.glowStrength = 5;
__id8_.gridFitType = "pixel";
__id8_.italic = false;
__id8_.selectable = false;
__id8_.underline = false;
try {
__id8_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 195
//PlaybackEndScreen_mc (gfx.ui.PlaybackEndScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class PlaybackEndScreen_mc extends MovieClip {
public var __id37_:LocalizedTextField;
public var replayButton:MovieClip;
public var brandingButton:MovieClip;
public var background:Background_In_Game;
public var backButton:MovieClip;
public var damageMessage:LocalizedTextField;
public function PlaybackEndScreen_mc(){
__setProp_damageMessage_gfx();
__setProp___id37__gfx();
}
function __setProp___id37__gfx(){
try {
__id37_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id37_.text = "{More_Games_Text}";
__id37_.textColor = 0xFFFFFF;
__id37_.textSize = 16;
__id37_.bold = false;
__id37_.embedFonts = true;
__id37_.font = "Myriad Pro";
__id37_.hAlign = "center";
__id37_.multiline = false;
__id37_.vAlign = "middle";
__id37_.antiAliasType = "advanced";
__id37_.glowBlur = 3;
__id37_.glowColor = 0;
__id37_.useGlowFilter = false;
__id37_.glowQuality = 1;
__id37_.glowStrength = 5;
__id37_.gridFitType = "pixel";
__id37_.italic = false;
__id37_.selectable = false;
__id37_.underline = false;
try {
__id37_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_damageMessage_gfx(){
try {
damageMessage["componentInspectorSetting"] = true;
} catch(e:Error) {
};
damageMessage.text = "I got 9999 damage, can you beat me?";
damageMessage.textColor = 0xFFFFFF;
damageMessage.textSize = 16;
damageMessage.bold = false;
damageMessage.embedFonts = true;
damageMessage.font = "Myriad Pro";
damageMessage.hAlign = "center";
damageMessage.multiline = true;
damageMessage.vAlign = "middle";
damageMessage.antiAliasType = "advanced";
damageMessage.glowBlur = 3;
damageMessage.glowColor = 0;
damageMessage.useGlowFilter = false;
damageMessage.glowQuality = 1;
damageMessage.glowStrength = 5;
damageMessage.gridFitType = "pixel";
damageMessage.italic = false;
damageMessage.selectable = false;
damageMessage.underline = false;
try {
damageMessage["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 196
//PlayWithGoreScreen_mc (gfx.ui.PlayWithGoreScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class PlayWithGoreScreen_mc extends MovieClip {
public var withButton:MovieClip;
public var withoutButton:MovieClip;
public var text:LocalizedTextField;
public var background:Background_In_Game;
public function PlayWithGoreScreen_mc(){
__setProp_text_gfx();
}
function __setProp_text_gfx(){
try {
text["componentInspectorSetting"] = true;
} catch(e:Error) {
};
text.text = "{Gore_Message}";
text.textColor = 0xFFFFFF;
text.textSize = 16;
text.bold = true;
text.embedFonts = true;
text.font = "Myriad Pro";
text.hAlign = "center";
text.multiline = true;
text.vAlign = "middle";
text.antiAliasType = "advanced";
text.glowBlur = 3;
text.glowColor = 0;
text.useGlowFilter = false;
text.glowQuality = 1;
text.glowStrength = 5;
text.gridFitType = "pixel";
text.italic = false;
text.selectable = false;
text.underline = false;
try {
text["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 197
//Preloader_mc (gfx.ui.Preloader_mc)
package gfx.ui {
import flash.display.*;
public dynamic class Preloader_mc extends MovieClip {
public var brandingButton:MovieClip;
public var loadingBar:MovieClip;
}
}//package gfx.ui
Section 198
//QualityControl_mc (gfx.ui.QualityControl_mc)
package gfx.ui {
import flash.display.*;
public dynamic class QualityControl_mc extends MovieClip {
public var high:MovieClip;
public var low:MovieClip;
public var meduim:MovieClip;
}
}//package gfx.ui
Section 199
//SendToFriendScreen_mc (gfx.ui.SendToFriendScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SendToFriendScreen_mc extends MovieClip {
public var urlText:TextField;
public var __id33_:LocalizedTextField;
public var __id32_:LocalizedTextField;
public var __id31_:LocalizedTextField;
public var copyButton:MovieClip;
public var background:Background_In_Game;
public var backButton:MovieClip;
public var nameText:TextField;
public function SendToFriendScreen_mc(){
__setProp___id31__gfx();
__setProp___id32__gfx();
__setProp___id33__gfx();
}
function __setProp___id33__gfx(){
try {
__id33_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id33_.text = "{Send_To_Friend}";
__id33_.textColor = 0xFFFFFF;
__id33_.textSize = 32;
__id33_.bold = true;
__id33_.embedFonts = true;
__id33_.font = "Myriad Pro";
__id33_.hAlign = "center";
__id33_.multiline = false;
__id33_.vAlign = "top";
__id33_.antiAliasType = "advanced";
__id33_.glowBlur = 3;
__id33_.glowColor = 0;
__id33_.useGlowFilter = false;
__id33_.glowQuality = 1;
__id33_.glowStrength = 5;
__id33_.gridFitType = "pixel";
__id33_.italic = false;
__id33_.selectable = false;
__id33_.underline = false;
try {
__id33_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id31__gfx(){
try {
__id31_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id31_.text = "{Your_Name} :";
__id31_.textColor = 0xEEEEEE;
__id31_.textSize = 14;
__id31_.bold = false;
__id31_.embedFonts = true;
__id31_.font = "Myriad Pro";
__id31_.hAlign = "center";
__id31_.multiline = false;
__id31_.vAlign = "top";
__id31_.antiAliasType = "advanced";
__id31_.glowBlur = 3;
__id31_.glowColor = 0;
__id31_.useGlowFilter = false;
__id31_.glowQuality = 1;
__id31_.glowStrength = 5;
__id31_.gridFitType = "pixel";
__id31_.italic = false;
__id31_.selectable = false;
__id31_.underline = false;
try {
__id31_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id32__gfx(){
try {
__id32_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id32_.text = "{URL} :";
__id32_.textColor = 0xEEEEEE;
__id32_.textSize = 14;
__id32_.bold = false;
__id32_.embedFonts = true;
__id32_.font = "Myriad Pro";
__id32_.hAlign = "center";
__id32_.multiline = false;
__id32_.vAlign = "top";
__id32_.antiAliasType = "advanced";
__id32_.glowBlur = 3;
__id32_.glowColor = 0;
__id32_.useGlowFilter = false;
__id32_.glowQuality = 1;
__id32_.glowStrength = 5;
__id32_.gridFitType = "pixel";
__id32_.italic = false;
__id32_.selectable = false;
__id32_.underline = false;
try {
__id32_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 200
//SentFromFriendScreen_mc (gfx.ui.SentFromFriendScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SentFromFriendScreen_mc extends MovieClip {
public var bg:MovieClip;
public var playButton:MovieClip;
public var brandingButton:MovieClip;
public var background:Background_In_Game;
public var messageText:LocalizedTextField;
public var backButton:MovieClip;
public function SentFromFriendScreen_mc(){
__setProp_messageText_gfx();
}
function __setProp_messageText_gfx(){
try {
messageText["componentInspectorSetting"] = true;
} catch(e:Error) {
};
messageText.text = "{Friend_Message}";
messageText.textColor = 15822392;
messageText.textSize = 32;
messageText.bold = false;
messageText.embedFonts = true;
messageText.font = "Myriad Pro";
messageText.hAlign = "center";
messageText.multiline = false;
messageText.vAlign = "middle";
messageText.antiAliasType = "advanced";
messageText.glowBlur = 3;
messageText.glowColor = 0;
messageText.useGlowFilter = false;
messageText.glowQuality = 1;
messageText.glowStrength = 5;
messageText.gridFitType = "pixel";
messageText.italic = false;
messageText.selectable = false;
messageText.underline = false;
try {
messageText["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 201
//Sidebar_mc (gfx.ui.Sidebar_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import gfx.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Sidebar_mc extends MovieClip {
public var __id7_:LocalizedTextField;
public var brandingButton:MovieClip;
public var levelText:LocalizedTextField;
public var bugget_txt:TextField;
public var toolSelector:ToolSelector_mc;
public var damageDisplay:DamageDisplay_mc;
public var stop_btn:MovieClip;
public var playbackDamage:PlaybackDamageDisplay;
public var optionsButton:options_button;
public var bugget_title:LocalizedTextField;
public var start_btn:StartButton;
public function Sidebar_mc(){
__setProp___id7__gfx();
__setProp_levelText_gfx();
__setProp_bugget_title_gfx();
}
function __setProp_levelText_gfx(){
try {
levelText["componentInspectorSetting"] = true;
} catch(e:Error) {
};
levelText.text = "Level 1/8";
levelText.textColor = 0xFFFFFF;
levelText.textSize = 13;
levelText.bold = false;
levelText.embedFonts = true;
levelText.font = "Myriad Pro Light";
levelText.hAlign = "left";
levelText.multiline = false;
levelText.vAlign = "top";
levelText.antiAliasType = "advanced";
levelText.glowBlur = 3;
levelText.glowColor = 0;
levelText.useGlowFilter = false;
levelText.glowQuality = 1;
levelText.glowStrength = 5;
levelText.gridFitType = "pixel";
levelText.italic = false;
levelText.selectable = false;
levelText.underline = false;
try {
levelText["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_bugget_title_gfx(){
try {
bugget_title["componentInspectorSetting"] = true;
} catch(e:Error) {
};
bugget_title.text = "{Bugget} :";
bugget_title.textColor = 0xFFFFFF;
bugget_title.textSize = 13;
bugget_title.bold = false;
bugget_title.embedFonts = true;
bugget_title.font = "Myriad Pro Light";
bugget_title.hAlign = "left";
bugget_title.multiline = false;
bugget_title.vAlign = "top";
bugget_title.antiAliasType = "advanced";
bugget_title.glowBlur = 3;
bugget_title.glowColor = 0;
bugget_title.useGlowFilter = false;
bugget_title.glowQuality = 1;
bugget_title.glowStrength = 5;
bugget_title.gridFitType = "pixel";
bugget_title.italic = false;
bugget_title.selectable = false;
bugget_title.underline = false;
try {
bugget_title["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id7__gfx(){
try {
__id7_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id7_.text = "{More_Games_Text}";
__id7_.textColor = 0xFFFFFF;
__id7_.textSize = 12;
__id7_.bold = false;
__id7_.embedFonts = true;
__id7_.font = "Myriad Pro Light";
__id7_.hAlign = "center";
__id7_.multiline = false;
__id7_.vAlign = "top";
__id7_.antiAliasType = "normal";
__id7_.glowBlur = 3;
__id7_.glowColor = 0;
__id7_.useGlowFilter = false;
__id7_.glowQuality = 1;
__id7_.glowStrength = 5;
__id7_.gridFitType = "pixel";
__id7_.italic = false;
__id7_.selectable = false;
__id7_.underline = false;
try {
__id7_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 202
//StartButton (gfx.ui.StartButton)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class StartButton extends MovieClip {
public var ducky_icon:MovieClip;
public var go_txt:LocalizedTextField;
public function StartButton(){
__setProp_go_txt_StartButton_Text_0();
}
function __setProp_go_txt_StartButton_Text_0(){
try {
go_txt["componentInspectorSetting"] = true;
} catch(e:Error) {
};
go_txt.text = "{GO}";
go_txt.textColor = 0xFFFFFF;
go_txt.textSize = 18;
go_txt.bold = false;
go_txt.embedFonts = true;
go_txt.font = "Myriad Pro Light";
go_txt.hAlign = "center";
go_txt.multiline = false;
go_txt.vAlign = "middle";
go_txt.antiAliasType = "advanced";
go_txt.glowBlur = 3;
go_txt.glowColor = 0;
go_txt.useGlowFilter = false;
go_txt.glowQuality = 1;
go_txt.glowStrength = 5;
go_txt.gridFitType = "pixel";
go_txt.italic = false;
go_txt.selectable = false;
go_txt.underline = false;
try {
go_txt["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 203
//SubmitScoreScreen_mc (gfx.ui.SubmitScoreScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SubmitScoreScreen_mc extends MovieClip {
public var __id52_:LocalizedTextField;
public var __id51_:LocalizedTextField;
public var __id50_:LocalizedTextField;
public var submitButton:MovieClip;
public var background:Background_In_Game;
public var nameText:TextField;
public var backButton:MovieClip;
public var scoreText:TextField;
public function SubmitScoreScreen_mc(){
__setProp___id50__gfx();
__setProp___id51__gfx();
__setProp___id52__gfx();
}
function __setProp___id50__gfx(){
try {
__id50_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id50_.text = "{Your_Name} :";
__id50_.textColor = 0xEEEEEE;
__id50_.textSize = 14;
__id50_.bold = false;
__id50_.embedFonts = true;
__id50_.font = "Myriad Pro";
__id50_.hAlign = "center";
__id50_.multiline = false;
__id50_.vAlign = "top";
__id50_.antiAliasType = "advanced";
__id50_.glowBlur = 3;
__id50_.glowColor = 0;
__id50_.useGlowFilter = false;
__id50_.glowQuality = 1;
__id50_.glowStrength = 5;
__id50_.gridFitType = "pixel";
__id50_.italic = false;
__id50_.selectable = false;
__id50_.underline = false;
try {
__id50_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id51__gfx(){
try {
__id51_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id51_.text = "{Submit_Score}";
__id51_.textColor = 0xFFFFFF;
__id51_.textSize = 32;
__id51_.bold = true;
__id51_.embedFonts = true;
__id51_.font = "Myriad Pro";
__id51_.hAlign = "center";
__id51_.multiline = false;
__id51_.vAlign = "top";
__id51_.antiAliasType = "advanced";
__id51_.glowBlur = 3;
__id51_.glowColor = 0;
__id51_.useGlowFilter = false;
__id51_.glowQuality = 1;
__id51_.glowStrength = 5;
__id51_.gridFitType = "pixel";
__id51_.italic = false;
__id51_.selectable = false;
__id51_.underline = false;
try {
__id51_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id52__gfx(){
try {
__id52_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id52_.text = "{Your_Score} :";
__id52_.textColor = 0xEEEEEE;
__id52_.textSize = 14;
__id52_.bold = false;
__id52_.embedFonts = true;
__id52_.font = "Myriad Pro";
__id52_.hAlign = "center";
__id52_.multiline = false;
__id52_.vAlign = "top";
__id52_.antiAliasType = "advanced";
__id52_.glowBlur = 3;
__id52_.glowColor = 0;
__id52_.useGlowFilter = false;
__id52_.glowQuality = 1;
__id52_.glowStrength = 5;
__id52_.gridFitType = "pixel";
__id52_.italic = false;
__id52_.selectable = false;
__id52_.underline = false;
try {
__id52_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 204
//ToolMenuItem_mc (gfx.ui.ToolMenuItem_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class ToolMenuItem_mc extends MovieClip {
public var description:LocalizedTextField;
public var cost:LocalizedTextField;
public function ToolMenuItem_mc(){
__setProp_description_gfx();
__setProp_cost_gfx();
}
function __setProp_cost_gfx(){
try {
cost["componentInspectorSetting"] = true;
} catch(e:Error) {
};
cost.text = "1000";
cost.textColor = 0xFFFFFF;
cost.textSize = 14;
cost.bold = false;
cost.embedFonts = true;
cost.font = "Myriad Pro Light";
cost.hAlign = "center";
cost.multiline = false;
cost.vAlign = "middle";
cost.antiAliasType = "advanced";
cost.glowBlur = 3;
cost.glowColor = 0x333333;
cost.useGlowFilter = false;
cost.glowQuality = 1;
cost.glowStrength = 5;
cost.gridFitType = "pixel";
cost.italic = false;
cost.selectable = false;
cost.underline = false;
try {
cost["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_description_gfx(){
try {
description["componentInspectorSetting"] = true;
} catch(e:Error) {
};
description.text = "Tool Description";
description.textColor = 0xFFFFFF;
description.textSize = 14;
description.bold = false;
description.embedFonts = true;
description.font = "Myriad Pro Light";
description.hAlign = "left";
description.multiline = false;
description.vAlign = "middle";
description.antiAliasType = "advanced";
description.glowBlur = 3;
description.glowColor = 0x333333;
description.useGlowFilter = false;
description.glowQuality = 1;
description.glowStrength = 5;
description.gridFitType = "pixel";
description.italic = false;
description.selectable = false;
description.underline = false;
try {
description["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 205
//ToolMenuTab (gfx.ui.ToolMenuTab)
package gfx.ui {
import flash.display.*;
public dynamic class ToolMenuTab extends MovieClip {
}
}//package gfx.ui
Section 206
//ToolSelector_mc (gfx.ui.ToolSelector_mc)
package gfx.ui {
import flash.display.*;
import gfx.*;
public dynamic class ToolSelector_mc extends MovieClip {
public var item3:ToolMenuItem_mc;
public var item4:ToolMenuItem_mc;
public var springs:MovieClip;
public var other_icon:MovieClip;
public var spikes_icon:MovieClip;
public var missiles:MovieClip;
public var mines:MovieClip;
public var springs_icon:MovieClip;
public var guns_icon:MovieClip;
public var tab:ToolMenuTab;
public var other:MovieClip;
public var mines_icon:MovieClip;
public var missiles_icon:MovieClip;
public var spikes:MovieClip;
public var background:ToolMenuBackground;
public var guns:MovieClip;
public var item0:ToolMenuItem_mc;
public var item1:ToolMenuItem_mc;
public var item2:ToolMenuItem_mc;
}
}//package gfx.ui
Section 207
//TutorialIntroScreen_mc (gfx.ui.TutorialIntroScreen_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TutorialIntroScreen_mc extends MovieClip {
public var __id48_:LocalizedTextField;
public var continueButton:MovieClip;
public var text:LocalizedTextField;
public var background:Background_In_Game;
public function TutorialIntroScreen_mc(){
__setProp___id48__gfx();
__setProp_text_gfx();
}
function __setProp_text_gfx(){
try {
text["componentInspectorSetting"] = true;
} catch(e:Error) {
};
text.text = "{Tutorial_Intro_Text}";
text.textColor = 0xFFFFFF;
text.textSize = 16;
text.bold = true;
text.embedFonts = true;
text.font = "Myriad Pro";
text.hAlign = "center";
text.multiline = true;
text.vAlign = "middle";
text.antiAliasType = "advanced";
text.glowBlur = 3;
text.glowColor = 0;
text.useGlowFilter = false;
text.glowQuality = 1;
text.glowStrength = 5;
text.gridFitType = "pixel";
text.italic = false;
text.selectable = false;
text.underline = false;
try {
text["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id48__gfx(){
try {
__id48_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id48_.text = "{How_To_Play}";
__id48_.textColor = 0xFFFFFF;
__id48_.textSize = 32;
__id48_.bold = true;
__id48_.embedFonts = true;
__id48_.font = "Myriad Pro";
__id48_.hAlign = "center";
__id48_.multiline = false;
__id48_.vAlign = "top";
__id48_.antiAliasType = "advanced";
__id48_.glowBlur = 3;
__id48_.glowColor = 0;
__id48_.useGlowFilter = false;
__id48_.glowQuality = 1;
__id48_.glowStrength = 5;
__id48_.gridFitType = "pixel";
__id48_.italic = false;
__id48_.selectable = false;
__id48_.underline = false;
try {
__id48_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 208
//TutorialPopup_mc (gfx.ui.TutorialPopup_mc)
package gfx.ui {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TutorialPopup_mc extends MovieClip {
public var text:LocalizedTextField;
public var background:MovieClip;
public function TutorialPopup_mc(){
__setProp_text_gfx();
}
function __setProp_text_gfx(){
try {
text["componentInspectorSetting"] = true;
} catch(e:Error) {
};
text.text = "Scat";
text.textColor = 0xFFFFFF;
text.textSize = 16;
text.bold = true;
text.embedFonts = true;
text.font = "Myriad Pro";
text.hAlign = "center";
text.multiline = true;
text.vAlign = "middle";
text.antiAliasType = "advanced";
text.glowBlur = 3;
text.glowColor = 0;
text.useGlowFilter = false;
text.glowQuality = 1;
text.glowStrength = 5;
text.gridFitType = "pixel";
text.italic = false;
text.selectable = false;
text.underline = false;
try {
text["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx.ui
Section 209
//WeaponCategory (gfx.ui.WeaponCategory)
package gfx.ui {
import flash.display.*;
public dynamic class WeaponCategory extends MovieClip {
public var icon0:MovieClip;
public var icon1:MovieClip;
public var icon2:MovieClip;
public var icon3:MovieClip;
}
}//package gfx.ui
Section 210
//VolumeControl_mc (gfx.ui.VolumeControl_mc)
package gfx.ui {
import flash.display.*;
public dynamic class VolumeControl_mc extends MovieClip {
public var thumb:MovieClip;
}
}//package gfx.ui
Section 211
//Background (gfx.Background)
package gfx {
import flash.display.*;
public dynamic class Background extends MovieClip {
}
}//package gfx
Section 212
//BarrelFire (gfx.BarrelFire)
package gfx {
import flash.display.*;
public dynamic class BarrelFire extends MovieClip {
public function BarrelFire(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package gfx
Section 213
//Blood1 (gfx.Blood1)
package gfx {
import flash.display.*;
public dynamic class Blood1 extends MovieClip {
}
}//package gfx
Section 214
//Blood10 (gfx.Blood10)
package gfx {
import flash.display.*;
public dynamic class Blood10 extends MovieClip {
}
}//package gfx
Section 215
//Blood11 (gfx.Blood11)
package gfx {
import flash.display.*;
public dynamic class Blood11 extends MovieClip {
}
}//package gfx
Section 216
//Blood12 (gfx.Blood12)
package gfx {
import flash.display.*;
public dynamic class Blood12 extends MovieClip {
}
}//package gfx
Section 217
//Blood13 (gfx.Blood13)
package gfx {
import flash.display.*;
public dynamic class Blood13 extends MovieClip {
}
}//package gfx
Section 218
//Blood2 (gfx.Blood2)
package gfx {
import flash.display.*;
public dynamic class Blood2 extends MovieClip {
}
}//package gfx
Section 219
//Blood3 (gfx.Blood3)
package gfx {
import flash.display.*;
public dynamic class Blood3 extends MovieClip {
}
}//package gfx
Section 220
//Blood4 (gfx.Blood4)
package gfx {
import flash.display.*;
public dynamic class Blood4 extends MovieClip {
}
}//package gfx
Section 221
//Blood5 (gfx.Blood5)
package gfx {
import flash.display.*;
public dynamic class Blood5 extends MovieClip {
}
}//package gfx
Section 222
//Blood6 (gfx.Blood6)
package gfx {
import flash.display.*;
public dynamic class Blood6 extends MovieClip {
}
}//package gfx
Section 223
//Blood7 (gfx.Blood7)
package gfx {
import flash.display.*;
public dynamic class Blood7 extends MovieClip {
}
}//package gfx
Section 224
//Blood8 (gfx.Blood8)
package gfx {
import flash.display.*;
public dynamic class Blood8 extends MovieClip {
}
}//package gfx
Section 225
//Blood9 (gfx.Blood9)
package gfx {
import flash.display.*;
public dynamic class Blood9 extends MovieClip {
}
}//package gfx
Section 226
//BulletCasing (gfx.BulletCasing)
package gfx {
import flash.display.*;
public dynamic class BulletCasing extends MovieClip {
}
}//package gfx
Section 227
//BullitFireImpact_mc (gfx.BullitFireImpact_mc)
package gfx {
import flash.display.*;
public dynamic class BullitFireImpact_mc extends MovieClip {
}
}//package gfx
Section 228
//Cleaner_mc (gfx.Cleaner_mc)
package gfx {
import flash.display.*;
public dynamic class Cleaner_mc extends MovieClip {
}
}//package gfx
Section 229
//Current_mc (gfx.Current_mc)
package gfx {
import flash.display.*;
public dynamic class Current_mc extends MovieClip {
public var current:MovieClip;
}
}//package gfx
Section 230
//duck_mc (gfx.duck_mc)
package gfx {
import flash.display.*;
public dynamic class duck_mc extends MovieClip {
public function duck_mc(){
addFrameScript(0, frame1, 54, frame55);
}
function frame1(){
stop();
}
function frame55(){
stop();
}
}
}//package gfx
Section 231
//DuckIcon_icon (gfx.DuckIcon_icon)
package gfx {
import flash.display.*;
public dynamic class DuckIcon_icon extends MovieClip {
}
}//package gfx
Section 232
//FlakBlood1 (gfx.FlakBlood1)
package gfx {
import flash.display.*;
public dynamic class FlakBlood1 extends MovieClip {
}
}//package gfx
Section 233
//FlakBlood10 (gfx.FlakBlood10)
package gfx {
import flash.display.*;
public dynamic class FlakBlood10 extends MovieClip {
}
}//package gfx
Section 234
//FlakBlood11 (gfx.FlakBlood11)
package gfx {
import flash.display.*;
public dynamic class FlakBlood11 extends MovieClip {
}
}//package gfx
Section 235
//FlakBlood12 (gfx.FlakBlood12)
package gfx {
import flash.display.*;
public dynamic class FlakBlood12 extends MovieClip {
}
}//package gfx
Section 236
//FlakBlood13 (gfx.FlakBlood13)
package gfx {
import flash.display.*;
public dynamic class FlakBlood13 extends MovieClip {
}
}//package gfx
Section 237
//FlakBlood14 (gfx.FlakBlood14)
package gfx {
import flash.display.*;
public dynamic class FlakBlood14 extends MovieClip {
}
}//package gfx
Section 238
//FlakBlood15 (gfx.FlakBlood15)
package gfx {
import flash.display.*;
public dynamic class FlakBlood15 extends MovieClip {
}
}//package gfx
Section 239
//FlakBlood16 (gfx.FlakBlood16)
package gfx {
import flash.display.*;
public dynamic class FlakBlood16 extends MovieClip {
}
}//package gfx
Section 240
//FlakBlood17 (gfx.FlakBlood17)
package gfx {
import flash.display.*;
public dynamic class FlakBlood17 extends MovieClip {
}
}//package gfx
Section 241
//FlakBlood18 (gfx.FlakBlood18)
package gfx {
import flash.display.*;
public dynamic class FlakBlood18 extends MovieClip {
}
}//package gfx
Section 242
//FlakBlood19 (gfx.FlakBlood19)
package gfx {
import flash.display.*;
public dynamic class FlakBlood19 extends MovieClip {
}
}//package gfx
Section 243
//FlakBlood2 (gfx.FlakBlood2)
package gfx {
import flash.display.*;
public dynamic class FlakBlood2 extends MovieClip {
}
}//package gfx
Section 244
//FlakBlood20 (gfx.FlakBlood20)
package gfx {
import flash.display.*;
public dynamic class FlakBlood20 extends MovieClip {
}
}//package gfx
Section 245
//FlakBlood21 (gfx.FlakBlood21)
package gfx {
import flash.display.*;
public dynamic class FlakBlood21 extends MovieClip {
}
}//package gfx
Section 246
//FlakBlood3 (gfx.FlakBlood3)
package gfx {
import flash.display.*;
public dynamic class FlakBlood3 extends MovieClip {
}
}//package gfx
Section 247
//FlakBlood4 (gfx.FlakBlood4)
package gfx {
import flash.display.*;
public dynamic class FlakBlood4 extends MovieClip {
}
}//package gfx
Section 248
//FlakBlood5 (gfx.FlakBlood5)
package gfx {
import flash.display.*;
public dynamic class FlakBlood5 extends MovieClip {
}
}//package gfx
Section 249
//FlakBlood6 (gfx.FlakBlood6)
package gfx {
import flash.display.*;
public dynamic class FlakBlood6 extends MovieClip {
}
}//package gfx
Section 250
//FlakBlood7 (gfx.FlakBlood7)
package gfx {
import flash.display.*;
public dynamic class FlakBlood7 extends MovieClip {
}
}//package gfx
Section 251
//FlakBlood8 (gfx.FlakBlood8)
package gfx {
import flash.display.*;
public dynamic class FlakBlood8 extends MovieClip {
}
}//package gfx
Section 252
//FlakBlood9 (gfx.FlakBlood9)
package gfx {
import flash.display.*;
public dynamic class FlakBlood9 extends MovieClip {
}
}//package gfx
Section 253
//Flakboy (gfx.Flakboy)
package gfx {
import flash.display.*;
import spill.flakboy.graphics.*;
public dynamic class Flakboy extends MovieClip {
public var head:Head;
public var leftUpperArm:MovieClip;
public var rightLowerLeg:MovieClip;
public var rightUpperLeg:MovieClip;
public var leftLowerArm:MovieClip;
public var torso:Body;
public var leftLowerLeg:MovieClip;
public var rightUpperArm:MovieClip;
public var rightLowerArm:MovieClip;
public var leftUpperLeg:MovieClip;
}
}//package gfx
Section 254
//Hatch_mc (gfx.Hatch_mc)
package gfx {
import flash.display.*;
public dynamic class Hatch_mc extends MovieClip {
}
}//package gfx
Section 255
//HotSpotSkinner_mc (gfx.HotSpotSkinner_mc)
package gfx {
import flash.display.*;
public dynamic class HotSpotSkinner_mc extends MovieClip {
}
}//package gfx
Section 256
//MainMenu_mc (gfx.MainMenu_mc)
package gfx {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gfx.ui.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainMenu_mc extends MovieClip {
public var highscores_btn:MovieClip;
public var achievements_btn:MovieClip;
public var volumeControl:VolumeControl_mc;
public var brandingButton:MovieClip;
public var __id5_:LocalizedTextField;
public var __id4_:LocalizedTextField;
public var versionText:TextField;
public var qualityControl:QualityControl_mc;
public var start_btn:MovieClip;
public function MainMenu_mc(){
__setProp___id4__gfx();
__setProp___id5__gfx();
}
function __setProp___id4__gfx(){
try {
__id4_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id4_.text = "{Quality}";
__id4_.textColor = 0x333333;
__id4_.textSize = 12;
__id4_.bold = false;
__id4_.embedFonts = true;
__id4_.font = "Myriad Pro Light";
__id4_.hAlign = "center";
__id4_.multiline = false;
__id4_.vAlign = "top";
__id4_.antiAliasType = "advanced";
__id4_.glowBlur = 3;
__id4_.glowColor = 0;
__id4_.useGlowFilter = false;
__id4_.glowQuality = 1;
__id4_.glowStrength = 5;
__id4_.gridFitType = "pixel";
__id4_.italic = false;
__id4_.selectable = false;
__id4_.underline = false;
try {
__id4_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp___id5__gfx(){
try {
__id5_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id5_.text = "{More_Games_Text}";
__id5_.textColor = 0;
__id5_.textSize = 12;
__id5_.bold = true;
__id5_.embedFonts = true;
__id5_.font = "Myriad Pro";
__id5_.hAlign = "center";
__id5_.multiline = false;
__id5_.vAlign = "top";
__id5_.antiAliasType = "normal";
__id5_.glowBlur = 3;
__id5_.glowColor = 0;
__id5_.useGlowFilter = false;
__id5_.glowQuality = 1;
__id5_.glowStrength = 5;
__id5_.gridFitType = "pixel";
__id5_.italic = false;
__id5_.selectable = false;
__id5_.underline = false;
try {
__id5_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package gfx
Section 257
//Mine_icon (gfx.Mine_icon)
package gfx {
import flash.display.*;
public dynamic class Mine_icon extends MovieClip {
}
}//package gfx
Section 258
//Mine_mc (gfx.Mine_mc)
package gfx {
import flash.display.*;
public dynamic class Mine_mc extends MovieClip {
public function Mine_mc(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package gfx
Section 259
//Mine2_icon (gfx.Mine2_icon)
package gfx {
import flash.display.*;
public dynamic class Mine2_icon extends MovieClip {
}
}//package gfx
Section 260
//Mine2_mc (gfx.Mine2_mc)
package gfx {
import flash.display.*;
public dynamic class Mine2_mc extends MovieClip {
public function Mine2_mc(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package gfx
Section 261
//Mine3_icon (gfx.Mine3_icon)
package gfx {
import flash.display.*;
public dynamic class Mine3_icon extends MovieClip {
}
}//package gfx
Section 262
//Mine3_mc (gfx.Mine3_mc)
package gfx {
import flash.display.*;
public dynamic class Mine3_mc extends MovieClip {
public function Mine3_mc(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
}
}
}//package gfx
Section 263
//Mine4_icon (gfx.Mine4_icon)
package gfx {
import flash.display.*;
public dynamic class Mine4_icon extends MovieClip {
}
}//package gfx
Section 264
//Mine4_mc (gfx.Mine4_mc)
package gfx {
import flash.display.*;
public dynamic class Mine4_mc extends MovieClip {
public function Mine4_mc(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package gfx
Section 265
//Missile_icon (gfx.Missile_icon)
package gfx {
import flash.display.*;
public dynamic class Missile_icon extends MovieClip {
}
}//package gfx
Section 266
//Missile_mc (gfx.Missile_mc)
package gfx {
import flash.display.*;
public dynamic class Missile_mc extends MovieClip {
public function Missile_mc(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package gfx
Section 267
//Missile2_icon (gfx.Missile2_icon)
package gfx {
import flash.display.*;
public dynamic class Missile2_icon extends MovieClip {
}
}//package gfx
Section 268
//Missile2_mc (gfx.Missile2_mc)
package gfx {
import flash.display.*;
public dynamic class Missile2_mc extends MovieClip {
public function Missile2_mc(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package gfx
Section 269
//Missile3_icon (gfx.Missile3_icon)
package gfx {
import flash.display.*;
public dynamic class Missile3_icon extends MovieClip {
}
}//package gfx
Section 270
//Missile3_mc (gfx.Missile3_mc)
package gfx {
import flash.display.*;
public dynamic class Missile3_mc extends MovieClip {
public function Missile3_mc(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package gfx
Section 271
//MissileHatch_mc (gfx.MissileHatch_mc)
package gfx {
import flash.display.*;
public dynamic class MissileHatch_mc extends MovieClip {
}
}//package gfx
Section 272
//MissileHatch2_mc (gfx.MissileHatch2_mc)
package gfx {
import flash.display.*;
public dynamic class MissileHatch2_mc extends MovieClip {
}
}//package gfx
Section 273
//MissileHatch3_mc (gfx.MissileHatch3_mc)
package gfx {
import flash.display.*;
public dynamic class MissileHatch3_mc extends MovieClip {
}
}//package gfx
Section 274
//options_button (gfx.options_button)
package gfx {
import flash.display.*;
public dynamic class options_button extends MovieClip {
}
}//package gfx
Section 275
//Scared_mc (gfx.Scared_mc)
package gfx {
import flash.display.*;
public dynamic class Scared_mc extends MovieClip {
}
}//package gfx
Section 276
//Skinner_mc (gfx.Skinner_mc)
package gfx {
import flash.display.*;
public dynamic class Skinner_mc extends MovieClip {
}
}//package gfx
Section 277
//SmokeParticle (gfx.SmokeParticle)
package gfx {
import flash.display.*;
public dynamic class SmokeParticle extends MovieClip {
public var fire:MovieClip;
public function SmokeParticle(){
addFrameScript(9, frame10);
}
function frame10(){
parent.removeChild(this);
stop();
}
}
}//package gfx
Section 278
//special_icon (gfx.special_icon)
package gfx {
import flash.display.*;
public dynamic class special_icon extends MovieClip {
}
}//package gfx
Section 279
//Spikes_icon (gfx.Spikes_icon)
package gfx {
import flash.display.*;
public dynamic class Spikes_icon extends MovieClip {
}
}//package gfx
Section 280
//Spikes_mc (gfx.Spikes_mc)
package gfx {
import flash.display.*;
public dynamic class Spikes_mc extends MovieClip {
public var hit_area:MovieClip;
public var spikes:MovieClip;
}
}//package gfx
Section 281
//Spikes2_icon (gfx.Spikes2_icon)
package gfx {
import flash.display.*;
public dynamic class Spikes2_icon extends MovieClip {
}
}//package gfx
Section 282
//Spikes2_mc (gfx.Spikes2_mc)
package gfx {
import flash.display.*;
public dynamic class Spikes2_mc extends MovieClip {
public var hit_area:MovieClip;
public var spikes:MovieClip;
}
}//package gfx
Section 283
//Spikes3_icon (gfx.Spikes3_icon)
package gfx {
import flash.display.*;
public dynamic class Spikes3_icon extends MovieClip {
}
}//package gfx
Section 284
//Spikes3_mc (gfx.Spikes3_mc)
package gfx {
import flash.display.*;
public dynamic class Spikes3_mc extends MovieClip {
public var hit_area:MovieClip;
public var spikes:MovieClip;
}
}//package gfx
Section 285
//SpringPlatform_icon (gfx.SpringPlatform_icon)
package gfx {
import flash.display.*;
public dynamic class SpringPlatform_icon extends MovieClip {
}
}//package gfx
Section 286
//SpringPlatform_mc (gfx.SpringPlatform_mc)
package gfx {
import flash.display.*;
public dynamic class SpringPlatform_mc extends MovieClip {
public var pole:MovieClip;
public var platform:MovieClip;
}
}//package gfx
Section 287
//SpringPlatform2_icon (gfx.SpringPlatform2_icon)
package gfx {
import flash.display.*;
public dynamic class SpringPlatform2_icon extends MovieClip {
}
}//package gfx
Section 288
//SpringPlatform2_mc (gfx.SpringPlatform2_mc)
package gfx {
import flash.display.*;
public dynamic class SpringPlatform2_mc extends MovieClip {
public var pole:MovieClip;
public var platform:MovieClip;
}
}//package gfx
Section 289
//SpringPlatform3_icon (gfx.SpringPlatform3_icon)
package gfx {
import flash.display.*;
public dynamic class SpringPlatform3_icon extends MovieClip {
}
}//package gfx
Section 290
//SpringPlatform3_mc (gfx.SpringPlatform3_mc)
package gfx {
import flash.display.*;
public dynamic class SpringPlatform3_mc extends MovieClip {
public var pole:MovieClip;
public var platform:MovieClip;
}
}//package gfx
Section 291
//ToolMenuBackground (gfx.ToolMenuBackground)
package gfx {
import flash.display.*;
public dynamic class ToolMenuBackground extends MovieClip {
}
}//package gfx
Section 292
//ToxicIcon_icon (gfx.ToxicIcon_icon)
package gfx {
import flash.display.*;
public dynamic class ToxicIcon_icon extends MovieClip {
}
}//package gfx
Section 293
//Turret_icon (gfx.Turret_icon)
package gfx {
import flash.display.*;
public dynamic class Turret_icon extends MovieClip {
}
}//package gfx
Section 294
//Turret1_mc (gfx.Turret1_mc)
package gfx {
import flash.display.*;
import gfx.Turret3_mc.*;
public dynamic class Turret1_mc extends MovieClip {
public var bulletcounter:MovieClip;
public var barrel:barrel;
}
}//package gfx
Section 295
//Turret2_icon (gfx.Turret2_icon)
package gfx {
import flash.display.*;
public dynamic class Turret2_icon extends MovieClip {
}
}//package gfx
Section 296
//Turret2_mc (gfx.Turret2_mc)
package gfx {
import flash.display.*;
import gfx.Turret_mc.*;
public dynamic class Turret2_mc extends MovieClip {
public var bulletcounter:MovieClip;
public var barrel:barrel;
}
}//package gfx
Section 297
//Turret3_icon (gfx.Turret3_icon)
package gfx {
import flash.display.*;
public dynamic class Turret3_icon extends MovieClip {
}
}//package gfx
Section 298
//Turret3_mc (gfx.Turret3_mc)
package gfx {
import flash.display.*;
import gfx.Turret2_mc.*;
public dynamic class Turret3_mc extends MovieClip {
public var bulletcounter:MovieClip;
public var barrel:barrel;
}
}//package gfx
Section 299
//Walking (gfx.Walking)
package gfx {
import flash.display.*;
public dynamic class Walking extends MovieClip {
public var ikNode_98:MovieClip;
public var ikNode_88:MovieClip;
public var ikNode_92:MovieClip;
public var ikNode_90:MovieClip;
public var ikNode_91:MovieClip;
public var ikNode_95:MovieClip;
public var ikNode_97:MovieClip;
public var ikNode_87:MovieClip;
public var ikNode_89:MovieClip;
public var ikNode_96:MovieClip;
}
}//package gfx
Section 300
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, 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");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {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");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
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 _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
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 _cleanup(_arg1:Object):void{
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);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var mc:MovieClip;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
if (!MochiAd._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."));
};
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._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;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = 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;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
loader.load(req);
};
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 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 adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array = _arg2.split(".");
var _local4:Number = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, 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");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
if (options.skip){
ad_timeout = 0;
};
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
var bar_w:Number = ((w - bar.x) - 10);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 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 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var progress:Number = Math.min(1, options.progress_override(clip));
var f:Function = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local12:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
var _local7:Number = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local8:Number = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
var _local9:Number = ((100 * _local3) / chk.ad_msec);
var _local10:Object = this._mochiad_bar._inside;
var _local11:Number = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
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");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var mc = _arg1;
var f:Function = 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 mochi.as3
Section 301
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 302
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 303
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 304
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 305
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 306
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.8 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var clip = _arg1;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function updateCopy(_arg1:Object):void{
MochiServices.send("coins_updateCopy", _arg1, null, null);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 307
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 308
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if (_syncContainer[_arg1] == _arg2){
return;
};
var _local3:String = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
}
}//package mochi.as3
Section 309
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 310
//FlexShape (mx.core.FlexShape)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexShape extends Shape {
mx_internal static const VERSION:String = "3.4.0.5348";
public function FlexShape(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 311
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 312
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 313
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 314
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 315
//FlexEvent (mx.events.FlexEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class FlexEvent extends Event {
public static const ADD:String = "add";
public static const TRANSFORM_CHANGE:String = "transformChange";
public static const ENTER_FRAME:String = "flexEventEnterFrame";
public static const INIT_COMPLETE:String = "initComplete";
public static const REMOVE:String = "remove";
public static const BUTTON_DOWN:String = "buttonDown";
public static const EXIT_STATE:String = "exitState";
public static const CREATION_COMPLETE:String = "creationComplete";
public static const REPEAT:String = "repeat";
public static const LOADING:String = "loading";
public static const RENDER:String = "flexEventRender";
public static const REPEAT_START:String = "repeatStart";
public static const INITIALIZE:String = "initialize";
public static const ENTER_STATE:String = "enterState";
public static const URL_CHANGED:String = "urlChanged";
public static const REPEAT_END:String = "repeatEnd";
mx_internal static const VERSION:String = "3.4.0.5348";
public static const HIDE:String = "hide";
public static const ENTER:String = "enter";
public static const PRELOADER_DONE:String = "preloaderDone";
public static const CURSOR_UPDATE:String = "cursorUpdate";
public static const PREINITIALIZE:String = "preinitialize";
public static const INVALID:String = "invalid";
public static const IDLE:String = "idle";
public static const VALID:String = "valid";
public static const DATA_CHANGE:String = "dataChange";
public static const APPLICATION_COMPLETE:String = "applicationComplete";
public static const VALUE_COMMIT:String = "valueCommit";
public static const UPDATE_COMPLETE:String = "updateComplete";
public static const INIT_PROGRESS:String = "initProgress";
public static const SHOW:String = "show";
public function FlexEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new FlexEvent(type, bubbles, cancelable));
}
}
}//package mx.events
Section 316
//RSLEvent (mx.events.RSLEvent)
package mx.events {
import flash.events.*;
import flash.net.*;
import mx.core.*;
public class RSLEvent extends ProgressEvent {
public var errorText:String;
public var rslIndex:int;
public var rslTotal:int;
public var url:URLRequest;
public static const RSL_PROGRESS:String = "rslProgress";
public static const RSL_ERROR:String = "rslError";
mx_internal static const VERSION:String = "3.4.0.5348";
public static const RSL_COMPLETE:String = "rslComplete";
public function RSLEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:int=-1, _arg7:int=-1, _arg8:URLRequest=null, _arg9:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.rslIndex = _arg6;
this.rslTotal = _arg7;
this.url = _arg8;
this.errorText = _arg9;
}
override public function clone():Event{
return (new RSLEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, rslIndex, rslTotal, url, errorText));
}
}
}//package mx.events
Section 317
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import flash.display.*;
import flash.geom.*;
import mx.core.*;
import mx.utils.*;
import flash.filters.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.4.0.5348";
public function get blRadius():Number{
return (_blRadius);
}
public function set brRadius(_arg1:Number):void{
if (_brRadius != _arg1){
_brRadius = _arg1;
changed = true;
};
}
public function set color(_arg1:int):void{
if (_color != _arg1){
_color = _arg1;
changed = true;
};
}
public function drawShadow(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
if (changed){
createShadowBitmaps();
changed = false;
};
_arg4 = Math.ceil(_arg4);
_arg5 = Math.ceil(_arg5);
var _local6:int = (leftShadow) ? leftShadow.width : 0;
var _local7:int = (rightShadow) ? rightShadow.width : 0;
var _local8:int = (topShadow) ? topShadow.height : 0;
var _local9:int = (bottomShadow) ? bottomShadow.height : 0;
var _local10:int = (_local6 + _local7);
var _local11:int = (_local8 + _local9);
var _local12:Number = ((_arg5 + _local11) / 2);
var _local13:Number = ((_arg4 + _local10) / 2);
var _local14:Matrix = new Matrix();
if (((leftShadow) || (topShadow))){
_local15 = Math.min((tlRadius + _local10), _local13);
_local16 = Math.min((tlRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (_arg3 - _local8), _local15, _local16);
_arg1.endFill();
};
if (((rightShadow) || (topShadow))){
_local17 = Math.min((trRadius + _local10), _local13);
_local18 = Math.min((trRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local17), (_arg3 - _local8), _local17, _local18);
_arg1.endFill();
};
if (((leftShadow) || (bottomShadow))){
_local19 = Math.min((blRadius + _local10), _local13);
_local20 = Math.min((blRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (((_arg3 + _arg5) + _local9) - _local20), _local19, _local20);
_arg1.endFill();
};
if (((rightShadow) || (bottomShadow))){
_local21 = Math.min((brRadius + _local10), _local13);
_local22 = Math.min((brRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local21), (((_arg3 + _arg5) + _local9) - _local22), _local21, _local22);
_arg1.endFill();
};
if (leftShadow){
_local14.tx = (_arg2 - _local6);
_local14.ty = 0;
_arg1.beginBitmapFill(leftShadow, _local14);
_arg1.drawRect((_arg2 - _local6), ((_arg3 - _local8) + _local16), _local6, ((((_arg5 + _local8) + _local9) - _local16) - _local20));
_arg1.endFill();
};
if (rightShadow){
_local14.tx = (_arg2 + _arg4);
_local14.ty = 0;
_arg1.beginBitmapFill(rightShadow, _local14);
_arg1.drawRect((_arg2 + _arg4), ((_arg3 - _local8) + _local18), _local7, ((((_arg5 + _local8) + _local9) - _local18) - _local22));
_arg1.endFill();
};
if (topShadow){
_local14.tx = 0;
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(topShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local15), (_arg3 - _local8), ((((_arg4 + _local6) + _local7) - _local15) - _local17), _local8);
_arg1.endFill();
};
if (bottomShadow){
_local14.tx = 0;
_local14.ty = (_arg3 + _arg5);
_arg1.beginBitmapFill(bottomShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local19), (_arg3 + _arg5), ((((_arg4 + _local6) + _local7) - _local19) - _local21), _local9);
_arg1.endFill();
};
}
public function get brRadius():Number{
return (_brRadius);
}
public function get angle():Number{
return (_angle);
}
private function createShadowBitmaps():void{
var _local1:Number = ((Math.max(tlRadius, blRadius) + (2 * distance)) + Math.max(trRadius, brRadius));
var _local2:Number = ((Math.max(tlRadius, trRadius) + (2 * distance)) + Math.max(blRadius, brRadius));
if ((((_local1 < 0)) || ((_local2 < 0)))){
return;
};
var _local3:Shape = new FlexShape();
var _local4:Graphics = _local3.graphics;
_local4.beginFill(0xFFFFFF);
GraphicsUtil.drawRoundRectComplex(_local4, 0, 0, _local1, _local2, tlRadius, trRadius, blRadius, brRadius);
_local4.endFill();
var _local5:BitmapData = new BitmapData(_local1, _local2, true, 0);
_local5.draw(_local3, new Matrix());
var _local6:DropShadowFilter = new DropShadowFilter(distance, angle, color, alpha);
_local6.knockout = true;
var _local7:Rectangle = new Rectangle(0, 0, _local1, _local2);
var _local8:Rectangle = _local5.generateFilterRect(_local7, _local6);
var _local9:Number = (_local7.left - _local8.left);
var _local10:Number = (_local8.right - _local7.right);
var _local11:Number = (_local7.top - _local8.top);
var _local12:Number = (_local8.bottom - _local7.bottom);
shadow = new BitmapData(_local8.width, _local8.height);
shadow.applyFilter(_local5, _local7, new Point(_local9, _local11), _local6);
var _local13:Point = new Point(0, 0);
var _local14:Rectangle = new Rectangle();
if (_local9 > 0){
_local14.x = 0;
_local14.y = ((tlRadius + _local11) + _local12);
_local14.width = _local9;
_local14.height = 1;
leftShadow = new BitmapData(_local9, 1);
leftShadow.copyPixels(shadow, _local14, _local13);
} else {
leftShadow = null;
};
if (_local10 > 0){
_local14.x = (shadow.width - _local10);
_local14.y = ((trRadius + _local11) + _local12);
_local14.width = _local10;
_local14.height = 1;
rightShadow = new BitmapData(_local10, 1);
rightShadow.copyPixels(shadow, _local14, _local13);
} else {
rightShadow = null;
};
if (_local11 > 0){
_local14.x = ((tlRadius + _local9) + _local10);
_local14.y = 0;
_local14.width = 1;
_local14.height = _local11;
topShadow = new BitmapData(1, _local11);
topShadow.copyPixels(shadow, _local14, _local13);
} else {
topShadow = null;
};
if (_local12 > 0){
_local14.x = ((blRadius + _local9) + _local10);
_local14.y = (shadow.height - _local12);
_local14.width = 1;
_local14.height = _local12;
bottomShadow = new BitmapData(1, _local12);
bottomShadow.copyPixels(shadow, _local14, _local13);
} else {
bottomShadow = null;
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():int{
return (_color);
}
public function set angle(_arg1:Number):void{
if (_angle != _arg1){
_angle = _arg1;
changed = true;
};
}
public function set trRadius(_arg1:Number):void{
if (_trRadius != _arg1){
_trRadius = _arg1;
changed = true;
};
}
public function set tlRadius(_arg1:Number):void{
if (_tlRadius != _arg1){
_tlRadius = _arg1;
changed = true;
};
}
public function get trRadius():Number{
return (_trRadius);
}
public function set distance(_arg1:Number):void{
if (_distance != _arg1){
_distance = _arg1;
changed = true;
};
}
public function get distance():Number{
return (_distance);
}
public function get tlRadius():Number{
return (_tlRadius);
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
changed = true;
};
}
public function set blRadius(_arg1:Number):void{
if (_blRadius != _arg1){
_blRadius = _arg1;
changed = true;
};
}
}
}//package mx.graphics
Section 318
//RoundedRectangle (mx.graphics.RoundedRectangle)
package mx.graphics {
import flash.geom.*;
import mx.core.*;
public class RoundedRectangle extends Rectangle {
public var cornerRadius:Number;// = 0
mx_internal static const VERSION:String = "3.4.0.5348";
public function RoundedRectangle(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){
super(_arg1, _arg2, _arg3, _arg4);
this.cornerRadius = _arg5;
}
}
}//package mx.graphics
Section 319
//DownloadProgressBar (mx.preloaders.DownloadProgressBar)
package mx.preloaders {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import mx.graphics.*;
import flash.geom.*;
import mx.events.*;
import flash.net.*;
import mx.core.*;
import flash.utils.*;
import flash.system.*;
public class DownloadProgressBar extends Sprite implements IPreloaderDisplay {
protected var MINIMUM_DISPLAY_TIME:uint;// = 0
private var _barFrameRect:RoundedRectangle;
private var _stageHeight:Number;// = 375
private var _stageWidth:Number;// = 500
private var _percentRect:Rectangle;
private var _percentObj:TextField;
private var _downloadingLabel:String;// = "Loading"
private var _showProgressBar:Boolean;// = true
private var _yOffset:Number;// = 20
private var _initProgressCount:uint;// = 0
private var _barSprite:Sprite;
private var _visible:Boolean;// = false
private var _barRect:RoundedRectangle;
private var _showingDisplay:Boolean;// = false
private var _backgroundSize:String;// = ""
private var _initProgressTotal:uint;// = 12
private var _startedInit:Boolean;// = false
private var _showLabel:Boolean;// = true
private var _value:Number;// = 0
private var _labelRect:Rectangle;
private var _backgroundImage:Object;
private var _backgroundAlpha:Number;// = 1
private var _backgroundColor:uint;
private var _startedLoading:Boolean;// = false
private var _showPercentage:Boolean;// = false
private var _barFrameSprite:Sprite;
protected var DOWNLOAD_PERCENTAGE:uint;// = 60
private var _displayStartCount:uint;// = 0
private var _labelObj:TextField;
private var _borderRect:RoundedRectangle;
private var _maximum:Number;// = 0
private var _displayTime:int;
private var _label:String;// = ""
private var _preloader:Sprite;
private var _xOffset:Number;// = 20
private var _startTime:int;
mx_internal static const VERSION:String = "3.4.0.5348";
private static var _initializingLabel:String = "Initializing";
public function DownloadProgressBar(){
_labelRect = labelRect;
_percentRect = percentRect;
_borderRect = borderRect;
_barFrameRect = barFrameRect;
_barRect = barRect;
super();
}
protected function getPercentLoaded(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
if ((((((((_arg1 == 0)) || ((_arg2 == 0)))) || (isNaN(_arg2)))) || (isNaN(_arg1)))){
return (0);
};
_local3 = ((100 * _arg1) / _arg2);
if (((isNaN(_local3)) || ((_local3 <= 0)))){
return (0);
};
if (_local3 > 99){
return (99);
};
return (Math.round(_local3));
}
protected function get labelFormat():TextFormat{
var _local1:TextFormat = new TextFormat();
_local1.color = 0x333333;
_local1.font = "Verdana";
_local1.size = 10;
return (_local1);
}
private function calcScale():void{
var _local1:Number;
if ((((stageWidth < 160)) || ((stageHeight < 120)))){
scaleX = 1;
scaleY = 1;
} else {
if ((((stageWidth < 240)) || ((stageHeight < 150)))){
createChildren();
_local1 = Math.min((stageWidth / 240), (stageHeight / 150));
scaleX = _local1;
scaleY = _local1;
} else {
createChildren();
};
};
}
protected function get percentRect():Rectangle{
return (new Rectangle(108, 4, 34, 16));
}
protected function set showLabel(_arg1:Boolean):void{
_showLabel = _arg1;
draw();
}
private function calcBackgroundSize():Number{
var _local2:int;
var _local1:Number = NaN;
if (backgroundSize){
_local2 = backgroundSize.indexOf("%");
if (_local2 != -1){
_local1 = Number(backgroundSize.substr(0, _local2));
};
};
return (_local1);
}
private function show():void{
_showingDisplay = true;
calcScale();
draw();
_displayTime = getTimer();
}
private function loadBackgroundImage(_arg1:Object):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var classOrString = _arg1;
if (((classOrString) && ((classOrString as Class)))){
cls = Class(classOrString);
initBackgroundImage(new (cls));
} else {
if (((classOrString) && ((classOrString is String)))){
try {
cls = Class(getDefinitionByName(String(classOrString)));
} catch(e:Error) {
};
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loader_ioErrorHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(classOrString)), loaderContext);
};
};
};
}
protected function set showPercentage(_arg1:Boolean):void{
_showPercentage = _arg1;
draw();
}
protected function get barFrameRect():RoundedRectangle{
return (new RoundedRectangle(14, 40, 154, 4));
}
private function loader_ioErrorHandler(_arg1:IOErrorEvent):void{
}
protected function rslErrorHandler(_arg1:RSLEvent):void{
_preloader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
_preloader.removeEventListener(Event.COMPLETE, completeHandler);
_preloader.removeEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
_preloader.removeEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
_preloader.removeEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
_preloader.removeEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
_preloader.removeEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
if (!_showingDisplay){
show();
_showingDisplay = true;
};
label = ((("RSL Error " + (_arg1.rslIndex + 1)) + " of ") + _arg1.rslTotal);
var _local2:ErrorField = new ErrorField(this);
_local2.show(_arg1.errorText);
}
protected function rslCompleteHandler(_arg1:RSLEvent):void{
label = ((("Loaded library " + _arg1.rslIndex) + " of ") + _arg1.rslTotal);
}
protected function get borderRect():RoundedRectangle{
return (new RoundedRectangle(0, 0, 182, 60, 4));
}
protected function showDisplayForDownloading(_arg1:int, _arg2:ProgressEvent):Boolean{
return ((((_arg1 > 700)) && ((_arg2.bytesLoaded < (_arg2.bytesTotal / 2)))));
}
protected function createChildren():void{
var _local2:TextField;
var _local3:TextField;
var _local1:Graphics = graphics;
if (backgroundColor != 4294967295){
_local1.beginFill(backgroundColor, backgroundAlpha);
_local1.drawRect(0, 0, stageWidth, stageHeight);
};
if (backgroundImage != null){
loadBackgroundImage(backgroundImage);
};
_barFrameSprite = new Sprite();
_barSprite = new Sprite();
addChild(_barFrameSprite);
addChild(_barSprite);
_local1.beginFill(0xCCCCCC, 0.4);
_local1.drawRoundRect(calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height, (_borderRect.cornerRadius * 2), (_borderRect.cornerRadius * 2));
_local1.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
_local1.endFill();
_local1.beginFill(0xCCCCCC, 0.4);
_local1.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
_local1.endFill();
var _local4:Graphics = _barFrameSprite.graphics;
var _local5:Matrix = new Matrix();
_local5.createGradientBox(_barFrameRect.width, _barFrameRect.height, (Math.PI / 2), calcX(_barFrameRect.x), calcY(_barFrameRect.y));
_local4.beginGradientFill(GradientType.LINEAR, [6054502, 11909306], [1, 1], [0, 0xFF], _local5);
_local4.drawRoundRect(calcX(_barFrameRect.x), calcY(_barFrameRect.y), _barFrameRect.width, _barFrameRect.height, (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
_local4.drawRoundRect(calcX((_barFrameRect.x + 1)), calcY((_barFrameRect.y + 1)), (_barFrameRect.width - 2), (_barFrameRect.height - 2), (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
_local4.endFill();
_labelObj = new TextField();
_labelObj.x = calcX(_labelRect.x);
_labelObj.y = calcY(_labelRect.y);
_labelObj.width = _labelRect.width;
_labelObj.height = _labelRect.height;
_labelObj.selectable = false;
_labelObj.defaultTextFormat = labelFormat;
addChild(_labelObj);
_percentObj = new TextField();
_percentObj.x = calcX(_percentRect.x);
_percentObj.y = calcY(_percentRect.y);
_percentObj.width = _percentRect.width;
_percentObj.height = _percentRect.height;
_percentObj.selectable = false;
_percentObj.defaultTextFormat = percentFormat;
addChild(_percentObj);
var _local6:RectangularDropShadow = new RectangularDropShadow();
_local6.color = 0;
_local6.angle = 90;
_local6.alpha = 0.6;
_local6.distance = 2;
_local6.tlRadius = (_local6.trRadius = (_local6.blRadius = (_local6.brRadius = _borderRect.cornerRadius)));
_local6.drawShadow(_local1, calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height);
_local1.lineStyle(1, 0xFFFFFF, 0.3);
_local1.moveTo((calcX(_borderRect.x) + _borderRect.cornerRadius), calcY(_borderRect.y));
_local1.lineTo(((calcX(_borderRect.x) - _borderRect.cornerRadius) + _borderRect.width), calcY(_borderRect.y));
}
private function draw():void{
var _local1:Number;
if (_startedLoading){
if (!_startedInit){
_local1 = Math.round(((getPercentLoaded(_value, _maximum) * DOWNLOAD_PERCENTAGE) / 100));
} else {
_local1 = Math.round((((getPercentLoaded(_value, _maximum) * (100 - DOWNLOAD_PERCENTAGE)) / 100) + DOWNLOAD_PERCENTAGE));
};
} else {
_local1 = getPercentLoaded(_value, _maximum);
};
if (_labelObj){
_labelObj.text = _label;
};
if (_percentObj){
if (!_showPercentage){
_percentObj.visible = false;
_percentObj.text = "";
} else {
_percentObj.text = (String(_local1) + "%");
};
};
if (((_barSprite) && (_barFrameSprite))){
if (!_showProgressBar){
_barSprite.visible = false;
_barFrameSprite.visible = false;
} else {
drawProgressBar(_local1);
};
};
}
private function timerHandler(_arg1:Event=null):void{
dispatchEvent(new Event(Event.COMPLETE));
}
private function hide():void{
}
public function get backgroundSize():String{
return (_backgroundSize);
}
protected function center(_arg1:Number, _arg2:Number):void{
_xOffset = Math.floor(((_arg1 - _borderRect.width) / 2));
_yOffset = Math.floor(((_arg2 - _borderRect.height) / 2));
}
protected function progressHandler(_arg1:ProgressEvent):void{
var _local2:uint = _arg1.bytesLoaded;
var _local3:uint = _arg1.bytesTotal;
var _local4:int = (getTimer() - _startTime);
if (((_showingDisplay) || (showDisplayForDownloading(_local4, _arg1)))){
if (!_startedLoading){
show();
label = downloadingLabel;
_startedLoading = true;
};
setProgress(_arg1.bytesLoaded, _arg1.bytesTotal);
};
}
protected function initProgressHandler(_arg1:Event):void{
var _local3:Number;
var _local2:int = (getTimer() - _startTime);
_initProgressCount++;
if (((!(_showingDisplay)) && (showDisplayForInit(_local2, _initProgressCount)))){
_displayStartCount = _initProgressCount;
show();
} else {
if (_showingDisplay){
if (!_startedInit){
_startedInit = true;
label = initializingLabel;
};
_local3 = ((100 * _initProgressCount) / (_initProgressTotal - _displayStartCount));
setProgress(_local3, 100);
};
};
}
protected function set downloadingLabel(_arg1:String):void{
_downloadingLabel = _arg1;
}
public function get stageWidth():Number{
return (_stageWidth);
}
protected function get showPercentage():Boolean{
return (_showPercentage);
}
override public function get visible():Boolean{
return (_visible);
}
public function set stageHeight(_arg1:Number):void{
_stageHeight = _arg1;
}
public function initialize():void{
_startTime = getTimer();
center(stageWidth, stageHeight);
}
protected function rslProgressHandler(_arg1:RSLEvent):void{
}
protected function get barRect():RoundedRectangle{
return (new RoundedRectangle(14, 39, 154, 6, 0));
}
protected function get percentFormat():TextFormat{
var _local1:TextFormat = new TextFormat();
_local1.align = "right";
_local1.color = 0;
_local1.font = "Verdana";
_local1.size = 10;
return (_local1);
}
public function set backgroundImage(_arg1:Object):void{
_backgroundImage = _arg1;
}
private function calcX(_arg1:Number):Number{
return ((_arg1 + _xOffset));
}
private function calcY(_arg1:Number):Number{
return ((_arg1 + _yOffset));
}
public function set backgroundAlpha(_arg1:Number):void{
_backgroundAlpha = _arg1;
}
private function initCompleteHandler(_arg1:Event):void{
var _local3:Timer;
var _local2:int = (getTimer() - _displayTime);
if (((_showingDisplay) && ((_local2 < MINIMUM_DISPLAY_TIME)))){
_local3 = new Timer((MINIMUM_DISPLAY_TIME - _local2), 1);
_local3.addEventListener(TimerEvent.TIMER, timerHandler);
_local3.start();
} else {
timerHandler();
};
}
public function set backgroundColor(_arg1:uint):void{
_backgroundColor = _arg1;
}
private function initBackgroundImage(_arg1:DisplayObject):void{
var _local7:Number;
var _local8:Number;
var _local9:Number;
addChildAt(_arg1, 0);
var _local2:Number = _arg1.width;
var _local3:Number = _arg1.height;
var _local4:Number = calcBackgroundSize();
if (isNaN(_local4)){
_local7 = 1;
_local8 = 1;
} else {
_local9 = (_local4 * 0.01);
_local7 = ((_local9 * stageWidth) / _local2);
_local8 = ((_local9 * stageHeight) / _local3);
};
_arg1.scaleX = _local7;
_arg1.scaleY = _local8;
var _local5:Number = Math.round((0.5 * (stageWidth - (_local2 * _local7))));
var _local6:Number = Math.round((0.5 * (stageHeight - (_local3 * _local8))));
_arg1.x = _local5;
_arg1.y = _local6;
if (!isNaN(backgroundAlpha)){
_arg1.alpha = backgroundAlpha;
};
}
public function set backgroundSize(_arg1:String):void{
_backgroundSize = _arg1;
}
protected function showDisplayForInit(_arg1:int, _arg2:int):Boolean{
return ((((_arg1 > 300)) && ((_arg2 == 2))));
}
protected function get downloadingLabel():String{
return (_downloadingLabel);
}
private function loader_completeHandler(_arg1:Event):void{
var _local2:DisplayObject = DisplayObject(LoaderInfo(_arg1.target).loader);
initBackgroundImage(_local2);
}
protected function setProgress(_arg1:Number, _arg2:Number):void{
if (((((((!(isNaN(_arg1))) && (!(isNaN(_arg2))))) && ((_arg1 >= 0)))) && ((_arg2 > 0)))){
_value = Number(_arg1);
_maximum = Number(_arg2);
draw();
};
}
public function get stageHeight():Number{
return (_stageHeight);
}
public function get backgroundImage():Object{
return (_backgroundImage);
}
public function get backgroundAlpha():Number{
if (!isNaN(_backgroundAlpha)){
return (_backgroundAlpha);
};
return (1);
}
private function drawProgressBar(_arg1:Number):void{
var _local11:Number;
var _local2:Graphics = _barSprite.graphics;
_local2.clear();
var _local3:Array = [0xFFFFFF, 0xFFFFFF];
var _local4:Array = [0, 0xFF];
var _local5:Matrix = new Matrix();
var _local6:Number = ((_barRect.width * _arg1) / 100);
var _local7:Number = (_local6 / 2);
var _local8:Number = (_barRect.height - 4);
var _local9:Number = calcX(_barRect.x);
var _local10:Number = (calcY(_barRect.y) + 2);
_local5.createGradientBox(_local7, _local8, 0, _local9, _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.39, 0.85], _local4, _local5);
_local2.drawRect(_local9, _local10, _local7, _local8);
_local5.createGradientBox(_local7, _local8, 0, (_local9 + _local7), _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.85, 1], _local4, _local5);
_local2.drawRect((_local9 + _local7), _local10, _local7, _local8);
_local7 = (_local6 / 3);
_local8 = _barRect.height;
_local10 = calcY(_barRect.y);
_local11 = ((_local10 + _local8) - 1);
_local5.createGradientBox(_local7, _local8, 0, _local9, _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.05, 0.15], _local4, _local5);
_local2.drawRect(_local9, _local10, _local7, 1);
_local2.drawRect(_local9, _local11, _local7, 1);
_local5.createGradientBox(_local7, _local8, 0, (_local9 + _local7), _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.15, 0.25], _local4, _local5);
_local2.drawRect((_local9 + _local7), _local10, _local7, 1);
_local2.drawRect((_local9 + _local7), _local11, _local7, 1);
_local5.createGradientBox(_local7, _local8, 0, (_local9 + (_local7 * 2)), _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.25, 0.1], _local4, _local5);
_local2.drawRect((_local9 + (_local7 * 2)), _local10, _local7, 1);
_local2.drawRect((_local9 + (_local7 * 2)), _local11, _local7, 1);
_local7 = (_local6 / 3);
_local8 = _barRect.height;
_local10 = (calcY(_barRect.y) + 1);
_local11 = ((calcY(_barRect.y) + _local8) - 2);
_local5.createGradientBox(_local7, _local8, 0, _local9, _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.15, 0.3], _local4, _local5);
_local2.drawRect(_local9, _local10, _local7, 1);
_local2.drawRect(_local9, _local11, _local7, 1);
_local5.createGradientBox(_local7, _local8, 0, (_local9 + _local7), _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.3, 0.4], _local4, _local5);
_local2.drawRect((_local9 + _local7), _local10, _local7, 1);
_local2.drawRect((_local9 + _local7), _local11, _local7, 1);
_local5.createGradientBox(_local7, _local8, 0, (_local9 + (_local7 * 2)), _local10);
_local2.beginGradientFill(GradientType.LINEAR, _local3, [0.4, 0.25], _local4, _local5);
_local2.drawRect((_local9 + (_local7 * 2)), _local10, _local7, 1);
_local2.drawRect((_local9 + (_local7 * 2)), _local11, _local7, 1);
}
public function get backgroundColor():uint{
return (_backgroundColor);
}
public function set stageWidth(_arg1:Number):void{
_stageWidth = _arg1;
}
protected function completeHandler(_arg1:Event):void{
}
protected function set label(_arg1:String):void{
if (!(_arg1 is Function)){
_label = _arg1;
};
draw();
}
public function set preloader(_arg1:Sprite):void{
_preloader = _arg1;
_arg1.addEventListener(ProgressEvent.PROGRESS, progressHandler);
_arg1.addEventListener(Event.COMPLETE, completeHandler);
_arg1.addEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
_arg1.addEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
_arg1.addEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
_arg1.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
_arg1.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
}
protected function get label():String{
return (_label);
}
protected function get labelRect():Rectangle{
return (new Rectangle(14, 17, 100, 16));
}
override public function set visible(_arg1:Boolean):void{
if (((!(_visible)) && (_arg1))){
show();
} else {
if (((_visible) && (!(_arg1)))){
hide();
};
};
_visible = _arg1;
}
protected function get showLabel():Boolean{
return (_showLabel);
}
public static function get initializingLabel():String{
return (_initializingLabel);
}
public static function set initializingLabel(_arg1:String):void{
_initializingLabel = _arg1;
}
}
}//package mx.preloaders
import flash.display.*;
import flash.text.*;
import flash.system.*;
class ErrorField extends Sprite {
private const TEXT_MARGIN_PX:int = 10;
private const MAX_WIDTH_INCHES:int = 6;
private const MIN_WIDTH_INCHES:int = 2;
private var downloadProgressBar:DownloadProgressBar;
private function ErrorField(_arg1:DownloadProgressBar){
this.downloadProgressBar = _arg1;
}
protected function get labelFormat():TextFormat{
var _local1:TextFormat = new TextFormat();
_local1.color = 0;
_local1.font = "Verdana";
_local1.size = 10;
return (_local1);
}
public function show(_arg1:String):void{
if ((((_arg1 == null)) || ((_arg1.length == 0)))){
return;
};
var _local2:Number = downloadProgressBar.stageWidth;
var _local3:Number = downloadProgressBar.stageHeight;
var _local4:TextField = new TextField();
_local4.autoSize = TextFieldAutoSize.LEFT;
_local4.multiline = true;
_local4.wordWrap = true;
_local4.background = true;
_local4.defaultTextFormat = labelFormat;
_local4.text = _arg1;
_local4.width = Math.max((MIN_WIDTH_INCHES * Capabilities.screenDPI), (_local2 - (TEXT_MARGIN_PX * 2)));
_local4.width = Math.min((MAX_WIDTH_INCHES * Capabilities.screenDPI), _local4.width);
_local4.y = Math.max(0, ((_local3 - TEXT_MARGIN_PX) - _local4.height));
_local4.x = ((_local2 - _local4.width) / 2);
downloadProgressBar.parent.addChild(this);
this.addChild(_local4);
}
}
Section 320
//IPreloaderDisplay (mx.preloaders.IPreloaderDisplay)
package mx.preloaders {
import flash.events.*;
import flash.display.*;
public interface IPreloaderDisplay extends IEventDispatcher {
function set backgroundAlpha(_arg1:Number):void;
function get stageHeight():Number;
function get stageWidth():Number;
function set backgroundColor(_arg1:uint):void;
function set preloader(_arg1:Sprite):void;
function get backgroundImage():Object;
function get backgroundSize():String;
function get backgroundAlpha():Number;
function set stageHeight(_arg1:Number):void;
function get backgroundColor():uint;
function set stageWidth(_arg1:Number):void;
function set backgroundImage(_arg1:Object):void;
function set backgroundSize(_arg1:String):void;
function initialize():void;
}
}//package mx.preloaders
Section 321
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.4.0.5348";
public static function drawRoundRectComplex(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):void{
var _local10:Number = (_arg2 + _arg4);
var _local11:Number = (_arg3 + _arg5);
var _local12:Number = ((_arg4 < _arg5)) ? (_arg4 * 2) : (_arg5 * 2);
_arg6 = ((_arg6 < _local12)) ? _arg6 : _local12;
_arg7 = ((_arg7 < _local12)) ? _arg7 : _local12;
_arg8 = ((_arg8 < _local12)) ? _arg8 : _local12;
_arg9 = ((_arg9 < _local12)) ? _arg9 : _local12;
var _local13:Number = (_arg9 * 0.292893218813453);
var _local14:Number = (_arg9 * 0.585786437626905);
_arg1.moveTo(_local10, (_local11 - _arg9));
_arg1.curveTo(_local10, (_local11 - _local14), (_local10 - _local13), (_local11 - _local13));
_arg1.curveTo((_local10 - _local14), _local11, (_local10 - _arg9), _local11);
_local13 = (_arg8 * 0.292893218813453);
_local14 = (_arg8 * 0.585786437626905);
_arg1.lineTo((_arg2 + _arg8), _local11);
_arg1.curveTo((_arg2 + _local14), _local11, (_arg2 + _local13), (_local11 - _local13));
_arg1.curveTo(_arg2, (_local11 - _local14), _arg2, (_local11 - _arg8));
_local13 = (_arg6 * 0.292893218813453);
_local14 = (_arg6 * 0.585786437626905);
_arg1.lineTo(_arg2, (_arg3 + _arg6));
_arg1.curveTo(_arg2, (_arg3 + _local14), (_arg2 + _local13), (_arg3 + _local13));
_arg1.curveTo((_arg2 + _local14), _arg3, (_arg2 + _arg6), _arg3);
_local13 = (_arg7 * 0.292893218813453);
_local14 = (_arg7 * 0.585786437626905);
_arg1.lineTo((_local10 - _arg7), _arg3);
_arg1.curveTo((_local10 - _local14), _arg3, (_local10 - _local13), (_arg3 + _local13));
_arg1.curveTo(_local10, (_arg3 + _local14), _local10, (_arg3 + _arg7));
_arg1.lineTo(_local10, (_local11 - _arg9));
}
}
}//package mx.utils
Section 322
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.4.0.5348";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 323
//LevelComplete (sfx.music.LevelComplete)
package sfx.music {
import flash.media.*;
public dynamic class LevelComplete extends Sound {
}
}//package sfx.music
Section 324
//LevelFailed (sfx.music.LevelFailed)
package sfx.music {
import flash.media.*;
public dynamic class LevelFailed extends Sound {
}
}//package sfx.music
Section 325
//MainScreenMusic (sfx.music.MainScreenMusic)
package sfx.music {
import flash.media.*;
public dynamic class MainScreenMusic extends Sound {
}
}//package sfx.music
Section 326
//Music1 (sfx.music.Music1)
package sfx.music {
import flash.media.*;
public dynamic class Music1 extends Sound {
}
}//package sfx.music
Section 327
//Music2 (sfx.music.Music2)
package sfx.music {
import flash.media.*;
public dynamic class Music2 extends Sound {
}
}//package sfx.music
Section 328
//Music3 (sfx.music.Music3)
package sfx.music {
import flash.media.*;
public dynamic class Music3 extends Sound {
}
}//package sfx.music
Section 329
//TrophyMusic (sfx.music.TrophyMusic)
package sfx.music {
import flash.media.*;
public dynamic class TrophyMusic extends Sound {
}
}//package sfx.music
Section 330
//ButtonHit (sfx.ButtonHit)
package sfx {
import flash.media.*;
public dynamic class ButtonHit extends Sound {
}
}//package sfx
Section 331
//ButtonOver (sfx.ButtonOver)
package sfx {
import flash.media.*;
public dynamic class ButtonOver extends Sound {
}
}//package sfx
Section 332
//CasingSound (sfx.CasingSound)
package sfx {
import flash.media.*;
public dynamic class CasingSound extends Sound {
}
}//package sfx
Section 333
//Choice (sfx.Choice)
package sfx {
import flash.media.*;
public dynamic class Choice extends Sound {
}
}//package sfx
Section 334
//ChoiceWeapons (sfx.ChoiceWeapons)
package sfx {
import flash.media.*;
public dynamic class ChoiceWeapons extends Sound {
}
}//package sfx
Section 335
//CleanerRobots (sfx.CleanerRobots)
package sfx {
import flash.media.*;
public dynamic class CleanerRobots extends Sound {
}
}//package sfx
Section 336
//CountersignWeapon (sfx.CountersignWeapon)
package sfx {
import flash.media.*;
public dynamic class CountersignWeapon extends Sound {
}
}//package sfx
Section 337
//DuckAppears (sfx.DuckAppears)
package sfx {
import flash.media.*;
public dynamic class DuckAppears extends Sound {
}
}//package sfx
Section 338
//DuckSound (sfx.DuckSound)
package sfx {
import flash.media.*;
public dynamic class DuckSound extends Sound {
}
}//package sfx
Section 339
//ElectricitySound (sfx.ElectricitySound)
package sfx {
import flash.media.*;
public dynamic class ElectricitySound extends Sound {
}
}//package sfx
Section 340
//HatchesAndDoors (sfx.HatchesAndDoors)
package sfx {
import flash.media.*;
public dynamic class HatchesAndDoors extends Sound {
}
}//package sfx
Section 341
//MenuCloseSound (sfx.MenuCloseSound)
package sfx {
import flash.media.*;
public dynamic class MenuCloseSound extends Sound {
}
}//package sfx
Section 342
//MenuOpenSound (sfx.MenuOpenSound)
package sfx {
import flash.media.*;
public dynamic class MenuOpenSound extends Sound {
}
}//package sfx
Section 343
//MisselesImpact (sfx.MisselesImpact)
package sfx {
import flash.media.*;
public dynamic class MisselesImpact extends Sound {
}
}//package sfx
Section 344
//MissileFlight (sfx.MissileFlight)
package sfx {
import flash.media.*;
public dynamic class MissileFlight extends Sound {
}
}//package sfx
Section 345
//PlaceDuck (sfx.PlaceDuck)
package sfx {
import flash.media.*;
public dynamic class PlaceDuck extends Sound {
}
}//package sfx
Section 346
//PlaceElectrocutor (sfx.PlaceElectrocutor)
package sfx {
import flash.media.*;
public dynamic class PlaceElectrocutor extends Sound {
}
}//package sfx
Section 347
//PlaceMine (sfx.PlaceMine)
package sfx {
import flash.media.*;
public dynamic class PlaceMine extends Sound {
}
}//package sfx
Section 348
//PlaceMisseles (sfx.PlaceMisseles)
package sfx {
import flash.media.*;
public dynamic class PlaceMisseles extends Sound {
}
}//package sfx
Section 349
//PlaceSkinner (sfx.PlaceSkinner)
package sfx {
import flash.media.*;
public dynamic class PlaceSkinner extends Sound {
}
}//package sfx
Section 350
//PlaceSpikes (sfx.PlaceSpikes)
package sfx {
import flash.media.*;
public dynamic class PlaceSpikes extends Sound {
}
}//package sfx
Section 351
//PlaceSpringTool2 (sfx.PlaceSpringTool2)
package sfx {
import flash.media.*;
public dynamic class PlaceSpringTool2 extends Sound {
}
}//package sfx
Section 352
//PlaceTurret (sfx.PlaceTurret)
package sfx {
import flash.media.*;
public dynamic class PlaceTurret extends Sound {
}
}//package sfx
Section 353
//PressStrat (sfx.PressStrat)
package sfx {
import flash.media.*;
public dynamic class PressStrat extends Sound {
}
}//package sfx
Section 354
//SkinnerSound (sfx.SkinnerSound)
package sfx {
import flash.media.*;
public dynamic class SkinnerSound extends Sound {
}
}//package sfx
Section 355
//SpikesHit (sfx.SpikesHit)
package sfx {
import flash.media.*;
public dynamic class SpikesHit extends Sound {
}
}//package sfx
Section 356
//SpikesOut (sfx.SpikesOut)
package sfx {
import flash.media.*;
public dynamic class SpikesOut extends Sound {
}
}//package sfx
Section 357
//SpikesOut2 (sfx.SpikesOut2)
package sfx {
import flash.media.*;
public dynamic class SpikesOut2 extends Sound {
}
}//package sfx
Section 358
//SpikesOut3 (sfx.SpikesOut3)
package sfx {
import flash.media.*;
public dynamic class SpikesOut3 extends Sound {
}
}//package sfx
Section 359
//SpringtoolIn (sfx.SpringtoolIn)
package sfx {
import flash.media.*;
public dynamic class SpringtoolIn extends Sound {
}
}//package sfx
Section 360
//SpringtoolOut (sfx.SpringtoolOut)
package sfx {
import flash.media.*;
public dynamic class SpringtoolOut extends Sound {
}
}//package sfx
Section 361
//TurretFiring2 (sfx.TurretFiring2)
package sfx {
import flash.media.*;
public dynamic class TurretFiring2 extends Sound {
}
}//package sfx
Section 362
//TurretFiring3 (sfx.TurretFiring3)
package sfx {
import flash.media.*;
public dynamic class TurretFiring3 extends Sound {
}
}//package sfx
Section 363
//TurretsFiring (sfx.TurretsFiring)
package sfx {
import flash.media.*;
public dynamic class TurretsFiring extends Sound {
}
}//package sfx
Section 364
//FlakboyBlood (spill.flakboy.character.FlakboyBlood)
package spill.flakboy.character {
import flash.display.*;
import com.gskinner.utils.*;
import gfx.*;
public class FlakboyBlood extends Sprite {
private static var blood:Array = [[FlakBlood1, FlakBlood2, FlakBlood3, FlakBlood4, FlakBlood5, FlakBlood6, FlakBlood7, FlakBlood8, FlakBlood9, FlakBlood10, FlakBlood11], [FlakBlood12, FlakBlood13, FlakBlood14, FlakBlood15, FlakBlood16, FlakBlood17, FlakBlood18, FlakBlood19, FlakBlood20, FlakBlood21]];
public static function getBlood(_arg1:int):Sprite{
return (new (blood[_arg1][Math.floor((Rndm.random() * blood[_arg1].length))]));
}
}
}//package spill.flakboy.character
Section 365
//FlakboyControl (spill.flakboy.character.FlakboyControl)
package spill.flakboy.character {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import spill.flakboy.events.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Common.Math.*;
import flash.media.*;
import gfx.*;
import spill.flakboy.tools.specials.*;
import spill.physics.elements.*;
import spill.physics.shapes.*;
public class FlakboyControl extends Ragdoll {
public var maxDamage:Number;// = 1400
private var activateNextFrame:Boolean;// = false
private var standingList:Array;
private var walkBody:WalkingBody;
public var anim:Walking;
private var standingCounter:Number;// = 0
private var lookX:Number;
private var lookY:Number;
private var fire:Bitmap;
private var walkDirection:Number;// = 1
private var timeOffFloor:int;// = 0
public var totalDamage:Number;// = 0
private var fireBitMap:BitmapData;
public var status:String;// = "walking"
private var groundContacts:Array;
private var walkSpeed:Number;// = 3
public static const SIMULATING:String = "simulating";
public static const DEAD:String = "dead";
public static const WALKING:String = "walking";
public static var maxHealth:Number = 1400;
public static var instance:FlakboyControl;
public function FlakboyControl(){
standingList = new Array();
super();
FlakboyControl.instance = this;
}
public function set armor(_arg1:Number):void{
var _local2:RagdollBodypart;
for each (_local2 in bodyParts) {
_local2.armor = _arg1;
};
}
public function get armDamage():Number{
return ((((leftLowerArm.damage + leftUpperArm.damage) + rightLowerArm.damage) + rightUpperArm.damage));
}
override protected function initialize():void{
super.initialize();
walkBody = new WalkingBody(null);
walkBody.addShape(new spRectangle((20 / Game.drawScale), (60 / Game.drawScale), 0, 0));
walkBody.def.fixedRotation = true;
walkBody.position.Set(initX, initY);
walkBody.useParentDensity = false;
walkBody.density = 0.2;
walkBody.useParentRestitution = false;
walkBody.restitution = 0;
addBody(walkBody);
}
public function addSkeleton():void{
var _local1:RagdollBodypart;
for each (_local1 in bodyParts) {
if (_local1.attached){
_local1.addSkeleton();
};
};
}
public function damageTaken():void{
var _local1:RagdollBodypart;
totalDamage = 0;
for each (_local1 in bodyParts) {
totalDamage = (totalDamage + _local1.damage);
};
dispatchEvent(new FlakboyEvent(FlakboyEvent.DAMAGE_TAKEN));
}
override protected function removeFromDisplay(_arg1:spDisplay):void{
super.removeFromDisplay(_arg1);
if (anim){
anim.stop();
};
}
public function get legDamage():Number{
return ((((leftLowerLeg.damage + leftUpperLeg.damage) + rightLowerLeg.damage) + rightUpperLeg.damage));
}
public function setSkinAlpha(_arg1:Number):void{
var _local2:RagdollBodypart;
for each (_local2 in bodyParts) {
if (_local2.attached){
_local2.setSkinAlpha(_arg1);
};
};
}
public function removeSkin():void{
var _local1:RagdollBodypart;
for each (_local1 in bodyParts) {
if (_local1.attached){
_local1.removeSkin();
};
};
}
override public function onResultContact(_arg1:b2ContactResult, _arg2:spShape, _arg3:spShape):void{
if (status == WALKING){
if (Math.abs(_arg1.normalImpulse) > 4){
activateNextFrame = true;
};
};
var _local4:RagdollBodypart = RagdollBodypart(_arg2.parent);
_local4.onResultContact(_arg1, _arg2, _arg3);
if ((((_arg3 == Engine.instance.room.floor)) && (_local4.attached))){
timeOffFloor = 0;
};
}
override protected function render(_arg1:Event):void{
if (status == SIMULATING){
super.render(_arg1);
};
}
public function get maxLegDamage():Number{
return ((((leftLowerLeg.maxHealth + leftUpperLeg.maxHealth) + rightLowerLeg.maxHealth) + rightUpperLeg.maxHealth));
}
override protected function addToDisplay(_arg1:spDisplay):void{
super.addToDisplay(_arg1);
anim = new Walking();
anim.soundTransform = new SoundTransform(Data.volume);
anim.visible = false;
anim.x = (initX * Game.drawScale);
anim.y = ((initY + 1) * Game.drawScale);
anim.scaleX = Ducky.side;
anim.stop();
container.addChild(anim);
mc.visible = false;
}
override function limbLost(_arg1:RagdollLimb):void{
if (((rightUpperArm.attached) && (leftUpperArm.attached))){
if (((!(rightUpperLeg.attached)) && (!(leftUpperLeg.attached)))){
Achievements.achievementEarned(Achievements.NO_LEGS);
};
};
if (((rightUpperLeg.attached) && (leftUpperLeg.attached))){
if (((!(rightUpperArm.attached)) && (!(leftUpperArm.attached)))){
Achievements.achievementEarned(Achievements.NO_ARMS);
};
};
if (((((((!(rightUpperArm.attached)) && (!(leftUpperArm.attached)))) && (!(rightUpperLeg.attached)))) && (!(leftUpperLeg.attached)))){
Achievements.achievementEarned(Achievements.NO_LIMBS);
};
}
public function lookAt(_arg1:Number, _arg2:Number):void{
lookX = _arg1;
lookY = _arg2;
}
override function limbBroken(_arg1:RagdollLimb):void{
}
public function outputDamage():void{
trace(("leftLowerLeg\t\t" + Math.round(leftLowerLeg.damage)));
trace(("leftUpperLeg\t\t" + Math.round(leftUpperLeg.damage)));
trace(("rightLowerLeg\t\t" + Math.round(rightLowerLeg.damage)));
trace(("rightUpperLeg\t\t" + Math.round(rightUpperLeg.damage)));
trace(("leftLowerArm\t\t" + Math.round(leftLowerArm.damage)));
trace(("leftUpperArm\t\t" + Math.round(leftUpperArm.damage)));
trace(("rightLowerArm\t\t" + Math.round(rightLowerArm.damage)));
trace(("rightUpperArm\t\t" + Math.round(rightUpperArm.damage)));
trace(("torso\t\t\t" + Math.round(torso.damage)));
trace(("head\t\t\t" + Math.round(head.damage)));
trace("--------------------------------");
trace(("total\t\t\t" + totalDamage));
}
public function makeSkeleton():void{
}
public function get maxHealth():Number{
var _local2:RagdollBodypart;
var _local1:Number = 0;
for each (_local2 in bodyParts) {
_local1 = (_local1 + _local2.maxHealth);
};
return (_local1);
}
public function get maxArmDamage():Number{
return ((((leftLowerArm.maxHealth + leftUpperArm.maxHealth) + rightLowerArm.maxHealth) + rightUpperArm.maxHealth));
}
override public function onPersistContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if ((_arg3.parent.parent is spRoom)){
if (_arg2.parent == leftLowerLeg){
groundContacts.push(_arg2.parent);
};
if (_arg2.parent == rightLowerLeg){
groundContacts.push(_arg2.parent);
};
};
var _local4:RagdollBodypart = RagdollBodypart(_arg2.parent);
if ((((_arg3 == Engine.instance.room.floor)) && (_local4.attached))){
timeOffFloor = 0;
};
}
private function beforeStep(_arg1:Event):void{
if (activateNextFrame){
activate();
activateNextFrame = false;
};
var _local2:Number = 0;
if (status == WALKING){
walkBody.linearVelocity.x = (walkBody.linearVelocity.x + (((1.5 * Ducky.side) - walkBody.linearVelocity.x) * 0.5));
anim.x = (walkBody.position.x * Game.drawScale);
anim.y = ((walkBody.position.y + 1) * Game.drawScale);
} else {
if ((((torso.position.y < ((Game.physicsHeight / Game.drawScale) - 0.4))) && ((torso.position.y > ((Game.physicsHeight / Game.drawScale) - 0.8))))){
if ((((groundContacts.indexOf(leftLowerLeg) >= 0)) && ((groundContacts.indexOf(rightLowerLeg) >= 0)))){
_local2 = 1;
};
};
standingList.push(_local2);
standingCounter = (standingCounter + _local2);
if (standingList.length > 100){
standingCounter = (standingCounter - standingList.shift());
};
if ((((standingCounter > 70)) && (Game.instance.hasReachedTarget()))){
Achievements.achievementEarned(Achievements.STANDING);
};
};
groundContacts = new Array();
timeOffFloor++;
if (timeOffFloor == Achievements.HANG_HIGH_TIME){
Achievements.achievementEarned(Achievements.HANGING_HIGH);
};
}
override public function activate(_arg1:RagdollPose=null, _arg2:b2Vec2=null, _arg3:Number=0, _arg4:b2Vec2=null):void{
var _local5:b2Vec2;
if (world.ref.m_lock){
activateNextFrame = true;
} else {
if (status == WALKING){
status = SIMULATING;
removeBody(walkBody);
anim.stop();
container.removeChild(anim);
anim = null;
mc.visible = true;
};
_local5 = walkBody.position.Copy();
walkBody.position.Copy().y = (_local5.y + 0.7);
super.activate(null, _local5, 0, walkBody.linearVelocity.Copy());
};
}
override protected function addToWorld(_arg1:spWorld):void{
super.addToWorld(_arg1);
this.deactivate();
_arg1.addEventListener("beforeStep", beforeStep, false, 0, true);
}
override protected function removeFromWorld(_arg1:spWorld):void{
}
}
}//package spill.flakboy.character
Section 366
//HeadBody (spill.flakboy.character.HeadBody)
package spill.flakboy.character {
import flash.display.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Dynamics.Contacts.*;
public class HeadBody extends RagdollBodypart {
public function HeadBody(_arg1:MovieClip){
super(_arg1);
armor = 4;
mc.setChildIndex(damageBitmap, (mc.getChildIndex(mc.background) + 1));
}
override public function onResultContact(_arg1:b2ContactResult, _arg2:spShape, _arg3:spShape):void{
var _local4:Number = Math.abs(_arg1.normalImpulse);
if (_local4 > armor){
applyDamage(_local4, null, _arg1.position.Copy());
if (_arg1.position.x < 0.2){
Engine.instance.addBloodSplatter(0, (_arg1.position.y * Game.drawScale), 0);
} else {
if (_arg1.position.x > ((Game.physicsWidth / Game.drawScale) - 0.2)){
Engine.instance.addBloodSplatter(Game.physicsWidth, (_arg1.position.y * Game.drawScale), 0);
} else {
if (_arg1.position.y < 0.2){
Engine.instance.addBloodSplatter((_arg1.position.x * Game.drawScale), 0, 1);
};
};
};
};
}
}
}//package spill.flakboy.character
Section 367
//Ragdoll (spill.flakboy.character.Ragdoll)
package spill.flakboy.character {
import flash.events.*;
import flash.display.*;
import spill.flakboy.events.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import spill.flakboy.ui.*;
import gfx.*;
import spill.flakboy.graphics.*;
public class Ragdoll extends spElement {
protected var container:Sprite;
private var leftShoulderJoint:RagdollJoint;
protected var leftUpperArm:RagdollLimb;
private var rightShoulderJoint:RagdollJoint;
public var mc:Flakboy;
protected var rightLowerLeg:RagdollLimb;
protected var rightUpperArm:RagdollLimb;
protected var leftUpperLeg:RagdollLimb;
protected var display:Display;
private var rightElbowJoint:RagdollJoint;
private var leftKneeJoint:RagdollJoint;
public var initX:Number;// = 1
public var initY:Number;// = 1
private var rightKneeJoint:RagdollJoint;
protected var rightUpperLeg:RagdollLimb;
protected var rightLowerArm:RagdollLimb;
protected var leftLowerArm:RagdollLimb;
public var bodyParts:Array;
public var head:HeadBody;
public var simulating:Boolean;// = true
private var leftHipJoint:RagdollJoint;
public var drawScale:Number;// = 60
private var neckJoint:RagdollJoint;
private var leftElbowJoint:RagdollJoint;
public var torso:RagdollBodypart;
protected var leftLowerLeg:RagdollLimb;
private var rightHipJoint:RagdollJoint;
public function set muscleForce(_arg1:Number):void{
var _local3:RagdollJoint;
var _local2:Object = getJoints();
for each (_local3 in _local2) {
_local3.muscleForce = _arg1;
};
}
public function set tempMuscleForce(_arg1:Number):void{
var _local3:RagdollJoint;
var _local2:Object = getJoints();
for each (_local3 in _local2) {
_local3.tempForce = _arg1;
};
}
override protected function removeFromDisplay(_arg1:spDisplay):void{
display.character.removeChild(container);
display.removeEventListener("renderWorld", render);
}
private function createJoint(_arg1:RagdollBodypart, _arg2:RagdollBodypart):RagdollJoint{
var _local3:RagdollJoint = new RagdollJoint(_arg1, _arg2, _arg1.position.Copy());
addJoint(_local3);
if ((_arg2 is RagdollLimb)){
RagdollLimb(_arg2).childBody = RagdollLimb(_arg1);
RagdollLimb(_arg2).childJoint = _local3;
};
if ((_arg1 is RagdollLimb)){
RagdollLimb(_arg1).parentBody = RagdollBodypart(_arg2);
RagdollLimb(_arg1).parentJoint = _local3;
};
return (_local3);
}
override protected function initialize():void{
super.initialize();
bodyParts = new Array();
container = new Sprite();
mc = new Flakboy();
container.addChild(mc);
filter.categoryBits = Engine.characterBit;
density = 5;
torso = createBody(mc.torso);
torso.useParentDensity = false;
torso.density = 1;
torso.maxHealth = 200;
torso.isLimb = true;
head = (createBody(mc.head, HeadBody) as HeadBody);
head.useParentDensity = false;
head.density = 0.4;
head.maxHealth = 400;
neckJoint = createJoint(head, torso);
leftUpperArm = createLimb(mc.leftUpperArm, false);
leftLowerArm = createLimb(mc.leftLowerArm, true);
leftShoulderJoint = createJoint(leftUpperArm, torso);
leftShoulderJoint.upperAngle = (20 * (Math.PI / 180));
leftElbowJoint = createJoint(leftLowerArm, leftUpperArm);
rightUpperArm = createLimb(mc.rightUpperArm, false);
rightLowerArm = createLimb(mc.rightLowerArm, true);
rightShoulderJoint = createJoint(rightUpperArm, torso);
rightShoulderJoint.lowerAngle = (-20 * (Math.PI / 180));
rightElbowJoint = createJoint(rightLowerArm, rightUpperArm);
leftUpperLeg = createLimb(mc.leftUpperLeg, false);
leftLowerLeg = createLimb(mc.leftLowerLeg, true);
leftHipJoint = createJoint(leftUpperLeg, torso);
leftKneeJoint = createJoint(leftLowerLeg, leftUpperLeg);
rightUpperLeg = createLimb(mc.rightUpperLeg, false);
rightLowerLeg = createLimb(mc.rightLowerLeg, true);
rightHipJoint = createJoint(rightUpperLeg, torso);
rightKneeJoint = createJoint(rightLowerLeg, rightUpperLeg);
}
public function set pose(_arg1:RagdollPose):void{
neckJoint.angle = _arg1.neckAngle;
leftShoulderJoint.angle = _arg1.leftShoulderAngle;
leftElbowJoint.angle = _arg1.leftElbowAngle;
rightShoulderJoint.angle = _arg1.rightShoulderAngle;
rightElbowJoint.angle = _arg1.rightElbowAngle;
leftHipJoint.angle = _arg1.leftHipAngle;
leftKneeJoint.angle = _arg1.leftKneeAngle;
rightHipJoint.angle = _arg1.rightHipAngle;
rightKneeJoint.angle = _arg1.rightKneeAngle;
}
override public function onResultContact(_arg1:b2ContactResult, _arg2:spShape, _arg3:spShape):void{
if ((_arg2.parent is RagdollBodypart)){
RagdollBodypart(_arg2.parent).onResultContact(_arg1, _arg2, _arg3);
};
}
override protected function addToDisplay(_arg1:spDisplay):void{
display = Display(_arg1);
display.character.addChild(container);
display.addEventListener("renderWorld", render);
}
private function createLimb(_arg1:MovieClip, _arg2:Boolean):RagdollLimb{
var _local3:RagdollLimb = (createBody(_arg1, RagdollLimb) as RagdollLimb);
_local3.damageMultiplier = (_arg2) ? 0.6 : 1;
_local3.isLower = _arg2;
return (_local3);
}
private function activateBody(_arg1:spBody, _arg2:spBody, _arg3:RagdollJoint, _arg4:Number, _arg5:b2Vec2=null):void{
_arg1.position = _arg2.ref.GetWorldPoint(_arg3.def.localAnchor2);
_arg1.angle = _arg4;
if (_arg5){
_arg1.linearVelocity.SetV(_arg5);
} else {
_arg1.linearVelocity.Set(0, 0);
};
_arg1.angularVelocity = 0;
addBody(_arg1);
if (!_arg3.broken){
addJoint(_arg3);
};
}
private function sortOnAngle(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number = Math.atan2(_arg1.y, _arg1.x);
_local3 = ((_local3 < 0)) ? (_local3 + (Math.PI * 2)) : _local3;
var _local4:Number = Math.atan2(_arg2.y, _arg2.x);
_local4 = ((_local4 < 0)) ? (_local4 + (Math.PI * 2)) : _local4;
return (((_local3 < _local4)) ? -1 : 1);
}
function limbLost(_arg1:RagdollLimb):void{
dispatchEvent(new FlakboyEvent(FlakboyEvent.LIMB_LOST));
}
private function createBody(_arg1:MovieClip, _arg2:Class=null):RagdollBodypart{
var _local6:DisplayObject;
if (!_arg2){
_arg2 = RagdollBodypart;
};
var _local3:b2PolygonDef = new b2PolygonDef();
_local3.vertexCount = 0;
var _local4:Number = (_arg1.numChildren - 1);
while (_local4 >= 0) {
_local6 = _arg1.getChildAt(_local4);
if ((_local6 is PolyNode)){
var _local7 = _local3.vertexCount++;
_local3.vertices[_local7] = new b2Vec2((_local6.x / Game.drawScale), (_local6.y / Game.drawScale));
_arg1.removeChild(_local6);
};
_local4--;
};
_local4 = _local3.vertexCount;
while (_local4 < 8) {
delete _local3.vertices[_local4];
_local4++;
};
_local3.vertices.sort(sortOnAngle);
var _local5:RagdollBodypart = new _arg2(_arg1);
_local5.addShape(new spShape(_local3));
_local5.position.x = ((_arg1.x / Game.drawScale) + initX);
_local5.position.y = ((_arg1.y / Game.drawScale) + initY);
_local5.angle = (_arg1.rotation * (Math.PI / 180));
addBody(_local5);
bodyParts.push(_local5);
return (_local5);
}
function limbBroken(_arg1:RagdollLimb):void{
dispatchEvent(new FlakboyEvent(FlakboyEvent.LIMB_BROKEN));
}
public function set tempMuscleSpeed(_arg1:Number):void{
var _local3:RagdollJoint;
var _local2:Object = getJoints();
for each (_local3 in _local2) {
_local3.tempSpeed = _arg1;
};
}
public function set muscleSpeed(_arg1:Number):void{
var _local3:RagdollJoint;
var _local2:Object = getJoints();
for each (_local3 in _local2) {
_local3.muscleSpeed = _arg1;
};
}
public function breakArm():void{
leftShoulderJoint.breakJoint();
leftElbowJoint.forceMultiplier = 0;
leftUpperArm.filterIn();
leftLowerArm.filterIn();
neckJoint.breakJoint();
head.filterIn();
}
protected function render(_arg1:Event):void{
head.render();
torso.render();
leftLowerArm.render();
leftUpperArm.render();
rightLowerArm.render();
rightUpperArm.render();
leftLowerLeg.render();
leftUpperLeg.render();
rightLowerLeg.render();
rightUpperLeg.render();
neckJoint.applyTorque();
leftShoulderJoint.applyTorque();
leftElbowJoint.applyTorque();
rightShoulderJoint.applyTorque();
rightElbowJoint.applyTorque();
leftHipJoint.applyTorque();
leftKneeJoint.applyTorque();
rightHipJoint.applyTorque();
rightKneeJoint.applyTorque();
}
public function activate(_arg1:RagdollPose=null, _arg2:b2Vec2=null, _arg3:Number=0, _arg4:b2Vec2=null):void{
if (simulating){
return;
};
simulating = true;
if (!_arg1){
_arg1 = new RagdollPose();
};
var _local5:Number = _arg3;
torso.position = (_arg2) ? _arg2 : torso.position;
torso.angle = _local5;
addBody(torso);
activateBody(head, torso, neckJoint, (_local5 + _arg1.neckAngle), _arg4);
activateBody(leftUpperArm, torso, leftShoulderJoint, (_local5 + _arg1.leftShoulderAngle), _arg4);
activateBody(leftLowerArm, leftUpperArm, leftElbowJoint, ((_local5 + _arg1.leftShoulderAngle) + _arg1.leftElbowAngle), _arg4);
activateBody(rightUpperArm, torso, rightShoulderJoint, (_local5 + _arg1.rightShoulderAngle), _arg4);
activateBody(rightLowerArm, rightUpperArm, rightElbowJoint, ((_local5 + _arg1.rightShoulderAngle) + _arg1.rightElbowAngle), _arg4);
activateBody(leftUpperLeg, torso, leftHipJoint, (_local5 + _arg1.leftHipAngle), _arg4);
activateBody(leftLowerLeg, leftUpperLeg, leftKneeJoint, ((_local5 + _arg1.leftHipAngle) + _arg1.leftKneeAngle), _arg4);
activateBody(rightUpperLeg, torso, rightHipJoint, (_local5 + _arg1.rightHipAngle), _arg4);
activateBody(rightLowerLeg, rightUpperLeg, rightKneeJoint, ((_local5 + _arg1.rightHipAngle) + _arg1.rightKneeAngle), _arg4);
}
public function deactivate():void{
if (!simulating){
return;
};
simulating = false;
removeBody(head);
removeBody(torso);
removeBody(leftUpperArm);
removeBody(leftLowerArm);
removeBody(rightUpperArm);
removeBody(rightLowerArm);
removeBody(leftUpperLeg);
removeBody(leftLowerLeg);
removeBody(rightUpperLeg);
removeBody(rightLowerLeg);
}
}
}//package spill.flakboy.character
Section 368
//RagdollBodypart (spill.flakboy.character.RagdollBodypart)
package spill.flakboy.character {
import flash.display.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import flash.geom.*;
public class RagdollBodypart extends spBody {
protected var damageBmd:BitmapData;
private var damageBuffer:Number;// = 0
public var damageMultiplier:Number;// = 1
public var mc:MovieClip;
public var maxImpulseDamage:Number;// = 15
public var isLimb:Boolean;// = false
public var maxHealth:Number;// = 100
public var attached:Boolean;// = true
public var damage:Number;// = 0
protected var damageBitmap:Bitmap;
public var armor:Number;// = 2
public function RagdollBodypart(_arg1:MovieClip){
var _local2:Rectangle;
super();
mc = _arg1;
useParentFilter = false;
filter = new b2FilterData();
filter.groupIndex = -1;
filter.categoryBits = Engine.characterBit;
if (mc){
mc.background.stop();
_local2 = mc.getBounds(mc);
damageBmd = new BitmapData(_local2.width, _local2.height, true, 0);
damageBitmap = new Bitmap(damageBmd);
damageBitmap.smoothing = true;
damageBitmap.x = _local2.left;
damageBitmap.y = _local2.top;
mc.addChild(damageBitmap);
mc.removeChild(mc.bones);
if (mc.damageMask){
mc.mask = mc.damageMask;
mc.mask.visible = false;
};
};
}
public function applyDamage(_arg1:Number, _arg2:b2Vec2=null, _arg3:b2Vec2=null):void{
var _local4:Sprite;
var _local5:b2Vec2;
var _local6:Matrix;
var _local7:ColorTransform;
damage = (damage + (_arg1 * damageMultiplier));
damage = Math.min(maxHealth, damage);
FlakboyControl(parent).damageTaken();
Ragdoll(parent).activate();
mc.background.gotoAndStop(Math.round(((damage / maxHealth) * mc.background.totalFrames)));
if (((_arg3) && (Flakboy.showGore))){
_local4 = FlakboyBlood.getBlood((isLimb) ? 1 : 0);
_local5 = ref.GetLocalPoint(_arg3);
_local5.Multiply(Game.drawScale);
_local6 = new Matrix();
_local6.translate((_local5.x - damageBitmap.x), (_local5.y - damageBitmap.y));
_local7 = new ColorTransform(0, 0, 0, 0.7, ((Game.flakBloodColor & 0xFF0000) >> 16), ((Game.flakBloodColor & 0xFF00) >> 8), (Game.flakBloodColor & 0xFF), 0);
damageBmd.draw(_local4, _local6, _local7);
};
}
public function addSkeleton():void{
mc.addChildAt(mc.bones, 0);
}
public function render():void{
if (damageBuffer){
applyDamage(damageBuffer);
damageBuffer = 0;
};
if (((ref) && (!(ref.IsSleeping())))){
mc.x = (position.x * Game.drawScale);
mc.y = (position.y * Game.drawScale);
mc.rotation = (angle * (180 / Math.PI));
};
}
public function setSkinAlpha(_arg1:Number):void{
mc.background.alpha = _arg1;
}
public function removeSkin():void{
if (((mc) && (mc.background.parent))){
mc.removeChild(mc.background);
};
}
public function onResultContact(_arg1:b2ContactResult, _arg2:spShape, _arg3:spShape):void{
var _local4:Number = Math.abs(_arg1.normalImpulse);
if (_local4 > armor){
applyDamage(Math.min(_local4, maxImpulseDamage), null, _arg1.position.Copy());
};
}
public function filterOut():void{
filter.groupIndex = -1;
refilter();
}
public function filterIn():void{
filter.groupIndex = 1;
refilter();
}
}
}//package spill.flakboy.character
Section 369
//RagdollJoint (spill.flakboy.character.RagdollJoint)
package spill.flakboy.character {
import spill.physics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class RagdollJoint extends spJoint {
private var _forceMultiplier:Number;// = 1
private var body1:RagdollBodypart;
private var body2:RagdollBodypart;
public var tempSpeed:Number;// = 0
public var broken:Boolean;// = false
public var muscleSpeed:Number;// = 1.5
public var angle:Number;// = 0
private var inits:Boolean;// = false
private var anchor:b2Vec2;
public var tempForce:Number;// = 0
private var _muscleForce:Number;// = 2
public function RagdollJoint(_arg1:RagdollBodypart, _arg2:RagdollBodypart, _arg3:b2Vec2){
def = new b2RevoluteJointDef();
def.userData = this;
def.lowerAngle = (-70 * (Math.PI / 180));
def.upperAngle = (70 * (Math.PI / 180));
def.enableLimit = true;
def.enableMotor = true;
def.maxMotorTorque = (_forceMultiplier * _muscleForce);
body1 = _arg1;
body2 = _arg2;
anchor = _arg3;
}
public function get def():b2RevoluteJointDef{
return ((_def as b2RevoluteJointDef));
}
public function set def(_arg1:b2RevoluteJointDef):void{
_def = _arg1;
}
public function breakJoint():void{
if (broken){
return;
};
broken = true;
world.ref.DestroyJoint(ref);
$destroyed();
}
public function get upperAngle():Number{
return (def.upperAngle);
}
public function get lowerAngle():Number{
return (def.lowerAngle);
}
public function applyTorque():void{
var _local1:b2RevoluteJoint = b2RevoluteJoint(ref);
if (_local1.GetJointAngle() < -(Math.PI)){
body1.ref.m_sweep.a = (body1.ref.m_sweep.a - (Math.PI * 2));
};
if (_local1.GetJointAngle() > Math.PI){
body1.ref.m_sweep.a = (body1.ref.m_sweep.a + (Math.PI * 2));
};
var _local2:Number = (-(angle) - _local1.GetJointAngle());
if (tempSpeed != 0){
if (_local1){
_local1.SetMotorSpeed((_local2 * tempSpeed));
};
} else {
if (_local1){
_local1.SetMotorSpeed((_local2 * muscleSpeed));
};
};
if (tempForce != 0){
if (_local1){
_local1.SetMaxMotorTorque(tempForce);
};
} else {
if (_local1){
_local1.SetMaxMotorTorque(_muscleForce);
};
};
tempSpeed = 0;
tempForce = 0;
}
public function set forceMultiplier(_arg1:Number):void{
_forceMultiplier = _arg1;
b2RevoluteJoint(ref).SetMaxMotorTorque((_muscleForce * _forceMultiplier));
}
public function set upperAngle(_arg1:Number):void{
def.upperAngle = _arg1;
}
public function set lowerAngle(_arg1:Number):void{
def.lowerAngle = _arg1;
}
public function set muscleForce(_arg1:Number):void{
_muscleForce = _arg1;
b2RevoluteJoint(ref).SetMaxMotorTorque((_muscleForce * _forceMultiplier));
}
public function get muscleForce():Number{
return (b2RevoluteJoint(ref).GetMotorTorque());
}
override protected function initialise(_arg1:spWorld):void{
if (inits){
def.body1 = body1.ref;
def.body2 = body2.ref;
} else {
inits = true;
def.Initialize(body1.ref, (body2) ? body2.ref : _arg1.ref.GetGroundBody(), anchor);
};
}
}
}//package spill.flakboy.character
Section 370
//RagdollLimb (spill.flakboy.character.RagdollLimb)
package spill.flakboy.character {
import flash.display.*;
import Box2D.Common.Math.*;
public class RagdollLimb extends RagdollBodypart {
public var parentJoint:RagdollJoint;
public var parentBody:RagdollBodypart;
public var childJoint:RagdollJoint;
public var isLower:Boolean;// = false
public var childBody:RagdollLimb;
public function RagdollLimb(_arg1:MovieClip){
isLimb = true;
super(_arg1);
}
private function breakOff():void{
if (!attached){
return;
};
parentJoint.breakJoint();
attached = false;
filterIn();
if (!isLower){
childBody.filterIn();
childBody.attached = false;
childBody.damage = 100;
childBody.applyDamage(100);
Ragdoll(parent).limbLost(this);
} else {
Ragdoll(parent).limbBroken(this);
};
}
override public function applyDamage(_arg1:Number, _arg2:b2Vec2=null, _arg3:b2Vec2=null):void{
super.applyDamage(_arg1, _arg2, _arg3);
if (damage >= maxHealth){
breakOff();
};
}
}
}//package spill.flakboy.character
Section 371
//RagdollPose (spill.flakboy.character.RagdollPose)
package spill.flakboy.character {
import flash.display.*;
public class RagdollPose {
public var rightHipAngle:Number;// = 0
public var leftKneeAngle:Number;// = 0
public var leftHipAngle:Number;// = 0
public var rightElbowAngle:Number;// = 0
public var leftShoulderAngle:Number;// = 0
public var rightKneeAngle:Number;// = 0
public var leftElbowAngle:Number;// = 0
public var neckAngle:Number;// = 0
public var rightShoulderAngle:Number;// = 0
public function interpolate(_arg1:RagdollPose, _arg2:Number):RagdollPose{
var _local3:RagdollPose = new RagdollPose();
interpolateJoint(_arg1, _local3, _arg2, "neckAngle");
interpolateJoint(_arg1, _local3, _arg2, "leftShoulderAngle");
interpolateJoint(_arg1, _local3, _arg2, "leftElbowAngle");
interpolateJoint(_arg1, _local3, _arg2, "leftHipAngle");
interpolateJoint(_arg1, _local3, _arg2, "leftKneeAngle");
interpolateJoint(_arg1, _local3, _arg2, "rightShoulderAngle");
interpolateJoint(_arg1, _local3, _arg2, "rightElbowAngle");
interpolateJoint(_arg1, _local3, _arg2, "rightHipAngle");
interpolateJoint(_arg1, _local3, _arg2, "rightKneeAngle");
return (_local3);
}
public function loadPose(_arg1:MovieClip):void{
neckAngle = (_arg1.head.rotation * (Math.PI / 180));
leftShoulderAngle = (_arg1.leftUpperArm.rotation * (Math.PI / 180));
rightShoulderAngle = (_arg1.rightUpperArm.rotation * (Math.PI / 180));
leftHipAngle = (_arg1.leftUpperLeg.rotation * (Math.PI / 180));
rightHipAngle = (_arg1.rightUpperLeg.rotation * (Math.PI / 180));
leftElbowAngle = ((_arg1.leftLowerArm.rotation * (Math.PI / 180)) - leftShoulderAngle);
rightElbowAngle = ((_arg1.rightLowerArm.rotation * (Math.PI / 180)) - rightShoulderAngle);
leftKneeAngle = ((_arg1.leftLowerLeg.rotation * (Math.PI / 180)) - leftHipAngle);
rightKneeAngle = ((_arg1.rightLowerLeg.rotation * (Math.PI / 180)) - rightHipAngle);
}
public function interpolateJoint(_arg1:RagdollPose, _arg2:RagdollPose, _arg3:Number, _arg4:String):void{
_arg2[_arg4] = (this[_arg4] + (_arg3 * (_arg1[_arg4] - this[_arg4])));
}
}
}//package spill.flakboy.character
Section 372
//WalkingBody (spill.flakboy.character.WalkingBody)
package spill.flakboy.character {
import flash.display.*;
import Box2D.Common.Math.*;
public class WalkingBody extends RagdollBodypart {
public function WalkingBody(_arg1:MovieClip){
super(_arg1);
}
override public function applyDamage(_arg1:Number, _arg2:b2Vec2=null, _arg3:b2Vec2=null):void{
FlakboyControl(parent).activate();
}
}
}//package spill.flakboy.character
Section 373
//Achievements (spill.flakboy.data.Achievements)
package spill.flakboy.data {
import flash.events.*;
import flash.utils.*;
public class Achievements extends EventDispatcher implements IExternalizable {
public var lastAchievement:int;
public var names:Array;
public var complete:Array;
public var callbackFunction:Function;
public static const HIGH_PROFIT:int = 8;
public static const NO_LIMBS:int = 2;
public static const PROFIT:int = 7;
public static const MONEY_MAKER:int = 3;
public static const HIGH_DAMAGE_AMOUNT:int = 1000;
public static const STANDING:int = 13;
public static const TOOLS_DEPLETED:int = 10;
public static const SKINNED:int = 14;
public static const MAX_DAMAGE:int = 6;
public static const MONEY_MAKER_AMOUNT:int = 8000;
public static const NO_ARMS:int = 1;
public static const HIGH_PROFIT_AMOUNT:int = 1000;
public static const TOOLS_DEPLETED_AMOUNT:int = 6;
public static const TRIPPLE_DAMAGE:int = 12;
public static const DOUBLE_DAMAGE:int = 11;
public static const NO_LEGS:int = 0;
public static const ACHIEVEMENT_EARNED:String = "achievement_earned";
public static const HIGH_DAMAGE:int = 5;
public static const MINE_FIELD:int = 9;
public static const HANGING_HIGH:int = 4;
public static const HANG_HIGH_TIME:int = 450;
public static var enabled:Boolean = true;
public static var instance:Achievements;
public function Achievements():void{
names = new Array();
complete = new Array();
super();
add("No_Legs", NO_LEGS);
add("No_Arms", NO_ARMS);
add("No_Limbs", NO_LIMBS);
add("Money_Maker", MONEY_MAKER);
add("Hanging_High", HANGING_HIGH);
add("Max_Damage", MAX_DAMAGE);
add("High_Damage", HIGH_DAMAGE);
add("Make_Profit", PROFIT);
add("High_Profit", HIGH_PROFIT);
add("Mine_Field", MINE_FIELD);
add("Tools_Depleted", TOOLS_DEPLETED);
add("Double_Damage", DOUBLE_DAMAGE);
add("Tripple_Damage", TRIPPLE_DAMAGE);
add("Standing", STANDING);
add("Skinned", SKINNED);
instance = this;
}
private function add(_arg1:String, _arg2:int):void{
names[_arg2] = _arg1;
complete[_arg2] = false;
}
public function writeExternal(_arg1:IDataOutput):void{
_arg1.writeObject(complete);
}
public function readExternal(_arg1:IDataInput):void{
complete = _arg1.readObject();
}
public static function getState(_arg1:int):Boolean{
return (instance.complete[_arg1]);
}
public static function getName(_arg1:int):String{
return (instance.names[_arg1]);
}
public static function achievementEarned(_arg1:int):void{
if (!enabled){
return;
};
instance.callbackFunction(_arg1);
}
}
}//package spill.flakboy.data
Section 374
//Analytics (spill.flakboy.data.Analytics)
package spill.flakboy.data {
import flash.display.*;
import com.google.analytics.*;
public class Analytics {
private static var enabled:Boolean = true;
private static var mainScreenVisited:Boolean = false;
private static var gameCompleted:Boolean = false;
private static var account:String = "UA-6695967-1";
private static var tracker:AnalyticsTracker;
private static var gameName:String = "Flakboy";
private static var levelImproved:Boolean = false;
public static function gameCompletedEvent():void{
if (((!(gameCompleted)) && (enabled))){
gameCompleted = true;
tracker.trackEvent(gameName, "all levels completed", "per session", 0);
};
}
public static function mainScreenEvent():void{
if (((!(mainScreenVisited)) && (enabled))){
mainScreenVisited = true;
tracker.trackEvent(gameName, "mainscreen viewed", "per session", 0);
};
}
public static function initialize(_arg1:DisplayObject, _arg2:Boolean=true):void{
if (enabled){
tracker = new GATracker(_arg1, account, "AS3", _arg2);
};
}
public static function levelImprovedEvent():void{
if (((!(levelImproved)) && (enabled))){
levelImproved = true;
tracker.trackEvent(gameName, "level improved", "per session", 0);
};
}
}
}//package spill.flakboy.data
Section 375
//Data (spill.flakboy.data.Data)
package spill.flakboy.data {
import spill.flakboy.*;
import flash.net.*;
public class Data {
private static var reset:Boolean = false;
private static var so:SharedObject;
private static var version:Number = 0.200007;
private static var contents:Object;
public static var settings:Object;
public static function setLevel(_arg1:int, _arg2:LevelData):void{
so.flush((1000 * 1000));
contents.levels[_arg1] = _arg2;
}
public static function get tutorialCompleted():Boolean{
return (contents.tutorialCompleted);
}
public static function getLevel(_arg1:int):LevelData{
return (contents.levels[_arg1]);
}
public static function initialize():void{
try {
so = SharedObject.getLocal("Flakboy", "/");
} catch(e:Error) {
trace("Error getting cookie");
};
trace(so.size);
if (Flakboy.testMode){
reset = true;
};
if (((((((((!(so)) || (!(so.data.version)))) || ((so.data.version < version)))) || (!(so.data.contents)))) || (reset))){
createContents();
} else {
loadContents();
};
}
public static function get debug():Object{
return (contents.debug);
}
public static function isGameComplete():Boolean{
return (getLevel((Game.totalLevels - 1)).completed);
}
public static function getBugget(_arg1:int):Number{
var _local2:Number = Game.startingBugget;
var _local3:int;
while (_local3 < _arg1) {
_local2 = (_local2 + LevelData(contents.levels[_local3]).profit);
_local3++;
};
return (_local2);
}
public static function get volume():Number{
return (contents.settings.volume);
}
public static function getLevelProgress():int{
var _local1:int;
while (true) {
if (!getLevel(_local1)){
return (_local1);
};
_local1++;
};
return (8);
}
public static function get bestScore():Number{
return (contents.bestScore);
}
private static function loadContents():void{
contents = so.data.contents;
settings = contents.settings;
}
public static function get lastUsedName():String{
return (contents.lastUsedName);
}
public static function set tutorialCompleted(_arg1:Boolean):void{
contents.tutorialCompleted = _arg1;
}
public static function set bestScore(_arg1:Number):void{
contents.bestScore = _arg1;
}
public static function getTotalProfit(_arg1:Boolean=false, _arg2:int=0):Number{
var _local5:LevelData;
var _local3:Number = 0;
var _local4:int;
while (_local4 < Game.totalLevels) {
if (((_arg1) && ((_local4 == _arg2)))){
} else {
_local5 = LevelData(contents.levels[_local4]);
if (_local5.completed){
_local3 = (_local3 + _local5.profit);
};
};
_local4++;
};
return (_local3);
}
public static function set volume(_arg1:Number):void{
contents.settings.volume = _arg1;
}
private static function createContents():void{
contents = new Object();
contents.settings = new Object();
contents.settings.volume = 1;
contents.settings.quality = 1;
contents.debug = new Object();
contents.debug.ui = false;
contents.debug.draw = false;
contents.debug.mouse = false;
contents.bestScore = 0;
contents.lastUsedName = "";
contents.tutorialCompleted = false;
contents.achievements = new Achievements();
contents.levels = new Array();
var _local1:int;
while (_local1 < Game.totalLevels) {
contents.levels[_local1] = new LevelData();
if (Flakboy.testMode){
contents.levels[_local1].unlocked = true;
contents.levels[_local1].moneyEarned = 3000;
contents.levels[_local1].completed = false;
};
_local1++;
};
contents.levels[0].unlocked = true;
if (so){
so.data.version = version;
so.data.contents = contents;
};
}
public static function set lastUsedName(_arg1:String):void{
contents.lastUsedName = _arg1;
}
public static function set quality(_arg1:String):void{
contents.settings.quality = _arg1;
}
public static function get quality():String{
return (contents.settings.quality);
}
registerClassAlias("spill.flakboy.data.LevelData", LevelData);
registerClassAlias("spill.flakboy.data.Achievements", Achievements);
}
}//package spill.flakboy.data
Section 376
//LevelData (spill.flakboy.data.LevelData)
package spill.flakboy.data {
import flash.utils.*;
public class LevelData implements IExternalizable {
public var torsoDamage:Number;
public var completed:Boolean;// = false
public var totalDamage:Number;
public var moneySpent:Number;// = 0
public var moneyEarned:Number;// = 0
public var maxLegDamage:Number;
public var gameComplete:Boolean;// = false
public var image:ByteArray;
public var legDamage:Number;
public var targetDamage:Number;
public var unlocked:Boolean;// = false
public var scoreImproved:Boolean;// = false
public var improvement:Number;// = 0
public var maxArmDamage:Number;
public var layout:String;// = "none"
public var armDamage:Number;
public var headDamage:Number;
public var level:int;// = 0
public var maxDamage:Number;
public var maxHeadDamage:Number;
public var improved:Boolean;
public var maxTorsoDamage:Number;
public static var targets:Array = [200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100];
public function writeExternal(_arg1:IDataOutput):void{
_arg1.writeFloat(armDamage);
_arg1.writeFloat(legDamage);
_arg1.writeFloat(headDamage);
_arg1.writeFloat(torsoDamage);
_arg1.writeFloat(totalDamage);
_arg1.writeFloat(targetDamage);
_arg1.writeFloat(moneyEarned);
_arg1.writeFloat(moneySpent);
_arg1.writeInt(level);
_arg1.writeUTF(layout);
_arg1.writeObject(image);
_arg1.writeBoolean(completed);
_arg1.writeBoolean(unlocked);
}
public function get profit():Number{
return ((moneyEarned - moneySpent));
}
public function readExternal(_arg1:IDataInput):void{
armDamage = _arg1.readFloat();
legDamage = _arg1.readFloat();
headDamage = _arg1.readFloat();
torsoDamage = _arg1.readFloat();
totalDamage = _arg1.readFloat();
targetDamage = _arg1.readFloat();
moneyEarned = _arg1.readFloat();
moneySpent = _arg1.readFloat();
level = _arg1.readInt();
layout = _arg1.readUTF();
image = _arg1.readObject();
completed = _arg1.readBoolean();
unlocked = _arg1.readBoolean();
}
}
}//package spill.flakboy.data
Section 377
//DebugWindow (spill.flakboy.debug.DebugWindow)
package spill.flakboy.debug {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import spill.flakboy.*;
import flash.media.*;
import flash.system.*;
public class DebugWindow extends Sprite {
public var debugDrawEnabled:Boolean;// = false
private var game:Game;
private var mc:DebugWindow_mc;
public function DebugWindow(_arg1:Game){
mc = new DebugWindow_mc();
mc.framerate.maximum = 31;
mc.memory.maximum = 200;
mc.calc.maximum = 30;
mc.draw.addEventListener(Event.CHANGE, setDebugDrawing, false, 0, true);
mc.draw.selected = Data.debug.draw;
mc.mouse.addEventListener(Event.CHANGE, setMouseEnabled, false, 0, true);
mc.mouse.selected = Data.debug.mouse;
addChild(mc);
mc.volume.maximum = 1;
mc.volume.value = Data.volume;
mc.volume.addEventListener(Event.CHANGE, volumeChanged, false, 0, true);
mc.volume.snapInterval = 0.01;
SoundMixer.soundTransform.volume = Data.volume;
alpha = 0.75;
game = _arg1;
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
addEventListener(MouseEvent.MOUSE_UP, mouseUp);
}
private function added(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
private function removed(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, update);
}
private function update(_arg1:Event):void{
var _local2:Number;
if (game.engine){
mc.framerate.value = game.engine.world.frameRate;
mc.framerate_txt.text = game.engine.world.frameRate.toString();
_local2 = (System.totalMemory / (0x0400 * 0x0400));
mc.memory.value = _local2;
mc.memory_txt.text = Math.round(_local2).toString();
mc.calc.value = game.engine.world.calcTime;
mc.calc_txt.text = game.engine.world.calcTime.toString();
};
}
private function setDebugDrawing(_arg1:Event):void{
debugDrawEnabled = mc.draw.selected;
Data.debug.draw = debugDrawEnabled;
if (game.engine){
game.engine.display.debugDrawEnabled = debugDrawEnabled;
};
}
private function mouseDown(_arg1:MouseEvent):void{
if (_arg1.target == mc){
startDrag(false);
};
}
private function mouseUp(_arg1:MouseEvent):void{
stopDrag();
}
private function volumeChanged(_arg1:Event):void{
SoundMixer.soundTransform.volume = mc.volume.value;
SoundMixer.soundTransform = SoundMixer.soundTransform;
Data.volume = mc.volume.value;
}
private function setMouseEnabled(_arg1:Event):void{
game.engine.mouseControl.enabled = mc.mouse.selected;
Data.debug.mouse = mc.mouse.selected;
}
}
}//package spill.flakboy.debug
Section 378
//FlakboyEvent (spill.flakboy.events.FlakboyEvent)
package spill.flakboy.events {
import flash.events.*;
public class FlakboyEvent extends Event {
public static const LIMB_LOST:String = "limbLost";
public static const DAMAGE_TAKEN:String = "damageTaken";
public static const LIMB_BROKEN:String = "limbBroken";
public static const STANDING:String = "standing";
public function FlakboyEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package spill.flakboy.events
Section 379
//ToolMenuEvent (spill.flakboy.events.ToolMenuEvent)
package spill.flakboy.events {
import flash.events.*;
import spill.flakboy.tools.core.*;
public class ToolMenuEvent extends Event {
public var tool:ToolDescr;
public static const TOOL_PRESSED:String = "toolPressed";
public function ToolMenuEvent(_arg1:String, _arg2:ToolDescr){
super(_arg1, false, false);
tool = _arg2;
}
}
}//package spill.flakboy.events
Section 380
//Body (spill.flakboy.graphics.Body)
package spill.flakboy.graphics {
import flash.display.*;
public dynamic class Body extends MovieClip {
public var background:MovieClip;
public var damageMask:MovieClip;
public var bones:MovieClip;
}
}//package spill.flakboy.graphics
Section 381
//Head (spill.flakboy.graphics.Head)
package spill.flakboy.graphics {
import flash.display.*;
public dynamic class Head extends MovieClip {
public var leftEye2:MovieClip;
public var leftEye:MovieClip;
public var background:MovieClip;
public var bones:MovieClip;
public var rightEye:MovieClip;
public var damageMask:MovieClip;
public var rightEye2:MovieClip;
}
}//package spill.flakboy.graphics
Section 382
//PolyNode (spill.flakboy.graphics.PolyNode)
package spill.flakboy.graphics {
import flash.display.*;
public dynamic class PolyNode extends MovieClip {
}
}//package spill.flakboy.graphics
Section 383
//GameCompleteScreen (spill.flakboy.menus.GameCompleteScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.data.*;
import gfx.ui.*;
import spill.flakboy.utils.*;
public class GameCompleteScreen extends InGameMenuBase {
private var mc:GameCompleteScreen_mc;
private var main:Main;
public function GameCompleteScreen(_arg1:Main, _arg2:Boolean=false){
main = _arg1;
mc = new GameCompleteScreen_mc();
super(mc);
if (main.loaderInfo.parameters.hasOwnProperty("username")){
Utils.initButton(mc.submitScoreButton, submitScore);
} else {
mc.submitScoreButton.visible = false;
};
Utils.initButton(mc.backButton, back);
mc.scoreText.text = ("$" + Data.getTotalProfit());
mc.gore.visible = Flakboy.showGore;
if (_arg2){
mc.titleText.text = "{New_Highscore}";
};
easingTime = 8;
startTransition();
}
private function back(_arg1:Event):void{
startTransitionOut(removeMe);
}
private function submitScore(_arg1:Event):void{
main.addChild(new SubmitScoreScreen(main));
removeMe();
}
private function removeMe():void{
parent.removeChild(this);
}
}
}//package spill.flakboy.menus
Section 384
//InGameMenuBase (spill.flakboy.menus.InGameMenuBase)
package spill.flakboy.menus {
import flash.events.*;
import flash.display.*;
import fl.transitions.*;
import gfx.ui.*;
import flash.geom.*;
import fl.motion.easing.*;
import sfx.*;
import spill.flakboy.sound.*;
public class InGameMenuBase extends MovieClip {
private var minW:Number;// = 0
private var transBg:Sprite;
protected var easingTime:int;// = 6
protected var transH:Number;
private var easingFunction:Function;
protected var fadingTime:int;// = 3
private var tween:Tween;
private var menuBMP:Bitmap;
protected var transW:Number;
private var completeFunction:Function;
private var _mc:MovieClip;
private var minH:Number;// = 2
private var cover:Sprite;
public function InGameMenuBase(_arg1:MovieClip){
easingFunction = Quadratic.easeInOut;
super();
_mc = _arg1;
transW = _arg1.background.width;
transH = _arg1.background.height;
x = 350;
y = 270;
}
private function fadeIn(_arg1:Event):void{
var _local2:Rectangle = _mc.getBounds(_mc);
var _local3:Matrix = new Matrix();
_local3.translate(-(_local2.left), -(_local2.top));
var _local4:BitmapData = new BitmapData(_local2.width, _local2.height, true, 0);
_local4.draw(_mc, _local3);
menuBMP = new Bitmap(_local4);
menuBMP.x = _local2.left;
menuBMP.y = _local2.top;
menuBMP.alpha = 0;
addChild(menuBMP);
tween = new Tween(menuBMP, "alpha", easingFunction, 0, 1, fadingTime, false);
exeNext(fadeInDone1);
}
private function tw1(_arg1:Event):void{
tween = new Tween(transBg, "height", easingFunction, transBg.height, minH, easingTime, false);
exeNext(tw2);
}
protected function startTransitionOut(_arg1:Function=null):void{
completeFunction = _arg1;
var _local2:Rectangle = _mc.getBounds(_mc);
var _local3:Matrix = new Matrix();
_local3.translate(-(_local2.left), -(_local2.top));
var _local4:BitmapData = new BitmapData(_local2.width, _local2.height, true, 0);
_local4.draw(_mc, _local3);
menuBMP = new Bitmap(_local4);
menuBMP.x = _local2.left;
menuBMP.y = _local2.top;
menuBMP.alpha = 1;
addChild(menuBMP);
removeChild(_mc);
tween = new Tween(menuBMP, "alpha", easingFunction, 1, 0, fadingTime, false);
exeNext(tw1);
SoundFX.playSound(MenuCloseSound);
}
private function tw3(_arg1:Event):void{
tween = new Tween(cover, "alpha", easingFunction, 1, 0, fadingTime, false);
exeNext(transitionOutComplete);
}
protected function transitionOutComplete(_arg1:Event):void{
if ((completeFunction is Function)){
completeFunction();
};
}
protected function startTransition():void{
cover = new Sprite();
cover.graphics.beginFill(0, 0.4);
cover.graphics.drawRect(-350, -270, 700, 540);
cover.graphics.endFill();
cover.alpha = 0;
addChild(cover);
transBg = new Background_In_Game();
transBg.width = minW;
transBg.height = minH;
addChild(transBg);
tween = new Tween(cover, "alpha", easingFunction, 0, 1, fadingTime, false);
exeNext(tweenOut);
}
private function exeNext(_arg1:Function):void{
tween.addEventListener(TweenEvent.MOTION_FINISH, _arg1, false, 0, true);
}
private function tw2(_arg1:Event):void{
tween = new Tween(transBg, "width", easingFunction, transBg.width, minW, easingTime, false);
exeNext(tw3);
}
private function tweenOut(_arg1:Event):void{
tween = new Tween(transBg, "width", easingFunction, transBg.width, transW, easingTime, false);
exeNext(tweenUp);
SoundFX.playSound(MenuOpenSound);
}
protected function fadeInDone():void{
}
private function fadeInDone1(_arg1:Event):void{
removeChild(menuBMP);
menuBMP = null;
addChild(_mc);
fadeInDone();
}
private function tweenUp(_arg1:Event):void{
tween = new Tween(transBg, "height", easingFunction, transBg.height, transH, easingTime, false);
exeNext(fadeIn);
}
}
}//package spill.flakboy.menus
Section 385
//LevelCompleteScreen (spill.flakboy.menus.LevelCompleteScreen)
package spill.flakboy.menus {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import gfx.ui.*;
import flash.geom.*;
import spill.flakboy.utils.*;
import spill.flakboy.sound.*;
import spill.localisation.*;
public class LevelCompleteScreen extends InGameMenuBase {
private var main:Main;
private var level:Number;
private var levelData:LevelData;
private var mc:LevelComplete_mc;
private var game:Game;
public function LevelCompleteScreen(_arg1:int, _arg2:LevelData, _arg3:Game, _arg4:Main){
level = _arg1;
game = _arg3;
main = _arg4;
levelData = _arg2;
mc = new LevelComplete_mc();
super(mc);
var _local5:String = SpilGame.getString("Level_X_Complete");
_local5 = _local5.replace("XXX", (level + 1).toString());
_local5 = _local5.replace("YYY", Game.totalLevels.toString());
mc.levelCompleteText.text = _local5;
drawMeter(mc.headDamage, (_arg2.headDamage / _arg2.maxHeadDamage));
drawMeter(mc.armDamage, (_arg2.armDamage / _arg2.maxArmDamage));
drawMeter(mc.legDamage, (_arg2.legDamage / _arg2.maxLegDamage));
drawMeter(mc.torsoDamage, (_arg2.torsoDamage / _arg2.maxTorsoDamage));
drawMeter(mc.totalDamage, (_arg2.totalDamage / _arg2.maxDamage));
drawMeter(mc.targetDamage, (_arg2.targetDamage / _arg2.maxDamage));
mc.totalDamageText.text = Math.round(_arg2.totalDamage).toString();
mc.targetDamageText.text = _arg2.targetDamage.toString();
mc.moneyEarnedText.text = ("+$" + _arg2.moneyEarned);
mc.moneySpentText.text = ("-$" + _arg2.moneySpent);
mc.profitText.text = ("$" + _arg2.profit);
if (_arg2.profit < 0){
mc.profitText.textColor = 0xFF0000;
};
mc.improvementText.text = ("$" + _arg2.improvement);
if (_arg2.improved){
mc.improvementMessage.text = "{Improved}";
} else {
if (_arg2.improvement == 0){
mc.improvementMessage.text = "{No_Change}";
} else {
mc.improvementMessage.text = "{Decreased}";
};
};
updateToolDisplay(level);
if (((((level + 1) < Game.totalLevels)) && (!(((Flakboy.restricted) && ((level >= 3))))))){
Utils.initButton(mc.nextLevelButton, goNextLevel);
} else {
mc.nextLevelButton.text.text = "{Select_Level}";
Utils.initButton(mc.nextLevelButton, levelSelect);
};
Utils.initButton(mc.retryButton, retryLevel);
Utils.initButton(mc.sendToFriendButton, sendToFriend);
Utils.initBrandinButton(mc.brandingButton, "Level_Complete_Screen");
easingTime = 8;
startTransition();
Music.playSong("levelComplete", false);
}
private function sendToFriend(_arg1:Event=null):void{
game.addChild(new SendToFriendScreen());
}
override protected function fadeInDone():void{
if (levelData.gameComplete){
parent.addChild(new GameCompleteScreen(main));
} else {
if (levelData.scoreImproved){
parent.addChild(new GameCompleteScreen(main, true));
};
};
}
private function drawMeter(_arg1:MovieClip, _arg2:Number):void{
var _local3:Sprite = Sprite(_arg1.bars);
var _local4:Number = _local3.height;
var _local5:Number = _local3.width;
_arg1.bars.scrollRect = new Rectangle(0, 0, (_local5 * _arg2), _local4);
}
private function levelSelect(_arg1:Event):void{
main.addChild(new LevelSelectionScreen(main));
}
private function goNextLevel(_arg1:Event):void{
startTransitionOut(game.nextLevel);
}
private function updateToolDisplay(_arg1:int):void{
updateToolCat(mc.mines, ToolCategories.MINES, _arg1);
updateToolCat(mc.missiles, ToolCategories.MISSILES, _arg1);
updateToolCat(mc.guns, ToolCategories.GUNS, _arg1);
updateToolCat(mc.platforms, ToolCategories.SPRINGS, _arg1);
updateToolCat(mc.spikes, ToolCategories.SPIKES, _arg1);
updateToolCat(mc.specials, ToolCategories.OTHER, _arg1);
}
private function retryLevel(_arg1:Event):void{
startTransitionOut(game.retry);
}
private function updateToolCat(_arg1:WeaponCategory, _arg2:int, _arg3:int):void{
var _local4:Array = ToolList.getCategory(_arg2, (_arg3 + 1));
updateTool(_arg1.icon0, _local4[0], _arg3);
updateTool(_arg1.icon1, _local4[1], _arg3);
updateTool(_arg1.icon2, _local4[2], _arg3);
updateTool(_arg1.icon3, _local4[3], _arg3);
}
private function updateTool(_arg1:MovieClip, _arg2:ToolDescr, _arg3:int):void{
var _local4:Sprite;
if (!_arg2){
_arg1.visible = false;
} else {
_local4 = new (_arg2.iconClass);
_arg1.addChild(_local4);
if ((_arg3 + 1) == _arg2.level){
_arg1.gotoAndStop("new");
} else {
if ((_arg3 + 1) > _arg2.level){
_arg1.gotoAndStop("old");
} else {
_arg1.gotoAndStop("locked");
_local4.transform.colorTransform = new ColorTransform(0, 0, 0, 0.5, 0, 0, 0, 0);
};
};
};
}
private function backToMain(_arg1:Event):void{
startTransitionOut(main.goMainScreen);
}
}
}//package spill.flakboy.menus
Section 386
//LevelFailedScreen (spill.flakboy.menus.LevelFailedScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.*;
import gfx.ui.*;
import spill.flakboy.utils.*;
public class LevelFailedScreen extends InGameMenuBase {
private var game:Game;
private var mc:LevelFailed_mc;
private var main:Main;
public function LevelFailedScreen(_arg1:Main, _arg2:Game){
main = _arg1;
game = _arg2;
mc = new LevelFailed_mc();
super(mc);
Utils.initButton(mc.retry_btn, retry);
Utils.initButton(mc.back_btn, goMain);
startTransition();
}
private function goMain(_arg1:Event):void{
startTransitionOut(main.goMainScreen);
}
private function retry(_arg1:Event):void{
startTransitionOut(game.retry);
}
}
}//package spill.flakboy.menus
Section 387
//LevelSelectionScreen (spill.flakboy.menus.LevelSelectionScreen)
package spill.flakboy.menus {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import gfx.ui.*;
import gfx.*;
import spill.flakboy.utils.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
public class LevelSelectionScreen extends InGameMenuBase {
private var buttons:Array;
private var progress:int;
private var levelToPlay:int;
private var mc:LevelSelectionScreen_mc;
private var main:Main;
private var emptyLevelThumb:BitmapData;
public function LevelSelectionScreen(_arg1:Main){
main = _arg1;
mc = new LevelSelectionScreen_mc();
super(mc);
makeEmptyLevelThumb();
progress = Data.getLevelProgress();
buttons = [mc.b0, mc.b1, mc.b2, mc.b3, mc.b4, mc.b5, mc.b6, mc.b7];
var _local2:int;
while (_local2 < buttons.length) {
initButton(buttons[_local2], _local2);
_local2++;
};
Utils.initButton(mc.backButton, backToMain);
mc.profitText.text = ("$" + Data.getTotalProfit());
if (Flakboy.restricted){
mc.locked.addEventListener(MouseEvent.CLICK, lockedClicked, false, 0, true);
mc.locked.buttonMode = true;
mc.locked.mouseChildren = false;
mc.locked.mouseEnabled = true;
mc.locked.useHandCursor = true;
} else {
mc.locked.visible = false;
};
if (Data.getTotalProfit() <= Data.bestScore){
mc.submitScoreButton.visible = false;
mc.removeChild(mc.scoreImprovedText);
} else {
Utils.initButton(mc.submitScoreButton, submitScore);
};
easingTime = 8;
startTransition();
Music.playSong("mainScreen");
}
private function getThumb():Bitmap{
return (new Bitmap(emptyLevelThumb.clone()));
}
private function initButton(_arg1:MovieClip, _arg2:int):void{
var _local4:Loader;
var _local3:LevelData = Data.getLevel(_arg2);
_arg1.levelText.text = (_arg2 + 1).toString();
_arg1.levelText.mouseEnabled = false;
if (_local3.unlocked){
_arg1.profitText.mouseEnabled = false;
_arg1.gotoAndStop("unlocked");
if (_local3.completed){
_local4 = new Loader();
_local4.loadBytes(_local3.image);
_local4.mouseEnabled = false;
_arg1.addChild(_local4);
if (_local3.profit < 0){
_arg1.profitText.defaultTextFormat = new TextFormat(null, null, 0xFF0000);
};
_arg1.profitText.text = ("$" + _local3.profit);
} else {
_arg1.profitText.text = "---";
_arg1.addChild(getThumb());
};
_arg1.addEventListener(MouseEvent.CLICK, playLevel, false, 0, true);
_arg1.addEventListener(MouseEvent.ROLL_OVER, playRollOverSound, false, 0, true);
_arg1.index = _arg2;
} else {
_arg1.profitText.text = "";
_arg1.gotoAndStop("locked");
};
}
private function submitScore(_arg1:Event):void{
main.addChild(new SubmitScoreScreen(main));
removeMe();
}
private function playRollOverSound(_arg1:Event):void{
SoundFX.playSound(Choice);
}
public function removeSubmitScoreOption():void{
mc.submitScoreButton.visible = false;
if (mc.contains(mc.scoreImprovedText)){
mc.removeChild(mc.scoreImprovedText);
};
}
private function playLevel2():void{
removeMe();
main.playLevel(levelToPlay);
}
private function playLevel(_arg1:Event):void{
levelToPlay = _arg1.currentTarget.index;
easingTime = 8;
startTransitionOut(playLevel2);
}
private function makeEmptyLevelThumb():void{
var _local1:BitmapData = new BitmapData(700, 470);
emptyLevelThumb = new BitmapData(140, 94, false);
_local1.draw(new Background());
ImageScaler.scaleImage(_local1, emptyLevelThumb);
}
private function backToMain(_arg1:Event):void{
easingTime = 8;
startTransitionOut(removeMe);
}
private function removeMe(_arg1:Event=null):void{
parent.removeChild(this);
}
private function lockedClicked(_arg1:Event):void{
var _local2:String = SpilGame.getSendToFriendLink().replace("send_to_friend", "Play_Full_Version");
navigateToURL(new URLRequest(_local2), "_blank");
}
}
}//package spill.flakboy.menus
Section 388
//MainScreen (spill.flakboy.menus.MainScreen)
package spill.flakboy.menus {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import gfx.ui.*;
import gfx.*;
import spill.flakboy.ui.controls.*;
import spill.flakboy.utils.*;
import spill.flakboy.sound.*;
import spill.localisation.*;
import flash.net.*;
import mochi.as3.*;
public class MainScreen extends Sprite {
private var volumeControl:VolumeControl;
private var mc:MainMenu_mc;
private var main:Main;
private var levelSelectScreen:LevelSelectionScreen;
private var qualityControl:QualityControl;
public function MainScreen(_arg1:Main){
var _local2:MovieClip;
super();
main = _arg1;
mc = new MainMenu_mc();
addChild(mc);
Analytics.mainScreenEvent();
if (Flakboy.bMochi){
MochiEvents.trackEvent("StartGame");
};
mc.versionText.text = Flakboy.version;
qualityControl = new QualityControl(mc.qualityControl);
volumeControl = new VolumeControl(mc.volumeControl);
Utils.initButton(mc.start_btn, levelSelect);
mc.achievements_btn.visible = false;
Utils.initBrandinButton(mc.brandingButton, "Main_Menu");
if (Flakboy.bIphone){
_local2 = new btn_Iphone();
_local2.x = 625;
_local2.y = 277;
mc.addChild(_local2);
Utils.initButton(_local2, ClickIphoneBtn);
};
Music.playSong("mainScreen");
if (SpilGame.isExternal){
Utils.initPromotionButton(mc.highscores_btn);
} else {
mc.highscores_btn.visible = false;
};
}
private function levelSelect(_arg1:Event):void{
levelSelectScreen = new LevelSelectionScreen(main);
addChild(levelSelectScreen);
}
private function ClickIphoneBtn(_arg1:Event):void{
var _local2:String;
_local2 = verifyCountryID(SpilGame.currentLanguage.name, SpilGame.currentBranding.portalGroup);
navigateToURL(new URLRequest(_local2), "_blank");
}
private function verifyCountryID(_arg1:String, _arg2:uint):String{
switch (_arg1.toLowerCase()){
case "en_us":
return ("http://www.gamesgames.com/iphone_games_flakboy.html");
case "en_uk":
return ("http://www.games.co.uk/iphone_games_flakboy.html");
case "nl":
return ("http://www.spelletjes.nl/iphone_games_flakboy.html");
case "de":
return ("http://www.jetztspielen.de/iphone_games_flakboy.html");
case "fr":
return ("http://www.jeux.fr/iphone_games_flakboy.html");
case "es":
return ("http://www.juegos.com/iphone_games_flakboy.html");
case "br":
return ("http://www.ojogos.com.br/iphone_games_flakboy.html");
case "pt":
return ("http://www.ojogos.pt/iphone_games_flakboy.html");
case "it":
return ("http://www.gioco.it/iphone_games_flakboy.html");
case "se":
return ("http://www.spela.se/iphone_games_flakboy.html");
case "pl":
return ("http://www.gry.pl/iphone_games_flakboy.html");
case "ru":
return ("http://www.ourgames.ru/iphone_games_flakboy.html");
case "id":
return ("http://www.gamesgames.com/iphone_games_flakboy.html");
default:
return ("http://www.gamesgames.com/iphone_games_flakboy.html");
};
}
}
}//package spill.flakboy.menus
Section 389
//OptionsScreen (spill.flakboy.menus.OptionsScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.*;
import gfx.ui.*;
import spill.flakboy.ui.controls.*;
import spill.flakboy.utils.*;
import spill.flakboy.sound.*;
public class OptionsScreen extends InGameMenuBase {
private var volumeControl:VolumeControl;
private var game:Game;
private var levelSelectionScreen:LevelSelectionScreen;
private var mc:OptionsScreen_mc;
private var qualityControl:QualityControl;
public function OptionsScreen(_arg1:Game){
game = _arg1;
mc = new OptionsScreen_mc();
super(mc);
qualityControl = new QualityControl(mc.qualityControl);
volumeControl = new VolumeControl(mc.volumeControl);
mc.achievementButton.visible = false;
Utils.initButton(mc.backToMainButton, backToMain);
Utils.initButton(mc.sendToFriendButton, sendToFriend);
Utils.initButton(mc.levelSelectButton, selectLevel);
Utils.initButton(mc.backButton, back);
easingTime = 6;
startTransition();
Music.playSong("mainScreen");
}
private function sendToFriend(_arg1:Event):void{
parent.addChild(new SendToFriendScreen());
}
private function back(_arg1:Event):void{
startTransitionOut(back2);
}
private function back2():void{
Music.playPreviousSong();
parent.removeChild(this);
}
private function selectLevel(_arg1:Event):void{
levelSelectionScreen = new LevelSelectionScreen(game.main);
parent.addChild(levelSelectionScreen);
}
private function backToMain(_arg1:Event):void{
startTransitionOut(game.backToMain);
}
}
}//package spill.flakboy.menus
Section 390
//PlaybackEndScreen (spill.flakboy.menus.PlaybackEndScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.*;
import gfx.ui.*;
import spill.flakboy.character.*;
import spill.flakboy.utils.*;
import spill.localisation.*;
public class PlaybackEndScreen extends InGameMenuBase {
private var game:Game;
private var mc:PlaybackEndScreen_mc;
public function PlaybackEndScreen(_arg1:Game){
game = _arg1;
mc = new PlaybackEndScreen_mc();
super(mc);
Utils.initButton(mc.replayButton, replay);
Utils.initButton(mc.backButton, back);
Utils.initBrandinButton(mc.brandingButton, "STF_Landing_Screen_Playback_Ended");
var _local2:Number = FlakboyControl.instance.totalDamage;
var _local3:String = SpilGame.getString("Damage_Message");
mc.damageMessage.text = _local3.replace("XXX", Math.round(_local2));
easingTime = 8;
startTransition();
}
private function replay(_arg1:Event):void{
startTransitionOut(replay2);
}
private function back2():void{
parent.removeChild(this);
game.backToMain();
}
private function replay2():void{
parent.removeChild(this);
game.replay();
}
private function back(_arg1:Event):void{
startTransitionOut(back2);
}
}
}//package spill.flakboy.menus
Section 391
//PlayWithGoreScreen (spill.flakboy.menus.PlayWithGoreScreen)
package spill.flakboy.menus {
import flash.events.*;
import gfx.ui.*;
import spill.flakboy.utils.*;
import spill.localisation.*;
import flash.net.*;
public class PlayWithGoreScreen extends InGameMenuBase {
private var mc:PlayWithGoreScreen_mc;
public function PlayWithGoreScreen(){
mc = new PlayWithGoreScreen_mc();
super(mc);
Utils.initButton(mc.withButton, goA10);
Utils.initButton(mc.withoutButton, back);
startTransition();
}
private function goA10(_arg1:Event):void{
var _local2:String = SpilGame.getSendToFriendLink().replace("send_to_friend", "Play_With_Gore");
navigateToURL(new URLRequest(_local2), "_blank");
}
private function removeMe():void{
parent.removeChild(this);
}
private function back(_arg1:Event):void{
startTransitionOut(removeMe);
}
}
}//package spill.flakboy.menus
Section 392
//PreloaderScreen (spill.flakboy.menus.PreloaderScreen)
package spill.flakboy.menus {
import flash.events.*;
import flash.display.*;
import mx.preloaders.*;
import spill.localisation.*;
import flash.net.*;
import mochi.as3.*;
import gfx.ui.*;
public class PreloaderScreen extends DownloadProgressBar {
private var mc:Preloader_mc;
private var ldrInfo:LoaderInfo;
private var _clip:MovieClip;
public function PreloaderScreen(_arg1:LoaderInfo){
ldrInfo = _arg1;
ldrInfo.addEventListener(ProgressEvent.PROGRESS, progress, false, 0, true);
mc = new Preloader_mc();
mc.brandingButton.addEventListener(MouseEvent.CLICK, brandingButtonClicked, false, 0, true);
addChild(mc);
if (Flakboy.bMochi){
_clip = new MovieClip();
addChild(_clip);
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
};
}
private function MochiAdComplete():void{
if (hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, init);
};
dispatchEvent(new Event(Event.COMPLETE));
}
private function init(_arg1:Event):void{
if (hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, init);
};
MochiServices.connect("9fbd48097a7095d4", parent);
MochiAd.showPreGameAd({clip:_clip, id:"9fbd48097a7095d4", res:((700 + "x") + 540), ad_finished:MochiAdComplete});
}
private function brandingButtonClicked(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(SpilGame.getMoreGamesLink("More_Games_Button_Preloader")));
}
private function progress(_arg1:ProgressEvent):void{
var _local2:Number = (ldrInfo.bytesLoaded / ldrInfo.bytesTotal);
mc.loadingBar.scaleX = _local2;
if (_local2 == 1){
if (!Flakboy.bMochi){
MochiAdComplete();
};
ldrInfo.removeEventListener(ProgressEvent.PROGRESS, progress, false);
ldrInfo = null;
};
}
}
}//package spill.flakboy.menus
Section 393
//SendToFriendScreen (spill.flakboy.menus.SendToFriendScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.data.*;
import spill.flakboy.*;
import gfx.ui.*;
import fl.managers.*;
import spill.flakboy.utils.*;
import spill.flakboy.sound.*;
import spill.localisation.*;
import flash.system.*;
public class SendToFriendScreen extends InGameMenuBase {
private var focusManager:FocusManager;
private var mc:SendToFriendScreen_mc;
public function SendToFriendScreen(){
mc = new SendToFriendScreen_mc();
super(mc);
Utils.initButton(mc.backButton, back);
Utils.initButton(mc.copyButton, copyUrl);
easingTime = 8;
startTransition();
if (Data.lastUsedName){
mc.nameText.text = Data.lastUsedName;
} else {
mc.nameText.text = SpilGame.getString("default_name");
};
mc.nameText.embedFonts = SpilGame.currentLanguage.embedFonts;
mc.nameText.maxChars = 20;
generateUrl();
Music.playSong("mainScreen");
}
override protected function fadeInDone():void{
stage.focus = mc.nameText;
mc.nameText.setSelection(0, mc.nameText.text.length);
}
private function back(_arg1:Event=null):void{
startTransitionOut(removeMe);
}
private function nameFocusLost(_arg1:FocusEvent):void{
generateUrl();
stage.focus = mc.urlText;
}
private function copyUrl(_arg1:Event):void{
generateUrl();
System.setClipboard(mc.urlText.text);
}
private function generateUrl():void{
Data.lastUsedName = mc.nameText.text;
var _local1:String = Game.instance.layout.exportString(mc.nameText.text);
var _local2:String = SpilGame.getSendToFriendLink();
mc.urlText.text = ((_local2 + "&code=") + _local1);
}
private function removeMe():void{
Music.playPreviousSong();
parent.removeChild(this);
}
}
}//package spill.flakboy.menus
Section 394
//SentFromFriendScreen (spill.flakboy.menus.SentFromFriendScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.*;
import gfx.ui.*;
import spill.flakboy.utils.*;
import spill.localisation.*;
public class SentFromFriendScreen extends InGameMenuBase {
private var game:Game;
private var mc:SentFromFriendScreen_mc;
public function SentFromFriendScreen(_arg1:Game, _arg2:String, _arg3:Boolean=false){
var _local4:String;
game = _arg1;
mc = new SentFromFriendScreen_mc();
super(mc);
if (!_arg3){
_local4 = SpilGame.getString("Friend_Message").replace("XXX", _arg2);
mc.backButton.visible = false;
Utils.initButton(mc.playButton, playback);
} else {
_local4 = "{Send_To_Friend_Error}";
mc.playButton.visible = false;
Utils.initButton(mc.backButton, goBack);
};
mc.messageText.text = _local4;
Utils.initBrandinButton(mc.brandingButton, "STF_Landing_Screen");
easingTime = 8;
startTransition();
}
private function playback2():void{
game.startPlayBack();
parent.removeChild(this);
}
private function goBack2(_arg1:Event=null):void{
game.backToMain();
}
private function playback(_arg1:Event):void{
startTransitionOut(playback2);
}
private function goBack(_arg1:Event):void{
startTransitionOut(goBack2);
}
}
}//package spill.flakboy.menus
Section 395
//SubmitScoreScreen (spill.flakboy.menus.SubmitScoreScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.data.*;
import gfx.ui.*;
import spill.flakboy.utils.*;
import flash.ui.*;
public class SubmitScoreScreen extends InGameMenuBase {
private var mc:SubmitScoreScreen_mc;
private var main:Main;
public function SubmitScoreScreen(_arg1:Main){
main = _arg1;
mc = new SubmitScoreScreen_mc();
super(mc);
mc.nameText.selectable = false;
if (main.loaderInfo.parameters.hasOwnProperty("username")){
mc.nameText.text = main.loaderInfo.parameters["username"];
} else {
mc.nameText.text = "";
mc.nameText.visible = true;
};
Utils.initButton(mc.submitButton, submitScore);
mc.scoreText.text = ("$" + Data.getTotalProfit());
Utils.initButton(mc.backButton, back);
easingTime = 6;
startTransition();
}
private function keyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
submitScore();
};
}
private function back(_arg1:Event):void{
startTransitionOut(removeMe);
}
private function submitScore(_arg1:Event=null):void{
var _local2:Number = Data.getTotalProfit();
Data.lastUsedName = mc.nameText.text;
Data.bestScore = _local2;
main.O11O.m_SubmitScore(_local2);
mc.nameText.text = "";
startTransitionOut(showSubmitFollowupScreen);
}
private function removeMe():void{
parent.removeChild(this);
}
private function showSubmitFollowupScreen():void{
parent.addChild(new LevelSelectionScreen(main));
removeMe();
}
}
}//package spill.flakboy.menus
Section 396
//TutorialIntroScreen (spill.flakboy.menus.TutorialIntroScreen)
package spill.flakboy.menus {
import flash.events.*;
import spill.flakboy.*;
import gfx.ui.*;
import spill.flakboy.utils.*;
public class TutorialIntroScreen extends InGameMenuBase {
private var game:Game;
private var mc:TutorialIntroScreen_mc;
public function TutorialIntroScreen(_arg1:Game, _arg2:String){
game = _arg1;
mc = new TutorialIntroScreen_mc();
super(mc);
mc.text.text = _arg2;
Utils.initButton(mc.continueButton, back);
startTransition();
}
private function back(_arg1:Event):void{
startTransitionOut(removeMe);
}
private function removeMe():void{
parent.removeChild(this);
game.exitTutorialIntro();
}
}
}//package spill.flakboy.menus
Section 397
//Music (spill.flakboy.sound.Music)
package spill.flakboy.sound {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import sfx.music.*;
public class Music {
public static const TEST:Object = {fadeInStart:0, fadeInTime:5, fadeOutStart:1, fadeOutTime:5};
public static const NO_FADE:Object = {fadeInStart:1, fadeInTime:0, fadeOutStart:0, fadeOutTime:0};
public static const FADE_IN_OUT:Object = {fadeInStart:0.5, fadeInTime:1, fadeOutStart:1, fadeOutTime:0.5};
public static const FADE_IN:Object = {fadeInStart:0, fadeInTime:1, fadeOutStart:0, fadeOutTime:0};
public static const FADE_OUT:Object = {fadeInStart:1, fadeInTime:0, fadeOutStart:1, fadeOutTime:1};
private static const frameRate:Number = 30;
private static var isFading:Boolean = false;
private static var songs:Object = {mainScreen:MainScreenMusic, levelFailed:LevelFailed, levelComplete:LevelComplete, music0:Music1, music1:Music2, music2:Music3, trophy:TrophyMusic};
private static var enterFrameDispatcher:MovieClip = new MovieClip();
private static var lastChannel:SoundChannel;
private static var currentFade:Object;
private static var currentSound:Sound;
private static var lastSound:Sound;
private static var currentSong:String;
private static var paused:Boolean;
public static var _volume:Number = 1;
private static var pausePosition:Number;
private static var currentChannel:SoundChannel;
private static var lastSong:String;
private static var currentTransform:SoundTransform;
private static var lastTransform:SoundTransform;
private static var _mute:Number = 1;
public static function playPreviousSong():void{
playSong(lastSong);
}
public static function get volume():Number{
return (_volume);
}
public static function get mute():Boolean{
return (!(Boolean(_mute)));
}
private static function doFade(_arg1:Event):void{
var _local2:Boolean;
var _local3:Boolean;
if (((((lastSong) && (lastTransform))) && (lastChannel))){
lastTransform.volume = (lastTransform.volume - (volume / (frameRate * currentFade.fadeOutTime)));
if (lastTransform.volume <= 0){
lastTransform.volume = 0;
lastChannel.stop();
_local2 = true;
} else {
lastChannel.soundTransform = lastTransform;
};
} else {
_local2 = true;
};
if (((((currentSong) && (currentTransform))) && (currentChannel))){
currentTransform.volume = (currentTransform.volume + (volume / (frameRate * currentFade.fadeInTime)));
if (currentTransform.volume >= (volume * _mute)){
currentTransform.volume = (volume * _mute);
_local3 = true;
};
currentChannel.soundTransform = currentTransform;
} else {
_local3 = true;
};
if (((_local2) && (_local3))){
enterFrameDispatcher.removeEventListener(Event.ENTER_FRAME, doFade);
isFading = false;
};
}
public static function resume():void{
if (!paused){
return;
};
paused = false;
currentChannel = currentSound.play((pausePosition % currentSound.length), 1, currentTransform);
if (currentChannel){
currentChannel.addEventListener(Event.SOUND_COMPLETE, loopSong, false, 0, true);
};
}
public static function set mute(_arg1:Boolean):void{
_mute = (_arg1) ? 0 : 1;
if (((currentTransform) && (currentChannel))){
currentTransform.volume = (_mute * volume);
currentChannel.soundTransform = currentTransform;
};
}
public static function set volume(_arg1:Number):void{
_volume = _arg1;
if (((currentTransform) && (currentChannel))){
currentTransform.volume = (_mute * _volume);
currentChannel.soundTransform = currentTransform;
};
}
public static function stopSong(_arg1:Object=null):void{
playSong(null, false, _arg1);
}
private static function loopSong(_arg1:Event):void{
currentChannel = currentSound.play(0, 100, currentTransform);
}
public static function playSong(_arg1:String=null, _arg2:Boolean=true, _arg3:Object=null, _arg4:Boolean=false):SoundChannel{
if ((((currentSong == _arg1)) && (!(_arg4)))){
return (null);
};
if (((isFading) && (lastChannel))){
lastChannel.stop();
};
currentFade = (_arg3) ? _arg3 : FADE_IN_OUT;
pausePosition = 0;
trace(("playing song: " + _arg1));
lastSong = currentSong;
if (currentSong != null){
lastSound = currentSound;
lastTransform = currentTransform;
lastChannel = currentChannel;
if (lastTransform){
lastTransform.volume = ((currentFade.fadeOutStart * volume) * _mute);
};
};
currentSong = _arg1;
if (songs[_arg1] != null){
currentSound = new (songs[_arg1]);
currentChannel = currentSound.play(0, (_arg2) ? 100 : 1);
currentTransform = new SoundTransform();
currentTransform.volume = ((currentFade.fadeInStart * volume) * _mute);
if (currentChannel){
currentChannel.soundTransform = currentTransform;
};
};
enterFrameDispatcher.addEventListener(Event.ENTER_FRAME, doFade);
isFading = true;
paused = false;
return (currentChannel);
}
public static function pause():void{
paused = true;
pausePosition = currentChannel.position;
currentChannel.stop();
}
}
}//package spill.flakboy.sound
Section 398
//SoundFX (spill.flakboy.sound.SoundFX)
package spill.flakboy.sound {
import spill.flakboy.data.*;
import flash.utils.*;
import flash.media.*;
public class SoundFX {
private static var soundDict:Dictionary = new Dictionary();
private static var _mute:Boolean = false;
public static var volume:Number = 1;
public static function get mute():Boolean{
return (_mute);
}
public static function set mute(_arg1:Boolean):void{
_mute = _arg1;
}
public static function playSound(_arg1:Class, _arg2:Number=1, _arg3:Number=1):SoundChannel{
if ((!(_arg1) is Class)){
return (null);
};
var _local4:Sound = new (_arg1);
var _local5:SoundChannel = _local4.play(0, _arg2);
if (!_local5){
return (null);
};
_local5.soundTransform = new SoundTransform((_mute) ? 0 : ((Data.volume * _arg3) * 0.7));
return (_local5);
}
}
}//package spill.flakboy.sound
Section 399
//Tool (spill.flakboy.tools.core.Tool)
package spill.flakboy.tools.core {
import flash.display.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Common.Math.*;
import spill.flakboy.ui.*;
public class Tool extends spElement {
protected var y:Number;
protected var container:Sprite;
protected var placement:int;
protected var dummy:ToolDummy;
protected var position:b2Vec2;
protected var _mc:MovieClip;
protected var x:Number;
protected var display:Display;
public function Tool(_arg1:ToolDummy){
filter.categoryBits = Engine.toolBit;
dummy = _arg1;
x = dummy.x;
y = dummy.y;
placement = dummy.placement;
position = new b2Vec2((x / Game.drawScale), (y / Game.drawScale));
container = new Sprite();
_mc = new dummy.descriptor.mcClass();
_mc.rotation = dummy.getRotation();
_mc.stop();
spSettings.stopChildren(_mc);
container.addChild(_mc);
container.x = x;
container.y = y;
}
protected function toolDepleted():void{
Engine.toolDepleted();
}
override protected function addToDisplay(_arg1:spDisplay):void{
display = Display(_arg1);
display.tools.addChild(container);
}
override protected function removeFromDisplay(_arg1:spDisplay):void{
if (container.parent){
display.tools.removeChild(container);
};
}
}
}//package spill.flakboy.tools.core
Section 400
//ToolCategories (spill.flakboy.tools.core.ToolCategories)
package spill.flakboy.tools.core {
public class ToolCategories {
public static const MINES:int = 0;
public static const SPRINGS:int = 2;
public static const SPIKES:int = 3;
public static const OTHER:int = 5;
public static const GUNS:int = 1;
public static const MISSILES:int = 4;
}
}//package spill.flakboy.tools.core
Section 401
//ToolDescr (spill.flakboy.tools.core.ToolDescr)
package spill.flakboy.tools.core {
import flash.geom.*;
public class ToolDescr {
public var toolClass:Class;
public var mcClass:Class;
public var level:int;
public var possiblePlacements:uint;
public var cost:Number;
public var name:String;
public var id:int;
public var bounding:Rectangle;
public var category:int;
public var dummyClass:Class;
public var rotationOffset:Number;// = 0
public var type:String;
public var description:String;
public var iconClass:Class;
public function ToolDescr(){
dummyClass = ToolDummy;
super();
}
}
}//package spill.flakboy.tools.core
Section 402
//ToolDummy (spill.flakboy.tools.core.ToolDummy)
package spill.flakboy.tools.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import spill.flakboy.*;
import spill.physics.*;
import flash.geom.*;
import sfx.*;
import spill.flakboy.tools.specials.*;
import spill.flakboy.sound.*;
import flash.filters.*;
public class ToolDummy extends Sprite {
public var locationValid:Boolean;// = false
private var invalidFilters:Array;
private var isMouseOver:Boolean;// = false
private var mc:MovieClip;
private var isDragging:Boolean;// = false
private var clickDelay:Number;// = 250
private var snapDistance:Number;// = 30
private var mouseOverFilters:Array;
public var placement:uint;// = 0
private var downTime:int;
private var layout:ToolLayout;
public var descriptor:ToolDescr;
public static const PRESSED:String = "toolDummyPressed";
public static const RELEASED:String = "toolDummyReleased";
public function ToolDummy(_arg1:ToolDescr, _arg2:ToolLayout){
mouseOverFilters = [new GlowFilter(0xFF00, 1, 4, 4, 3, 1)];
invalidFilters = [new GlowFilter(0xFF0000, 1, 4, 4, 3, 1)];
super();
layout = _arg2;
descriptor = _arg1;
mc = new (_arg1.mcClass);
mc.stop();
addChild(mc);
if (mc.hit_area){
mc.hitArea = mc.hit_area;
mc.hit_area.visible = false;
};
spSettings.stopChildren(mc);
addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, rollOut, false, 0, true);
}
public function snap():Boolean{
var _local1:Rectangle;
locationValid = false;
placement = 0;
mc.rotation = 0;
if ((descriptor.possiblePlacements & ToolPlacements.LEFT)){
if (Math.abs(x) < snapDistance){
_local1 = getLocalBounds(ToolPlacements.LEFT);
if (((((y + _local1.top) > 0)) && (((y + _local1.bottom) < Game.physicsHeight)))){
x = 0;
locationValid = true;
placement = ToolPlacements.LEFT;
mc.rotation = 90;
};
};
};
if ((((descriptor.possiblePlacements & ToolPlacements.RIGHT)) && (!(locationValid)))){
if (Math.abs((x - Game.physicsWidth)) < snapDistance){
_local1 = getLocalBounds(ToolPlacements.RIGHT);
if (((((y + _local1.top) > 0)) && (((y + _local1.bottom) < Game.physicsHeight)))){
x = Game.physicsWidth;
locationValid = true;
placement = ToolPlacements.RIGHT;
mc.rotation = -90;
};
};
};
if ((((descriptor.possiblePlacements & ToolPlacements.TOP)) && (!(locationValid)))){
if (Math.abs(y) < snapDistance){
_local1 = getLocalBounds(ToolPlacements.TOP);
if (((((x + _local1.left) > 0)) && (((x + _local1.right) < Game.physicsWidth)))){
y = 0;
locationValid = true;
placement = ToolPlacements.TOP;
mc.rotation = 180;
};
};
};
if ((((descriptor.possiblePlacements & ToolPlacements.BOTTOM)) && (!(locationValid)))){
if (Math.abs((y - Game.physicsHeight)) < snapDistance){
_local1 = getLocalBounds(ToolPlacements.BOTTOM);
if (((((x + _local1.left) > 0)) && (((x + _local1.right) < Game.physicsWidth)))){
y = Game.physicsHeight;
locationValid = true;
placement = ToolPlacements.BOTTOM;
mc.rotation = 0;
};
};
};
if ((((descriptor.possiblePlacements & ToolPlacements.BACK)) && (!(locationValid)))){
_local1 = getLocalBounds(ToolPlacements.BACK);
if (((((x + _local1.left) > Game.physx)) && (((x + _local1.right) < (Game.physicsWidth - Game.physx))))){
if (((((y + _local1.top) > Game.physy)) && (((y + _local1.bottom) < (Game.physicsHeight - Game.physy))))){
locationValid = true;
placement = ToolPlacements.BACK;
mc.rotation = 0;
};
};
};
if ((descriptor.possiblePlacements & ToolPlacements.DUCKY)){
if (Ducky.leftRect.contains(x, y)){
locationValid = true;
placement = ToolPlacements.DUCKY;
x = Ducky.leftPoint.x;
y = Ducky.leftPoint.y;
scaleX = -1;
Ducky.side = 1;
} else {
if (Ducky.rightRect.contains(x, y)){
locationValid = true;
placement = ToolPlacements.DUCKY;
x = Ducky.rightPoint.x;
y = Ducky.rightPoint.y;
scaleX = 1;
Ducky.side = -1;
};
};
};
locationValid = ((locationValid) && (layout.locationValid(this)));
if (((!(locationValid)) && ((descriptor.possiblePlacements == ToolPlacements.WALLS)))){
if (x < (Game.physicsWidth / 2)){
placement = ToolPlacements.LEFT;
} else {
placement = ToolPlacements.RIGHT;
};
mc.rotation = (90 - ((x / Game.physicsWidth) * 180));
};
if (((!(locationValid)) && ((descriptor.possiblePlacements == (ToolPlacements.TOP | ToolPlacements.BOTTOM))))){
if (y < (Game.physicsHeight / 2)){
placement = ToolPlacements.TOP;
} else {
placement = ToolPlacements.BOTTOM;
};
mc.rotation = (180 - ((y / Game.physicsHeight) * 180));
};
mc.rotation = (mc.rotation - descriptor.rotationOffset);
if (locationValid){
drawBound();
} else {
clearBound();
};
return (locationValid);
}
function playPlacementSound():void{
var _local1:Class;
var _local2:int = descriptor.category;
if (_local2 == ToolCategories.GUNS){
_local1 = PlaceTurret;
} else {
if (_local2 == ToolCategories.MINES){
_local1 = PlaceMine;
} else {
if (_local2 == ToolCategories.MISSILES){
_local1 = PlaceMisseles;
} else {
if (_local2 == ToolCategories.SPRINGS){
_local1 = PlaceSpringTool2;
} else {
if (_local2 == ToolCategories.SPIKES){
_local1 = PlaceSpikes;
} else {
if (descriptor.toolClass == Ducky){
_local1 = PlaceDuck;
} else {
if (_local2 == ToolCategories.OTHER){
if (descriptor.toolClass == Skinner){
_local1 = PlaceElectrocutor;
} else {
if (descriptor.toolClass == Electrocutor){
_local1 = PlaceSkinner;
};
};
};
};
};
};
};
};
};
SoundFX.playSound(_local1);
}
private function rollOut(_arg1:MouseEvent=null):void{
isMouseOver = false;
if (!isDragging){
filters = [];
};
}
public function remove():void{
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp, false);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragging, false);
locationValid = false;
dispatchEvent(new Event(RELEASED));
clearBound();
}
private function drawBound():void{
}
private function mouseUp(_arg1:Event):void{
if ((getTimer() - downTime) < clickDelay){
return;
};
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp, false);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragging, false);
dragging();
isDragging = false;
if (!isMouseOver){
rollOut();
};
dispatchEvent(new Event(RELEASED));
clearBound();
}
public function getToolBounds(_arg1:uint=0):Rectangle{
if (!_arg1){
_arg1 = placement;
};
var _local2:Rectangle = getLocalBounds(_arg1);
_local2.offset(x, y);
return (_local2);
}
public function mouseDown(_arg1:Event=null):void{
if (((isDragging) || (!(stage)))){
return;
};
downTime = getTimer();
filters = mouseOverFilters;
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragging, false, 0, true);
dragging();
isDragging = true;
dispatchEvent(new Event(PRESSED));
drawBound();
}
private function rollOver(_arg1:MouseEvent=null):void{
isMouseOver = true;
if (!isDragging){
filters = mouseOverFilters;
};
}
public function getRotation():Number{
return (mc.rotation);
}
public function getLocalBounds(_arg1:uint=0):Rectangle{
if (!_arg1){
_arg1 = placement;
};
var _local2:Rectangle = new Rectangle();
var _local3:Rectangle = descriptor.bounding.clone();
if ((((_arg1 & ToolPlacements.BOTTOM)) || ((_arg1 & ToolPlacements.BACK)))){
_local2 = _local3;
} else {
if ((_arg1 & ToolPlacements.LEFT)){
_local2.x = -(_local3.bottom);
_local2.y = _local3.left;
_local2.width = _local3.height;
_local2.height = _local3.width;
} else {
if ((_arg1 & ToolPlacements.RIGHT)){
_local2.x = _local3.top;
_local2.y = -(_local3.right);
_local2.width = _local3.height;
_local2.height = _local3.width;
} else {
if ((_arg1 & ToolPlacements.TOP)){
_local2.x = _local3.x;
_local2.y = -(_local3.bottom);
_local2.width = _local3.width;
_local2.height = _local3.height;
} else {
if ((_arg1 & ToolPlacements.DUCKY)){
_local2 = _local3;
};
};
};
};
};
return (_local2);
}
private function clearBound():void{
graphics.clear();
}
private function dragging(_arg1:MouseEvent=null):void{
x = parent.mouseX;
y = parent.mouseY;
snap();
filters = (locationValid) ? mouseOverFilters : invalidFilters;
alpha = (locationValid) ? 1 : 0.7;
if (_arg1){
_arg1.updateAfterEvent();
};
}
}
}//package spill.flakboy.tools.core
Section 403
//ToolLayout (spill.flakboy.tools.core.ToolLayout)
package spill.flakboy.tools.core {
import flash.events.*;
import flash.display.*;
import spill.flakboy.*;
import spill.flakboy.ui.*;
import flash.geom.*;
import spill.flakboy.utils.*;
import spill.flakboy.tools.specials.*;
public class ToolLayout extends Sprite {
private var placing:Boolean;// = false
public var friendName:String;
private var hatchRect:Rectangle;
private var ui:Sidebar;
public var duckySide:Number;// = 1
public var tools:Array;
public var map:Bitmap;
public var hasDucky:Boolean;// = false
public var mapData:BitmapData;
private var currentTool:ToolDummy;
public function ToolLayout(_arg1:Sidebar){
tools = new Array();
mapData = new BitmapData(Game.roomWidth, Game.roomHeight, true, 0);
map = new Bitmap(mapData);
map.x = -(Game.physx);
map.y = -(Game.physy);
ui = _arg1;
addChild(map);
var _local2:Number = 100;
var _local3:Number = 150;
hatchRect = new Rectangle(((Game.physicsWidth - 100) / 2), (Game.roomHeight - _local3), _local2, _local3);
}
private function duckyAdded():void{
hasDucky = true;
Game.instance.duckyAdded();
}
public function locationValid(_arg1:ToolDummy):Boolean{
var _local2:ToolDummy;
for each (_local2 in tools) {
if (_local2 == _arg1){
} else {
if (_local2.getToolBounds().intersects(_arg1.getToolBounds())){
return (false);
};
};
};
return (!(_arg1.getToolBounds().intersects(hatchRect)));
}
public function clear():void{
var _local1:int = (tools.length - 1);
while (_local1 >= 0) {
removeTool(tools[_local1], false);
_local1--;
};
Engine.resetRecording();
}
public function addDummy(_arg1:ToolDummy, _arg2:Boolean):void{
tools.push(_arg1);
addChild(_arg1);
_arg1.addEventListener(ToolDummy.RELEASED, toolReleased, false, 0, true);
_arg1.addEventListener(ToolDummy.PRESSED, toolPressed, false, 0, true);
if (_arg2){
_arg1.mouseDown();
};
Engine.resetRecording();
}
public function get moneySpent():Number{
var _local2:ToolDummy;
var _local1:Number = 0;
for each (_local2 in tools) {
_local1 = (_local1 + _local2.descriptor.cost);
};
return (_local1);
}
public function importString(_arg1:String):Boolean{
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:ToolDescr;
var _local8:ToolDummy;
var _local2:BitArray = new BitArray();
_local2.writeBytes(Base64.decodeToByteArray(unescape(_arg1)));
_local2.position = 0;
var _local3:Number = 0;
while (_local2.bytesAvailable) {
_local4 = _local2.readBits(10);
if (_local4 == 1023){
friendName = _local2.readUTFBytes(_local2.bytesAvailable);
return (true);
};
_local5 = _local2.readBits(9);
_local6 = _local2.readBits(5);
_local7 = ToolList.getTool(_local6);
if (!_local7){
trace("error: invalid tool id");
return (false);
};
_local8 = new ToolDummy(_local7, this);
_local8.x = _local4;
_local8.y = _local5;
if (((_local8.snap()) && (locationValid(_local8)))){
addDummy(_local8, false);
if (_local8.descriptor == ToolList.ducky){
duckyAdded();
};
_local3++;
} else {
trace("invalid tool location, discarding");
return (false);
};
};
return (false);
}
public function addTool(_arg1:ToolDescr, _arg2:Boolean):void{
var _local3:ToolDummy = new ToolDummy(_arg1, this);
addDummy(_local3, _arg2);
Engine.resetRecording();
}
public function isMineField():Boolean{
var _local2:ToolDummy;
var _local1:Boolean;
for each (_local2 in tools) {
if (((!((_local2.descriptor.category == ToolCategories.MINES))) && (!((_local2.descriptor.toolClass == Ducky))))){
return (false);
};
if (_local2.descriptor.category == ToolCategories.MINES){
_local1 = true;
};
};
return (_local1);
}
public function validateLayout():Boolean{
var _local1:ToolDummy;
for each (_local1 in tools) {
if (((!(locationValid(_local1))) || (!(_local1.snap())))){
return (false);
};
};
return (true);
}
public function exportString(_arg1:String=""):String{
var _local3:ToolDummy;
var _local4:String;
var _local2:BitArray = new BitArray();
for each (_local3 in tools) {
_local2.writeBits(_local3.x, 10);
_local2.writeBits(_local3.y, 9);
_local2.writeBits(_local3.descriptor.id, 5);
};
_local2.writeBits(1023, 10);
_local2.flushInputBuffer();
_local2.writeUTFBytes(_arg1);
_local2.position = 0;
_local4 = escape(Base64.encodeByteArray(_local2));
return (_local4);
}
private function duckyRemoved():void{
hasDucky = false;
Game.instance.duckyRemoved();
}
private function toolPressed(_arg1:Event):void{
var _local2:ToolDummy = ToolDummy(_arg1.currentTarget);
if (placing){
currentTool.remove();
};
setChildIndex(_local2, (numChildren - 1));
drawMap(_local2);
map.visible = true;
placing = true;
currentTool = _local2;
}
public function hasToolCategory(_arg1:int):Boolean{
var _local2:ToolDummy;
for each (_local2 in tools) {
if (_local2.descriptor.category == _arg1){
return (true);
};
};
return (false);
}
private function toolReleased(_arg1:Event):void{
var _local2:ToolDummy = ToolDummy(_arg1.currentTarget);
if (!_local2.locationValid){
removeTool(_local2);
} else {
_local2.x = Math.round(_local2.x);
_local2.y = Math.round(_local2.y);
if (_local2.descriptor == ToolList.ducky){
duckyAdded();
};
Game.instance.toolPlaced(_local2.descriptor);
_local2.playPlacementSound();
};
Engine.resetRecording();
map.visible = false;
placing = false;
currentTool = null;
}
public function addingNewTool(_arg1:ToolDescr):void{
if ((((_arg1.toolClass == Ducky)) && (hasDucky))){
return;
};
if (Game.instance.bugget >= _arg1.cost){
Game.instance.bugget = (Game.instance.bugget - _arg1.cost);
addTool(_arg1, true);
};
}
public function removeTool(_arg1:ToolDummy, _arg2:Boolean=true):void{
if (_arg1.descriptor.toolClass == Ducky){
duckyRemoved();
};
if (_arg2){
Game.instance.bugget = (Game.instance.bugget + _arg1.descriptor.cost);
};
tools.splice(tools.indexOf(_arg1), 1);
_arg1.removeEventListener(ToolDummy.RELEASED, toolReleased);
_arg1.removeEventListener(ToolDummy.PRESSED, toolReleased);
removeChild(_arg1);
Engine.resetRecording();
}
private function drawMap(_arg1:ToolDummy):void{
var _local3:ToolDummy;
var _local6:Rectangle;
var _local7:Rectangle;
var _local8:Rectangle;
mapData.lock();
mapData.fillRect(mapData.rect, 0);
var _local2:Number = -(_arg1.descriptor.bounding.y);
if ((_arg1.descriptor.possiblePlacements & ToolPlacements.LEFT)){
mapData.fillRect(new Rectangle(0, Game.physy, (Game.physx * 2), Game.physicsHeight), 855703296);
};
if ((_arg1.descriptor.possiblePlacements & ToolPlacements.RIGHT)){
mapData.fillRect(new Rectangle((Game.roomWidth - (Game.physx * 2)), Game.physy, (Game.physx * 2), Game.physicsHeight), 855703296);
};
if ((_arg1.descriptor.possiblePlacements & ToolPlacements.BOTTOM)){
mapData.fillRect(new Rectangle(Game.physx, (Game.roomHeight - (Game.physy * 2)), Game.physicsWidth, (Game.physy * 2)), 855703296);
};
if ((_arg1.descriptor.possiblePlacements & ToolPlacements.TOP)){
mapData.fillRect(new Rectangle(Game.physx, 0, Game.physicsWidth, (Game.physy * 2)), 855703296);
};
if ((_arg1.descriptor.possiblePlacements & ToolPlacements.BACK)){
mapData.fillRect(new Rectangle((Game.physx * 2), (Game.physy * 2), (Game.physicsWidth - (Game.physx * 2)), (Game.physicsHeight - (Game.physy * 2))), 855703296);
};
for each (_local3 in tools) {
if (_local3 == _arg1){
} else {
_local6 = _local3.getToolBounds();
_local6.offset(Game.physx, Game.physy);
mapData.fillRect(_local6, 0);
};
};
if ((_arg1.descriptor.possiblePlacements & ToolPlacements.DUCKY)){
_local7 = Ducky.leftRect.clone();
_local7.offset(Game.physx, Game.physy);
_local8 = Ducky.rightRect.clone();
_local8.offset(Game.physx, Game.physy);
mapData.fillRect(_local7, 855703296);
mapData.fillRect(_local8, 855703296);
};
var _local4:Number = 100;
var _local5:Rectangle = hatchRect.clone();
_local5.offset(Game.physx, Game.physy);
mapData.fillRect(_local5, 0);
mapData.unlock();
}
}
}//package spill.flakboy.tools.core
Section 404
//ToolList (spill.flakboy.tools.core.ToolList)
package spill.flakboy.tools.core {
import gfx.ui.*;
import flash.geom.*;
import gfx.*;
import spill.flakboy.tools.specials.*;
import spill.flakboy.tools.mines.*;
import spill.flakboy.tools.spikes.*;
import spill.flakboy.tools.missiles.*;
import spill.flakboy.tools.turrets.*;
import spill.flakboy.tools.platforms.*;
import spill.flakboy.tools.*;
public class ToolList {
public static var ducky:ToolDescr;
private static var tools:Array = new Array();
public static function getCategory(_arg1:int, _arg2:int=0):Array{
var _local3:Array = new Array();
var _local4:int;
while (_local4 < tools.length) {
if (tools[_local4].toolClass == Ducky){
} else {
if ((((tools[_local4].category == _arg1)) && ((tools[_local4].level <= _arg2)))){
_local3.push(tools[_local4]);
};
};
_local4++;
};
return (_local3);
}
public static function init():void{
var _local1:ToolDescr;
_local1 = new ToolDescr();
_local1.bounding = new Rectangle(-20, -15, 40, 20);
_local1.category = ToolCategories.MINES;
_local1.cost = 100;
_local1.level = 0;
_local1.description = "{Mine1_Description}";
_local1.mcClass = Mine_mc;
_local1.toolClass = Mine1;
_local1.iconClass = Mine_icon;
_local1.possiblePlacements = ToolPlacements.BOTTOM;
addTool(_local1);
_local1 = new ToolDescr();
_local1.bounding = new Rectangle(-20, -15, 40, 20);
_local1.category = ToolCategories.MINES;
_local1.cost = 200;
_local1.level = 1;
_local1.description = "{Mine2_Description}";
_local1.mcClass = Mine2_mc;
_local1.toolClass = Mine2;
_local1.iconClass = Mine2_icon;
_local1.possiblePlacements = ToolPlacements.BOTTOM;
addTool(_local1);
_local1 = new ToolDescr();
_local1.bounding = new Rectangle(-20, -15, 40, 20);
_local1.category = ToolCategories.MINES;
_local1.cost = 300;
_local1.level = 3;
_local1.description = "{Mine3_Description}";
_local1.mcClass = Mine3_mc;
_local1.toolClass = Mine3;
_local1.iconClass = Mine3_icon;
_local1.possiblePlacements = (ToolPlacements.BOTTOM | ToolPlacements.TOP);
addTool(_local1);
_local1 = new ToolDescr();
_local1.bounding = new Rectangle(-20, -15, 40, 20);
_local1.category = ToolCategories.MINES;
_local1.cost = 400;
_local1.level = 6;
_local1.description = "{Mine4_Description}";
_local1.mcClass = Mine4_mc;
_local1.toolClass = Mine4;
_local1.iconClass = Mine4_icon;
_local1.possiblePlacements = ((ToolPlacements.BOTTOM | ToolPlacements.TOP) | ToolPlacements.WALLS);
addTool(_local1);
var _local2:TurretDescr = new TurretDescr();
_local2.cost = 100;
_local2.level = 0;
_local2.description = "{Turret1_Description}";
_local2.mcClass = Turret1_mc;
_local2.toolClass = Turret1;
_local2.iconClass = Turret_icon;
addTool(_local2);
_local2 = new TurretDescr();
_local2.cost = 200;
_local2.level = 2;
_local2.description = "{Turret2_Description}";
_local2.mcClass = Turret2_mc;
_local2.toolClass = Turret2;
_local2.iconClass = Turret2_icon;
_local2.possiblePlacements = (_local2.possiblePlacements | ToolPlacements.TOP);
addTool(_local2);
_local2 = new TurretDescr();
_local2.cost = 300;
_local2.level = 5;
_local2.description = "{Turret3_Description}";
_local2.mcClass = Turret3_mc;
_local2.toolClass = Turret3;
_local2.iconClass = Turret3_icon;
_local2.possiblePlacements = (_local2.possiblePlacements | ToolPlacements.EDGES);
addTool(_local2);
var _local3:ToolDescr = new ToolDescr();
_local3.bounding = new Rectangle(-50, -12, 100, 30);
_local3.category = ToolCategories.SPRINGS;
_local3.cost = 100;
_local3.level = 0;
_local3.description = "{Spring_Platform1_Description}";
_local3.mcClass = SpringPlatform_mc;
_local3.toolClass = SpringPlatform1;
_local3.iconClass = SpringPlatform_icon;
_local3.possiblePlacements = ToolPlacements.BOTTOM;
addTool(_local3);
_local3 = new ToolDescr();
_local3.bounding = new Rectangle(-50, -12, 100, 30);
_local3.category = ToolCategories.SPRINGS;
_local3.cost = 200;
_local3.level = 2;
_local3.description = "{Spring_Platform2_Description}";
_local3.mcClass = SpringPlatform2_mc;
_local3.toolClass = SpringPlatform2;
_local3.iconClass = SpringPlatform2_icon;
_local3.possiblePlacements = ToolPlacements.BOTTOM;
addTool(_local3);
_local3 = new ToolDescr();
_local3.bounding = new Rectangle(-50, -12, 100, 30);
_local3.category = ToolCategories.SPRINGS;
_local3.cost = 300;
_local3.level = 5;
_local3.description = "{Spring_Platform3_Description}";
_local3.mcClass = SpringPlatform3_mc;
_local3.toolClass = SpringPlatform3;
_local3.iconClass = SpringPlatform3_icon;
_local3.possiblePlacements = ToolPlacements.BOTTOM;
addTool(_local3);
var _local4:ToolDescr = new ToolDescr();
_local4.bounding = new Rectangle(-70, -12, 140, 30);
_local4.category = ToolCategories.SPIKES;
_local4.cost = 100;
_local4.level = 0;
_local4.description = "{Spikes1_Description}";
_local4.mcClass = Spikes_mc;
_local4.toolClass = Spikes1;
_local4.iconClass = Spikes_icon;
_local4.possiblePlacements = (ToolPlacements.WALLS | ToolPlacements.TOP);
addTool(_local4);
_local4 = new ToolDescr();
_local4.bounding = new Rectangle(-70, -12, 140, 30);
_local4.category = ToolCategories.SPIKES;
_local4.cost = 200;
_local4.level = 4;
_local4.description = "{Spikes2_Description}";
_local4.mcClass = Spikes2_mc;
_local4.toolClass = Spikes2;
_local4.iconClass = Spikes2_icon;
_local4.possiblePlacements = (ToolPlacements.WALLS | ToolPlacements.TOP);
addTool(_local4);
_local4 = new ToolDescr();
_local4.bounding = new Rectangle(-70, -12, 140, 30);
_local4.category = ToolCategories.SPIKES;
_local4.cost = 300;
_local4.level = 6;
_local4.description = "{Spikes3_Description}";
_local4.mcClass = Spikes3_mc;
_local4.toolClass = Spikes3;
_local4.iconClass = Spikes3_icon;
_local4.possiblePlacements = (ToolPlacements.WALLS | ToolPlacements.TOP);
addTool(_local4);
var _local5:ToolDescr = new ToolDescr();
_local5.bounding = new Rectangle(-22, -24, 44, 48);
_local5.category = ToolCategories.MISSILES;
_local5.cost = 200;
_local5.level = 3;
_local5.description = "{Missile1_Description}";
_local5.mcClass = MissileHatch_mc;
_local5.toolClass = Missile1;
_local5.iconClass = Missile_icon;
_local5.possiblePlacements = ToolPlacements.BACK;
addTool(_local5);
_local5 = new ToolDescr();
_local5.bounding = new Rectangle(-22, -24, 44, 48);
_local5.category = ToolCategories.MISSILES;
_local5.cost = 400;
_local5.level = 5;
_local5.description = "{Missile2_Description}";
_local5.mcClass = MissileHatch2_mc;
_local5.toolClass = Missile2;
_local5.iconClass = Missile2_icon;
_local5.possiblePlacements = ToolPlacements.BACK;
addTool(_local5);
_local5 = new ToolDescr();
_local5.bounding = new Rectangle(-22, -24, 44, 48);
_local5.category = ToolCategories.MISSILES;
_local5.cost = 600;
_local5.level = 7;
_local5.description = "{Missile3_Description}";
_local5.mcClass = MissileHatch3_mc;
_local5.toolClass = Missile3;
_local5.iconClass = Missile3_icon;
_local5.possiblePlacements = ToolPlacements.BACK;
addTool(_local5);
var _local6:ToolDescr = new ToolDescr();
_local6.bounding = new Rectangle(-20, -20, 40, 40);
_local6.category = ToolCategories.OTHER;
_local6.cost = 1000;
_local6.level = 6;
_local6.description = "{Electrocutor_Description}";
_local6.mcClass = Current_mc;
_local6.toolClass = Electrocutor;
_local6.iconClass = special_icon;
_local6.possiblePlacements = (ToolPlacements.WALLS | ToolPlacements.TOP);
_local6.rotationOffset = -90;
addTool(_local6);
_local6 = new ToolDescr();
_local6.bounding = new Rectangle(-20, -20, 40, 40);
_local6.category = ToolCategories.OTHER;
_local6.cost = 1000;
_local6.level = 7;
_local6.description = "{Skinner_Description}";
_local6.mcClass = HotSpotSkinner_mc;
_local6.toolClass = Skinner;
_local6.iconClass = ToxicIcon_icon;
_local6.possiblePlacements = ToolPlacements.BACK;
addTool(_local6);
_local6 = new ToolDescr();
_local6.bounding = new Rectangle(-10, -20, 20, 20);
_local6.category = ToolCategories.OTHER;
_local6.cost = 0;
_local6.level = 0;
_local6.description = "{Ducky_Description}";
_local6.mcClass = duck_mc;
_local6.toolClass = Ducky;
_local6.iconClass = DuckIcon_icon;
_local6.possiblePlacements = ToolPlacements.DUCKY;
addTool(_local6);
ducky = _local6;
}
private static function addTool(_arg1:ToolDescr):void{
_arg1.id = tools.length;
tools.push(_arg1);
}
public static function getTool(_arg1:Number):ToolDescr{
return (tools[_arg1]);
}
}
}//package spill.flakboy.tools.core
Section 405
//ToolPlacements (spill.flakboy.tools.core.ToolPlacements)
package spill.flakboy.tools.core {
public class ToolPlacements {
public static const DUCKY:uint = 32;
public static const ALL:uint = (EDGES | BACK);
public static const EDGES:uint = ((WALLS | TOP) | BOTTOM);
public static const LEFT:uint = 1;
public static const WALLS:uint = (LEFT | RIGHT);
public static const BOTTOM:uint = 8;
public static const TOP:uint = 4;
public static const RIGHT:uint = 2;
public static const BACK:uint = 16;
}
}//package spill.flakboy.tools.core
Section 406
//Mine1 (spill.flakboy.tools.mines.Mine1)
package spill.flakboy.tools.mines {
import spill.flakboy.tools.core.*;
public class Mine1 extends MineBase {
public function Mine1(_arg1:ToolDummy){
super(_arg1);
range = 3;
power = 30;
damage = 6;
directionalForce = 20;
}
}
}//package spill.flakboy.tools.mines
Section 407
//Mine2 (spill.flakboy.tools.mines.Mine2)
package spill.flakboy.tools.mines {
import spill.flakboy.tools.core.*;
public class Mine2 extends MineBase {
public function Mine2(_arg1:ToolDummy){
super(_arg1);
range = 3.3;
power = 35;
damage = 10;
directionalForce = 22;
}
}
}//package spill.flakboy.tools.mines
Section 408
//Mine3 (spill.flakboy.tools.mines.Mine3)
package spill.flakboy.tools.mines {
import spill.flakboy.tools.core.*;
public class Mine3 extends MineBase {
public function Mine3(_arg1:ToolDummy){
super(_arg1);
range = 3.6;
power = 40;
damage = 15;
directionalForce = 25;
}
}
}//package spill.flakboy.tools.mines
Section 409
//Mine4 (spill.flakboy.tools.mines.Mine4)
package spill.flakboy.tools.mines {
import spill.flakboy.tools.core.*;
public class Mine4 extends MineBase {
public function Mine4(_arg1:ToolDummy){
super(_arg1);
range = 4;
power = 45;
damage = 20;
directionalForce = 30;
}
}
}//package spill.flakboy.tools.mines
Section 410
//MineBase (spill.flakboy.tools.mines.MineBase)
package spill.flakboy.tools.mines {
import flash.events.*;
import flash.display.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import spill.flakboy.character.*;
import Box2D.Common.Math.*;
import com.gskinner.utils.*;
import gfx.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.physics.shapes.*;
public class MineBase extends Tool {
private var sensor:spBody;
private var exploded:Boolean;// = false
public var power:Number;// = 30
public var directionalForce:Number;// = 20
public var damage:Number;// = 5
private var mc:MovieClip;
public var range:Number;// = 3
public function MineBase(_arg1:ToolDummy){
super(_arg1);
useGlobalDensity = false;
density = 0;
position = new b2Vec2((x / Game.drawScale), (y / Game.drawScale));
sensor = new spBody();
var _local2:spCircle = new spCircle(0.3);
_local2.def.isSensor = true;
sensor.addShape(_local2);
sensor.position = position.Copy();
addBody(sensor);
mc = _mc;
mc.addFrameScript((mc.totalFrames - 1), explosionEnded);
}
override protected function removeFromWorld(_arg1:spWorld):void{
_arg1.removeEventListener("afterStep", afterStep, false);
}
private function explosionEnded():void{
if (Engine.instance){
Engine.instance.drawOnBackground(mc, dummy.x, dummy.y);
};
mc.stop();
mc.parent.removeChild(mc);
mc = null;
if (active){
world.removeElement(this);
};
}
override public function onAddContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if (!exploded){
if ((_arg3.parent.parent is Ragdoll)){
if ((_arg3.parent is RagdollLimb)){
if (!RagdollLimb(_arg3.parent).attached){
return;
};
};
RagdollBodypart(_arg3.parent).applyDamage(1, null, _arg1.position);
exploded = true;
};
};
}
override protected function addToWorld(_arg1:spWorld):void{
world.addEventListener("afterStep", afterStep, false, 0, true);
}
private function explode():void{
var _local5:spBody;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
removeBody(sensor);
var _local1:b2AABB = new b2AABB();
_local1.lowerBound.x = (position.x - range);
_local1.lowerBound.y = (position.y - range);
_local1.upperBound.x = (position.x + range);
_local1.upperBound.y = (position.y + range);
var _local2:Array = new Array();
world.ref.Query(_local1, _local2, 20);
var _local3:int;
while (_local3 < _local2.length) {
_local5 = spShape(_local2[_local3].GetUserData()).parent;
if ((_local5.parent is FlakboyControl)){
_local6 = _local5.position.Copy();
_local6.Subtract(position);
_local7 = _local6.Length();
if (_local7 < range){
_local6.Multiply(((power * _local5.ref.m_mass) * 10));
_local8 = ((dummy.rotation - 90) * (Math.PI / 180));
_local6.x = (_local6.x + (Math.cos(_local8) * directionalForce));
_local6.y = (_local6.y + (Math.sin(_local8) * directionalForce));
_local5.ref.ApplyForce(_local6, _local5.ref.GetWorldCenter());
_local5.ref.ApplyTorque(((Rndm.random() - 0.5) * 1000));
if ((_local5 is RagdollBodypart)){
RagdollBodypart(_local5).applyDamage((((range - _local7) / range) * damage), position);
};
SoundFX.playSound(MisselesImpact);
};
};
_local3++;
};
toolDepleted();
var _local4:RagdollBodypart = FlakboyControl.instance.torso;
Engine.instance.addBloodSplatter((_local4.position.x * Game.drawScale), (_local4.position.y * Game.drawScale), 3, ((_local4.position.x > position.x)) ? 1 : -1);
mc.play();
}
private function afterStep(_arg1:Event):void{
if (exploded){
world.removeEventListener("afterStep", afterStep);
FlakboyControl.instance.activate();
explode();
};
}
}
}//package spill.flakboy.tools.mines
Section 411
//Missile1 (spill.flakboy.tools.missiles.Missile1)
package spill.flakboy.tools.missiles {
import spill.flakboy.tools.core.*;
public class Missile1 extends MissileBase {
public function Missile1(_arg1:ToolDummy){
super(_arg1);
}
}
}//package spill.flakboy.tools.missiles
Section 412
//Missile2 (spill.flakboy.tools.missiles.Missile2)
package spill.flakboy.tools.missiles {
import spill.flakboy.tools.core.*;
import gfx.*;
public class Missile2 extends MissileBase {
public function Missile2(_arg1:ToolDummy){
super(_arg1);
rocketPower = 1;
rotationPower = 0.03;
rotationRandomFactor = 5;
bombPower = 100;
bombDamage = 10;
bombRange = 2;
trailDist = 24;
missileGraphicsClass = Missile2_mc;
}
}
}//package spill.flakboy.tools.missiles
Section 413
//Missile3 (spill.flakboy.tools.missiles.Missile3)
package spill.flakboy.tools.missiles {
import spill.flakboy.tools.core.*;
import gfx.*;
public class Missile3 extends MissileBase {
public function Missile3(_arg1:ToolDummy){
super(_arg1);
rocketPower = 1.3;
rotationPower = 0.04;
rotationRandomFactor = 2;
bombPower = 120;
bombDamage = 14;
bombRange = 2.5;
trailDist = 23;
missileGraphicsClass = Missile3_mc;
}
}
}//package spill.flakboy.tools.missiles
Section 414
//MissileBase (spill.flakboy.tools.missiles.MissileBase)
package spill.flakboy.tools.missiles {
import flash.events.*;
import flash.display.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import spill.flakboy.character.*;
import Box2D.Common.Math.*;
import com.gskinner.utils.*;
import gfx.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.flakboy.tools.utils.*;
import spill.physics.shapes.*;
public class MissileBase extends Tool {
public var bombPower:Number;// = 100
public var trailDist:Number;// = 10
private var missile_mc:MovieClip;
public var rotationRandomFactor:Number;// = 7
public var rocketPower:Number;// = 0.8
private var targetBody:spBody;
private var antiGravity:b2Vec2;
private var missile:spBody;
public var rotationPower:Number;// = 0.02
public var missileGraphicsClass:Class;
public var bombDamage:Number;// = 6
private var status:int;
private var sensor:spBody;
public var bombRange:Number;// = 1.8
private static var EXPLODE:int = 4;
private static var EXPLODED:int = 5;
private static var WAITING:int = 0;
private static var FINISHED:int = 3;
private static var FIRED:int = 2;
private static var TRIGGERED:int = 1;
public function MissileBase(_arg1:ToolDummy){
missileGraphicsClass = Missile_mc;
status = WAITING;
super(_arg1);
}
private function openHatch(_arg1:Event=null):void{
SoundFX.playSound(MissileFlight);
_mc.play();
_mc.addFrameScript(23, fireMissile);
_mc.addFrameScript((_mc.totalFrames - 1), closeHatch);
world.removeEventListener("afterStep", openHatch);
}
override protected function initialize():void{
sensor = new spBody();
var _local1:spCircle = new spCircle((40 / Game.drawScale));
_local1.def.isSensor = true;
sensor.addShape(_local1);
sensor.position = position.Copy();
sensor.useParentDensity = false;
sensor.density = 0;
addBody(sensor);
}
private function render():void{
var _local1:MovieClip;
missile_mc.x = (missile.position.x * Game.drawScale);
missile_mc.y = (missile.position.y * Game.drawScale);
missile_mc.rotation = (missile.angle * (180 / Math.PI));
if (status != EXPLODED){
_local1 = new SmokeParticle();
_local1.x = (missile_mc.x + (Math.cos(missile.angle) * -(trailDist)));
_local1.y = (missile_mc.y + (Math.sin(missile.angle) * -(trailDist)));
_local1.rotation = ((missile_mc.rotation + (Math.random() * 20)) - 10);
Engine.instance.display.background.addChild(_local1);
};
}
private function explode():void{
var _local4:spBody;
var _local5:b2Vec2;
var _local6:Number;
removeBody(missile);
world.removeEventListener("afterStep", trackMissile);
var _local1:b2AABB = new b2AABB();
_local1.lowerBound.x = (missile.position.x - bombRange);
_local1.lowerBound.y = (missile.position.y - bombRange);
_local1.upperBound.x = (missile.position.x + bombRange);
_local1.upperBound.y = (missile.position.y + bombRange);
var _local2:Array = new Array();
world.ref.Query(_local1, _local2, 30);
var _local3:int;
while (_local3 < _local2.length) {
_local4 = spShape(_local2[_local3].GetUserData()).parent;
if ((_local4.parent is FlakboyControl)){
_local5 = _local4.position.Copy();
_local5.Subtract(missile.position);
_local6 = _local5.Length();
if (_local6 < bombRange){
_local5.Multiply(((bombPower * _local4.ref.m_mass) * 10));
_local4.ref.ApplyForce(_local5, _local4.ref.GetWorldCenter());
_local4.ref.ApplyTorque(((Rndm.random() - 0.5) * 1000));
if ((_local4 is RagdollBodypart)){
RagdollBodypart(_local4).applyDamage((((bombRange - _local6) / bombRange) * bombDamage), position);
};
};
};
_local3++;
};
SoundFX.playSound(MisselesImpact);
toolDepleted();
render();
Engine.instance.addBloodSplatter((missile.position.x * Game.drawScale), (missile.position.y * Game.drawScale), BloodSplatter.EXPLOSION, ((missile.position.x < FlakboyControl.instance.torso.position.x)) ? 1 : -1);
missile_mc.addFrameScript((missile_mc.totalFrames - 1), explosionEnded);
missile_mc.play();
}
private function explosionEnded():void{
missile_mc.stop();
missile_mc.parent.removeChild(missile_mc);
Engine.instance.drawOnBackground(missile_mc);
}
private function closeHatch():void{
_mc.stop();
Engine.instance.drawOnBackground(_mc, container.x, container.y);
_mc.parent.removeChild(_mc);
}
private function trackMissile(_arg1:Event):void{
if (status == EXPLODE){
status = EXPLODED;
world.removeEventListener("afterStep", trackMissile);
explode();
return;
};
missile.ref.ApplyForce(antiGravity, missile.ref.GetWorldCenter());
var _local2:b2Vec2 = targetBody.position.Copy();
_local2.Subtract(missile.position);
var _local3:Number = (Math.atan2(_local2.y, _local2.x) - missile.angle);
while (_local3 > Math.PI) {
_local3 = (_local3 - (Math.PI * 2));
};
while (_local3 < -(Math.PI)) {
_local3 = (_local3 + (Math.PI * 2));
};
missile.ref.ApplyTorque((((_local3 + (Rndm.random() * rotationRandomFactor)) - (rotationRandomFactor * 0.5)) * rotationPower));
var _local4:b2Vec2 = new b2Vec2((Math.cos(missile.angle) * rocketPower), (Math.sin(missile.angle) * rocketPower));
missile.ref.ApplyForce(_local4, missile.ref.GetWorldCenter());
render();
}
private function fireMissile(_arg1:Event=null):void{
status = FIRED;
world.addEventListener("afterStep", trackMissile, false, 0, true);
removeBody(sensor);
missile = new spBody();
var _local2:spCircle = new spCircle(0.25, 0.05);
missile.useParentFilter = false;
missile.filter.maskBits = (missile.filter.maskBits & ~(Engine.toolBit));
missile.position.Set(position.x, position.y);
missile.addShape(_local2);
missile.useParentAngularDamping = false;
missile.angularDamping = 1;
missile.useParentLinearDamping = false;
missile.linearDamping = 1;
missile.useParentDensity = false;
missile.density = 1;
missile.useParentFriction = false;
missile.friction = 0;
addBody(missile);
antiGravity = new b2Vec2(0, (-10 * missile.ref.m_mass));
targetBody = FlakboyControl.instance.torso;
missile_mc = new missileGraphicsClass();
missile_mc.stop();
display.tools.addChild(missile_mc);
render();
}
override public function onAddContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if (status == WAITING){
if ((_arg3.parent.parent is FlakboyControl)){
status = TRIGGERED;
world.addEventListener("afterStep", openHatch);
};
} else {
if (status == FIRED){
if ((_arg3.parent.parent is FlakboyControl)){
if ((_arg3.parent is RagdollBodypart)){
RagdollBodypart(_arg3.parent).applyDamage(1, null, _arg1.position);
};
status = EXPLODE;
};
};
};
}
}
}//package spill.flakboy.tools.missiles
Section 415
//SpringPlatform1 (spill.flakboy.tools.platforms.SpringPlatform1)
package spill.flakboy.tools.platforms {
import spill.flakboy.tools.core.*;
public class SpringPlatform1 extends SpringPlatformBase {
public function SpringPlatform1(_arg1:ToolDummy){
super(_arg1);
translation = 1.5;
power = 1300;
ammo = 5;
}
}
}//package spill.flakboy.tools.platforms
Section 416
//SpringPlatform2 (spill.flakboy.tools.platforms.SpringPlatform2)
package spill.flakboy.tools.platforms {
import spill.flakboy.tools.core.*;
public class SpringPlatform2 extends SpringPlatformBase {
public function SpringPlatform2(_arg1:ToolDummy){
super(_arg1);
translation = 1.75;
power = 1600;
ammo = 7;
}
}
}//package spill.flakboy.tools.platforms
Section 417
//SpringPlatform3 (spill.flakboy.tools.platforms.SpringPlatform3)
package spill.flakboy.tools.platforms {
import spill.flakboy.tools.core.*;
public class SpringPlatform3 extends SpringPlatformBase {
public function SpringPlatform3(_arg1:ToolDummy){
super(_arg1);
translation = 2;
power = 2000;
ammo = 10;
}
}
}//package spill.flakboy.tools.platforms
Section 418
//SpringPlatformBase (spill.flakboy.tools.platforms.SpringPlatformBase)
package spill.flakboy.tools.platforms {
import flash.events.*;
import flash.display.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import spill.flakboy.character.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import com.gskinner.geom.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.flakboy.tools.utils.*;
import spill.physics.shapes.*;
import flash.filters.*;
public class SpringPlatformBase extends Tool {
public var power:Number;// = 2000
public var ammo:Number;// = 3
public var launchDelay:Number;// = 20
private var joint:SpringPlatformJoint;
private var mc:MovieClip;
public var translation:Number;// = 2
private var status:int;// = 0
private var platform:spBody;
private var launchCountdown:Number;// = 0
private static const statusStrings:Array = ["WAITING", "TRIGGERED", "LAUNCHING", "RETRACTING"];
private static const RETRACTING:int = 3;
private static const TRIGGERED:int = 1;
private static const WAITING:int = 0;
private static const LAUNCHING:int = 2;
public function SpringPlatformBase(_arg1:ToolDummy){
super(_arg1);
filter.maskBits = (filter.maskBits & ~(Engine.groundBit));
}
private function afterStep(_arg1:Event):void{
var _local2:b2Vec2;
if (status == TRIGGERED){
launchCountdown++;
if (launchCountdown >= launchDelay){
SoundFX.playSound(SpringtoolOut);
status = LAUNCHING;
FlakboyControl.instance.activate();
launchCountdown = 0;
};
};
if (status == LAUNCHING){
if ((((platform.linearVelocity.y >= 0)) && ((b2PrismaticJoint(joint.ref).GetJointTranslation() > 1)))){
status = RETRACTING;
if (!--ammo){
shutDown();
};
} else {
platform.ref.ApplyForce(new b2Vec2(0, -(power)), platform.position);
};
};
if (status == RETRACTING){
_local2 = position.Copy();
_local2.Subtract(platform.position);
if (_local2.Length() < 0.2){
status = WAITING;
SoundFX.playSound(SpringtoolIn);
} else {
platform.ref.ApplyForce(_local2, platform.position);
};
};
render();
}
override protected function initialize():void{
super.initialize();
mc = _mc;
platform = new spBody();
platform.addShape(new spRectangle(0.75, 1.2, 0, 1.2));
platform.position = position.Copy();
platform.def.fixedRotation = true;
platform.position.y = (platform.position.y - 0.001);
addBody(platform);
joint = new SpringPlatformJoint(platform, position.Copy(), translation);
addJoint(joint);
}
private function render(_arg1:Event=null):void{
var _local2:ColorMatrix;
mc.platform.x = (mc.pole.x = ((platform.position.x - position.x) * Game.drawScale));
mc.platform.y = (mc.pole.y = ((platform.position.y - position.y) * Game.drawScale));
if (((platform.ref.IsSleeping()) && (!(ammo)))){
world.removeEventListener("afterStep", render);
_local2 = new ColorMatrix();
_local2.adjustSaturation(-100);
container.filters = [new ColorMatrixFilter(_local2)];
container.alpha = 0.9;
Engine.instance.drawOnBackground(container);
world.removeElement(this);
};
}
override public function onPersistContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if (!ammo){
return;
};
if (status == WAITING){
if ((_arg3.parent.parent is Ragdoll)){
if ((_arg3.parent is RagdollLimb)){
if (!RagdollLimb(_arg3.parent).attached){
return;
};
};
if (_arg1.position.y < (position.y + 1)){
status = TRIGGERED;
};
};
};
}
override protected function addToDisplay(_arg1:spDisplay):void{
super.addToDisplay(_arg1);
}
override protected function addToWorld(_arg1:spWorld):void{
super.addToWorld(_arg1);
_arg1.addEventListener("afterStep", afterStep, false, 0, true);
}
private function shutDown():void{
toolDepleted();
world.removeEventListener("afterStep", afterStep);
world.addEventListener("afterStep", render, false, 0, true);
}
}
}//package spill.flakboy.tools.platforms
Section 419
//Ducky (spill.flakboy.tools.specials.Ducky)
package spill.flakboy.tools.specials {
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import flash.geom.*;
import sfx.*;
import spill.flakboy.sound.*;
public class Ducky extends Tool {
public static const rightRect:Rectangle = new Rectangle((rightPoint.x - w), ((rightPoint.y - (h * 2)) + 1), (w * 2), (h * 2));
public static const h:Number = 15;
public static const leftPoint:Point = new Point((((Game.physicsWidth / 2) - 50) - w), Game.physicsHeight);
public static const leftRect:Rectangle = new Rectangle((leftPoint.x - w), ((leftPoint.y - (h * 2)) + 1), (w * 2), (h * 2));
public static const rightPoint:Point = new Point((((Game.physicsWidth / 2) + 50) + w), Game.physicsHeight);
public static const w:Number = 15;
public static var instance:Ducky;
public static var side:Number = 1;
public function Ducky(_arg1:ToolDummy){
super(_arg1);
container.scaleX = _arg1.scaleX;
instance = this;
}
private function playDuckySound():void{
SoundFX.playSound(DuckSound);
}
public function play(_arg1:Function):void{
_mc.addFrameScript(5, _arg1);
_mc.addFrameScript(20, playDuckySound);
_mc.gotoAndPlay(2);
SoundFX.playSound(DuckAppears);
}
public function getSide():Boolean{
return ((container.x < (Game.physicsWidth / 2)));
}
}
}//package spill.flakboy.tools.specials
Section 420
//Electrocutor (spill.flakboy.tools.specials.Electrocutor)
package spill.flakboy.tools.specials {
import flash.events.*;
import flash.display.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import spill.flakboy.character.*;
import Box2D.Common.Math.*;
import flash.media.*;
import com.gskinner.geom.*;
import gfx.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.physics.shapes.*;
import flash.filters.*;
public class Electrocutor extends Tool {
private var objectsInRange:Array;
private var ammo:Number;// = 100
private var damage:Number;// = 2
private var mc:Current_mc;
private var sensor:spBody;
private var soundChannel:SoundChannel;
private var range:Number;// = 3
public function Electrocutor(_arg1:ToolDummy){
objectsInRange = new Array();
super(_arg1);
filter.maskBits = (filter.maskBits & ~(Engine.groundBit));
useGlobalDensity = false;
density = 0;
var _local2:spCircle = new spCircle(range, 0, 0);
_local2.def.isSensor = true;
sensor = new spBody();
sensor.addShape(_local2);
sensor.position = position.Copy();
addBody(sensor);
mc = Current_mc(_mc);
mc.current.alpha = 1;
mc.current.visible = false;
}
private function afterStep(_arg1:Event):void{
var _local3:spBody;
var _local8:spBody;
var _local9:b2Vec2;
var _local10:Number;
var _local2:Number = Number.POSITIVE_INFINITY;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:int;
while (_local6 < objectsInRange.length) {
_local8 = objectsInRange[_local6];
if ((_local8 is RagdollBodypart)){
if ((_local8 is RagdollLimb)){
//unresolved if
} else {
_local9 = _local8.position.Copy();
_local9.Subtract(position);
_local10 = _local9.Length();
_local4++;
if (_local10 < _local2){
_local2 = _local10;
_local3 = _local8;
_local5 = Math.atan2(_local9.y, _local9.x);
};
};
};
_local6++;
};
mc.current.visible = false;
var _local7:Boolean;
if (_local3){
_local7 = shootAt(_local5);
};
if (_local7){
if (!soundChannel){
soundChannel = SoundFX.playSound(ElectricitySound, 4);
trace("startSound");
};
} else {
if (soundChannel){
soundChannel.stop();
soundChannel = null;
trace("stopSound");
};
FlakboyControl.instance.mc.blendMode = BlendMode.NORMAL;
};
objectsInRange = new Array();
}
override protected function addToWorld(_arg1:spWorld):void{
world.addEventListener("afterStep", afterStep, false, 0, true);
}
override public function onPersistContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if (ammo > 0){
objectsInRange.push(_arg3.parent);
};
}
private function shootAt(_arg1:Number):Boolean{
var _local5:spBody;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:MovieClip;
var _local2:b2Vec2 = position.Copy();
_local2.x = (_local2.x + (Math.cos(_arg1) * range));
_local2.y = (_local2.y + (Math.sin(_arg1) * range));
var _local3:Array = new Array();
var _local4:Number = world.testSegment(position.Copy(), _local2, null, _local3);
if ((((_local4 > 0)) && ((_local4 < 1)))){
_local5 = spShape(_local3[0]).parent;
if (!(_local5 is RagdollBodypart)){
return (false);
};
_local2.Subtract(position);
_local6 = _local2.Copy();
_local6.Multiply(-2);
_local5.ref.ApplyForce(_local6, new b2Vec2((position.x + (_local2.x * _local4)), (position.y + (_local2.y * _local4))));
if ((_local5 is RagdollBodypart)){
RagdollBodypart(_local5).applyDamage(damage);
};
_local7 = ((_local2.x * Game.drawScale) * _local4);
_local8 = ((_local2.y * Game.drawScale) * _local4);
if ((placement & ToolPlacements.RIGHT)){
_arg1 = (_arg1 + Math.PI);
} else {
if ((placement & ToolPlacements.TOP)){
_arg1 = (_arg1 - (Math.PI / 2));
};
};
mc.current.rotation = (_arg1 * (180 / Math.PI));
mc.current.visible = true;
mc.current.play();
mc.current.scaleX = (((_local2.Length() * Game.drawScale) * _local4) / 142);
FlakboyControl.instance.tempMuscleForce = 50;
FlakboyControl.instance.tempMuscleSpeed = 50;
_local9 = FlakboyControl.instance.mc;
if (_local9.blendMode == BlendMode.NORMAL){
_local9.blendMode = ((Math.random() < 0.5)) ? BlendMode.DIFFERENCE : BlendMode.INVERT;
} else {
_local9.blendMode = BlendMode.NORMAL;
};
if (!--ammo){
shutDown();
return (false);
};
return (true);
//unresolved jump
};
return (false);
}
private function shutDown():void{
toolDepleted();
FlakboyControl.instance.mc.blendMode = BlendMode.NORMAL;
if (soundChannel){
soundChannel.stop();
soundChannel = null;
trace("stopSound");
};
world.removeEventListener("afterStep", afterStep);
mc.current.visible = false;
var _local1:ColorMatrix = new ColorMatrix();
_local1.adjustSaturation(-100);
container.filters = [new ColorMatrixFilter(_local1)];
container.alpha = 0.9;
Engine.instance.drawOnBackground(container);
container.parent.removeChild(container);
removeBody(sensor);
world.removeElement(this);
}
}
}//package spill.flakboy.tools.specials
Section 421
//Skinner (spill.flakboy.tools.specials.Skinner)
package spill.flakboy.tools.specials {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import spill.flakboy.character.*;
import Box2D.Common.Math.*;
import gfx.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.physics.shapes.*;
public class Skinner extends Tool {
private var skinner2_mc:MovieClip;
private var skinner_mc:Skinner_mc;
private var fadeStartFrame:int;// = 130
private var status:int;// = 0
private var shellBody:spBody;
private var bodyParts:Array;
private var fadeTime:int;// = 60
private var fadeEndFrame:int;// = 190
private var fading:Boolean;// = false
private var sensor:spBody;
private static const WAITING:int = 0;
private static const TRIGGERED:int = 1;
public function Skinner(_arg1:ToolDummy){
bodyParts = new Array();
super(_arg1);
}
private function storeVelocities():void{
var _local3:RagdollBodypart;
var _local1:Array = FlakboyControl.instance.bodyParts;
var _local2:int;
while (_local2 < _local1.length) {
_local3 = _local1[_local2];
bodyParts[_local2] = _local3.ref.m_linearVelocity.Copy();
_local2++;
};
}
override public function onAddContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if (((!(Game.instance.specialWeaponActive)) && ((status == WAITING)))){
if ((_arg3.parent.parent is FlakboyControl)){
status = TRIGGERED;
world.addEventListener("beforeStep", catchFlakboy);
FlakboyControl.instance.activate();
Game.instance.specialWeaponActive = this;
};
};
}
private function applyVelocities():void{
var _local3:RagdollBodypart;
var _local1:Array = FlakboyControl.instance.bodyParts;
var _local2:int;
while (_local2 < _local1.length) {
_local3 = _local1[_local2];
_local3.ref.m_linearVelocity.SetV(bodyParts[_local2]);
_local2++;
};
}
private function removeShell():void{
removeBody(shellBody);
}
private function addShell():void{
var _local1:b2PolygonDef = new b2PolygonDef();
_local1.vertices[0] = new b2Vec2(0, -2);
_local1.vertices[1] = new b2Vec2(0.7, -1.5);
_local1.vertices[2] = new b2Vec2(1, -0.5);
_local1.vertices[3] = new b2Vec2(0.7, 0.7);
_local1.vertices[4] = new b2Vec2(0, 1);
_local1.vertices[5] = new b2Vec2(-0.7, 0.7);
_local1.vertices[6] = new b2Vec2(-1, -0.5);
_local1.vertices[7] = new b2Vec2(-0.7, -1.5);
_local1.vertexCount = 8;
var _local2:int;
while (_local2 < 8) {
b2Vec2(_local1.vertices[_local2]).Multiply(1.1);
_local2++;
};
var _local3:spShape = new spShape(_local1);
_local3.useParentDensity = false;
_local3.density = 0;
_local3.useParentFilter = false;
_local3.filter.maskBits = (_local3.filter.maskBits & ~(Engine.characterBit));
shellBody = new spBody();
shellBody.addShape(_local3);
shellBody.position = position.Copy();
addBody(shellBody);
}
override protected function initialize():void{
sensor = new spBody();
var _local1:spCircle = new spCircle((40 / Game.drawScale));
_local1.def.isSensor = true;
sensor.addShape(_local1);
sensor.position = position.Copy();
sensor.useParentDensity = false;
sensor.density = 0;
addBody(sensor);
}
private function releaseFlakboy():void{
removeShell();
applyVelocities();
world.removeEventListener("afterStep", pinFlakboy);
}
private function pinFlakboy(_arg1:Event):void{
var _local2:RagdollBodypart;
var _local3:RagdollBodypart;
var _local4:Number;
FlakboyControl.instance.torso.ref.SetXForm(position, 0);
for each (_local2 in FlakboyControl.instance.bodyParts) {
if (_local2.attached){
_local2.ref.m_linearVelocity.Multiply(0.5);
_local2.applyDamage(0.1);
};
};
_local3 = FlakboyControl.instance.head;
_local3.ref.ApplyForce(new b2Vec2(0, -10), _local3.ref.GetWorldCenter());
if (fading){
_local4 = ((skinner_mc.currentFrame - fadeStartFrame) / fadeTime);
FlakboyControl.instance.setSkinAlpha((1 - _local4));
};
}
private function animationEnded():void{
display.character.removeChild(skinner_mc);
display.background.removeChild(skinner2_mc);
skinner_mc.stop();
skinner2_mc.stop();
skinner_mc = null;
skinner2_mc = null;
toolDepleted();
Achievements.achievementEarned(Achievements.SKINNED);
world.removeElement(this);
Game.instance.specialWeaponActive = null;
}
private function skinFlakboy():void{
if (((_mc) && (_mc.parent))){
_mc.parent.removeChild(_mc);
};
}
private function catchFlakboy(_arg1:Event=null):void{
storeVelocities();
world.removeEventListener("beforeStep", catchFlakboy);
skinner_mc = new Skinner_mc();
skinner_mc.x = dummy.x;
skinner_mc.y = (dummy.y - 30);
skinner_mc.addFrameScript((skinner_mc.totalFrames - 1), animationEnded);
skinner_mc.addFrameScript(Math.round((skinner_mc.totalFrames / 2)), skinFlakboy);
skinner_mc.addFrameScript(Math.round((skinner_mc.totalFrames * 0.9)), releaseFlakboy);
skinner_mc.addFrameScript(fadeStartFrame, startFade);
skinner_mc.addFrameScript(fadeEndFrame, endFade);
skinner_mc.alpha = 1;
skinner2_mc = new MovieClip();
skinner2_mc.x = dummy.x;
skinner2_mc.y = (dummy.y - 10);
display.background.addChild(skinner2_mc);
display.character.addChild(skinner_mc);
world.addEventListener("afterStep", pinFlakboy);
FlakboyControl.instance.addSkeleton();
addShell();
SoundFX.playSound(SkinnerSound);
}
private function endFade():void{
FlakboyControl.instance.removeSkin();
fading = false;
}
private function startFade():void{
FlakboyControl.instance.addSkeleton();
fading = true;
}
}
}//package spill.flakboy.tools.specials
Section 422
//Spikes1 (spill.flakboy.tools.spikes.Spikes1)
package spill.flakboy.tools.spikes {
import spill.flakboy.tools.core.*;
import sfx.*;
public class Spikes1 extends SpikesBase {
public function Spikes1(_arg1:ToolDummy){
super(_arg1);
totalActiveFrames = 150;
soundClass = SpikesOut;
}
}
}//package spill.flakboy.tools.spikes
Section 423
//Spikes2 (spill.flakboy.tools.spikes.Spikes2)
package spill.flakboy.tools.spikes {
import spill.flakboy.tools.core.*;
import sfx.*;
public class Spikes2 extends SpikesBase {
public function Spikes2(_arg1:ToolDummy){
super(_arg1);
totalActiveFrames = 225;
soundClass = SpikesOut2;
}
}
}//package spill.flakboy.tools.spikes
Section 424
//Spikes3 (spill.flakboy.tools.spikes.Spikes3)
package spill.flakboy.tools.spikes {
import spill.flakboy.tools.core.*;
import sfx.*;
public class Spikes3 extends SpikesBase {
public function Spikes3(_arg1:ToolDummy){
super(_arg1);
totalActiveFrames = 300;
soundClass = SpikesOut3;
}
}
}//package spill.flakboy.tools.spikes
Section 425
//SpikesBase (spill.flakboy.tools.spikes.SpikesBase)
package spill.flakboy.tools.spikes {
import flash.events.*;
import flash.display.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import spill.flakboy.character.*;
import Box2D.Common.Math.*;
import com.gskinner.geom.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.physics.shapes.*;
import flash.filters.*;
public class SpikesBase extends Tool {
private var touchingBodies:Object;
private var horizontal:Boolean;
private var totalTouching:Number;// = 0
protected var soundClass:Class;
public var totalActiveFrames:Number;// = 300
private var mc:MovieClip;
private var lastTouching:Number;// = 0
private var sensor:spBody;
public var damagePerFrame:Number;// = 0.1
public function SpikesBase(_arg1:ToolDummy){
touchingBodies = new Object();
super(_arg1);
filter.maskBits = (filter.maskBits & ~(Engine.groundBit));
}
private function shutDown():void{
world.removeEventListener("beforeStep", afterStep);
removeBody(sensor);
toolDepleted();
if (mc.spikes.currentFrame == 3){
mc.spikes.gotoAndPlay(4);
mc.spikes.addFrameScript((mc.spikes.totalFrames - 1), finalShutDown);
} else {
finalShutDown();
};
}
override public function onPersistContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if (!totalActiveFrames){
return;
};
if ((_arg3.parent.parent is FlakboyControl)){
if (touchingBodies[_arg3.parent.id]){
return;
};
mc.spikes.gotoAndStop(3);
touchingBodies[_arg3.parent.id] = _arg3.parent;
totalTouching++;
};
}
private function afterStep(_arg1:Event):void{
var _local3:spBody;
var _local2:Boolean;
for each (_local3 in touchingBodies) {
if (horizontal){
_local3.linearVelocity.y = 0;
_local3.ref.ApplyForce(new b2Vec2(0, (-(_local3.ref.m_mass) * 10)), _local3.ref.GetWorldCenter());
_local3.angularVelocity = 0;
} else {
_local3.linearVelocity.x = 0;
_local3.ref.ApplyForce(new b2Vec2(0, (-(_local3.ref.m_mass) * 5)), _local3.ref.GetWorldCenter());
_local3.angularVelocity = 0;
};
_local2 = false;
_local3.linearVelocity.Multiply(0.5);
if ((_local3 is RagdollBodypart)){
RagdollBodypart(_local3).applyDamage(damagePerFrame);
};
};
touchingBodies = new Object();
if (totalTouching){
totalActiveFrames--;
};
if (((!(totalTouching)) && ((mc.spikes.currentFrame == 3)))){
mc.spikes.gotoAndPlay(4);
SoundFX.playSound(SpikesHit);
};
if (!totalActiveFrames){
shutDown();
};
if (((totalTouching) && (!(lastTouching)))){
SoundFX.playSound(soundClass);
};
lastTouching = totalTouching;
totalTouching = 0;
}
override protected function initialize():void{
super.initialize();
sensor = new spBody();
var _local1:spRectangle = new spRectangle(1, 0.5, 0, 0.5);
_local1.def.isSensor = true;
sensor.addShape(_local1);
sensor.useParentDensity = false;
sensor.density = 0;
sensor.position = position.Copy();
addBody(sensor);
if ((dummy.placement & ToolPlacements.LEFT)){
sensor.angle = (-(Math.PI) / 2);
horizontal = true;
} else {
if ((dummy.placement & ToolPlacements.RIGHT)){
sensor.angle = (Math.PI / 2);
horizontal = true;
} else {
horizontal = false;
};
};
mc = _mc;
mc.removeChild(mc.hit_area);
mc.spikes.stop();
}
private function finalShutDown():void{
var _local1:ColorMatrix;
if (Engine.instance){
mc.spikes.stop();
_local1 = new ColorMatrix();
_local1.adjustSaturation(-100);
container.filters = [new ColorMatrixFilter(_local1)];
container.alpha = 0.9;
Engine.instance.drawOnBackground(container);
world.removeElement(this);
};
}
override protected function addToWorld(_arg1:spWorld):void{
_arg1.addEventListener("beforeStep", afterStep, false, 0, true);
}
}
}//package spill.flakboy.tools.spikes
Section 426
//Turret1 (spill.flakboy.tools.turrets.Turret1)
package spill.flakboy.tools.turrets {
import spill.flakboy.tools.core.*;
import sfx.*;
public class Turret1 extends TurretBase {
public function Turret1(_arg1:ToolDummy){
super(_arg1);
ammo = 6;
aimingSpeed = 2;
bulletPower = 350;
damage = 10;
range = 2.5;
soundClass = TurretsFiring;
}
}
}//package spill.flakboy.tools.turrets
Section 427
//Turret2 (spill.flakboy.tools.turrets.Turret2)
package spill.flakboy.tools.turrets {
import spill.flakboy.tools.core.*;
import sfx.*;
public class Turret2 extends TurretBase {
public function Turret2(_arg1:ToolDummy){
super(_arg1);
ammo = 10;
aimingSpeed = 3;
bulletPower = 350;
damage = 15;
range = 3;
rateOfFire = 12;
soundClass = TurretFiring2;
}
}
}//package spill.flakboy.tools.turrets
Section 428
//Turret3 (spill.flakboy.tools.turrets.Turret3)
package spill.flakboy.tools.turrets {
import spill.flakboy.tools.core.*;
import sfx.*;
public class Turret3 extends TurretBase {
public function Turret3(_arg1:ToolDummy){
super(_arg1);
ammo = 16;
aimingSpeed = 4;
bulletPower = 400;
damage = 20;
rateOfFire = 8;
range = 3.5;
soundClass = TurretFiring3;
}
}
}//package spill.flakboy.tools.turrets
Section 429
//TurretBase (spill.flakboy.tools.turrets.TurretBase)
package spill.flakboy.tools.turrets {
import flash.events.*;
import flash.display.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Collision.*;
import spill.flakboy.character.*;
import Box2D.Common.Math.*;
import com.gskinner.utils.*;
import Box2D.Dynamics.Joints.*;
import gfx.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.physics.joints.*;
import spill.physics.shapes.*;
public class TurretBase extends Tool {
public var aimingSpeed:Number;// = 2
public var ammo:Number;// = 5
private var fireCycle:Number;// = 0
public var scale:Number;// = 1
private var mc:MovieClip;
private var joint:spRevoluteJoint;
public var bulletPower:Number;// = 200
private var objectsInRange:Array;
private var barrel:spBody;
protected var soundClass:Class;
public var rateOfFire:Number;// = 15
public var damage:Number;// = 4
private var hitmc:MovieClip;
private var sensor:spBody;
public var range:Number;// = 3
public function TurretBase(_arg1:ToolDummy){
objectsInRange = new Array();
super(_arg1);
}
override protected function addToWorld(_arg1:spWorld):void{
world.addEventListener("afterStep", afterStep, false, 0, true);
}
private function addImpact(_arg1:b2Vec2, _arg2:Number):void{
removeImpact();
hitmc = new BullitFireImpact_mc();
hitmc.x = ((_arg1.x * Game.drawScale) * _arg2);
hitmc.y = ((_arg1.y * Game.drawScale) * _arg2);
hitmc.addFrameScript((hitmc.totalFrames - 1), removeImpact);
container.addChild(hitmc);
}
private function afterStep(_arg1:Event):void{
var _local3:spBody;
var _local7:spBody;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
if (fireCycle){
fireCycle++;
fireCycle = (fireCycle % rateOfFire);
};
container.graphics.clear();
var _local2:Number = Number.POSITIVE_INFINITY;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:int;
while (_local6 < objectsInRange.length) {
_local7 = objectsInRange[_local6];
if ((_local7 is RagdollBodypart)){
if ((_local7 is RagdollLimb)){
//unresolved if
} else {
_local8 = _local7.position.Copy();
_local8.Subtract(position);
_local9 = _local8.Length();
_local4++;
if (_local9 < _local2){
_local2 = _local9;
_local3 = _local7;
_local5 = Math.atan2(_local8.y, _local8.x);
};
};
};
_local6++;
};
if (_local3){
barrel.ref.WakeUp();
_local10 = (_local5 - barrel.angle);
if (_local10 < -(Math.PI)){
_local10 = (_local10 + (Math.PI * 2));
};
if (_local10 > Math.PI){
_local10 = (_local10 - (Math.PI * 2));
};
b2RevoluteJoint(joint.ref).m_motorSpeed = (_local10 * -(aimingSpeed));
if (!fireCycle){
shootAt(barrel.angle);
};
} else {
b2RevoluteJoint(joint.ref).m_motorSpeed = 0;
};
render();
objectsInRange = new Array();
}
override protected function initialize():void{
filter.maskBits = (filter.maskBits & ~(Engine.groundBit));
useGlobalDensity = false;
density = 0;
var _local1:spCircle = new spCircle(range, 0, 0);
_local1.def.isSensor = true;
sensor = new spBody();
sensor.addShape(_local1);
sensor.position = position.Copy();
addBody(sensor);
var _local2:spBody = new spBody();
_local2.addShape(new spCircle((0.66 * scale)));
_local2.position = position.Copy();
addBody(_local2);
barrel = new spBody();
barrel.addShape(new spRectangle((0.5 * scale), (0.15 * scale), (0.45 * scale), 0));
barrel.position = position.Copy();
barrel.useParentDensity = false;
barrel.density = 4;
if ((placement & ToolPlacements.LEFT)){
barrel.angle = 0;
} else {
if ((placement & ToolPlacements.RIGHT)){
barrel.angle = Math.PI;
} else {
if ((placement & ToolPlacements.TOP)){
barrel.angle = (Math.PI * 0.5);
} else {
if ((placement & ToolPlacements.BOTTOM)){
barrel.angle = (Math.PI * 1.5);
};
};
};
};
addBody(barrel);
joint = new spRevoluteJoint(barrel, _local2, position.Copy());
joint.def.enableLimit = true;
joint.def.upperAngle = (60 * (Math.PI / 180));
joint.def.lowerAngle = (-60 * (Math.PI / 180));
joint.def.enableMotor = true;
joint.def.maxMotorTorque = 100;
addJoint(joint);
mc = _mc;
mc.scaleX = scale;
mc.scaleY = scale;
mc.bulletcounter.cacheAsBitmap = true;
}
private function shutDown():void{
toolDepleted();
world.removeEventListener("afterStep", afterStep);
removeImpact();
b2RevoluteJoint(joint.ref).m_enableMotor = false;
barrel.density = 0;
barrel.linearVelocity.Set(0, 0);
barrel.angularVelocity = 0;
container.graphics.clear();
Engine.instance.drawOnBackground(container);
container.parent.removeChild(container);
removeBody(sensor);
}
private function render(_arg1:Event=null):void{
var _local2:Number = Math.round(((barrel.angle * (180 / Math.PI)) + mc.rotation));
if ((((placement & ToolPlacements.TOP)) || ((placement & ToolPlacements.BOTTOM)))){
_local2 = (_local2 + 180);
};
if (mc.barrel.rotation != _local2){
mc.barrel.rotation = _local2;
};
}
private function removeImpact():void{
if (hitmc){
hitmc.stop();
container.removeChild(hitmc);
hitmc = null;
};
}
override public function onPersistContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
if (ammo > 0){
objectsInRange.push(_arg3.parent);
};
}
private function shootAt(_arg1:Number):void{
var _local5:spBody;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local2:b2Vec2 = position.Copy();
_local2.x = (_local2.x + (Math.cos(_arg1) * range));
_local2.y = (_local2.y + (Math.sin(_arg1) * range));
var _local3:Array = new Array();
var _local4:Number = world.testSegment(position.Copy(), _local2, null, _local3);
if ((((_local4 > 0)) && ((_local4 < 1)))){
_local5 = spShape(_local3[0]).parent;
if (!(_local5 is RagdollBodypart)){
return;
};
_local2.Subtract(position);
container.graphics.moveTo(0, 0);
container.graphics.lineStyle(1, 0, 0.5);
container.graphics.lineTo(((_local2.x * Game.drawScale) * _local4), ((_local2.y * Game.drawScale) * _local4));
_local6 = _local2.Copy();
_local6.Normalize();
_local6.Multiply(bulletPower);
_local5.ref.ApplyForce(_local6, new b2Vec2((position.x + (_local2.x * _local4)), (position.y + (_local2.y * _local4))));
fireCycle = 1;
_local7 = ((_local2.x * _local4) + position.x);
_local8 = ((_local2.y * _local4) + position.y);
if ((_local5 is RagdollBodypart)){
RagdollBodypart(_local5).applyDamage(damage, position.Copy(), new b2Vec2(_local7, _local8));
};
Engine.instance.addBloodSplatter((_local7 * Game.drawScale), (_local8 * Game.drawScale), 2, 1);
_local9 = (1 + Rndm.random());
_local10 = Math.PI;
if ((dummy.placement & ToolPlacements.RIGHT)){
_local9 = (_local9 * -1);
_local10 = 0;
};
Engine.instance.bulletCasings.addCasing(position.x, (position.y - 0.3), _local10, _local9, (-4 + Rndm.random()), ((Rndm.random() * 12) - 6));
addImpact(_local2, _local4);
mc.barrel.play();
mc.bulletcounter.gotoAndStop(((mc.bulletcounter.totalFrames - ammo) + 1));
if (!--ammo){
shutDown();
};
SoundFX.playSound(soundClass);
};
}
}
}//package spill.flakboy.tools.turrets
Section 430
//TurretDescr (spill.flakboy.tools.turrets.TurretDescr)
package spill.flakboy.tools.turrets {
import spill.flakboy.tools.core.*;
import flash.geom.*;
public class TurretDescr extends ToolDescr {
public function TurretDescr(){
bounding = new Rectangle(-40, -40, 80, 50);
category = ToolCategories.GUNS;
possiblePlacements = (ToolPlacements.LEFT | ToolPlacements.RIGHT);
rotationOffset = 90;
}
}
}//package spill.flakboy.tools.turrets
Section 431
//BloodSplatter (spill.flakboy.tools.utils.BloodSplatter)
package spill.flakboy.tools.utils {
import flash.display.*;
import spill.flakboy.*;
import com.gskinner.utils.*;
import flash.geom.*;
import gfx.*;
public class BloodSplatter extends Sprite {
private var clips:Array;
private var mc:MovieClip;
private var bloodColor:uint;// = 0xFF0000
public static const EXPLOSION:int = 3;
public static const BACK:int = 2;
public static const WALL:int = 0;
public static const CEILING:int = 1;
public function BloodSplatter(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int=1){
clips = [[Blood6, Blood7, Blood8], [Blood9, Blood11], [Blood1, Blood2, Blood3, Blood10, Blood12], [Blood5, Blood4, Blood13]];
super();
mc = new (clips[_arg3][Math.floor((clips[_arg3].length * Rndm.random()))]);
mc.addFrameScript((mc.totalFrames - 1), end);
mc.x = _arg1;
mc.y = _arg2;
mc.scaleX = ((Rndm.random() * 0.5) + 0.5);
mc.scaleX = (mc.scaleX * _arg4);
mc.scaleY = ((Rndm.random() * 0.5) + 0.5);
mc.alpha = ((Rndm.random() * 0.5) + 0.5);
mc.transform.colorTransform = new ColorTransform(0, 0, 0, mc.alpha, ((Game.bloodColor & 0xFF0000) >> 16), ((Game.bloodColor & 0xFF00) >> 8), (Game.bloodColor & 0xFF), 0);
addChild(mc);
}
private function end():void{
mc.stop();
if (Engine.instance){
Engine.instance.drawOnBackground(this);
};
parent.removeChild(this);
}
}
}//package spill.flakboy.tools.utils
Section 432
//BulletCasings (spill.flakboy.tools.utils.BulletCasings)
package spill.flakboy.tools.utils {
import flash.events.*;
import flash.display.*;
import spill.flakboy.*;
import spill.physics.*;
import Box2D.Dynamics.Contacts.*;
import spill.flakboy.ui.*;
import gfx.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.physics.shapes.*;
public class BulletCasings extends spElement {
private var container:Sprite;
private var display:Display;
private var casings:Object;
private var casingSprites:Object;
private var totalCasings:Number;// = 0
public function BulletCasings(){
casings = new Object();
casingSprites = new Object();
super();
useGlobalDensity = false;
density = 1;
filter.groupIndex = -30;
filter.maskBits = (filter.maskBits & ~((Engine.toolBit | Engine.characterBit)));
}
override protected function addToDisplay(_arg1:spDisplay):void{
display = Display(_arg1);
container = new Sprite();
display.tools.addChild(container);
}
public function addCasing(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:spBody = new spBody();
_local7.position.x = _arg1;
_local7.position.y = _arg2;
_local7.angle = _arg3;
_local7.linearVelocity.x = _arg4;
_local7.linearVelocity.y = _arg5;
_local7.angularVelocity = _arg6;
_local7.addShape(new spRectangle(0.1, 0.05, 0, 0));
addBody(_local7);
totalCasings++;
casings[_local7.id] = _local7;
var _local8:Sprite = new BulletCasing();
casingSprites[_local7.id] = _local8;
container.addChild(_local8);
if (totalCasings == 1){
world.addEventListener("afterStep", afterStep, false, 0, true);
};
}
private function afterStep(_arg1:Event):void{
var _local2:spBody;
var _local3:Sprite;
var _local4:MovieClip;
for each (_local2 in casings) {
if (_local2.ref.IsSleeping()){
totalCasings--;
removeBody(_local2);
_local3 = casingSprites[_local2.id];
Engine.instance.drawOnBackground(_local3, 0, 0);
container.removeChild(_local3);
delete casings[_local2.id];
delete casingSprites[_local2.id];
} else {
_local4 = casingSprites[_local2.id];
_local4.x = (_local2.position.x * Game.drawScale);
_local4.y = (_local2.position.y * Game.drawScale);
_local4.rotation = (_local2.angle * (180 / Math.PI));
};
if (!totalCasings){
world.removeEventListener("afterStep", afterStep, false);
};
};
}
override public function onResultContact(_arg1:b2ContactResult, _arg2:spShape, _arg3:spShape):void{
if (Math.abs(_arg1.normalImpulse) > 0.05){
SoundFX.playSound(CasingSound, 1, (Math.abs(_arg1.normalImpulse) * 2));
};
}
}
}//package spill.flakboy.tools.utils
Section 433
//SpringPlatformJoint (spill.flakboy.tools.utils.SpringPlatformJoint)
package spill.flakboy.tools.utils {
import spill.physics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class SpringPlatformJoint extends spJoint {
private var anchor:b2Vec2;
private var body1:spBody;
public function SpringPlatformJoint(_arg1:spBody, _arg2:b2Vec2, _arg3:Number=2){
def = new b2PrismaticJointDef();
def.userData = this;
def.enableLimit = true;
def.enableMotor = true;
def.enableLimit = true;
def.lowerTranslation = 0;
def.upperTranslation = _arg3;
body1 = _arg1;
anchor = _arg2;
}
public function set def(_arg1:b2PrismaticJointDef):void{
_def = _arg1;
}
override protected function initialise(_arg1:spWorld):void{
super.initialise(_arg1);
def.Initialize(body1.ref, _arg1.ref.GetGroundBody(), anchor, new b2Vec2(0, 1));
}
public function get def():b2PrismaticJointDef{
return ((_def as b2PrismaticJointDef));
}
}
}//package spill.flakboy.tools.utils
Section 434
//DamageMeter (spill.flakboy.ui.controls.DamageMeter)
package spill.flakboy.ui.controls {
import flash.display.*;
import flash.geom.*;
public class DamageMeter {
private var barWidth:Number;
private var barHeight:Number;
private var mc:MovieClip;
public function DamageMeter(_arg1:MovieClip){
mc = _arg1;
barWidth = mc.bars.width;
barHeight = mc.bars.height;
}
public function set value(_arg1:Number):void{
mc.bars.scrollRect = new Rectangle(0, 0, (barWidth * _arg1), barHeight);
}
}
}//package spill.flakboy.ui.controls
Section 435
//QualityControl (spill.flakboy.ui.controls.QualityControl)
package spill.flakboy.ui.controls {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import gfx.ui.*;
public class QualityControl {
private var mc:QualityControl_mc;
private var qualities:Array;
public function QualityControl(_arg1:QualityControl_mc){
qualities = [StageQuality.LOW, StageQuality.MEDIUM, StageQuality.HIGH];
super();
mc = _arg1;
initButton(mc.low, StageQuality.LOW);
initButton(mc.meduim, StageQuality.MEDIUM);
initButton(mc.high, StageQuality.HIGH);
value = Data.quality;
}
private function initButton(_arg1:MovieClip, _arg2:String):void{
_arg1.stop();
_arg1.buttonMode = true;
_arg1.quality = _arg2;
_arg1.addEventListener(MouseEvent.CLICK, setQuality);
}
private function setQuality(_arg1:MouseEvent):void{
value = MovieClip(_arg1.currentTarget).quality;
}
public function set value(_arg1:String):void{
if (mc.stage){
mc.stage.quality = _arg1;
};
setButtonSelected(mc.low, (_arg1 == StageQuality.LOW));
setButtonSelected(mc.meduim, (_arg1 == StageQuality.MEDIUM));
setButtonSelected(mc.high, (_arg1 == StageQuality.HIGH));
Data.quality = _arg1;
}
private function setButtonSelected(_arg1:MovieClip, _arg2:Boolean):void{
_arg1.mouseEnabled = !(_arg2);
_arg1.enabled = !(_arg2);
_arg1.gotoAndStop((_arg2) ? "_over" : "_up");
}
}
}//package spill.flakboy.ui.controls
Section 436
//TutorialPopup (spill.flakboy.ui.controls.TutorialPopup)
package spill.flakboy.ui.controls {
import flash.display.*;
import gfx.ui.*;
public class TutorialPopup extends Sprite {
private var mc:TutorialPopup_mc;
public function TutorialPopup(_arg1:String){
mc = new TutorialPopup_mc();
mc.text.text = _arg1;
addChild(mc);
}
}
}//package spill.flakboy.ui.controls
Section 437
//VolumeControl (spill.flakboy.ui.controls.VolumeControl)
package spill.flakboy.ui.controls {
import flash.events.*;
import spill.flakboy.data.*;
import gfx.ui.*;
import spill.flakboy.sound.*;
public class VolumeControl {
private var trackWidth:Number;// = 70
private var mc:VolumeControl_mc;
public function VolumeControl(_arg1:VolumeControl_mc){
mc = _arg1;
mc.thumb.stop();
mc.thumb.buttonMode = true;
mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
value = Data.volume;
}
private function mouseUp(_arg1:MouseEvent):void{
mc.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove, false);
mc.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp, false);
}
public function get value():Number{
return ((mc.thumb.x / trackWidth));
}
public function set value(_arg1:Number):void{
_arg1 = Math.min(1, _arg1);
_arg1 = Math.max(0, _arg1);
mc.thumb.x = (_arg1 * trackWidth);
Data.volume = _arg1;
Music.volume = _arg1;
}
private function mouseMove(_arg1:MouseEvent):void{
value = (mc.mouseX / trackWidth);
}
private function mouseDown(_arg1:MouseEvent):void{
mc.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove, false, 0, true);
mc.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
}
}
}//package spill.flakboy.ui.controls
Section 438
//DamageDisplay (spill.flakboy.ui.DamageDisplay)
package spill.flakboy.ui {
import gfx.ui.*;
import spill.flakboy.character.*;
import spill.flakboy.ui.controls.*;
public class DamageDisplay {
private var mc:DamageDisplay_mc;
private var targetMeter:DamageMeter;
private var damageMeter:DamageMeter;
public function DamageDisplay(_arg1:DamageDisplay_mc){
mc = _arg1;
damageMeter = new DamageMeter(mc.damageMeter);
targetMeter = new DamageMeter(mc.targetMeter);
}
public function set targetDamage(_arg1:Number):void{
mc.targetText.text = _arg1.toString();
targetMeter.value = (_arg1 / FlakboyControl.maxHealth);
}
public function updateDisplay(_arg1:FlakboyControl):void{
if (!_arg1){
damageMeter.value = 0;
mc.damageText.text = "0";
} else {
damageMeter.value = (_arg1.totalDamage / _arg1.maxDamage);
mc.damageText.text = Math.round(_arg1.totalDamage).toString();
};
}
}
}//package spill.flakboy.ui
Section 439
//Display (spill.flakboy.ui.Display)
package spill.flakboy.ui {
import flash.display.*;
import spill.physics.*;
public class Display extends spDisplay {
public var debug:Sprite;
public var character:Sprite;
public var tools:Sprite;
public var background:Sprite;
public function Display(_arg1:spWorld){
background = new Sprite();
debug = new Sprite();
character = new Sprite();
tools = new Sprite();
super(_arg1);
addChild(background);
addChild(tools);
addChild(character);
addChild(debug);
dbgDraw.m_fillAlpha = 0.1;
debugLayer = debug;
}
}
}//package spill.flakboy.ui
Section 440
//Sidebar (spill.flakboy.ui.Sidebar)
package spill.flakboy.ui {
import flash.events.*;
import flash.display.*;
import spill.flakboy.events.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import gfx.ui.*;
import spill.flakboy.character.*;
import spill.flakboy.ui.controls.*;
import spill.flakboy.utils.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.localisation.*;
public class Sidebar extends Sprite {
public var enabled:Boolean;// = true
private var damageDisplay:DamageDisplay;
private var mc:Sidebar_mc;
private var toolSelector:ToolSelector;
private var playbackMode:Boolean;// = false
private var game:Game;
private var playbackDamageMeter:DamageMeter;
public function Sidebar(_arg1:Game){
mc = new Sidebar_mc();
addChild(mc);
game = _arg1;
mc.bugget_txt.embedFonts = true;
toolSelector = new ToolSelector(mc.toolSelector);
toolSelector.addEventListener(ToolMenuEvent.TOOL_PRESSED, toolPressed);
damageDisplay = new DamageDisplay(mc.damageDisplay);
mc.start_btn.addEventListener(MouseEvent.CLICK, startClicked);
mc.start_btn.buttonMode = true;
mc.start_btn.stop();
mc.stop_btn.addEventListener(MouseEvent.CLICK, game.toggleSimulation);
mc.stop_btn.buttonMode = true;
mc.stop_btn.stop();
Utils.initButton(mc.optionsButton, game.showOptions);
Utils.initBrandinButton(mc.brandingButton, "In_Game");
bugget = Game.instance.bugget;
addEventListener(Event.ADDED_TO_STAGE, added);
setHasDucky(false);
}
private function added(_arg1:Event):void{
setMode(true);
}
public function set bugget(_arg1:Number):void{
mc.bugget_txt.text = ("$" + _arg1);
}
public function set level(_arg1:int):void{
mc.levelText.text = SpilGame.getString("Level");
mc.levelText.text = (mc.levelText.text + (((" " + (_arg1 + 1)) + "/") + Game.totalLevels));
toolSelector.level = _arg1;
}
public function updateDamageMeter(_arg1:FlakboyControl):void{
if (playbackMode){
if (!_arg1){
playbackDamageMeter.value = 0;
mc.playbackDamage.damageText.text = "0";
} else {
playbackDamageMeter.value = (_arg1.totalDamage / _arg1.maxDamage);
mc.playbackDamage.damageText.text = Math.round(_arg1.totalDamage).toString();
};
} else {
damageDisplay.updateDisplay(_arg1);
};
}
public function setPlaybackMode():void{
playbackMode = true;
setMode(false);
playbackDamageMeter = new DamageMeter(mc.playbackDamage.damageMeter);
}
public function setTargetDamage(_arg1:Number):void{
damageDisplay.targetDamage = _arg1;
}
private function startClicked(_arg1:Event):void{
if (game.layout.hasDucky){
game.toggleSimulation();
} else {
game.layout.addingNewTool(ToolList.ducky);
};
SoundFX.playSound(PressStrat);
}
public function setHasDucky(_arg1:Boolean):void{
mc.start_btn.go_txt.visible = _arg1;
mc.start_btn.ducky_icon.visible = !(_arg1);
}
private function toolPressed(_arg1:ToolMenuEvent):void{
if (enabled){
dispatchEvent(new ToolMenuEvent(_arg1.type, _arg1.tool));
};
}
public function setMode(_arg1:Boolean):void{
if (((((!(mc.toolSelector.parent)) && (_arg1))) && (!(playbackMode)))){
mc.addChild(mc.toolSelector);
};
if (((mc.toolSelector.parent) && (((!(_arg1)) || (playbackMode))))){
mc.removeChild(mc.toolSelector);
};
if (((((!(mc.damageDisplay.parent)) && (!(_arg1)))) && (!(playbackMode)))){
mc.addChild(mc.damageDisplay);
};
if (((mc.damageDisplay.parent) && (((_arg1) || (playbackMode))))){
mc.removeChild(mc.damageDisplay);
};
damageDisplay.updateDisplay(null);
mc.start_btn.visible = ((_arg1) && (!(playbackMode)));
mc.bugget_txt.visible = ((_arg1) && (!(playbackMode)));
mc.bugget_title.visible = ((_arg1) && (!(playbackMode)));
mc.stop_btn.visible = ((!(_arg1)) || (playbackMode));
mc.playbackDamage.visible = playbackMode;
mc.levelText.visible = !(playbackMode);
}
}
}//package spill.flakboy.ui
Section 441
//ToolSelector (spill.flakboy.ui.ToolSelector)
package spill.flakboy.ui {
import flash.events.*;
import flash.display.*;
import spill.flakboy.events.*;
import spill.flakboy.tools.core.*;
import spill.flakboy.*;
import gfx.ui.*;
import flash.geom.*;
import sfx.*;
import spill.flakboy.tools.specials.*;
import spill.flakboy.sound.*;
public class ToolSelector extends EventDispatcher {
private var menuItems:Array;
private var mc:ToolSelector_mc;
private var catButtons:Array;
private var currentLevel:int;// = 10
public function ToolSelector(_arg1:ToolSelector_mc){
catButtons = new Array();
super();
mc = _arg1;
mc.tab.mouseEnabled = false;
mc.addEventListener(MouseEvent.ROLL_OUT, hideMenu);
initCategory(0, mc.missiles, mc.missiles_icon, ToolCategories.MISSILES);
initCategory(1, mc.mines, mc.mines_icon, ToolCategories.MINES);
initCategory(2, mc.guns, mc.guns_icon, ToolCategories.GUNS);
initCategory(3, mc.spikes, mc.spikes_icon, ToolCategories.SPIKES);
initCategory(4, mc.springs, mc.springs_icon, ToolCategories.SPRINGS);
initCategory(5, mc.other, mc.other_icon, ToolCategories.OTHER);
menuItems = [mc.item0, mc.item1, mc.item2, mc.item3, mc.item4];
initItems();
hideMenu();
}
private function hideMenu(_arg1:Event=null):void{
mc.background.visible = false;
mc.tab.visible = false;
var _local2:int;
while (_local2 < 5) {
menuItems[_local2].visible = false;
_local2++;
};
}
public function update(_arg1:int):void{
currentLevel = _arg1;
}
private function playRollOverSound(_arg1:Event):void{
SoundFX.playSound(CountersignWeapon);
}
private function initCategory(_arg1:int, _arg2:MovieClip, _arg3:Sprite, _arg4:int):void{
_arg3.mouseEnabled = false;
_arg2.index = _arg1;
_arg2.category = _arg4;
_arg2.alpha = 0;
_arg2.icon = _arg3;
_arg2.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
catButtons.push(_arg2);
}
public function set level(_arg1:int):void{
var _local3:MovieClip;
var _local4:Array;
currentLevel = _arg1;
var _local2:int;
while (_local2 < 6) {
_local3 = catButtons[_local2];
_local4 = ToolList.getCategory(_local3.category, currentLevel);
if (_local4.length){
_local3.icon.alpha = 1;
_local3.enabled = true;
} else {
_local3.icon.alpha = 0.5;
_local3.enabled = false;
};
_local2++;
};
}
private function initItems():void{
var _local2:ToolMenuItem_mc;
var _local1:int;
while (_local1 < 5) {
_local2 = menuItems[_local1];
_local2.index = _local1;
_local2.focusRect = false;
_local2.tabEnabled = false;
_local2.tabChildren = false;
_local2.addEventListener(MouseEvent.MOUSE_DOWN, menuItemMouseDown);
_local2.addEventListener(MouseEvent.ROLL_OVER, playRollOverSound);
_local1++;
};
}
private function rollOver(_arg1:MouseEvent):void{
showMenu(_arg1.currentTarget.index, _arg1.currentTarget.category);
}
private function menuItemMouseDown(_arg1:MouseEvent):void{
dispatchEvent(new ToolMenuEvent(ToolMenuEvent.TOOL_PRESSED, _arg1.currentTarget.tool));
SoundFX.playSound(Choice);
hideMenu();
}
private function renderItem(_arg1:int, _arg2:ToolDescr):void{
var _local3 = (_arg2.cost <= Game.instance.bugget);
if ((((_arg2.toolClass == Ducky)) && (Game.instance.layout.hasDucky))){
_local3 = false;
};
var _local4:ToolMenuItem_mc = menuItems[_arg1];
_local4.description.text = _arg2.description;
_local4.cost.text = _arg2.cost.toString();
_local4.tool = _arg2;
if (_local4.icon){
_local4.removeChild(_local4.icon);
};
_local4.icon = _local4.addChild(new _arg2.iconClass());
_local4.icon.mouseEnabled = false;
_local4.enabled = _local3;
_local4.mouseEnabled = _local3;
_local4.mouseChildren = _local3;
_local4.cacheAsBitmap = !(_local3);
if (_local3){
_local4.transform.colorTransform = new ColorTransform();
} else {
_local4.transform.colorTransform = new ColorTransform(2, 1, 1, 0.5, 50, -50, -50, 0);
};
}
private function showMenu(_arg1:int, _arg2:int):void{
var _local3:Array = ToolList.getCategory(_arg2, currentLevel);
if (!_local3.length){
hideMenu();
return;
};
var _local4:int;
while (_local4 < 5) {
if (_local4 < _local3.length){
menuItems[_local4].visible = true;
renderItem(_local4, _local3[_local4]);
} else {
menuItems[_local4].visible = false;
};
_local4++;
};
mc.background.visible = true;
mc.tab.visible = true;
mc.tab.x = (_arg1 * 50);
mc.background.height = Math.max(30, ((50 * _local3.length) + 20));
SoundFX.playSound(ChoiceWeapons);
}
}
}//package spill.flakboy.ui
Section 442
//Base64 (spill.flakboy.utils.Base64)
package spill.flakboy.utils {
import flash.utils.*;
public class Base64 {
public static const version:String = "1.1.0";
private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._";
public function Base64(){
throw (new Error("Base64 class is static container only"));
}
public static function encode(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (encodeByteArray(_local2));
}
public static function encodeByteArray(_arg1:ByteArray):String{
var _local3:Array;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local2 = "";
var _local4:Array = new Array(4);
_arg1.position = 0;
while (_arg1.bytesAvailable > 0) {
_local3 = new Array();
_local5 = 0;
while ((((_local5 < 3)) && ((_arg1.bytesAvailable > 0)))) {
_local3[_local5] = _arg1.readUnsignedByte();
_local5++;
};
_local4[0] = ((_local3[0] & 252) >> 2);
_local4[1] = (((_local3[0] & 3) << 4) | (_local3[1] >> 4));
_local4[2] = (((_local3[1] & 15) << 2) | (_local3[2] >> 6));
_local4[3] = (_local3[2] & 63);
_local6 = _local3.length;
while (_local6 < 3) {
_local4[(_local6 + 1)] = 64;
_local6++;
};
_local7 = 0;
while (_local7 < _local4.length) {
_local2 = (_local2 + BASE64_CHARS.charAt(_local4[_local7]));
_local7++;
};
};
return (_local2);
}
public static function decode(_arg1:String):String{
var _local2:ByteArray = decodeToByteArray(_arg1);
return (_local2.readUTFBytes(_local2.length));
}
public static function decodeToByteArray(_arg1:String):ByteArray{
var _local6:uint;
var _local7:uint;
var _local2:ByteArray = new ByteArray();
var _local3:Array = new Array(4);
var _local4:Array = new Array(3);
var _local5:uint;
while (_local5 < _arg1.length) {
_local6 = 0;
while ((((_local6 < 4)) && (((_local5 + _local6) < _arg1.length)))) {
_local3[_local6] = BASE64_CHARS.indexOf(_arg1.charAt((_local5 + _local6)));
_local6++;
};
_local4[0] = ((_local3[0] << 2) + ((_local3[1] & 48) >> 4));
_local4[1] = (((_local3[1] & 15) << 4) + ((_local3[2] & 60) >> 2));
_local4[2] = (((_local3[2] & 3) << 6) + _local3[3]);
_local7 = 0;
while (_local7 < _local4.length) {
if (_local3[(_local7 + 1)] == 64){
break;
};
_local2.writeByte(_local4[_local7]);
_local7++;
};
_local5 = (_local5 + 4);
};
_local2.position = 0;
return (_local2);
}
}
}//package spill.flakboy.utils
Section 443
//BitArray (spill.flakboy.utils.BitArray)
package spill.flakboy.utils {
import flash.utils.*;
public class BitArray extends ByteArray {
private var outputBuffer:uint;// = 0
private var inputBuffer:uint;// = 0
private var inputBufferLen:uint;// = 0
private var outputBufferLen:uint;// = 0
public function writeBits(_arg1:uint, _arg2:uint):void{
if (_arg1 > (Math.pow(2, _arg2) - 1)){
trace((((_arg1 + " too long to fit in ") + _arg2) + "bits"));
};
var _local3:String = _arg1.toString(2);
var _local4:int = _local3.length;
while (_local4 < _arg2) {
writeBit(false);
_local4++;
};
_local4 = 0;
while (_local4 < _local3.length) {
writeBit((_local3.charCodeAt(_local4) > 48));
_local4++;
};
}
public function flushInputBuffer():void{
while (inputBufferLen) {
writeBit(false);
};
}
public function flushOutputBuffer():void{
outputBuffer = 0;
outputBufferLen = 0;
}
private function writeBit(_arg1:Boolean):void{
inputBuffer = (inputBuffer << 1);
if (_arg1){
inputBuffer++;
};
if (++inputBufferLen == 8){
writeByte(inputBuffer);
inputBuffer = 0;
inputBufferLen = 0;
};
}
private function readBit():Boolean{
if (!outputBufferLen){
outputBuffer = readByte();
outputBufferLen = 8;
};
outputBufferLen--;
var _local1 = ((outputBuffer & 128) > 0);
outputBuffer = (outputBuffer << 1);
return (_local1);
}
public function readBits(_arg1:uint):uint{
var _local2:uint;
while (_arg1--) {
_local2 = (_local2 << 1);
if (readBit()){
_local2++;
};
};
return (_local2);
}
}
}//package spill.flakboy.utils
Section 444
//ImageScaler (spill.flakboy.utils.ImageScaler)
package spill.flakboy.utils {
import flash.display.*;
public class ImageScaler {
public static function scaleImage(_arg1:BitmapData, _arg2:BitmapData):void{
var _local10:int;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:int;
var _local16:Number;
var _local17:Number;
var _local18:uint;
var _local3:int = _arg1.width;
var _local4:int = _arg1.height;
var _local5:int = _arg2.width;
var _local6:int = _arg2.height;
var _local7:Number = (_local3 / _local5);
var _local8:Number = (_local4 / _local6);
var _local9:int;
while (_local9 < _local5) {
_local10 = 0;
while (_local10 < _local6) {
_local11 = 0;
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local15 = 0;
_local16 = Math.floor((_local9 * _local7));
while (_local16 < ((_local9 + 1) * _local7)) {
_local17 = Math.floor((_local10 * _local8));
while (_local17 < ((_local10 + 1) * _local8)) {
_local18 = _arg1.getPixel32(_local16, _local17);
_local11 = (_local11 + ((_local18 & 4278190080) >> 24));
_local12 = (_local12 + ((_local18 & 0xFF0000) >> 16));
_local13 = (_local13 + ((_local18 & 0xFF00) >> 8));
_local14 = (_local14 + (_local18 & 0xFF));
_local15++;
_local17++;
};
_local16++;
};
_local11 = (_local11 / _local15);
_local12 = (_local12 / _local15);
_local13 = (_local13 / _local15);
_local14 = (_local14 / _local15);
_arg2.setPixel32(_local9, _local10, ((((_local11 << 24) | (_local12 << 16)) | (_local13 << 8)) | _local14));
_local10++;
};
_local9++;
};
}
}
}//package spill.flakboy.utils
Section 445
//Utils (spill.flakboy.utils.Utils)
package spill.flakboy.utils {
import flash.events.*;
import flash.display.*;
import sfx.*;
import spill.flakboy.sound.*;
import spill.localisation.*;
import flash.net.*;
public class Utils {
public static function initButton(_arg1:MovieClip, _arg2:Function=null):void{
_arg1.buttonMode = true;
_arg1.mouseChildren = false;
_arg1.stop();
_arg1.addEventListener(MouseEvent.ROLL_OVER, buttonRollOver, false, 0, true);
_arg1.addEventListener(MouseEvent.CLICK, buttonClicked, false, 0, true);
if ((_arg2 is Function)){
_arg1.addEventListener(MouseEvent.CLICK, _arg2, false, 0, true);
};
}
public static function deInitButton(_arg1:MovieClip, _arg2:Function=null):void{
_arg1.buttonMode = false;
_arg1.mouseChildren = false;
_arg1.stop();
_arg1.removeEventListener(MouseEvent.ROLL_OVER, buttonRollOver);
_arg1.removeEventListener(MouseEvent.CLICK, buttonClicked);
if ((_arg2 is Function)){
_arg1.removeEventListener(MouseEvent.CLICK, _arg2);
};
}
private static function promotionClicked(_arg1:Event):void{
var _local2:String = SpilGame.getPromotionLink();
navigateToURL(new URLRequest(_local2), "_blank");
}
public static function initPromotionButton(_arg1:MovieClip):void{
initButton(_arg1, promotionClicked);
}
private static function buttonRollOver(_arg1:MouseEvent):void{
SoundFX.playSound(ButtonOver);
}
private static function brandingClicked(_arg1:Event):void{
var _local2:String = SpilGame.getMoreGamesLink(MovieClip(_arg1.currentTarget).term);
navigateToURL(new URLRequest(_local2), "_blank");
}
private static function buttonClicked(_arg1:MouseEvent):void{
SoundFX.playSound(ButtonHit);
}
public static function initBrandinButton(_arg1:MovieClip, _arg2:String):void{
_arg1.addEventListener(MouseEvent.CLICK, brandingClicked, false, 0, true);
_arg1.term = _arg2;
}
}
}//package spill.flakboy.utils
Section 446
//Engine (spill.flakboy.Engine)
package spill.flakboy {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import spill.flakboy.events.*;
import spill.flakboy.tools.core.*;
import spill.physics.*;
import spill.flakboy.character.*;
import spill.flakboy.ui.*;
import flash.geom.*;
import gfx.*;
import spill.flakboy.tools.specials.*;
import spill.flakboy.tools.utils.*;
import spill.physics.elements.*;
public class Engine extends MovieClip {
private var bodies:Array;
public var display:Display;
private var toolsDepleted:int;
public var backgroundBitmapData:BitmapData;
public var bulletCasings:BulletCasings;
public var world:spWorld;
private var frameNum:int;// = 0
public var room:spRoom;
public var flakboy:FlakboyControl;
private var flakBoyScaredAnimation:Scared_mc;
public var background:Bitmap;
private var totalTools:int;
public var mouseControl:spMouseControl;
public static const characterBit:int = 2;
public static const groundBit:int = 4;
public static const toolBit:int = 8;
private static var currentRecording:Array;
private static var lastRecording:Array;
public static var instance:Engine;
public function Engine(){
bodies = new Array();
super();
}
private function proxyListener(_arg1:Event):void{
dispatchEvent(new FlakboyEvent(_arg1.type));
}
public function drawOnBackground(_arg1:Sprite, _arg2:Number=0, _arg3:Number=0):void{
var _local4:Matrix = _arg1.transform.matrix.clone();
_local4.translate((Game.physx + _arg2), (Game.physy + _arg3));
backgroundBitmapData.lock();
backgroundBitmapData.draw(_arg1, _local4, _arg1.transform.colorTransform);
backgroundBitmapData.unlock();
}
private function scaredAnimationFinished():void{
flakBoyScaredAnimation.stop();
removeChild(flakBoyScaredAnimation);
flakBoyScaredAnimation = null;
flakboy.anim.visible = true;
flakboy.anim.play();
world.start();
}
public function init():void{
scrollRect = new Rectangle(0, 0, 700, 470);
if (Engine.instance){
Engine.instance.destroy();
};
Engine.instance = this;
backgroundBitmapData = new BitmapData(700, 470);
var _local1:Background = new Background();
backgroundBitmapData.draw(_local1);
background = new Bitmap(backgroundBitmapData);
background.smoothing = false;
background.pixelSnapping = PixelSnapping.ALWAYS;
addChild(background);
world = new spWorld();
world.globalAngularDamping = 0.05;
world.globalLinearDamping = 0.05;
world.globalRestitution = 0.3;
world.addEventListener("afterStep", afterStep);
world.ref.SetContinuousPhysics(true);
world.timeStep = (1 / 31);
display = new Display(world);
display.x = Game.physx;
display.y = Game.physy;
display.drawScale = Game.drawScale;
display.debugDrawEnabled = Data.debug.draw;
world.display = display;
room = new spRoom();
room.width = (Game.physicsWidth / Game.drawScale);
room.height = (Game.physicsHeight / Game.drawScale);
room.thickness = 20;
room.filter.categoryBits = Engine.groundBit;
world.addElement(room);
flakboy = new FlakboyControl();
flakboy.initX = (350 / Game.drawScale);
flakboy.initY = ((Game.physicsHeight / Game.drawScale) - 1);
flakboy.drawScale = Game.drawScale;
flakboy.addEventListener(FlakboyEvent.DAMAGE_TAKEN, proxyListener, false, 0, true);
flakboy.addEventListener(FlakboyEvent.LIMB_LOST, proxyListener, false, 0, true);
flakboy.addEventListener(FlakboyEvent.LIMB_BROKEN, proxyListener, false, 0, true);
world.addElement(flakboy);
addChild(display);
bulletCasings = new BulletCasings();
world.addElement(bulletCasings);
mouseControl = new spMouseControl(world, display);
mouseControl.enabled = Data.debug.mouse;
bodies.push(flakboy.head);
if (currentRecording){
lastRecording = currentRecording;
};
currentRecording = new Array();
flakBoyScaredAnimation = new Scared_mc();
flakBoyScaredAnimation.x = (Game.roomWidth / 2);
flakBoyScaredAnimation.y = (Game.roomHeight - Game.physy);
flakBoyScaredAnimation.scaleX = -(Ducky.side);
flakBoyScaredAnimation.addFrameScript((flakBoyScaredAnimation.totalFrames - 1), scaredAnimationFinished);
flakBoyScaredAnimation.stop();
addChild(flakBoyScaredAnimation);
}
public function addBloodSplatter(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int=1):void{
var _local5:BloodSplatter;
if (Flakboy.showGore){
_local5 = new BloodSplatter(_arg1, _arg2, _arg3, _arg4);
display.background.addChild(_local5);
};
}
private function playScaredAnimation():void{
flakBoyScaredAnimation.play();
}
private function afterStep(_arg1:Event):void{
var _local4:spBody;
var _local5:Array;
var _local2:Array = new Array();
currentRecording[frameNum] = _local2;
var _local3:int;
while (_local3 < bodies.length) {
_local4 = spBody(bodies[_local3]);
_local2.push(_local4.position.x, _local4.position.y, _local4.angle);
if (lastRecording){
_local5 = lastRecording[frameNum];
if (_local5){
if (((((!((_local5[0] == _local2[0]))) || (!((_local5[1] == _local2[1]))))) || (!((_local5[2] == _local2[2]))))){
trace("DIFFERENCE in simulation!!");
};
};
};
_local3++;
};
frameNum++;
}
public function start():void{
Ducky.instance.play(playScaredAnimation);
}
public function loadLayout(_arg1:ToolLayout):void{
var _local3:ToolDummy;
var _local4:ToolDescr;
var _local5:spElement;
totalTools = 0;
toolsDepleted = 0;
var _local2:int;
while (_local2 < _arg1.tools.length) {
_local3 = _arg1.tools[_local2];
_local4 = _local3.descriptor;
_local5 = new _local4.toolClass(_local3);
world.addElement(_local5);
if (_local4.toolClass != Ducky){
totalTools++;
};
_local2++;
};
}
override public function stop():void{
world.stop();
}
public function destroy():void{
if (mouseControl){
mouseControl.destroy();
};
world.destroy();
Engine.instance = null;
if (flakBoyScaredAnimation){
flakBoyScaredAnimation.stop();
};
}
public static function resetRecording():void{
lastRecording = null;
currentRecording = null;
}
public static function toolDepleted():void{
instance.toolsDepleted++;
if ((((instance.toolsDepleted == instance.totalTools)) && ((instance.totalTools >= Achievements.TOOLS_DEPLETED_AMOUNT)))){
Achievements.achievementEarned(Achievements.TOOLS_DEPLETED);
};
}
}
}//package spill.flakboy
Section 447
//Game (spill.flakboy.Game)
package spill.flakboy {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import fl.transitions.*;
import flash.utils.*;
import spill.flakboy.events.*;
import spill.flakboy.tools.core.*;
import gfx.ui.*;
import spill.physics.*;
import spill.flakboy.character.*;
import com.gskinner.utils.*;
import flash.media.*;
import spill.flakboy.ui.*;
import com.adobe.images.*;
import flash.geom.*;
import spill.flakboy.debug.*;
import gfx.*;
import spill.flakboy.menus.*;
import spill.flakboy.ui.controls.*;
import fl.motion.easing.*;
import spill.flakboy.utils.*;
import sfx.*;
import spill.flakboy.tools.specials.*;
import spill.flakboy.sound.*;
public class Game extends Sprite {
private const FIRST_RUN:int = 5;
private const PLACE_TURRET:int = 2;
private const PLACE_DUCKY:int = 3;
private const START:int = 0;
private const PLACE_MINE:int = 1;
private const PRESS_GO:int = 4;
private const TUTORIAL_COMPLETE:int = 6;
private var transitionParameters:Object;
private var tutorialMode:Boolean;// = false
private var debugWindow:DebugWindow;
public var layout:ToolLayout;
private var background:Sprite;
private var engineLayer:Sprite;
private var cleaner1:Cleaner_mc;
private var hatch:Hatch_mc;
public var engine:Engine;
private var currentScreen:DisplayObject;
private var layoutLayer:Sprite;
private var transitionOffset:Matrix;
private var playbackEndScreen:PlaybackEndScreen;
private var levelData:LevelData;
private var debug:Boolean;// = false
private var transition:TransitionManager;
private var transInBmp:BitmapData;
private var sidebar:Sidebar;
private var isMineField:Boolean;
private var targetDamage:Number;// = 100
private var landingScreen:SentFromFriendScreen;
private var f:Number;
private var transitioning:Boolean;// = false
private var gameLayer:Sprite;
private var _bugget:Number;// = 2000
private var t:Number;
private var playBackMode:Boolean;// = false
private var currentLevel:Number;// = 0
private var tutorialLayer:Sprite;
private var moneySpent:int;
public var specialWeaponActive:Tool;
private var transitionPosition:Number;// = 0
private var levelCompleteScreen:LevelCompleteScreen;
private var levelFailedScreen:LevelFailedScreen;
private var transitionBitmapData:BitmapData;
private var profitFromOtherLevels:Number;
public var main:Main;
private var tutorialState:int;// = 0
private var transitionRect:Rectangle;
private var simulating:Boolean;// = false
private var transitionBitmap:Bitmap;
private var tutorialPopup:TutorialPopup;
private var transitionSpeed:Number;// = 10
public static const startingBugget:Number = 600;
public static const stageHeight:Number = 540;
public static const totalLevels:Number = 8;
public static const transitionFrameRate:Number = 41;
public static const physicsHeight:Number = 448;
public static const drawScale:Number = 60;
public static const physy:Number = 11;
public static const stageWidth:Number = 700;
public static const roomHeight:Number = 470;
public static const roomWidth:Number = 700;
public static const defaultFrameRate:Number = 31;
public static const physx:Number = 13;
public static const physicsWidth:Number = 674;
public static var instance:Game;
public function Game(_arg1:Main, _arg2:int=0, _arg3:String=null){
transitionOffset = new Matrix(1, 0, 0, 1, physx, physy);
transitionRect = new Rectangle(0, 0, transitionSpeed, Game.roomHeight);
transitionParameters = {type:Squeeze, direction:Transition.IN, duration:1, startPoint:5, easing:Quadratic.easeOut};
super();
main = _arg1;
if (Game.instance){
Game.instance.destroyEngine();
};
instance = this;
gameLayer = new Sprite();
gameLayer.scrollRect = new Rectangle(0, 0, roomWidth, roomHeight);
addChild(gameLayer);
engineLayer = new Sprite();
gameLayer.addChild(engineLayer);
sidebar = new Sidebar(this);
sidebar.x = 0;
sidebar.y = 470;
sidebar.addEventListener(ToolMenuEvent.TOOL_PRESSED, toolPressed, false, 0, true);
addChild(sidebar);
layoutLayer = new Sprite();
gameLayer.addChild(layoutLayer);
layout = new ToolLayout(sidebar);
layout.x = physx;
layout.y = physy;
layoutLayer.addChild(layout);
if (_arg3){
_arg2 = 7;
playBackMode = true;
Achievements.enabled = false;
sidebar.setPlaybackMode();
if (layout.importString(_arg3)){
landingScreen = new SentFromFriendScreen(this, layout.friendName, false);
} else {
layout.clear();
landingScreen = new SentFromFriendScreen(this, null, true);
};
addChild(landingScreen);
} else {
Achievements.enabled = true;
};
background = new Background();
background.x = -(physx);
background.y = -(physy);
layout.addChildAt(background, 0);
tutorialLayer = new Sprite();
tutorialLayer.x = -(physx);
tutorialLayer.y = -(physy);
layout.addChildAt(tutorialLayer, 1);
debugWindow = new DebugWindow(this);
debugWindow.visible = false;
addChild(debugWindow);
sidebar.updateDamageMeter(null);
addEventListener(Event.ADDED_TO_STAGE, added);
addEventListener(Event.REMOVED_FROM_STAGE, removed);
if (!playBackMode){
bugget = 2000;
setLevel(_arg2);
openHatch();
};
Achievements.instance.callbackFunction = achievementEarned;
}
private function added(_arg1:Event):void{
stage.addEventListener(KeyboardEvent.KEY_DOWN, toggleDebug);
}
private function playHatchSound():void{
SoundFX.playSound(HatchesAndDoors);
}
public function duckyAdded():void{
sidebar.setHasDucky(true);
}
public function hasReachedTarget():Boolean{
return ((engine.flakboy.totalDamage >= targetDamage));
}
private function removeScreen():void{
removeChild(currentScreen);
currentScreen = null;
levelFailedScreen = null;
levelCompleteScreen = null;
}
private function firstRunComplete(_arg1:Boolean):void{
tutorialState = TUTORIAL_COMPLETE;
if (!_arg1){
addChild(new TutorialIntroScreen(this, "{Tutorial_Outro}"));
};
Data.tutorialCompleted = true;
}
public function startSimulation(_arg1:Event=null):void{
if (hatch.currentFrame != hatch.totalFrames){
return;
};
if (!layout.hasDucky){
return;
};
if (simulating){
return;
};
if (transitioning){
return;
};
if (landingScreen){
landingScreen = null;
};
simulating = true;
if (transitioning){
endTransition();
};
specialWeaponActive = null;
debugWindow.visible = false;
Rndm.seed = 1;
createEngine();
engine.start();
layoutLayer.removeChild(layout);
sidebar.setMode(false);
sidebar.updateDamageMeter(null);
moneySpent = layout.moneySpent;
isMineField = layout.isMineField();
profitFromOtherLevels = Data.getTotalProfit(true, currentLevel);
if (((tutorialMode) && ((tutorialState == PRESS_GO)))){
goPressed();
};
Music.stopSong();
}
private function goPressed():void{
tutorialState = FIRST_RUN;
removeTutorialPopup();
}
private function openHatch():void{
hatch = new Hatch_mc();
hatch.x = ((Game.roomWidth / 2) - Game.physx);
hatch.y = (Game.roomHeight - Game.physy);
hatch.addFrameScript((hatch.totalFrames - 1), hatchEnd);
hatch.addFrameScript((hatch.totalFrames / 2), playHatchSound);
layout.addChildAt(hatch, 1);
}
private function levelCompleted():void{
levelCompleteScreen = new LevelCompleteScreen(currentLevel, levelData, this, main);
currentScreen = levelCompleteScreen;
addChild(levelCompleteScreen);
if ((currentLevel + 1) < Game.totalLevels){
if (!((Flakboy.restricted) && ((currentLevel >= 3)))){
Data.getLevel((currentLevel + 1)).unlocked = true;
};
};
}
private function removeHatch(_arg1:Event=null):void{
}
public function exitTutorialIntro():void{
if (tutorialState == START){
showMinePopup();
};
}
private function transitionHandler(_arg1:Event):void{
transitionBitmapData.lock();
transitionRect.x = transitionPosition;
transitionBitmapData.copyPixels(transInBmp, transitionRect, new Point(transitionRect.x, 0));
transitionBitmapData.unlock(transitionRect);
cleaner1.x = (transitionPosition + transitionSpeed);
if (transitionPosition >= (Game.roomWidth + cleaner1.width)){
endTransition();
};
transitionPosition = (transitionPosition + transitionSpeed);
f++;
}
public function nextLevel(_arg1:Event=null):void{
removeScreen();
layout.clear();
setLevel((currentLevel + 1));
startTransition();
}
private function startTransition():void{
layout.removeChild(hatch);
transInBmp = new BitmapData(Game.roomWidth, Game.roomHeight);
transInBmp.draw(layout, transitionOffset);
stage.frameRate = 41;
addEventListener(Event.ENTER_FRAME, transitionHandler);
cleaner1 = new Cleaner_mc();
cleaner1.x = 0;
cleaner1.y = Game.roomHeight;
cleaner1.scaleX = -1;
spSettings.stopChildren(cleaner1);
cleaner1.cacheAsBitmap = true;
gameLayer.addChild(cleaner1);
if (!playBackMode){
sidebar.setMode(true);
};
transitioning = true;
transitionPosition = 0;
t = getTimer();
f = 0;
sidebar.enabled = false;
SoundFX.playSound(CleanerRobots);
}
private function createEngine():void{
engine = new Engine();
engineLayer.addChild(engine);
engine.init();
engine.loadLayout(layout);
engine.addEventListener(FlakboyEvent.DAMAGE_TAKEN, damageTaken, false, 0, true);
}
private function toggleDebug(_arg1:KeyboardEvent):void{
}
public function setLevel(_arg1:int):void{
tutorialMode = (((_arg1 == 0)) && (!(Data.tutorialCompleted)));
currentLevel = _arg1;
targetDamage = LevelData.targets[_arg1];
sidebar.setTargetDamage(targetDamage);
sidebar.level = _arg1;
bugget = Data.getBugget(currentLevel);
var _local2:LevelData = Data.getLevel(_arg1);
startMusic();
if (_local2.completed){
layout.importString(_local2.layout);
bugget = (bugget - layout.moneySpent);
} else {
layout.clear();
};
}
private function removed(_arg1:Event):void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, toggleDebug);
}
public function get bugget():Number{
return (_bugget);
}
private function toolPressed(_arg1:ToolMenuEvent):void{
layout.addingNewTool(_arg1.tool);
}
private function errorLoadingLayout():void{
}
private function showTurretPopup():void{
if (layout.hasToolCategory(ToolCategories.GUNS)){
showDuckyPopup();
} else {
tutorialState = PLACE_TURRET;
showTutorialPopup(330, 470, "{Place_Turret_Tutorial}");
};
}
public function duckyRemoved():void{
sidebar.setHasDucky(false);
}
public function toggleSimulation(_arg1:Event=null):void{
if (simulating){
stopSimulation();
} else {
startSimulation();
};
}
private function hatchEnd(_arg1:Event=null):void{
hatch.stop();
sidebar.enabled = true;
if (playBackMode){
startSimulation();
} else {
if (((tutorialMode) && ((tutorialState == START)))){
showTutorialIntro();
};
};
}
private function achievementEarned(_arg1:int):void{
trace(((("Achievement Earned " + Achievements.getName(_arg1)) + " - ") + _arg1));
if (!Achievements.instance.complete[_arg1]){
Achievements.instance.complete[_arg1] = true;
};
if (_arg1 == Achievements.MINE_FIELD){
main.achievementManager.m_AchievementGained(0);
};
if (_arg1 == Achievements.NO_LIMBS){
main.achievementManager.m_AchievementGained(1);
};
if (_arg1 == Achievements.STANDING){
main.achievementManager.m_AchievementGained(2);
};
if (_arg1 == Achievements.SKINNED){
main.achievementManager.m_AchievementGained(3);
};
if (_arg1 == Achievements.MAX_DAMAGE){
main.achievementManager.m_AchievementGained(4);
};
}
private function showDuckyPopup():void{
if (layout.hasDucky){
showGoPopup();
} else {
tutorialState = PLACE_DUCKY;
showTutorialPopup(640, 470, "{Place_Ducky_Tutorial}");
};
}
private function endTransition():void{
var _local1:Number = ((getTimer() - t) / 1000);
stage.frameRate = 31;
transitioning = false;
removeEventListener(Event.ENTER_FRAME, transitionHandler);
gameLayer.removeChild(transitionBitmap);
transitionBitmap = null;
transitionBitmapData = null;
transInBmp = null;
layoutLayer.addChild(layout);
sidebar.setMode(true);
gameLayer.removeChild(cleaner1);
cleaner1 = null;
openHatch();
}
private function getLevelData():void{
var _local1:FlakboyControl = engine.flakboy;
levelData = new LevelData();
levelData.armDamage = _local1.armDamage;
levelData.maxArmDamage = _local1.maxArmDamage;
levelData.legDamage = _local1.legDamage;
levelData.maxLegDamage = _local1.maxLegDamage;
levelData.headDamage = _local1.head.damage;
levelData.maxHeadDamage = _local1.head.maxHealth;
levelData.torsoDamage = _local1.torso.damage;
levelData.maxTorsoDamage = _local1.torso.maxHealth;
levelData.totalDamage = _local1.totalDamage;
levelData.maxDamage = _local1.maxDamage;
levelData.targetDamage = targetDamage;
levelData.completed = (levelData.totalDamage >= levelData.targetDamage);
levelData.moneyEarned = Math.round((levelData.totalDamage * 3));
levelData.moneySpent = layout.moneySpent;
levelData.layout = layout.exportString();
levelData.unlocked = true;
var _local2:LevelData = Data.getLevel(currentLevel);
if (levelData.completed){
if (!_local2.completed){
levelData.improved = true;
levelData.improvement = levelData.profit;
levelData.image = makeThumbnail();
Data.setLevel(currentLevel, levelData);
if ((currentLevel + 1) == Game.totalLevels){
levelData.gameComplete = true;
Analytics.gameCompletedEvent();
};
} else {
if (levelData.profit > _local2.profit){
levelData.improved = true;
levelData.improvement = (levelData.profit - _local2.profit);
levelData.image = makeThumbnail();
Data.setLevel(currentLevel, levelData);
if (Data.isGameComplete()){
levelData.scoreImproved = true;
Analytics.levelImprovedEvent();
};
} else {
levelData.improved = false;
levelData.improvement = (levelData.profit - _local2.profit);
};
};
};
}
public function backToMain():void{
main.goMainScreen();
}
private function showMinePopup():void{
if (layout.hasToolCategory(ToolCategories.MINES)){
showTurretPopup();
} else {
tutorialState = PLACE_MINE;
showTutorialPopup(280, 470, "{Place_Mine_Tutorial}");
};
}
private function makeThumbnail():ByteArray{
var _local1:BitmapData = new BitmapData(700, 470);
var _local2:BitmapData = new BitmapData(140, 94);
_local1.draw(engine);
ImageScaler.scaleImage(_local1, _local2);
return (new JPGEncoder(90).encode(_local2));
}
private function damageTaken(_arg1:Event):void{
sidebar.updateDamageMeter(engine.flakboy);
var _local2:Number = engine.flakboy.totalDamage;
var _local3:Number = ((_local2 * 3) - moneySpent);
if (_local2 >= Achievements.HIGH_DAMAGE_AMOUNT){
Achievements.achievementEarned(Achievements.HIGH_DAMAGE);
};
if (_local2 >= engine.flakboy.maxDamage){
Achievements.achievementEarned(Achievements.MAX_DAMAGE);
};
if (_local2 >= (targetDamage * 2)){
Achievements.achievementEarned(Achievements.DOUBLE_DAMAGE);
};
if (_local2 >= (targetDamage * 3)){
Achievements.achievementEarned(Achievements.TRIPPLE_DAMAGE);
};
if (_local3 > 0){
Achievements.achievementEarned(Achievements.PROFIT);
};
if (_local3 >= Achievements.HIGH_PROFIT_AMOUNT){
Achievements.achievementEarned(Achievements.HIGH_PROFIT);
};
if (((isMineField) && ((_local2 >= targetDamage)))){
Achievements.achievementEarned(Achievements.MINE_FIELD);
};
if ((profitFromOtherLevels + _local3) >= Achievements.MONEY_MAKER_AMOUNT){
Achievements.achievementEarned(Achievements.MONEY_MAKER);
};
}
public function retry(_arg1:Event=null):void{
removeScreen();
startTransition();
}
public function loadLayout(_arg1:String):void{
var str = _arg1;
try {
layout.importString(str);
} catch(e:Error) {
errorLoadingLayout();
};
}
private function prepareTransition():void{
transitionBitmapData = new BitmapData(Game.roomWidth, Game.roomHeight);
transitionBitmapData.draw(engine);
transitionBitmap = new Bitmap(transitionBitmapData);
destroyEngine();
gameLayer.addChild(transitionBitmap);
}
public function startPlayBack():void{
openHatch();
}
public function playbackEnd():void{
playbackEndScreen = new PlaybackEndScreen(this);
addChild(playbackEndScreen);
}
public function stopSimulation():void{
if (!simulating){
return;
};
simulating = false;
if (!playBackMode){
getLevelData();
};
debugWindow.visible = false;
prepareTransition();
if (!playBackMode){
if (levelData.completed){
levelCompleted();
} else {
levelFailed();
};
if (tutorialState == FIRST_RUN){
firstRunComplete(levelData.completed);
};
} else {
playbackEnd();
};
}
public function set bugget(_arg1:Number):void{
_bugget = _arg1;
sidebar.bugget = _arg1;
}
private function removeTutorialPopup():void{
if (tutorialPopup){
tutorialLayer.removeChild(tutorialPopup);
};
tutorialPopup = null;
}
private function destroyEngine():void{
if (engine){
engine.destroy();
engineLayer.removeChild(engine);
engine.removeEventListener(FlakboyEvent.DAMAGE_TAKEN, damageTaken);
engine = null;
};
}
private function showTutorialIntro():void{
if (tutorialState == START){
addChild(new TutorialIntroScreen(this, "{Tutorial_Intro}"));
};
}
private function startMusic(_arg1:Event=null):void{
Music.playSong(("music" + (currentLevel % 3)));
}
public function replay(_arg1:Event=null):void{
startTransition();
}
private function levelFailed():void{
addChild(new LevelFailedMessage_mc());
startTransition();
var _local1:SoundChannel = Music.playSong("levelFailed", false);
_local1.addEventListener(Event.SOUND_COMPLETE, startMusic);
}
public function showOptions(_arg1:Event):void{
addChild(new OptionsScreen(this));
}
private function showTutorialPopup(_arg1:Number, _arg2:Number, _arg3:String):void{
if (tutorialPopup){
removeTutorialPopup();
};
tutorialPopup = new TutorialPopup(_arg3);
tutorialPopup.x = _arg1;
tutorialPopup.y = _arg2;
tutorialLayer.addChild(tutorialPopup);
}
public function toolPlaced(_arg1:ToolDescr):void{
if (tutorialState == PLACE_MINE){
if (_arg1.category == ToolCategories.MINES){
showTurretPopup();
};
};
if (tutorialState == PLACE_TURRET){
if (_arg1.category == ToolCategories.GUNS){
showDuckyPopup();
};
};
if (tutorialState == PLACE_DUCKY){
if (_arg1.toolClass == Ducky){
showGoPopup();
};
};
}
private function showGoPopup():void{
tutorialState = PRESS_GO;
showTutorialPopup(640, 470, "{Press_Go_Tutorial}");
}
public static function get bloodColor():uint{
var _local1:uint = ((Math.floor((Rndm.random() * 85)) << 16) + 0x990000);
var _local2:uint = (Math.floor((Rndm.random() * 34)) << 8);
var _local3:uint = Math.floor((Rndm.random() * 34));
return (((_local1 | _local2) | _local3));
}
public static function get flakBloodColor():uint{
var _local1:uint = ((Math.floor((Rndm.random() * 51)) << 16) + 0xBB0000);
var _local2:uint = (Math.floor((Rndm.random() * 34)) << 8);
var _local3:uint = Math.floor((Rndm.random() * 34));
return (((_local1 | _local2) | _local3));
}
}
}//package spill.flakboy
Section 448
//Brand (spill.localisation.Brand)
package spill.localisation {
import flash.xml.*;
public class Brand {
public var domain:String;
public var emailPage:String;
public var name:String;
public var site_id:uint;
public var isExternal:Boolean;// = false
public var id:Number;
public var hostingDomain:String;// = ""
public var preferedLanguage:String;// = ""
public var moreLink:String;// = ""
public var hasSendToFriendLink:Boolean;// = true
public var emailLink:String;// = "game"
public var portalGroup:uint;
public var useGoogleAnalitics:Boolean;// = true
private static const topLevelDoubles:String = (((((((((((((("ac.cn,ac.jp,ac.uk,ad.jp,adm.br,adv.br,agr.br," + "ah.cn,am.br,arq.br,art.br,asn.au,ato.br,av.tr,bel.tr,bio.br,biz.tr,bj.cn,bmd.br,") + "cim.br,cng.br,cnt.br,co.at,co.jp,co.uk,com.au,com.br,com.cn,com.eg,com.hk,com.mx,") + "com.ru,com.tr,com.tw,conf.au,cq.cn,csiro.au,dr.tr,ecn.br,edu.au,edu.br,edu.tr,") + "emu.id.au,eng.br,esp.br,etc.br,eti.br,eun.eg,far.br,fj.cn,fm.br,fnd.br,fot.br,") + "fst.br,g12.br,gb.com,gb.net,gd.cn,gen.tr,ggf.br,gob.mx,gov.au,gov.br,gov.cn,") + "gov.hk,gov.tr,gr.jp,gs.cn,gx.cn,gz.cn,ha.cn,hb.cn,he.cn,hi.cn,hk.cn,hl.cn,hn.cn,") + "id.au,idv.tw,imb.br,ind.br,inf.br,info.au,info.tr,jl.cn,jor.br,js.cn,jx.cn,k12.tr,") + "lel.br,ln.cn,ltd.uk,mat.br,me.uk,med.br,mil.br,mil.tr,mo.cn,mus.br,name.tr,ne.jp,") + "net.au,net.br,net.cn,net.eg,net.hk,net.lu,net.mx,net.ru,net.tr,net.tw,net.uk,") + "nm.cn,no.com,nom.br,not.br,ntr.br,nx.cn,odo.br,oop.br,or.at,or.jp,org.au,org.br,") + "org.cn,org.hk,org.lu,org.ru,org.tr,org.tw,org.uk,plc.uk,pol.tr,pp.ru,ppg.br,pro.br,") + "psc.br,psi.br,qh.cn,qsl.br,rec.br,sc.cn,sd.cn,se.com,se.net,sh.cn,slg.br,sn.cn,") + "srv.br,sx.cn,tel.tr,tj.cn,tmp.br,trd.br,tur.br,tv.br,tw.cn,uk.com,uk.net,vet.br,") + "wattle.id.au,web.tr,xj.cn,xz.cn,yn.cn,zj.cn,zlg.br,co.nr,co.nz,com.fr,com.ph,");
private function get utm_campaign():String{
if (isExternal){
return (("utm_campaign=" + hostingDomain));
};
return ("");
}
public function exportXML():XML{
var _local3:XML;
var _local1:XML = <portal/>
;
_local1.@id = site_id;
_local1.@language = preferedLanguage;
_local1.@channel = portalGroup;
var _local2:XML = <domain/>
;
_local2.appendChild(new XMLNode(3, domain));
_local1.appendChild(_local2);
if (moreLink){
_local3 = <more_games_path/>
;
_local3.appendChild(new XMLNode(3, moreLink));
_local1.appendChild(_local3);
};
_local2 = <game_path/>
;
_local2.appendChild(new XMLNode(3, emailLink));
_local1.appendChild(_local2);
if (!useGoogleAnalitics){
_local1.attributes.noGoogleAnalitics = true;
};
if (!hasSendToFriendLink){
_local1.attributes.noSendToFriendLink = true;
};
return (_local1);
}
public function getPromotionLink(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:String="", _arg5:String=""):String{
var _local6:String = ("http://" + domain);
_local6 = (_local6 + ((("/" + emailLink) + "/") + _arg2));
if (useGoogleAnalitics){
_local6 = (_local6 + ("?utm_medium=brandedgames_" + (_arg3) ? "external" : "internal"));
_local6 = (_local6 + ("&utm_campaign=" + _arg1));
_arg4 = stripSubDomain(_arg4);
trace(_arg4);
if (_arg4 == "localhost"){
_arg4 = "offline_play";
};
_local6 = (_local6 + ("&utm_source=" + _arg4));
if (((!((_arg5 == ""))) && (!((_arg5 == null))))){
_local6 = (_local6 + ("&utm_content=" + _arg5));
};
};
return (_local6);
}
private function get utm_source():String{
return (("utm_source=brandedgames_" + (isExternal) ? "external" : "internal"));
}
public function getMoreGamesLink(_arg1:String, _arg2:Boolean, _arg3:String="", _arg4:String=""):String{
var _local5:String = ("http://" + domain);
_local5 = (_local5 + ("/" + moreLink));
if (useGoogleAnalitics){
_local5 = (_local5 + ("?utm_medium=brandedgames_" + (_arg2) ? "external" : "internal"));
_local5 = (_local5 + ("&utm_campaign=" + _arg1));
_arg3 = stripSubDomain(_arg3);
trace(_arg3);
if (_arg3 == "localhost"){
_arg3 = "offline_play";
};
_local5 = (_local5 + ("&utm_source=" + _arg3));
if (((!((_arg4 == ""))) && (!((_arg4 == null))))){
_local5 = (_local5 + ("&utm_content=" + _arg4));
};
};
return (_local5);
}
public function get backgroundColor():uint{
return (PortalGroup.backgroundColors[portalGroup]);
}
private function get utm_term():String{
return ("utm_term=");
}
public function importXML(_arg1:XMLNode):void{
}
public function getSendToFriendLink(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:String=""):String{
if (!hasSendToFriendLink){
return (getMoreGamesLink(_arg1, _arg3));
};
var _local5:String = ("http://" + domain);
_local5 = (_local5 + ((("/" + emailLink) + "/") + _arg2));
if (useGoogleAnalitics){
_local5 = (_local5 + ("?utm_medium=brandedgames_" + (_arg3) ? "external" : "internal"));
_local5 = (_local5 + ("&utm_campaign=" + _arg1));
_arg4 = stripSubDomain(_arg4);
if (_arg4 == "localhost"){
_arg4 = "offline_play";
};
_local5 = (_local5 + ("&utm_source=" + _arg4));
_local5 = (_local5 + "&utm_content=send_to_friend");
};
return (_local5);
}
private static function stripSubDomain(_arg1:String):String{
if (!_arg1){
return ("");
};
var _local2:Array = _arg1.split(".");
if (_local2.length <= 2){
return (_arg1);
};
_local2 = _local2.reverse();
if (topLevelDoubles.indexOf((((_local2[1] + ".") + _local2[0]) + ",")) > 0){
return (((((_local2[2] + ".") + _local2[1]) + ".") + _local2[0]));
};
return (((_local2[1] + ".") + _local2[0]));
}
}
}//package spill.localisation
Section 449
//BrandingLogo (spill.localisation.BrandingLogo)
package spill.localisation {
import flash.events.*;
import flash.display.*;
public class BrandingLogo extends MovieClip {
public function BrandingLogo(){
addFrameScript(0, frame1);
super();
stop();
mouseEnabled = false;
mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
if (stage){
added();
};
brandingChanged();
}
private function added(_arg1:Event=null):void{
SpilGame.addEventListener("brandingChanged", brandingChanged, false, 0, true);
brandingChanged();
}
private function brandingChanged(_arg1:Event=null):void{
if (SpilGame.currentBranding){
gotoAndStop(SpilGame.currentBranding.domain);
};
}
function frame1(){
stop();
}
private function removed(_arg1:Event):void{
SpilGame.removeEventListener("brandingChanged", brandingChanged);
}
}
}//package spill.localisation
Section 450
//Brandings (spill.localisation.Brandings)
package spill.localisation {
public class Brandings {
private static var brands_by_id:Object = new Object();
private static var brands_by_domain:Object = new Object();
public static function getBrandByID(_arg1:Number):Brand{
return (brands_by_id[_arg1]);
}
public static function getBrandsArray():Array{
var _local2:Brand;
var _local1:Array = new Array();
for each (_local2 in brands_by_domain) {
_local1.push(_local2);
};
return (_local1);
}
private static function addBrand(_arg1:Brand):Brand{
if (brands_by_domain[_arg1.domain]){
trace(("ERROR: Attempting to add duplicate brand by domain: " + _arg1.domain));
} else {
brands_by_domain[_arg1.domain] = _arg1;
};
if (brands_by_id[_arg1.site_id]){
trace(("ERROR: Attempting to add duplicate brand by id: " + _arg1.site_id));
} else {
brands_by_id[_arg1.site_id] = _arg1;
};
return (_arg1);
}
public static function initialize():void{
var _local1:Brand;
_local1 = new Brand();
_local1.site_id = 79;
_local1.domain = "www.agame.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.TWEEN;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 88;
_local1.domain = "www.gamesgames.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.FAMILY;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 90;
_local1.domain = "www.girlsgogames.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.GIRL;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 45;
_local1.domain = "www.a10.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.TEEN;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 92;
_local1.domain = "www.games.co.uk";
_local1.preferedLanguage = "en_uk";
_local1.portalGroup = PortalGroup.FAMILY;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 107;
_local1.domain = "www.mygames.co.uk";
_local1.preferedLanguage = "en_uk";
_local1.portalGroup = PortalGroup.TWEEN;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 102;
_local1.domain = "www.girlsgogames.co.uk";
_local1.preferedLanguage = "en_uk";
_local1.portalGroup = PortalGroup.GIRL;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 2;
_local1.domain = "www.game.com.cn";
_local1.moreLink = "moregames/";
_local1.preferedLanguage = "cn";
_local1.portalGroup = PortalGroup.NONE;
_local1.useGoogleAnalitics = false;
_local1.hasSendToFriendLink = false;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 25;
_local1.domain = "www.spel.nl";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "nl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 1;
_local1.domain = "www.spelletjes.nl";
_local1.emailLink = "spel";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "nl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 93;
_local1.domain = "www.girlsgogames.nl";
_local1.emailLink = "spel";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "nl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 12;
_local1.domain = "www.jeu.fr";
_local1.emailLink = "jeu";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "fr";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 95;
_local1.domain = "www.girlsgogames.fr";
_local1.emailLink = "jeu";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "fr";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 11;
_local1.domain = "www.jeux.fr";
_local1.emailLink = "jeu";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "fr";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 26;
_local1.domain = "www.spielen.com";
_local1.emailLink = "spiel";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "de";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 94;
_local1.domain = "www.girlsgogames.de";
_local1.emailLink = "spiel";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "de";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 5;
_local1.domain = "www.jetztspielen.de";
_local1.emailLink = "spiel";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "de";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 109;
_local1.domain = "www.minigry.pl";
_local1.emailLink = "gra";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "pl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 16;
_local1.domain = "www.gry.pl";
_local1.emailLink = "gra";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "pl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 98;
_local1.domain = "www.girlsgogames.pl";
_local1.emailLink = "gra";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "pl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 108;
_local1.domain = "www.spel.se";
_local1.emailLink = "spel_";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "se";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 100;
_local1.domain = "www.girlsgogames.se";
_local1.emailLink = "spel_";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "se";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 44;
_local1.domain = "www.spela.se";
_local1.emailLink = "spel_";
_local1.preferedLanguage = "se";
_local1.portalGroup = PortalGroup.FAMILY;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 106;
_local1.domain = "www.giocaregratis.it";
_local1.emailLink = "gioco";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "it";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 15;
_local1.domain = "www.gioco.it";
_local1.emailLink = "gioco";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "it";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 99;
_local1.domain = "www.girlsgogames.it";
_local1.emailLink = "gioco";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "it";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 97;
_local1.domain = "www.zapjuegos.com";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 86;
_local1.domain = "www.juegos.com";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 96;
_local1.domain = "www.juegosdechicas.com";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 122;
_local1.domain = "www.girlsgogames.es";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 91;
_local1.domain = "www.clickjogos.com";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "br";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 101;
_local1.domain = "www.girlsgogames.com.br";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "br";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 50;
_local1.domain = "www.ojogos.com.br";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "br";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 55;
_local1.domain = "www.games.co.id";
_local1.emailLink = "permainanme";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "id";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 105;
_local1.domain = "www.flashgames.ru";
_local1.emailLink = "igra";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "ru";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 104;
_local1.domain = "www.girlsgogames.ru";
_local1.emailLink = "igra";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "ru";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 103;
_local1.domain = "www.ourgames.ru";
_local1.emailLink = "igra";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "ru";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 24;
_local1.domain = "www.game.co.in";
_local1.emailLink = "game";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "in";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 87;
_local1.domain = "www.ojogos.pt";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "pt";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 120;
_local1.domain = "www.egames.jp";
_local1.emailLink = "game";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "jp";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 0;
_local1.domain = "gamedev.dev.spilgames.com";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = null;
addBrand(_local1);
}
public static function exportXML():XML{
var _local2:Brand;
var _local1:XML = <portals/>
;
for each (_local2 in brands_by_domain) {
_local1.appendChild(_local2.exportXML());
};
return (_local1);
}
public static function getBrandByDomain(_arg1:String):Brand{
return (brands_by_domain[_arg1]);
}
public static function hasDomain(_arg1:String):Boolean{
return (!((brands_by_domain[_arg1] == null)));
}
}
}//package spill.localisation
Section 451
//Language (spill.localisation.Language)
package spill.localisation {
import flash.xml.*;
public class Language {
public var portal_groups:Array;
public var references:Array;
public var name:String;
public var embedInputFonts:Boolean;// = true
public var id:uint;
public var forceFont:String;// = null
public var textLanguage:String;
public var bwcId:int;
public var embedFonts:Boolean;// = true
public var displayName:String;// = ""
public var dname:String;
public function Language(_arg1:String, _arg2:String=null){
references = [];
super();
name = _arg1;
dname = _arg2;
portal_groups = new Array();
}
public function exportXML():XMLNode{
var _local1:XMLNode = new XMLNode(1, "language");
_local1.attributes.name = name;
if (textLanguage != null){
_local1.attributes.textLanguage = textLanguage;
};
if (references.length){
_local1.attributes.references = references.toString();
};
_local1.attributes.id = bwcId;
var _local2:XMLNode = new XMLNode(1, "display_name");
_local2.firstChild = new XMLNode(3, displayName);
_local1.appendChild(_local2);
var _local3:Array = [];
var _local4:Array = PortalGroup.channelNames;
var _local5:int;
while (_local5 < _local4.length) {
_local3.push(Brandings.getBrandByDomain(portal_groups[_local5]).site_id);
_local5++;
};
_local1.attributes.channels = _local3.join(",");
return (_local1);
}
public function get p_teen():String{
return (portal_groups[PortalGroup.TEEN]);
}
public function set p_teen(_arg1:String):void{
portal_groups[PortalGroup.TEEN] = _arg1;
}
public function get p_tween():String{
return (portal_groups[PortalGroup.TWEEN]);
}
public function get p_family():String{
return (portal_groups[PortalGroup.FAMILY]);
}
public function get p_girl():String{
return (portal_groups[PortalGroup.GIRL]);
}
public function set p_girl(_arg1:String):void{
portal_groups[PortalGroup.GIRL] = _arg1;
}
public function get displayAcronim():String{
return ((dname) ? dname : name);
}
public function set p_family(_arg1:String):void{
portal_groups[PortalGroup.FAMILY] = _arg1;
}
public function set p_tween(_arg1:String):void{
portal_groups[PortalGroup.TWEEN] = _arg1;
}
}
}//package spill.localisation
Section 452
//Languages (spill.localisation.Languages)
package spill.localisation {
import flash.xml.*;
public class Languages {
public static var languages:Object = new Object();
private static var _init:Boolean = false;
public static function initialize():void{
var _local1:Language;
if (_init){
return;
};
_init = true;
_local1 = new Language("nl");
_local1.displayName = "Nederlands";
_local1.p_family = "www.spelletjes.nl";
_local1.p_tween = "www.spel.nl";
_local1.p_girl = "www.girlsgogames.nl";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 3;
addLanguage(_local1);
_local1 = new Language("es");
_local1.displayName = "Español";
_local1.p_family = "www.juegos.com";
_local1.p_tween = "www.zapjuegos.com";
_local1.p_girl = "www.girlsgogames.es";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 9;
addLanguage(_local1);
_local1 = new Language("pl");
_local1.displayName = "Polski";
_local1.p_family = "www.gry.pl";
_local1.p_tween = "www.minigry.pl";
_local1.p_girl = "www.girlsgogames.pl";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 6;
addLanguage(_local1);
_local1 = new Language("fr");
_local1.displayName = "Français";
_local1.p_family = "www.jeux.fr";
_local1.p_tween = "www.jeu.fr";
_local1.p_girl = "www.girlsgogames.fr";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 4;
addLanguage(_local1);
_local1 = new Language("en_us", "us");
_local1.displayName = "English (US)";
_local1.p_family = "www.gamesgames.com";
_local1.p_tween = "www.agame.com";
_local1.p_girl = "www.girlsgogames.com";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 1;
addLanguage(_local1);
addReference(_local1, "en");
_local1 = new Language("id");
_local1.displayName = "Bahasa Ind.";
_local1.p_family = "www.games.co.id";
_local1.p_tween = "www.games.co.id";
_local1.p_girl = "www.games.co.id";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 11;
addLanguage(_local1);
_local1 = new Language("ru");
_local1.displayName = "Русский язык";
_local1.p_family = "www.ourgames.ru";
_local1.p_tween = "www.flashgames.ru";
_local1.p_girl = "www.girlsgogames.ru";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 12;
addLanguage(_local1);
_local1 = new Language("se");
_local1.displayName = "Svenska";
_local1.p_family = "www.spela.se";
_local1.p_tween = "www.spel.se";
_local1.p_girl = "www.girlsgogames.se";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 7;
addLanguage(_local1);
addReference(_local1, "sv");
_local1 = new Language("it");
_local1.displayName = "Italiano";
_local1.p_family = "www.gioco.it";
_local1.p_tween = "www.giocaregratis.it";
_local1.p_girl = "www.girlsgogames.it";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 8;
addLanguage(_local1);
_local1 = new Language("en_uk", "uk");
_local1.displayName = "English (UK)";
_local1.p_family = "www.games.co.uk";
_local1.p_tween = "www.mygames.co.uk";
_local1.p_girl = "www.girlsgogames.co.uk";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 13;
addLanguage(_local1);
_local1 = new Language("cn");
_local1.displayName = "中文";
_local1.p_family = "www.game.com.cn";
_local1.p_tween = "www.game.com.cn";
_local1.p_girl = "www.game.com.cn";
_local1.p_teen = "www.game.com.cn";
_local1.bwcId = 2;
_local1.embedFonts = false;
_local1.embedInputFonts = false;
_local1.forceFont = "_sans";
addLanguage(_local1);
addReference(_local1, "zh-CN");
addReference(_local1, "zh-TW");
_local1 = new Language("pt");
_local1.displayName = "Português";
_local1.p_family = "www.ojogos.pt";
_local1.p_tween = "www.ojogos.pt";
_local1.p_girl = "www.ojogos.pt";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 17;
addLanguage(_local1);
_local1 = new Language("in");
_local1.displayName = "India";
_local1.p_family = "www.game.co.in";
_local1.p_tween = "www.game.co.in";
_local1.p_girl = "www.game.co.in";
_local1.p_teen = "www.a10.com";
_local1.textLanguage = "en_uk";
_local1.bwcId = 14;
addLanguage(_local1);
_local1 = new Language("de");
_local1.displayName = "Deutsch";
_local1.p_family = "www.jetztspielen.de";
_local1.p_tween = "www.spielen.com";
_local1.p_girl = "www.girlsgogames.de";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 5;
addLanguage(_local1);
_local1 = new Language("br");
_local1.displayName = "PortuguêsBR";
_local1.p_family = "www.ojogos.com.br";
_local1.p_tween = "www.clickjogos.com";
_local1.p_girl = "www.girlsgogames.com.br";
_local1.p_teen = "www.a10.com";
_local1.bwcId = 10;
addLanguage(_local1);
_local1 = new Language("jp");
_local1.displayName = "日本語";
_local1.p_family = "www.egames.jp";
_local1.p_tween = "www.egames.jp";
_local1.p_girl = "www.egames.jp";
_local1.p_teen = "www.a10.com";
_local1.embedFonts = true;
_local1.embedInputFonts = false;
_local1.forceFont = "MS UI Gothic";
_local1.bwcId = 19;
addLanguage(_local1);
addReference(_local1, "ja");
}
public static function exportXML():XMLNode{
var _local3:Language;
var _local1:Array = getLanguagesArray();
var _local2:XMLNode = new XMLNode(1, "languages");
for each (_local3 in _local1) {
_local2.appendChild(_local3.exportXML());
};
return (_local2);
}
public static function getLanguagesArray():Array{
var _local3:Language;
var _local1:Array = new Array();
var _local2:Object = new Object();
for each (_local3 in languages) {
if (!_local2[_local3.name]){
_local1.push(_local3);
_local2[_local3.name] = true;
};
};
return (_local1);
}
public static function getLanguage(_arg1:String):Language{
return (languages[_arg1]);
}
private static function addLanguage(_arg1:Language):void{
languages[_arg1.name] = _arg1;
}
private static function addReference(_arg1:Language, _arg2:String):void{
languages[_arg2] = _arg1;
_arg1.references.push(_arg2);
}
public static function getLanguageByOldID(_arg1:int):Language{
var _local2:Language;
for each (_local2 in languages) {
if (_local2.bwcId == _arg1){
return (_local2);
};
};
return (null);
}
}
}//package spill.localisation
Section 453
//LanguageSelectBox (spill.localisation.LanguageSelectBox)
package spill.localisation {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class LanguageSelectBox extends MovieClip {
private var flag:MovieClip;
private var languageName_text:TextField;
private var popup:MovieClip;
private var mc:MovieClip;
public function LanguageSelectBox(){
if (numChildren > 0){
removeChildAt(0);
};
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
Languages.initialize();
popup = new LanguageSelectPopup_mc();
x = Math.round(x);
y = Math.round(y);
popup.y = (-(Math.floor(popup.height)) + 1);
popup.visible = false;
addChild(popup);
mc = new LanguageSelectBox_mc();
addChild(mc);
flag = mc.flag;
languageName_text = mc.languageName_text;
if (stage){
added();
};
init();
languageChanged();
}
private function added(_arg1:Event=null):void{
SpilGame.addEventListener("languageChanged", languageChanged, false, 0, true);
}
private function mouseOut(_arg1:MouseEvent):void{
popup.visible = false;
}
public function set popupLocation(_arg1:String):void{
trace(("popupLocation = " + _arg1));
if (_arg1 == "bottom"){
popup.y = (Math.floor(mc.height) - 1);
} else {
popup.y = (-(Math.floor(popup.height)) + 1);
};
}
private function removed(_arg1:Event):void{
SpilGame.removeEventListener("languageChanged", languageChanged);
}
private function init():void{
var _local2:MovieClip;
var _local3:Language;
var _local1:int;
while (_local1 < popup.numChildren) {
_local2 = MovieClip(popup.getChildAt(_local1));
_local2.addEventListener(MouseEvent.CLICK, itemClicked, true, 0, true);
_local2.flag.gotoAndStop(_local2.name.substr(2));
_local2.flag.mouseEnabled = false;
_local2.text.mouseEnabled = false;
_local3 = Languages.getLanguage(_local2.name.substr(2));
if (_local3){
_local2.text.text = _local3.displayAcronim;
} else {
trace((("Error, '" + _local2.name.substr(2)) + "' language not found"));
};
_local1++;
};
}
private function itemClicked(_arg1:MouseEvent):void{
SpilGame.changeLanguage(_arg1.currentTarget.name.substr(2));
popup.visible = false;
}
private function mouseOver(_arg1:MouseEvent):void{
popup.visible = true;
}
private function languageChanged(_arg1:Event=null):void{
if (SpilGame.currentLanguage){
flag.gotoAndStop(SpilGame.currentLanguage.name);
languageName_text.text = SpilGame.currentLanguage.displayName;
languageName_text.embedFonts = SpilGame.currentLanguage.embedInputFonts;
};
}
}
}//package spill.localisation
Section 454
//LanguageSelectBox_mc (spill.localisation.LanguageSelectBox_mc)
package spill.localisation {
import flash.display.*;
import flash.text.*;
public dynamic class LanguageSelectBox_mc extends MovieClip {
public var languageName_text:TextField;
public var flag:MovieClip;
}
}//package spill.localisation
Section 455
//LanguageSelectPopup_mc (spill.localisation.LanguageSelectPopup_mc)
package spill.localisation {
import flash.display.*;
public dynamic class LanguageSelectPopup_mc extends MovieClip {
public var l_br:MovieClip;
public var l_se:MovieClip;
public var l_id:MovieClip;
public var l_in:MovieClip;
public var l_en_uk:MovieClip;
public var l_en_us:MovieClip;
public var l_es:MovieClip;
public var l_it:MovieClip;
public var l_cn:MovieClip;
public var l_pl:MovieClip;
public var l_nl:MovieClip;
public var l_de:MovieClip;
public var l_ru:MovieClip;
public var l_pt:MovieClip;
public var l_jp:MovieClip;
public var l_fr:MovieClip;
}
}//package spill.localisation
Section 456
//LocalizedTextField (spill.localisation.LocalizedTextField)
package spill.localisation {
import flash.events.*;
public class LocalizedTextField extends TextFieldFit {
private var regex:RegExp;
private var originalText:String;
public function LocalizedTextField(){
regex = /{([^{}]*)}/g;
super();
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
added();
}
private function added(_arg1:Event=null):void{
SpilGame.addEventListener("languageChanged", languageChanged, false, 0, true);
text = originalText;
}
private function replaceFn():String{
var _local2:String = SpilGame.getString(arguments[1]);
if (((!(_local2)) || ((_local2 == "")))){
return ((("{" + arguments[1]) + "}"));
};
return (_local2);
}
private function removed(_arg1:Event):void{
SpilGame.removeEventListener("languageChanged", languageChanged);
}
override public function set text(_arg1:String):void{
originalText = _arg1;
if ((_arg1 is String)){
super.text = _arg1.replace(regex, replaceFn);
} else {
super.text = "";
};
}
private function languageChanged(_arg1:Event):void{
text = originalText;
updateProperties();
}
}
}//package spill.localisation
Section 457
//PortalGroup (spill.localisation.PortalGroup)
package spill.localisation {
import flash.xml.*;
public class PortalGroup {
public static const FAMILY:uint = 0;
public static const channelNames:Array = ["family", "tween", "girl", "teen"];
public static const TWEEN:uint = 1;
public static const NONE:uint = 4;
public static const TEEN:uint = 3;
public static const GIRL:uint = 2;
public static const backgroundColors:Array = [0xFFFFFF, 0xFFFFFF, 16742331, 0xFFFFFF];
public static function getName(_arg1:int):String{
return (channelNames[_arg1]);
}
public static function exportXML():XMLNode{
var _local3:XMLNode;
var _local1:XMLNode = new XMLNode(1, "channels");
var _local2:int;
while (_local2 < 4) {
_local3 = new XMLNode(1, "channel");
_local3.attributes.name = channelNames[_local2];
_local3.attributes.id = _local2;
_local1.appendChild(_local3);
_local2++;
};
return (_local1);
}
}
}//package spill.localisation
Section 458
//spil_internal (spill.localisation.spil_internal)
package spill.localisation {
public namespace spil_internal = "spill.localisation";
}//package spill.localisation
Section 459
//SpilGame (spill.localisation.SpilGame)
package spill.localisation {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import flash.external.*;
public class SpilGame {
private static const cookiePath:String = "/";
private static const cookieLanguageVar:String = "savedLang";
public static const LANGUAGE_CHANGED:String = "languageChanged";
private static const cookieName:String = "spilgames_language_v100";
public static const BRANDING_CHANGED:String = "brandingChanged";
private static var strings:Object = new Object();
public static var currentBranding:Brand;
private static var contexMenuItem:ContextMenuItem;
spil_internal static var gameName:String;
spil_internal static var debugHostDomain:String = "";
private static var localDomains:Object = new Object();
spil_internal static var emailPage:String;
private static var channelLock:Boolean = false;
spil_internal static var debugEmbedDomain:String = "";
private static var eventDispatcher:EventDispatcher;
private static var _init:Boolean = false;
public static var currentLanguage:Language;
spil_internal static var portalGroup:uint;
public static function getSpilCompanyLink():String{
if (currentLanguage.name == "cn"){
return ("http://www.game.com.cn/downloads/");
};
return ("http://www.gameportal.net");
}
public static function getPromotionLink(_arg1:String="feature_promotion"):String{
var _local2:String = (embedDomain) ? embedDomain : hostingDomain;
return (currentBranding.getPromotionLink(gameName, emailPage, isExternal, _local2, _arg1));
}
public static function traceAllBrands():void{
trace(outputAllBrands());
}
public static function getString(_arg1:String):String{
var _local2:Object = strings[_arg1];
if (_local2){
if (currentLanguage.textLanguage){
return (_local2[currentLanguage.textLanguage]);
};
return (_local2[currentLanguage.name]);
//unresolved jump
};
return ("");
}
public static function initialize(_arg1:String, _arg2:int, _arg3:String, _arg4:Sprite, _arg5:Boolean=false):void{
if (_init){
trace("ERROR: LocalisationManager already initialised");
return;
};
_init = true;
localDomains["localhost"] = true;
localDomains["www8.agame.com"] = true;
localDomains["gamedev.dev.spilgames.com"] = true;
Brandings.initialize();
Languages.initialize();
initContexMenu(_arg4);
channelLock = _arg5;
gameName = _arg1.replace(" ", "_");
portalGroup = _arg2;
emailPage = _arg3;
chooseLanguage();
chooseBranding();
}
public static function get isExternal():Boolean{
return (((!(Brandings.hasDomain(embedDomain))) && (!(localDomains[embedDomain]))));
}
private static function initContexMenu(_arg1:Sprite):void{
contexMenuItem = new ContextMenuItem("");
_arg1.contextMenu = new ContextMenu();
_arg1.contextMenu.customItems.push(contexMenuItem);
contexMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contexMenuClicked);
}
private static function replaceFn():String{
var _local2:String = SpilGame.getString(arguments[1]);
if (((!(_local2)) || ((_local2 == "")))){
return ((("{" + arguments[1]) + "}"));
};
return (_local2);
}
public static function initTextField(_arg1:TextField):void{
var _local2:TextFormat;
trace(_arg1.text);
_arg1.text = _arg1.text.replace(/{([^{}]*)}/g, replaceFn);
trace(_arg1.text);
_arg1.embedFonts = currentLanguage.embedFonts;
if (currentLanguage.forceFont != ""){
_local2 = new TextFormat();
_local2.font = currentLanguage.forceFont;
_arg1.setTextFormat(_local2);
};
}
spil_internal static function get hostingDomain():String{
var _local1:LocalConnection;
if (debugHostDomain != ""){
return (debugHostDomain);
};
_local1 = new LocalConnection();
return (_local1.domain);
}
spil_internal static function chooseLanguage():void{
if (cookieLanguage != null){
currentLanguage = cookieLanguage;
} else {
if (isExternal){
currentLanguage = systemLanguage;
} else {
currentLanguage = portalLanguage;
if (!currentLanguage){
currentLanguage = systemLanguage;
};
};
};
if (!currentLanguage){
trace("Unable to determine language, using 'English US'");
currentLanguage = Languages.getLanguage("en_us");
};
TextFieldFit.embedFonts = currentLanguage.embedFonts;
TextFieldFit.forceFont = currentLanguage.forceFont;
dispatchEvent(new Event(LANGUAGE_CHANGED));
}
private static function contexMenuClicked(_arg1:ContextMenuEvent):void{
navigateToURL(new URLRequest(getMoreGamesLink("Contex_Menu")));
}
public static function importXMLv2(_arg1:XML):void{
var _local2:XML;
var _local3:Object;
var _local4:XML;
for each (_local2 in _arg1.children()) {
_local3 = (strings[_local2.attribute("identifier")] = new Object());
for each (_local4 in _local2.children()) {
if (_local4.children().length() > 0){
_local3[_local4.name()] = _local4.children()[0].toString();
} else {
_local3[_local4.name()] = "";
};
};
};
}
spil_internal static function changeLanguage(_arg1:String):void{
var _local2:Language = Languages.getLanguage(_arg1);
if (!_local2){
trace("ERROR: Supplied language string does not have a matching language");
} else {
cookieLanguage = _local2;
currentLanguage = _local2;
};
TextFieldFit.embedFonts = currentLanguage.embedFonts;
TextFieldFit.forceFont = currentLanguage.forceFont;
chooseBranding();
dispatchEvent(new Event(LANGUAGE_CHANGED));
}
public static function getSendToFriendLink():String{
return (currentBranding.getSendToFriendLink(gameName, emailPage, isExternal, embedDomain));
}
spil_internal static function chooseBranding():void{
var _local1:Brand;
var _local2:uint;
if (!isExternal){
_local1 = Brandings.getBrandByDomain(embedDomain);
if (_local1){
if (currentLanguage.name == _local1.preferedLanguage){
currentBranding = _local1;
} else {
_local2 = 0;
if ((((_local1.portalGroup == PortalGroup.NONE)) || (channelLock))){
_local2 = portalGroup;
} else {
_local2 = _local1.portalGroup;
};
currentBranding = Brandings.getBrandByDomain(currentLanguage.portal_groups[_local2]);
};
} else {
currentBranding = Brandings.getBrandByDomain(currentLanguage.portal_groups[portalGroup]);
};
} else {
currentBranding = Brandings.getBrandByDomain(currentLanguage.portal_groups[portalGroup]);
};
if ((!(currentBranding) is Brand)){
currentBranding = Brandings.getBrandByDomain("www.agame.com");
};
contexMenuItem.caption = ("More Games: " + currentBranding.domain);
dispatchEvent(new Event(BRANDING_CHANGED));
}
spil_internal static function get systemLanguage():Language{
return (Languages.getLanguage(Capabilities.language));
}
spil_internal static function set cookieLanguage(_arg1:Language):void{
var _local2:SharedObject = SharedObject.getLocal(cookieName, cookiePath);
if (_arg1 == null){
_local2.data[cookieLanguageVar] = null;
} else {
_local2.data[cookieLanguageVar] = _arg1.name;
};
_local2.flush();
}
public static function importXML(_arg1:XML):void{
var _local2:XML;
var _local3:Object;
var _local4:XML;
for each (_local2 in _arg1.children()) {
_local3 = (strings[_local2.identifier] = new Object());
for each (_local4 in _local2.children()) {
_local3[_local4.name()] = _local4.children()[0].toString();
};
};
}
spil_internal static function dispatchEvent(_arg1:Event):void{
if (!eventDispatcher){
eventDispatcher = new EventDispatcher();
};
eventDispatcher.dispatchEvent(_arg1);
}
private static function getDomain(_arg1:String):String{
var _local2:String;
var _local3:uint;
if (_arg1.indexOf("file") == 0){
return ("offline_play");
};
_local2 = new String();
_local3 = 7;
while (_local3 < _arg1.length) {
if (_arg1.charAt(_local3) == "/"){
break;
};
_local2 = (_local2 + _arg1.charAt(_local3));
_local3++;
};
if (_local2 == "localhost"){
_local2 = "offline_play";
};
return (_local2);
}
public static function exportXML():XML{
var _local1:XML = <spil_games/>
;
_local1.appendChild(Brandings.exportXML());
_local1.appendChild(Languages.exportXML());
_local1.appendChild(PortalGroup.exportXML());
return (_local1);
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (!eventDispatcher){
eventDispatcher = new EventDispatcher();
};
eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public static function outputAllBrands():String{
var _local3:Brand;
var _local1:Array = Brandings.getBrandsArray();
var _local2 = "";
for each (_local3 in _local1) {
_local2 = (_local2 + (_local3.getSendToFriendLink(gameName, emailPage, isExternal, embedDomain) + "\n"));
};
return (_local2);
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (!eventDispatcher){
eventDispatcher = new EventDispatcher();
};
eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public static function getMoreGamesLink(_arg1:String=""):String{
var _local2:String = (embedDomain) ? embedDomain : hostingDomain;
return (currentBranding.getMoreGamesLink(gameName, isExternal, _local2, _arg1));
}
spil_internal static function get cookieLanguage():Language{
var _local1:SharedObject = SharedObject.getLocal(cookieName, cookiePath);
var _local2:String = String(_local1.data[cookieLanguageVar]);
return (Languages.getLanguage(_local2));
}
private static function get portalLanguage():Language{
var _local1:Brand;
var _local2:String;
var _local3:Language;
if (isExternal){
return (null);
};
if (!embedDomain){
return (null);
};
_local1 = Brandings.getBrandByDomain(embedDomain);
if (!_local1){
return (null);
};
_local2 = _local1.preferedLanguage;
if (!_local2){
return (null);
};
_local3 = Languages.getLanguage(_local2);
if (!_local3){
return (null);
};
return (_local3);
}
spil_internal static function get embedDomain():String{
var loc:String;
if (debugEmbedDomain != ""){
return (debugEmbedDomain);
};
if (ExternalInterface.available){
try {
loc = ExternalInterface.call("window.location.href.toString");
if (((!((loc == ""))) && (!((loc == null))))){
trace(("embed domain = " + getDomain(loc)));
return (getDomain(loc));
};
} catch(e:SecurityError) {
trace(("Security Error connecting to external interface, error = " + e));
} catch(e:Error) {
trace(("Error connecting to external interface, error = " + e));
};
};
return (null);
}
}
}//package spill.localisation
Section 460
//SpilGamesLink (spill.localisation.SpilGamesLink)
package spill.localisation {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class SpilGamesLink extends SimpleButton {
public function SpilGamesLink(){
addEventListener(MouseEvent.CLICK, buttonClicked);
}
private function buttonClicked(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(SpilGame.getSpilCompanyLink()), "_blank");
}
}
}//package spill.localisation
Section 461
//TextFieldFit (spill.localisation.TextFieldFit)
package spill.localisation {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.filters.*;
public class TextFieldFit extends MovieClip {
protected var _glowQuality:Number;// = 1
protected var _gridFitType:String;// = "pixel"
protected var _text:String;// = "default"
private var debugBounding:Sprite;
protected var _disableWordwrap:Boolean;// = false
protected var _textSize:Number;// = 12
protected var _multiline:Boolean;// = false
protected var _font:String;// = ""
protected var _embedFonts:Boolean;// = true
protected var _underline:Boolean;// = false
protected var _vAlign:String;// = "top"
protected var _italic:Boolean;// = false
protected var _useGlowFilter:Boolean;// = false
protected var _glowColor:uint;// = 0
protected var _bold:Boolean;// = false
private var h:Number;
protected var _antiAliasType:String;// = "advanced"
private var sizeChanged:Boolean;// = true
private var w:Number;
private var embeddedFonts:Array;
protected var _hAlign:String;// = "left"
protected var _textColor:uint;// = 0
protected var _glowStrength:Number;// = 5
protected var _glowBlur:Number;// = 3
protected var _selectable:Boolean;// = false
private var format:TextFormat;
private var field:TextField;
private var valid:Boolean;// = true
private static const gutter:Number = 2;
spil_internal static var embedFonts:Boolean = true;
spil_internal static var forceAAType:String = null;
spil_internal static var forceFont:String = null;
public static var alwaysCheckWidth:Boolean = false;
public function TextFieldFit(){
var _local1:Boolean = ((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")));
var _local2:Number = width;
var _local3:Number = height;
if (numChildren > 0){
removeChildAt(0);
};
if (!field){
field = new TextField();
addChild(field);
};
field.border = false;
field.background = false;
field.type = TextFieldType.DYNAMIC;
mouseEnabled = false;
mouseChildren = false;
format = new TextFormat();
embeddedFonts = Font.enumerateFonts(false);
setSize(_local2, _local3);
validate();
if (stage){
addEventListener(Event.RENDER, init);
stage.invalidate();
};
init();
}
private function resizeText(_arg1:Boolean=false):void{
if (!doesTextFit()){
format.size = Object((Number(format.size) - 1));
if (format.size <= 3){
trace("WARNING: Text resised to 3px, either an error occured or the text just wont fit");
return;
};
field.setTextFormat(format);
resizeText(true);
} else {
if (_arg1 == false){
while (doesTextFit()) {
if (format.size <= textSize){
format.size = Object((Number(format.size) + 1));
field.setTextFormat(format);
if (!doesTextFit()){
format.size = Object((Number(format.size) - 1));
field.setTextFormat(format);
break;
};
} else {
break;
};
};
};
};
}
public function set hAlign(_arg1:String):void{
_hAlign = _arg1;
invalidate();
}
public function set bold(_arg1:Boolean):void{
_bold = _arg1;
invalidate();
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.RENDER, init);
updateProperties();
layoutText();
}
private function validate(_arg1:Event=null):void{
updateProperties();
layoutText();
removeEventListener(Event.ENTER_FRAME, validate);
valid = true;
}
public function set glowBlur(_arg1:Number):void{
_glowBlur = _arg1;
invalidate();
}
public function get vAlign():String{
return (_vAlign);
}
public function get italic():Boolean{
return (_italic);
}
public function get textColor():uint{
return (_textColor);
}
private function invalidate():void{
if (valid){
addEventListener(Event.ENTER_FRAME, validate);
if (stage){
stage.invalidate();
};
valid = false;
};
}
public function get text():String{
return (_text);
}
public function get useGlowFilter():Boolean{
return (_useGlowFilter);
}
public function get selectable():Boolean{
return (_selectable);
}
public function set text(_arg1:String):void{
_text = _arg1;
invalidate();
}
public function set embedFonts(_arg1:Boolean):void{
_embedFonts = _arg1;
invalidate();
}
public function set vAlign(_arg1:String):void{
_vAlign = _arg1;
invalidate();
}
public function set italic(_arg1:Boolean):void{
_italic = _arg1;
invalidate();
}
public function get font():String{
return (_font);
}
public function set multiline(_arg1:Boolean):void{
_multiline = _arg1;
invalidate();
}
public function get disableWordwrap():Boolean{
return (_disableWordwrap);
}
public function set textColor(_arg1:uint):void{
_textColor = _arg1;
invalidate();
}
public function get antiAliasType():String{
return (_antiAliasType);
}
private function layoutText():void{
resizeText();
field.height = (field.textHeight + (gutter * 2));
if (vAlign == "top"){
field.y = 0;
} else {
if (vAlign == "middle"){
field.y = ((h - field.height) / 2);
} else {
if (vAlign == "bottom"){
field.y = (h - field.height);
};
};
};
}
public function set glowQuality(_arg1:Number):void{
_glowQuality = _arg1;
invalidate();
}
public function get hAlign():String{
return (_hAlign);
}
public function setSize(_arg1:Number, _arg2:Number):void{
w = _arg1;
h = _arg2;
scaleX = (scaleY = 1);
field.width = w;
field.height = h;
invalidate();
}
public function get bold():Boolean{
return (_bold);
}
public function set gridFitType(_arg1:String):void{
_gridFitType = _arg1;
invalidate();
}
public function set underline(_arg1:Boolean):void{
_underline = _arg1;
invalidate();
}
public function get glowBlur():Number{
return (_glowBlur);
}
public function set useGlowFilter(_arg1:Boolean):void{
_useGlowFilter = _arg1;
invalidate();
}
public function set font(_arg1:String):void{
_font = _arg1;
invalidate();
}
public function set textSize(_arg1:Number):void{
_textSize = _arg1;
sizeChanged = true;
invalidate();
}
public function set selectable(_arg1:Boolean):void{
_selectable = _arg1;
invalidate();
}
public function get multiline():Boolean{
return (_multiline);
}
public function get embedFonts():Boolean{
return (_embedFonts);
}
public function set glowColor(_arg1:uint):void{
_glowColor = _arg1;
invalidate();
}
public function set disableWordwrap(_arg1:Boolean):void{
_disableWordwrap = _arg1;
invalidate();
}
public function get glowQuality():Number{
return (_glowQuality);
}
public function get gridFitType():String{
return (_gridFitType);
}
public function get underline():Boolean{
return (_underline);
}
public function get textSize():Number{
return (_textSize);
}
public function get glowColor():uint{
return (_glowColor);
}
public function set antiAliasType(_arg1:String):void{
_antiAliasType = _arg1;
invalidate();
}
public function set glowStrength(_arg1:Number):void{
_glowStrength = _arg1;
invalidate();
}
protected function updateProperties():void{
var _local1:Boolean;
var _local2:Font;
field.text = _text;
field.multiline = ((((_text.indexOf(" ") < 0)) && ((_text.length < 14)))) ? false : _multiline;
field.wordWrap = ((field.multiline) && (!(_disableWordwrap)));
field.selectable = _selectable;
field.antiAliasType = (forceAAType) ? forceAAType : _antiAliasType;
field.gridFitType = _gridFitType;
embeddedFonts = Font.enumerateFonts(false);
if (((((_embedFonts) && (!((_font == ""))))) && (TextFieldFit.embedFonts))){
_local1 = false;
for each (_local2 in embeddedFonts) {
if (_font == _local2.fontName){
_local1 = true;
break;
};
};
field.embedFonts = _local1;
if (!_local1){
trace(((("WARNING: Embedded font '" + _font) + "' not found, disabling embedding of fonts, text = ") + _text));
};
} else {
field.embedFonts = false;
};
if (TextFieldFit.forceFont){
format.font = TextFieldFit.forceFont;
} else {
if (_font != ""){
format.font = _font;
};
};
if (sizeChanged){
format.size = _textSize;
};
format.color = _textColor;
format.align = _hAlign;
format.bold = _bold;
format.italic = _italic;
format.underline = _underline;
format.leftMargin = 0;
format.rightMargin = 0;
field.setTextFormat(format);
if (_useGlowFilter){
filters = [new GlowFilter(_glowColor, 1, _glowBlur, _glowBlur, _glowStrength, _glowQuality)];
} else {
filters = [];
};
}
private function doesTextFit():Boolean{
if (((((field.textHeight + (gutter * 2)) > h)) || (((((field.textWidth + (gutter * 2)) > w)) && (((!(field.multiline)) || (alwaysCheckWidth))))))){
return (false);
};
return (true);
}
public function get glowStrength():Number{
return (_glowStrength);
}
}
}//package spill.localisation
Section 462
//spRoom (spill.physics.elements.spRoom)
package spill.physics.elements {
import spill.physics.*;
import spill.physics.shapes.*;
public class spRoom extends spElement {
public var ceiling:spShape;
public var width:Number;// = 32
public var height:Number;// = 24
public var rightWall:spShape;
public var leftWall:spShape;
public var thickness:Number;// = 2
public var x:Number;// = 0
public var y:Number;// = 0
public var floor:spShape;
public var roomBody:spBody;
public function spRoom(){
roomBody = new spBody();
addBody(roomBody);
useGlobalDensity = false;
density = 0;
}
override protected function initialize():void{
var _local1:Number = thickness;
leftWall = new spRectangle((_local1 / 2), ((height / 2) + _local1), (-(_local1) / 2), (height / 2));
roomBody.addShape(leftWall);
rightWall = new spRectangle((_local1 / 2), ((height / 2) + _local1), (width + (_local1 / 2)), (height / 2));
roomBody.addShape(rightWall);
floor = new spRectangle(((width / 2) + _local1), (_local1 / 2), (width / 2), (height + (_local1 / 2)));
roomBody.addShape(floor);
ceiling = new spRectangle(((width / 2) + _local1), (_local1 / 2), (width / 2), (-(_local1) / 2));
roomBody.addShape(ceiling);
}
}
}//package spill.physics.elements
Section 463
//spWorldEvent (spill.physics.events.spWorldEvent)
package spill.physics.events {
import flash.events.*;
import spill.physics.*;
public class spWorldEvent extends Event {
public var world:spWorld;
public var timeStep:Number;
public var element:spElement;
public static const BEFORE_STEP_PHYSICS:String = "beforeStepPhysics";
public static const AFTER_STEP_PHYSICS:String = "afterStepPhysics";
public static const ELEMENT_ADDED:String = "elementAdded";
public static const ELEMENT_REMOVED:String = "elementRemoved";
public function spWorldEvent(_arg1:String, _arg2:spWorld, _arg3:Number=0.033333, _arg4:spElement=null){
super(_arg1);
world = _arg2;
timeStep = _arg3;
element = _arg4;
}
}
}//package spill.physics.events
Section 464
//spRevoluteJoint (spill.physics.joints.spRevoluteJoint)
package spill.physics.joints {
import spill.physics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class spRevoluteJoint extends spJoint {
private var body1:spBody;
private var body2:spBody;
private var anchor:b2Vec2;
public function spRevoluteJoint(_arg1:spBody, _arg2:spBody, _arg3:b2Vec2){
def = new b2RevoluteJointDef();
def.userData = this;
body1 = _arg1;
body2 = _arg2;
anchor = _arg3;
}
public function set upperAngle(_arg1:Number):void{
def.upperAngle = _arg1;
}
public function set lowerAngle(_arg1:Number):void{
def.lowerAngle = _arg1;
}
public function get def():b2RevoluteJointDef{
return ((_def as b2RevoluteJointDef));
}
public function set def(_arg1:b2RevoluteJointDef):void{
_def = _arg1;
}
public function get lowerAngle():Number{
return (def.lowerAngle);
}
override protected function initialise(_arg1:spWorld):void{
def.Initialize(body1.ref, (body2) ? body2.ref : _arg1.ref.GetGroundBody(), anchor);
}
public function get upperAngle():Number{
return (def.upperAngle);
}
}
}//package spill.physics.joints
Section 465
//spCircle (spill.physics.shapes.spCircle)
package spill.physics.shapes {
import flash.display.*;
import spill.physics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class spCircle extends spShape {
public function spCircle(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0){
var _local4:b2CircleDef = new b2CircleDef();
_local4.radius = _arg1;
_local4.localPosition.Set(_arg2, _arg3);
super(_local4);
}
public function get radius():Number{
return (b2CircleDef(def).radius);
}
public function get localPosition():b2Vec2{
return (b2CircleDef(def).localPosition);
}
public function set localPosition(_arg1:b2Vec2):void{
b2CircleDef(def).localPosition = _arg1;
if (active){
$shapeChanged();
};
}
public function set radius(_arg1:Number):void{
b2CircleDef(def).radius = _arg1;
if (active){
$shapeChanged();
};
}
public function drawShape(_arg1:Sprite, _arg2:Number, _arg3:b2Vec2=null):void{
var _local4:b2Vec2;
_local4 = (_local4) ? _local4 : new b2Vec2();
_local4.Add(localPosition);
_arg1.graphics.drawCircle((_local4.x * _arg2), (_local4.y * _arg2), (radius * _arg2));
}
}
}//package spill.physics.shapes
Section 466
//spRectangle (spill.physics.shapes.spRectangle)
package spill.physics.shapes {
import flash.display.*;
import spill.physics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class spRectangle extends spShape {
private var _height:Number;// = 1
private var _width:Number;// = 1
public function spRectangle(_arg1:Number=1, _arg2:Number=1, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){
var _local6:b2PolygonDef = new b2PolygonDef();
var _local7:b2Vec2 = new b2Vec2();
_local7.Set(_arg3, _arg4);
_local6.SetAsOrientedBox(_arg1, _arg2, _local7, _arg5);
super(_local6);
}
public function drawShape(_arg1:Sprite, _arg2:Number, _arg3:b2Vec2=null):void{
_arg3 = (_arg3) ? _arg3 : new b2Vec2();
var _local4:Array = b2PolygonDef(def).vertices;
_arg1.graphics.moveTo((_local4[_local4.length].x + _arg3.x), (_local4[_local4.length].y + _arg3.y));
var _local5:int;
while (_local5 < _local4.length) {
_arg1.graphics.lineTo((_local4[_local5].x + _arg3.x), (_local4[_local5].y + _arg3.y));
_local5++;
};
}
}
}//package spill.physics.shapes
Section 467
//sp_internal (spill.physics.sp_internal)
package spill.physics {
public namespace sp_internal = "spill.physics";
}//package spill.physics
Section 468
//spBody (spill.physics.spBody)
package spill.physics {
import flash.events.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class spBody extends EventDispatcher {
public var name:String;// = ""
public var useParentLinearDamping:Boolean;
public var draggable:Boolean;// = true
private var _shapes:Array;
private var _world:spWorld;
public var useParentDensity:Boolean;
public var useParentRestitution:Boolean;
private var _filter:b2FilterData;
private var _angularVelocity:Number;// = 0
private var _active:Boolean;// = false
public var mouseForceMultiplier:Number;// = 1
private var _density:Number;// = 1
private var _restitution:Number;// = 0.5
private var _linearDamping:Number;// = 0.1
public var useParentAngularDamping:Boolean;
public var useParentFriction:Boolean;
private var _id:Number;// = 0
private var _linearVelocity:b2Vec2;
private var _def:b2BodyDef;
sp_internal var _parent:spElement;
private var _ref:b2Body;
private var _friction:Number;// = 0.5
private var _angularDamping:Number;// = 0.1
public var useParentFilter:Boolean;
private static var _idCounter:Number = 0;
public function spBody(){
useParentFriction = spSettings.inheritProps;
useParentRestitution = spSettings.inheritProps;
useParentDensity = spSettings.inheritProps;
useParentLinearDamping = spSettings.inheritProps;
useParentAngularDamping = spSettings.inheritProps;
useParentFilter = spSettings.inheritProps;
_shapes = new Array();
super();
_id = _idCounter++;
_def = new b2BodyDef();
_def.userData = this;
_linearVelocity = new b2Vec2();
_linearVelocity.Set(0, 0);
_filter = new b2FilterData();
}
public function addShape(_arg1:spShape):void{
if (_shapes.indexOf(_arg1) < 0){
_shapes.push(_arg1);
if (_active){
$addShape(_arg1);
_ref.SetMassFromShapes();
};
} else {
trace("WARNING: Attempted to add duplicate shape to body");
};
}
public function get def():b2BodyDef{
return (_def);
}
public function get active():Boolean{
return (_active);
}
public function set angularDamping(_arg1:Number):void{
_def.angularDamping = _arg1;
if (_active){
_ref.m_angularDamping = _arg1;
};
}
public function get linearDamping():Number{
return (_def.linearDamping);
}
public function set isBullet(_arg1:Boolean):void{
_def.isBullet = _arg1;
if (_active){
_ref.SetBullet(_arg1);
};
}
function $addToWorld(_arg1:spWorld):void{
var _local2:int;
if (!_active){
_world = _arg1;
_ref = _arg1.ref.CreateBody(def);
_active = true;
_local2 = 0;
while (_local2 < _shapes.length) {
$addShape(_shapes[_local2]);
_local2++;
};
_ref.SetMassFromShapes();
_ref.m_linearVelocity = _linearVelocity;
_ref.m_angularVelocity = _angularVelocity;
} else {
trace(("WARNING: attempted to add an already active body to world : " + this));
};
}
private function $addShape(_arg1:spShape):void{
$setShapeProps(_arg1);
_arg1.$addToBody(this);
}
public function get parent():spElement{
return (_parent);
}
public function get position():b2Vec2{
if (_active){
return (_ref.GetPosition());
};
return (_def.position);
}
private function $setShapeProps(_arg1:spShape):void{
if (_arg1.useParentDensity){
_arg1.density = _density;
};
if (_arg1.useParentFriction){
_arg1.friction = _friction;
};
if (_arg1.useParentRestitution){
_arg1.restitution = _restitution;
};
if (_arg1.useParentFilter){
_arg1.filter = _filter.Copy();
};
}
public function get id():Number{
return (_id);
}
public function set linearVelocity(_arg1:b2Vec2):void{
_linearVelocity = _arg1;
if (_active){
ref.m_linearVelocity = _arg1;
};
}
public function set angularVelocity(_arg1:Number):void{
_angularVelocity = _arg1;
if (_active){
_ref.m_angularVelocity = _arg1;
};
}
function $removeFromWorld(_arg1:spWorld):void{
var _local2:int;
if (_active){
_arg1.ref.DestroyBody(_ref);
_local2 = 0;
while (_local2 < _shapes.length) {
_shapes[_local2].$bodyDestroyed();
_local2++;
};
_def.position = _ref.GetPosition();
_def.angle = _ref.GetAngle();
_linearVelocity = _ref.GetLinearVelocity();
_angularVelocity = _ref.GetAngularVelocity();
_ref = null;
_active = false;
dispatchEvent(new Event("bodyDestroyed"));
} else {
trace(("WARNING: attempted to remove inactive body from world : " + this));
};
}
public function set angle(_arg1:Number):void{
var _local2:spWorld;
if (_active){
_local2 = _world;
$removeFromWorld(_local2);
_def.angle = _arg1;
$addToWorld(_local2);
} else {
_def.angle = _arg1;
};
}
public function get isBullet():Boolean{
return (_def.isBullet);
}
public function get linearVelocity():b2Vec2{
if (_active){
return (ref.m_linearVelocity);
};
return (_linearVelocity);
}
public function set density(_arg1:Number):void{
var _local2:spShape;
_density = _arg1;
if (_active){
for each (_local2 in _shapes) {
if (_local2.useParentDensity){
_local2.density = _arg1;
};
};
_ref.SetMassFromShapes();
};
}
public function get angle():Number{
if (_active){
return (_ref.GetAngle());
};
return (_def.angle);
}
public function get angularDamping():Number{
return (_def.angularDamping);
}
public function set restitution(_arg1:Number):void{
var _local2:spShape;
_restitution = _arg1;
if (_active){
for each (_local2 in _shapes) {
if (_local2.useParentRestitution){
_local2.restitution = _arg1;
};
};
};
}
public function set linearDamping(_arg1:Number):void{
_def.linearDamping = _arg1;
if (_active){
_ref.m_linearDamping = _arg1;
};
}
public function get angularVelocity():Number{
if (_active){
return (ref.m_angularVelocity);
};
return (_angularVelocity);
}
public function get ref():b2Body{
if (_active){
return (_ref);
};
trace(("WARNING: Attempted to access a reference of a non active body, " + this));
return (null);
}
public function get density():Number{
return (_density);
}
public function get restitution():Number{
return (_restitution);
}
public function getShapes():Array{
return (_shapes.concat());
}
public function set filter(_arg1:b2FilterData):void{
var _local2:spShape;
_filter = _arg1;
for each (_local2 in _shapes) {
if (_local2.useParentFilter){
_local2.filter = _arg1;
};
};
}
public function refilter():void{
var _local1:int;
if (_active){
_local1 = 0;
while (_local1 < _shapes.length) {
if (_shapes[_local1].useParentFilter){
_shapes[_local1].filter = filter;
};
_world.ref.Refilter(_shapes[_local1].ref);
_local1++;
};
};
}
public function get filter():b2FilterData{
return (_filter);
}
public function get friction():Number{
return (_friction);
}
public function set friction(_arg1:Number):void{
var _local2:spShape;
_friction = _arg1;
if (_active){
for each (_local2 in _shapes) {
if (_local2.useParentFriction){
_local2.friction = _arg1;
};
};
};
}
public function removeShape(_arg1:spShape):void{
_arg1.$removeFromBody(this);
_shapes.splice(_shapes.indexOf(_arg1), 1);
if (_active){
_ref.SetMassFromShapes();
};
}
public function set position(_arg1:b2Vec2):void{
var _local2:spWorld;
if (_active){
_local2 = _world;
$removeFromWorld(_local2);
_def.position = _arg1;
$addToWorld(_local2);
} else {
_def.position = _arg1;
};
}
}
}//package spill.physics
Section 469
//spCollisionListener (spill.physics.spCollisionListener)
package spill.physics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Dynamics.*;
public class spCollisionListener extends b2ContactListener {
public var minImpulse:Number;// = 50
override public function Add(_arg1:b2ContactPoint):void{
var _local2:spShape = spShape(_arg1.shape1.GetUserData());
var _local3:spShape = spShape(_arg1.shape2.GetUserData());
_local2.parent.parent.onAddContact(_arg1, _local2, _local3);
_local3.parent.parent.onAddContact(_arg1, _local3, _local2);
}
override public function Persist(_arg1:b2ContactPoint):void{
var _local2:spShape = spShape(_arg1.shape1.GetUserData());
var _local3:spShape = spShape(_arg1.shape2.GetUserData());
_local2.parent.parent.onPersistContact(_arg1, _local2, _local3);
_local3.parent.parent.onPersistContact(_arg1, _local3, _local2);
}
override public function Remove(_arg1:b2ContactPoint):void{
var _local2:spShape = spShape(_arg1.shape1.GetUserData());
var _local3:spShape = spShape(_arg1.shape2.GetUserData());
_local2.parent.parent.onRemoveContact(_arg1, _local2, _local3);
_local3.parent.parent.onRemoveContact(_arg1, _local3, _local2);
}
override public function Result(_arg1:b2ContactResult):void{
var _local2:spShape = spShape(_arg1.shape1.GetUserData());
var _local3:spShape = spShape(_arg1.shape2.GetUserData());
_local2.parent.parent.onResultContact(_arg1, _local2, _local3);
_local3.parent.parent.onResultContact(_arg1, _local3, _local2);
}
}
}//package spill.physics
Section 470
//spDestructionListener (spill.physics.spDestructionListener)
package spill.physics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Dynamics.Joints.*;
public class spDestructionListener extends b2DestructionListener {
override public function SayGoodbyeShape(_arg1:b2Shape):void{
}
override public function SayGoodbyeJoint(_arg1:b2Joint):void{
_arg1.GetUserData().$destroyed();
}
}
}//package spill.physics
Section 471
//spDisplay (spill.physics.spDisplay)
package spill.physics {
import flash.events.*;
import flash.display.*;
import Box2D.Dynamics.*;
import spill.physics.events.*;
public dynamic class spDisplay extends MovieClip {
public var drawScale:Number;// = 20
private var _debugDrawEnabled:Boolean;// = true
public var dbgDraw:b2DebugDraw;
public var world:spWorld;
public function spDisplay(_arg1:spWorld){
world = _arg1;
world.addEventListener("renderWorld", render, false, 0, true);
world.addEventListener(spWorldEvent.ELEMENT_ADDED, elementAdded, false, 0, true);
world.addEventListener(spWorldEvent.ELEMENT_REMOVED, elementRemoved, false, 0, true);
dbgDraw = new b2DebugDraw();
dbgDraw.m_sprite = this;
dbgDraw.m_drawScale = drawScale;
dbgDraw.m_fillAlpha = 0;
dbgDraw.m_lineThickness = 0.1;
dbgDraw.m_drawFlags = 3;
}
public function destroy():void{
world.removeEventListener("renderWorld", render, false);
world.removeEventListener(spWorldEvent.ELEMENT_ADDED, elementAdded, false);
world.removeEventListener(spWorldEvent.ELEMENT_REMOVED, elementRemoved, false);
world = null;
dbgDraw = null;
}
public function set debugLayer(_arg1:Sprite):void{
dbgDraw.m_sprite = _arg1;
}
public function get debugDrawEnabled():Boolean{
return (_debugDrawEnabled);
}
public function elementRemoved(_arg1:spWorldEvent):void{
_arg1.element.$removeFromDisplay(this);
}
public function set debugDrawEnabled(_arg1:Boolean):void{
_debugDrawEnabled = _arg1;
if (_arg1){
world.ref.SetDebugDraw(dbgDraw);
dbgDraw.m_drawScale = drawScale;
} else {
world.ref.SetDebugDraw(null);
dbgDraw.m_sprite.graphics.clear();
};
dbgDraw.m_sprite.visible = _arg1;
}
public function render(_arg1:Event):void{
dispatchEvent(new spWorldEvent("renderWorld", world, world.timeStep, null));
}
public function elementAdded(_arg1:spWorldEvent):void{
_arg1.element.$addToDisplay(this);
}
}
}//package spill.physics
Section 472
//spElement (spill.physics.spElement)
package spill.physics {
import flash.events.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.Shapes.*;
public class spElement extends EventDispatcher {
public var useGlobalRestitution:Boolean;
public var name:String;// = ""
private var _world:spWorld;
private var _initialized:Boolean;// = false
private var _filter:b2FilterData;
private var _linearDamping:Number;// = 0.1
public var useGlobalFriction:Boolean;
private var _active:Boolean;// = false
private var _density:Number;// = 1
private var _restitution:Number;// = 0.5
private var _id:int;
public var type:String;// = ""
public var useGlobalLinearDamping:Boolean;
private var _joints:Array;
private var _friction:Number;// = 0.5
private var _angularDamping:Number;// = 0.1
private var _numBodies:Number;// = 0
public var useGlobalAngularDamping:Boolean;
private var _bodies:Array;
public var useGlobalDensity:Boolean;
private static var _idCounter:int = 0;
public function spElement(){
useGlobalFriction = spSettings.inheritProps;
useGlobalRestitution = spSettings.inheritProps;
useGlobalDensity = spSettings.inheritProps;
useGlobalLinearDamping = spSettings.inheritProps;
useGlobalAngularDamping = spSettings.inheritProps;
_bodies = new Array();
_joints = new Array();
super();
_id = _idCounter++;
_filter = new b2FilterData();
}
public function get friction():Number{
return (_friction);
}
protected function stop():void{
}
public function set friction(_arg1:Number):void{
var _local2:spBody;
_friction = _arg1;
if (_active){
for each (_local2 in _bodies) {
if (_local2.useParentFriction){
_local2.friction = _arg1;
};
};
};
}
public function onAddContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
}
public function get active():Boolean{
return (_active);
}
public function set angularDamping(_arg1:Number):void{
var _local2:spBody;
_angularDamping = _arg1;
if (_active){
for each (_local2 in _bodies) {
if (_local2.useParentAngularDamping){
_local2.angularDamping = _arg1;
};
};
};
}
public function get world():spWorld{
return (_world);
}
protected function removeFromDisplay(_arg1:spDisplay):void{
}
final sp_internal function $addToWorld(_arg1:spWorld):void{
var _local2:int;
if (!_active){
_world = _arg1;
if (!_initialized){
initialize();
_initialized = false;
};
_local2 = 0;
while (_local2 < _bodies.length) {
$setBodyProps(_bodies[_local2]);
_bodies[_local2].$addToWorld(world);
_local2++;
};
_local2 = 0;
while (_local2 < _joints.length) {
_joints[_local2].$addToWorld(world);
_local2++;
};
_active = true;
addToWorld(_arg1);
} else {
trace(("WARNING: attempted to add an already active element to world : " + this));
};
}
public function get id():Number{
return (_id);
}
public function get linearDamping():Number{
return (_linearDamping);
}
protected function initialize():void{
}
public function mouseRelease(_arg1:spBody):void{
}
protected function addToDisplay(_arg1:spDisplay):void{
}
sp_internal function $stop():void{
stop();
}
public function getBodies():Object{
return (_bodies);
}
public function getJoints():Object{
return (_joints);
}
final sp_internal function $removeFromWorld(_arg1:spWorld):void{
var _local2:int;
if (_active){
_local2 = (_bodies.length - 1);
while (_local2 >= 0) {
_bodies[_local2].$removeFromWorld(_arg1);
_local2--;
};
_local2 = (_joints.length - 1);
while (_local2 >= 0) {
_joints[_local2].$removeFromWorld(_arg1);
_local2--;
};
_world = null;
_active = false;
removeFromWorld(_arg1);
} else {
trace(("WARNING: attempted to remove inactive element from world : " + this));
};
}
public function removeBody(_arg1:spBody):void{
if (_bodies.indexOf(_arg1) < 0){
trace((((("WARNING: attempted to remove body " + _arg1) + " from ") + this) + " that is not part of the Element"));
} else {
_numBodies--;
if (_active){
_arg1.$removeFromWorld(world);
};
_bodies.splice(_bodies.indexOf(_arg1), 1);
_arg1._parent = null;
};
}
public function get angularDamping():Number{
return (_angularDamping);
}
public function set linearDamping(_arg1:Number):void{
var _local2:spBody;
_linearDamping = _arg1;
if (_active){
for each (_local2 in _bodies) {
if (_local2.useParentLinearDamping){
_local2.linearDamping = _arg1;
};
};
};
}
sp_internal function $start():void{
start();
}
private function $setBodyProps(_arg1:spBody):void{
if (_arg1.useParentFriction){
_arg1.friction = _friction;
};
if (_arg1.useParentRestitution){
_arg1.restitution = _restitution;
};
if (_arg1.useParentDensity){
_arg1.density = _density;
};
if (_arg1.useParentLinearDamping){
_arg1.linearDamping = _linearDamping;
};
if (_arg1.useParentAngularDamping){
_arg1.angularDamping = _angularDamping;
};
if (_arg1.useParentFilter){
_arg1.filter = _filter.Copy();
};
}
sp_internal function $addToDisplay(_arg1:spDisplay):void{
addToDisplay(_arg1);
}
public function set density(_arg1:Number):void{
var _local2:spBody;
_density = _arg1;
if (_active){
for each (_local2 in _bodies) {
if (_local2.useParentDensity){
_local2.density = _arg1;
};
};
};
}
public function set restitution(_arg1:Number):void{
var _local2:spBody;
_restitution = _arg1;
if (_active){
for each (_local2 in _bodies) {
if (_local2.useParentRestitution){
_local2.restitution = _arg1;
};
};
};
}
public function onRemoveContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
}
protected function start():void{
}
public function addBody(_arg1:spBody):void{
if (_bodies.indexOf(_arg1) >= 0){
trace(((("WARNING: attempted to add a duplicate body " + _arg1) + " to ") + this));
} else {
_numBodies++;
_bodies.push(_arg1);
_arg1._parent = this;
$setBodyProps(_arg1);
if (_active){
_arg1.$addToWorld(world);
};
};
}
protected function removeFromWorld(_arg1:spWorld):void{
}
public function get density():Number{
return (_density);
}
public function addJoint(_arg1:spJoint):void{
_arg1._parent = this;
_joints.push(_arg1);
if (_active){
_arg1.$addToWorld(world);
};
}
public function refilter():void{
var _local1:int;
if (_active){
_local1 = 0;
while (_local1 < _bodies.length) {
if (_bodies[_local1].useParentFilter){
_bodies[_local1].filter = filter;
};
_bodies[_local1].refilter();
_local1++;
};
};
}
public function removeJoint(_arg1:spJoint):void{
_arg1._parent = null;
if (_joints.indexOf(_arg1) < 0){
trace((((("WARNING: attempted to remove joint " + _arg1) + " from ") + this) + " that is not part of the Element"));
} else {
_joints.splice(_joints.indexOf(_arg1), 1);
if (_active){
_arg1.$removeFromWorld(world);
};
};
}
sp_internal function $removeFromDisplay(_arg1:spDisplay):void{
removeFromDisplay(_arg1);
}
public function get restitution():Number{
return (_restitution);
}
public function onPersistContact(_arg1:b2ContactPoint, _arg2:spShape, _arg3:spShape):void{
}
public function get numBodies():Number{
return (_numBodies);
}
protected function addToWorld(_arg1:spWorld):void{
}
public function set filter(_arg1:b2FilterData):void{
var _local2:spBody;
_filter = _arg1;
for each (_local2 in _bodies) {
if (_local2.useParentFilter){
_local2.filter = _arg1;
};
};
}
public function onResultContact(_arg1:b2ContactResult, _arg2:spShape, _arg3:spShape):void{
}
public function mouseDrag(_arg1:spBody):void{
}
public function destroy():void{
var _local1:int = (_bodies.length - 1);
while (_local1 >= 0) {
removeBody(_bodies[_local1]);
_local1--;
};
_local1 = (_joints.length - 1);
while (_local1 >= 0) {
removeJoint(_joints[_local1]);
_local1--;
};
_bodies = new Array();
_joints = new Array();
}
public function get filter():b2FilterData{
return (_filter);
}
}
}//package spill.physics
Section 473
//spJoint (spill.physics.spJoint)
package spill.physics {
import Box2D.Dynamics.Joints.*;
public class spJoint {
private var _active:Boolean;// = false
protected var _def:b2JointDef;
sp_internal var _parent:spElement;
private var _ref:b2Joint;
protected var world:spWorld;
private var _id:Number;
private static var _idCounter:Number = 0;
public function spJoint():void{
_id = _idCounter++;
}
function $removeFromWorld(_arg1:spWorld):void{
if (_active){
_arg1.ref.DestroyJoint(_ref);
_active = false;
};
_parent = null;
removeFromWorld(_arg1);
}
function $addToWorld(_arg1:spWorld):void{
if (_active){
trace(("WARNING: attempted to add an already active joint to world : " + this));
} else {
world = _arg1;
_active = true;
initialise(world);
_def.userData = this;
_ref = world.ref.CreateJoint(_def);
addToWorld(world);
};
}
public function get id():Number{
return (_id);
}
public function get ref():b2Joint{
return (_ref);
}
protected function removeFromWorld(_arg1:spWorld):void{
}
public function get active():Boolean{
return (_active);
}
public function get parent():spElement{
return (_parent);
}
public function $destroyed():void{
_active = false;
if (_parent){
_parent.removeJoint(this);
};
}
protected function addToWorld(_arg1:spWorld):void{
}
protected function initialise(_arg1:spWorld):void{
}
}
}//package spill.physics
Section 474
//spMouseControl (spill.physics.spMouseControl)
package spill.physics {
import flash.events.*;
import flash.display.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Dynamics.Joints.*;
public class spMouseControl extends EventDispatcher {
protected var display:spDisplay;
protected var stage:Stage;
private var _enabled:Boolean;// = false
public var maxMouseForce:Number;// = 300
protected var mouseYWorldPhys:Number;
protected var world:spWorld;
private var mousePVec:b2Vec2;
protected var isDragging:Boolean;// = false
protected var mouseYWorld:Number;
protected var mouseXWorldPhys:Number;
protected var display_mc:Sprite;
protected var m_mouseJoint:b2MouseJoint;
public var maxMass:Number;// = 5
protected var mouseXWorld:Number;
public function spMouseControl(_arg1:spWorld, _arg2:spDisplay){
mousePVec = new b2Vec2();
super();
world = _arg1;
display = _arg2;
stage = display.stage;
enabled = true;
}
public function getBodyAtMouse(_arg1:Boolean=false, _arg2:Boolean=true):b2Body{
var _local9:b2Shape;
var _local10:Boolean;
mouseXWorldPhys = (display.mouseX / display.drawScale);
mouseYWorldPhys = (display.mouseY / display.drawScale);
mousePVec.Set(mouseXWorldPhys, mouseYWorldPhys);
var _local3:b2AABB = new b2AABB();
_local3.lowerBound.Set((mouseXWorldPhys - 0.001), (mouseYWorldPhys - 0.001));
_local3.upperBound.Set((mouseXWorldPhys + 0.001), (mouseYWorldPhys + 0.001));
var _local4 = 10;
var _local5:Array = new Array();
var _local6:int = world.ref.Query(_local3, _local5, _local4);
var _local7:b2Body;
var _local8:int;
while (_local8 < _local6) {
if ((((_local5[_local8].GetBody().IsStatic() == false)) || (_arg1))){
if (((_local5[_local8].GetBody().GetUserData().draggable) || (_arg2))){
_local9 = (_local5[_local8] as b2Shape);
_local10 = (_local5[_local8] as b2Shape).TestPoint(_local9.GetBody().GetXForm(), mousePVec);
if (_local10){
_local7 = _local9.GetBody();
break;
};
};
};
_local8++;
};
return (_local7);
}
public function get enabled():Boolean{
return (_enabled);
}
public function destroy():void{
enabled = false;
stage = null;
world = null;
display_mc = null;
display = null;
}
public function set enabled(_arg1:Boolean):void{
if (((!(_enabled)) && (_arg1))){
display.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, true, 0, true);
} else {
if (((((_enabled) && (!(_arg1)))) && (!(isDragging)))){
display.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown, true);
};
};
_enabled = _arg1;
if (((isDragging) && (!(_arg1)))){
disconnect();
};
}
protected function mouseMove(_arg1:MouseEvent=null):void{
var _local2:b2Vec2;
if (isDragging){
mouseXWorld = display.mouseX;
mouseYWorld = display.mouseY;
mouseXWorldPhys = (mouseXWorld / display.drawScale);
mouseYWorldPhys = (mouseYWorld / display.drawScale);
_local2 = new b2Vec2(mouseXWorldPhys, mouseYWorldPhys);
m_mouseJoint.SetTarget(_local2);
dispatchEvent(new Event("dragging"));
};
}
public function disconnect(_arg1:Event=null, _arg2:Boolean=false):void{
var _local3:spBody;
if (isDragging){
_local3 = spBody(m_mouseJoint.m_body2.GetUserData());
_local3.parent.mouseRelease(_local3);
if (!_arg2){
world.ref.DestroyJoint(m_mouseJoint);
};
m_mouseJoint.m_userData = null;
m_mouseJoint = null;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
isDragging = false;
dispatchEvent(new Event("stopDrag"));
};
}
protected function mouseDown(_arg1:MouseEvent):void{
var _local2:b2Body;
var _local3:b2MouseJointDef;
if (!isDragging){
_local2 = getBodyAtMouse(false, false);
if (_local2){
if (_local2.GetUserData().draggable){
_arg1.stopPropagation();
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
_local2.GetUserData().parent.mouseDrag(spBody(_local2.GetUserData()));
_local3 = new b2MouseJointDef();
_local3.frequencyHz = 1000;
_local3.dampingRatio = 0.5;
_local3.userData = this;
_local3.body1 = world.ref.GetGroundBody();
_local3.body2 = _local2;
_local3.target.Set(mouseXWorldPhys, mouseYWorldPhys);
_local3.maxForce = ((maxMouseForce * Math.min(_local2.GetMass(), maxMass)) * _local2.GetUserData().mouseForceMultiplier);
_local3.timeStep = world.timeStep;
m_mouseJoint = (world.ref.CreateJoint(_local3) as b2MouseJoint);
_local2.WakeUp();
isDragging = true;
dispatchEvent(new Event("startDrag"));
};
};
};
}
protected function mouseUp(_arg1:MouseEvent):void{
disconnect();
}
function $destroyed():void{
disconnect(null, true);
}
}
}//package spill.physics
Section 475
//spSettings (spill.physics.spSettings)
package spill.physics {
import flash.display.*;
public final class spSettings {
public static var inheritProps:Boolean = true;
public static function stopChildren(_arg1:Sprite):void{
var _local3:Sprite;
if ((_arg1 is MovieClip)){
MovieClip(_arg1).stop();
};
var _local2:int;
while (_local2 < _arg1.numChildren) {
if ((_arg1.getChildAt(_local2) is Sprite)){
_local3 = Sprite(_arg1.getChildAt(_local2));
if ((_local3 is MovieClip)){
MovieClip(_local3).stop();
};
stopChildren(_local3);
};
_local2++;
};
}
public static function playChildren(_arg1:MovieClip):void{
var _local3:MovieClip;
_arg1.play();
var _local2:int;
while (_local2 < _arg1.numChildren) {
if ((_arg1.getChildAt(_local2) is MovieClip)){
_local3 = MovieClip(_arg1.getChildAt(_local2));
_local3.play();
playChildren(_local3);
};
_local2++;
};
}
public static function playMovieClip(_arg1:MovieClip, _arg2:Number):void{
if (!_arg1.$_init){
_arg1.$_init = true;
_arg1.playheadPosition = _arg1.currentFrame;
_arg1.stop();
};
_arg1.playheadPosition = (_arg1.playheadPosition + (30 * _arg2));
if (_arg1.playheadPosition > _arg1.totalFrames){
_arg1.playheadPosition = (_arg1.playheadPosition - _arg1.totalFrames);
};
_arg1.gotoAndStop(Math.ceil(_arg1.playheadPosition));
}
}
}//package spill.physics
Section 476
//spShape (spill.physics.spShape)
package spill.physics {
import Box2D.Collision.Shapes.*;
public class spShape {
private var _def:b2ShapeDef;
private var _parent:spBody;
private var _ref:b2Shape;
public var useParentDensity:Boolean;
public var useParentRestitution:Boolean;
private var _filter:b2FilterData;
private var _friction:Number;// = 0.5
private var _active:Boolean;// = false
public var useParentFilter:Boolean;
private var _restitution:Number;// = 0.5
private var _density:Number;// = 1
public var useParentFriction:Boolean;
private var _id:Number;
private static var _idCounter:Number = 0;
public function spShape(_arg1:b2ShapeDef=null){
useParentFriction = spSettings.inheritProps;
useParentRestitution = spSettings.inheritProps;
useParentDensity = spSettings.inheritProps;
useParentFilter = spSettings.inheritProps;
super();
_id = _idCounter++;
if (_arg1 != null){
setDefinition(_arg1);
};
_filter = new b2FilterData();
}
function $bodyDestroyed():void{
_active = false;
_parent = null;
_ref = null;
}
public function set friction(_arg1:Number):void{
_def.friction = _arg1;
_friction = _arg1;
if (_active){
_ref.m_friction = _arg1;
};
}
public function get def():b2ShapeDef{
return (_def);
}
public function get active():Boolean{
return (_active);
}
public function set density(_arg1:Number):void{
_def.density = _arg1;
_density = _arg1;
if (_active){
_ref.m_density = _arg1;
};
}
public function get ref():b2Shape{
return (_ref);
}
public function setDefinition(_arg1:b2ShapeDef):void{
if (!_active){
_def = _arg1;
_def.userData = this;
} else {
trace("WARNING: Attempted to set shape definition of an already active shape");
};
}
function $addToBody(_arg1:spBody):void{
if (!_active){
if (_def != null){
_def.friction = _friction;
_def.restitution = _restitution;
_def.density = _density;
_def.filter = _filter;
_ref = _arg1.ref.CreateShape(_def);
_active = true;
_parent = _arg1;
} else {
trace("WARNING: Attempted to add shape without a definition to body.");
};
} else {
trace("WARNING: Attempted to add an already active shape to a body.");
};
}
public function set restitution(_arg1:Number):void{
_restitution = _arg1;
_def.restitution = _arg1;
if (_active){
_ref.m_restitution = _arg1;
};
}
public function get friction():Number{
return (_friction);
}
public function get id():Number{
return (_id);
}
public function get parent():spBody{
return (_parent);
}
public function get density():Number{
return (_density);
}
public function get restitution():Number{
return (_restitution);
}
protected function $shapeChanged():void{
var _local1:spBody;
if (_active){
_local1 = _parent;
$removeFromBody(_local1);
$addToBody(_local1);
_local1.ref.SetMassFromShapes();
};
}
public function get filter():b2FilterData{
return (_filter);
}
function $removeFromBody(_arg1:spBody):void{
if (_active){
_arg1.ref.DestroyShape(_ref);
_active = false;
_parent = null;
_ref = null;
} else {
trace("WARNING: Attempted to remove a non active shape from a body.");
};
}
public function set filter(_arg1:b2FilterData):void{
_def.filter = _arg1;
_filter = _arg1;
if (_active){
_ref.m_filter = _arg1;
};
}
}
}//package spill.physics
Section 477
//spWorld (spill.physics.spWorld)
package spill.physics {
import flash.events.*;
import flash.utils.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import spill.physics.events.*;
import Box2D.Dynamics.Joints.*;
public class spWorld extends EventDispatcher {
public var ref:b2World;
private var _globalAngularDamping:Number;// = 0
public var timeStep:Number;// = 0.0333333333333333
public var running:Boolean;// = false
public var calcTime:Number;// = 0
private var timer:Timer;
private var _globalDensity:Number;// = 1
private var _globalRestitution:Number;// = 0
public var display:spDisplay;
private var fpsCounter:Number;// = 0
public var worldScale:Number;// = 20
private var _globalFriction:Number;// = 0.5
private var calcCounter:Number;// = 0
public var frameRate:Number;// = 0
public var elements:Object;
private var _globalLinearDamping:Number;// = 0
public function spWorld():void{
elements = new Object();
super();
var _local1:b2AABB = new b2AABB();
_local1.lowerBound.Set(-100, -100);
_local1.upperBound.Set(100, 100);
ref = new b2World(_local1, new b2Vec2(0, 10), true);
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, fpsCounterEvent, false, 0, true);
ref.SetContactListener(new spCollisionListener());
ref.SetDestructionListener(new spDestructionListener());
}
public function destroy():void{
var _local1:spElement;
for each (_local1 in elements) {
_local1.destroy();
removeElement(_local1);
};
if (running){
stop();
};
timer.removeEventListener(TimerEvent.TIMER, fpsCounterEvent, false);
elements = null;
display = null;
ref = null;
timer = null;
}
public function stop():void{
var _local1:spElement;
if (running){
display.removeEventListener(Event.ENTER_FRAME, update);
running = false;
timer.stop();
for each (_local1 in elements) {
_local1.$stop();
};
} else {
trace("WARNING: Attempted to stop world that was not running.");
};
}
public function set globalLinearDamping(_arg1:Number):void{
var _local2:spElement;
_globalLinearDamping = _arg1;
for each (_local2 in elements) {
if (_local2.useGlobalLinearDamping){
_local2.linearDamping = _arg1;
};
};
}
public function set globalAngularDamping(_arg1:Number):void{
var _local2:spElement;
_globalAngularDamping = _arg1;
for each (_local2 in elements) {
if (_local2.useGlobalAngularDamping){
_local2.angularDamping = _arg1;
};
};
}
private function fpsCounterEvent(_arg1:TimerEvent):void{
frameRate = fpsCounter;
calcTime = Math.round((calcCounter / frameRate));
calcCounter = 0;
fpsCounter = 0;
}
public function set globalRestitution(_arg1:Number):void{
var _local2:spElement;
_globalRestitution = _arg1;
for each (_local2 in elements) {
if (_local2.useGlobalRestitution){
_local2.restitution = _arg1;
};
};
}
public function set globalDensity(_arg1:Number):void{
var _local2:spElement;
_globalDensity = _arg1;
for each (_local2 in elements) {
if (_local2.useGlobalDensity){
_local2.density = _arg1;
};
};
}
private function _setElementProps(_arg1:spElement):void{
if (_arg1.useGlobalFriction){
_arg1.friction = _globalFriction;
};
if (_arg1.useGlobalRestitution){
_arg1.restitution = _globalRestitution;
};
if (_arg1.useGlobalDensity){
_arg1.density = _globalDensity;
};
if (_arg1.useGlobalLinearDamping){
_arg1.linearDamping = _globalLinearDamping;
};
if (_arg1.useGlobalAngularDamping){
_arg1.angularDamping = _globalAngularDamping;
};
}
public function addElement(_arg1:spElement):void{
if (elements[_arg1.id] == null){
elements[_arg1.id] = _arg1;
_setElementProps(_arg1);
_arg1.$addToWorld(this);
dispatchEvent(new spWorldEvent("elementAdded", this, timeStep, _arg1));
} else {
trace(((("WARNING: attempted to add a duplicate element " + _arg1) + " to ") + this));
};
}
public function set gravity(_arg1:b2Vec2):void{
ref.m_gravity = _arg1;
}
public function get globalLinearDamping():Number{
return (_globalLinearDamping);
}
public function get globalFriction():Number{
return (_globalFriction);
}
public function testSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2=null, _arg4:Array=null):Number{
var _local8:b2Segment;
var _local9:Number;
var _local10:Array;
var _local11:int;
var _local12:b2Shape;
var _local13:b2XForm;
var _local14:b2Vec2;
var _local5:b2AABB = new b2AABB();
_local5.lowerBound.x = (Math.min(_arg1.x, _arg2.x) - 1E-5);
_local5.lowerBound.y = (Math.min(_arg1.y, _arg2.y) - 1E-5);
_local5.upperBound.x = (Math.max(_arg1.x, _arg2.x) + 1E-5);
_local5.upperBound.y = (Math.max(_arg1.y, _arg2.y) + 1E-5);
var _local6:Array = new Array();
var _local7:int = ref.Query(_local5, _local6, 20);
if (_local7 > 0){
if (!_arg3){
_arg3 = new b2Vec2();
};
if (!_arg4){
_arg4 = new Array();
};
_local8 = new b2Segment();
_local8.p1 = _arg1;
_local8.p2 = _arg2;
_local9 = 1;
_local10 = new Array();
_local11 = 0;
while (_local11 < _local6.length) {
_local12 = b2Shape(_local6[_local11]);
if (_local12.m_isSensor){
} else {
_local13 = _local12.GetBody().GetXForm();
_local14 = new b2Vec2();
if (_local12.TestSegment(_local13, _local10, _local14, _local8, 1)){
if (_local10[0] < _local9){
_local9 = _local10[0];
_arg4[0] = spShape(_local12.GetUserData());
_arg3.Set(_local14.x, _local14.y);
};
};
};
_local11++;
};
if (_local9 >= 1){
return (-1);
};
return (_local9);
};
return (-1);
}
public function get globalAngularDamping():Number{
return (_globalAngularDamping);
}
public function get globalRestitution():Number{
return (_globalRestitution);
}
public function get globalDensity():Number{
return (_globalDensity);
}
public function reset():void{
var _local1:spElement;
for each (_local1 in elements) {
removeElement(_local1);
};
}
private function update(_arg1:Event):void{
fpsCounter++;
var _local2:Number = getTimer();
dispatchEvent(new spWorldEvent("beforeStep", this, timeStep));
ref.Step(timeStep, 10);
dispatchEvent(new spWorldEvent("afterStep", this, timeStep));
dispatchEvent(new spWorldEvent("renderWorld", this, timeStep));
calcCounter = (calcCounter + (getTimer() - _local2));
}
public function get gravity():b2Vec2{
return (ref.m_gravity);
}
public function removeElement(_arg1:spElement):void{
if (elements[_arg1.id] != null){
delete elements[_arg1.id];
_arg1.$removeFromWorld(this);
dispatchEvent(new spWorldEvent("elementRemoved", this, timeStep, _arg1));
} else {
trace(((("WARNING: attempted to remove non existent element " + _arg1) + " from ") + this));
};
}
public function start():void{
var _local1:spElement;
if (!running){
display.addEventListener(Event.ENTER_FRAME, update, false, 0, true);
running = true;
timer.start();
for each (_local1 in elements) {
_local1.$start();
};
} else {
trace("WARNING: Attempted to start an already running world.");
};
}
public function getBodyAtPoint(_arg1:b2Vec2, _arg2:Boolean=false, _arg3:Boolean=true):b2Body{
var _local10:b2Shape;
var _local11:Boolean;
var _local4:b2AABB = new b2AABB();
_local4.lowerBound.Set((_arg1.x - 0.001), (_arg1.y - 0.001));
_local4.upperBound.Set((_arg1.x + 0.001), (_arg1.y + 0.001));
var _local5 = 10;
var _local6:Array = new Array();
var _local7:int = ref.Query(_local4, _local6, _local5);
var _local8:b2Body;
var _local9:int;
while (_local9 < _local7) {
if ((((_local6[_local9].GetBody().IsStatic() == false)) || (_arg2))){
if (((_local6[_local9].GetBody().GetUserData().draggable) || (_arg3))){
_local10 = (_local6[_local9] as b2Shape);
_local11 = (_local6[_local9] as b2Shape).TestPoint(_local10.GetBody().GetXForm(), _arg1);
if (_local11){
_local8 = _local10.GetBody();
break;
};
};
};
_local9++;
};
return (_local8);
}
public function getElements(_arg1:String=""):Object{
return (elements);
}
public function set globalFriction(_arg1:Number):void{
var _local2:spElement;
_globalFriction = _arg1;
for each (_local2 in elements) {
if (_local2.useGlobalFriction){
_local2.friction = _arg1;
};
};
}
}
}//package spill.physics
Section 478
//m_SpilAchievement (spill.m_SpilAchievement)
package spill {
public class m_SpilAchievement {
private var bGained:Boolean;
private var awardTag:String;
public function m_SpilAchievement(_arg1:String){
awardTag = _arg1;
bGained = false;
}
public function m_GetAwardTag():String{
return (awardTag);
}
public function m_isGained():Boolean{
return (bGained);
}
public function m_setGained():void{
bGained = true;
}
}
}//package spill
Section 479
//m_SpilAchievementManager (spill.m_SpilAchievementManager)
package spill {
public class m_SpilAchievementManager {
private var submitter:m_SpilSubmitter;
public var achievementList:Array;
public function m_SpilAchievementManager(){
achievementList = new Array();
init();
}
private function init():void{
achievementList.push(new m_SpilAchievement("Minefield"), new m_SpilAchievement("NoLimbs"), new m_SpilAchievement("StandingStrong"), new m_SpilAchievement("WhoNeedsSkin"), new m_SpilAchievement("Sadistic"));
}
public function m_setAlreadyAchievedAwards(_arg1:Array):void{
var _local2:int;
if (((achievementList) && (_arg1))){
if (achievementList.length == _arg1.length){
_local2 = 0;
while (_local2 < _arg1.length) {
if (_arg1[_local2] == true){
achievementList[_local2].m_setGained();
};
_local2++;
};
};
};
}
public function m_setSubmitter(_arg1:m_SpilSubmitter):void{
submitter = _arg1;
}
public function m_AchievementGained(_arg1:int):void{
trace(("Try granting is sub ready???: " + achievementList[_arg1].m_GetAwardTag()));
if (((((((((achievementList) && ((_arg1 < achievementList.length)))) && (!(achievementList[_arg1].m_isGained())))) && (submitter))) && (submitter.m_getHighScoreComp()))){
if (submitter.m_AchievementReadyToBeSend()){
trace(("Try granting definit: " + achievementList[_arg1].m_GetAwardTag()));
submitter.m_grantAchievement(this, achievementList[_arg1].m_GetAwardTag());
m_achievementGranted(achievementList[_arg1].m_GetAwardTag());
} else {
submitter.m_grantAchievement(this, achievementList[_arg1].m_GetAwardTag());
};
};
}
public function m_achievementGranted(_arg1:String):void{
trace(("Granted: " + _arg1));
var _local2:int;
while (_local2 < achievementList.length) {
if (achievementList[_local2].m_GetAwardTag() == _arg1){
achievementList[_local2].m_setGained();
};
_local2++;
};
}
public function m_getSaveList():Array{
var _local2:int;
var _local1:Array = new Array();
if (achievementList){
_local2 = 0;
while (_local2 < achievementList.length) {
_local1.push(achievementList[_local2].m_isGained());
_local2++;
};
};
return (_local1);
}
}
}//package spill
Section 480
//m_SpilSubmitter (spill.m_SpilSubmitter)
package spill {
import flash.events.*;
import flash.display.*;
import Spill.Components.*;
public class m_SpilSubmitter extends Sprite {
private var O11O:Submitter;
private var bSubmitterActive:Boolean;// = false
private var bAchievementCallReady:Boolean;// = false
private var main;
private var achievementManager;
public function m_SpilSubmitter(_arg1){
main = _arg1;
O11O = new Submitter();
O11O.addEventListener(Event.COMPLETE, SubmiterComponentInitialized);
O11O.addEventListener("LoadingFailed", FailedToLoadSubmitter);
O11O._O0000Ol01(_arg1, "Flakboy", "Flakboy.html", 0, "normal", "", 0, 0, 1, true);
}
public function eventHandlerScore(_arg1:Event):void{
if (_arg1.currentTarget.OO00OO1l1l.O0l00l0O0 != null){
};
}
public function eventHandlerAchiev(_arg1:Event):void{
var _local2:String;
if (_arg1.currentTarget.OO00OO1l1l.O1OlOO00O != null){
if (achievementManager){
if (_arg1.type == "AchievLoadInfoComplete"){
_local2 = _arg1.currentTarget.OO00OO1l1l.O1OlOO00O["resultset"]["result"]["tag"];
achievementManager.m_achievementGranted(_local2);
bAchievementCallReady = true;
achievementManager = null;
} else {
if (_arg1.type == "AchievLoadGrantComplete"){
O11O._OOlOOOll1(_arg1.currentTarget.OO00OO1l1l.O1OlOO00O["awardid"]);
};
};
};
};
if (_arg1.type == "AchievLoadError"){
bAchievementCallReady = true;
achievementManager = null;
};
}
public function m_grantAchievement(_arg1, _arg2:String):void{
if (bSubmitterActive){
achievementManager = _arg1;
O11O._O00OOl1Ol(_arg2);
bAchievementCallReady = false;
};
}
public function m_SubmitScore(_arg1:Object):void{
if (bSubmitterActive){
O11O._O01lOO10O(_arg1);
};
}
private function FailedToLoadSubmitter(_arg1:Event):void{
O11O.removeEventListener(Event.COMPLETE, SubmiterComponentInitialized);
O11O.removeEventListener("LoadingFailed", FailedToLoadSubmitter);
bSubmitterActive = false;
O11O = null;
}
public function m_AchievementReadyToBeSend():Boolean{
return (bAchievementCallReady);
}
public function m_destroy():void{
if (O11O){
if (O11O.hasEventListener("ScoreLoadError")){
O11O.removeEventListener("ScoreLoadError", eventHandlerScore);
};
if (O11O.hasEventListener("ScoreLoadTimeComplete")){
O11O.removeEventListener("ScoreLoadTimeComplete", eventHandlerScore);
};
if (O11O.hasEventListener("ScoreLoadSubmitComplete")){
O11O.removeEventListener("ScoreLoadSubmitComplete", eventHandlerScore);
};
if (O11O.hasEventListener("ScoreLoadListComplete")){
O11O.removeEventListener("ScoreLoadListComplete", eventHandlerScore);
};
if (O11O.hasEventListener("AchievLoadError")){
O11O.removeEventListener("AchievLoadError", eventHandlerAchiev);
};
if (O11O.hasEventListener("AchievLoadTimeComplete")){
O11O.removeEventListener("AchievLoadTimeComplete", eventHandlerAchiev);
};
if (O11O.hasEventListener("AchievLoadListComplete")){
O11O.removeEventListener("AchievLoadListComplete", eventHandlerAchiev);
};
if (O11O.hasEventListener("AchievLoadInfoComplete")){
O11O.removeEventListener("AchievLoadInfoComplete", eventHandlerAchiev);
};
if (O11O.hasEventListener("AchievLoadGrantComplete")){
O11O.removeEventListener("AchievLoadGrantComplete", eventHandlerAchiev);
};
O11O.destroy();
};
O11O = null;
}
public function m_getHighScoreComp():Submitter{
return (O11O);
}
private function SubmiterComponentInitialized(_arg1:Event):void{
O11O.removeEventListener(Event.COMPLETE, SubmiterComponentInitialized);
O11O.removeEventListener("LoadingFailed", FailedToLoadSubmitter);
O11O.addEventListener("ScoreLoadError", eventHandlerScore);
O11O.addEventListener("ScoreLoadTimeComplete", eventHandlerScore);
O11O.addEventListener("ScoreLoadSubmitComplete", eventHandlerScore);
O11O.addEventListener("ScoreLoadListComplete", eventHandlerScore);
O11O.addEventListener("AchievLoadError", eventHandlerAchiev);
O11O.addEventListener("AchievLoadTimeComplete", eventHandlerAchiev);
O11O.addEventListener("AchievLoadListComplete", eventHandlerAchiev);
O11O.addEventListener("AchievLoadInfoComplete", eventHandlerAchiev);
O11O.addEventListener("AchievLoadGrantComplete", eventHandlerAchiev);
bAchievementCallReady = true;
bSubmitterActive = true;
}
}
}//package spill
Section 481
//Submitter (Spill.Components.Submitter)
package Spill.Components {
import flash.display.*;
public dynamic class Submitter extends MovieClip {
}
}//package Spill.Components
Section 482
//AchievementsButton_133 (ui_fla.AchievementsButton_133)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class AchievementsButton_133 extends MovieClip {
public var __id1_:LocalizedTextField;
public function AchievementsButton_133(){
__setProp___id1__AchievementsButton_TextField_0();
}
function __setProp___id1__AchievementsButton_TextField_0(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.text = "{Achievements}";
__id1_.textColor = 0xFFFFFF;
__id1_.textSize = 28;
__id1_.bold = false;
__id1_.embedFonts = true;
__id1_.font = "Myriad Pro Light";
__id1_.hAlign = "left";
__id1_.multiline = false;
__id1_.vAlign = "middle";
__id1_.antiAliasType = "normal";
__id1_.glowBlur = 2;
__id1_.glowColor = 0;
__id1_.useGlowFilter = false;
__id1_.glowQuality = 1;
__id1_.glowStrength = 1;
__id1_.gridFitType = "pixel";
__id1_.italic = false;
__id1_.selectable = false;
__id1_.underline = false;
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 483
//AchievementsButton2_74 (ui_fla.AchievementsButton2_74)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class AchievementsButton2_74 extends MovieClip {
public var __id38_:LocalizedTextField;
public function AchievementsButton2_74(){
__setProp___id38__AchievementsButton2_Text_0();
}
function __setProp___id38__AchievementsButton2_Text_0(){
try {
__id38_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id38_.text = "{Achievements}";
__id38_.textColor = 0xFFFFFF;
__id38_.textSize = 24;
__id38_.bold = false;
__id38_.embedFonts = true;
__id38_.font = "Myriad Pro";
__id38_.hAlign = "center";
__id38_.multiline = false;
__id38_.vAlign = "middle";
__id38_.antiAliasType = "advanced";
__id38_.glowBlur = 3;
__id38_.glowColor = 0;
__id38_.useGlowFilter = false;
__id38_.glowQuality = 1;
__id38_.glowStrength = 5;
__id38_.gridFitType = "pixel";
__id38_.italic = false;
__id38_.selectable = false;
__id38_.underline = false;
try {
__id38_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 484
//BackButton_18 (ui_fla.BackButton_18)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BackButton_18 extends MovieClip {
public var __setPropDict:Dictionary;
public var __id53_:LocalizedTextField;
public function BackButton_18(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28, 28, frame29, 29, frame30);
}
function frame30(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame11(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame12(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame13(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame14(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function __setProp___id53__BackButton_Text_0(){
try {
__id53_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id53_.text = "{Back}";
__id53_.textColor = 0xFFFFFF;
__id53_.textSize = 18;
__id53_.bold = false;
__id53_.embedFonts = true;
__id53_.font = "Myriad Pro";
__id53_.hAlign = "left";
__id53_.multiline = false;
__id53_.vAlign = "top";
__id53_.antiAliasType = "advanced";
__id53_.glowBlur = 3;
__id53_.glowColor = 0;
__id53_.useGlowFilter = false;
__id53_.glowQuality = 1;
__id53_.glowStrength = 5;
__id53_.gridFitType = "pixel";
__id53_.italic = false;
__id53_.selectable = false;
__id53_.underline = false;
try {
__id53_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame16(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame10(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame18(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame19(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame15(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame17(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function __setProp___id53__BackButton_Text_10(){
try {
__id53_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id53_.text = "{Back}";
__id53_.textColor = 0xFFFFFF;
__id53_.textSize = 18;
__id53_.bold = false;
__id53_.embedFonts = true;
__id53_.font = "Myriad Pro";
__id53_.hAlign = "left";
__id53_.multiline = false;
__id53_.vAlign = "top";
__id53_.antiAliasType = "advanced";
__id53_.glowBlur = 3;
__id53_.glowColor = 0;
__id53_.useGlowFilter = false;
__id53_.glowQuality = 1;
__id53_.glowStrength = 5;
__id53_.gridFitType = "pixel";
__id53_.italic = false;
__id53_.selectable = false;
__id53_.underline = true;
try {
__id53_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame1(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame2(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame3(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame4(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame5(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame6(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame7(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame8(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame9(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 1)) && ((int(__setPropDict[__id53_]) <= 10))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_0();
};
}
function frame23(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame24(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame25(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame26(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame20(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame21(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame22(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame27(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame28(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
function frame29(){
if ((((__setPropDict[__id53_] == undefined)) || (!((((int(__setPropDict[__id53_]) >= 11)) && ((int(__setPropDict[__id53_]) <= 30))))))){
__setPropDict[__id53_] = currentFrame;
__setProp___id53__BackButton_Text_10();
};
}
}
}//package ui_fla
Section 485
//BackToMainButton1_71 (ui_fla.BackToMainButton1_71)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BackToMainButton1_71 extends MovieClip {
public var __id41_:LocalizedTextField;
public function BackToMainButton1_71(){
__setProp___id41__BackToMainButton1_Text_0();
}
function __setProp___id41__BackToMainButton1_Text_0(){
try {
__id41_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id41_.text = "{Back_To_Main}";
__id41_.textColor = 0xFFFFFF;
__id41_.textSize = 24;
__id41_.bold = false;
__id41_.embedFonts = true;
__id41_.font = "Myriad Pro";
__id41_.hAlign = "center";
__id41_.multiline = false;
__id41_.vAlign = "middle";
__id41_.antiAliasType = "advanced";
__id41_.glowBlur = 3;
__id41_.glowColor = 0;
__id41_.useGlowFilter = false;
__id41_.glowQuality = 1;
__id41_.glowStrength = 5;
__id41_.gridFitType = "pixel";
__id41_.italic = false;
__id41_.selectable = false;
__id41_.underline = false;
try {
__id41_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 486
//BackToMainButton2_95 (ui_fla.BackToMainButton2_95)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BackToMainButton2_95 extends MovieClip {
public var __id24_:LocalizedTextField;
public var __setPropDict:Dictionary;
public function BackToMainButton2_95(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28, 28, frame29, 29, frame30);
}
function frame30(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame10(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame11(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame12(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function __setProp___id24__BackToMainButton2_Text_0(){
try {
__id24_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id24_.text = "{Back_To_Main}";
__id24_.textColor = 0xFFFFFF;
__id24_.textSize = 18;
__id24_.bold = false;
__id24_.embedFonts = true;
__id24_.font = "Myriad Pro";
__id24_.hAlign = "left";
__id24_.multiline = false;
__id24_.vAlign = "top";
__id24_.antiAliasType = "advanced";
__id24_.glowBlur = 3;
__id24_.glowColor = 0;
__id24_.useGlowFilter = false;
__id24_.glowQuality = 1;
__id24_.glowStrength = 5;
__id24_.gridFitType = "pixel";
__id24_.italic = false;
__id24_.selectable = false;
__id24_.underline = false;
try {
__id24_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame14(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame15(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame16(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame17(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame18(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame19(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame13(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function __setProp___id24__BackToMainButton2_Text_10(){
try {
__id24_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id24_.text = "{Back_To_Main}";
__id24_.textColor = 0xFFFFFF;
__id24_.textSize = 18;
__id24_.bold = false;
__id24_.embedFonts = true;
__id24_.font = "Myriad Pro";
__id24_.hAlign = "left";
__id24_.multiline = false;
__id24_.vAlign = "top";
__id24_.antiAliasType = "advanced";
__id24_.glowBlur = 3;
__id24_.glowColor = 0;
__id24_.useGlowFilter = false;
__id24_.glowQuality = 1;
__id24_.glowStrength = 5;
__id24_.gridFitType = "pixel";
__id24_.italic = false;
__id24_.selectable = false;
__id24_.underline = true;
try {
__id24_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame1(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame2(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame3(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame4(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame5(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame6(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame7(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame8(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame9(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 1)) && ((int(__setPropDict[__id24_]) <= 10))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_0();
};
}
function frame22(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame23(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame24(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame25(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame26(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame20(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame21(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame29(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame27(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
function frame28(){
if ((((__setPropDict[__id24_] == undefined)) || (!((((int(__setPropDict[__id24_]) >= 11)) && ((int(__setPropDict[__id24_]) <= 30))))))){
__setPropDict[__id24_] = currentFrame;
__setProp___id24__BackToMainButton2_Text_10();
};
}
}
}//package ui_fla
Section 487
//ContinueButton_62 (ui_fla.ContinueButton_62)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class ContinueButton_62 extends MovieClip {
public var __id47_:LocalizedTextField;
public function ContinueButton_62(){
__setProp___id47__ContinueButton_Text_0();
}
function __setProp___id47__ContinueButton_Text_0(){
try {
__id47_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id47_.text = "{Continue}";
__id47_.textColor = 0xFFFFFF;
__id47_.textSize = 16;
__id47_.bold = false;
__id47_.embedFonts = true;
__id47_.font = "Myriad Pro";
__id47_.hAlign = "center";
__id47_.multiline = false;
__id47_.vAlign = "middle";
__id47_.antiAliasType = "advanced";
__id47_.glowBlur = 3;
__id47_.glowColor = 0;
__id47_.useGlowFilter = false;
__id47_.glowQuality = 1;
__id47_.glowStrength = 5;
__id47_.gridFitType = "pixel";
__id47_.italic = false;
__id47_.selectable = false;
__id47_.underline = false;
try {
__id47_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 488
//CopyToClipboardButton_85 (ui_fla.CopyToClipboardButton_85)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class CopyToClipboardButton_85 extends MovieClip {
public var __id30_:LocalizedTextField;
public function CopyToClipboardButton_85(){
__setProp___id30__CopyToClipboardButton_Text_0();
}
function __setProp___id30__CopyToClipboardButton_Text_0(){
try {
__id30_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id30_.text = "{Copy}";
__id30_.textColor = 0xFFFFFF;
__id30_.textSize = 16;
__id30_.bold = false;
__id30_.embedFonts = true;
__id30_.font = "Myriad Pro";
__id30_.hAlign = "center";
__id30_.multiline = false;
__id30_.vAlign = "middle";
__id30_.antiAliasType = "advanced";
__id30_.glowBlur = 3;
__id30_.glowColor = 0;
__id30_.useGlowFilter = false;
__id30_.glowQuality = 1;
__id30_.glowStrength = 5;
__id30_.gridFitType = "pixel";
__id30_.italic = false;
__id30_.selectable = false;
__id30_.underline = false;
try {
__id30_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 489
//flag_icon_138 (ui_fla.flag_icon_138)
package ui_fla {
import flash.display.*;
public dynamic class flag_icon_138 extends MovieClip {
public function flag_icon_138(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ui_fla
Section 490
//Game_Rescricted_89 (ui_fla.Game_Rescricted_89)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Game_Rescricted_89 extends MovieClip {
public var __id27_:LocalizedTextField;
public function Game_Rescricted_89(){
__setProp___id27__Game_Rescricted_Layer1_0();
}
function __setProp___id27__Game_Rescricted_Layer1_0(){
try {
__id27_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id27_.text = "{Game_Restricted_Message}";
__id27_.textColor = 0xFFFFFF;
__id27_.textSize = 20;
__id27_.bold = true;
__id27_.embedFonts = true;
__id27_.font = "Myriad Pro";
__id27_.hAlign = "center";
__id27_.multiline = false;
__id27_.vAlign = "top";
__id27_.antiAliasType = "advanced";
__id27_.glowBlur = 3;
__id27_.glowColor = 0;
__id27_.useGlowFilter = false;
__id27_.glowQuality = 1;
__id27_.glowStrength = 5;
__id27_.gridFitType = "pixel";
__id27_.italic = false;
__id27_.selectable = false;
__id27_.underline = false;
try {
__id27_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 491
//HighScoresButton_131 (ui_fla.HighScoresButton_131)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class HighScoresButton_131 extends MovieClip {
public var __id2_:LocalizedTextField;
public function HighScoresButton_131(){
__setProp___id2__HighScoresButton_TextField_0();
}
function __setProp___id2__HighScoresButton_TextField_0(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.text = "{play_for_highscores_and_achievements}";
__id2_.textColor = 0xFFFFFF;
__id2_.textSize = 28;
__id2_.bold = false;
__id2_.embedFonts = true;
__id2_.font = "Myriad Pro Light";
__id2_.hAlign = "left";
__id2_.multiline = false;
__id2_.vAlign = "middle";
__id2_.antiAliasType = "normal";
__id2_.glowBlur = 2;
__id2_.glowColor = 0;
__id2_.useGlowFilter = false;
__id2_.glowQuality = 1;
__id2_.glowStrength = 1;
__id2_.gridFitType = "pixel";
__id2_.italic = false;
__id2_.selectable = false;
__id2_.underline = false;
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 492
//LevelFailedTextmc_10 (ui_fla.LevelFailedTextmc_10)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LevelFailedTextmc_10 extends MovieClip {
public var __id55_:LocalizedTextField;
public function LevelFailedTextmc_10(){
__setProp___id55__LevelFailedTextmc_Text_0();
}
function __setProp___id55__LevelFailedTextmc_Text_0(){
try {
__id55_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id55_.text = "{Level_Failed}";
__id55_.textColor = 15822392;
__id55_.textSize = 40;
__id55_.bold = true;
__id55_.embedFonts = true;
__id55_.font = "Myriad Pro Light";
__id55_.hAlign = "center";
__id55_.multiline = false;
__id55_.vAlign = "middle";
__id55_.antiAliasType = "advanced";
__id55_.glowBlur = 4;
__id55_.glowColor = 0;
__id55_.useGlowFilter = true;
__id55_.glowQuality = 1;
__id55_.glowStrength = 5;
__id55_.gridFitType = "pixel";
__id55_.italic = false;
__id55_.selectable = false;
__id55_.underline = false;
try {
__id55_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 493
//LevelSelectionButton_73 (ui_fla.LevelSelectionButton_73)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LevelSelectionButton_73 extends MovieClip {
public var __id39_:LocalizedTextField;
public function LevelSelectionButton_73(){
__setProp___id39__LevelSelectionButton_Text_0();
}
function __setProp___id39__LevelSelectionButton_Text_0(){
try {
__id39_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id39_.text = "{Select_Level}";
__id39_.textColor = 0xFFFFFF;
__id39_.textSize = 24;
__id39_.bold = false;
__id39_.embedFonts = true;
__id39_.font = "Myriad Pro";
__id39_.hAlign = "center";
__id39_.multiline = false;
__id39_.vAlign = "middle";
__id39_.antiAliasType = "advanced";
__id39_.glowBlur = 3;
__id39_.glowColor = 0;
__id39_.useGlowFilter = false;
__id39_.glowQuality = 1;
__id39_.glowStrength = 5;
__id39_.gridFitType = "pixel";
__id39_.italic = false;
__id39_.selectable = false;
__id39_.underline = false;
try {
__id39_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 494
//NextLevelButton_108 (ui_fla.NextLevelButton_108)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class NextLevelButton_108 extends MovieClip {
public var text:LocalizedTextField;
public function NextLevelButton_108(){
__setProp_text_NextLevelButton_Text_0();
}
function __setProp_text_NextLevelButton_Text_0(){
try {
text["componentInspectorSetting"] = true;
} catch(e:Error) {
};
text.text = "{Next_Level}";
text.textColor = 0xFFFFFF;
text.textSize = 24;
text.bold = false;
text.embedFonts = true;
text.font = "Myriad Pro";
text.hAlign = "center";
text.multiline = false;
text.vAlign = "middle";
text.antiAliasType = "advanced";
text.glowBlur = 3;
text.glowColor = 0;
text.useGlowFilter = false;
text.glowQuality = 1;
text.glowStrength = 5;
text.gridFitType = "pixel";
text.italic = false;
text.selectable = false;
text.underline = false;
try {
text["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 495
//PlayAgainButton_77 (ui_fla.PlayAgainButton_77)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class PlayAgainButton_77 extends MovieClip {
public var __id36_:LocalizedTextField;
public function PlayAgainButton_77(){
__setProp___id36__PlayAgainButton_Text_0();
}
function __setProp___id36__PlayAgainButton_Text_0(){
try {
__id36_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id36_.text = "{Replay}";
__id36_.textColor = 0xFFFFFF;
__id36_.textSize = 24;
__id36_.bold = false;
__id36_.embedFonts = true;
__id36_.font = "Myriad Pro";
__id36_.hAlign = "center";
__id36_.multiline = false;
__id36_.vAlign = "middle";
__id36_.antiAliasType = "advanced";
__id36_.glowBlur = 3;
__id36_.glowColor = 0;
__id36_.useGlowFilter = false;
__id36_.glowQuality = 1;
__id36_.glowStrength = 5;
__id36_.gridFitType = "pixel";
__id36_.italic = false;
__id36_.selectable = false;
__id36_.underline = false;
try {
__id36_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 496
//PlayWithGoreButton_3 (ui_fla.PlayWithGoreButton_3)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class PlayWithGoreButton_3 extends MovieClip {
public var __id57_:LocalizedTextField;
public function PlayWithGoreButton_3(){
__setProp___id57__PlayWithGoreButton_Text_0();
}
function __setProp___id57__PlayWithGoreButton_Text_0(){
try {
__id57_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id57_.text = "{Play_With_Gore}";
__id57_.textColor = 0xFFFFFF;
__id57_.textSize = 24;
__id57_.bold = false;
__id57_.embedFonts = true;
__id57_.font = "Myriad Pro";
__id57_.hAlign = "center";
__id57_.multiline = false;
__id57_.vAlign = "middle";
__id57_.antiAliasType = "advanced";
__id57_.glowBlur = 3;
__id57_.glowColor = 0;
__id57_.useGlowFilter = false;
__id57_.glowQuality = 1;
__id57_.glowStrength = 5;
__id57_.gridFitType = "pixel";
__id57_.italic = false;
__id57_.selectable = false;
__id57_.underline = false;
try {
__id57_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 497
//PlayWithoutGoreButton_8 (ui_fla.PlayWithoutGoreButton_8)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class PlayWithoutGoreButton_8 extends MovieClip {
public var __id56_:LocalizedTextField;
public function PlayWithoutGoreButton_8(){
__setProp___id56__PlayWithoutGoreButton_Text_0();
}
function __setProp___id56__PlayWithoutGoreButton_Text_0(){
try {
__id56_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id56_.text = "{Play_Without_Gore}";
__id56_.textColor = 0xFFFFFF;
__id56_.textSize = 24;
__id56_.bold = false;
__id56_.embedFonts = true;
__id56_.font = "Myriad Pro";
__id56_.hAlign = "center";
__id56_.multiline = false;
__id56_.vAlign = "middle";
__id56_.antiAliasType = "advanced";
__id56_.glowBlur = 3;
__id56_.glowColor = 0;
__id56_.useGlowFilter = false;
__id56_.glowQuality = 1;
__id56_.glowStrength = 5;
__id56_.gridFitType = "pixel";
__id56_.italic = false;
__id56_.selectable = false;
__id56_.underline = false;
try {
__id56_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 498
//PlayYourself_78 (ui_fla.PlayYourself_78)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class PlayYourself_78 extends MovieClip {
public var __id35_:LocalizedTextField;
public function PlayYourself_78(){
__setProp___id35__PlayYourself_Text_0();
}
function __setProp___id35__PlayYourself_Text_0(){
try {
__id35_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id35_.text = "{Play_Yourself}";
__id35_.textColor = 0xFFFFFF;
__id35_.textSize = 24;
__id35_.bold = false;
__id35_.embedFonts = true;
__id35_.font = "Myriad Pro";
__id35_.hAlign = "center";
__id35_.multiline = false;
__id35_.vAlign = "middle";
__id35_.antiAliasType = "advanced";
__id35_.glowBlur = 3;
__id35_.glowColor = 0;
__id35_.useGlowFilter = false;
__id35_.glowQuality = 1;
__id35_.glowStrength = 5;
__id35_.gridFitType = "pixel";
__id35_.italic = false;
__id35_.selectable = false;
__id35_.underline = false;
try {
__id35_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 499
//SendToFriendButton_72 (ui_fla.SendToFriendButton_72)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SendToFriendButton_72 extends MovieClip {
public var __id40_:LocalizedTextField;
public function SendToFriendButton_72(){
__setProp___id40__SendToFriendButton_Text_0();
}
function __setProp___id40__SendToFriendButton_Text_0(){
try {
__id40_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id40_.text = "{Send_To_Friend}";
__id40_.textColor = 0xFFFFFF;
__id40_.textSize = 24;
__id40_.bold = false;
__id40_.embedFonts = true;
__id40_.font = "Myriad Pro";
__id40_.hAlign = "center";
__id40_.multiline = false;
__id40_.vAlign = "middle";
__id40_.antiAliasType = "advanced";
__id40_.glowBlur = 3;
__id40_.glowColor = 0;
__id40_.useGlowFilter = false;
__id40_.glowQuality = 1;
__id40_.glowStrength = 5;
__id40_.gridFitType = "pixel";
__id40_.italic = false;
__id40_.selectable = false;
__id40_.underline = false;
try {
__id40_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 500
//StartGameButton_128 (ui_fla.StartGameButton_128)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class StartGameButton_128 extends MovieClip {
public var __id3_:LocalizedTextField;
public function StartGameButton_128(){
__setProp___id3__StartGameButton_TextField_0();
}
function __setProp___id3__StartGameButton_TextField_0(){
try {
__id3_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id3_.text = "{Select_Level}";
__id3_.textColor = 0xFFFFFF;
__id3_.textSize = 28;
__id3_.bold = false;
__id3_.embedFonts = true;
__id3_.font = "Myriad Pro Light";
__id3_.hAlign = "left";
__id3_.multiline = false;
__id3_.vAlign = "middle";
__id3_.antiAliasType = "normal";
__id3_.glowBlur = 2;
__id3_.glowColor = 0;
__id3_.useGlowFilter = false;
__id3_.glowQuality = 1;
__id3_.glowStrength = 1;
__id3_.gridFitType = "pixel";
__id3_.italic = false;
__id3_.selectable = false;
__id3_.underline = false;
try {
__id3_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 501
//StartPlaybackButton_83 (ui_fla.StartPlaybackButton_83)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class StartPlaybackButton_83 extends MovieClip {
public var __id34_:LocalizedTextField;
public function StartPlaybackButton_83(){
__setProp___id34__StartPlaybackButton_Text_0();
}
function __setProp___id34__StartPlaybackButton_Text_0(){
try {
__id34_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id34_.text = "{Click_To_Play}";
__id34_.textColor = 0xFFFFFF;
__id34_.textSize = 24;
__id34_.bold = false;
__id34_.embedFonts = true;
__id34_.font = "Myriad Pro";
__id34_.hAlign = "center";
__id34_.multiline = false;
__id34_.vAlign = "middle";
__id34_.antiAliasType = "advanced";
__id34_.glowBlur = 3;
__id34_.glowColor = 0;
__id34_.useGlowFilter = false;
__id34_.glowQuality = 1;
__id34_.glowStrength = 5;
__id34_.gridFitType = "pixel";
__id34_.italic = false;
__id34_.selectable = false;
__id34_.underline = false;
try {
__id34_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 502
//StopButton_124 (ui_fla.StopButton_124)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class StopButton_124 extends MovieClip {
public var stop_txt:LocalizedTextField;
public function StopButton_124(){
__setProp_stop_txt_StopButton_Text_0();
}
function __setProp_stop_txt_StopButton_Text_0(){
try {
stop_txt["componentInspectorSetting"] = true;
} catch(e:Error) {
};
stop_txt.text = "{STOP}";
stop_txt.textColor = 0xFFFFFF;
stop_txt.textSize = 18;
stop_txt.bold = false;
stop_txt.embedFonts = true;
stop_txt.font = "Myriad Pro Light";
stop_txt.hAlign = "center";
stop_txt.multiline = false;
stop_txt.vAlign = "middle";
stop_txt.antiAliasType = "advanced";
stop_txt.glowBlur = 3;
stop_txt.glowColor = 0;
stop_txt.useGlowFilter = false;
stop_txt.glowQuality = 1;
stop_txt.glowStrength = 5;
stop_txt.gridFitType = "pixel";
stop_txt.italic = false;
stop_txt.selectable = false;
stop_txt.underline = false;
try {
stop_txt["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 503
//SubmitScoreButton_60 (ui_fla.SubmitScoreButton_60)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SubmitScoreButton_60 extends MovieClip {
public var __id49_:LocalizedTextField;
public function SubmitScoreButton_60(){
__setProp___id49__SubmitScoreButton_Text_0();
}
function __setProp___id49__SubmitScoreButton_Text_0(){
try {
__id49_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id49_.text = "{Submit}";
__id49_.textColor = 0xFFFFFF;
__id49_.textSize = 16;
__id49_.bold = false;
__id49_.embedFonts = true;
__id49_.font = "Myriad Pro";
__id49_.hAlign = "center";
__id49_.multiline = false;
__id49_.vAlign = "middle";
__id49_.antiAliasType = "advanced";
__id49_.glowBlur = 3;
__id49_.glowColor = 0;
__id49_.useGlowFilter = false;
__id49_.glowQuality = 1;
__id49_.glowStrength = 5;
__id49_.gridFitType = "pixel";
__id49_.italic = false;
__id49_.selectable = false;
__id49_.underline = false;
try {
__id49_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 504
//SubmitScoreButton2_65 (ui_fla.SubmitScoreButton2_65)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SubmitScoreButton2_65 extends MovieClip {
public var __id45_:LocalizedTextField;
public function SubmitScoreButton2_65(){
__setProp___id45__SubmitScoreButton2_Text_0();
}
function __setProp___id45__SubmitScoreButton2_Text_0(){
try {
__id45_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id45_.text = "{Submit_Score}";
__id45_.textColor = 0xFFFFFF;
__id45_.textSize = 24;
__id45_.bold = false;
__id45_.embedFonts = true;
__id45_.font = "Myriad Pro";
__id45_.hAlign = "center";
__id45_.multiline = false;
__id45_.vAlign = "middle";
__id45_.antiAliasType = "advanced";
__id45_.glowBlur = 3;
__id45_.glowColor = 0;
__id45_.useGlowFilter = false;
__id45_.glowQuality = 1;
__id45_.glowStrength = 5;
__id45_.gridFitType = "pixel";
__id45_.italic = false;
__id45_.selectable = false;
__id45_.underline = false;
try {
__id45_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 505
//TryAgainButton_94 (ui_fla.TryAgainButton_94)
package ui_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import spill.localisation.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class TryAgainButton_94 extends MovieClip {
public var __id25_:LocalizedTextField;
public function TryAgainButton_94(){
__setProp___id25__TryAgainButton_Text_0();
}
function __setProp___id25__TryAgainButton_Text_0(){
try {
__id25_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id25_.text = "{Retry}";
__id25_.textColor = 0xFFFFFF;
__id25_.textSize = 24;
__id25_.bold = false;
__id25_.embedFonts = true;
__id25_.font = "Myriad Pro";
__id25_.hAlign = "center";
__id25_.multiline = false;
__id25_.vAlign = "middle";
__id25_.antiAliasType = "advanced";
__id25_.glowBlur = 3;
__id25_.glowColor = 0;
__id25_.useGlowFilter = false;
__id25_.glowQuality = 1;
__id25_.glowStrength = 5;
__id25_.gridFitType = "pixel";
__id25_.italic = false;
__id25_.selectable = false;
__id25_.underline = false;
try {
__id25_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package ui_fla
Section 506
//spikes_121 (weapons_fla.spikes_121)
package weapons_fla {
import flash.display.*;
public dynamic class spikes_121 extends MovieClip {
public function spikes_121(){
addFrameScript(0, frame1, 2, frame3);
}
function frame1(){
stop();
}
function frame3(){
stop();
}
}
}//package weapons_fla
Section 507
//spikes2_84 (weapons_fla.spikes2_84)
package weapons_fla {
import flash.display.*;
public dynamic class spikes2_84 extends MovieClip {
public function spikes2_84(){
addFrameScript(0, frame1, 2, frame3);
}
function frame1(){
stop();
}
function frame3(){
stop();
}
}
}//package weapons_fla
Section 508
//spikes3_137 (weapons_fla.spikes3_137)
package weapons_fla {
import flash.display.*;
public dynamic class spikes3_137 extends MovieClip {
public function spikes3_137(){
addFrameScript(0, frame1, 2, frame3);
}
function frame1(){
stop();
}
function frame3(){
stop();
}
}
}//package weapons_fla
Section 509
//CheckBox_disabledIcon (CheckBox_disabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_disabledIcon extends MovieClip {
}
}//package
Section 510
//CheckBox_downIcon (CheckBox_downIcon)
package {
import flash.display.*;
public dynamic class CheckBox_downIcon extends MovieClip {
}
}//package
Section 511
//CheckBox_overIcon (CheckBox_overIcon)
package {
import flash.display.*;
public dynamic class CheckBox_overIcon extends MovieClip {
}
}//package
Section 512
//CheckBox_selectedDisabledIcon (CheckBox_selectedDisabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDisabledIcon extends MovieClip {
}
}//package
Section 513
//CheckBox_selectedDownIcon (CheckBox_selectedDownIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDownIcon extends MovieClip {
}
}//package
Section 514
//CheckBox_selectedOverIcon (CheckBox_selectedOverIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedOverIcon extends MovieClip {
}
}//package
Section 515
//CheckBox_selectedUpIcon (CheckBox_selectedUpIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedUpIcon extends MovieClip {
}
}//package
Section 516
//CheckBox_upIcon (CheckBox_upIcon)
package {
import flash.display.*;
public dynamic class CheckBox_upIcon extends MovieClip {
}
}//package
Section 517
//DebugWindow_mc (DebugWindow_mc)
package {
import flash.display.*;
import fl.controls.*;
import flash.text.*;
public dynamic class DebugWindow_mc extends MovieClip {
public var memory:ProgressBar;
public var framerate_txt:TextField;
public var volume:Slider;
public var memory_txt:TextField;
public var draw:CheckBox;
public var calc:ProgressBar;
public var calc_txt:TextField;
public var mouse:CheckBox;
public var framerate:ProgressBar;
public function DebugWindow_mc(){
__setProp_mouse_DebugWindow_mc_Layer1_1();
__setProp_memory_DebugWindow_mc_Layer1_1();
__setProp_draw_DebugWindow_mc_Layer1_1();
__setProp_framerate_DebugWindow_mc_Layer1_1();
__setProp_calc_DebugWindow_mc_Layer1_1();
__setProp_volume_DebugWindow_mc_Layer1_1();
}
function __setProp_draw_DebugWindow_mc_Layer1_1(){
try {
draw["componentInspectorSetting"] = true;
} catch(e:Error) {
};
draw.enabled = true;
draw.label = "Debug Draw";
draw.labelPlacement = "left";
draw.selected = false;
draw.visible = true;
try {
draw["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_framerate_DebugWindow_mc_Layer1_1(){
try {
framerate["componentInspectorSetting"] = true;
} catch(e:Error) {
};
framerate.direction = "right";
framerate.enabled = true;
framerate.mode = "manual";
framerate.sourceName = "";
framerate.visible = true;
try {
framerate["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_calc_DebugWindow_mc_Layer1_1(){
try {
calc["componentInspectorSetting"] = true;
} catch(e:Error) {
};
calc.direction = "right";
calc.enabled = true;
calc.mode = "manual";
calc.sourceName = "";
calc.visible = true;
try {
calc["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_memory_DebugWindow_mc_Layer1_1(){
try {
memory["componentInspectorSetting"] = true;
} catch(e:Error) {
};
memory.direction = "right";
memory.enabled = true;
memory.mode = "manual";
memory.sourceName = "";
memory.visible = true;
try {
memory["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_volume_DebugWindow_mc_Layer1_1(){
try {
volume["componentInspectorSetting"] = true;
} catch(e:Error) {
};
volume.direction = "horizontal";
volume.enabled = true;
volume.liveDragging = true;
volume.maximum = 1;
volume.minimum = 0;
volume.snapInterval = 0;
volume.tickInterval = 0;
volume.value = 1;
volume.visible = true;
try {
volume["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_mouse_DebugWindow_mc_Layer1_1(){
try {
mouse["componentInspectorSetting"] = true;
} catch(e:Error) {
};
mouse.enabled = true;
mouse.label = "Mouse Enabled";
mouse.labelPlacement = "left";
mouse.selected = false;
mouse.visible = true;
try {
mouse["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 518
//Flakboy (Flakboy)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import spill.localisation.*;
import flash.utils.*;
import spill.flakboy.menus.*;
import spill.flakboy.data.*;
public class Flakboy extends MovieClip {
private var preloader:PreloaderScreen;
private var bMochiAdComplete:Boolean;// = false
public static const MyriadProBold:Class = Flakboy_MyriadProBold;
public static const MyriadProLightBold:Class = Flakboy_MyriadProLightBold;
public static const MyriadPro:Class = Flakboy_MyriadPro;
public static const MyriadProLight:Class = Flakboy_MyriadProLight;
public static const MSUIGOTHIC:Class = Flakboy_MSUIGOTHIC;
public static var bMochi:Boolean = false;
public static var goreVersion:Boolean = false;
public static var isOnA10:Boolean = false;
public static var version:String = "v2.0";
public static var restricted:Boolean = false;
public static var testMode:Boolean = false;
public static var siteLocked:Boolean = false;
public static var bIphone:Boolean = true;
public static var showGore:Boolean = false;
public function Flakboy():void{
scrollRect = new Rectangle(0, 0, 700, 540);
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.frameRate = 31;
stage.stageFocusRect = false;
stage.showDefaultContextMenu = false;
Analytics.initialize(this, false);
SpilGame.initialize("Flakboy", PortalGroup.FAMILY, "Flakboy.html", this);
var _local1:XML = <LocalisedText><textItem identifier="Portal_Description"><en_us>An experiment in physical destruction: how much damage can you deal?</en_us><en_uk>An experiment in physical destruction: how much damage can you inflict?</en_uk><nl>In een destructieve bui? Reageer je af op de Flakboy en kijk hoeveel schade je kunt aanrichten!</nl><fr>Une expérience de destruction physique : combien de dégâts peux-tu causer ?</fr><de>Ein physikalisches Experiment: Wieviel Schaden kannst du anrichten?</de><es>Un experimento sobre destrucción física: ¿cuánto daño puedes causar?</es><br>Um experimento de destruição: quanto dano você é capaz de causar?</br><pt>Uma experiência em destruição física: quantos danos conseguirá causar?</pt><it>Un esperimento in distruzione fisica: quanti danni puoi provocare?</it><se>Ett experiment i fysisk misshandel: Hur stor skada kan du orsaka?</se><pl>Eksperyment nad fizyczną destrukcją: ile uszkodzeń wytrzymasz?</pl><ru>Полигон смерти к твоим услугам! Сколько повреждений ты сумеешь нанести подопытному киборгу?</ru><id>Sebuah eksperimen dalam pembongkaran jasmani: berapa banyak kerusakan yang bisa anda lakukan?</id><jp>ここは新開発の武器実験室。君はどれだけのダメージをフラックボーイに与えられるかな?!</jp><cn>有无限的兵人够你破坏的。你可以完成15个成绩吗?</cn><ar>An experiment in physical destruction: how much damage can you deal?</ar></textItem><textItem identifier="Portal_Manual"><en_us>Roll over the categories, clicking the weapons you want to add and dragging them into place (border must be green). Place the ducky to finish your design and hit Go to see how many damage dollars you can rack up.</en_us><en_uk>Roll over the categories, click the weapons you want to add, and drag them into place (the border must be green). Position the ducky to finish your design and hit go to see how many damage pounds you can rack up.</en_uk><nl>Bekijk alle categorieën en klik de wapens aan die je wilt toevoegen. Sleep ze naar een plek (plaatsen kan alleen als de rand groen is). Rond het af met het eendje en druk op Gaan! om te zien hoeveel schadegeld je kunt opstrijken.</nl><fr>Passe sur les catégories avec ta souris et clique sur les armes que tu veux ajouter et mets-les en place (le bord doit être vert). Place le petit canard pour une touche finale puis appuie sur 'go' pour voir combien de euros tu peux rafler pour les dégâts causés.</fr><de>Schau alle Kategorien an und klicke die Waffen an, die du benutzen möchtest. Ziehe sie an die gewünschte Stelle (der Rand muss grün sein). Platziere dann noch die kleine Ente, wenn du fertig bist und klicke "Los", um zu sehen, wieviel Schaden du anrichten und wieviel Geld du damit verdienen kannst.</de><es>Pasa por las distintas categorías, haz clic en las armas que quieras añadir y arrástralas para colocarlas (el borde debe estar de color verde). Para terminar tu diseño, coloca el patito y dale a ¡Ya! para ver cuántos euros de daño consigues. </es><br>Use o botão de rolagem para navegar pelas categorias, clicando nas armas que deseja adicionar e arrastando-as no lugar certo (deve estar contornado de verde). Posicione o pato de borracha para terminar a decoração e clique em JÁ para ver quantos dólares você consegue acumular por dano. </br><pt>Percorra as diferentes categorias, clicando nas armas que pretende adicionar e arraste-as para o local pretendido (o rebordo tem de estar verde). Posicione o patinho para concluir o processo e clique em Iniciar para ver quantos danos consegue amealhar.</pt><it>Scorri attraverso le categorie, cliccando sulle armi che vuoi aggiungere e trascinandole al loro posto (il bordo deve essere verde). Metti la papera per completare il tuo piano e premi il tasto VIA per vedere quanti euro di danni puoi racimolare.</it><se>För markören över kategorier, klicka på de vapen du vill ha och dra dem på plats (ramen måste vara grön). Placera ut ankan för att slutföra och klicka på kör för att se hur många skade du kan få.</se><pl>Przewijaj kategorie, klikając na bronie, które chcesz dodać i przeciągając je na wybrane miejsce (otoczka musi być zielona). Dołóż kaczuszkę, aby zakończyć projekt i naciśnij Start, aby sprawdzić, ile pieniędzy możesz zgarnąć.</pl><ru>Перебирая категории, щелкай мышью по тем видам оружия, которые ты хочешь добавить на полигон, и перетаскивай их на нужное место (граница должна оставаться зеленой). Напоследок размести уточку, нажми "Начать" и узнай, сколько за нанесенные повреждения ты сумеешь срубить!</ru><id>Gulunglah kategori-kategori, klik senjata yang ingin anda tambahkan dan tariklah ke tempatnya (batasan harus berwarna hijau). Letakkan bebek-bebek untuk menyelesaikan desain anda dan tekan maju untuk melihat berapa banyak uang yang diperoleh atas kerusakan yang diperbuat.</id><jp>各カテゴリーをクリックしてオプションを表示し、その中から使いたい武器を選び、クリック&ドラッグしてフィールド上に設置します(境界線は緑色で表示)。使いたい武器を全て設置しおえたら、「アヒル」をフラックボーイの隣に置いて武器を発動させ、どのくらいのダメージとお金を獲得できるかを見ましょう。</jp><cn>用鼠标放置武器。把鸭子放在房间中,点击"GO",坐下来看好戏吧。</cn><ar>Roll over the categories, clicking the weapons you want to add and dragging them into place (border must be green). Place the ducky to finish your design and hit Go to see how many damage dollars you can rack up.</ar></textItem><textItem identifier="Branding_More_Games_Sentence_Long"><en_us>MORE FREE ACTION GAMES AT:</en_us><en_uk>MORE FREE ACTION GAMES AT:</en_uk><nl>MEER GRATIS ACTIEGAMES OP:</nl><fr>PLUS DE JEUX D’ACTION GRATUITS SUR :</fr><de>MEHR KOSTENLOSE ACTIONSPIELE AUF:</de><es>MÁS JUEGOS DE ACCIÓN GRATUITOS EN:</es><br>MAIS JOGOS DE AÇÃO GRATUITOS EM:</br><pt>MAIS JOGOS DE ACÇÃO GRÁTIS EM:</pt><it>PIÙ GIOCHI DI AZIONE GRATIS SU:</it><se>FLER GRATIS ACTIONSPEL PÅ:</se><pl>WIĘCEJ DARMOWYCH GIER AKCJI NA:</pl><ru>ДРУГИЕ БЕСПЛАТНЫЕ ЭКШН-ИГРЫ:</ru><id>PERMAINAN AKSI GRATIS LAINNYA DI:</id><jp>他の無料アクションゲームをもっと遊ぶ</jp><cn>更多游戏尽在:</cn><ar>MORE FREE ACTION GAMES AT:</ar></textItem><textItem identifier="More_Games_Text"><en_us>MORE ACTION AT:</en_us><en_uk>MORE ACTION AT:</en_uk><nl>MEER ACTIE OP:</nl><fr>PLUS D’ACTION SUR :</fr><de>MEHR ACTION AUF:</de><es>MÁS ACCIÓN EN:</es><br>MAIS AÇÃO EM:</br><pt>MAIS ACÇÃO EM:</pt><it>PIÙ AZIONE SU:</it><se>MER ACTION PÅ:</se><pl>WIĘCEJ AKCJI NA:</pl><ru>ДРУГИЕ ЭКШН-ИГРЫ:</ru><id>AKSI LAINNYA DI:</id><jp>アクションゲームをもっと遊ぶ</jp><cn>更多游戏尽在:</cn><ar>MORE ACTION AT:</ar></textItem><textItem identifier="Damage"><en_us>Damage</en_us><en_uk>Damage</en_uk><nl>Schade</nl><fr>Dégâts</fr><de>Schaden</de><es>Daño</es><br>Dano</br><pt>Danos</pt><it>Danni</it><se>Skador</se><pl>Uszkodzenia</pl><ru>Повреждения</ru><id>Kerusakan</id><jp>ダメージ</jp><cn>破坏</cn><ar>Damage</ar></textItem><textItem identifier="Head"><en_us>Head</en_us><en_uk>Head</en_uk><nl>Hoofd</nl><fr>Tête</fr><de>Kopf</de><es>Cabeza</es><br>Cabeça</br><pt>Cabeça</pt><it>Testa</it><se>Huvud</se><pl>Głowa</pl><ru>Голова</ru><id>Kepala</id><jp>頭</jp><cn>头</cn><ar>Head</ar></textItem><textItem identifier="Arms"><en_us>Arms</en_us><en_uk>Arms</en_uk><nl>Armen</nl><fr>Bras</fr><de>Arme</de><es>Brazos</es><br>Braços</br><pt>Braços</pt><it>Braccia</it><se>Armar</se><pl>Ramiona</pl><ru>Руки</ru><id>Lengan</id><jp>腕</jp><cn>手臂</cn><ar>Arms</ar></textItem><textItem identifier="Torso"><en_us>Torso</en_us><en_uk>Torso</en_uk><nl>Romp</nl><fr>Torse</fr><de>Rumpf</de><es>Torso</es><br>Torso</br><pt>Tronco</pt><it>Busto</it><se>Bål</se><pl>Tułów</pl><ru>Туловище</ru><id>Batang tubuh</id><jp>胴体</jp><cn>躯干</cn><ar>Torso</ar></textItem><textItem identifier="Legs"><en_us>Legs</en_us><en_uk>Legs</en_uk><nl>Benen</nl><fr>Jambes</fr><de>Beine</de><es>Piernas</es><br>Pernas</br><pt>Pernas</pt><it>Gambe</it><se>Ben</se><pl>Nogi</pl><ru>Ноги</ru><id>Kaki</id><jp>足</jp><cn>腿</cn><ar>Legs</ar></textItem><textItem identifier="Target_Damage"><en_us>Damage Target</en_us><en_uk>Damage Target</en_uk><nl>Streefschade</nl><fr>Objectif des dégâts</fr><de>Schadensziel</de><es>Daño objetivo</es><br>Objetivo de dano</br><pt>Alvo dos danos</pt><it>Obiettivo di danno</it><se>Skademål</se><pl>Wymagany poziom uszkodzeń</pl><ru>Требуемая величина</ru><id>Sasaran Kerusakan</id><jp>目標ダメージ</jp><cn>目标破坏数</cn><ar>Damage Target</ar></textItem><textItem identifier="Total_Damage"><en_us>Total Damage</en_us><en_uk>Total Damage</en_uk><nl>Totaal toegebracht</nl><fr>Total des dégâts</fr><de>Schaden gesamt</de><es>Daño total</es><br>Dano total</br><pt>Danos totais</pt><it>Danni totali</it><se>Skador totalt</se><pl>Łączne uszkodzenia</pl><ru>Общие повреждения</ru><id>Totak Kerusakan</id><jp>総合ダメージ</jp><cn>总破坏</cn><ar>Total Damage</ar></textItem><textItem identifier="Weapons_Unlocked"><en_us>Weapons Unlocked</en_us><en_uk>Weapons Unlocked</en_uk><nl>Vrijgespeelde wapens</nl><fr>Armes déverrouillées</fr><de>Freigeschaltete Waffen</de><es>Armas desbloqueadas</es><br>Armas desbloqueadas</br><pt>Armas desbloqueadas</pt><it>Armi sbloccate</it><se>Upplåsta vapen</se><pl>Odblokowane bronie</pl><ru>Доступное оружие</ru><id>Senjata yang Terbuka</id><jp>使用可能な武器</jp><cn>解锁的武器</cn><ar>Weapons Unlocked</ar></textItem><textItem identifier="Back_To_Main"><en_us>Back to Main</en_us><en_uk>Back to Main</en_uk><nl>Terug naar hoofdmenu</nl><fr>Retour au menu principal</fr><de>Zurück zum Hauptmenü</de><es>Volver al menú principal</es><br>Voltar ao menu</br><pt>Voltar ao menu principal</pt><it>Indietro al menu principale</it><se>Till meny</se><pl>Powrót do strony głównej</pl><ru>Главное меню</ru><id>Kembali ke Utama</id><jp>メインメニューに戻る</jp><cn>返回主菜单</cn><ar>Back to Main</ar></textItem><textItem identifier="Next_Level"><en_us>Next Level</en_us><en_uk>Next Level</en_uk><nl>Volgend level</nl><fr>Niveau suivant</fr><de>Nächster Level</de><es>Siguiente nivel</es><br>Próximo nível</br><pt>Próximo nível</pt><it>Prossimo livello</it><se>Nästa nivå</se><pl>Następny poziom</pl><ru>Следующий уровень</ru><id>Level Berikutnya</id><jp>次のレベルに進む</jp><cn>下一关</cn><ar>Next Level</ar></textItem><textItem identifier="Quality"><en_us>Quality</en_us><en_uk>Quality</en_uk><nl>Kwaliteit</nl><fr>Qualité</fr><de>Qualität</de><es>Calidad</es><br>Qualidade</br><pt>Qualidade</pt><it>Qualità</it><se>Kvalitet</se><pl>Jakość</pl><ru>Качество</ru><id>Kualitas</id><jp>クオリティ</jp><cn>质量</cn><ar>Quality</ar></textItem><textItem identifier="Bugget"><en_us>Budget</en_us><en_uk>Budget</en_uk><nl>Budget</nl><fr>Budget</fr><de>Budget</de><es>Recursos</es><br>Orçamento</br><pt>Orçamento</pt><it>Budget</it><se>Budget</se><pl>Budżet</pl><ru>Бюджет</ru><id>Anggaran</id><jp>予算</jp><cn>经费</cn><ar>Budget</ar></textItem><textItem identifier="GO"><en_us>GO</en_us><en_uk>GO</en_uk><nl>GAAN!</nl><fr>GO </fr><de>LOS</de><es>¡YA!</es><br>JÁ</br><pt>INICIAR</pt><it>VIA</it><se>KÖR</se><pl>START</pl><ru>НАЧАТЬ</ru><id>MAJU</id><jp>開始</jp><cn>GO</cn><ar>GO</ar></textItem><textItem identifier="STOP"><en_us>STOP</en_us><en_uk>STOP</en_uk><nl>KAPPEN</nl><fr>STOP</fr><de>STOP</de><es>DETENER</es><br>PARE</br><pt>PARAR</pt><it>STOP</it><se>STOPPA</se><pl>STOP</pl><ru>СТОП</ru><id>BERHENTI</id><jp>停止</jp><cn>停</cn><ar>STOP</ar></textItem><textItem identifier="Level_Complete"><en_us>Damage Dealt</en_us><en_uk>Damage Dealt</en_uk><nl>Toegebrachte schade</nl><fr>Dégâts causés</fr><de>Angerichteter Schaden</de><es>Daño causado</es><br>Dano causado</br><pt>Danos causados</pt><it>Danni provocati</it><se>Skada tillfogad</se><pl>Wymagany cel osiągnięty</pl><ru>Испытания завершены!</ru><id>Kerusakan yang dijanjikan</id><jp>目標ダメージ達成</jp><cn>本关完成</cn><ar>Damage Dealt</ar></textItem><textItem identifier="Level_Failed"><en_us>Not good enough.</en_us><en_uk>Not good enough.</en_uk><nl>Niet goed genoeg. </nl><fr>Pas assez bon.</fr><de>Nicht gut genug.</de><es>No es suficiente.</es><br>Não foi suficiente.</br><pt>Aquém das expectativas.</pt><it>Non abbastanza buono.</it><se>Inte tillräckligt bra.</se><pl>Niewystarczająco dobrze.</pl><ru>Задача не выполнена.</ru><id>Kurang baik.</id><jp>目標ダメージ未達成</jp><cn>本关失败</cn><ar>Not good enough.</ar></textItem><textItem identifier="Achievements"><en_us>Achievements</en_us><en_uk>Achievements</en_uk><nl>Prestaties</nl><fr>Missions accomplies</fr><de>Errungenschaften</de><es>Logros</es><br>Conquistas</br><pt>Proezas</pt><it>Risultati</it><se>Bedrifter</se><pl>Trofea</pl><ru>Достижения</ru><id>Prestasi</id><jp>スペシャルゴール</jp><cn>成绩</cn><ar>Achievements</ar></textItem><textItem identifier="Mine1_Description"><en_us>Foot Blaster</en_us><en_uk>Foot Blaster</en_uk><nl>Voetenknaller</nl><fr>Exploseur de pied</fr><de>Fußsprenger</de><es>Revientapies</es><br>Buscapé</br><pt>Destruidorazinha</pt><it>Gambizzatore</it><se>Fotsprängare</se><pl>Destruktor Stóp</pl><ru>Ампутатор</ru><id>Hempasan Kaki</id><jp>プチマイン</jp><cn>地雷1</cn><ar>Foot Blaster</ar></textItem><textItem identifier="Mine2_Description"><en_us>Blastastic B50</en_us><en_uk>Blastastic B50</en_uk><nl>Knaltastisch B50</nl><fr>Explofolie E50</fr><de>Sprengmine B50</de><es>Explotástica B50</es><br>Bombástica B50</br><pt>Fantástica Balástica B50</pt><it>Scoppiatutto B50</it><se>Pangbom B50</se><pl>Wybuchowiec B50</pl><ru>Бадабум В50</ru><id>Peledak B50</id><jp>スタンダードマイン B50</jp><cn>地雷2</cn><ar>Blastastic B50</ar></textItem><textItem identifier="Mine3_Description"><en_us>MegaMiner 1000</en_us><en_uk>MegaMiner 1000</en_uk><nl>MegaMijn 1000</nl><fr>Mégaexplo 1000</fr><de>MegaMine 1000</de><es>Megamina 1000</es><br>Megamina 1000</br><pt>Mina Guilhermina 1000</pt><it>Megamina 1000</it><se>MegaMina 1000</se><pl>MegaMina</pl><ru>Мегафугас 1000</ru><id>Kipas Sakti </id><jp>パワーマイン 1000</jp><cn>地雷3</cn><ar>MegaMiner 1000</ar></textItem><textItem identifier="Mine4_Description"><en_us>LegEater M400</en_us><en_uk>LegEater M400</en_uk><nl>BenenVreter M400</nl><fr>Mangejambe M400</fr><de>Beinfresser M400</de><es>Devorapiernas M400</es><br>Devoradora de pernas M400</br><pt>Granada Danada M400</pt><it>Mangiagambe M400</it><se>BenBort M400</se><pl>Pożeracz Nóg M400</pl><ru>Кошмар сапера М400</ru><id>Penghancur Kaki M400</id><jp>ウルトラスーパーマイン M400</jp><cn>地雷4</cn><ar>LegEater M400</ar></textItem><textItem identifier="Turret1_Description"><en_us>Wall Gunner</en_us><en_uk>Wall Gunner</en_uk><nl>Muurkanon</nl><fr>Mitratour</fr><de>Wandkanone</de><es>Ametralladora de pared</es><br>Atiradora de parede</br><pt>Paredoura Demolidora</pt><it>Sparatore da muro</it><se>Väggkrut</se><pl>Działo Ścienne</pl><ru>Настенный долботрон</ru><id>Senapan tanpa mata</id><jp>プチタレット</jp><cn>炮塔1</cn><ar>Wall Gunner</ar></textItem><textItem identifier="Turret2_Description"><en_us>DamageDealer B14</en_us><en_uk>DamageDealer B14</en_uk><nl>Schadestichter S14</nl><fr>Tourodégâts T14</fr><de>Schadensbringer B14</de><es>Dañomática B14</es><br>Danificadora B14</br><pt>Leva tudo à frente B14</pt><it>Provocadanni B14</it><se>SuperOnt B14</se><pl>Dystrybutor Uszkodzeń B14</pl><ru>Бронебой B14</ru><id>Perusak jitu B14</id><jp>スタンダードタレット B14</jp><cn>炮塔2</cn><ar>DamageDealer B14</ar></textItem><textItem identifier="Turret3_Description"><en_us>Destructor 34S</en_us><en_uk>Destructor 34S</en_uk><nl>Verwoester 34S</nl><fr>Destructeur 34S</fr><de>Zerstörer 34S</de><es>Destructora 34S</es><br>Destruidora 34S</br><pt>Desconstrutor 34S</pt><it>Distruttore 34S</it><se>Förintare 34S</se><pl>Niszczyciel 34S</pl><ru>Разрушитель 34S</ru><id>Penghancur 34S</id><jp>パワータレット 34S</jp><cn>炮塔3</cn><ar>Destructor 34S</ar></textItem><textItem identifier="Spring_Platform1_Description"><en_us>BouncingBoy 66</en_us><en_uk>BouncingBoy 66</en_uk><nl>Stuiterbinkie 66</nl><fr>Eksasaute 66</fr><de>Plattform 66</de><es>Rebotante 66</es><br>Saltadora 66</br><pt>Plataforma B66</pt><it>Saltellante 66</it><se>StudsPojke 66</se><pl>Skaczący Chłopczyk 66</pl><ru>Попрыгунчик 66</ru><id>Manusia Pelambung 66</id><jp>プチジャンパー 66</jp><cn>弹簧1_平台</cn><ar>BouncingBoy 66</ar></textItem><textItem identifier="Spring_Platform2_Description"><en_us>Boingbastic 3GC</en_us><en_uk>Boingbastic 3GC</en_uk><nl>Boingbastisch 3GC</nl><fr>Sautastique 3GC</fr><de>Katapult 3GC</de><es>Botamático 3GC</es><br>Boingbástica 3GC</br><pt>Bombástica 3GC</pt><it>Bombastico 3GC</it><se>Megastuds 3GC</se><pl>SuperHop 3GC</pl><ru>Убоинг 3GC</ru><id>Peledak Boeing 3GC</id><jp>スタンダードジャンパー 3GC</jp><cn>弹簧2_平台</cn><ar>Boingbastic 3GC</ar></textItem><textItem identifier="Spring_Platform3_Description"><en_us>Propelatron 5510</en_us><en_uk>Propelatron 5510</en_uk><nl>Propelatron 5510</nl><fr>Propulsatron 5510</fr><de>Propeller 5510</de><es>Rebotatrón 5510</es><br>Propelatron 5510</br><pt>Propensador 5510</pt><it>Propulsore 5510</it><se>FlygMax 5510</se><pl>Odrzutowy Skakacz 5510</pl><ru>Полный улет 5510</ru><id>Kapak Sakti 5510</id><jp>パワージャンパー 5510</jp><cn>弹簧3_平台</cn><ar>Propelatron 5510</ar></textItem><textItem identifier="Spikes1_Description"><en_us>Pokingmon Lite</en_us><en_uk>Pokingmon Lite</en_uk><nl>Prikkelaar Light</nl><fr>Piquolo</fr><de>Stecher light</de><es>Pinchador light</es><br>Espetamon básica</br><pt>Espigões malandrões</pt><it>Spingitore Mini</it><se>VassPik light</se><pl>Mały Szturchacz</pl><ru>Шипастик</ru><id>Paku tanpa bayangan</id><jp>プチスパイク</jp><cn>尖状物1</cn><ar>Pokingmon Lite</ar></textItem><textItem identifier="Spikes2_Description"><en_us>Stabatrix 3000</en_us><en_uk>Stabatrix 3000</en_uk><nl>Priematrix 3000</nl><fr>BrochT 3000</fr><de>Abstecher 3000</de><es>Apuñalante 3000</es><br>Espetarix 3000</br><pt>Esc(r)ápula X3000</pt><it>Accoltellatrice 3000</it><se>Spetzad 3000</se><pl>Dźgacz 3000</pl><ru>Ежик-убийца 3000</ru><id>Paku seram 3000</id><jp>スタンダードスパイク 3000</jp><cn>尖状物2</cn><ar>Stabatrix 3000</ar></textItem><textItem identifier="Spikes3_Description"><en_us>LaserKill WD60</en_us><en_uk>LaserKill WD60</en_uk><nl>Laserpierlala WD60</nl><fr>Lasérifieur WD60</fr><de>Todeslaser WD60</de><es>Filo láser WD60</es><br>Morte Certa WD60</br><pt>Laser mortal WD60</pt><it>Laser assassino WD60</it><se>LaserDöd WD60</se><pl>Laserowa Śmierć WD60</pl><ru>Дырокол WD60</ru><id>Paku Jumbo WD60</id><jp>パワースパイク WD60</jp><cn>尖状物3</cn><ar>LaserKill WD60</ar></textItem><textItem identifier="Missile1_Description"><en_us>DamageMaster Lite</en_us><en_uk>DamageMaster Lite</en_uk><nl>Verwoestingzaaier AA</nl><fr>DommagOmaître</fr><de>Rakete light</de><es>Daño maestro light</es><br>Mestra dos danos básica</br><pt>Prego a fundo</pt><it>Mastro Danno Mini</it><se>RaketMaster light</se><pl>Mały Mistrz Masakry</pl><ru>Йа ракетко</ru><id>Anak Peluru </id><jp>プチミサイル</jp><cn>导弹1</cn><ar>DamageMaster Lite</ar></textItem><textItem identifier="Missile2_Description"><en_us>Explodinar 555</en_us><en_uk>Explodinar 555</en_uk><nl>Explodinair 555</nl><fr>Explosil 555</fr><de>Explosion 555</de><es>Explotante 555</es><br>Explodinário 555</br><pt>Explosivo 555</pt><it>Esploditore 555</it><se>Exploderare 555</se><pl>Wybuchacz 555</pl><ru>Смертоносец 555</ru><id>Peluru Peledak 555</id><jp>スタンダードミサイル 555</jp><cn>导弹2</cn><ar>Explodinar 555</ar></textItem><textItem identifier="Missile3_Description"><en_us>DeathSeeker D-lux</en_us><en_uk>DeathSeeker D-lux</en_uk><nl>Precisiedoder D-lux</nl><fr>Bonvoyage 13</fr><de>Todesrakete Deluxe</de><es>Enviudador D-lux</es><br>Caça-morte Deluxe</br><pt>Míssil mortal D-luxo</pt><it>Cercamorte D-lux</it><se>DödsBringare D-lux</se><pl>Dawca Śmierci D-lux</pl><ru>Привет с Байконура</ru><id>Peluru kematian</id><jp>パワーミサイルデラックス</jp><cn>导弹3</cn><ar>DeathSeeker D-lux</ar></textItem><textItem identifier="Skinner_Description"><en_us>The Skinnerator</en_us><en_uk>The Skinnerator</en_uk><nl>Vilmachine XXL</nl><fr>Squeletteur </fr><de>Der Hautvernichter</de><es>El Despellejador</es><br>Esfoladora</br><pt>Esqueletor P58H</pt><it>Il tirapelle</it><se>Hudflängare</se><pl>Skórościągacz</pl><ru>Шкуросдиратель</ru><id>Pengelupas Kulit</id><jp>スケルトンメーカー</jp><cn>剥皮者</cn><ar>The Skinnerator</ar></textItem><textItem identifier="Electrocutor_Description"><en_us>Fryboy A1080</en_us><en_uk>Fryboy A1080</en_uk><nl>Schokpepper A1080</nl><fr>Pèteléplomb A1080</fr><de>Grillboy A1080</de><es>Friturante A1080</es><br>Fritadeira A1080</br><pt>Electrocuta-M 1080</pt><it>Soffriggitrice A1080</it><se>Elchock A1080</se><pl>Opiekacz A1080</pl><ru>Электропрожарка А1080</ru><id>Bom Penggoreng A1080</id><jp>電気ショッカー A1080</jp><cn>电刑者</cn><ar>Fryboy A1080</ar></textItem><textItem identifier="Target"><en_us>Target</en_us><en_uk>Target</en_uk><nl>Doel</nl><fr>Objectif </fr><de>Ziel</de><es>Objetivo</es><br>Meta</br><pt>Objectivo</pt><it>Obiettivo</it><se>Mål</se><pl>Cel</pl><ru>Цель</ru><id>Sasaran</id><jp>目標</jp><cn>目标 </cn><ar>Target</ar></textItem><textItem identifier="High_Scores"><en_us>High Scores</en_us><en_uk>Highscores</en_uk><nl>Topscores</nl><fr>Meilleurs scores</fr><de>Highscores</de><es>Puntuaciones máximas</es><br>Recordes</br><pt>Pontuações mais altas</pt><it>Punteggi più alti</it><se>Toppoäng</se><pl>Ranking</pl><ru>Рекорды</ru><id>Nilai tertinggi</id><jp>ハイスコア</jp><cn>高分榜</cn><ar>High Scores</ar></textItem><textItem identifier=""><en_us></en_us><en_uk></en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><jp></jp><cn></cn><ar></ar></textItem><textItem identifier="Spent"><en_us>Spent</en_us><en_uk>Spent</en_uk><nl>Uitgegeven</nl><fr>Dépensé</fr><de>Ausgegeben</de><es>Gastado</es><br>Gastos</br><pt>Gasto</pt><it>Spesi</it><se>Betalat</se><pl>Wydatki</pl><ru>Потрачено</ru><id>Dibelanjakan</id><jp>使ったお金</jp><cn>花费</cn><ar>Spent</ar></textItem><textItem identifier="Earned"><en_us>Earned</en_us><en_uk>Earned</en_uk><nl>Verdiend</nl><fr>Gagné</fr><de>Verdient</de><es>Ganado</es><br>Ganhos</br><pt>Ganho</pt><it>Guadagnati</it><se>Tjänat</se><pl>Zarobek</pl><ru>Заработано</ru><id>Diperoleh</id><jp>獲得したお金</jp><cn>收入</cn><ar>Earned</ar></textItem><textItem identifier="Profit"><en_us>Profit</en_us><en_uk>Profit</en_uk><nl>Winst</nl><fr>Bénéfice</fr><de>Gewinn</de><es>Beneficio</es><br>Lucro</br><pt>Lucro</pt><it>Profitto</it><se>Vinst</se><pl>Dochód</pl><ru>Прибыль</ru><id>Laba</id><jp>利益</jp><cn>收益</cn><ar>Profit</ar></textItem><textItem identifier="Total_Profit"><en_us>Total Profit</en_us><en_uk>Total Profit</en_uk><nl>Totale winst</nl><fr>Bénéfice total</fr><de>Gesamtverdienst</de><es>Beneficio total</es><br>Lucro total</br><pt>Lucro total</pt><it>Profitto totale</it><se>Vinst totalt</se><pl>Łączny dochód</pl><ru>Общая прибыль</ru><id>Total Laba</id><jp>総利益</jp><cn>总收益</cn><ar>Total Profit</ar></textItem><textItem identifier="Select_Level"><en_us>Select Level</en_us><en_uk>Select level</en_uk><nl>Selecteer level</nl><fr>Sélectionner un niveau</fr><de>Level auswählen</de><es>Seleccionar un nivel</es><br>Escolher o nível</br><pt>Selecção de nível</pt><it>Seleziona livello</it><se>Välj nivå</se><pl>Wybór poziomów</pl><ru>Выберите уровень</ru><id>Pilih level</id><jp>レベルを選択する</jp><cn>选择关卡</cn><ar>Select Level</ar></textItem><textItem identifier="Friend_Message"><en_us>XXX challenges you.</en_us><en_uk>XXX is challenging you.</en_uk><nl>XXX daagt je uit.</nl><fr>XXX t'a lancé un défi.</fr><de>XXX fordert dich heraus.</de><es>XXX te envía un reto.</es><br>XXX está desafiando você.</br><pt>XXX desafia-o(a).</pt><it>XXX ti sfida.</it><se>XXX utmanar dig.</se><pl>XXX wyzywa cię.</pl><ru>XXX бросает вам вызов!</ru><id>XXX menantang anda.</id><jp>XXX から挑戦状を受け取りました。</jp><cn>XXX发给你这个</cn><ar>XXX challenges you.</ar></textItem><textItem identifier="Send_To_Friend_Error"><en_us>Error Loading Level</en_us><en_uk>Error Loading Level</en_uk><nl>Fout tijdens laden level</nl><fr>Erreur de chargement du niveau</fr><de>Fehler beim Laden des Levels</de><es>Error al cargar el nivel</es><br>Erro ao carregar o nível</br><pt>Erro no carregamento do nível</pt><it>Errore di caricamento livello</it><se>Nivå kunde ej laddas</se><pl>Błąd podczas ładowania poziomu</pl><ru>Ошибка загрузки уровня</ru><id>Kesalahan Pengisian Level</id><jp>レベルのロードに失敗しました</jp><cn>关卡加载错误</cn><ar>Error Loading Level</ar></textItem><textItem identifier="Click_To_Play"><en_us>Click to Play</en_us><en_uk>Click to Play</en_uk><nl>Klik om te spelen</nl><fr>Clique pour jouer</fr><de>Zum Spielen klicken</de><es>Haz clic para jugar</es><br>Clique para jogar</br><pt>Clique para jogar</pt><it>Clicca per giocare</it><se>Klicka för att spela</se><pl>Kliknij, aby zagrać</pl><ru>Щелкните, чтобы начать игру</ru><id>Klik untuk bermain</id><jp>クリックしてプレイ</jp><cn>点击开始</cn><ar>Click to Play</ar></textItem><textItem identifier="Send_To_Friend"><en_us>Send to a Friend</en_us><en_uk>Send to a Friend</en_uk><nl>Naar een vriend sturen</nl><fr>Envoyer à un(e) ami(e)</fr><de>An einen Freund schicken</de><es>Enviar a un amigo</es><br>Enviar a um amigo</br><pt>Enviar a amigo</pt><it>Invia ad un amico</it><se>Skicka till vän</se><pl>Wyślij do przyjaciela</pl><ru>Отправить другу</ru><id>Kirim ke teman</id><jp>友達に送る</jp><cn>发给朋友</cn><ar>Send to a Friend</ar></textItem><textItem identifier="Back"><en_us>Back</en_us><en_uk>Back</en_uk><nl>Terug</nl><fr>Retour</fr><de>Zurück</de><es>Atrás</es><br>Anterior</br><pt>Retroceder</pt><it>Indietro</it><se>Bakåt</se><pl>Powrót</pl><ru>Обратно</ru><id>Kembali</id><jp>戻る</jp><cn>后退</cn><ar>Back</ar></textItem><textItem identifier="Play_Yourself"><en_us>Beat That Damage</en_us><en_uk>Beat That Damage</en_uk><nl>Richt meer schade aan!</nl><fr>Fais encore plus de dégâts</fr><de>Lust etwas Schaden anzurichten?</de><es>Supera ese daño</es><br>Aceitar o desafio</br><pt>Cause Mais Danos</pt><it>Batti quei danni</it><se>Överträffa skadorna</se><pl>Pobij ten wynik</pl><ru>Побить рекорд!</ru><id>Kalahkan Kerusakan itu</id><jp>自分も挑戦する</jp><cn>游戏开始</cn><ar>Beat That Damage</ar></textItem><textItem identifier="Replay"><en_us>Replay Video</en_us><en_uk>Replay Video</en_uk><nl>Video opnieuw afspelen</nl><fr>Revoir la vidéo</fr><de>Video noch einmal abspielen</de><es>Ver vídeo de nuevo</es><br>Reproduzir novamente</br><pt>Rever vídeo</pt><it>Riguarda il video</it><se>Spela om video</se><pl>Powtórz video</pl><ru>Воспроизведение</ru><id>Mengulangi Video</id><jp>ビデオをリプレイする</jp><cn>再玩一次</cn><ar>Replay Video</ar></textItem><textItem identifier="Retry"><en_us>Try Again</en_us><en_uk>Try Again</en_uk><nl>Opnieuw</nl><fr>Réessayer</fr><de>Noch einmal probieren</de><es>Inténtalo otra vez</es><br>Tentar novamente</br><pt>Tentar novamente</pt><it>Riprova</it><se>Försök igen</se><pl>Spróbuj ponownie</pl><ru>Еще раз</ru><id>Coba lagi</id><jp>もう1度トライする</jp><cn>再试一次</cn><ar>Try Again</ar></textItem><textItem identifier="URL"><en_us>URL</en_us><en_uk>URL</en_uk><nl>URL</nl><fr>URL</fr><de>URL</de><es>Dirección</es><br>URL</br><pt>URL</pt><it>URL</it><se>URL</se><pl>URL</pl><ru>URL</ru><id>URL</id><jp>URL</jp><cn>URL</cn><ar>URL</ar></textItem><textItem identifier="Your_Name"><en_us>Your Name</en_us><en_uk>Your Name</en_uk><nl>Je naam</nl><fr>Ton nom</fr><de>Dein Name</de><es>Tu nombre</es><br>Seu nome</br><pt>O seu nome</pt><it>Il tuo nome</it><se>Ditt namn</se><pl>Twoje imię</pl><ru>Ваше имя</ru><id>Nama Anda</id><jp>あなたの名前</jp><cn>你的名字</cn><ar>Your Name</ar></textItem><textItem identifier="Copy"><en_us>Copy</en_us><en_uk>Copy</en_uk><nl>Kopiëren</nl><fr>Copier</fr><de>Kopieren</de><es>Copiar</es><br>Copiar</br><pt>Copiar</pt><it>Copia</it><se>Kopiera</se><pl>Kopiuj</pl><ru>Копировать</ru><id>Salin</id><jp>コピーする</jp><cn>复制</cn><ar>Copy</ar></textItem><textItem identifier="Submit"><en_us>Submit</en_us><en_uk>Submit</en_uk><nl>Verzenden</nl><fr>Enregistrer</fr><de>Abschicken</de><es>Enviar</es><br>Enviar</br><pt>Enviar</pt><it>Invia</it><se>Skicka</se><pl>Zapisz</pl><ru>Сохранить</ru><id>Kumpulkan </id><jp>決定</jp><cn>提交</cn><ar>Submit</ar></textItem><textItem identifier="Your_Score"><en_us>Your Score</en_us><en_uk>Your score</en_uk><nl>Je score</nl><fr>Ton score</fr><de>Deine Punkte</de><es>Tu puntuación</es><br>Seu placar</br><pt>A sua pontuação</pt><it>Tuo punteggio</it><se>Din poäng</se><pl>Twój wynik</pl><ru>Ваш результат</ru><id>Skor anda</id><jp>あなたのスコア</jp><cn>你的分数</cn><ar>Your Score</ar></textItem><textItem identifier="Score_Improved"><en_us>You did better!</en_us><en_uk>You have improved!</en_uk><nl>Je hebt je score verbeterd!</nl><fr>Tu t'es amélioré(e) !</fr><de>Du hast dich verbessert!</de><es>¡Has mejorado!</es><br>Você melhorou!</br><pt>Conseguiu fazer melhor!</pt><it>Hai fatto di meglio!</it><se>Resultat förbättrat!</se><pl>Jesteś lepszy!</pl><ru>Вы побили рекорд!</ru><id>Anda melakukannya lebih baik!</id><jp>記録更新!</jp><cn>分数提高</cn><ar>You did better!</ar></textItem><textItem identifier="Improved"><en_us>Better</en_us><en_uk>Better</en_uk><nl>Beter</nl><fr>Mieux</fr><de>Besser</de><es>Mejor</es><br>Melhorou</br><pt>Melhor</pt><it>Meglio</it><se>Bättre</se><pl>Lepiej</pl><ru>Лучше</ru><id>Lebih baik</id><jp>向上</jp><cn>提高</cn><ar>Better</ar></textItem><textItem identifier="No_Change"><en_us>Same</en_us><en_uk>Same</en_uk><nl>Hetzelfde</nl><fr>Pareil</fr><de>Gleich</de><es>Igual</es><br>Está igual</br><pt>Igual</pt><it>Stesso</it><se>Samma</se><pl>Tak samo</pl><ru>Так же</ru><id>Sama</id><jp>同じ</jp><cn>分数相同</cn><ar>Same</ar></textItem><textItem identifier="Decreased"><en_us>Worse</en_us><en_uk>Worse</en_uk><nl>Slechter</nl><fr>Moins bien</fr><de>Schlechter</de><es>Peor</es><br>Piorou</br><pt>Pior</pt><it>Peggio</it><se>Sämre</se><pl>Gorzej</pl><ru>Хуже</ru><id>Lebih buruk</id><jp>低下</jp><cn>降低</cn><ar>Worse</ar></textItem><textItem identifier="Level_X_Complete"><en_us>Level XXX/YYY Completed</en_us><en_uk>Level XXX/YYY Completed</en_uk><nl>Level XXX/YYY uitgespeeld</nl><fr>Niveau XXX/YYY complété</fr><de>Level XXX/YYY beendet</de><es>Nivel XXX/YYY completado</es><br>Nível XXX/YYY concluído</br><pt>Nível XXX/YYY concluído</pt><it>Livello XXX/YYY completato</it><se>Nivå XXX/YYY klarad</se><pl>Poziom XXX/YYY ukończony</pl><ru>Уровень XXX/YYY пройден</ru><id>Level [X\Y] selesai</id><jp>レベル XXX/YYY クリア</jp><cn>XXX/YYY结束</cn><ar>Level XXX/YYY Completed</ar></textItem><textItem identifier="Finance"><en_us>Finances</en_us><en_uk>Finances</en_uk><nl>Financiën</nl><fr>Finances</fr><de>Finanzen</de><es>Finanzas</es><br>Finanças</br><pt>Finanças</pt><it>Finanze</it><se>Pengar</se><pl>Finanse</pl><ru>Финансы</ru><id>Keuangan</id><jp>財政状態</jp><cn>财务状况</cn><ar>Finances</ar></textItem><textItem identifier="Level"><en_us>Level</en_us><en_uk>Level</en_uk><nl>Level</nl><fr>Niveau</fr><de>Level</de><es>Nivel</es><br>Nível</br><pt>Nível</pt><it>Livello</it><se>Nivå</se><pl>Poziom</pl><ru>Уровень</ru><id>Level</id><jp>レベル</jp><cn>关数</cn><ar>Level</ar></textItem><textItem identifier="Damage_Message"><en_us>I did XXX in damage. Can you beat that?</en_us><en_uk>I inflicted XXX damage. Can you beat that?</en_uk><nl>Ik heb XXX schade aangericht. Kun jij het beter?</nl><fr>J'ai obtenu un XXX en dégâts. Peux-tu faire mieux ?</fr><de>Meine Punktzahl: XXX. Denkst du, du bist besser?</de><es>Conseguí XXX de daño. ¿Puedes superarlo?</es><br>Eu fiz XXX pontos de dano. Será que você consegue me vencer?</br><pt>Eu fiz XXX em estragos. Consegue fazer melhor?</pt><it>Ho fatto XXX in danni. Puoi battere questo?</it><se>Jag fick XXX i skador. Kan du slå det?</se><pl>Uzyskałem XXX uszkodzeń. Czy pobijesz ten wynik?</pl><ru>Я нанес XXX повреждений. Слабо меня переплюнуть?</ru><id>Saya melakukan XXX kerusakan. Bisakah anda mengalahkannya?</id><jp> XXXダメージを記録したよ。君はこの記録を破れるかな?</jp><cn>我进行了XXX破坏。你能打败我吗?</cn><ar>I did XXX in damage. Can you beat that?</ar></textItem><textItem identifier="No_Legs_Achievement"><en_us>"Aaaai got no legs"</en_us><en_uk>"Aaaai! I've got no legs"</en_uk><nl>Brekebeen</nl><fr>Sans les jambes !</fr><de>"Aaaah, meine Beine"</de><es>No siento las piernas</es><br>"Aaaai, cadê minhas pernas?"</br><pt>"Ai as minhas perninhas"</pt><it>"Aaaai non ho le gambe"</it><se>"Aaaaj, var är mina ben."</se><pl>"Nieee maaam nóóóg"</pl><ru>Проща-а-ай, футбол!</ru><id>"Aaaai tidak ada kaki"</id><jp>ノーレッグ</jp><cn>“腿没了”</cn><ar>"Aaaai got no legs"</ar></textItem><textItem identifier="No_Legs_Description"><en_us>Blow off Flakboy's legs, but leave his arms.</en_us><en_uk>Blow off Flakboy's legs, but leave his arms.</en_uk><nl>Knal Flakboys benen eraf, maar laat zijn armen eraan zitten.</nl><fr>Fais sauter les jambes de Flakboy, mais épargne ses bras.</fr><de>Entferne Flakboys Beine, aber verschone seine Arme.</de><es>Vuela las piernas de Flakboy, pero déjale los brazos.</es><br>Arrebente as pernas do Flakboy, mas deixe os braços.</br><pt>Rebente com as pernas do Flakboy mas deixe-lhe ficar os braços.</pt><it>Fai volar via le gambe di Flakboy, ma lasciagli le braccia.</it><se>Spräng bort Flakboys ben, men inte armarna.</se><pl>Odstrzel Chłopcu Do Bicia nogi, ale zostaw mu ręce.</pl><ru>Оторвите Броневасе ножки, но оставьте ручки.</ru><id>Ledakkan kaki Flakboy, tapi tinggalkan lengannya.</id><jp>フラックボーイの腕は残したまま、足を吹き飛ばそう。</jp><cn>腿炸飞了,胳膊还在。</cn><ar>Blow off Flakboy's legs, but leave his arms.</ar></textItem><textItem identifier="No_Arms_Achievement"><en_us>Lend Me a Hand?</en_us><en_uk>Lend Me a Hand?</en_uk><nl>Handjes in de lucht!</nl><fr>Sans les bras !</fr><de>Gib mir deine Hand!</de><es>¿Me echas una mano?</es><br>Me dá uma mãozinha?</br><pt>Dá-me uma mão?</pt><it>Mi dai una mano?</it><se>Ge mig en hand?</se><pl>Czy podasz mi pomocną dłoń?</pl><ru>Я не вижу ваши руки!</ru><id>Pinjamkan saya sebuah tangan?</id><jp>ノーアーム</jp><cn>胳膊没了。</cn><ar>Lend Me a Hand?</ar></textItem><textItem identifier="No_Arms_Description"><en_us>Blow off Flakboy's arms, but leave his legs.</en_us><en_uk>Blow off Flakboy's arms, but leave his legs.</en_uk><nl>Knal Flakboys armen eraf, maar laat zijn benen eraan zitten.</nl><fr>Fais sauter les bras de Flakboy, mais épargne ses jambes.</fr><de>Entferne Flakboys Arme, aber verschone seine Beine.</de><es>Vuela los brazos de Flakboy, pero déjale las piernas.</es><br>Arrebente os braços do Flakboy, mas deixe as pernas.</br><pt>Rebente com os braços do Flakboy mas deixe-lhe ficar as pernas.</pt><it>Fai volar via le braccia di Flakboy, ma lasciagli le gambe.</it><se>Spräng bort Flakboys armar, men inte benen.</se><pl>Odstrzel Chłopcu Do Bicia ręce, ale zostaw mu nogi.</pl><ru>Оторвите Броневасе ручки, но оставьте ножки.</ru><id>Ledakkan lengan Flakboy, tapi tinggalkan kakinya.</id><jp>フラックボーイの足は残したまま、腕を吹き飛ばそう。</jp><cn>胳膊炸飞了,腿还在。</cn><ar>Blow off Flakboy's arms, but leave his legs.</ar></textItem><textItem identifier="No_Limbs_Achievement"><en_us>Stumpy</en_us><en_uk>Stumpy</en_uk><nl>Stompje</nl><fr>Tronco</fr><de>Rumpfbeugen</de><es>Muñoncitos</es><br>Toquinho</br><pt>Completamente atarracado</pt><it>Tozzo</it><se>Stumpar bara</se><pl>Kadłubek</pl><ru>Огрызок</ru><id>Puntungan</id><jp>オンリーボディ</jp><cn>全残了</cn><ar>Stumpy</ar></textItem><textItem identifier="No_Limbs_Description"><en_us>Blow off all Flakboy's limbs.</en_us><en_uk>Blow off all Flakboy's limbs.</en_uk><nl>Knal alle ledematen van Flakboy eraf. </nl><fr>Fais sauter tous les membres de Flakboy.</fr><de>Entferne alle Gliedmaßen von Flakboy.</de><es>Vuela todas las extremidades de Flakboy.</es><br>Arrebente todos os membros do Flakboy.</br><pt>Rebente com todos os membros do Flakboy.</pt><it>Fai volar via tutti gli arti di Flakboy.</it><se>Spräng bort Flakboys alla lemmar.</se><pl>Odstrzel Chłopcu Do Bicia wszystkie kończyny.</pl><ru>Оторвите Броневасе все конечности.</ru><id>Ledakkan tungkai dan kaki Flakboy.</id><jp>フラックボーイの足と手を吹き飛ばそう。</jp><cn>胳膊和腿都炸飞了</cn><ar>Blow off all Flakboy's limbs.</ar></textItem><textItem identifier="Money_Maker_Achievement"><en_us>High Roller</en_us><en_uk>High Roller</en_uk><nl>Gokbaas</nl><fr>Flambeur</fr><de>High Roller</de><es>Montado en el dólar</es><br>Grande apostador</br><pt>Cilindrado de todo</pt><it>Sperperatutto</it><se>Värsta krösusen</se><pl>Hazardzista</pl><ru>Воротила</ru><id>Pendapatan yang besar</id><jp>ビッグマネー</jp><cn>赚钱大师</cn><ar>High Roller</ar></textItem><textItem identifier="Money_Maker_Description"><en_us>Make over $8000 profit.</en_us><en_uk>Make a profit of over £8,000.</en_uk><nl>Meer dan € 8000 winst maken. </nl><fr>Touche un bénéfice de plus de 8000€.</fr><de>Mach mehr als €8000 Gewinn.</de><es>Obtén más de 8000 € de beneficio.</es><br>Obtenha um lucro maior que $ 8000.</br><pt>Ganhe 8000 € de lucro.</pt><it>Fai oltre €8000 di profitto.</it><se>Få över 8000 kr i vinst.</se><pl>Zdobądź ponad 8000 zł dochodu.</pl><ru>Заработайте более 8000 руб.</ru><id>Buatlah laba lebih dari $8000</id><jp>8000ドルを超える利益を獲得しよう。</jp><cn>赚了八千块</cn><ar>Make over $8000 profit.</ar></textItem><textItem identifier="Hanging_High_Achievement"><en_us>Hanging High</en_us><en_uk>Hanging High</en_uk><nl>Hoogvlieger</nl><fr>Haute voltige</fr><de>Hoch oben in der Luft</de><es>Por los aires</es><br>Voando alto</br><pt>Bem lá em cima</pt><it>Sospeso in alto</it><se>Högtflygande</se><pl>Wysoko nad ziemią</pl><ru>Полет под куполом</ru><id>Menggantung Tinggi</id><jp>空中遊泳</jp><cn>高挂 </cn><ar>Hanging High</ar></textItem><textItem identifier="Hanging_High_Description"><en_us>Keep Flakboy in the air without touching the ground for 10 seconds.</en_us><en_uk>Keep Flakboy in the air without touching the ground for 10 seconds.</en_uk><nl>Zorg dat Flakboy 10 seconden de grond niet raakt. </nl><fr>Maintiens Flakboy en l'air pendant 10 secondes sans qu'il touche le sol.</fr><de>Halte Flakboy mindestens 10 Sekunden lang in der Luft, ohne dass er dabei den Boden berührt.</de><es>Mantén a Flakboy en el aire sin tocar el suelo durante 10 segundos.</es><br>Não deixe Flakboy tocar o chão por 10 segundos.</br><pt>Mantenha o Flakboy suspenso no ar sem tocar no chão durante 10 segundos.</pt><it>Tieni Flakboy in aria senza toccare terra per 10 secondi.</it><se>Håll Flakboy i luften utan att han nuddar marken i 10 sekunder.</se><pl>Utrzymaj Chłopca Do Bicia w powietrzu przez 10 sekund bez dotykania ziemi.</pl><ru>Удерживайте Броневасю в воздухе 10 секунд, не давая коснуться пола.</ru><id>Jagalah agar Flakboy tetap di udara tanpa menyentuh tanah untuk 10 detik.</id><jp>フラックボーイを10秒間地面から浮かせたままにしよう。</jp><cn>把兵人悬在半空10秒钟。</cn><ar>Keep Flakboy in the air without touching the ground for 10 seconds.</ar></textItem><textItem identifier="Max_Damage_Achievement"><en_us>Sadistic</en_us><en_uk>Sadistic</en_uk><nl>Sadist</nl><fr>Sadique</fr><de>Sadist</de><es>Sádico</es><br>Sádico</br><pt>Sadismo total</pt><it>Sadico</it><se>Sadist</se><pl>Sadysta</pl><ru>Садюга</ru><id>Kekejaman</id><jp>サディスティック</jp><cn>虐待狂</cn><ar>Sadistic</ar></textItem><textItem identifier="Max_Damage_Description"><en_us>Achieve the maximum amount of damage.</en_us><en_uk>Achieve the maximum amount of damage.</en_uk><nl>Breng de maximum hoeveelheid schade toe. </nl><fr>Cause un maximum de dégâts.</fr><de>Richte den größtmöglichen Schaden an.</de><es>Consigue la cantidad máxima de daño.</es><br>Cause o valor máximo de dano.</br><pt>Cause o maior número de danos que conseguir.</pt><it>Realizza la quantità massima di danni.</it><se>Orsaka maximal skada.</se><pl>Osiągnij maksymalny poziom uszkodzeń.</pl><ru>Добейтесь максимальных повреждений.</ru><id>Capailah jumlah kerusakan maksimum.</id><jp>フラックボーイに最大ダメージを与えよう。</jp><cn>完成最多破坏</cn><ar>Achieve the maximum amount of damage.</ar></textItem><textItem identifier="High_Damage_Achievement"><en_us>The Damager</en_us><en_uk>The Damager</en_uk><nl>De verwoester</nl><fr>Dégator</fr><de>Der Zerstörer</de><es>El Castigador</es><br>Destruidor</br><pt>O Destruidor </pt><it>Il distruttore</it><se>Skademästare</se><pl>Niszczyciel</pl><ru>Разрушитель</ru><id>Perusak</id><jp>ダメージメーカー</jp><cn>高级破坏</cn><ar>The Damager</ar></textItem><textItem identifier="High_Damage_Description"><en_us>Get over 1000 damage.</en_us><en_uk>Inflict over 1,000 of damage.</en_uk><nl>Breng meer dan 1000 schade toe.</nl><fr>Cause plus de 1000 dégâts</fr><de>Erreiche einen Schadenswert von mehr als 1000.</de><es>Consigue más de 1000 de daño.</es><br>Cause mais de 1000 pontos de dano.</br><pt>Cause mais de 1000 danos.</pt><it>Supera i 1000 danni.</it><se>Få över 1000 i skador.</se><pl>Zdobądź ponad 1000 uszkodzeń.</pl><ru>Нанесите более 1000 очков повреждений.</ru><id>Lakukanlah lebih dari 1000 kerusakan</id><jp>フラックボーイに1000を超えるダメージを与えよう。</jp><cn>超过一千次破坏</cn><ar>Get over 1000 damage.</ar></textItem><textItem identifier="Make_Profit_Achievement"><en_us>Makin' Money</en_us><en_uk>Makin' Money</en_uk><nl>Grootverdiener</nl><fr>Récolteur d'oseille</fr><de>Geld verdienen</de><es>Ganando a lo grande</es><br>Juntando dinheiro</br><pt>Vivendo e enriquecendo</pt><it>Guadagnando</it><se>Tjäna pengar</se><pl>Nabijanie kasy</pl><ru>Главное – прибыль!</ru><id>Mendapatkan uang</id><jp>マネーメーカー</jp><cn>赚些钱</cn><ar>Makin' Money</ar></textItem><textItem identifier="Make_Profit_Description"><en_us>Make over 1$ profit on any level.</en_us><en_uk>Make a profit of over £1 in any level.</en_uk><nl>Maak in een level meer dan € 1 winst. </nl><fr>Obtiens plus d'1€ de bénéfice à n'importe quel niveau.</fr><de>Mach mehr als €1 Gewinn in einem beliebigen Level.</de><es>Obtén más de 1 € de beneficio en cualquier nivel.</es><br>Obtenha um lucro maior que $ 1 em qualquer nível.</br><pt>Ganhe mais de 1 € em cada um dos níveis.</pt><it>Fai oltre 1€ di profitto in ogni livello.</it><se>Tjäna över 1 kr i vinst på valfri nivå.</se><pl>Uzyskaj więcej niż 1 zł dochodu na którymś z poziomów.</pl><ru>Заработайте не менее 1руб на каждом уровне.</ru><id>Buatlah laba $1 dalam level apapun.</id><jp>いずれかのレベルで1ドルを超える利益を獲得しよう。</jp><cn>在任一关赚超过一块钱</cn><ar>Make over 1$ profit on any level.</ar></textItem><textItem identifier="High_Profit_Achievement"><en_us>Greedy</en_us><en_uk>Greedy</en_uk><nl>Vrek</nl><fr>Tadfric</fr><de>Habgier</de><es>Codicioso</es><br>Ganancioso</br><pt>Ganância total</pt><it>Avido</it><se>Girigbuk</se><pl>Chciwiec</pl><ru>Буржуй</ru><id>Tamak</id><jp>欲張り屋</jp><cn>贪婪</cn><ar>Greedy</ar></textItem><textItem identifier="High_Profit_Description"><en_us>Make over $1000 profit in a single level.</en_us><en_uk>Make a profit of over £1,000 in a single level.</en_uk><nl>Maak in een level meer dan € 1000 winst.</nl><fr>Obtiens plus d'1000€ de bénéfice dans un seul niveau.</fr><de>Mach mehr als €1000 Gewinn in einem einzigen Level.</de><es>Obtén más de 1000 € de beneficio en un solo nivel.</es><br>Obtenha um lucro maior que $ 1000 em um único nível.</br><pt>Ganhe mais de 1000 € num único nível.</pt><it>Fai oltre 1€ di profitto in un singolo livello.</it><se>Få över 1000 kr i vinst på en nivå.</se><pl>Uzyskaj więcej niż 1000 zł dochodu na jednym poziomie.</pl><ru>Заработайте более 1000 руб на одном уровне.</ru><id>Buatlah laba lebih dari $1000 dalam satu level.</id><jp>1つのレベルで1000ドルを超える利益を獲得しよう。</jp><cn>在一关内赚超过一千块</cn><ar>Make over $1000 profit in a single level.</ar></textItem><textItem identifier="Mine_Field_Achievement"><en_us>Mine Field</en_us><en_uk>Minefield</en_uk><nl>Mijnenveld</nl><fr>Champ de mines</fr><de>Minenfeld</de><es>Campo de minas</es><br>Campo minado</br><pt>Terreno minado</pt><it>Campo di mine</it><se>Minfält</se><pl>Pole minowe</pl><ru>Минингит</ru><id>Lahan Tambang</id><jp>マインユーザー</jp><cn>雷区</cn><ar>Mine Field</ar></textItem><textItem identifier="Mine_Field_Description"><en_us>Reach the damage target using only mines.</en_us><en_uk>Reach the damage target using only mines.</en_uk><nl>Breng de streefschade toe met alleen maar mijnen.</nl><fr>Atteins les dégâts indiqués en n'utilisant que des mines.</fr><de>Erreiche das Schadensziel nur mit Minen.</de><es>Alcanza el daño objetivo usando sólo minas.</es><br>Alcance o objetivo de dano usando apenas as minas.</br><pt>Atinja o objectivo em termos de danos, usando apenas minas.</pt><it>Raggiungi l'obiettivo di danno usando solo mine.</it><se>Nå skademålet med endast minor.</se><pl>Osiągnij wymagany poziom uszkodzeń używając tylko min.</pl><ru>Нанесите требуемые повреждения, используя только мины.</ru><id>Capailah sasaran kerusakan dengan hanya menggunakan ranjau.</id><jp>マインだけを使って目標ダメージを達成させよう。</jp><cn>只用地雷完成破坏任务</cn><ar>Reach the damage target using only mines.</ar></textItem><textItem identifier="Tools_Depleted_Achievement"><en_us>No Tool Left Behind</en_us><en_uk>No Tool Left Behind</en_uk><nl>Geen halve maatregelen</nl><fr>Table rase</fr><de>Keine Waffe mehr übrig</de><es>Ninguna herramienta sin usar</es><br>Arsenal esgotado</br><pt>Tudo ao molho</pt><it>Nessun attrezzo resti inutilizzato</it><se>Inga glömda verktyg</se><pl>Nie zostanie żadna broń</pl><ru>Все пригодилось!</ru><id>Tidak ada peralatan yang tersisa</id><jp>オールウェポン</jp><cn>后面没有工具了</cn><ar>No Tool Left Behind</ar></textItem><textItem identifier="Tools_Depleted_Description"><en_us>Place at least 6 tools and use them all up.</en_us><en_uk>Place at least 6 tools and use them all up.</en_uk><nl>Plaats en gebruik minimaal 6 hulpmiddelen.</nl><fr>Place au moins 6 objets et utilise-les tous.</fr><de>Platziere mindestens 6 Waffen und benutze die alle.</de><es>Coloca al menos 6 herramientas y úsalas todas.</es><br>Posicione pelo menos 6 armas e use todas elas.</br><pt>Posicione pelo menos 6 ferramentas e use-as a todas.</pt><it>Metti almeno 6 attrezzi ed usali tutti.</it><se>Placera ut minst 6 verktyg och använd dem alla.</se><pl>Umieść na ekranie co najmniej 6 narzędzi i wykorzystaj wszystkie.</pl><ru>Разместите на полигоне не менее 6 устройств и используйте их все.</ru><id>Letakkan paling sedikit 6 peralatan dan pergunakanlah kesemua peralatan tersebut.</id><jp>6個以上の武器を設置し、全て使い尽くそう。</jp><cn>工具减少了,必须放置大于等于六个工具</cn><ar>Place at least 6 tools and use them all up.</ar></textItem><textItem identifier="Double_Damage_Achievement"><en_us>Double Damage</en_us><en_uk>Double Damage</en_uk><nl>Dubbele schade</nl><fr>Dégâts x2</fr><de>Doppelter Schaden</de><es>Daño doble</es><br>Dano duplo</br><pt>Danos a dobrar</pt><it>Doppio danno</it><se>Dubbel skada</se><pl>Podwójne uszkodzenia</pl><ru>Двойная норма</ru><id>Kerusakan ganda</id><jp>ダブルダメージ</jp><cn>双重破坏</cn><ar>Double Damage</ar></textItem><textItem identifier="Double_Damage_Description"><en_us>Score double the damage target.</en_us><en_uk>Score double the damage target.</en_uk><nl>Scoor twee keer zo veel als de streefschade. </nl><fr>Cause deux fois plus de dégâts qu'indiqué.</fr><de>Erreiche das doppelte Schadensziel.</de><es>Consigue el doble del daño objetivo.</es><br>O placar equivale ao dobro do objetivo de dano.</br><pt>Cause o dobro dos danos indicados no alvo.</pt><it>Segna il doppio dell'obiettivo di danno.</it><se>Få dubbla skademålet.</se><pl>Podwajaj uszkodzenia.</pl><ru>Нанесите повреждения, вдвое превышающие требуемые.</ru><id>Dapatkanlah skor berlipat ganda untuk sasaran kerusakan</id><jp>目標の2倍のダメージをフラックボーイに与えよう。</jp><cn>超过目标数一倍</cn><ar>Score double the damage target.</ar></textItem><textItem identifier="Tripple_Damage_Achievement"><en_us>Triple Damage</en_us><en_uk>Triple Damage</en_uk><nl>Driedubbele schade</nl><fr>Dégâts x3</fr><de>Dreifacher Schaden</de><es>Daño triple</es><br>Dano triplo</br><pt>A conta que Deus fez</pt><it>Triplo danno</it><se>Trippel skada</se><pl>Potrójne uszkodzenia</pl><ru>Тройная норма</ru><id>Kerusakan tiga kali lipat</id><jp>トリプルダメージ</jp><cn>三倍破坏</cn><ar>Triple Damage</ar></textItem><textItem identifier="Tripple_Damage_Description"><en_us>Score triple the damage target.</en_us><en_uk>Score triple the damage target.</en_uk><nl>Scoor drie keer zo veel als de streefschade.</nl><fr>Cause trois fois plus de dégâts qu'indiqué.</fr><de>Erreiche das dreifache Schadensziel.</de><es>Consigue el triple del daño objetivo.</es><br>O placar equivale ao triplo do objetivo de dano.</br><pt>Cause três vezes mais danos do que os indicados.</pt><it>Segna il triplo dell'obiettivo di danno.</it><se>Få tre gånger skademålet.</se><pl>Potrajaj uszkodzenia.</pl><ru>Нанесите повреждения, втрое превышающие требуемые.</ru><id>Dapatkanlah skor tiga kali lipat untuk sasaran kerusakan.</id><jp>目標の3倍のダメージをフラックボーイに与えよう。</jp><cn>超过目标数二倍</cn><ar>Score triple the damage target.</ar></textItem><textItem identifier="Standing_Achievement"><en_us>Standing Strong</en_us><en_uk>Standing Strong</en_uk><nl>Staplaats</nl><fr>Enraciné</fr><de>Standhaft, standhaft</de><es>Aguantando el temporal</es><br>Firme e forte</br><pt>Aguentando firme</pt><it>Restando forte</it><se>Står stabilt</se><pl>Człowiek z żelaza</pl><ru>Стоять, я сказал!</ru><id>Berdiri tegak</id><jp>立ち往生</jp><cn>站稳</cn><ar>Standing Strong</ar></textItem><textItem identifier="Standing_Description"><en_us>Reach the damage target with Flakboy still standing at the end.</en_us><en_uk>Reach the damage target with Flakboy still standing at the end.</en_uk><nl>Behaal de streefschade, terwijl Flakboy aan het eind nog staat. </nl><fr>Atteins les dégâts indiqués ; Flakboy doit encore tenir débout.</fr><de>Erreiche das Schadensziel…aber Flakboy muss am Ende noch stehen.</de><es>Flakboy debe seguir en pie después de alcanzar el daño objetivo.</es><br>Atinja o objetivo de dano com o Flakboy ainda de pé no final.</br><pt>Cause os danos indicados, fazendo com que o Flakboy ainda se aguente em pé no fim.</pt><it>Raggiungi l'obiettivo di danno con Flakboy che resta fino alla fine. </it><se>Nå skademålet när Skadepojken fortfarande står upp.</se><pl>Osiągnij wymagany poziom uszkodzeń i utrzymaj Chłopca Do Bicia stojącego na dwóch stopach do sameg końca.</pl><ru>Нанесите требуемый объем повреждений так, чтобы Броневася остался стоять.</ru><id>Capailah sasaran kerusakan dengan Flakboy masih berdiri pada bagian akhir.</id><jp>目標ダメージを与えても、フラックボーイが最後に立っていられるようにしよう。</jp><cn>完成目标后,兵人站起来了。</cn><ar>Reach the damage target with Flakboy still standing at the end.</ar></textItem><textItem identifier="Skinned_Achievement"><en_us>Who Needs Skin?</en_us><en_uk>Who Needs Skin?</en_uk><nl>Met huid en haar</nl><fr>J'en ai pô besoin !</fr><de>Wer braucht schon Haut?</de><es>Duro de pelar</es><br>Quem precisa de pele?</br><pt>Pele para quê?</pt><it>A chi serve della pelle?</it><se>Vem behöver hud?!</se><pl>Ktoś potrzebuje skóry?</pl><ru>Долой татуировки!</ru><id>Siapa yang membutuhkan kulit?</id><jp>ノースキン</jp><cn>谁还需要皮肤?</cn><ar>Who Needs Skin?</ar></textItem><textItem identifier="Skinned_Description"><en_us>Rip off all of Flakboy's skin.</en_us><en_uk>Rip off all of Flakboy's skin.</en_uk><nl>Verwijder al Flakboy's huid. </nl><fr>Dépouille Flakboy.</fr><de>Vernichte Flakboys Haut.</de><es>Arráncale toda la piel a Flakboy.</es><br>Arranque toda a pele do Flakboy.</br><pt>Retire toda a pele ao Flakboy.</pt><it>Strappa via tutta la pelle di Flakboy</it><se>Hudfläng Flakboy.</se><pl>Obedrzyj Chłopca Do Bicia ze skóry.</pl><ru>Сдерите с Броневаси всю кожу!</ru><id>Curilah semua kulit Flakboy.</id><jp>フラックボーイの皮を剥がそう。</jp><cn>剥了他的皮</cn><ar>Rip off all of Flakboy's skin.</ar></textItem><textItem identifier="New_Achievement"><en_us>New Achievement!</en_us><en_uk>New Achievement!</en_uk><nl>Nieuwe prestatie! </nl><fr>Nouvelle performance !</fr><de>Neue Errungenschaft!</de><es>¡Nuevo logro!</es><br>Nova conquista!</br><pt>Novo feito!</pt><it>Nuovo risultato!</it><se>Ny bedrift!</se><pl>Nowe trofeum!</pl><ru>Новое достижение!</ru><id>Pencapaian Baru!</id><jp>新スペシャルゴールを達成!</jp><cn>你得到一个新成绩</cn><ar>New Achievement!</ar></textItem><textItem identifier="Submit_Score"><en_us>Submit Score</en_us><en_uk>Submit Score</en_uk><nl>Score verzenden</nl><fr>Enregistrer le score</fr><de>Punkte eintragen</de><es>Enviar puntuación</es><br>Enviar pontuação</br><pt>Enviar pontuação</pt><it>Invia punteggio</it><se>Skicka poäng</se><pl>Zapisz wynik</pl><ru>Сохранить результат</ru><id>Kumpulkan skor</id><jp>スコアを登録する</jp><cn>提交分数</cn><ar>Submit Score</ar></textItem><textItem identifier="How_To_Play"><en_us>How to Play</en_us><en_uk>How to Play</en_uk><nl>Doel van het spel</nl><fr>Instructions</fr><de>Anleitung</de><es>Cómo jugar</es><br>Como jogar</br><pt>Como jogar</pt><it>Come giocare</it><se>Spelregler</se><pl>Jak grać</pl><ru>Как играть</ru><id>Cara bermain</id><jp>遊び方</jp><cn>玩法</cn><ar>How to Play</ar></textItem><textItem identifier="Tutorial_Intro"><en_us>This is subject no. 451, code name: Flakboy. This guy can take a lot of damage, so he's going to be your, er, volunteer for the day as we test out some new weaponry.</en_us><en_uk>This is subject no. 451, code name: Flakboy. This guy can take a lot of damage, so he's going to be your... er... volunteer for the day as we test some new weaponry.</en_uk><nl>Testobject nr. 451, codenaam: Flakboy. Deze gast kan veel schade hebben, dus hij wordt vandaag je... ehm... vrijwilliger, zodat we wat nieuwe wapens kunnen testen. </nl><fr>Voici le sujet n° 451, nom de code : Flakboy. Ce gars peut subir un grand nombre de dégâts, il va donc être... heu... ton cobaye lors de tests de nouvelles armes.</fr><de>Kapitel 451, Codename: Flakboy. Dieser Kerl kann eine Menge einstecken, und daher ist er jetzt dein, ähm, Freiwilliger für den heutigen Waffentest.</de><es>Este es el sujeto de pruebas nº 451, nombre código: Flakboy. Este chico puede aguantar mucho daño, así que va a ser tu, hmm, voluntario durante el día de hoy mientras probamos nuestro nuevo armamento.</es><br>Este é o indivíduo de número 451, codinome: Flakboy. Este cara consegue suportar uma grande quantidade de dano, então, ele vai ser o nosso... é...voluntário para testarmos algumas armas novas.</br><pt>Este é o assunto nº 451, nome de código: Flakboy. Este ser consegue aguentar muita pancada, por isso vai ser o seu, digamos assim, voluntário, enquanto você testa novo armamento.</pt><it>Questo è il soggetto n. 451, nome in codice: Flakboy. Questo ragazzo può sopportare un sacco di danni, quindi è stato arruolato come tuo, ehm, volontario nell'arco della giornata mentre testiamo nuove armi.</it><se>Träffa objekt nr 451, kodnamn: Flakboy. Den här killen tål mycket stryk, så han är er, öhh, frivillige idag när vi ska testa några nya vapen.</se><pl>Oto obiekt nr 451, pseudonim: Chłopiec Do Bicia. Ten koleś może przyjąć wiele uszkodzeń, więc będzie, twoim, yyy, ochotnikiem, na którym będziemy mogli wypróbować nowy arsenał.</pl><ru>Это объект номер 13, кодовое имя – Броневася. Этому пареньку все нипочем, поэтому именно он будет вашим… хм… добровольцем в ходе испытаний нашего нового оружия.</ru><id>Ini ialah subjek no.451, nama kode: Flakboy. Senjata ini bisa melakukan banyak kerusakan, jadi dia akan menjadi milik anda, sukarelawan saat kita menguji beberapa senjata baru.</id><jp>被験者番号451、コードネーム:フラックボーイ。この被験者は非常に大きなダメージに耐えることができる特別な体の持ち主である。彼の協力により、新開発の武器のテストをこれから行う…。</jp><cn>这是兵人。</cn><ar>This is subject no. 451, code name: Flakboy. This guy can take a lot of damage, so he's going to be your, er, volunteer for the day as we test out some new weaponry.</ar></textItem><textItem identifier="Continue"><en_us>Continue</en_us><en_uk>Continue</en_uk><nl>Doorgaan</nl><fr>Continuer</fr><de>Weiter</de><es>Continuar</es><br>Continuar</br><pt>Continuar</pt><it>Continua</it><se>Fortsätt</se><pl>Kontynuuj</pl><ru>Продолжать</ru><id>Melanjutkan</id><jp>続ける</jp><cn>继续</cn><ar>Continue</ar></textItem><textItem identifier="Place_Mine_Tutorial"><en_us>Click on the mine you'd like to buy, and then drag it into place somewhere on the ground.</en_us><en_uk>Click on the mine you would like to buy, and then drag it into place at a spot on the ground.</en_uk><nl>Kies de mijn die je wilt kopen en klik erop. Sleep deze vervolgens naar een plek op de grond. </nl><fr>Clique sur la mine que tu voudrais acheter puis déplace-la quelque part sur le sol.</fr><de>Klicke auf die Mine, die du kaufen möchtest, und zieh sie dorthin, wo du sie platzieren willst.</de><es>Haz clic en la mina que quieras comprar y arrástrala a algún sitio del suelo.</es><br>Clique na mina que você gostaria de comprar e depois posicione-a em algum lugar do chão.</br><pt>Clique na mina que gostava de adquirir e depois arraste-a para o local pretendido na área de jogo.</pt><it>Clicca sulla mina che vorresti acquistare, e poi trascinala al suo posto da qualsiasi parte per terra.</it><se>Klicka på minan du vill köpa och dra den sedan till önskad plats på marken.</se><pl>Kliknij na minę, którą chcesz kupić, a następnie przeciągnij ją na wybrane miejsce na ziemi.</pl><ru>Щелкните по мине, которую вы хотите купить, а затем перетащите ее мышью на подходящее место на полу.</ru><id>Klik pada barang tambang yang ingin anda beli, dan kemudian tariklah ke tempat di atas tanah.</id><jp>購入したいマインをクリックし、フィールド上の任意の場所までドラッグして設置しよう。</jp><cn>从菜单里拿个地雷放在地上某个地方</cn><ar>Click on the mine you'd like to buy, and then drag it into place somewhere on the ground.</ar></textItem><textItem identifier="Place_Turret_Tutorial"><en_us>Now buy a turret and place it on one of the walls.</en_us><en_uk>Now buy a turret and place it on one of the walls.</en_uk><nl>Koop nu een geschutskoepel en plaats deze op één van de muren. </nl><fr>Achète maintenant une tourelle et place-la où tu veux sur le mur.</fr><de>Kaufe jetzt einen Gefechtsturm und platziere ihn an eine der Wände.</de><es>Ahora compra una torreta y colócala en uno de los muros.</es><br>Agora, compre uma torre e posicione-a em uma das paredes.</br><pt>Agora adquira uma torre e coloque-a numa das paredes. </pt><it>Ora acquista una torretta e mettila su uno dei muri.</it><se>Köp nu ett torn och placera det på en av väggarna.</se><pl>Teraz kup działo i umieść je na jednej ze ścian.</pl><ru>Теперь купите пушечную установку и разместите ее на одной из стен.</ru><id>Sekarang belilah sebuah meriam dan tempatkan di salah satu dinding.</id><jp>今度はタレットを購入し、壁のどこかに設置しよう。</jp><cn>现在拿起炮塔,放在其中一面墙上。</cn><ar>Now buy a turret and place it on one of the walls.</ar></textItem><textItem identifier="Place_Ducky_Tutorial"><en_us>Finally, place the ducky next to Flakboy…these things repulse him.</en_us><en_uk>Finally, place the ducky next to Flakboy…these things repulse him.</en_uk><nl>Zet ten slotte het badeendje naast Flakboy... Hij haat die dingen!</nl><fr>Puis place le petit canard à côté de Flakboy… l'objet qu'il déteste le plus au monde !</fr><de>Platziere jetzt noch die Ente neben Flakboy…diese kleinen Dinger stoßen ihn ab.</de><es>Por último, coloca el patito junto a Flakboy... esas cosas le repugnan.</es><br>Por fim, coloque o pato de borracha perto do Flakboy... ele morre de medo desse patinho.</br><pt>Por último, posicione o patinho junto do Flakboy… estas coisas repelem-no.</pt><it>Infine, metti la papera vicino a Flakboy…queste cose gli danno il voltastomaco.</it><se>Placera slutligen ankan bredvid Flakboy. Den stöter bort honom.</se><pl>Na końcu umieść kaczuszkę obok Chłopca... takie rzeczy go odrzucają.</pl><ru>И наконец поместите уточку рядом с Броневасей… Это единственное, чего он боится!</ru><id>Pada akhirnya, tempatkan bebek-bebek di samping Flakboy…benda-benda ini akan memukulnya mundur ke belakang.</id><jp>最後にアヒルをフラックボーイの隣に置くと、これらの武器が発動準備を始める。</jp><cn>最后,把这个鸭子放在兵人旁边。</cn><ar>Finally, place the ducky next to Flakboy…these things repulse him.</ar></textItem><textItem identifier="Press_Go_Tutorial"><en_us>Now click Go and let the fun begin! Press Stop when you think Flakboy has had enough.</en_us><en_uk>Now click Go and let the fun begin! Press Stop when you think Flakboy has had enough.</en_uk><nl>Klik nu op 'Gaan!' en leef je uit! Druk op 'Kappen' als je vindt dat Flakboy genoeg heeft gehad. </nl><fr>Clique maintenant sur 'Go' pour commencer ! Appuie sur 'Stop' quand tu penses que Flakboy en a eu assez.</fr><de>Klicke jetzt auf "Los", und ab geht's! Drücke "Stop", wenn du der Ansicht bist, dass Flakboy genug mitgemacht hat.</de><es>Ahora haz clic en ¡Ya! ¡Y que empiece la diversión! Pulsa Detener cuando creas que Flakboy ha tenido suficiente.</es><br>Clique em Já e deixe a diversão começar! Pressione Pare quando achar que o Flakboy já agüentou o suficiente.</br><pt>Agora clique em GO e inicie a diversão! Prima STOP quando achar que o Flakboy já sofreu o suficiente.</pt><it>Adesso clicca su VIA e fai iniziare il divertimento! Premi su STOP quando pensi che Flakboy ne abbia avuto abbastanza.</it><se>Klicka nu på ''Kör'' och låt det roliga börja! Tryck Stoppa när du tycker att han har fått nog.</se><pl>Teraz kliknij Start i niech zacznie się zabawa! Naciśnij Stop, kiedy uznasz, że Chłopiec Do Bicia ma już dosyć.</pl><ru>Теперь нажмите "Начать", чтобы начать испытания. Нажмите "Стоп", когда решите, что с Броневаси достаточно. </ru><id>Sekarang klik Maju dan biarkan kesenangan dimulai! Tekan Berhenti saat anda berpikir Flakboy telah mendapatkan uang yang cukup.</id><jp>ここで「開始」ボタンをクリックし、実験結果を見よう。実験が十分に行われたと思ったら、「停止」ボタンをクリックして実験を終了しよう。</jp><cn>点击“go" 看好玩的东西吧:)。当你觉得flakboy受够了的话点击停止。</cn><ar>Now click Go and let the fun begin! Press Stop when you think Flakboy has had enough.</ar></textItem><textItem identifier="Tutorial_Outro"><en_us>You haven't reached your damage target, but that's okay. Play around a bit with the weaponry you have available in your budget and you'll get there.</en_us><en_uk>You have not yet reached your damage target, but that's OK. Play around a bit with the weaponry you have available in your budget, and you'll get there.</en_uk><nl>Je hebt de streefschade niet gehaald, maar dat is oké. Speel een beetje met de wapens die je met je budget kunt kopen, dan kom je er vanzelf. </nl><fr>Tu n'as pas atteint les dégâts indiqués, mais ce n'est pas grave. Exerce-toi un peu avec les armes que tu peux acheter avec ton budget et tu y arriveras.</fr><de>Du hast das Schadensziel nicht erreicht, aber das ist okay. Experimentiere etwas mit den Waffen herum, die du dir leisten kannst, dann klappt's auch irgendwann.</de><es>No has alcanzado el daño objetivo, pero no pasa nada. Experimenta un poco con el armamento que tienes disponible en tus recursos y lo conseguirás.</es><br>Você não atingiu o objetivo de dano, mas não tem problema. Jogue um pouco com a artilharia disponível para o seu orçamento e você chegará lá.</br><pt>Não atingiu o seu alvo em termos de danos causados mas não faz mal. Treine um pouco mais com o armamento que tem disponível para o seu orçamento e lá chegará.</pt><it>Non hai raggiunto iI tuo obiettivo di danno, ma va bene. Divertiti un pò con le armi che sono disponibili nel tuo budget e ci arriverai.</it><se>Du har inte nått ditt skademål, men det gör inget. Pröva dig fram med vapnen inom din budget så kommer du att klara det.</se><pl>Nie uzyskałeś wymaganego poziomu uszkodzeń, ale nic nie szkodzi. Potrenuj trochę z bronią dostępną w ramach twojego budżetu, a na pewno ci się uda.</pl><ru>Вы не достигли требуемого уровня повреждений! Ничего страшного, покумекайте немного над оружием, которое позволяет купить ваш бюджет, и все получится!</ru><id>Anda belum mencapai sasaran kerusakan, tapi itu tidak apa-apa. Bermainlah dengan senjata anda yang tersedia dalam anggaran anda dan anda menuju kesana.</id><jp>今回は目標ダメージに達成しなかったが、大丈夫。予算内で購入可能な武器を使用して何度か練習実験をすれば、目標ダメージに達成するのもそう難しくはないはずだ。</jp><cn>你没达到目标,不过没事啦 。</cn><ar>You haven't reached your damage target, but that's okay. Play around a bit with the weaponry you have available in your budget and you'll get there.</ar></textItem><textItem identifier="Game_Complete"><en_us>Weapons Testing Complete</en_us><en_uk>Weapons Testing Complete</en_uk><nl>Wapentest voltooid</nl><fr>Test de nouvelles armes terminé</fr><de>Waffentest abgeschlossen</de><es>Test de armas completado</es><br>Teste de artilharia concluído</br><pt>Teste de armas concluído</pt><it>Test delle armi completo</it><se>Vapentestning klar</se><pl>Testowanie broni ukończone</pl><ru>Испытания оружия завершены</ru><id>Uji Senjata Selesai</id><jp>武器実験終了</jp><cn>游戏完成</cn><ar>Weapons Testing Complete</ar></textItem><textItem identifier="New_Highscore"><en_us>New High Score!</en_us><en_uk>New High Score!</en_uk><nl>Nieuwe topscore!</nl><fr>Nouveau meilleur score !</fr><de>Neuer Highscore!</de><es>¡Nueva puntuación máxima!</es><br>Nova melhor pontuação!</br><pt>Nova maior pontuação!</pt><it>Nuovo punteggio più alto!</it><se>Ny toppoäng!</se><pl>Nowy rekord!</pl><ru>Новый рекорд!</ru><id>Skor baru tertinggi!</id><jp>新記録!</jp><cn>分数创新高!</cn><ar>New High Score!</ar></textItem><textItem identifier="Gore_Message"><en_us>You are now playing the clean version of this game. If you want to get your hands a little dirty, play the full version at www.A10.com.</en_us><en_uk>You are now playing the clean version of this game. If you want to get your hands a little dirty, play the full version at www.A10.com.</en_uk><nl>Je speelt nu de gecensureerde versie van dit spel. Als je vieze handen niet erg vindt, kun je de volledige versie spelen op www.A10.com. </nl><fr>Tu joues maintenant à la version gentille de ce jeu. Si tu veux être plus sadique, joue à la version complète sur www.A10.com.</fr><de>Du spielst jetzt die saubere Version dieses Spiels. Wenn du dir die Finger ein bisschen schmutziger machen willst, spiele die Vollversion auf www.A10.com.</de><es>Estás jugando a la versión limpia de este juego. Si quieres ensuciarte un poco las manos, juega a la versión completa en www.A10.com</es><br>Você está jogando a versão pacífica do jogo. Se quiser sujar um pouco mais as mãos, jogue a versão completa no site www.A10.com.</br><pt>Está a jogar a versão mais limpa deste jogo. Se pretende mesmo sujar as suas mãos, jogue a versão completa em www.A10.com.</pt><it>Adesso stai giocando con la versione pulita del gioco. Se vuoi sporcarti un pò le mani, gioca la versione completa su www.A10.com.</it><se>Nu spelar du den snälla versionen av spelet. Om du vill pröva den läskigare versionen, spela den fullständiga versionen på www.A10.com.</se><pl>Grasz teraz w grzeczną wersję tej gry. Jeśli chcesz ubrudzić ręce trochę bardziej, zagraj w pełną wersję na www.a10.com.</pl><ru>Вы играете в смягченную версию игры. Если вы не прочь слегка запачкать свои руки, сыграйте в полную версию на www.A10.com.</ru><id>Anda sedang bermain versi bersih dari permainan ini. Jika anda ingin mengotori tangan anda sedikit, mainkan versi lengkapnya di www.A10.com.</id><jp>あなたが現在プレイしているのはデモバージョンです。もっと刺激的な実験を楽しみたいプレーヤーはwww.A10.comでフルバージョンをプレイしましょう。</jp><cn>你现在玩的是限制版。访问www.a10.com玩完整版。</cn><ar>You are now playing the clean version of this game. If you want to get your hands a little dirty, play the full version at www.A10.com.</ar></textItem><textItem identifier="Play_Without_Gore"><en_us>Clean Version</en_us><en_uk>Clean Version</en_uk><nl>Beschaafde versie</nl><fr>Version gentille</fr><de>Saubere Version</de><es>Versión limpia</es><br>Versão pacífica</br><pt>Versão suave</pt><it>Versione pulita</it><se>Snäll version</se><pl>Grzeczna wersja</pl><ru>Смягченная версия</ru><id>Versi bersih</id><jp>デモバージョン</jp><cn>完整版</cn><ar>Clean Version</ar></textItem><textItem identifier="Play_With_Gore"><en_us>Dirty Version</en_us><en_uk>Dirty Version</en_uk><nl>Ongecensureerde versie</nl><fr>Version sadique</fr><de>Schmutzige Version</de><es>Versión sucia</es><br>Versão dura</br><pt>Versão dura</pt><it>Versione sporca</it><se>Smutsig version</se><pl>Niegrzeczna wersja</pl><ru>Бесцензурная версия</ru><id>Versi tidak murni</id><jp>フルバージョン</jp><cn>正常版</cn><ar>Dirty Version</ar></textItem><textItem identifier="Site_Lock"><en_us>Play this game at</en_us><en_uk>Play this game at</en_uk><nl>Speel dit spel op</nl><fr>Joue à ce jeu sur </fr><de>Spiele dieses Spiel auf</de><es>Juega a este juego en</es><br>Experimente este jogo em</br><pt>Jogue este jogo em</pt><it>Gioca questo gioco su</it><se>Spela spelet på</se><pl>Zagraj w tę grę na</pl><ru>Сыграйте в эту игру на</ru><id>Mainkan permainan ini di</id><jp>このゲームをプレイする</jp><cn>点此玩游戏</cn><ar>Play this game at</ar></textItem><textItem identifier="Game_Restricted_Message"><en_us>Levels locked. Play the full game at: </en_us><en_uk>Levels locked. Play the full game at: </en_uk><nl>Vergrendelde levels. Speel het volledige spel op: </nl><fr>Niveaux bloqués. Joue au jeu entier sur :</fr><de>Level gesperrt. Spiele das komplette Spiel auf:</de><es>Niveles bloqueados. Juega a la versión completa en:</es><br>Níveis bloqueados. Jogue a versão completa em:</br><pt>Níveis bloqueados. Jogue a versão completa deste jogo em:</pt><it>Livelli bloccati. Gioca la versione intera su:</it><se>Nivåer låsta. Spela full version på: </se><pl>Poziomy zablokowane. Zagraj w pełną wersję gry na:</pl><ru>Эти уровни недоступны. Полную версию игры можно найти на</ru><id>Level terkunci. Mainkan permainan selengkapnya di:</id><jp>このレベルはロックされています。www.A10.comでフルバージョンをプレイしよう!</jp><cn>关卡解锁,点此玩完整版</cn><ar>Levels locked. Play the full game at: </ar></textItem><textItem identifier="play_for_highscores_and_achievements"><en_us>Play for highscores and achievements</en_us><en_uk>Play for highscores and achievements</en_uk><nl>Play for highscores and achievements</nl><fr>Play for highscores and achievements</fr><de>Play for highscores and achievements</de><es>Play for highscores and achievements</es><br>Play for highscores and achievements</br><pt>Play for highscores and achievements</pt><it>Play for highscores and achievements</it><se>Play for highscores and achievements</se><pl>Play for highscores and achievements</pl><ru>Play for highscores and achievements</ru><id>Play for highscores and achievements</id><jp>Play for highscores and achievements</jp><cn>Play for highscores and achievements</cn><ar>Play for highscores and achievements</ar></textItem><textItem identifier="btn_Ok"><en_us>Ok</en_us><en_uk>Ok</en_uk><nl>Ok</nl><fr>Ok</fr><de>Ok</de><es>Ok</es><br>Ok</br><pt>Ok</pt><it>Ok</it><se>Ok</se><pl>Ok</pl><ru>Ok</ru><id>Ok</id><jp>Ok</jp><cn>Ok</cn><ar>Ok</ar></textItem></LocalisedText>
;
SpilGame.importXMLv2(_local1);
trace("Language Data Succesfully included");
if (testMode){
Flakboy.goreVersion = true;
Flakboy.showGore = true;
Flakboy.isOnA10 = true;
} else {
if (Flakboy.goreVersion){
Flakboy.isOnA10 = (((((((((((SpilGame.embedDomain == "www.a10.com")) || ((SpilGame.embedDomain == "gamedev.dev.spilgames.com")))) || ((SpilGame.embedDomain == "stg.a10.com")))) || ((SpilGame.embedDomain == "stg.nl.a10.com")))) || ((SpilGame.embedDomain == "stg.pl.a10.com")))) || (bMochi));
Flakboy.showGore = Flakboy.isOnA10;
Flakboy.version = (Flakboy.version + "g");
};
};
trace(("Flakboy constructor, bytesLoaded = " + this.loaderInfo.bytesLoaded));
addEventListener(Event.ENTER_FRAME, checkFrame);
preloader = new PreloaderScreen(loaderInfo);
if (Flakboy.bMochi){
preloader.addEventListener(Event.COMPLETE, continueAfterAd);
} else {
bMochiAdComplete = true;
};
addChild(preloader);
}
private function checkFrame(_arg1:Event):void{
if ((((currentFrame == totalFrames)) && (bMochiAdComplete))){
removeChild(preloader);
preloader = null;
removeEventListener(Event.ENTER_FRAME, checkFrame);
startup();
};
}
private function startup():void{
stop();
var _local1:Class = (getDefinitionByName("Main") as Class);
addChild((new (_local1) as DisplayObject));
}
private function continueAfterAd(_arg1:Event):void{
bMochiAdComplete = true;
}
}
}//package
Section 519
//Flakboy_MSUIGOTHIC (Flakboy_MSUIGOTHIC)
package {
import mx.core.*;
public class Flakboy_MSUIGOTHIC extends FontAsset {
}
}//package
Section 520
//Flakboy_MyriadPro (Flakboy_MyriadPro)
package {
import mx.core.*;
public class Flakboy_MyriadPro extends FontAsset {
}
}//package
Section 521
//Flakboy_MyriadProBold (Flakboy_MyriadProBold)
package {
import mx.core.*;
public class Flakboy_MyriadProBold extends FontAsset {
}
}//package
Section 522
//Flakboy_MyriadProLight (Flakboy_MyriadProLight)
package {
import mx.core.*;
public class Flakboy_MyriadProLight extends FontAsset {
}
}//package
Section 523
//Flakboy_MyriadProLightBold (Flakboy_MyriadProLightBold)
package {
import mx.core.*;
public class Flakboy_MyriadProLightBold extends FontAsset {
}
}//package
Section 524
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 525
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import spill.flakboy.data.*;
import fl.transitions.*;
import spill.flakboy.tools.core.*;
import spill.*;
import spill.flakboy.*;
import spill.flakboy.menus.*;
import fl.motion.easing.*;
import flash.external.*;
public class Main extends Sprite {
public var O11O:m_SpilSubmitter;
private var currentScreen:DisplayObject;
private var debug:String;// = ""
private var transition:TransitionManager;
public var achievementManager:m_SpilAchievementManager;
private var transitionParameters:Object;
private var lastScreen:MovieClip;
private var transitioning:Boolean;// = false
public function Main(){
var _local2:String;
transitionParameters = {type:Fade, direction:Transition.OUT, duration:1, startPoint:5, easing:Quadratic.easeOut};
super();
Data.initialize();
ToolList.init();
var _local1:String = getCurrentURL();
if (isSentFromFriend(_local1)){
_local2 = getCode(_local1);
if (_local2.length > 5){
goSentFromFriend(_local2);
} else {
goMainScreen();
};
} else {
goMainScreen();
};
if (((Flakboy.goreVersion) && (!(Flakboy.isOnA10)))){
addChild(new PlayWithGoreScreen());
};
addEventListener(Event.ADDED_TO_STAGE, added);
}
private function showScreen(_arg1:DisplayObject):void{
var _local2:BitmapData;
var _local3:Bitmap;
if (transitioning){
transitionComplete();
};
addChildAt(_arg1, 0);
if (currentScreen){
_local2 = new BitmapData(700, 540, true, 0);
_local2.draw(currentScreen);
_local3 = new Bitmap(_local2);
lastScreen = new MovieClip();
lastScreen.addChild(_local3);
lastScreen.mouseEnabled = false;
lastScreen.mouseChildren = false;
addChild(lastScreen);
removeChild(currentScreen);
transition = new TransitionManager(lastScreen);
transition.addEventListener("allTransitionsOutDone", transitionComplete);
transition.startTransition(transitionParameters);
transitioning = true;
};
currentScreen = _arg1;
}
public function goMainScreen(_arg1:Event=null):void{
showScreen(new MainScreen(this));
}
private function added(_arg1:Event):void{
O11O = new m_SpilSubmitter(this);
stage.quality = Data.quality;
achievementManager = new m_SpilAchievementManager();
achievementManager.m_setSubmitter(O11O);
}
private function getCode(_arg1:String):String{
var _local2:Number = (_arg1.indexOf("code=") + 5);
var _local3:Number = _arg1.indexOf("&", _local2);
if (_local3 < _local2){
return (_arg1.substring(_local2));
};
return (_arg1.substring(_local2, _local3));
}
public function goSentFromFriend(_arg1:String):void{
showScreen(new Game(this, 7, _arg1));
}
private function getCurrentURL():String{
var loc:String;
if (ExternalInterface.available){
try {
loc = ExternalInterface.call("window.location.href.toString");
if (((!((loc == ""))) && (!((loc == null))))){
debug = ("ok, loc = " + loc);
return (loc);
} else {
debug = "no loc";
return ("");
};
} catch(e:SecurityError) {
debug = e.message;
return ("");
} catch(e:Error) {
debug = e.message;
return ("");
};
} else {
debug = "external interface not available";
return ("");
};
return ("");
}
private function transitionComplete(_arg1:Event=null):void{
transition.removeEventListener("allTransitionsOutDone", transitionComplete);
transitioning = false;
removeChild(lastScreen);
}
public function playLevel(_arg1:int):void{
showScreen(new Game(this, _arg1));
}
private function isSentFromFriend(_arg1:String):Boolean{
return ((_arg1.indexOf("code=") > 0));
}
public function startGame(_arg1:Event=null):void{
showScreen(new Game(this));
}
}
}//package
Section 526
//ProgressBar_barSkin (ProgressBar_barSkin)
package {
import flash.display.*;
public dynamic class ProgressBar_barSkin extends MovieClip {
}
}//package
Section 527
//ProgressBar_indeterminateSkin (ProgressBar_indeterminateSkin)
package {
import flash.display.*;
public dynamic class ProgressBar_indeterminateSkin extends MovieClip {
}
}//package
Section 528
//ProgressBar_trackSkin (ProgressBar_trackSkin)
package {
import flash.display.*;
public dynamic class ProgressBar_trackSkin extends MovieClip {
}
}//package
Section 529
//SliderThumb_disabledSkin (SliderThumb_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_disabledSkin extends MovieClip {
}
}//package
Section 530
//SliderThumb_downSkin (SliderThumb_downSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_downSkin extends MovieClip {
}
}//package
Section 531
//SliderThumb_overSkin (SliderThumb_overSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_overSkin extends MovieClip {
}
}//package
Section 532
//SliderThumb_upSkin (SliderThumb_upSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_upSkin extends MovieClip {
}
}//package
Section 533
//SliderTick_skin (SliderTick_skin)
package {
import flash.display.*;
public dynamic class SliderTick_skin extends MovieClip {
}
}//package
Section 534
//SliderTrack_disabledSkin (SliderTrack_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderTrack_disabledSkin extends MovieClip {
}
}//package
Section 535
//SliderTrack_skin (SliderTrack_skin)
package {
import flash.display.*;
public dynamic class SliderTrack_skin extends MovieClip {
}
}//package
Section 536
//SubmitterProxy (SubmitterProxy)
package {
import flash.events.*;
import flash.display.*;
import com.spilgames.api.*;
import flash.system.*;
public class SubmitterProxy extends MovieClip {
public var m_scoreXMLData:XML;
public var m_achievXMLData:XML;
private var parentObj;
public var m_scoreServerTimeXMLData:XML;
private static var _failed:Boolean = false;
private static var _loading:Boolean = false;
private static var _initialised:Boolean = false;
private static var SpilComp:SpilGamesServices;
public function SubmitterProxy():void{
var cld:*;
super();
Security.allowDomain("*");
parentObj = this.parent;
parentObj.stop();
var i:int = (parentObj.numChildren - 1);
while (i >= 0) {
cld = parentObj.getChildAt(i);
if ((cld is MovieClip)){
cld.visible = false;
} else {
if (cld != null){
parentObj.removeChild(cld);
};
};
i = (i - 1);
};
try {
parentObj["setLoader"] = setLoader;
parentObj["isDomainAllowed"] = isDomainAllowed;
parentObj["hasUserData"] = hasUserData;
parentObj["_O0000Ol01"] = setLoader;
parentObj["_O0Olll0lO"] = isDomainAllowed;
} catch(e:Error) {
trace(e);
};
}
private function SpilConfiguratorFailedToInitialise(_arg1:Event):void{
if (SpilComp){
SpilComp.removeEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.removeEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.removeEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
};
_failed = true;
_loading = false;
parentObj.dispatchEvent(new Event("LoadingFailed"));
}
public function SpilCallback(_arg1:int, _arg2:Object):void{
}
private function onLoadDone():void{
parentObj["isSWFReady"] = isSWFReady;
parentObj["setServerSelect"] = setServerSelect;
parentObj["requestScoreServerTime"] = requestScoreServerTime;
parentObj["getScoreServerTime"] = getScoreServerTime;
parentObj["submitScore"] = submitScore;
parentObj["requestHighscoreList"] = requestHighscoreList;
parentObj["requestUserHighscoreList"] = requestUserHighscoreList;
parentObj["submitGrantAward"] = submitGrantAward;
parentObj["requestAwardList"] = requestAwardList;
parentObj["requestAwardInfo"] = requestAwardInfo;
parentObj["destroy"] = destroy;
parentObj["getSpilGamesConnector"] = getSpilGamesConnector;
parentObj["_O0O1l0OO0"] = isSWFReady;
parentObj["_O0lOO010l"] = requestScoreServerTime;
parentObj["_O01Ol1O1O"] = getScoreServerTime;
parentObj["_O01lOO10O"] = submitScore;
parentObj["_O110l10ll"] = requestHighscoreList;
parentObj["_O11lll1OO0"] = requestUserHighscoreList;
parentObj["_O00OOl1Ol"] = submitGrantAward;
parentObj["_O1OlO10OO"] = requestAwardList;
parentObj["_OOlOOOll1"] = requestAwardInfo;
parentObj["_O010ll111"] = destroy;
parentObj["OO00OO1l1l"] = OO00OO1l1l();
}
private function processTimeResults(_arg1:int, _arg2:Object):void{
if (_arg2){
if (_arg2.errorMessage){
} else {
if (_arg2.xml){
m_scoreServerTimeXMLData = _arg2.xml;
};
};
} else {
m_scoreServerTimeXMLData = new XML("<hyscore><time>123456789</time></hyscore>");
};
}
private function isSWFReady():Boolean{
return (((SpilComp) && (SpilComp.isSWFReady())));
}
private function requestAwardList():void{
if (SpilComp){
SpilComp.send("Awards", "getAwardList", processAwardResults, {userName:SpilComp.getUserName(), userHash:SpilComp.getUserHash()});
};
}
public function set O1lll0ll0(_arg1:XML):void{
m_scoreServerTimeXMLData = _arg1;
}
public function OO00OO1l1l():SubmitterProxy{
return (this);
}
private function hasUserData():Boolean{
return (!(SpilComp.hasValidUserData()));
}
public function get O0l00l0O0():XML{
return (m_scoreXMLData);
}
private function destroy():void{
parentObj = null;
m_scoreXMLData = null;
m_achievXMLData = null;
}
private function requestScoreServerTime():void{
if (SpilComp){
SpilComp.send("Score", "checkServerTime", processTimeResults);
};
}
private function requestUserHighscoreList(_arg1:String):void{
if (SpilComp){
SpilComp.send("Score", "getUserRankList", processScoreResults, {targetUserName:_arg1});
};
}
public function get O1OlOO00O():XML{
return (m_achievXMLData);
}
private function submitGrantAward(_arg1:String):void{
if (SpilComp){
SpilComp.send("Awards", "submitAward", processAwardResults, {tag:_arg1, userName:SpilComp.getUserName(), userHash:SpilComp.getUserHash()});
};
}
private function setLoader(_arg1=null, _arg2:String="default", _arg3="", _arg4:int=0, _arg5:String="normal", _arg6:String="", _arg7:int=0, _arg8:int=0, _arg9:int=1, _arg10:Boolean=false, _arg11:int=1):void{
if (!_initialised){
trace("Initialising for the first time");
_initialised = true;
if (_arg1){
SpilComp = SpilGamesServices.getInstance();
SpilComp.addEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.addEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.addEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
_loading = true;
SpilComp.connect(_arg1);
} else {
throw (new Error("'container' cannot be null"));
};
} else {
trace("Initialisation called multiple times");
if (!_loading){
trace("Ready with loading");
if (!_failed){
trace("Simulate Submitter complete");
onLoadDone();
parentObj.dispatchEvent(new Event(Event.COMPLETE));
} else {
trace("Simulate Submitter LoadingFailed");
parentObj.dispatchEvent(new Event("LoadingFailed"));
};
} else {
trace("Still loading");
};
};
}
private function requestHighscoreList():void{
if (SpilComp){
SpilComp.send("Score", "getRankingList", processScoreResults, null);
};
}
public function set O0l00l0O0(_arg1:XML):void{
m_scoreXMLData = _arg1;
}
private function setServerSelect(_arg1:int):void{
if (SpilComp){
};
}
private function requestAwardInfo(_arg1:int):void{
if (SpilComp){
SpilComp.send("Awards", "getAward", SpilCallback, {awardID:_arg1});
};
}
public function set O1OlOO00O(_arg1:XML):void{
m_achievXMLData = _arg1;
}
private function processAwardResults(_arg1:int, _arg2:Object):void{
if (_arg2){
m_achievXMLData = _arg2.xml;
} else {
m_achievXMLData = new XML("<hyscor><awardid>147</awardid></hyscor>");
};
}
public function getSpilGamesConnector(){
return (SpilComp);
}
public function get O1lll0ll0():XML{
return (m_scoreServerTimeXMLData);
}
private function processScoreResults(_arg1:int, _arg2:Object):void{
if (_arg2){
m_scoreXMLData = _arg2.xml;
} else {
m_scoreXMLData = <hyscor><resultset>
<group>daily</group>
<result>
<position>1</position>
<timestamp>1271247768</timestamp>
<username>noot</username>
<authenticated>1</authenticated>
<score>2</score>
<gamelevel>0</gamelevel>
<country>NL</country>
</result>
</resultset>
<resultset>
<group>weekly</group>
<result>
<position>1</position>
<timestamp>1271247768</timestamp>
<username>noot</username>
<authenticated>1</authenticated>
<score>2</score>
<gamelevel>0</gamelevel>
<country>NL</country>
</result>
</resultset>
<resultset>
<group>monthly</group>
<result>
<position>1</position>
<timestamp>1271247768</timestamp>
<username>noot</username>
<authenticated>1</authenticated>
<score>2</score>
<gamelevel>0</gamelevel>
<country>NL</country>
</result>
</resultset>
</hyscor>
;
};
}
private function getScoreServerTime():void{
if (SpilComp){
SpilComp.send("Score", "getLatestTimeCheck", processTimeResults);
};
}
private function SpilConfiguratorReady(_arg1:Event):void{
if (SpilComp){
SpilComp.removeEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.removeEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.removeEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
};
_loading = false;
onLoadDone();
parentObj.dispatchEvent(new Event(Event.COMPLETE));
}
private function doCommTest():String{
if (SpilComp){
return ("y");
};
return (("FAILED " + SpilComp));
}
private function submitScore(_arg1:int):void{
if (SpilComp){
SpilComp.send("Score", "submitScore", processScoreResults, {score:_arg1, userName:SpilComp.getUserName(), userHash:SpilComp.getUserHash()});
};
}
private function SpilConfiguratorFailedToLoad(_arg1:Event):void{
if (SpilComp){
SpilComp.removeEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.removeEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.removeEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
};
trace("SpilConfiguratorFailedToLoad", _arg1.toString());
_failed = true;
_loading = false;
if (parentObj.hasEventListener(IOErrorEvent.IO_ERROR)){
parentObj.dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR));
};
}
private function onLegacyEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function isDomainAllowed(_arg1:Boolean=false):Boolean{
return (SpilComp.isDomainAllowed());
}
private function setLoader2(_arg1=null, _arg2:String="default", _arg3:int=1, _arg4="", _arg5:int=0, _arg6:String="normal", _arg7:String="", _arg8:int=0, _arg9:int=0, _arg10:int=1, _arg11:Boolean=false, _arg12:int=1):void{
setLoader(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12);
}
}
}//package