STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229593
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/60028106?noj=FRM60028106-21DC" width="1" height="1"></div>

eRacer.swf

This is the info page for
Flash #134405

(Click the ID number above for more basic data on this flash file.)


Text
<p align="center"><font face="Eurostile" size="30" color="#ffffff" letterSpacing="0.000000" kerning="1">00</font></p>

<p align="left"><font face="Eurostile" size="22" color="#ffffff" letterSpacing="0.000000" kerning="1">00</font></p>

<p align="center"><font face="Eurostile" size="30" color="#ffffff" letterSpacing="0.000000" kerning="1">00</font></p>

:

<p align="right"><font face="Eurostile" size="30" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p>

PLAY GAME

PLAY GAME

HIGH SCORES

HIGH SCORES

SHARE

SHARE

CONGRATULATIONS, YOU SCORED:

<p align="right"><font face="Eurostile" size="30" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p>

SUBMIT YOUR SCORE TO THE HIGH SCORE BOARD

NAME

EMAIL

RECIEVE UPDATES FROM E-COMMERCE EXPO

PRIVACY POLICY

PRIVACY POLICY

BE PART OF THE DIGITAL REVOLUTION

FOCUSSING ON E-COMMERCE AND ONLINE
RETAILING, REGISTER FOR FREE ENTRY

<p align="left"></p>

<p align="left"></p>

COMPLETE ALL FEILDS

<p align="left"><font face="Eurostile" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">THIS IS MY NAME</font></p>

<p align="left"><font face="Eurostile" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">10.</font></p>

<p align="right"><font face="Eurostile" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">5555555</font></p>

ActionScript [AS3]

Section 1
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; public class b2CircleDef extends b2ShapeDef { public var localPosition:b2Vec2; public var radius:Number; 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 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))); } 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); } 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 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)))); } public function GetLocalPosition():b2Vec2{ return (m_localPosition); } public function GetRadius():Number{ return (m_radius); } 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); } } }//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData) package Box2D.Collision.Shapes { public class b2FilterData { public var categoryBits:uint; public var maskBits:uint; public var groupIndex:int; public function b2FilterData(){ categoryBits = 1; maskBits = 0xFFFF; groupIndex = 0; super(); } 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; public var center:b2Vec2; public var I:Number; public function b2MassData(){ mass = 0; center = new b2Vec2(0, 0); I = 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 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); } 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++; }; }; } } }//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 { private var s_supportVec:b2Vec2; public var m_centroid:b2Vec2; public var m_obb:b2OBB; public var m_vertices:Array; public var m_normals:Array; public var m_coreVertices:Array; 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 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); } 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 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 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); } 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 GetOBB():b2OBB{ return (m_obb); } public function GetCentroid():b2Vec2{ return (m_centroid); } public function GetVertexCount():int{ return (m_vertexCount); } public function GetVertices():Array{ return (m_vertices); } public function GetCoreVertices():Array{ return (m_coreVertices); } public function GetNormals():Array{ return (m_normals); } 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)); } 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); } 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++; }; } 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_type:int; public var m_next:b2Shape; public var m_body:b2Body; public var m_sweepRadius:Number; public var m_density:Number; public var m_friction:Number; public var m_restitution:Number; public var m_proxyId:uint; public var m_filter:b2FilterData; public var m_isSensor:Boolean; public var m_userData; public static const e_unknownShape:int = -1; public static const e_circleShape:int = 0; public static const e_polygonShape:int = 1; public static const e_shapeTypeCount:int = 2; private static var s_proxyAABB:b2AABB = new b2AABB(); private static var s_syncAABB:b2AABB = new b2AABB(); private static var s_resetAABB: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 GetType():int{ return (m_type); } public function IsSensor():Boolean{ return (m_isSensor); } public function SetFilterData(_arg1:b2FilterData):void{ m_filter = _arg1.Copy(); } public function GetFilterData():b2FilterData{ return (m_filter.Copy()); } public function GetBody():b2Body{ return (m_body); } public function GetNext():b2Shape{ return (m_next); } public function GetUserData(){ return (m_userData); } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{ return (false); } public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{ return (false); } public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{ } public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{ } public function ComputeMass(_arg1:b2MassData):void{ } public function GetSweepRadius():Number{ return (m_sweepRadius); } public function GetFriction():Number{ return (m_friction); } public function GetRestitution():Number{ return (m_restitution); } 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 DestroyProxy(_arg1:b2BroadPhase):void{ if (m_proxyId != b2Pair.b2_nullProxy){ _arg1.DestroyProxy(m_proxyId); m_proxyId = b2Pair.b2_nullProxy; }; } 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 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 UpdateSweepRadius(_arg1:b2Vec2):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); }; } public static function Destroy(_arg1:b2Shape, _arg2):void{ } } }//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef) package Box2D.Collision.Shapes { public class b2ShapeDef { public var type:int; public var userData; public var friction:Number; public var restitution:Number; public var density:Number; public var isSensor:Boolean; public var filter:b2FilterData; public function b2ShapeDef(){ type = b2Shape.e_unknownShape; userData = null; friction = 0.2; restitution = 0; density = 0; isSensor = false; 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 lowerBound:b2Vec2; public var upperBound: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 IsLower():Boolean{ return (((value & 1) == 0)); } public function IsUpper():Boolean{ return (((value & 1) == 1)); } 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; } } }//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_pairManager:b2PairManager; public var m_proxyPool:Array; public var m_freeProxy:uint; public var m_bounds:Array; public var m_queryResults:Array; public var m_queryResultCount:int; public var m_worldAABB:b2AABB; public var m_quantizationFactor:b2Vec2; public var m_proxyCount:int; public var m_timeStamp:uint; public static const b2_invalid:uint = b2Settings.USHRT_MAX; public static const b2_nullEdge:uint = b2Settings.USHRT_MAX; 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 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 GetProxy(_arg1:int):b2Proxy{ var _local2:b2Proxy = m_proxyPool[_arg1]; if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){ return (null); }; return (_local2); } 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 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 function Commit():void{ m_pairManager.Commit(); } 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 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 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); } 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); } 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); } 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 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++; }; } 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++; }; } 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.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; public class b2Collision { public static const b2_nullFeature:uint = 0xFF; private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2(); 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 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 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 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 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 = b2_nullFeature; }; }; _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; } 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); } } }//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID) package Box2D.Collision { public class b2ContactID { public var features:Features; public var _key:uint; 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 get key():uint{ return (_key); } 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); } } }//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; public class b2ContactPoint { public var shape1:b2Shape; public var shape2:b2Shape; public var position:b2Vec2; public var velocity:b2Vec2; public var normal:b2Vec2; public var separation:Number; public var friction:Number; public var restitution:Number; public var id:b2ContactID; 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.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; public class b2Distance { private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()]; private static var s_p2s: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 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); } 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 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 - _local21) <= (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(_local15); _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(_local15); _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 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); } } }//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2Manifold { public var points:Array; public var normal:b2Vec2; public var pointCount:int; public function b2Manifold(){ pointCount = 0; super(); points = new Array(b2Settings.b2_maxManifoldPoints); var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { points[_local1] = new b2ManifoldPoint(); _local1++; }; normal = new b2Vec2(); } public function Reset():void{ var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { (points[_local1] as b2ManifoldPoint).Reset(); _local1++; }; normal.SetZero(); pointCount = 0; } 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); } } }//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint) package Box2D.Collision { import Box2D.Common.Math.*; public class b2ManifoldPoint { public var localPoint1:b2Vec2; public var localPoint2:b2Vec2; public var separation:Number; public var normalImpulse:Number; public var tangentImpulse:Number; public var id:b2ContactID; public function b2ManifoldPoint(){ localPoint1 = new b2Vec2(); localPoint2 = new b2Vec2(); id = new b2ContactID(); super(); } public function Reset():void{ localPoint1.SetZero(); localPoint2.SetZero(); separation = 0; normalImpulse = 0; tangentImpulse = 0; id.key = 0; } 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; } } }//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 { import Box2D.Common.*; public class b2Pair { public var userData; public var proxyId1:uint; public var proxyId2:uint; public var next:uint; public var status:uint; public static var b2_nullPair:uint = b2Settings.USHRT_MAX; public static var b2_nullProxy:uint = b2Settings.USHRT_MAX; public static var b2_tableCapacity:int = b2Settings.b2_maxPairs; public static var b2_tableMask:int = (b2_tableCapacity - 1); public static var e_pairBuffered:uint = 1; public static var e_pairRemoved:uint = 2; public static var e_pairFinal:uint = 4; public function b2Pair(){ userData = null; super(); } public function SetBuffered():void{ status = (status | e_pairBuffered); } public function ClearBuffered():void{ status = (status & ~(e_pairBuffered)); } public function IsBuffered():Boolean{ return (((status & e_pairBuffered) == e_pairBuffered)); } public function SetRemoved():void{ status = (status | e_pairRemoved); } public function ClearRemoved():void{ status = (status & ~(e_pairRemoved)); } public function IsRemoved():Boolean{ return (((status & e_pairRemoved) == e_pairRemoved)); } public function SetFinal():void{ status = (status | e_pairFinal); } public function IsFinal():Boolean{ return (((status & e_pairFinal) == e_pairFinal)); } } }//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback) package Box2D.Collision { public class b2PairCallback { public function PairAdded(_arg1, _arg2){ return (null); } public function PairRemoved(_arg1, _arg2, _arg3):void{ } } }//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_broadPhase:b2BroadPhase; public var m_callback:b2PairCallback; public var m_pairs:Array; public var m_freePair:uint; public var m_pairCount:int; public var m_pairBuffer:Array; public var m_pairBufferCount:int; public var m_hashTable:Array; 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; } 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(); }; } 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(); }; } 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(); }; } 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 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); } 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 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 ValidateBuffer():void{ } private function ValidateTable():void{ } 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)))); } public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{ return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2)))); } } }//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 Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{ return (p); } public function GetFirstVertex(_arg1:b2XForm):b2Vec2{ return (p); } } }//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy) package Box2D.Collision { public class b2Proxy { public var lowerBounds:Array; public var upperBounds:Array; public var overlapCount:uint; public var timeStamp:uint; public var userData; public function b2Proxy(){ lowerBounds = [uint(0), uint(0)]; upperBounds = [uint(0), uint(0)]; userData = null; super(); } public function GetNext():uint{ return (lowerBounds[0]); } public function SetNext(_arg1:uint):void{ lowerBounds[0] = (_arg1 & 0xFFFF); } public function IsValid():Boolean{ return (!((overlapCount == b2BroadPhase.b2_invalid))); } } }//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 = ((-(_local6) * _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.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; public class b2TimeOfImpact { public static var s_p1:b2Vec2 = new b2Vec2(); public static var s_p2:b2Vec2 = new b2Vec2(); public static var s_xf1:b2XForm = new b2XForm(); public static var s_xf2:b2XForm = new b2XForm(); 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 v:b2Vec2; public var id:b2ContactID; 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 _incidentVertex:int; public var _flip:int; public var _m_id:b2ContactID; public function set referenceEdge(_arg1:int):void{ _referenceEdge = _arg1; _m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF)); } public function get referenceEdge():int{ return (_referenceEdge); } public function set incidentEdge(_arg1:int):void{ _incidentEdge = _arg1; _m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00)); } public function get incidentEdge():int{ return (_incidentEdge); } public function set incidentVertex(_arg1:int):void{ _incidentVertex = _arg1; _m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000)); } 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 get flip():int{ return (_flip); } } }//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 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 SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{ col1.SetV(_arg1); col2.SetV(_arg2); } public function Copy():b2Mat22{ return (new b2Mat22(0, col1, col2)); } 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 SetIdentity():void{ col1.x = 1; col2.x = 0; col1.y = 0; col2.y = 1; } public function SetZero():void{ col1.x = 0; col2.x = 0; col1.y = 0; col2.y = 0; } public function GetAngle():Number{ return (Math.atan2(col1.y, col1.x)); } 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 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); } public function Abs():void{ col1.Abs(); col2.Abs(); } } }//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math) package Box2D.Common.Math { public class b2Math { public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0); 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 function b2IsValid(_arg1:Number):Boolean{ return (isFinite(_arg1)); } public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{ return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y))); } public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{ return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))); } 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 b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x)); return (_local3); } 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); } 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 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 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 AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y)); return (_local3); } 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 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 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 MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y)); 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 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 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 b2Abs(_arg1:Number):Number{ return (((_arg1 > 0)) ? _arg1 : -(_arg1)); } public static function b2AbsV(_arg1:b2Vec2):b2Vec2{ var _local2:b2Vec2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y)); return (_local2); } public static function b2AbsM(_arg1:b2Mat22):b2Mat22{ var _local2:b2Mat22 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2)); return (_local2); } public static function b2Min(_arg1:Number, _arg2:Number):Number{ return (((_arg1 < _arg2)) ? _arg1 : _arg2); } 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 b2Max(_arg1:Number, _arg2:Number):Number{ return (((_arg1 > _arg2)) ? _arg1 : _arg2); } 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 b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{ return (b2Max(_arg2, b2Min(_arg1, _arg3))); } public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{ return (b2MaxV(_arg2, b2MinV(_arg1, _arg3))); } public static function b2Swap(_arg1:Array, _arg2:Array):void{ var _local3:* = _arg1[0]; _arg1[0] = _arg2[0]; _arg2[0] = _local3; } public static function b2Random():Number{ return (((Math.random() * 2) - 1)); } public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{ var _local3:Number = Math.random(); _local3 = (((_arg2 - _arg1) * _local3) + _arg1); 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 b2IsPowerOfTwo(_arg1:uint):Boolean{ var _local2:Boolean = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0))); return (_local2); } } }//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep) package Box2D.Common.Math { public class b2Sweep { public var localCenter:b2Vec2; public var c0:b2Vec2; public var c:b2Vec2; public var a0:Number; public var a:Number; public var t0:Number; public function b2Sweep(){ localCenter = new b2Vec2(); c0 = new b2Vec2(); c = new b2Vec2(); super(); } 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))); } 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; }; } } }//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2) package Box2D.Common.Math { public class b2Vec2 { public var x:Number; public var y:Number; public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{ x = _arg1; y = _arg2; } public function SetZero():void{ x = 0; y = 0; } public function Set(_arg1:Number=0, _arg2:Number=0):void{ x = _arg1; y = _arg2; } public function SetV(_arg1:b2Vec2):void{ x = _arg1.x; y = _arg1.y; } public function Negative():b2Vec2{ return (new b2Vec2(-(x), -(y))); } public function Copy():b2Vec2{ return (new b2Vec2(x, y)); } public function Add(_arg1:b2Vec2):void{ x = (x + _arg1.x); y = (y + _arg1.y); } public function Subtract(_arg1:b2Vec2):void{ x = (x - _arg1.x); y = (y - _arg1.y); } public function Multiply(_arg1:Number):void{ x = (x * _arg1); y = (y * _arg1); } 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 MulTM(_arg1:b2Mat22):void{ var _local2:Number = b2Math.b2Dot(this, _arg1.col1); y = b2Math.b2Dot(this, _arg1.col2); x = _local2; } public function CrossVF(_arg1:Number):void{ var _local2:Number = x; x = (_arg1 * y); y = (-(_arg1) * _local2); } public function CrossFV(_arg1:Number):void{ var _local2:Number = x; x = (-(_arg1) * y); y = (_arg1 * _local2); } public function MinV(_arg1:b2Vec2):void{ x = ((x < _arg1.x)) ? x : _arg1.x; y = ((y < _arg1.y)) ? y : _arg1.y; } public function MaxV(_arg1:b2Vec2):void{ x = ((x > _arg1.x)) ? x : _arg1.x; y = ((y > _arg1.y)) ? y : _arg1.y; } public function Abs():void{ if (x < 0){ x = -(x); }; if (y < 0){ y = -(y); }; } public function Length():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function LengthSquared():Number{ return (((x * x) + (y * 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 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 SetIdentity():void{ position.SetZero(); R.SetIdentity(); } public function Set(_arg1:b2XForm):void{ position.SetV(_arg1.position); R.SetM(_arg1.R); } } }//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color) package Box2D.Common { import Box2D.Common.Math.*; public class b2Color { private var _r:uint; private var _g:uint; private var _b:uint; public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){ _r = 0; _g = 0; _b = 0; super(); _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 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))); } 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))); } } }//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings) package Box2D.Common { import Box2D.Common.Math.*; public class b2Settings { public static const USHRT_MAX:int = 0xFFFF; public static const b2_pi:Number = 3.14159265358979; public static const b2_maxManifoldPoints:int = 2; public static const b2_maxPolygonVertices:int = 8; public static const b2_maxProxies:int = 0x0200; public static const b2_maxPairs:int = 4096; public static const b2_linearSlop:Number = 0.005; public static const b2_angularSlop:Number = 0.0349065850398866; public static const b2_toiSlop:Number = 0.04; public static const b2_maxTOIContactsPerIsland:int = 32; public static const b2_velocityThreshold:Number = 1; public static const b2_maxLinearCorrection:Number = 0.2; public static const b2_maxAngularCorrection:Number = 0.139626340159546; public static const b2_maxLinearVelocity:Number = 200; public static const b2_maxLinearVelocitySquared:Number = 40000; public static const b2_maxAngularVelocity:Number = 250; public static const b2_maxAngularVelocitySquared:Number = 62500; public static const b2_contactBaumgarte:Number = 0.2; public static const b2_timeToSleep:Number = 0.5; public static const b2_linearSleepTolerance:Number = 0.01; public static const b2_angularSleepTolerance:Number = 0.0111111111111111; 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.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.Shapes.*; 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 Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2CircleContact(_arg1, _arg2)); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } } }//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact) package Box2D.Dynamics.Contacts { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; public class b2Contact { public var m_flags:uint; public var m_prev:b2Contact; public var m_next:b2Contact; public var m_node1:b2ContactEdge; public var m_node2:b2ContactEdge; public var m_shape1:b2Shape; public var m_shape2:b2Shape; public var m_manifoldCount:int; public var m_friction:Number; public var m_restitution:Number; public var m_toi:Number; public static var e_nonSolidFlag:uint = 1; public static var e_slowFlag:uint = 2; public static var e_islandFlag:uint = 4; public static var e_toiFlag:uint = 8; 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 GetManifolds():Array{ return (null); } public function GetManifoldCount():int{ return (m_manifoldCount); } public function IsSolid():Boolean{ return (((m_flags & e_nonSolidFlag) == 0)); } public function GetNext():b2Contact{ return (m_next); } public function GetShape1():b2Shape{ return (m_shape1); } public function GetShape2():b2Shape{ return (m_shape2); } 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 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 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 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); } 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); } } }//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 manifold:b2Manifold; public var body1:b2Body; public var body2:b2Body; public var friction:Number; public var restitution: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 localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var r1:b2Vec2; public var r2:b2Vec2; public var normalImpulse:Number; public var tangentImpulse:Number; public var positionImpulse:Number; public var normalMass:Number; public var tangentMass:Number; public var equalizedMass:Number; public var separation:Number; public var velocityBias:Number; 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 contact:b2Contact; public var prev:b2ContactEdge; public var next:b2ContactEdge; } }//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister) package Box2D.Dynamics.Contacts { public class b2ContactRegister { public var createFcn:Function; public var destroyFcn:Function; public var primary:Boolean; } }//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult) package Box2D.Dynamics.Contacts { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; public class b2ContactResult { public var shape1:b2Shape; public var shape2:b2Shape; public var position:b2Vec2; public var normal:b2Vec2; public var normalImpulse:Number; 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_step:b2TimeStep; public var m_allocator; public var m_constraints:Array; public var m_constraintCount:int; 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 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++; }; } 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))); } } }//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.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.Shapes.*; 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 Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2PolyAndCircleContact(_arg1, _arg2)); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } } }//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact) package Box2D.Dynamics.Contacts { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; public class b2PolygonContact extends b2Contact { private var m0:b2Manifold; private var m_manifolds:Array; 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 Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2PolygonContact(_arg1, _arg2)); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } } }//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_u:b2Vec2; public var m_frequencyHz:Number; public var m_dampingRatio:Number; public var m_gamma:Number; public var m_bias:Number; public var m_impulse:Number; public var m_mass: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 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 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)))); } 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 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 = new b2Vec2(); _local1.SetV(m_u); _local1.Multiply((m_inv_dt * m_impulse)); return (_local1); } override public function GetReactionTorque():Number{ return (0); } } }//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 localAnchor2:b2Vec2; public var length:Number; public var frequencyHz:Number; public var dampingRatio: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_ground1:b2Body; public var m_ground2:b2Body; public var m_revolute1:b2RevoluteJoint; public var m_prismatic1:b2PrismaticJoint; public var m_revolute2:b2RevoluteJoint; public var m_prismatic2:b2PrismaticJoint; public var m_groundAnchor1:b2Vec2; public var m_groundAnchor2:b2Vec2; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_J:b2Jacobian; public var m_constant:Number; public var m_ratio:Number; public var m_mass:Number; public var m_force:Number; 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 GetReactionForce():b2Vec2{ var _local1:b2Vec2 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y)); return (_local1); } 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); } public function GetRatio():Number{ return (m_ratio); } 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 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)); } 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)); } } }//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 angular1:Number; public var linear2:b2Vec2; public var angular2:Number; public function b2Jacobian(){ linear1 = new b2Vec2(); linear2 = new b2Vec2(); super(); } public function SetZero():void{ linear1.SetZero(); angular1 = 0; linear2.SetZero(); angular2 = 0; } public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{ linear1.SetV(_arg1); angular1 = _arg2; linear2.SetV(_arg3); angular2 = _arg4; } 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_type:int; public var m_prev:b2Joint; public var m_next:b2Joint; public var m_node1:b2JointEdge; public var m_node2:b2JointEdge; public var m_body1:b2Body; public var m_body2:b2Body; public var m_inv_dt:Number; public var m_islandFlag:Boolean; public var m_collideConnected:Boolean; public var m_userData; public static const e_unknownJoint:int = 0; public static const e_revoluteJoint:int = 1; public static const e_prismaticJoint:int = 2; public static const e_distanceJoint:int = 3; public static const e_pulleyJoint:int = 4; public static const e_mouseJoint:int = 5; public static const e_gearJoint:int = 6; public static const e_inactiveLimit:int = 0; public static const e_atLowerLimit:int = 1; public static const e_atUpperLimit:int = 2; public static const e_equalLimits:int = 3; 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 GetType():int{ return (m_type); } public function GetAnchor1():b2Vec2{ return (null); } public function GetAnchor2():b2Vec2{ return (null); } public function GetReactionForce():b2Vec2{ return (null); } public function GetReactionTorque():Number{ return (0); } public function GetBody1():b2Body{ return (m_body1); } public function GetBody2():b2Body{ return (m_body2); } public function GetNext():b2Joint{ return (m_next); } public function GetUserData(){ return (m_userData); } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function InitVelocityConstraints(_arg1:b2TimeStep):void{ } public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ } public function InitPositionConstraints():void{ } public function SolvePositionConstraints():Boolean{ return (false); } 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); } public static function Destroy(_arg1:b2Joint, _arg2):void{ } } }//package Box2D.Dynamics.Joints
Section 54
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef) package Box2D.Dynamics.Joints { import Box2D.Dynamics.*; public class b2JointDef { public var type:int; public var userData; public var body1:b2Body; public var body2:b2Body; public var collideConnected:Boolean; 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 joint:b2Joint; public var prev:b2JointEdge; public var next:b2JointEdge; } }//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 K:b2Mat22; private var K1:b2Mat22; private var K2:b2Mat22; public var m_localAnchor:b2Vec2; public var m_target:b2Vec2; public var m_impulse:b2Vec2; public var m_mass:b2Mat22; public var m_C:b2Vec2; public var m_maxForce:Number; public var m_beta:Number; public var m_gamma: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)); } override public function GetAnchor1():b2Vec2{ return (m_target); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor)); } override public function GetReactionForce():b2Vec2{ return (m_impulse); } override public function GetReactionTorque():Number{ return (0); } public function SetTarget(_arg1:b2Vec2):void{ if (m_body2.IsSleeping()){ m_body2.WakeUp(); }; m_target = _arg1; } 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 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)))); } override public function SolvePositionConstraints():Boolean{ return (true); } } }//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 target:b2Vec2; public var maxForce:Number; public var frequencyHz:Number; public var dampingRatio:Number; public var timeStep: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_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_localXAxis1:b2Vec2; public var m_localYAxis1:b2Vec2; public var m_refAngle:Number; public var m_linearJacobian:b2Jacobian; public var m_linearMass:Number; public var m_force:Number; public var m_angularMass:Number; public var m_torque:Number; public var m_motorJacobian:b2Jacobian; public var m_motorMass:Number; public var m_motorForce:Number; public var m_limitForce:Number; public var m_limitPositionImpulse:Number; public var m_lowerTranslation:Number; public var m_upperTranslation:Number; public var m_maxMotorForce:Number; public var m_motorSpeed:Number; public var m_enableLimit:Boolean; public var m_enableMotor:Boolean; public var m_limitState:int; 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 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: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 GetReactionTorque():Number{ return (m_torque); } 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 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); } public function IsLimitEnabled():Boolean{ return (m_enableLimit); } public function EnableLimit(_arg1:Boolean):void{ m_enableLimit = _arg1; } public function GetLowerLimit():Number{ return (m_lowerTranslation); } public function GetUpperLimit():Number{ return (m_upperTranslation); } public function SetLimits(_arg1:Number, _arg2:Number):void{ m_lowerTranslation = _arg1; m_upperTranslation = _arg2; } public function IsMotorEnabled():Boolean{ return (m_enableMotor); } public function EnableMotor(_arg1:Boolean):void{ m_enableMotor = _arg1; } public function SetMotorSpeed(_arg1:Number):void{ m_motorSpeed = _arg1; } public function GetMotorSpeed():Number{ return (m_motorSpeed); } public function SetMaxMotorForce(_arg1:Number):void{ m_maxMotorForce = _arg1; } public function GetMotorForce():Number{ return (m_motorForce); } 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; } 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 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)))); } } }//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 localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var localAxis1:b2Vec2; public var referenceAngle:Number; public var enableLimit:Boolean; public var lowerTranslation:Number; public var upperTranslation:Number; public var enableMotor:Boolean; public var maxMotorForce:Number; public var motorSpeed: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_ground:b2Body; public var m_groundAnchor1:b2Vec2; public var m_groundAnchor2:b2Vec2; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_u1:b2Vec2; public var m_u2:b2Vec2; public var m_constant:Number; public var m_ratio:Number; public var m_maxLength1:Number; public var m_maxLength2:Number; public var m_pulleyMass:Number; public var m_limitMass1:Number; public var m_limitMass2:Number; public var m_force:Number; public var m_limitForce1:Number; public var m_limitForce2:Number; public var m_positionImpulse:Number; public var m_limitPositionImpulse1:Number; public var m_limitPositionImpulse2:Number; public var m_state:int; public var m_limitState1:int; public var m_limitState2:int; 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; } 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 GetReactionTorque():Number{ return (0); } public function GetGroundAnchor1():b2Vec2{ var _local1:b2Vec2 = m_ground.m_xf.position.Copy(); _local1.Add(m_groundAnchor1); return (_local1); } public function GetGroundAnchor2():b2Vec2{ var _local1:b2Vec2 = m_ground.m_xf.position.Copy(); _local1.Add(m_groundAnchor2); return (_local1); } 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 GetRatio():Number{ return (m_ratio); } 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 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)))); }; } 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)); } } }//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 groundAnchor1:b2Vec2; public var groundAnchor2:b2Vec2; public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var length1:Number; public var maxLength1:Number; public var length2:Number; public var maxLength2:Number; public var ratio: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 { private var K:b2Mat22; private var K1:b2Mat22; private var K2:b2Mat22; private var K3:b2Mat22; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_pivotForce:b2Vec2; public var m_motorForce:Number; public var m_limitForce:Number; public var m_limitPositionImpulse:Number; public var m_pivotMass:b2Mat22; public var m_motorMass:Number; public var m_enableMotor:Boolean; public var m_maxMotorTorque:Number; public var m_motorSpeed:Number; public var m_enableLimit:Boolean; public var m_referenceAngle:Number; public var m_lowerAngle:Number; public var m_upperAngle:Number; public var m_limitState:int; 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 GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function GetReactionForce():b2Vec2{ return (m_pivotForce); } override public function GetReactionTorque():Number{ return (m_limitForce); } public function GetJointAngle():Number{ return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle)); } public function GetJointSpeed():Number{ return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity)); } public function IsLimitEnabled():Boolean{ return (m_enableLimit); } public function EnableLimit(_arg1:Boolean):void{ m_enableLimit = _arg1; } public function GetLowerLimit():Number{ return (m_lowerAngle); } public function GetUpperLimit():Number{ return (m_upperAngle); } public function SetLimits(_arg1:Number, _arg2:Number):void{ m_lowerAngle = _arg1; m_upperAngle = _arg2; } public function IsMotorEnabled():Boolean{ return (m_enableMotor); } public function EnableMotor(_arg1:Boolean):void{ m_enableMotor = _arg1; } public function SetMotorSpeed(_arg1:Number):void{ m_motorSpeed = _arg1; } public function GetMotorSpeed():Number{ return (m_motorSpeed); } public function SetMaxMotorTorque(_arg1:Number):void{ m_maxMotorTorque = _arg1; } 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; } 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 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)))); } } }//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 localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var referenceAngle:Number; public var enableLimit:Boolean; public var lowerAngle:Number; public var upperAngle:Number; public var enableMotor:Boolean; public var motorSpeed: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.Common.Math.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; public class b2Body { public var m_flags:uint; public var m_type:int; public var m_xf:b2XForm; public var m_sweep:b2Sweep; public var m_linearVelocity:b2Vec2; public var m_angularVelocity:Number; public var m_force:b2Vec2; public var m_torque:Number; public var m_world:b2World; public var m_prev:b2Body; public var m_next:b2Body; public var m_shapeList:b2Shape; public var m_shapeCount:int; public var m_jointList:b2JointEdge; public var m_contactList:b2ContactEdge; public var m_mass:Number; public var m_invMass:Number; public var m_I:Number; public var m_invI:Number; public var m_linearDamping:Number; public var m_angularDamping:Number; public var m_sleepTime:Number; public var m_userData; private static var s_massData:b2MassData = new b2MassData(); private static var s_xf1:b2XForm = new b2XForm(); public static var e_frozenFlag:uint = 2; public static var e_islandFlag:uint = 4; public static var e_sleepFlag:uint = 8; public static var e_allowSleepFlag:uint = 16; public static var e_bulletFlag:uint = 32; public static var e_fixedRotationFlag:uint = 64; public static var e_staticType:uint = 1; public static var e_dynamicType:uint = 2; public static var e_maxTypes:uint = 3; 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 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 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 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 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 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 GetXForm():b2XForm{ return (m_xf); } public function GetPosition():b2Vec2{ return (m_xf.position); } public function GetAngle():Number{ return (m_sweep.a); } public function GetWorldCenter():b2Vec2{ return (m_sweep.c); } public function GetLocalCenter():b2Vec2{ return (m_sweep.localCenter); } public function SetLinearVelocity(_arg1:b2Vec2):void{ m_linearVelocity.SetV(_arg1); } public function GetLinearVelocity():b2Vec2{ return (m_linearVelocity); } public function SetAngularVelocity(_arg1:Number):void{ m_angularVelocity = _arg1; } public function GetAngularVelocity():Number{ return (m_angularVelocity); } 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 ApplyTorque(_arg1:Number):void{ if (IsSleeping()){ WakeUp(); }; m_torque = (m_torque + _arg1); } 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 GetMass():Number{ return (m_mass); } public function GetInertia():Number{ return (m_I); } 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 GetWorldVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulMV(m_xf.R, _arg1)); } public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulXT(m_xf, _arg1)); } public function GetLocalVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulTMV(m_xf.R, _arg1)); } public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{ return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_arg1.x - m_sweep.c.x))))); } 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 IsBullet():Boolean{ return (((m_flags & e_bulletFlag) == e_bulletFlag)); } public function SetBullet(_arg1:Boolean):void{ if (_arg1){ m_flags = (m_flags | e_bulletFlag); } else { m_flags = (m_flags & ~(e_bulletFlag)); }; } public function IsStatic():Boolean{ return ((m_type == e_staticType)); } public function IsDynamic():Boolean{ return ((m_type == e_dynamicType)); } public function IsFrozen():Boolean{ return (((m_flags & e_frozenFlag) == e_frozenFlag)); } public function IsSleeping():Boolean{ return (((m_flags & e_sleepFlag) == e_sleepFlag)); } public function AllowSleeping(_arg1:Boolean):void{ if (_arg1){ m_flags = (m_flags | e_allowSleepFlag); } else { m_flags = (m_flags & ~(e_allowSleepFlag)); WakeUp(); }; } public function WakeUp():void{ m_flags = (m_flags & ~(e_sleepFlag)); m_sleepTime = 0; } 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 GetShapeList():b2Shape{ return (m_shapeList); } public function GetJointList():b2JointEdge{ return (m_jointList); } public function GetNext():b2Body{ return (m_next); } public function GetUserData(){ return (m_userData); } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function GetWorld():b2World{ return (m_world); } 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 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 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 Advance(_arg1:Number):void{ m_sweep.Advance(_arg1); m_sweep.c.SetV(m_sweep.c0); m_sweep.a = m_sweep.a0; SynchronizeTransform(); } } }//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef) package Box2D.Dynamics { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; public class b2BodyDef { public var massData:b2MassData; public var userData; public var position:b2Vec2; public var angle:Number; public var linearDamping:Number; public var angularDamping:Number; public var allowSleep:Boolean; public var isSleeping:Boolean; public var fixedRotation:Boolean; public var isBullet:Boolean; 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 Persist(_arg1:b2ContactPoint):void{ } public function Remove(_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.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; public class b2ContactManager extends b2PairCallback { public var m_world:b2World; public var m_nullContact:b2NullContact; public var m_destroyImmediate:Boolean; 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 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); } 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_shape2; _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--; } 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 Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; import flash.display.*; import Box2D.Dynamics.Contacts.*; public class b2DebugDraw { public var m_drawFlags:uint; public var m_sprite:Sprite; public var m_drawScale:Number; public var m_lineThickness:Number; public var m_alpha:Number; public var m_fillAlpha:Number; public var m_xformScale:Number; public static var e_shapeBit:uint = 1; public static var e_jointBit:uint = 2; public static var e_coreShapeBit:uint = 4; 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_centerOfMassBit:uint = 64; public function b2DebugDraw(){ m_drawScale = 1; m_lineThickness = 1; m_alpha = 1; m_fillAlpha = 1; m_xformScale = 1; super(); m_drawFlags = 0; } public function SetFlags(_arg1:uint):void{ m_drawFlags = _arg1; } public function GetFlags():uint{ return (m_drawFlags); } public function AppendFlags(_arg1:uint):void{ m_drawFlags = (m_drawFlags | _arg1); } public function ClearFlags(_arg1:uint):void{ m_drawFlags = (m_drawFlags & ~(_arg1)); } 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 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 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 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 DrawSegment1(_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 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.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; public class b2DestructionListener { public function SayGoodbyeJoint(_arg1:b2Joint):void{ } public function SayGoodbyeShape(_arg1:b2Shape):void{ } } }//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island) package Box2D.Dynamics { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.Joints.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; public class b2Island { public var m_allocator; public var m_listener:b2ContactListener; public var m_bodies:Array; public var m_contacts:Array; public var m_joints:Array; public var m_bodyCount:int; public var m_jointCount:int; public var m_contactCount:int; public var m_bodyCapacity:int; public var m_contactCapacity:int; public var m_jointCapacity:int; public var m_positionIterationCount: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 Clear():void{ m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; } 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 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); } 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 AddBody(_arg1:b2Body):void{ var _local2 = m_bodyCount++; m_bodies[_local2] = _arg1; } public function AddContact(_arg1:b2Contact):void{ var _local2 = m_contactCount++; m_contacts[_local2] = _arg1; } public function AddJoint(_arg1:b2Joint):void{ var _local2 = m_jointCount++; m_joints[_local2] = _arg1; } } }//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep) package Box2D.Dynamics { public class b2TimeStep { public var dt:Number; public var inv_dt:Number; public var dtRatio:Number; public var maxIterations:int; public var warmStarting:Boolean; public var positionCorrection:Boolean; } }//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World) package Box2D.Dynamics { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; public class b2World { public var m_blockAllocator; public var m_stackAllocator; public var m_lock:Boolean; public var m_broadPhase:b2BroadPhase; public var m_contactManager:b2ContactManager; public var m_bodyList:b2Body; public var m_jointList:b2Joint; public var m_contactList:b2Contact; public var m_bodyCount:int; public var m_contactCount:int; public var m_jointCount:int; public var m_gravity:b2Vec2; public var m_allowSleep:Boolean; public var m_groundBody:b2Body; public var m_destructionListener:b2DestructionListener; public var m_boundaryListener:b2BoundaryListener; public var m_contactFilter:b2ContactFilter; public var m_contactListener:b2ContactListener; public var m_debugDraw:b2DebugDraw; public var m_inv_dt0:Number; public var m_positionIterationCount:int; private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8); private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6); private static var s_xf:b2XForm = new b2XForm(); public static var m_positionCorrection:Boolean; public static var m_warmStarting:Boolean; public static var m_continuousPhysics:Boolean; 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 SetDestructionListener(_arg1:b2DestructionListener):void{ m_destructionListener = _arg1; } public function SetBoundaryListener(_arg1:b2BoundaryListener):void{ m_boundaryListener = _arg1; } public function SetContactFilter(_arg1:b2ContactFilter):void{ m_contactFilter = _arg1; } public function SetContactListener(_arg1:b2ContactListener):void{ m_contactListener = _arg1; } public function SetDebugDraw(_arg1:b2DebugDraw):void{ m_debugDraw = _arg1; } public function Validate():void{ m_broadPhase.Validate(); } public function GetProxyCount():int{ return (m_broadPhase.m_proxyCount); } public function GetPairCount():int{ return (m_broadPhase.m_pairManager.m_pairCount); } 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 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 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 Refilter(_arg1:b2Shape):void{ _arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf); } public function SetWarmStarting(_arg1:Boolean):void{ m_warmStarting = _arg1; } public function SetPositionCorrection(_arg1:Boolean):void{ m_positionCorrection = _arg1; } public function SetContinuousPhysics(_arg1:Boolean):void{ m_continuousPhysics = _arg1; } public function GetBodyCount():int{ return (m_bodyCount); } public function GetJointCount():int{ return (m_jointCount); } public function GetContactCount():int{ return (m_contactCount); } public function SetGravity(_arg1:b2Vec2):void{ m_gravity = _arg1; } public function GetGroundBody():b2Body{ return (m_groundBody); } 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 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 GetBodyList():b2Body{ return (m_bodyList); } public function GetJointList():b2Joint{ return (m_jointList); } 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 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 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 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 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.9, 0.9, 0.9), _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; }; }; } } }//package Box2D.Dynamics
Section 75
//MD5 (com.adobe.crypto.MD5) package com.adobe.crypto { import com.adobe.utils.*; public class MD5 { public static function hash(_arg1:String):String{ var _local6:int; var _local7:int; var _local8:int; var _local9:int; var _local2 = 1732584193; var _local3 = -271733879; var _local4 = -1732584194; var _local5 = 271733878; var _local10:Array = createBlocks(_arg1); var _local11:int = _local10.length; var _local12:int; while (_local12 < _local11) { _local6 = _local2; _local7 = _local3; _local8 = _local4; _local9 = _local5; _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330); _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983); _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162); _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551); _local2 = (_local2 + _local6); _local3 = (_local3 + _local7); _local4 = (_local4 + _local8); _local5 = (_local5 + _local9); _local12 = (_local12 + 16); }; return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5))); } private static function f(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg2) | (~(_arg1) & _arg3))); } private static function g(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg3) | (_arg2 & ~(_arg3)))); } private static function h(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 ^ _arg2) ^ _arg3)); } private static function i(_arg1:int, _arg2:int, _arg3:int):int{ return ((_arg2 ^ (_arg1 | ~(_arg3)))); } private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{ var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8); return ((IntUtil.rol(_local9, _arg7) + _arg3)); } private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function createBlocks(_arg1:String):Array{ var _local2:Array = new Array(); var _local3:int = (_arg1.length * 8); var _local4 = 0xFF; var _local5:int; while (_local5 < _local3) { _local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32))); _local5 = (_local5 + 8); }; _local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32))); _local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3; return (_local2); } } }//package com.adobe.crypto
Section 76
//IntUtil (com.adobe.utils.IntUtil) package com.adobe.utils { public class IntUtil { private static var hexChars:String = "0123456789abcdef"; public static function rol(_arg1:int, _arg2:int):int{ return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2)))); } public static function ror(_arg1:int, _arg2:int):uint{ var _local3:int = (32 - _arg2); return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3)))); } public static function toHex(_arg1:int, _arg2:Boolean=false):String{ var _local4:int; var _local5:int; var _local3 = ""; if (_arg2){ _local4 = 0; while (_local4 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15)))); _local4++; }; } else { _local5 = 0; while (_local5 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15)))); _local5++; }; }; return (_local3); } } }//package com.adobe.utils
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 isEmpty():Boolean{ return (_empty); } public function toURLString():String{ var _local1:Variables; _local1 = toVariables(); return (_local1.toString()); } public function toVariables():Variables{ var _local1:Variables; _local1 = new Variables(); _local1.URIencode = true; if (((!(isEmpty())) && (isNew()))){ _local1.utmcn = utmcn; }; if (((!(isEmpty())) && (!(isNew())))){ _local1.utmcr = utmcr; }; return (_local1); } public function isNew():Boolean{ return (_new); } public function get utmcn():String{ return ("1"); } 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" public function CampaignKey(){ UCCN = "utm_campaign"; UCCT = "utm_content"; UCID = "utm_id"; UCMD = "utm_medium"; UCNO = "utm_nooverride"; UCSR = "utm_source"; UCTR = "utm_term"; UGCLID = "gclid"; super(); } } }//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 hasNoOverride(_arg1:String):Boolean{ var _local2:CampaignKey; var _local3:Variables; var _local4:String; _local2 = _config.campaignKey; if (_arg1 == ""){ return (false); }; _local3 = new Variables(_arg1); _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 getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{ var _local3:CampaignInfo; var _local4:CampaignTracker; var _local5:Boolean; var _local6:Boolean; var _local7:int; var _local8:CampaignTracker; var _local9:int; _local3 = new CampaignInfo(); _local5 = false; _local6 = false; _local7 = 0; 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 isValid(_arg1:CampaignTracker):Boolean{ if (((_arg1) && (_arg1.isValid()))){ return (true); }; return (false); } public function getTrackerFromSearchString(_arg1:String):CampaignTracker{ var _local2:CampaignTracker; var _local3:CampaignTracker; var _local4:CampaignKey; var _local5:Variables; _local2 = getOrganicCampaign(); _local3 = new CampaignTracker(); _local4 = _config.campaignKey; if (_arg1 == ""){ return (_local3); }; _local5 = 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 _local2:URL; var _local3:String; var _local4:Array; var _local5:OrganicReferrer; var _local6:String; if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){ return (_local1); }; _local2 = new URL(_referrer); _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 isIgnoredReferral(_arg1:CampaignTracker):Boolean{ if (((_arg1) && ((_arg1.medium == "referral")))){ return (_config.organic.isIgnoredReferral(_arg1.source)); }; return (false); } public function getDirectCampaign():CampaignTracker{ var _local1:CampaignTracker; _local1 = 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 getReferrerCampaign():CampaignTracker{ var _local1:CampaignTracker; var _local2:URL; var _local3:String; var _local4:String; if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){ return (_local1); }; _local2 = new URL(_referrer); _local3 = _local2.hostName; _local4 = _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; _local3 = 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 id:String; public var clickId:String; public var name:String; public var term:String; public var medium:String; public var source: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 toTrackerString():String{ var _local1:Array; _local1 = []; _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)); } public function isValid():Boolean{ if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){ return (true); }; return (false); } 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; var _local3:Variables; _local2 = _arg1.split(CampaignManager.trackingDelimiter).join("&"); _local3 = 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; _local1 = toVariables(); return (_local1.toString()); } public function get utmsr():String{ return (((_info.screenWidth + "x") + _info.screenHeight)); } public function get utmcs():String{ return (_info.languageEncoding); } 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 toVariables():Variables{ var _local1:Variables; _local1 = 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 com.google.analytics.v4.*; import com.google.analytics.debug.*; import flash.net.*; 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 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 clearCookies():void{ utma.reset(); utmb.reset(); utmc.reset(); utmz.reset(); utmv.reset(); utmk.reset(); } 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 isGenuine():Boolean{ if (!hasUTMK()){ return (true); }; return ((utmk.hash == generateCookiesHash())); } public function resetCurrentSession():void{ _clearUTMB(); _clearUTMC(); save(); } public function hasUTMC():Boolean{ if (_utmc){ return (true); }; return (false); } public function hasUTMK():Boolean{ if (_utmk){ return (true); }; return (false); } public function generateCookiesHash():Number{ var _local1:String; _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 _createUMTA():void{ _utma = new UTMA(); _utma.proxy = this; } private function _createUMTB():void{ _utmb = new UTMB(); _utmb.proxy = this; } private function _createUMTC():void{ _utmc = new UTMC(); } 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 _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 _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 _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.utils.*; import com.google.analytics.external.*; public class DocumentInfo { private var _config:Configuration; private var _utmr:String; private var _adSense:AdSenseGlobals; private var _info:Environment; private var _pageURL:String; 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; _local1 = toVariables(); return (_local1.toString()); } private function _renderPageURL(_arg1:String=""):String{ var _local2:String; var _local3:String; _local2 = _info.locationPath; _local3 = _info.locationSearch; if (((!(_arg1)) || ((_arg1 == "")))){ _arg1 = (_local2 + unescape(_local3)); }; return (_arg1); } public function get utmp():String{ return (_renderPageURL(_pageURL)); } 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 get utmhid():String{ return (String(_generateHitId())); } public function toVariables():Variables{ var _local1:Variables; _local1 = 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 _name:String; private var _debug:DebugConfiguration; 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.utils.*; import com.google.analytics.data.*; public class EventInfo { private var _isEventHit:Boolean; private var _ext10:X10; 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; _local1 = 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; _local1 = 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 com.google.analytics.v4.*; import com.google.analytics.debug.*; import flash.net.*; 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; var _local3:String; var _local4:String; _local2 = _lastRequest.url; _local3 = String((_requests.length - 1)); _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; _local1 = []; 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 loader:Loader; var context:LoaderContext; var request = _arg1; loader = new Loader(); loader.name = String(_count++); context = 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 _local1:Number; var _local2:Number; _local1 = 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); }; }; } 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); } public function get utmhn():String{ return (_info.domainName); } private function _debugSend(_arg1:URLRequest):void{ var _local2:String; var _local3:String; _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; var _local3:String; var _local4:String; _local2 = _arg1.target.loader.name; _requests[_local2].complete(); _local3 = (("Gif Request #" + _local2) + " sent"); _local4 = _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 _loop:Timer; private var _stage:Stage; private var _lastMove:int; private var _debug:DebugConfiguration; private var _session:Timer; private var _inactivity:Number; private var _buffer:Buffer; public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){ var _local5:Number; var _local6:Number; var _local7:Number; super(); _local5 = _arg1.idleLoop; _local6 = _arg1.idleTimeout; _local7 = _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; _local2 = 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 getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{ var _local3:String; _local3 = _arg1.keyword; return (getKeywordValueFromPath(_local3, _arg2)); } public function isIgnoredKeyword(_arg1:String):Boolean{ if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){ return (true); }; return (false); } public function isIgnoredReferral(_arg1:String):Boolean{ if (_ignoredReferralsCache.hasOwnProperty(_arg1)){ return (true); }; return (false); } public function clear():void{ clearEngines(); clearIgnoredReferrals(); clearIgnoredKeywords(); } 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 get count():int{ return (_sources.length); } public function addSource(_arg1:String, _arg2:String):void{ var _local3:OrganicReferrer; _local3 = 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 clearIgnoredKeywords():void{ _ignoredKeywords = []; _ignoredKeywordsCache = {}; } 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 set engine(_arg1:String):void{ _engine = _arg1.toLowerCase(); } public function get keyword():String{ return (_keyword); } public function toString():String{ return (((engine + "?") + keyword)); } public function get engine():String{ return (_engine); } 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 request:URLRequest; public var end:int; public function RequestObject(_arg1:URLRequest){ start = getTimer(); this.request = _arg1; } public function toString():String{ var _local1:Array; _local1 = []; _local1.push((("duration: " + duration) + "ms")); _local1.push(("url: " + request.url)); return ((("{ " + _local1.join(", ")) + " }")); } public function get duration():int{ if (!hasCompleted()){ return (0); }; return ((end - start)); } public function hasCompleted():Boolean{ return ((end > 0)); } public function complete():void{ end = getTimer(); } } }//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 trackTrans():void{ enqueue("trackTrans"); } public function trackPageview(_arg1:String=""):void{ enqueue("trackPageview", _arg1); } public function setClientInfo(_arg1:Boolean):void{ enqueue("setClientInfo", _arg1); } 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 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 resetSession():void{ enqueue("resetSession"); } public function setDetectFlash(_arg1:Boolean):void{ enqueue("setDetectFlash", _arg1); } public function clear():void{ _ar = []; } 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 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 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 setCampSourceKey(_arg1:String):void{ enqueue("setCampSourceKey", _arg1); } public function setCampContentKey(_arg1:String):void{ enqueue("setCampContentKey", _arg1); } public function clearIgnoredRef():void{ enqueue("clearIgnoredRef"); } 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 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 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 setDetectTitle(_arg1:Boolean):void{ enqueue("setDetectTitle", _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 _local3:Array; var _local4:String; var _local5:int; var _local6:int; var _local7:int; if (_arg1 == ""){ return (""); }; _local3 = [" ", "\n", "\r", "\t"]; _local4 = _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 _local2:int; var _local3:int; var _local4:int; var _local5:int; _local2 = 1; _local3 = 0; 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; _local2 = /^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 toURLString():String; function toSharedObject():Object; function set creation(_arg1:Date):void; function fromSharedObject(_arg1:Object):void; function get expiration():Date; function isExpired():Boolean; function set expiration(_arg1:Date):void; function get creation():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 _domainHash:Number; private var _firstTime:Number; private var _currentTime:Number; private var _sessionId: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 get sessionCount():Number{ return (_sessionCount); } public function get firstTime():Number{ return (_firstTime); } public function set sessionId(_arg1:Number):void{ _sessionId = _arg1; update(); } public function set sessionCount(_arg1:Number):void{ _sessionCount = _arg1; update(); } public function set firstTime(_arg1:Number):void{ _firstTime = _arg1; update(); } public function set currentTime(_arg1:Number):void{ _currentTime = _arg1; update(); } public function get sessionId():Number{ return (_sessionId); } public function set domainHash(_arg1:Number):void{ _domainHash = _arg1; update(); } public function get currentTime():Number{ return (_currentTime); } public function get domainHash():Number{ return (_domainHash); } } }//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 _lastTime:Number; private var _domainHash:Number; private var _trackCount: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 get token():Number{ return (_token); } public function set trackCount(_arg1:Number):void{ _trackCount = _arg1; update(); } public function set lastTime(_arg1:Number):void{ _lastTime = _arg1; update(); } public function get lastTime():Number{ return (_lastTime); } public function set domainHash(_arg1:Number):void{ _domainHash = _arg1; update(); } public function get domainHash():Number{ return (_domainHash); } public function set token(_arg1:Number):void{ _token = _arg1; update(); } 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 set domainHash(_arg1:Number):void{ _domainHash = _arg1; update(); } public function get domainHash():Number{ return (_domainHash); } } }//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; private var _timespan:Number; protected var fields:Array; 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 _local1:int; var _local2:String; var _local3:int; _local1 = 0; _local3 = 0; 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); } protected function update():void{ resetTimestamp(); if (proxy){ proxy.update(name, toSharedObject()); }; } public function fromSharedObject(_arg1:Object):void{ var _local2:String; var _local3:int; var _local4:int; _local3 = fields.length; _local4 = 0; 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; var _local2:Number; _local1 = new Date(); _local2 = (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 reset():void{ var _local1:String; var _local2:int; _local2 = 0; 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 valueOf():String{ var _local1:Array; var _local2:String; var _local3:*; var _local4:int; _local1 = []; _local4 = 0; 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 resetTimestamp(_arg1:Number=NaN):void{ if (!isNaN(_arg1)){ _timespan = _arg1; }; _creation = null; _expiration = null; _timestamp(_timespan); } public function get expiration():Date{ if (_expiration){ return (_expiration); }; return (new Date((new Date().valueOf() + 1000))); } public function toURLString():String{ return (((inURL + "=") + valueOf())); } public function toSharedObject():Object{ var _local1:Object; var _local2:String; var _local3:*; var _local4:int; _local1 = {}; _local4 = 0; 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 _local2:Array; var _local3:String; var _local4:*; var _local5:int; var _local6:int; var _local7:String; _local2 = []; _local5 = fields.length; _local6 = 0; 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)); }; }; }; }; _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 get hash():Number{ return (_hash); } public function set hash(_arg1:Number):void{ _hash = _arg1; update(); } } }//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; } public function get value():String{ return (_value); } public function set value(_arg1:String):void{ _value = _arg1; update(); } override public function toURLString():String{ return (((inURL + "=") + encodeURI(valueOf()))); } public function get domainHash():Number{ return (_domainHash); } public function set domainHash(_arg1:Number):void{ _domainHash = _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 _domainHash:Number; private var _campaignSessions:Number; private var _campaignTracking:String; private var _responseCount:Number; private var _campaignCreation: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 get campaignCreation():Number{ return (_campaignCreation); } public function set campaignSessions(_arg1:Number):void{ _campaignSessions = _arg1; update(); } public function set responseCount(_arg1:Number):void{ _responseCount = _arg1; update(); } public function set campaignCreation(_arg1:Number):void{ _campaignCreation = _arg1; update(); } public function get campaignSessions():Number{ return (_campaignSessions); } public function get responseCount():Number{ return (_responseCount); } public function set domainHash(_arg1:Number):void{ _domainHash = _arg1; update(); } public function get campaignTracking():String{ return (_campaignTracking); } public function set campaignTracking(_arg1:String):void{ _campaignTracking = _arg1; update(); } public function get domainHash():Number{ return (_domainHash); } } }//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 _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 _projectData:Object; private var _hasData:int; private var _escapeCharMap:Object; private var _minimum:int; private var _value:String;// = "v" public function X10(){ _key = "k"; _value = "v"; _set = [_key, _value]; _delimBegin = "("; _delimEnd = ")"; _delimSet = "*"; _delimNumValue = "!"; _escapeChar = "'"; super(); _projectData = {}; _escapeCharMap = {}; _escapeCharMap[_escapeChar] = "'0"; _escapeCharMap[_delimEnd] = "'1"; _escapeCharMap[_delimSet] = "'2"; _escapeCharMap[_delimNumValue] = "'3"; _minimum = 1; } 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 hasData():Boolean{ return ((_hasData > 0)); } 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); } 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 _local2:Array; var _local3:String; var _local4:int; _local2 = []; _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 clearValue(_arg1:Number):void{ _clearInternal(_arg1, _value); } public function renderMergedUrlString(_arg1:X10=null):String{ var _local2:Array; var _local3:String; if (!_arg1){ return (renderUrlString()); }; _local2 = [_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 _local1:Array; var _local2:String; _local1 = []; 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 getValue(_arg1:Number, _arg2:Number){ var _local3:*; _local3 = _getInternal(_arg1, _value, _arg2); if (_local3 == null){ return (null); }; return (Number(_local3)); } private function _renderProject(_arg1:Object):String{ var _local2:String; var _local3:Boolean; var _local4:int; var _local5:Array; var _local6:int; _local2 = ""; _local3 = false; _local6 = _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); } private function _escapeExtensibleValue(_arg1:String):String{ var _local2:String; var _local3:int; var _local4:String; var _local5:String; _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.net.*; import flash.text.*; public class _Style { public var borderColor:uint; public var backgroundColor:uint; private var _sheet:StyleSheet; public var roundedCorner:uint; public var alertColor:uint; public var infoColor:uint; public var successColor:uint; private var _loader:URLLoader; public var failureColor:uint; private var _defaultSheet:String; public var warningColor:uint; 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 actionOnNextLine:Boolean;// = true public var autoClose: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){ var _local8:int; autoClose = true; actionOnNextLine = 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 = []; _local8 = 0; while (_local8 < _arg2.length) { _arg2[_local8].container = this; _actions.push(_arg2[_local8]); _local8++; }; } protected function getAction(_arg1:String):AlertAction{ var _local2:int; _local2 = 0; while (_local2 < _actions.length) { if (_arg1 == _actions[_local2].activator){ return (_actions[_local2]); }; _local2++; }; return (null); } override protected function layout():void{ super.layout(); _defineActions(); } protected function spaces(_arg1:int):String{ var _local2:String; var _local3:String; var _local4:int; _local2 = ""; _local3 = " "; _local4 = 0; 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(); }; } protected function isValidAction(_arg1:String):Boolean{ var _local2:int; _local2 = 0; while (_local2 < _actions.length) { if (_arg1 == _actions[_local2].activator){ return (true); }; _local2++; }; return (false); } private function _defineActions():void{ var _local1:String; var _local2:Array; var _local3:AlertAction; var _local4:int; _local1 = ""; if (actionOnNextLine){ _local1 = (_local1 + "\n"); } else { _local1 = (_local1 + " |"); }; _local1 = (_local1 + " "); _local2 = []; _local4 = 0; 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"); } 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 name:String; public var activator: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; _local7 = 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 public var maxLines:uint;// = 16 private var _linediff:int;// = 0 public static var count:uint = 0; public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){ _linediff = 0; _preferredForcedWidth = 540; maxLines = 16; 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 close():void{ dispose(); } public function writeBold(_arg1:String):void{ write(_arg1, true); } override protected function dispose():void{ removeEventListener(KeyboardEvent.KEY_DOWN, onKey); super.dispose(); } override public function get forcedWidth():uint{ if (this.parent){ if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){ return (_preferredForcedWidth); }; return (UISprite(this.parent).forcedWidth); } else { }; return (!NULL!); } 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"); } public function write(_arg1:String, _arg2:Boolean=false):void{ var _local3:Array; var _local4:String; var _local5:String; var _local6:int; var _local7:Array; if (_arg1.indexOf("") > -1){ _local3 = _arg1.split("\n"); } else { _local3 = [_arg1]; }; _local4 = ""; _local5 = ""; if (_arg2){ _local4 = "<b>"; _local5 = "</b>"; }; _local6 = 0; while (_local6 < _local3.length) { _lines.push(((_local4 + _local3[_local6]) + _local5)); _local6++; }; _local7 = _getLinesToDisplay(); text = _local7.join("\n"); } 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); } } }//package com.google.analytics.debug
Section 113
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration) package com.google.analytics.debug { import com.google.analytics.core.*; import flash.net.*; 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 infoTimeout:Number;// = 1000 public var showInfos:Boolean;// = true 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(){ _active = false; _verbose = false; _visualInitialized = false; _mode = VisualDebugMode.basic; traceOutput = false; javascript = false; GIFRequests = false; showInfos = true; infoTimeout = 1000; showWarnings = true; warningTimeout = 1500; minimizedOnStart = false; 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 _local2:Array; var _local3:String; var _local4:String; var _local5:int; var _local6:int; var _local7:Array; var _local8:int; _local2 = []; _local3 = ""; _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)); }; _local5 = _local2.length; _local6 = 0; 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; var _local5:Boolean; var _local6:Boolean; _local4 = Align.bottomLeft; _local5 = true; _local6 = false; 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 com.google.analytics.core.*; import flash.net.*; public interface ILayout { function createWarning(_arg1:String):void; function addToStage(_arg1:DisplayObject):void; function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):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 createAlert(_arg1:String):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 onComplete(_arg1:TimerEvent):void{ close(); } override public function onLink(_arg1:TextEvent):void{ switch (_arg1.text){ case "hide": close(); break; }; } public function close():void{ if (parent != null){ parent.removeChild(this); }; } } }//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 _text:String; private var _textField:TextField; private var _color:uint; protected var selectable:Boolean; public var stickToEdge:Boolean; private var _background:Shape; 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); } override protected function dispose():void{ _textField.removeEventListener(TextEvent.LINK, onLink); super.dispose(); } private function _draw():void{ var _local1:Graphics; var _local2:uint; var _local3:uint; _local1 = _background.graphics; _local1.clear(); _local1.beginFill(_color); _local2 = _textField.width; _local3 = _textField.height; if (forcedWidth > 0){ _local2 = forcedWidth; }; Background.drawRounded(this, _local1, _local2, _local3); _local1.endFill(); } 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 get text():String{ return (_textField.text); } public function set tag(_arg1:String):void{ _tag = _arg1; text = ""; } public function set text(_arg1:String):void{ if (_arg1 == ""){ _arg1 = _text; }; _textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>"); _text = _arg1; _draw(); resize(); } 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 onLink(_arg1:TextEvent):void{ } public function get tag():String{ return (_tag); } } }//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 com.google.analytics.core.*; import flash.net.*; 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){ _maxCharPerLine = 85; super(); _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 bringToFront(_arg1:DisplayObject):void{ _display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1)); } public function createFailureAlert(_arg1:String):void{ var _local2:AlertAction; var _local3:Alert; if (_debug.verbose){ _arg1 = _filterMaxChars(_arg1); _local2 = new AlertAction("Close", "close", "close"); } else { _local2 = new AlertAction("X", "close", "close"); }; _local3 = 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:int; var _local2:uint; var _local3:uint; var _local4:Panel; _local1 = 10; _local2 = (_display.stage.stageWidth - (_local1 * 2)); _local3 = (_display.stage.stageHeight - (_local1 * 2)); _local4 = 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 _local3:DisplayObject; var _local4:Panel; _local3 = _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 _local3:String; var _local4:Array; var _local5:Array; var _local6:String; var _local7:int; _local3 = "\n"; _local4 = []; _local5 = _arg1.split(_local3); if (_arg2 == 0){ _arg2 = _maxCharPerLine; }; _local7 = 0; 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)); } public function createWarning(_arg1:String):void{ var _local2:Warning; if (((_hasWarning) || (!(isAvailable())))){ _warningQueue.push(_arg1); return; }; _arg1 = _filterMaxChars(_arg1); _hasWarning = true; _local2 = new Warning(_arg1, _debug.warningTimeout); addToPanel("analytics", _local2); _local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true); if (_hasDebug){ visualDebug.writeBold(_arg1); }; } 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; var _local3:Alert; if (_debug.verbose){ _arg1 = _filterMaxChars(_arg1); _local2 = new AlertAction("Close", "close", "close"); } else { _local2 = new AlertAction("X", "close", "close"); }; _local3 = 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{ var _local2:Alert; _arg1 = _filterMaxChars(_arg1); _local2 = new Alert(_arg1, [new AlertAction("Close", "close", "close")]); addToPanel("analytics", _local2); if (_hasDebug){ visualDebug.writeBold(_arg1); }; } public function createInfo(_arg1:String):void{ var _local2:Info; if (((_hasInfo) || (!(isAvailable())))){ _infoQueue.push(_arg1); return; }; _arg1 = _filterMaxChars(_arg1); _hasInfo = true; _local2 = 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 f:Function; var gra:GIFRequestAlert; var message = _arg1; var request = _arg2; var ref = _arg3; if (_hasGRAlert){ _GRAlertQueue.push([message, request, ref]); return; }; _hasGRAlert = true; f = function ():void{ ref.sendRequest(request); }; message = _filterMaxChars(message); gra = 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; _local4 = 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 bottom:int; public var top:int; public var right:int; public var left: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 { protected var baseAlpha:Number; private var _border:Shape; private var _name:String; private var _title:Label; private var _data:UISprite; private var _backgroundColor:uint; private var _colapsed:Boolean; private var _stickToEdge:Boolean; private var _background:Shape; private var _savedW:uint; private var _mask:Sprite; private var _savedH:uint; private var _borderColor:uint; 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 set stickToEdge(_arg1:Boolean):void{ _stickToEdge = _arg1; _title.stickToEdge = _arg1; } public function onToggle(_arg1:MouseEvent=null):void{ if (_colapsed){ _data.visible = true; } else { _data.visible = false; }; _colapsed = !(_colapsed); _update(); resize(); } override protected function dispose():void{ _title.removeEventListener(MouseEvent.CLICK, onToggle); super.dispose(); } private function _draw():void{ var _local1:uint; var _local2:uint; var _local3:Graphics; var _local4:Graphics; var _local5:Graphics; var _local6:Graphics; 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; }; _local3 = _background.graphics; _local3.clear(); _local3.beginFill(_backgroundColor); Background.drawRounded(this, _local3, _local1, _local2); _local3.endFill(); _local4 = _data.graphics; _local4.clear(); _local4.beginFill(_backgroundColor, 0); Background.drawRounded(this, _local4, _local1, _local2); _local4.endFill(); _local5 = _border.graphics; _local5.clear(); _local5.lineStyle(0.1, _borderColor); Background.drawRounded(this, _local5, _local1, _local2); _local5.endFill(); _local6 = _mask.graphics; _local6.clear(); _local6.beginFill(_backgroundColor); Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1)); _local6.endFill(); } override protected function layout():void{ _update(); addChild(_background); addChild(_data); addChild(_title); addChild(_border); addChild(_mask); mask = _mask; } public function get title():String{ return (_title.text); } public function get stickToEdge():Boolean{ return (_stickToEdge); } public function set title(_arg1:String):void{ _title.text = _arg1; } private function _update():void{ _draw(); if (baseAlpha < 1){ _background.alpha = baseAlpha; _border.alpha = baseAlpha; }; } public function addData(_arg1:DisplayObject):void{ _data.addChild(_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; var _local5:Boolean; var _local6:Boolean; _local4 = Align.bottomLeft; _local5 = true; _local6 = false; 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 _forcedHeight:uint; protected var listenResize:Boolean; public var alignement:Align; private var _forcedWidth:uint; public var margin:Margin; protected var alignTarget:DisplayObject; 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); } protected function dispose():void{ var _local1:DisplayObject; var _local2:int; _local2 = 0; while (_local2 < numChildren) { _local1 = getChildAt(_local2); if (_local1){ removeChild(_local1); }; _local2++; }; } protected function layout():void{ } public function get forcedHeight():uint{ if (_forcedHeight){ return (_forcedHeight); }; return (height); } 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; } public function get forcedWidth():uint{ if (_forcedWidth){ return (_forcedWidth); }; return (width); } protected function onResize(_arg1:Event):void{ resize(); } 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); }; } private function _onAddedToStage(_arg1:Event):void{ layout(); resize(); } public function set forcedHeight(_arg1:uint):void{ _forcedHeight = _arg1; } public function set forcedWidth(_arg1:uint):void{ _forcedWidth = _arg1; } } }//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 onComplete(_arg1:TimerEvent):void{ close(); } override public function onLink(_arg1:TextEvent):void{ switch (_arg1.text){ case "hide": close(); break; }; } public function close():void{ if (parent != null){ parent.removeChild(this); }; } } }//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){ _gaGlobalVerified = false; 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 get dh():String{ if (!isAvailable()){ return (null); }; _verify(); return (getProperty("gaGlobal.dh")); } public function get gaGlobal():Object{ if (!isAvailable()){ return (null); }; _verify(); return (getProperty("gaGlobal")); } public function set hid(_arg1:String):void{ if (!isAvailable()){ return; }; _verify(); setProperty("gaGlobal.hid", _arg1); } public function get sid():String{ if (!isAvailable()){ return (null); }; _verify(); return (getProperty("gaGlobal.sid")); } private function _verify():void{ if (!_gaGlobalVerified){ executeBlock(gaGlobal_js); _gaGlobalVerified = true; }; } public function get vid():String{ if (!isAvailable()){ return (null); }; _verify(); return (getProperty("gaGlobal.vid")); } public function set sid(_arg1:String):void{ if (!isAvailable()){ return; }; _verify(); setProperty("gaGlobal.sid", _arg1); } } }//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 _protocol:String; private var _host:String; private var _location:String; private var _pathname:String; private var _title:String; private var _characterSet:String; private var _search:String; private var _language: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 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 cacheProperties():void{ var _local1:Object; if (!isAvailable()){ return; }; _local1 = 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 colorDepth():String{ if (_colorDepth){ return (_colorDepth); }; if (!isAvailable()){ return (null); }; _colorDepth = getProperty("window.screen.colorDepth"); return (_colorDepth); } public function get title():String{ if (_title){ return (_title); }; if (!isAvailable()){ return (null); }; _title = getProperty("document.title"); return (_title); } 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{ var _local1:String; if (_characterSet){ return (_characterSet); }; if (!isAvailable()){ return (null); }; _local1 = getProperty("document.characterSet"); if (_local1 == null){ _local1 = getProperty("document.charset"); }; _characterSet = _local1; return (_characterSet); } public function get language():String{ var _local1:String; if (_language){ return (_language); }; if (!isAvailable()){ return (null); }; _local1 = getProperty("navigator.language"); if (_local1 == null){ _local1 = getProperty("navigator.browserLanguage"); }; _language = _local1; return (_language); } } }//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.external.*; import flash.system.*; 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){ _notAvailableWarning = true; super(); _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; _local1 = 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.core.*; 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 playerType():String{ return (Capabilities.playerType); } public function get locationSearch():String{ var _local1:String; _local1 = _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; _local1 = Version.fromString(Capabilities.version.split(" ")[1], ","); return (_local1); } public function get screenWidth():Number{ return (Capabilities.screenResolutionX); } 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; var _local2:String; switch (Capabilities.screenColor){ case "bw": _local1 = "1"; break; case "gray": _local1 = "2"; break; case "color": default: _local1 = "24"; }; _local2 = _dom.colorDepth; if (_local2){ _local1 = _local2; }; return (_local1); } private function _findProtocol():void{ var _local1:Protocols; var _local2:String; var _local3:String; var _local4:String; var _local5:String; _local1 = 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; }; }; _local2 = _dom.protocol; _local3 = (_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; _local1 = 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; } public function get userAgent():UserAgent{ if (!_userAgent){ _userAgent = new UserAgent(this, appName, appVersion.toString(4)); }; return (_userAgent); } ga_internal function set url(_arg1:String):void{ _url = _arg1; } public function get referrer():String{ var _local1:String; _local1 = _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; var _local2:String; _local1 = _dom.language; _local2 = 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; _local1 = _dom.pathname; if (_local1){ return (_local1); }; return (""); } public function get documentTitle():String{ var _local1:String; _local1 = _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; _local1 = _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 search():String{ var _local1:String; _local1 = _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); } public function get subDomain():String{ if (((!((domain == ""))) && (!((domain == hostName))))){ return (hostName.split(("." + domain)).join("")); }; return (""); } public function get protocol():Protocols{ var _local1:String; _local1 = _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; _local1 = _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); } } }//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 _version:Version; private var _localInfo:Environment; private var _applicationProduct:String; 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 set applicationProduct(_arg1:String):void{ _applicationProduct = _arg1; } public function get applicationVersion():String{ return (_version.toString(2)); } public function get applicationProductToken():String{ var _local1:String; _local1 = applicationProduct; if (applicationVersion != ""){ _local1 = (_local1 + ("/" + applicationVersion)); }; return (_local1); } public function get vendorProductToken():String{ var _local1:String; _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:String; _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 = []; _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 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 = []; sort = true; 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; var _local3:int; _local2 = _args.length; _local3 = 0; while (_local3 < _local2) { if (!(_args[_local3] is Variables)){ } else { _join(_args[_local3]); }; _local3++; }; } public function toString():String{ var _local1:Array; var _local2:String; var _local3:String; var _local4:String; var _local5:int; var _local6:int; var _local7:String; var _local8:String; _local1 = []; 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; var _local7:int; if (_arg1 == ""){ return; }; if (_arg1.indexOf("&") > -1){ _local2 = _arg1.split("&"); } else { _local2 = [_arg1]; }; _local7 = 0; 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 _local1:URLVariables; var _local2:String; _local1 = 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 _maxBuild:uint;// = 0xFF private var _maxMinor:uint;// = 15 private var _maxMajor:uint;// = 15 private var _revision:uint; private var _separator:String;// = "." private var _maxRevision:uint;// = 0xFFFF private var _build:uint; private var _minor:uint; private var _major:uint; public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){ var _local5:Version; _maxMajor = 15; _maxMinor = 15; _maxBuild = 0xFF; _maxRevision = 0xFFFF; _separator = "."; 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 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); } public function valueOf():uint{ return (((((major << 28) | (minor << 24)) | (build << 16)) | revision)); } public function get major():uint{ return (_major); } public function set revision(_arg1:uint):void{ _revision = Math.min(_arg1, _maxRevision); } private function getFields():int{ var _local1:int; _local1 = 4; if (revision == 0){ _local1--; }; if ((((_local1 == 3)) && ((build == 0)))){ _local1--; }; if ((((_local1 == 2)) && ((minor == 0)))){ _local1--; }; return (_local1); } 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 _local3:Version; var _local4:Array; _local3 = 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; _local2 = 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; _hasGATracker = false; _jsContainer = "_GATracker"; 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 setClientInfo(_arg1:Boolean):void{ _debug.info((("setClientInfo( " + _arg1) + " )")); _call("_setClientInfo", _arg1); } public function trackTrans():void{ _debug.info("trackTrans()"); _call("_trackTrans"); } public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{ var _local5:int; _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 trackPageview(_arg1:String=""):void{ _debug.info((("trackPageview( " + _arg1) + " )")); _call("_trackPageview", _arg1); } public function setCookieTimeout(_arg1:int):void{ _debug.info((("setCookieTimeout( " + _arg1) + " )")); _call("_setCookieTimeout", _arg1); } 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")); } public function getClientInfo():Boolean{ _debug.info("getClientInfo()"); return (_call("_getClientInfo")); } 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; var _local3:Boolean; _local2 = _proxy.hasProperty(_arg1); _local3 = _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 setDetectFlash(_arg1:Boolean):void{ _debug.info((("setDetectFlash( " + _arg1) + " )")); _call("_setDetectFlash", _arg1); } public function setCampNameKey(_arg1:String):void{ _debug.info((("setCampNameKey( " + _arg1) + " )")); _call("_setCampNameKey", _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 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 setCampSourceKey(_arg1:String):void{ _debug.info((("setCampSourceKey( " + _arg1) + " )")); _call("_setCampSourceKey", _arg1); } public function setCampContentKey(_arg1:String):void{ _debug.info((("setCampContentKey( " + _arg1) + " )")); _call("_setCampContentKey", _arg1); } public function clearIgnoredRef():void{ _debug.info("clearIgnoredRef()"); _call("_clearIgnoreRef"); } public function setLocalServerMode():void{ _debug.info("setLocalServerMode()"); _call("_setLocalServerMode"); } public function getLocalGifPath():String{ _debug.info("getLocalGifPath()"); return (_call("_getLocalGifPath")); } 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); } public function setCampTermKey(_arg1:String):void{ _debug.info((("setCampTermKey( " + _arg1) + " )")); _call("_setCampTermKey", _arg1); } private function _createTrackingObject(_arg1:String):void{ _proxy.call(_createTrackingObject_js, _arg1); } public function getDetectFlash():Boolean{ _debug.info("getDetectFlash()"); return (_call("_getDetectFlash")); } public function setCampaignTrack(_arg1:Boolean):void{ _debug.info((("setCampaignTrack( " + _arg1) + " )")); _call("_setCampaignTrack", _arg1); } public function clearOrganic():void{ _debug.info("clearOrganic()"); _call("_clearOrganic"); } public function addIgnoredRef(_arg1:String):void{ _debug.info((("addIgnoredRef( " + _arg1) + " )")); _call("_addIgnoredRef", _arg1); } public function setCampMediumKey(_arg1:String):void{ _debug.info((("setCampMediumKey( " + _arg1) + " )")); _call("_setCampMediumKey", _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 allowLocalTracking:Boolean;// = true public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif" public var hasSiteOverlay:Boolean;// = false 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; private var _trackingLimitPerSession:int;// = 500 private var _domain:Domain; public var allowAnchor:Boolean;// = false 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){ _version = "4.3as"; _sampleRate = 1; _trackingLimitPerSession = 500; _organic = new Organic(); googleCsePath = "cse"; googleSearchParam = "q"; google = "google"; _cookieName = "analytics"; allowDomainHash = true; allowAnchor = false; allowLinker = false; hasSiteOverlay = false; tokenRate = 0.2; conversionTimeout = Timespan.sixmonths; sessionTimeout = Timespan.thirtyminutes; idleLoop = 30; idleTimeout = 60; maxOutboundLinkExamined = 1000; tokenCliff = 10; bucketCapacity = 10; detectClientInfo = true; detectFlash = true; detectTitle = true; campaignKey = new CampaignKey(); campaignTracking = true; isTrackOutboundSubdomains = false; serverMode = ServerOperationMode.remote; localGIFpath = "/__utm.gif"; remoteGIFpath = "http://www.google-analytics.com/__utm.gif"; secureRemoteGIFpath = "https://ssl.google-analytics.com/__utm.gif"; cookiePath = "/"; transactionFieldDelim = "|"; domainName = ""; allowLocalTracking = true; super(); _debug = _arg1; _domain = new Domain(DomainNameMode.auto, "", _debug); serverMode = ServerOperationMode.remote; _initOrganicSources(); } public function get organic():Organic{ return (_organic); } 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 get cookieName():String{ return (_cookieName); } 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 getServiceMode():ServerOperationMode; function setLocalRemoteServerMode():void; function setCampSourceKey(_arg1:String):void; function setCampContentKey(_arg1:String):void; function addOrganic(_arg1:String, _arg2:String):void; function setDetectFlash(_arg1:Boolean):void; function resetSession():void; 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 addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object; 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 trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean; 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 linkByPost(_arg1:Object, _arg2:Boolean=false):void; function setLocalServerMode():void; function setDetectTitle(_arg1:Boolean):void; function setAllowHash(_arg1:Boolean):void; function clearOrganic():void; function getAccount():String; function setDomainName(_arg1:String):void; function link(_arg1:String, _arg2:Boolean=false):void; function setCampNOKey(_arg1:String):void; function getClientInfo():Boolean; 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.utils.*; import com.google.analytics.data.*; import com.google.analytics.external.*; 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; _hasInitData = false; _isNewVisitor = false; _noSessionInformation = false; 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 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 trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{ var _local5:Boolean; var _local6:int; _local5 = true; _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 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(); } 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{ var _local2:String; _config.campaignKey.UCCN = _arg1; _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )"); if (_debug.mode == VisualDebugMode.geek){ _debug.info((_local2 + " [UCCN]")); } else { _debug.info(_local2); }; } private function _formatReferrer():String{ var _local1:String; var _local2:String; var _local3:URL; var _local4:URL; _local1 = _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) + " )")); } public function getClientInfo():Boolean{ _debug.info("getClientInfo()"); return (_config.detectClientInfo); } 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); } public function setCampContentKey(_arg1:String):void{ var _local2:String; _config.campaignKey.UCCT = _arg1; _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()"); } private function _renderMetricsSearchVariables(_arg1:String=""):Variables{ var _local2:Variables; var _local3:DocumentInfo; var _local4:Variables; var _local5:Variables; _local2 = new Variables(); _local2.URIencode = true; _local3 = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense); _debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek); if (_config.campaignTracking){ _local4 = _campaignInfo.toVariables(); }; _local5 = _browserInfo.toVariables(); _local2.join(_local3.toVariables(), _local5, _local4); return (_local2); } public function clearIgnoredRef():void{ _debug.info("clearIgnoredRef()"); _config.organic.clearIgnoredReferrals(); } public function setCampSourceKey(_arg1:String):void{ var _local2:String; _config.campaignKey.UCSR = _arg1; _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; var _local2:Boolean; var _local3:Boolean; var _local4:Boolean; var _local5:Boolean; _local1 = _config.domainName; _local2 = (_local1.indexOf("www.google.") < 0); _local3 = (_local1.indexOf(".google.") < 0); _local4 = (_local1.indexOf("google.") < 0); _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:String; _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 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{ var _local2:String; _config.campaignKey.UCTR = _arg1; _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); } public function setCampNOKey(_arg1:String):void{ var _local2:String; _config.campaignKey.UCNO = _arg1; _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )"); if (_debug.mode == VisualDebugMode.geek){ _debug.info((_local2 + " [UCNO]")); } else { _debug.info(_local2); }; } 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{ var _local2:String; _config.campaignKey.UCMD = _arg1; _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; _local1 = ((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 config(_arg1:Configuration):void; function isReady():Boolean; function get mode():String; function set debug(_arg1:DebugConfiguration):void; function get account():String; function set mode(_arg1:String):void; function get config():Configuration; function get debug():DebugConfiguration; function set account(_arg1:String):void; function get visualDebug():Boolean; function set visualDebug(_arg1:Boolean):void; } }//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: 234 $ ".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.utils.*; import com.google.analytics.external.*; 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){ _ready = false; super(); _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 trackPageview(_arg1:String=""):void{ _tracker.trackPageview(_arg1); } public function getClientInfo():Boolean{ return (_tracker.getClientInfo()); } 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 addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ _eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); } 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 setDomainName(_arg1:String):void{ _tracker.setDomainName(_arg1); } public function createEventTracker(_arg1:String):EventTracker{ return (_tracker.createEventTracker(_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 setCampSourceKey(_arg1:String):void{ _tracker.setCampSourceKey(_arg1); } 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 isReady():Boolean{ return (_ready); } public function getLocalGifPath():String{ return (_tracker.getLocalGifPath()); } public function setAllowAnchor(_arg1:Boolean):void{ _tracker.setAllowAnchor(_arg1); } public function clearIgnoredRef():void{ _tracker.clearIgnoredRef(); } 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 setCampNOKey(_arg1:String):void{ _tracker.setCampNOKey(_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; var _local2:TrackerCache; _jsproxy = new JavascriptProxy(debug); if (visualDebug){ debug.layout = new Layout(debug, _display); debug.active = visualDebug; }; _local2 = (_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 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 setSessionTimeout(_arg1:int):void{ _tracker.setSessionTimeout(_arg1); } public function getDetectFlash():Boolean{ return (_tracker.getDetectFlash()); } public function get visualDebug():Boolean{ return (_visualDebug); } public function getAccount():String{ return (_tracker.getAccount()); } public function hasEventListener(_arg1:String):Boolean{ return (_eventDispatcher.hasEventListener(_arg1)); } public function setRemoteServerMode():void{ _tracker.setRemoteServerMode(); } } var _local1:* = ServerOperationMode; return (_local1); }//package com.google.analytics
Section 145
//PropTween (com.greensock.core.PropTween) package com.greensock.core { public class PropTween { public var target:Object; public var property:String; public var start:Number; public var change:Number; public var name:String; public var priority:int; public var isPlugin:Boolean; public var nextNode:PropTween; public var prevNode:PropTween; public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){ this.target = _arg1; this.property = _arg2; this.start = _arg3; this.change = _arg4; this.name = _arg5; this.isPlugin = _arg6; if (_arg7){ _arg7.prevNode = this; this.nextNode = _arg7; }; this.priority = _arg8; } } }//package com.greensock.core
Section 146
//SimpleTimeline (com.greensock.core.SimpleTimeline) package com.greensock.core { public class SimpleTimeline extends TweenCore { protected var _firstChild:TweenCore; protected var _lastChild:TweenCore; public var autoRemoveChildren:Boolean; public function SimpleTimeline(_arg1:Object=null){ super(0, _arg1); } public function addChild(_arg1:TweenCore):void{ if (((!(_arg1.gc)) && (_arg1.timeline))){ _arg1.timeline.remove(_arg1, true); }; _arg1.timeline = this; if (_arg1.gc){ _arg1.setEnabled(true, true); }; if (_firstChild){ _firstChild.prevNode = _arg1; }; _arg1.nextNode = _firstChild; _firstChild = _arg1; _arg1.prevNode = null; } public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{ if (_arg1.gc){ return; }; if (!_arg2){ _arg1.setEnabled(false, true); }; if (_arg1.nextNode){ _arg1.nextNode.prevNode = _arg1.prevNode; } else { if (_lastChild == _arg1){ _lastChild = _arg1.prevNode; }; }; if (_arg1.prevNode){ _arg1.prevNode.nextNode = _arg1.nextNode; } else { if (_firstChild == _arg1){ _firstChild = _arg1.nextNode; }; }; } override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ var _local5:Number; var _local6:TweenCore; var _local4:TweenCore = _firstChild; this.cachedTotalTime = _arg1; this.cachedTime = _arg1; while (_local4) { _local6 = _local4.nextNode; if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){ if (!_local4.cachedReversed){ _local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false); } else { _local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration; _local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false); }; }; _local4 = _local6; }; } public function get rawTime():Number{ return (this.cachedTotalTime); } } }//package com.greensock.core
Section 147
//TweenCore (com.greensock.core.TweenCore) package com.greensock.core { import com.greensock.*; public class TweenCore { protected var _delay:Number; protected var _hasUpdate:Boolean; protected var _rawPrevTime:Number; protected var _pauseTime:Number; public var vars:Object; public var active:Boolean; public var gc:Boolean; public var initted:Boolean; public var timeline:SimpleTimeline; public var cachedStartTime:Number; public var cachedTime:Number; public var cachedTotalTime:Number; public var cachedDuration:Number; public var cachedTotalDuration:Number; public var cachedTimeScale:Number; public var cachedReversed:Boolean; public var nextNode:TweenCore; public var prevNode:TweenCore; public var cacheIsDirty:Boolean; public var cachedPaused:Boolean; public var data; public static const version:Number = 1.13; protected static var _classInitted:Boolean; public function TweenCore(_arg1:Number=0, _arg2:Object=null){ _rawPrevTime = -1; super(); this.vars = ((_arg2) || ({})); this.cachedDuration = (this.cachedTotalDuration = ((_arg1) || (0))); _delay = ((this.vars.delay) || (0)); this.cachedTimeScale = ((this.vars.timeScale) || (1)); this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false))))); this.cachedTotalTime = (this.cachedTime = 0); this.data = this.vars.data; if (!_classInitted){ if (isNaN(TweenLite.rootFrame)){ TweenLite.initClass(); _classInitted = true; } else { return; }; }; var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline; this.cachedStartTime = (_local3.cachedTotalTime + _delay); _local3.addChild(this); if (this.vars.reversed){ this.cachedReversed = true; }; if (this.vars.paused){ this.paused = true; }; } public function play():void{ this.reversed = false; this.paused = false; } public function pause():void{ this.paused = true; } public function resume():void{ this.paused = false; } public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{ this.reversed = false; this.paused = false; this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2); } public function reverse(_arg1:Boolean=true):void{ this.reversed = true; if (_arg1){ this.paused = false; } else { if (this.gc){ this.setEnabled(true, false); }; }; } public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ } public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{ if (!_arg1){ renderTime(this.cachedTotalDuration, _arg2, false); return; }; if (this.timeline.autoRemoveChildren){ this.setEnabled(false, false); } else { this.active = false; }; if (!_arg2){ if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); } else { if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){ this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams); }; }; }; } public function invalidate():void{ } public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ if (_arg1){ this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); if (((!(_arg2)) && (this.gc))){ this.timeline.addChild(this); }; } else { this.active = false; if (!_arg2){ this.timeline.remove(this, true); }; }; this.gc = !(_arg1); return (false); } public function kill():void{ setEnabled(false, false); } protected function setDirtyCache(_arg1:Boolean=true):void{ var _local2:TweenCore = (_arg1) ? this : this.timeline; while (_local2) { _local2.cacheIsDirty = true; _local2 = _local2.timeline; }; } protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{ var _local3:Number; var _local4:Number; if (this.timeline){ _local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime; if (this.cachedReversed){ _local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale)); } else { this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale)); }; if (!this.timeline.cacheIsDirty){ setDirtyCache(false); }; if (this.cachedTotalTime != _arg1){ renderTime(_arg1, _arg2, false); }; }; } public function get delay():Number{ return (_delay); } public function set delay(_arg1:Number):void{ this.startTime = (this.startTime + (_arg1 - _delay)); _delay = _arg1; } public function get duration():Number{ return (this.cachedDuration); } public function set duration(_arg1:Number):void{ this.cachedDuration = (this.cachedTotalDuration = _arg1); setDirtyCache(false); } public function get totalDuration():Number{ return (this.cachedTotalDuration); } public function set totalDuration(_arg1:Number):void{ this.duration = _arg1; } public function get currentTime():Number{ return (this.cachedTime); } public function set currentTime(_arg1:Number):void{ setTotalTime(_arg1, false); } public function get totalTime():Number{ return (this.cachedTotalTime); } public function set totalTime(_arg1:Number):void{ setTotalTime(_arg1, false); } public function get startTime():Number{ return (this.cachedStartTime); } public function set startTime(_arg1:Number):void{ var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc))))); this.cachedStartTime = _arg1; if (_local2){ this.timeline.addChild(this); }; } public function get reversed():Boolean{ return (this.cachedReversed); } public function set reversed(_arg1:Boolean):void{ if (_arg1 != this.cachedReversed){ this.cachedReversed = _arg1; setTotalTime(this.cachedTotalTime, true); }; } public function get paused():Boolean{ return (this.cachedPaused); } public function set paused(_arg1:Boolean):void{ if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){ if (_arg1){ _pauseTime = this.timeline.rawTime; } else { this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime)); _pauseTime = NaN; setDirtyCache(false); }; this.cachedPaused = _arg1; this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); }; if (((!(_arg1)) && (this.gc))){ this.setTotalTime(this.cachedTotalTime, false); this.setEnabled(true, false); }; } } }//package com.greensock.core
Section 148
//TweenEvent (com.greensock.events.TweenEvent) package com.greensock.events { import flash.events.*; public class TweenEvent extends Event { public static const VERSION:Number = 1; public static const START:String = "init"; public static const UPDATE:String = "change"; public static const COMPLETE:String = "complete"; public static const REVERSE_COMPLETE:String = "reverseComplete"; public static const REPEAT:String = "repeat"; public function TweenEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function clone():Event{ return (new TweenEvent(this.type, this.bubbles, this.cancelable)); } } }//package com.greensock.events
Section 149
//AutoAlphaPlugin (com.greensock.plugins.AutoAlphaPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class AutoAlphaPlugin extends TweenPlugin { protected var _target:Object; protected var _ignoreVisible:Boolean; public static const API:Number = 1; public function AutoAlphaPlugin(){ this.propName = "autoAlpha"; this.overwriteProps = ["alpha", "visible"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha"); return (true); } override public function killProps(_arg1:Object):void{ super.killProps(_arg1); _ignoreVisible = Boolean(("visible" in _arg1)); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); if (!_ignoreVisible){ _target.visible = Boolean(!((_target.alpha == 0))); }; } } }//package com.greensock.plugins
Section 150
//BevelFilterPlugin (com.greensock.plugins.BevelFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class BevelFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["distance", "angle", "highlightColor", "highlightAlpha", "shadowColor", "shadowAlpha", "blurX", "blurY", "strength", "quality"]; public function BevelFilterPlugin(){ this.propName = "bevelFilter"; this.overwriteProps = ["bevelFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = BevelFilter; initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))), _propNames); return (true); } } }//package com.greensock.plugins
Section 151
//BezierPlugin (com.greensock.plugins.BezierPlugin) package com.greensock.plugins { import com.greensock.core.*; import com.greensock.*; public class BezierPlugin extends TweenPlugin { protected var _target:Object; protected var _orientData:Array; protected var _orient:Boolean; protected var _future:Object; protected var _beziers:Object; public static const API:Number = 1; protected static const _RAD2DEG:Number = 57.2957795130823; public function BezierPlugin(){ _future = {}; super(); this.propName = "bezier"; this.overwriteProps = []; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (!(_arg2 is Array)){ return (false); }; init(_arg3, (_arg2 as Array), false); return (true); } protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{ var _local6:int; var _local7:String; var _local8:Object; _target = _arg1.target; var _local4:Object = ((_arg1.vars.isTV)==true) ? _arg1.vars.exposedVars : _arg1.vars; if (_local4.orientToBezier == true){ _orientData = [["x", "y", "rotation", 0, 0.01]]; _orient = true; } else { if ((_local4.orientToBezier is Array)){ _orientData = _local4.orientToBezier; _orient = true; }; }; var _local5:Object = {}; _local6 = 0; while (_local6 < _arg2.length) { for (_local7 in _arg2[_local6]) { if (_local5[_local7] == undefined){ _local5[_local7] = [_arg1.target[_local7]]; }; if (typeof(_arg2[_local6][_local7]) == "number"){ _local5[_local7].push(_arg2[_local6][_local7]); } else { _local5[_local7].push((_arg1.target[_local7] + Number(_arg2[_local6][_local7]))); }; }; _local6++; }; for (_local7 in _local5) { this.overwriteProps[this.overwriteProps.length] = _local7; if (_local4[_local7] != undefined){ if (typeof(_local4[_local7]) == "number"){ _local5[_local7].push(_local4[_local7]); } else { _local5[_local7].push((_arg1.target[_local7] + Number(_local4[_local7]))); }; _local8 = {}; _local8[_local7] = true; _arg1.killVars(_local8, false); delete _local4[_local7]; }; }; _beziers = parseBeziers(_local5, _arg3); } override public function killProps(_arg1:Object):void{ var _local2:String; for (_local2 in _beziers) { if ((_local2 in _arg1)){ delete _beziers[_local2]; }; }; super.killProps(_arg1); } override public function set changeFactor(_arg1:Number):void{ var _local2:int; var _local3:String; var _local4:Object; var _local5:Number; var _local6:uint; var _local7:Number; var _local8:Object; var _local9:Number; var _local10:Number; var _local11:Array; var _local12:Number; var _local13:Object; var _local14:Boolean; if (_arg1 == 1){ for (_local3 in _beziers) { _local2 = (_beziers[_local3].length - 1); _target[_local3] = _beziers[_local3][_local2][2]; }; } else { for (_local3 in _beziers) { _local6 = _beziers[_local3].length; if (_arg1 < 0){ _local2 = 0; } else { if (_arg1 >= 1){ _local2 = (_local6 - 1); } else { _local2 = int((_local6 * _arg1)); }; }; _local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6); _local4 = _beziers[_local3][_local2]; if (this.round){ _local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0]))))); _target[_local3] = ((_local7)>0) ? int((_local7 + 0.5)) : int((_local7 - 0.5)); } else { _target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0]))))); }; }; }; if (_orient){ _local2 = _orientData.length; _local8 = {}; while (_local2--) { _local11 = _orientData[_local2]; _local8[_local11[0]] = _target[_local11[0]]; _local8[_local11[1]] = _target[_local11[1]]; }; _local13 = _target; _local14 = this.round; _target = _future; this.round = false; _orient = false; _local2 = _orientData.length; while (_local2--) { _local11 = _orientData[_local2]; this.changeFactor = (_arg1 + ((_local11[4]) || (0.01))); _local12 = ((_local11[3]) || (0)); _local9 = (_future[_local11[0]] - _local8[_local11[0]]); _local10 = (_future[_local11[1]] - _local8[_local11[1]]); _local13[_local11[2]] = ((Math.atan2(_local10, _local9) * _RAD2DEG) + _local12); }; _target = _local13; this.round = _local14; _orient = true; }; } public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{ var _local3:int; var _local4:Array; var _local5:Object; var _local6:String; var _local7:Object = {}; if (_arg2){ for (_local6 in _arg1) { _local4 = _arg1[_local6]; _local5 = []; _local7[_local6] = _local5; if (_local4.length > 2){ _local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]]; _local3 = 1; while (_local3 < (_local4.length - 1)) { _local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]]; _local3++; }; } else { _local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]]; }; }; } else { for (_local6 in _arg1) { _local4 = _arg1[_local6]; _local5 = []; _local7[_local6] = _local5; if (_local4.length > 3){ _local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)]; _local3 = 2; while (_local3 < (_local4.length - 2)) { _local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)]; _local3++; }; _local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]]; } else { if (_local4.length == 3){ _local5[_local5.length] = [_local4[0], _local4[1], _local4[2]]; } else { if (_local4.length == 2){ _local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]]; }; }; }; }; }; return (_local7); } } }//package com.greensock.plugins
Section 152
//BezierThroughPlugin (com.greensock.plugins.BezierThroughPlugin) package com.greensock.plugins { import com.greensock.*; public class BezierThroughPlugin extends BezierPlugin { public static const API:Number = 1; public function BezierThroughPlugin(){ this.propName = "bezierThrough"; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (!(_arg2 is Array)){ return (false); }; init(_arg3, (_arg2 as Array), true); return (true); } } }//package com.greensock.plugins
Section 153
//BlurFilterPlugin (com.greensock.plugins.BlurFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class BlurFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["blurX", "blurY", "quality"]; public function BlurFilterPlugin(){ this.propName = "blurFilter"; this.overwriteProps = ["blurFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = BlurFilter; initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))), _propNames); return (true); } } }//package com.greensock.plugins
Section 154
//ColorMatrixFilterPlugin (com.greensock.plugins.ColorMatrixFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class ColorMatrixFilterPlugin extends FilterPlugin { protected var _matrix:Array; protected var _matrixTween:EndArrayPlugin; public static const API:Number = 1; private static var _propNames:Array = []; protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; protected static var _lumR:Number = 0.212671; protected static var _lumG:Number = 0.71516; protected static var _lumB:Number = 0.072169; public function ColorMatrixFilterPlugin(){ this.propName = "colorMatrixFilter"; this.overwriteProps = ["colorMatrixFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = ColorMatrixFilter; var _local4:Object = _arg2; initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()), _propNames); _matrix = ColorMatrixFilter(_filter).matrix; var _local5:Array = []; if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){ _local5 = _local4.matrix; } else { if (_local4.relative == true){ _local5 = _matrix.slice(); } else { _local5 = _idMatrix.slice(); }; _local5 = setBrightness(_local5, _local4.brightness); _local5 = setContrast(_local5, _local4.contrast); _local5 = setHue(_local5, _local4.hue); _local5 = setSaturation(_local5, _local4.saturation); _local5 = setThreshold(_local5, _local4.threshold); if (!isNaN(_local4.colorize)){ _local5 = colorize(_local5, _local4.colorize, _local4.amount); }; }; _matrixTween = new EndArrayPlugin(); _matrixTween.init(_matrix, _local5); return (true); } override public function set changeFactor(_arg1:Number):void{ _matrixTween.changeFactor = _arg1; ColorMatrixFilter(_filter).matrix = _matrix; super.changeFactor = _arg1; } public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{ if (isNaN(_arg2)){ return (_arg1); }; if (isNaN(_arg3)){ _arg3 = 1; }; var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF); var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF); var _local6:Number = ((_arg2 & 0xFF) / 0xFF); var _local7:Number = (1 - _arg3); var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0]; return (applyMatrix(_local8, _arg1)); } public static function setThreshold(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0]; return (applyMatrix(_local3, _arg1)); } public static function setHue(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; _arg2 = (_arg2 * (Math.PI / 180)); var _local3:Number = Math.cos(_arg2); var _local4:Number = Math.sin(_arg2); var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]; return (applyMatrix(_local5, _arg1)); } public static function setBrightness(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; _arg2 = ((_arg2 * 100) - 100); return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1)); } public static function setSaturation(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; var _local3:Number = (1 - _arg2); var _local4:Number = (_local3 * _lumR); var _local5:Number = (_local3 * _lumG); var _local6:Number = (_local3 * _lumB); var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0]; return (applyMatrix(_local7, _arg1)); } public static function setContrast(_arg1:Array, _arg2:Number):Array{ if (isNaN(_arg2)){ return (_arg1); }; _arg2 = (_arg2 + 0.01); var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0]; return (applyMatrix(_local3, _arg1)); } public static function applyMatrix(_arg1:Array, _arg2:Array):Array{ var _local6:int; var _local7:int; if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){ return (_arg2); }; var _local3:Array = []; var _local4:int; var _local5:int; _local6 = 0; while (_local6 < 4) { _local7 = 0; while (_local7 < 5) { if (_local7 == 4){ _local5 = _arg1[(_local4 + 4)]; } else { _local5 = 0; }; _local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5); _local7++; }; _local4 = (_local4 + 5); _local6++; }; return (_local3); } } }//package com.greensock.plugins
Section 155
//ColorTransformPlugin (com.greensock.plugins.ColorTransformPlugin) package com.greensock.plugins { import flash.display.*; import flash.geom.*; import com.greensock.*; public class ColorTransformPlugin extends TintPlugin { public static const API:Number = 1; public function ColorTransformPlugin(){ this.propName = "colorTransform"; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ var _local5:String; var _local6:Number; if (!(_arg1 is DisplayObject)){ return (false); }; var _local4:ColorTransform = _arg1.transform.colorTransform; for (_local5 in _arg2) { if ((((_local5 == "tint")) || ((_local5 == "color")))){ if (_arg2[_local5] != null){ _local4.color = int(_arg2[_local5]); }; } else { if ((((((_local5 == "tintAmount")) || ((_local5 == "exposure")))) || ((_local5 == "brightness")))){ } else { _local4[_local5] = _arg2[_local5]; }; }; }; if (!isNaN(_arg2.tintAmount)){ _local6 = (_arg2.tintAmount / (1 - (((_local4.redMultiplier + _local4.greenMultiplier) + _local4.blueMultiplier) / 3))); _local4.redOffset = (_local4.redOffset * _local6); _local4.greenOffset = (_local4.greenOffset * _local6); _local4.blueOffset = (_local4.blueOffset * _local6); _local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - _arg2.tintAmount))); } else { if (!isNaN(_arg2.exposure)){ _local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = (0xFF * (_arg2.exposure - 1)))); _local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = 1)); } else { if (!isNaN(_arg2.brightness)){ _local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = Math.max(0, ((_arg2.brightness - 1) * 0xFF)))); _local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - Math.abs((_arg2.brightness - 1))))); }; }; }; _ignoreAlpha = Boolean(((!((_arg3.vars.alpha == undefined))) && ((_arg2.alphaMultiplier == undefined)))); init((_arg1 as DisplayObject), _local4); return (true); } } }//package com.greensock.plugins
Section 156
//DropShadowFilterPlugin (com.greensock.plugins.DropShadowFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class DropShadowFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["distance", "angle", "color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout", "hideObject"]; public function DropShadowFilterPlugin(){ this.propName = "dropShadowFilter"; this.overwriteProps = ["dropShadowFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = DropShadowFilter; initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject), _propNames); return (true); } } }//package com.greensock.plugins
Section 157
//EndArrayPlugin (com.greensock.plugins.EndArrayPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class EndArrayPlugin extends TweenPlugin { protected var _a:Array; protected var _info:Array; public static const API:Number = 1; public function EndArrayPlugin(){ _info = []; super(); this.propName = "endArray"; this.overwriteProps = ["endArray"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){ return (false); }; init((_arg1 as Array), _arg2); return (true); } public function init(_arg1:Array, _arg2:Array):void{ _a = _arg1; var _local3:int = _arg2.length; while (_local3--) { if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){ _info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3])); }; }; } override public function set changeFactor(_arg1:Number):void{ var _local3:ArrayTweenInfo; var _local4:Number; var _local2:int = _info.length; if (this.round){ while (_local2--) { _local3 = _info[_local2]; _local4 = (_local3.start + (_local3.change * _arg1)); _a[_local3.index] = ((_local4)>0) ? int((_local4 + 0.5)) : int((_local4 - 0.5)); }; } else { while (_local2--) { _local3 = _info[_local2]; _a[_local3.index] = (_local3.start + (_local3.change * _arg1)); }; }; } } }//package com.greensock.plugins class ArrayTweenInfo { public var index:uint; public var start:Number; public var change:Number; private function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){ this.index = _arg1; this.start = _arg2; this.change = _arg3; } }
Section 158
//FilterPlugin (com.greensock.plugins.FilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.core.*; import com.greensock.*; import flash.filters.*; public class FilterPlugin extends TweenPlugin { protected var _target:Object; protected var _type:Class; protected var _filter:BitmapFilter; protected var _index:int; protected var _remove:Boolean; public static const VERSION:Number = 2.03; public static const API:Number = 1; protected function initFilter(_arg1:Object, _arg2:BitmapFilter, _arg3:Array):void{ var _local5:String; var _local6:int; var _local7:HexColorsPlugin; var _local4:Array = _target.filters; var _local8:Object = ((_arg1 is BitmapFilter)) ? {} : _arg1; _index = -1; if (_local8.index != null){ _index = _local8.index; } else { _local6 = _local4.length; while (_local6--) { if ((_local4[_local6] is _type)){ _index = _local6; break; }; }; }; if ((((((_index == -1)) || ((_local4[_index] == null)))) || ((_local8.addFilter == true)))){ _index = ((_local8.index)!=null) ? _local8.index : _local4.length; _local4[_index] = _arg2; _target.filters = _local4; }; _filter = _local4[_index]; if (_local8.remove == true){ _remove = true; this.onComplete = onCompleteTween; }; _local6 = _arg3.length; while (_local6--) { _local5 = _arg3[_local6]; if ((((_local5 in _arg1)) && (!((_filter[_local5] == _arg1[_local5]))))){ if ((((((_local5 == "color")) || ((_local5 == "highlightColor")))) || ((_local5 == "shadowColor")))){ _local7 = new HexColorsPlugin(); _local7.initColor(_filter, _local5, _filter[_local5], _arg1[_local5]); _tweens[_tweens.length] = new PropTween(_local7, "changeFactor", 0, 1, _local5, false); } else { if ((((((((_local5 == "quality")) || ((_local5 == "inner")))) || ((_local5 == "knockout")))) || ((_local5 == "hideObject")))){ _filter[_local5] = _arg1[_local5]; } else { addTween(_filter, _local5, _filter[_local5], _arg1[_local5], _local5); }; }; }; }; } public function onCompleteTween():void{ var _local1:Array; var _local2:int; if (_remove){ _local1 = _target.filters; if (!(_local1[_index] is _type)){ _local2 = _local1.length; while (_local2--) { if ((_local1[_local2] is _type)){ _local1.splice(_local2, 1); break; }; }; } else { _local1.splice(_index, 1); }; _target.filters = _local1; }; } override public function set changeFactor(_arg1:Number):void{ var _local3:PropTween; var _local2:int = _tweens.length; var _local4:Array = _target.filters; while (_local2--) { _local3 = _tweens[_local2]; _local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1)); }; if (!(_local4[_index] is _type)){ _local2 = (_index = _local4.length); while (_local2--) { if ((_local4[_local2] is _type)){ _index = _local2; break; }; }; }; _local4[_index] = _filter; _target.filters = _local4; } } }//package com.greensock.plugins
Section 159
//FrameLabelPlugin (com.greensock.plugins.FrameLabelPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class FrameLabelPlugin extends FramePlugin { public static const API:Number = 1; public function FrameLabelPlugin(){ this.propName = "frameLabel"; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if ((!(_arg3.target) is MovieClip)){ return (false); }; _target = (_arg1 as MovieClip); this.frame = _target.currentFrame; var _local4:Array = _target.currentLabels; var _local5:String = _arg2; var _local6:int = _target.currentFrame; var _local7:int = _local4.length; while (_local7--) { if (_local4[_local7].name == _local5){ _local6 = _local4[_local7].frame; break; }; }; if (this.frame != _local6){ addTween(this, "frame", this.frame, _local6, "frame"); }; return (true); } } }//package com.greensock.plugins
Section 160
//FramePlugin (com.greensock.plugins.FramePlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class FramePlugin extends TweenPlugin { public var frame:int; protected var _target:MovieClip; public static const API:Number = 1; public function FramePlugin(){ this.propName = "frame"; this.overwriteProps = ["frame", "frameLabel"]; this.round = true; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){ return (false); }; _target = (_arg1 as MovieClip); this.frame = _target.currentFrame; addTween(this, "frame", this.frame, _arg2, "frame"); return (true); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _target.gotoAndStop(this.frame); } } }//package com.greensock.plugins
Section 161
//GlowFilterPlugin (com.greensock.plugins.GlowFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class GlowFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout"]; public function GlowFilterPlugin(){ this.propName = "glowFilter"; this.overwriteProps = ["glowFilter"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _type = GlowFilter; initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout), _propNames); return (true); } } }//package com.greensock.plugins
Section 162
//HexColorsPlugin (com.greensock.plugins.HexColorsPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class HexColorsPlugin extends TweenPlugin { protected var _colors:Array; public static const API:Number = 1; public function HexColorsPlugin(){ this.propName = "hexColors"; this.overwriteProps = []; _colors = []; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ var _local4:String; for (_local4 in _arg2) { initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4])); }; return (true); } public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{ var _local5:Number; var _local6:Number; var _local7:Number; if (_arg3 != _arg4){ _local5 = (_arg3 >> 16); _local6 = ((_arg3 >> 8) & 0xFF); _local7 = (_arg3 & 0xFF); _colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)]; this.overwriteProps[this.overwriteProps.length] = _arg2; }; } override public function killProps(_arg1:Object):void{ var _local2:int = (_colors.length - 1); while (_local2 > -1) { if (_arg1[_colors[_local2][1]] != undefined){ _colors.splice(_local2, 1); }; _local2--; }; super.killProps(_arg1); } override public function set changeFactor(_arg1:Number):void{ var _local2:int; var _local3:Array; _local2 = (_colors.length - 1); while (_local2 > -1) { _local3 = _colors[_local2]; _local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7]))); _local2--; }; } } }//package com.greensock.plugins
Section 163
//RemoveTintPlugin (com.greensock.plugins.RemoveTintPlugin) package com.greensock.plugins { public class RemoveTintPlugin extends TintPlugin { public static const API:Number = 1; public function RemoveTintPlugin(){ this.propName = "removeTint"; } } }//package com.greensock.plugins
Section 164
//RoundPropsPlugin (com.greensock.plugins.RoundPropsPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class RoundPropsPlugin extends TweenPlugin { public static const API:Number = 1; public function RoundPropsPlugin(){ this.propName = "roundProps"; this.overwriteProps = []; this.round = true; } public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{ addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2); this.overwriteProps[this.overwriteProps.length] = _arg2; } } }//package com.greensock.plugins
Section 165
//ShortRotationPlugin (com.greensock.plugins.ShortRotationPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class ShortRotationPlugin extends TweenPlugin { public static const API:Number = 1; public function ShortRotationPlugin(){ this.propName = "shortRotation"; this.overwriteProps = []; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ var _local4:String; if (typeof(_arg2) == "number"){ return (false); }; for (_local4 in _arg2) { initRotation(_arg1, _local4, _arg1[_local4], ((typeof(_arg2[_local4]))=="number") ? Number(_arg2[_local4]) : (_arg1[_local4] + Number(_arg2[_local4]))); }; return (true); } public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{ var _local5:Number = ((_arg4 - _arg3) % 360); if (((_arg4 - _arg3) % 360) != (_local5 % 180)){ _local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360); }; addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2); this.overwriteProps[this.overwriteProps.length] = _arg2; } } }//package com.greensock.plugins
Section 166
//TintPlugin (com.greensock.plugins.TintPlugin) package com.greensock.plugins { import flash.display.*; import flash.geom.*; import com.greensock.core.*; import com.greensock.*; public class TintPlugin extends TweenPlugin { protected var _transform:Transform; protected var _ct:ColorTransform; protected var _ignoreAlpha:Boolean; public static const API:Number = 1; protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"]; public function TintPlugin(){ this.propName = "tint"; this.overwriteProps = ["tint"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (!(_arg1 is DisplayObject)){ return (false); }; var _local4:ColorTransform = new ColorTransform(); if (((!((_arg2 == null))) && (!((_arg3.vars.removeTint == true))))){ _local4.color = uint(_arg2); }; _ignoreAlpha = true; init((_arg1 as DisplayObject), _local4); return (true); } public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{ var _local4:String; _transform = _arg1.transform; _ct = _transform.colorTransform; var _local3:int = _props.length; while (_local3--) { _local4 = _props[_local3]; if (_ct[_local4] != _arg2[_local4]){ _tweens[_tweens.length] = new PropTween(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false); }; }; } override public function set changeFactor(_arg1:Number):void{ var _local2:ColorTransform; updateTweens(_arg1); if (_ignoreAlpha){ _local2 = _transform.colorTransform; _ct.alphaMultiplier = _local2.alphaMultiplier; _ct.alphaOffset = _local2.alphaOffset; }; _transform.colorTransform = _ct; } } }//package com.greensock.plugins
Section 167
//TweenPlugin (com.greensock.plugins.TweenPlugin) package com.greensock.plugins { import com.greensock.core.*; import com.greensock.*; public class TweenPlugin { public var propName:String; public var overwriteProps:Array; public var round:Boolean; public var priority:int; public var activeDisable:Boolean; public var onComplete:Function; public var onEnable:Function; public var onDisable:Function; protected var _tweens:Array; protected var _changeFactor:Number; public static const VERSION:Number = 1.31; public static const API:Number = 1; public function TweenPlugin(){ priority = 0; _tweens = []; _changeFactor = 0; super(); } public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName); return (true); } protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{ var _local6:Number; if (_arg4 != null){ _local6 = ((typeof(_arg4))=="number") ? (Number(_arg4) - _arg3) : Number(_arg4); if (_local6 != 0){ _tweens[_tweens.length] = new PropTween(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false); }; }; } protected function updateTweens(_arg1:Number):void{ var _local3:PropTween; var _local4:Number; var _local2:int = _tweens.length; if (this.round){ while (_local2--) { _local3 = _tweens[_local2]; _local4 = (_local3.start + (_local3.change * _arg1)); _local3.target[_local3.property] = ((_local4)>0) ? int((_local4 + 0.5)) : int((_local4 - 0.5)); }; } else { while (_local2--) { _local3 = _tweens[_local2]; _local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1)); }; }; } public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _changeFactor = _arg1; } public function get changeFactor():Number{ return (_changeFactor); } public function killProps(_arg1:Object):void{ var _local2:int = this.overwriteProps.length; while (_local2--) { if ((this.overwriteProps[_local2] in _arg1)){ this.overwriteProps.splice(_local2, 1); }; }; _local2 = _tweens.length; while (_local2--) { if ((PropTween(_tweens[_local2]).name in _arg1)){ _tweens.splice(_local2, 1); }; }; } private static function onTweenEvent(_arg1:String, _arg2:TweenLite):Boolean{ var _local4:Boolean; var _local5:Array; var _local6:int; var _local3:PropTween = _arg2.cachedPT1; if (_arg1 == "onInit"){ _local5 = []; while (_local3) { _local5[_local5.length] = _local3; _local3 = _local3.nextNode; }; _local5.sortOn("priority", (Array.NUMERIC | Array.DESCENDING)); _local6 = _local5.length; while (_local6--) { PropTween(_local5[_local6]).nextNode = _local5[(_local6 + 1)]; PropTween(_local5[_local6]).prevNode = _local5[(_local6 - 1)]; }; _arg2.cachedPT1 = _local5[0]; } else { while (_local3) { if (((_local3.isPlugin) && (_local3.target[_arg1]))){ if (_local3.target.activeDisable){ _local4 = true; }; var _local7 = _local3.target; _local7[_arg1](); }; _local3 = _local3.nextNode; }; }; return (_local4); } public static function activate(_arg1:Array):Boolean{ var _local3:Object; TweenLite.onPluginEvent = TweenPlugin.onTweenEvent; var _local2:int = _arg1.length; while (_local2--) { if (_arg1[_local2].hasOwnProperty("API")){ _local3 = new ((_arg1[_local2] as Class)); TweenLite.plugins[_local3.propName] = _arg1[_local2]; }; }; return (true); } } }//package com.greensock.plugins
Section 168
//VisiblePlugin (com.greensock.plugins.VisiblePlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class VisiblePlugin extends TweenPlugin { protected var _target:Object; protected var _tween:TweenLite; protected var _visible:Boolean; protected var _initVal:Boolean; public static const API:Number = 1; public function VisiblePlugin(){ this.propName = "visible"; this.overwriteProps = ["visible"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _tween = _arg3; _initVal = _target.visible; _visible = Boolean(_arg2); return (true); } override public function set changeFactor(_arg1:Number):void{ if ((((_arg1 == 1)) && ((((_tween.cachedDuration == _tween.cachedTime)) || ((_tween.cachedTime == 0)))))){ _target.visible = _visible; } else { _target.visible = _initVal; }; } } }//package com.greensock.plugins
Section 169
//VolumePlugin (com.greensock.plugins.VolumePlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.media.*; public class VolumePlugin extends TweenPlugin { protected var _target:Object; protected var _st:SoundTransform; public static const API:Number = 1; public function VolumePlugin(){ this.propName = "volume"; this.overwriteProps = ["volume"]; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){ return (false); }; _target = _arg1; _st = _target.soundTransform; addTween(_st, "volume", _st.volume, _arg2, "volume"); return (true); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _target.soundTransform = _st; } } }//package com.greensock.plugins
Section 170
//OverwriteManager (com.greensock.OverwriteManager) package com.greensock { import com.greensock.core.*; import flash.utils.*; import flash.errors.*; public class OverwriteManager { public static const version:Number = 6; public static const NONE:int = 0; public static const ALL_IMMEDIATE:int = 1; public static const AUTO:int = 2; public static const CONCURRENT:int = 3; public static const ALL_ONSTART:int = 4; public static const PREEXISTING:int = 5; public static var mode:int; public static var enabled:Boolean; public static function init(_arg1:int=2):int{ if (TweenLite.version < 11.099994){ throw (new Error("Warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.")); }; TweenLite.overwriteManager = OverwriteManager; mode = _arg1; enabled = true; return (mode); } public static function manageOverwrites(_arg1:TweenLite, _arg2:Object, _arg3:Array, _arg4:uint):Boolean{ var _local5:int; var _local6:Boolean; var _local7:TweenLite; var _local13:uint; var _local14:Number; var _local15:Number; var _local16:TweenCore; var _local17:Number; var _local18:SimpleTimeline; if (_arg4 >= 4){ _local13 = _arg3.length; _local5 = 0; while (_local5 < _local13) { _local7 = _arg3[_local5]; if (_local7 != _arg1){ if (_local7.setEnabled(false, false)){ _local6 = true; }; } else { if (_arg4 == 5){ break; }; }; _local5++; }; return (_local6); }; var _local8:Number = _arg1.startTime; var _local9:Array = []; var _local10:Array = []; var _local11:uint; var _local12:uint; _local5 = _arg3.length; while (_local5--) { _local7 = _arg3[_local5]; if ((((_local7 == _arg1)) || (_local7.gc))){ } else { if (_local7.timeline != _arg1.timeline){ if (!getGlobalPaused(_local7)){ var _temp1 = _local11; _local11 = (_local11 + 1); var _local19 = _temp1; _local10[_local19] = _local7; }; } else { if ((((((_local7.startTime <= _local8)) && (((_local7.startTime + _local7.totalDuration) > _local8)))) && (!(getGlobalPaused(_local7))))){ var _temp2 = _local12; _local12 = (_local12 + 1); _local19 = _temp2; _local9[_local19] = _local7; }; }; }; }; if (_local11 != 0){ _local14 = _arg1.cachedTimeScale; _local15 = _local8; _local18 = _arg1.timeline; while (_local18) { _local14 = (_local14 * _local18.cachedTimeScale); _local15 = (_local15 + _local18.startTime); _local18 = _local18.timeline; }; _local8 = (_local14 * _local15); _local5 = _local11; while (_local5--) { _local16 = _local10[_local5]; _local14 = _local16.cachedTimeScale; _local15 = _local16.startTime; _local18 = _local16.timeline; while (_local18) { _local14 = (_local14 * _local18.cachedTimeScale); _local15 = (_local15 + _local18.startTime); _local18 = _local18.timeline; }; _local17 = (_local14 * _local15); if ((((_local17 <= _local8)) && (((((_local17 + (_local16.totalDuration * _local14)) > _local8)) || ((_local16.cachedDuration == 0)))))){ var _temp3 = _local12; _local12 = (_local12 + 1); _local19 = _temp3; _local9[_local19] = _local16; }; }; }; if (_local12 == 0){ return (_local6); }; _local5 = _local12; if (_arg4 == 2){ while (_local5--) { _local7 = _local9[_local5]; if (_local7.killVars(_arg2)){ _local6 = true; }; if ((((_local7.cachedPT1 == null)) && (_local7.initted))){ _local7.setEnabled(false, false); }; }; } else { while (_local5--) { if (TweenLite(_local9[_local5]).setEnabled(false, false)){ _local6 = true; }; }; }; return (_local6); } public static function getGlobalPaused(_arg1:TweenCore):Boolean{ while (_arg1) { if (_arg1.cachedPaused){ return (true); }; _arg1 = _arg1.timeline; }; return (false); } } }//package com.greensock
Section 171
//TweenLite (com.greensock.TweenLite) package com.greensock { import flash.events.*; import flash.display.*; import com.greensock.core.*; import com.greensock.plugins.*; import flash.utils.*; public class TweenLite extends TweenCore { public var target:Object; public var propTweenLookup:Object; public var ratio:Number; public var cachedPT1:PropTween; protected var _ease:Function; protected var _overwrite:uint; protected var _overwrittenProps:Object; protected var _hasPlugins:Boolean; protected var _notifyPluginsOfEnabled:Boolean; public static const version:Number = 11.133; public static var plugins:Object = {}; public static var fastEaseLookup:Dictionary = new Dictionary(false); public static var onPluginEvent:Function; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; public static var defaultEase:Function = TweenLite.easeOut; public static var overwriteManager:Object; public static var rootFrame:Number; public static var rootTimeline:SimpleTimeline; public static var rootFramesTimeline:SimpleTimeline; public static var masterList:Dictionary = new Dictionary(false); private static var _shape:Shape = new Shape(); protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1}; public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){ var _local5:TweenLite; ratio = 0; super(_arg2, _arg3); this.target = _arg1; if ((((this.target is TweenCore)) && (("timeScale" in this.vars)))){ this.cachedTimeScale = 1; }; propTweenLookup = {}; _ease = defaultEase; _overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite); var _local4:Array = masterList[_arg1]; if (!_local4){ masterList[_arg1] = [this]; } else { if (_overwrite == 1){ for each (_local5 in _local4) { if (!_local5.gc){ _local5.setEnabled(false, false); }; }; masterList[_arg1] = [this]; } else { _local4[_local4.length] = this; }; }; if (((this.active) || (this.vars.immediateRender))){ renderTime(0, false, true); }; } protected function init():void{ var p:String; var i:int; var plugin:*; var prioritize:Boolean; var siblings:Array; var pt:PropTween; if (typeof(this.vars.ease) == "function"){ _ease = this.vars.ease; }; if (this.vars.easeParams){ this.vars.proxiedEase = _ease; _ease = easeProxy; }; this.cachedPT1 = null; this.propTweenLookup = {}; for (p in this.vars) { if ((((p in _reservedProps)) && (!((((p == "timeScale")) && ((this.target is TweenCore))))))){ } else { if ((((p in plugins)) && (_local4.onInitTween(this.target, this.vars[p], this)))){ this.cachedPT1 = new PropTween(plugin, "changeFactor", 0, 1, ((plugin.overwriteProps.length)==1) ? plugin.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1); if (this.cachedPT1.name == "_MULTIPLE_"){ i = plugin.overwriteProps.length; while ((i = (i - 1)), i) { this.propTweenLookup[plugin.overwriteProps[i]] = this.cachedPT1; }; } else { this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1; }; if (plugin.priority){ this.cachedPT1.priority = plugin.priority; prioritize = true; }; if (((plugin.onDisable) || (plugin.onEnable))){ _notifyPluginsOfEnabled = true; }; _hasPlugins = true; } else { try { if (this.target){ this.cachedPT1 = new PropTween(this.target, p, Number(this.target[p]), ((typeof(this.vars[p]))=="number") ? (Number(this.vars[p]) - this.target[p]) : Number(this.vars[p]), p, false, this.cachedPT1); this.propTweenLookup[p] = this.cachedPT1; } else { throw (new Error("TweenLite has recieved a null target")); }; } catch($err:Error) { }; }; }; }; if (prioritize){ onPluginEvent("onInit", this); }; if (this.vars.runBackwards){ pt = this.cachedPT1; while (pt) { pt.start = (pt.start + pt.change); pt.change = -(pt.change); pt = pt.nextNode; }; }; _hasUpdate = Boolean(!((this.vars.onUpdate == null))); if (_overwrittenProps){ killVars(_overwrittenProps); if (this.cachedPT1 == null){ this.setEnabled(false, false); }; }; if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (_local2))) && ((siblings.length > 1)))){ if (overwriteManager.manageOverwrites(this, this.propTweenLookup, siblings, _overwrite)){ init(); }; }; this.initted = true; } override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ var _local4:Boolean; var _local5:Number = this.cachedTime; if (_arg1 >= this.cachedDuration){ this.cachedTotalTime = (this.cachedTime = this.cachedDuration); this.ratio = 1; _local4 = true; if (this.cachedDuration == 0){ if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){ _arg3 = true; }; _rawPrevTime = _arg1; }; } else { if (_arg1 <= 0){ this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); if (_arg1 < 0){ this.active = false; if (this.cachedDuration == 0){ if (_rawPrevTime > 0){ _arg3 = true; _local4 = true; }; _rawPrevTime = _arg1; }; }; if (((this.cachedReversed) && (!((_local5 == 0))))){ _local4 = true; }; } else { this.cachedTotalTime = (this.cachedTime = _arg1); this.ratio = _ease(_arg1, 0, 1, this.cachedDuration); }; }; if ((((this.cachedTime == _local5)) && (!(_arg3)))){ return; }; if (!this.initted){ init(); if (((!(_local4)) && (this.cachedTime))){ this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){ this.vars.onStart.apply(null, this.vars.onStartParams); }; var _local6:PropTween = this.cachedPT1; while (_local6) { _local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change)); _local6 = _local6.nextNode; }; if (((_hasUpdate) && (!(_arg2)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_local4){ if (((_hasPlugins) && (this.cachedPT1))){ onPluginEvent("onComplete", this); }; complete(true, _arg2); }; } public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{ var _local3:String; var _local4:PropTween; var _local5:Boolean; if (_overwrittenProps == null){ _overwrittenProps = {}; }; for (_local3 in _arg1) { if ((_local3 in propTweenLookup)){ _local4 = propTweenLookup[_local3]; if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){ _local4.target.killProps(_arg1); if (_local4.target.overwriteProps.length == 0){ _local4.name = ""; }; }; if (_local4.name != "_MULTIPLE_"){ if (_local4.nextNode){ _local4.nextNode.prevNode = _local4.prevNode; }; if (_local4.prevNode){ _local4.prevNode.nextNode = _local4.nextNode; } else { if (this.cachedPT1 == _local4){ this.cachedPT1 = _local4.nextNode; }; }; if (((_local4.isPlugin) && (_local4.target.onDisable))){ _local4.target.onDisable(); if (_local4.target.activeDisable){ _local5 = true; }; }; delete propTweenLookup[_local3]; }; }; if (_arg2){ _overwrittenProps[_local3] = 1; }; }; return (_local5); } override public function invalidate():void{ if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ onPluginEvent("onDisable", this); }; this.cachedPT1 = null; _overwrittenProps = null; _hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false))); this.propTweenLookup = {}; } override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ var _local3:Array; if (_arg1){ _local3 = TweenLite.masterList[this.target]; if (!_local3){ TweenLite.masterList[this.target] = [this]; } else { _local3[_local3.length] = this; }; }; super.setEnabled(_arg1, _arg2); if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this)); }; return (false); } protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } public static function initClass():void{ rootFrame = 0; rootTimeline = new SimpleTimeline(null); rootFramesTimeline = new SimpleTimeline(null); rootTimeline.cachedStartTime = (getTimer() * 0.001); rootFramesTimeline.cachedStartTime = rootFrame; rootTimeline.autoRemoveChildren = true; rootFramesTimeline.autoRemoveChildren = true; _shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); if (overwriteManager == null){ overwriteManager = {mode:1, enabled:false}; }; } public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ return (new TweenLite(_arg1, _arg2, _arg3)); } public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ _arg3.runBackwards = true; if (!("immediateRender" in _arg3)){ _arg3.immediateRender = true; }; return (new TweenLite(_arg1, _arg2, _arg3)); } public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{ return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0})); } protected static function updateAll(_arg1:Event=null):void{ var _local2:Dictionary; var _local3:Object; var _local4:Array; var _local5:int; rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false); rootFrame++; rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false); if (!(rootFrame % 60)){ _local2 = masterList; for (_local3 in _local2) { _local4 = _local2[_local3]; _local5 = _local4.length; while (_local5--) { if (TweenLite(_local4[_local5]).gc){ _local4.splice(_local5, 1); }; }; if (_local4.length == 0){ delete _local2[_local3]; }; }; }; } public static function killTweensOf(_arg1:Object, _arg2:Boolean=false):void{ var _local3:Array; var _local4:int; if ((_arg1 in masterList)){ _local3 = masterList[_arg1]; _local4 = _local3.length; while (_local4--) { if (!TweenLite(_local3[_local4]).gc){ if (_arg2){ TweenLite(_local3[_local4]).complete(false, false); } else { TweenLite(_local3[_local4]).setEnabled(false, false); }; }; }; delete masterList[_arg1]; }; } protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (1 - (_arg1 / _arg4)); return ((1 - (_arg1 * _arg1))); } } }//package com.greensock
Section 172
//TweenMax (com.greensock.TweenMax) package com.greensock { import flash.events.*; import flash.display.*; import com.greensock.core.*; import com.greensock.plugins.*; import flash.utils.*; import com.greensock.events.*; public class TweenMax extends TweenLite implements IEventDispatcher { protected var _dispatcher:EventDispatcher; protected var _hasUpdateListener:Boolean; protected var _repeat:int; protected var _repeatDelay:Number; protected var _cyclesComplete:uint; protected var _easePower:uint; protected var _easeType:uint; public var yoyo:Boolean; public static const version:Number = 11.133; private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2); ; public static var killTweensOf:Function = TweenLite.killTweensOf; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){ _repeat = 0; _repeatDelay = 0; _cyclesComplete = 0; super(_arg1, _arg2, _arg3); if (TweenLite.version < 11.1){ throw (new Error("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.")); }; this.yoyo = Boolean(this.vars.yoyo); _repeat = ((this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); this.cacheIsDirty = true; if (((((((((this.vars.onCompleteListener) || (this.vars.onUpdateListener))) || (this.vars.onStartListener))) || (this.vars.onRepeatListener))) || (this.vars.onReverseCompleteListener))){ initDispatcher(); if ((((_arg2 == 0)) && ((_delay == 0)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); }; }; if (((("timeScale" in this.vars)) && (!((this.target is TweenCore))))){ this.cachedTimeScale = this.vars.timeScale; }; } override protected function init():void{ var _local1:TweenMax; var _local2:int; var _local3:String; var _local4:String; var _local5:Array; var _local6:Object; var _local7:PropTween; var _local8:PropTween; var _local9:int; if (this.vars.startAt){ this.vars.startAt.overwrite = 0; this.vars.startAt.immediateRender = true; _local1 = new TweenMax(this.target, 0, this.vars.startAt); }; super.init(); if ((_ease in fastEaseLookup)){ _easeType = fastEaseLookup[_ease][0]; _easePower = fastEaseLookup[_ease][1]; }; if (((!((this.vars.roundProps == null))) && (("roundProps" in TweenLite.plugins)))){ _local5 = this.vars.roundProps; _local9 = _local5.length; while (_local9--) { _local3 = _local5[_local9]; _local8 = this.cachedPT1; while (_local8) { if (_local8.name == _local3){ if (_local8.isPlugin){ _local8.target.round = true; } else { if (_local6 == null){ _local6 = new TweenLite.plugins.roundProps(); _local6.add(_local8.target, _local3, _local8.start, _local8.change); _hasPlugins = true; _local7 = insertPropTween(_local6, "changeFactor", 0, 1, "_MULTIPLE_", true, this.cachedPT1); this.cachedPT1 = _local7; } else { _local6.add(_local8.target, _local3, _local8.start, _local8.change); }; this.removePropTween(_local8); this.propTweenLookup[_local3] = _local7; }; } else { if (((((_local8.isPlugin) && ((_local8.name == "_MULTIPLE_")))) && (!(_local8.target.round)))){ _local4 = ((" " + _local8.target.overwriteProps.join(" ")) + " "); if (_local4.indexOf(((" " + _local3) + " ")) != -1){ _local8.target.round = true; }; }; }; _local8 = _local8.nextNode; }; }; }; } protected function insertPropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String, _arg6:Boolean, _arg7:PropTween):PropTween{ var _local9:Array; var _local10:int; var _local8:PropTween = new PropTween(_arg1, _arg2, _arg3, ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4), _arg5, _arg6, _arg7); if (((_arg6) && ((_arg5 == "_MULTIPLE_")))){ _local9 = _arg1.overwriteProps; _local10 = _local9.length; while (_local10--) { this.propTweenLookup[_local9[_local10]] = _local8; }; } else { this.propTweenLookup[_arg5] = _local8; }; return (_local8); } protected function removePropTween(_arg1:PropTween):Boolean{ if (_arg1.nextNode){ _arg1.nextNode.prevNode = _arg1.prevNode; }; if (_arg1.prevNode){ _arg1.prevNode.nextNode = _arg1.nextNode; } else { if (this.cachedPT1 == _arg1){ this.cachedPT1 = _arg1.nextNode; }; }; if (((_arg1.isPlugin) && (_arg1.target.onDisable))){ _arg1.target.onDisable(); if (_arg1.target.activeDisable){ return (true); }; }; return (false); } override public function invalidate():void{ this.yoyo = Boolean((this.vars.yoyo == true)); _repeat = ((this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); _hasUpdateListener = false; if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){ initDispatcher(); }; setDirtyCache(true); super.invalidate(); } protected function updateTo(_arg1:Object, _arg2:Boolean=true):void{ var _local5:String; var _local6:Object; var _local7:Boolean; var _local8:Object; var _local9:int; var _local3:PropTween = this.cachedPT1; var _local4:Number = this.cachedTotalTime; if (this.initted){ if (!_arg2){ this.totalTime = 0; }; killVars(_arg1, false); for (_local5 in _arg1) { if ((_local5 in _reservedProps)){ } else { if ((((_local5 in plugins)) && (new ((plugins[_local5] as Class)).onInitTween(this.target, _arg1[_local5], this)))){ _local8 = {}; _local9 = _local6.overwriteProps.length; while (_local9--) { _local8[_local6.overwriteProps[_local9]] = true; }; killVars(_local8, false); this.cachedPT1 = insertPropTween(_local6, "changeFactor", 0, 1, ((_local6.overwriteProps.length)==1) ? _local6.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1); _hasPlugins = true; if (_local6.priority){ this.cachedPT1.priority = _local6.priority; _local7 = true; }; } else { this.cachedPT1 = insertPropTween(this.target, _local5, this.target[_local5], _arg1[_local5], _local5, false, this.cachedPT1); }; }; this.vars[_local5] = _arg1[_local5]; }; if (_local7){ onPluginEvent("onInit", this); }; if (((_arg2) && (this.cachedTotalTime))){ adjustStartValues(); }; } else { for (_local5 in _arg1) { this.vars[_local5] = _arg1[_local5]; }; }; } public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{ var _local4:Object = {}; _local4[_arg1] = _arg2; updateTo(_local4, _arg3); } protected function adjustStartValues():void{ var _local1:Number; var _local2:PropTween; var _local3:Number; if (this.cachedTime != 0){ _local1 = (1 / (1 - this.ratio)); _local2 = this.cachedPT1; while (_local2) { if (!_local2.isPlugin){ _local3 = (_local2.start + _local2.change); _local2.change = ((_local3 - _local2.target[_local2.property]) * _local1); _local2.start = (_local3 - _local2.change); _local2 = _local2.nextNode; }; }; }; } public function killProperties(_arg1:Array):void{ var _local2:Object = {}; var _local3:int = _arg1.length; while (_local3--) { _local2[_arg1[_local3]] = true; }; killVars(_local2); } override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ var _local6:Boolean; var _local7:Boolean; var _local8:Boolean; var _local10:Number; var _local11:uint; var _local12:Number; var _local4:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; var _local5:Number = this.cachedTime; if (_arg1 >= _local4){ this.cachedTotalTime = _local4; this.cachedTime = this.cachedDuration; this.ratio = 1; _local6 = true; if (this.cachedDuration == 0){ if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){ _arg3 = true; }; _rawPrevTime = _arg1; }; } else { if (_arg1 <= 0){ if (_arg1 < 0){ this.active = false; if (this.cachedDuration == 0){ if (_rawPrevTime > 0){ _arg3 = true; _local6 = true; }; _rawPrevTime = _arg1; }; }; this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); if (((this.cachedReversed) && (!((_local5 == 0))))){ _local6 = true; }; } else { this.cachedTotalTime = (this.cachedTime = _arg1); _local8 = true; }; }; if (_repeat != 0){ _local10 = (this.cachedDuration + _repeatDelay); if (_local6){ if (((this.yoyo) && ((_repeat % 2)))){ this.cachedTime = (this.ratio = 0); }; } else { if (_arg1 > 0){ if (_cyclesComplete != (_cyclesComplete = int((this.cachedTotalTime / _local10)))){ _local7 = true; }; this.cachedTime = (((this.cachedTotalTime / _local10) - _cyclesComplete) * _local10); if (((this.yoyo) && ((_cyclesComplete % 2)))){ this.cachedTime = (this.cachedDuration - this.cachedTime); } else { if (this.cachedTime >= this.cachedDuration){ this.cachedTime = this.cachedDuration; this.ratio = 1; _local8 = false; }; }; if (this.cachedTime <= 0){ this.cachedTime = (this.ratio = 0); _local8 = false; }; }; }; }; if ((((_local5 == this.cachedTime)) && (!(_arg3)))){ return; }; if (!this.initted){ init(); }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; if (_local8){ if (_easeType){ _local11 = _easePower; _local12 = (this.cachedTime / this.cachedDuration); if (_easeType == 2){ _local12 = (1 - _local12); this.ratio = _local12; while (_local11--) { this.ratio = (_local12 * this.ratio); }; this.ratio = (1 - this.ratio); } else { if (_easeType == 1){ this.ratio = _local12; while (_local11--) { this.ratio = (_local12 * this.ratio); }; } else { if (_local12 < 0.5){ _local12 = (_local12 * 2); this.ratio = _local12; while (_local11--) { this.ratio = (_local12 * this.ratio); }; this.ratio = (this.ratio * 0.5); } else { _local12 = ((1 - _local12) * 2); this.ratio = _local12; while (_local11--) { this.ratio = (_local12 * this.ratio); }; this.ratio = (1 - (0.5 * this.ratio)); }; }; }; } else { this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if ((((((_local5 == 0)) && (!((this.cachedTotalTime == 0))))) && (!(_arg2)))){ if (this.vars.onStart){ this.vars.onStart.apply(null, this.vars.onStartParams); }; if (_dispatcher){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START)); }; }; var _local9:PropTween = this.cachedPT1; while (_local9) { _local9.target[_local9.property] = (_local9.start + (this.ratio * _local9.change)); _local9 = _local9.nextNode; }; if (((_hasUpdate) && (!(_arg2)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (((_hasUpdateListener) && (!(_arg2)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); }; if (_local6){ if (((_hasPlugins) && (this.cachedPT1))){ onPluginEvent("onComplete", this); }; complete(true, _arg2); } else { if (((_local7) && (!(_arg2)))){ if (this.vars.onRepeat){ this.vars.onRepeat.apply(null, this.vars.onRepeatParams); }; if (_dispatcher){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT)); }; }; }; } override public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{ super.complete(_arg1, _arg2); if (((!(_arg2)) && (_dispatcher))){ if ((((this.cachedTotalTime == this.cachedTotalDuration)) && (!(this.cachedReversed)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); } else { if (((this.cachedReversed) && ((this.cachedTotalTime == 0)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE)); }; }; }; } protected function initDispatcher():void{ if (_dispatcher == null){ _dispatcher = new EventDispatcher(this); }; if ((this.vars.onStartListener is Function)){ _dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true); }; if ((this.vars.onUpdateListener is Function)){ _dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true); _hasUpdateListener = true; }; if ((this.vars.onCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true); }; if ((this.vars.onRepeatListener is Function)){ _dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true); }; if ((this.vars.onReverseCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true); }; } public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ if (_dispatcher == null){ initDispatcher(); }; if (_arg1 == TweenEvent.UPDATE){ _hasUpdateListener = true; }; _dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); } public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{ if (_dispatcher){ _dispatcher.removeEventListener(_arg1, _arg2, _arg3); }; } public function hasEventListener(_arg1:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(_arg1)); } public function willTrigger(_arg1:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(_arg1)); } public function dispatchEvent(_arg1:Event):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(_arg1)); } public function get currentProgress():Number{ return ((this.cachedTime / this.duration)); } public function set currentProgress(_arg1:Number):void{ if (_cyclesComplete == 0){ setTotalTime((this.duration * _arg1), false); } else { setTotalTime(((this.duration * _arg1) + (_cyclesComplete * this.cachedDuration)), false); }; } public function get totalProgress():Number{ return ((this.cachedTotalTime / this.totalDuration)); } public function set totalProgress(_arg1:Number):void{ setTotalTime((this.totalDuration * _arg1), false); } override public function set currentTime(_arg1:Number):void{ if (_cyclesComplete == 0){ } else { if (((this.yoyo) && (((_cyclesComplete % 2) == 1)))){ _arg1 = ((this.duration - _arg1) + (_cyclesComplete * (this.cachedDuration + _repeatDelay))); } else { _arg1 = (_arg1 + (_cyclesComplete * (this.duration + _repeatDelay))); }; }; setTotalTime(_arg1, false); } override public function get totalDuration():Number{ if (this.cacheIsDirty){ this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat)); this.cacheIsDirty = false; }; return (this.cachedTotalDuration); } override public function set totalDuration(_arg1:Number):void{ if (_repeat == -1){ return; }; this.duration = ((_arg1 - (_repeat * _repeatDelay)) / (_repeat + 1)); } public function get timeScale():Number{ return (this.cachedTimeScale); } public function set timeScale(_arg1:Number):void{ if (_arg1 == 0){ _arg1 = 0.0001; }; var _local2:Number = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime; this.cachedStartTime = (_local2 - (((_local2 - this.cachedStartTime) * this.cachedTimeScale) / _arg1)); this.cachedTimeScale = _arg1; setDirtyCache(false); } public function get repeat():int{ return (_repeat); } public function set repeat(_arg1:int):void{ _repeat = _arg1; setDirtyCache(true); } public function get repeatDelay():Number{ return (_repeatDelay); } public function set repeatDelay(_arg1:Number):void{ _repeatDelay = _arg1; setDirtyCache(true); } public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{ return (new TweenMax(_arg1, _arg2, _arg3)); } public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{ _arg3.runBackwards = true; if (!("immediateRender" in _arg3)){ _arg3.immediateRender = true; }; return (new TweenMax(_arg1, _arg2, _arg3)); } public static function fromTo(_arg1:Object, _arg2:Number, _arg3:Object, _arg4:Object):TweenMax{ _arg4.startAt = _arg3; if (_arg3.immediateRender){ _arg4.immediateRender = true; }; return (new TweenMax(_arg1, _arg2, _arg4)); } public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{ var i:int; var varsDup:Object; var p:String; var onCompleteProxy:Function; var onCompleteParamsProxy:Array; var targets = _arg1; var duration = _arg2; var vars = _arg3; var stagger = _arg4; var onCompleteAll = _arg5; var onCompleteAllParams = _arg6; var l:uint = targets.length; var a:Array = []; var curDelay:Number = ((vars.delay) || (0)); onCompleteProxy = vars.onComplete; onCompleteParamsProxy = vars.onCompleteParams; var lastIndex:int = ((stagger)<=0) ? 0 : (l - 1); i = 0; while (i < l) { varsDup = {}; for (p in vars) { varsDup[p] = vars[p]; }; varsDup.delay = curDelay; if ((((i == lastIndex)) && (!((onCompleteAll == null))))){ varsDup.onComplete = function ():void{ if (onCompleteProxy != null){ onCompleteProxy.apply(null, onCompleteParamsProxy); }; onCompleteAll.apply(null, onCompleteAllParams); }; }; a[a.length] = new TweenMax(targets[i], duration, varsDup); curDelay = (curDelay + stagger); i = (i + 1); }; return (a); } public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{ _arg3.runBackwards = true; if (!("immediateRender" in _arg3)){ _arg3.immediateRender = true; }; return (allTo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6)); } public static function allFromTo(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Object, _arg5:Number=0, _arg6:Function=null, _arg7:Array=null):Array{ _arg4.startAt = _arg3; if (_arg3.immediateRender){ _arg4.immediateRender = true; }; return (allTo(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7)); } public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{ return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0})); } public static function getTweensOf(_arg1:Object):Array{ var _local4:int; var _local5:uint; var _local2:Array = masterList[_arg1]; var _local3:Array = []; if (_local2){ _local4 = _local2.length; _local5 = 0; while (_local4--) { if (!_local2[_local4].gc){ var _temp1 = _local5; _local5 = (_local5 + 1); var _local6 = _temp1; _local3[_local6] = _local2[_local4]; }; }; }; return (_local3); } public static function isTweening(_arg1:Object):Boolean{ var _local4:TweenLite; var _local2:Array = getTweensOf(_arg1); var _local3:int = _local2.length; while (_local3--) { _local4 = _local2[_local3]; if (((_local4.active) || ((((_local4.cachedStartTime == _local4.timeline.cachedTime)) && (_local4.timeline.active))))){ return (true); }; }; return (false); } public static function getAllTweens():Array{ var _local4:Array; var _local5:int; var _local1:Dictionary = masterList; var _local2:uint; var _local3:Array = []; for each (_local4 in _local1) { _local5 = _local4.length; while (_local5--) { if (!TweenLite(_local4[_local5]).gc){ var _temp1 = _local2; _local2 = (_local2 + 1); var _local8 = _temp1; _local3[_local8] = _local4[_local5]; }; }; }; return (_local3); } public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{ var _local5:Boolean; var _local4:Array = getAllTweens(); var _local6:int = _local4.length; while (_local6--) { _local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete); if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){ if (_arg1){ _local4[_local6].complete(false); } else { _local4[_local6].setEnabled(false, false); }; }; }; } public static function killChildTweensOf(_arg1:DisplayObjectContainer, _arg2:Boolean=false):void{ var _local4:Object; var _local5:DisplayObjectContainer; var _local3:Array = getAllTweens(); var _local6:int = _local3.length; while (_local6--) { _local4 = _local3[_local6].target; if ((_local4 is DisplayObject)){ _local5 = _local4.parent; while (_local5) { if (_local5 == _arg1){ if (_arg2){ _local3[_local6].complete(false); } else { _local3[_local6].setEnabled(false, false); }; }; _local5 = _local5.parent; }; }; }; } public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=true):void{ changePause(true, _arg1, _arg2); } public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=true):void{ changePause(false, _arg1, _arg2); } private static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{ var _local5:Boolean; var _local4:Array = getAllTweens(); var _local6:int = _local4.length; while (_local6--) { _local5 = (TweenLite(_local4[_local6]).target == TweenLite(_local4[_local6]).vars.onComplete); if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){ TweenCore(_local4[_local6]).paused = _arg1; }; }; } public static function get globalTimeScale():Number{ return (((TweenLite.rootTimeline)==null) ? 1 : TweenLite.rootTimeline.cachedTimeScale); } public static function set globalTimeScale(_arg1:Number):void{ if (_arg1 == 0){ _arg1 = 0.0001; }; if (TweenLite.rootTimeline == null){ TweenLite.to({}, 0, {}); }; var _local2:SimpleTimeline = TweenLite.rootTimeline; var _local3:Number = (getTimer() * 0.001); _local2.cachedStartTime = (_local3 - (((_local3 - _local2.cachedStartTime) * _local2.cachedTimeScale) / _arg1)); _local2 = TweenLite.rootFramesTimeline; _local3 = TweenLite.rootFrame; _local2.cachedStartTime = (_local3 - (((_local3 - _local2.cachedStartTime) * _local2.cachedTimeScale) / _arg1)); TweenLite.rootFramesTimeline.cachedTimeScale = (TweenLite.rootTimeline.cachedTimeScale = _arg1); } TweenPlugin.activate([AutoAlphaPlugin, EndArrayPlugin, FramePlugin, RemoveTintPlugin, TintPlugin, VisiblePlugin, VolumePlugin, BevelFilterPlugin, BezierPlugin, BezierThroughPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, ColorTransformPlugin, DropShadowFilterPlugin, FrameLabelPlugin, GlowFilterPlugin, HexColorsPlugin, RoundPropsPlugin, ShortRotationPlugin, {}]); } }//package com.greensock
Section 173
//Tracker (com.memecounter.Tracker) package com.memecounter { import flash.events.*; import flash.display.*; import flash.net.*; import flash.utils.*; import flash.system.*; public class Tracker { public static var root:DisplayObject; public static var c:uint; public static var a:uint = 0; public static var da:Array = ["distralytics.com", "distralytics.co.uk"]; public static var d:String = ""; public static var fpv:String = ""; private static var _isInited:Boolean = false; public static var _isReady:Boolean = false; private static var l:Loader; private static var lurl:String; private static var ori_dom:String; private static var _startEvent:uint = 0; private static var tracker:MovieClip; public static function init(_arg1:uint, _arg2:DisplayObject, _arg3:uint=0):void{ var _local4:uint; if (!_isInited){ _startEvent = _arg3; _isInited = true; c = _arg1; root = _arg2; _local4 = 0; while (_local4 < da.length) { Security.allowDomain(da[_local4], ((c + ".c.") + da[_local4]), ("*." + da[_local4])); _local4++; }; ori_dom = (root.loaderInfo.parameters.hasOwnProperty("ori_dom")) ? root.loaderInfo.parameters.ori_dom : ""; d = ((ori_dom)!="") ? ori_dom : ((root.loaderInfo.loaderURL.split("/")[0].indexOf("http"))==-1) ? "Local" : root.loaderInfo.loaderURL.split("/")[2].split("?")[0]; fpv = Capabilities.version.split(" ")[1].split(",")[0]; lurl = ((((((((("/control/tracking/trackerAS3.swf" + "?c=") + c) + "&r=") + Math.floor((Math.random() * 10000000000))) + "&d=") + d) + "&p=") + fpv) + "&as=3"); l = new Loader(); l.contentLoaderInfo.addEventListener(Event.INIT, loadComplete); l.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError); lc(); }; } public static function get isReady():Boolean{ return (isReady); } private static function loadComplete(_arg1:Event):void{ tracker = _arg1.target.content; tracker.init(getDefinitionByName("com.memecounter.Tracker"), root); _isReady = true; if (_startEvent != 0){ setTimeout(kvEvent, 5000, _startEvent); }; } private static function loadError(_arg1:Event):void{ a++; lc(); } private static function lc():void{ var _local1:String = (((("http://" + c) + ".c.") + da[(a % da.length)]) + lurl); Security.allowDomain(_local1); l.load(new URLRequest(_local1)); } public static function kvClick(_arg1:uint):void{ if (_isReady){ tracker.kvClick(_arg1); }; } public static function kvEvent(_arg1:uint):void{ if (_isReady){ tracker.kvEvent(_arg1); }; } public static function kvCountry():String{ if (_isReady){ return (tracker.kvCountry()); }; return (""); } } }//package com.memecounter
Section 174
//ArrayUtils (com.stampy.arrays.ArrayUtils) package com.stampy.arrays { public class ArrayUtils { public static function randomArray(_arg1:Array):Array{ var _local2:Array = new Array(); while (_arg1.length > 0) { _local2.push(_arg1.splice(Math.floor((Math.random() * _arg1.length)), 1)); }; return (_local2); } public static function arrayContains(_arg1:Array, _arg2):Boolean{ var _local3:uint = _arg1.length; var _local4:int; while (_local4 < _local3) { if (_arg1[_local4] == _arg2){ return (true); }; _local4++; }; return (false); } } }//package com.stampy.arrays
Section 175
//CustomContextMenu (com.stampy.contextmenu.CustomContextMenu) package com.stampy.contextmenu { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.ui.*; public class CustomContextMenu extends EventDispatcher { private var customCM:ContextMenu; private var target:InteractiveObject; private var selectedMenuItem:String; private var _menuItems:Dictionary; public function CustomContextMenu(_arg1:InteractiveObject){ this.target = _arg1; customCM = new ContextMenu(); removeDefaultItems(); _arg1.contextMenu = customCM; _menuItems = new Dictionary(); addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, handleMenuSelection); } private function handleMenuSelection(_arg1:ContextMenuEvent):void{ var _local2:Function; if (_menuItems[this.selectedMenu].hasOwnProperty("callBack")){ _local2 = (_menuItems[this.selectedMenu].callBack as Function); _local2.apply(null, _menuItems[this.selectedMenu].args); }; } public function get selectedMenu():String{ return (selectedMenuItem); } public function get currentMenuItems():Array{ return (customCM.customItems); } private function removeDefaultItems():void{ customCM.hideBuiltInItems(); } private function dispatchMenuEvent(_arg1:ContextMenuEvent):void{ selectedMenuItem = _arg1.target.caption; dispatchEvent(_arg1); } public function addMenuItem(_arg1:String, _arg2:Boolean, _arg3:Function, ... _args):void{ var _local5:ContextMenuItem = new ContextMenuItem(_arg1, _arg2); _local5.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, dispatchMenuEvent); customCM.customItems.push(_local5); _menuItems[_arg1] = {callBack:_arg3, args:_args}; } public function removeMenuItem(_arg1:String):void{ var _local3:Object; var _local2:Array = customCM.customItems; for (_local3 in _local2) { if (_local2[_local3].caption == _arg1){ _local2[_local3].removeEventListener(ContextMenuEvent.MENU_ITEM_SELECT, dispatchMenuEvent); customCM.customItems.splice(_local3, 1); break; }; }; } public function hideMenuItem(_arg1:String):void{ var _local3:Object; var _local2:Array = customCM.customItems; for (_local3 in _local2) { if (_local2[_local3].caption == _arg1){ customCM.customItems[_local3].enabled = false; break; }; }; } public function showMenuItem(_arg1:String):void{ var _local3:Object; var _local2:Array = customCM.customItems; for (_local3 in _local2) { if (_local2[_local3].caption == _arg1){ customCM.customItems[_local3].enabled = true; break; }; }; } } }//package com.stampy.contextmenu
Section 176
//EmailUtils (com.stampy.emails.EmailUtils) package com.stampy.emails { public class EmailUtils { public static function isValid(_arg1:String):Boolean{ var _local2:Boolean; var _local3:int = _arg1.indexOf("@"); var _local4:int = _arg1.indexOf("."); if ((((_local3 > 0)) && ((_local4 > 0)))){ _local2 = true; }; return (_local2); } } }//package com.stampy.emails
Section 177
//FrameUtils (com.stampy.frames.FrameUtils) package com.stampy.frames { import flash.display.*; public class FrameUtils { public static function frameNumByLabel(_arg1:String, _arg2:MovieClip):Number{ var _local3:uint = _arg2.currentLabels.length; var _local4:uint; while (_local4 < _local3) { if (_arg2.currentLabels[_local4].name == _arg1){ return (_arg2.currentLabels[_local4].frame); }; _local4++; }; return (1); } public static function removeOnEnterFrame(_arg1, _arg2, _arg3:Function):void{ if ((_arg2 is MovieClip)){ if ((_arg1 is uint)){ _arg2.addFrameScript((_arg1 - 1), _arg3, false, false); } else { if ((_arg1 is String)){ _arg2.addFrameScript((frameNumByLabel(_arg1, _arg2) - 1), _arg3, false, false); }; }; }; } public static function onEnterFrame(_arg1, _arg2, _arg3:Function, ... _args):void{ var _local5:uint; var _local6:uint; var _local7:uint; var _local8:uint; if ((_arg2 is MovieClip)){ if ((_arg1 is uint)){ _arg2.addFrameScript((_arg1 - 1), _arg3); } else { if ((_arg1 is String)){ _arg2.addFrameScript((frameNumByLabel(_arg1, _arg2) - 1), _arg3); } else { if ((_arg1 is Array)){ _local5 = _arg1.length; _local6 = 0; while (_local6 < _local5) { onEnterFrame(_arg1[_local6], _arg2, _arg3); _local6++; }; }; }; }; }; if ((_arg2 is Array)){ _local7 = _arg2.length; _local8 = 0; while (_local8 < _local7) { onEnterFrame(_arg1, _arg2[_local8], _arg3); _local8++; }; }; } public static function onEveryFrame(_arg1, _arg2:Function):void{ var _local4:uint; var _local5:uint; var _local6:uint; var _local3:uint = _arg1.framesLoaded; if ((_arg1 is MovieClip)){ _local4 = 1; while (_local4 <= _local3) { onEnterFrame(_local4, _arg1, _arg2); _local4++; }; } else { if ((_arg1 is Array)){ _local5 = _arg1.length; _local6 = 0; while (_local6 < _local5) { onEveryFrame(_arg1[_local6], _arg2); _local6++; }; }; }; } } }//package com.stampy.frames
Section 178
//Global (com.stampy.global.Global) package com.stampy.global { public class Global { public static var vars:Object = {}; } }//package com.stampy.global
Section 179
//Point3D (com.stampy.points.Point3D) package com.stampy.points { public class Point3D { private var _z:Number; private var _x:Number; private var _y:Number; public function Point3D(_arg1:Number, _arg2:Number, _arg3:Number){ _x = _arg1; _y = _arg2; _z = _arg3; } public function set x(_arg1:Number):void{ _x = _arg1; } public function set y(_arg1:Number):void{ _y = _arg1; } public function set z(_arg1:Number):void{ _z = _arg1; } public function get x():Number{ return (_x); } public function get y():Number{ return (_y); } public function get z():Number{ return (_z); } } }//package com.stampy.points
Section 180
//PointDistance (com.stampy.points.PointDistance) package com.stampy.points { import flash.geom.*; public class PointDistance { public static function betweenPoints(_arg1:Point, _arg2:Point):Number{ var _local3:*; var _local4:*; var _local5:Number; _local4 = (_arg2.x - _arg1.x); _local5 = (_arg2.y - _arg1.y); _local3 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5))); return (_local3); } public static function betweenPoints3D(_arg1:Point3D, _arg2:Point3D):Number{ var _local3:*; var _local4:*; var _local5:*; var _local6:Number; _local4 = (_arg2.x - _arg1.x); _local5 = (_arg2.y - _arg1.y); _local6 = (_arg2.z - _arg1.z); _local3 = Math.sqrt((((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6))); return (_local3); } } }//package com.stampy.points
Section 181
//PowerLoader (com.stampy.preloader.PowerLoader) package com.stampy.preloader { import flash.events.*; import flash.display.*; import flash.net.*; import flash.media.*; import com.stampy.random.*; import flash.system.*; public class PowerLoader extends EventDispatcher { private var _urlLoader:URLLoader; private var _loader:Loader; private var _sound:Sound; private var _method:String; private var _id; private var _streamOpen:Boolean; public function PowerLoader(){ _streamOpen = false; super(); } public function load(_arg1:String, _arg2:Boolean=false){ var _local4:LoaderContext; var _local3:String = (_arg2) ? ("?" + Random.range(1, 999).toString()) : ""; switch (getFileExtension(_arg1)){ case "xml": default: _method = "_urlLoader"; _urlLoader = new URLLoader(); _urlLoader.addEventListener(Event.COMPLETE, loadComplete); _urlLoader.addEventListener(ProgressEvent.PROGRESS, loadProgress); _urlLoader.addEventListener(IOErrorEvent.IO_ERROR, loadError); _urlLoader.load(new URLRequest((_arg1 + _local3))); _streamOpen = true; break; case "jpg": case "bmp": case "gif": case "png": case "swf": _local4 = new LoaderContext(true); _method = "_loader"; _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete); _loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError); _loader.load(new URLRequest((_arg1 + _local3)), _local4); _streamOpen = true; break; case "mp3": _method = "_sound"; _sound = new Sound(); _sound.addEventListener(Event.COMPLETE, loadComplete); _sound.addEventListener(ProgressEvent.PROGRESS, loadProgress); _sound.addEventListener(IOErrorEvent.IO_ERROR, loadError); _sound.load(new URLRequest((_arg1 + _local3))); _streamOpen = true; break; }; } public function cancel():void{ if (_streamOpen){ switch (_method){ case "_urlLoader": _urlLoader.close(); break; case "_loader": _loader.close(); break; case "_sound": _sound.close(); break; }; }; } public function set id(_arg1):void{ _id = _arg1; } public function get id(){ return (_id); } public function get content(){ switch (_method){ case "_urlLoader": return (this[_method].data); case "_loader": return (this[_method].content); case "_sound": return (_sound); }; return (null); } public function getLoader(){ switch (_method){ case "_urlLoader": return (this[_method]); case "_loader": return (this[_method]); }; return (null); } private function loadComplete(_arg1:Event):void{ dispatchEvent(_arg1); } private function loadProgress(_arg1:ProgressEvent):void{ dispatchEvent(_arg1); } private function loadError(_arg1:IOErrorEvent):void{ dispatchEvent(_arg1); } private function getFileExtension(_arg1:String):String{ var _local2 = "."; if (_arg1 == null){ return (""); }; var _local3:int = _arg1.lastIndexOf(_local2); if (_local3 == -1){ return (""); }; _local3 = (_local3 + _local2.length); return (_arg1.substr(_local3)); } } }//package com.stampy.preloader
Section 182
//Random (com.stampy.random.Random) package com.stampy.random { import com.stampy.arrays.*; public class Random { public static function range(_arg1:Number, _arg2:Number):Number{ return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1)); } public static function rangeWithExceptions(_arg1:Number, _arg2, _arg3:Array):Number{ var _local4:Number = 0; do { _local4 = range(_arg1, _arg2); } while (ArrayUtils.arrayContains(_arg3, _local4)); return (_local4); } public static function boolean():Boolean{ return (((range(1, 2))==1) ? true : false); } } }//package com.stampy.random
Section 183
//PHP_Service (com.stampy.services.PHP_Service) package com.stampy.services { import flash.events.*; import flash.net.*; public class PHP_Service extends EventDispatcher { private var _phpURL:String; private var _phpVariables:URLVariables; private var _phpPost:URLRequest; private var _phpReceive:URLLoader; private var _debug:Boolean; public function PHP_Service(_arg1:String):void{ _debug = false; super(); _phpURL = _arg1; _phpVariables = new URLVariables(); } public function get debug():Boolean{ return (_debug); } public function set debug(_arg1:Boolean):void{ _debug = _arg1; } public function send():void{ var _local1:Object; if (_phpVariables.toString() == "="){ return; }; _phpPost = new URLRequest(_phpURL); _phpPost.method = URLRequestMethod.POST; _phpPost.data = _phpVariables; _phpReceive = new URLLoader(); _phpReceive.dataFormat = URLLoaderDataFormat.VARIABLES; _phpReceive.addEventListener(Event.COMPLETE, dataRecieved); _phpReceive.addEventListener(IOErrorEvent.IO_ERROR, dataRequestFailed); _phpReceive.load(_phpPost); if (!debug){ return; }; for (_local1 in _phpVariables) { }; } public function addVariable(_arg1:String, _arg2){ _phpVariables[_arg1] = _arg2; } private function dataRecieved(_arg1:Event):void{ dispatchEvent(new PHPEvent(PHPEvent.DATA_RECIEVED, _arg1.target.data)); } private function dataRequestFailed(_arg1:IOErrorEvent):void{ dispatchEvent(new PHPEvent(PHPEvent.DATA_FAILED, null)); } } }//package com.stampy.services
Section 184
//PHPEvent (com.stampy.services.PHPEvent) package com.stampy.services { import flash.events.*; public class PHPEvent extends Event { private var _data; public static const DATA_RECIEVED:String = "dataRecieved"; public static const DATA_FAILED:String = "dataFailed"; public function PHPEvent(_arg1:String, _arg2){ super(_arg1); _data = _arg2; } override public function clone():Event{ return (new PHPEvent(type, _data)); } public function get data(){ return (_data); } } }//package com.stampy.services
Section 185
//StringUtils (com.stampy.strings.StringUtils) package com.stampy.strings { public class StringUtils { private function replace(_arg1:String, _arg2:String, _arg3:String):String{ return (_arg1.split(_arg2).join(_arg3)); } public static function afterFirst(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.indexOf(_arg2); if (_local3 == -1){ return (""); }; _local3 = (_local3 + _arg2.length); return (_arg1.substr(_local3)); } public static function afterLast(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.lastIndexOf(_arg2); if (_local3 == -1){ return (""); }; _local3 = (_local3 + _arg2.length); return (_arg1.substr(_local3)); } public static function beginsWith(_arg1:String, _arg2:String):Boolean{ if (_arg1 == null){ return (false); }; return ((_arg1.indexOf(_arg2) == 0)); } public static function beforeFirst(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.indexOf(_arg2); if (_local3 == -1){ return (""); }; return (_arg1.substr(0, _local3)); } public static function beforeLast(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.lastIndexOf(_arg2); if (_local3 == -1){ return (""); }; return (_arg1.substr(0, _local3)); } public static function between(_arg1:String, _arg2:String, _arg3:String):String{ var _local6:int; var _local4 = ""; if (_arg1 == null){ return (_local4); }; var _local5:int = _arg1.indexOf(_arg2); if (_local5 != -1){ _local5 = (_local5 + _arg2.length); _local6 = _arg1.indexOf(_arg3, _local5); if (_local6 != -1){ _local4 = _arg1.substr(_local5, (_local6 - _local5)); }; }; return (_local4); } public static function block(_arg1:String, _arg2:uint, _arg3:String="."):Array{ var _local8:String; var _local4:Array = new Array(); if ((((_arg1 == null)) || (!(contains(_arg1, _arg3))))){ return (_local4); }; var _local5:uint; var _local6:uint = _arg1.length; var _local7:RegExp = new RegExp((("[^" + escapePattern(_arg3)) + "]+$")); while (_local5 < _local6) { _local8 = _arg1.substr(_local5, _arg2); if (!contains(_local8, _arg3)){ _local4.push(truncate(_local8, _local8.length)); _local5 = (_local5 + _local8.length); }; _local8 = _local8.replace(_local7, ""); _local4.push(_local8); _local5 = (_local5 + _local8.length); }; return (_local4); } public static function capitalize(_arg1:String, ... _args):String{ var _local3:String = trimLeft(_arg1); if (_args[0] === true){ return (_local3.replace(/^.|\b./g, _upperCase)); }; return (_local3.replace(/(^\w)/, _upperCase)); } public static function contains(_arg1:String, _arg2:String):Boolean{ if (_arg1 == null){ return (false); }; return (!((_arg1.indexOf(_arg2) == -1))); } public static function countOf(_arg1:String, _arg2:String, _arg3:Boolean=true):uint{ if (_arg1 == null){ return (0); }; var _local4:String = escapePattern(_arg2); var _local5:String = (_arg3) ? "g" : "ig"; return (_arg1.match(new RegExp(_local4, _local5)).length); } public static function editDistance(_arg1:String, _arg2:String):uint{ var _local3:uint; var _local5:uint; var _local8:uint; var _local9:String; var _local10:String; if (_arg1 == null){ _arg1 = ""; }; if (_arg2 == null){ _arg2 = ""; }; if (_arg1 == _arg2){ return (0); }; var _local4:Array = new Array(); var _local6:uint = _arg1.length; var _local7:uint = _arg2.length; if (_local6 == 0){ return (_local7); }; if (_local7 == 0){ return (_local6); }; _local3 = 0; while (_local3 <= _local6) { _local4[_local3] = new Array(); _local3++; }; _local3 = 0; while (_local3 <= _local6) { _local4[_local3][0] = _local3; _local3++; }; _local8 = 0; while (_local8 <= _local7) { _local4[0][_local8] = _local8; _local8++; }; _local3 = 1; while (_local3 <= _local6) { _local9 = _arg1.charAt((_local3 - 1)); _local8 = 1; while (_local8 <= _local7) { _local10 = _arg2.charAt((_local8 - 1)); if (_local9 == _local10){ _local5 = 0; } else { _local5 = 1; }; _local4[_local3][_local8] = _minimum((_local4[(_local3 - 1)][_local8] + 1), (_local4[_local3][(_local8 - 1)] + 1), (_local4[(_local3 - 1)][(_local8 - 1)] + _local5)); _local8++; }; _local3++; }; return (_local4[_local6][_local7]); } public static function endsWith(_arg1:String, _arg2:String):Boolean{ return ((_arg1.lastIndexOf(_arg2) == (_arg1.length - _arg2.length))); } public static function hasText(_arg1:String):Boolean{ var _local2:String = removeExtraWhitespace(_arg1); return (!(!(_local2.length))); } public static function isEmpty(_arg1:String):Boolean{ if (_arg1 == null){ return (true); }; return (!(_arg1.length)); } public static function isNumeric(_arg1:String):Boolean{ if (_arg1 == null){ return (false); }; var _local2:RegExp = /^[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?$/; return (_local2.test(_arg1)); } public static function padLeft(_arg1:String, _arg2:String, _arg3:uint):String{ var _local4:String = _arg1; while (_local4.length < _arg3) { _local4 = (_arg2 + _local4); }; return (_local4); } public static function padRight(_arg1:String, _arg2:String, _arg3:uint):String{ var _local4:String = _arg1; while (_local4.length < _arg3) { _local4 = (_local4 + _arg2); }; return (_local4); } public static function properCase(_arg1:String):String{ if (_arg1 == null){ return (""); }; var _local2:String = _arg1.toLowerCase().replace(/\b([^.?;!]+)/, capitalize); return (_local2.replace(/\b[i]\b/, "I")); } public static function quote(_arg1:String):String{ var _local2:RegExp = /[\\"\r\n]/g; return ((("\"" + _arg1.replace(_local2, _quote)) + "\"")); } public static function remove(_arg1:String, _arg2:String, _arg3:Boolean=true):String{ if (_arg1 == null){ return (""); }; var _local4:String = escapePattern(_arg2); var _local5:String = (_arg3) ? "g" : "ig"; return (_arg1.replace(new RegExp(_local4, _local5), "")); } public static function removeExtraWhitespace(_arg1:String):String{ if (_arg1 == null){ return (""); }; var _local2:String = trim(_arg1); return (_local2.replace(/\s+/g, " ")); } public static function reverse(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.split("").reverse().join("")); } public static function reverseWords(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.split(/\s+/).reverse().join("")); } public static function similarity(_arg1:String, _arg2:String):Number{ var _local3:uint = editDistance(_arg1, _arg2); var _local4:uint = Math.max(_arg1.length, _arg2.length); if (_local4 == 0){ return (100); }; return (((1 - (_local3 / _local4)) * 100)); } public static function stripTags(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/<\/?[^>]+>/igm, "")); } public static function swapCase(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/(\w)/, _swapCase)); } public static function trim(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/^\s+|\s+$/g, "")); } public static function trimLeft(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/^\s+/, "")); } public static function trimRight(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/\s+$/, "")); } public static function wordCount(_arg1:String):uint{ if (_arg1 == null){ return (0); }; return (_arg1.match(/\b\w+\b/g).length); } public static function truncate(_arg1:String, _arg2:uint, _arg3:String="..."):String{ if (_arg1 == null){ return (""); }; _arg2 = (_arg2 - _arg3.length); var _local4:String = _arg1; if (_local4.length > _arg2){ _local4 = _local4.substr(0, _arg2); if (/[^\s]/.test(_arg1.charAt(_arg2))){ _local4 = trimRight(_local4.replace(/\w+$|\s+$/, "")); }; _local4 = (_local4 + _arg3); }; return (_local4); } private static function escapePattern(_arg1:String):String{ return (_arg1.replace(/(\]|\[|\{|\}|\(|\)|\*|\+|\?|\.|\\)/g, "\\$1")); } private static function _minimum(_arg1:uint, _arg2:uint, _arg3:uint):uint{ return (Math.min(_arg1, Math.min(_arg2, Math.min(_arg3, _arg1)))); } private static function _quote(_arg1:String, ... _args):String{ switch (_arg1){ case "\\": return ("\\\\"); case "\r": return ("\\r"); case "\n": return ("\\n"); case "\"": return ("\\\""); default: return (""); }; } private static function _upperCase(_arg1:String, ... _args):String{ return (_arg1.toUpperCase()); } private static function _swapCase(_arg1:String, ... _args):String{ var _local3:String = _arg1.toLowerCase(); var _local4:String = _arg1.toUpperCase(); switch (_arg1){ case _local3: return (_local4); case _local4: return (_local3); default: return (_arg1); }; } } }//package com.stampy.strings
Section 186
//Validate (com.stampy.validation.Validate) package com.stampy.validation { import com.stampy.emails.*; import com.stampy.strings.*; public class Validate { public static function email(_arg1:String):Boolean{ return (EmailUtils.isValid(_arg1)); } public static function string(_arg1:String):Boolean{ return (StringUtils.hasText(_arg1)); } public static function postCodeUK(_arg1:String):Boolean{ var _local2:RegExp = /^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) {0,1}[0-9][A-Za-z]{2})$/i; return (_local2.test(_arg1)); } } }//package com.stampy.validation
Section 187
//BitmapSequence (console.bitmapAnimation.BitmapSequence) package console.bitmapAnimation { import flash.display.*; import flash.geom.*; import flash.utils.*; public class BitmapSequence extends Bitmap { private var _interval:uint; private var _bitmapData:BitmapData; private var _frameWidth:Number; private var _frameHeight:Number; private var _currentFrame:int; private var _frameRate:uint; private var _looping:Boolean; private var _lastFrame:uint; private var _finalFrame:uint; private var _isPlaying; private var _isFramerateUpdated; private var _bitmapSequence:Array; private var _lastFrameInLoop:uint; private var _frameStop:Dictionary; private var _cropArea:Rectangle; private var _isRemovalAtEnd:Boolean; public function BitmapSequence(_arg1:Array, _arg2, _arg3:Rectangle=null){ _currentFrame = 0; _looping = true; _isPlaying = false; _isFramerateUpdated = false; _bitmapSequence = new Array(); _frameStop = new Dictionary(); _isRemovalAtEnd = false; super(); _cropArea = _arg3; _frameRate = _arg2; _bitmapSequence = _arg1; _finalFrame = _bitmapSequence.length; _lastFrameInLoop = (_finalFrame - 1); } public function set loop(_arg1:Boolean):void{ _looping = _arg1; } public function get loop():Boolean{ return (_looping); } public function play():void{ _isPlaying = true; _interval = setInterval(update, Math.round((1000 / _frameRate))); } public function set frameRate(_arg1:uint):void{ _frameRate = _arg1; _isFramerateUpdated = true; } public function get frameRate():uint{ return (_frameRate); } public function stop():void{ _isPlaying = false; clearInterval(_interval); } public function nextFrame():void{ update(); } public function prevFrame():void{ _currentFrame = (((_currentFrame - 2))>=0) ? (_currentFrame - 2) : (_finalFrame - _currentFrame); update(); } override public function get bitmapData():BitmapData{ var _local1:BitmapData; var _local2:BitmapData; if (_cropArea == null){ return (_bitmapSequence[_currentFrame]); }; _local1 = new BitmapData(_cropArea.width, _cropArea.height); _local2 = _bitmapSequence[_currentFrame]; _local1.copyPixels(_local2, _cropArea, new Point()); return (_local1); } override public function getRect(_arg1:DisplayObject):Rectangle{ return (new Rectangle(this.x, this.y, _frameWidth, _frameHeight)); } public function gotoAndStop(_arg1:uint):void{ stop(); this.frame = _arg1; } public function gotoAndPlay(_arg1:uint):void{ this.frame = _arg1; play(); } public function playOnce(_arg1:Boolean=false):void{ _isRemovalAtEnd = _arg1; gotoAndPlayBetween(1, _finalFrame); } public function gotoAndPlayBetween(_arg1:uint, _arg2:uint):void{ stopOnFrame(_arg2); gotoAndPlay(_arg1); } public function stopOnFrame(_arg1:uint):void{ _frameStop[(_arg1 - 1)] = true; } public function set frame(_arg1:uint):void{ if ((((_arg1 >= 0)) && ((_arg1 <= _finalFrame)))){ _currentFrame = _arg1; update(); }; } public function get frame():uint{ return ((_currentFrame + 1)); } private function update():void{ if (_frameStop[_currentFrame] == null){ if (_currentFrame < _lastFrameInLoop){ _currentFrame++; } else { if (_looping){ _currentFrame = 0; } else { stop(); }; }; if (_isFramerateUpdated){ _isFramerateUpdated = false; stop(); play(); }; } else { stop(); delete _frameStop[_currentFrame]; }; } public function get isPlaying():Boolean{ return (_isPlaying); } public function get currentFrame():int{ return ((_currentFrame + 1)); } public function get isRemovedAtEnd():Boolean{ return (_isRemovalAtEnd); } } }//package console.bitmapAnimation
Section 188
//BitmapSequenceBuilder (console.bitmapAnimation.BitmapSequenceBuilder) package console.bitmapAnimation { import flash.display.*; import flash.geom.*; public class BitmapSequenceBuilder { public static function sequence(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:Boolean=true):Array{ var _local8:BitmapData; var _local6:Array = []; var _local7:* = new Rectangle(0, 0, _arg2, _arg3); var _local9:uint = Math.floor((_arg1.width / _arg2)); var _local10:int; while (_local10 < _arg4) { _local7.x = ((_local10 % _local9) * _arg2); _local7.y = (Math.floor((_local10 / _local9)) * _arg3); _local8 = new BitmapData(_arg2, _arg3, _arg5, 0); _local8.copyPixels(_arg1, _local7, new Point(), null, null, _arg5); _local6[_local6.length] = _local8; _local10++; }; return (_local6); } public static function resequenceRotation(_arg1:Array, _arg2:Number, _arg3:Boolean=true):Array{ var _local4:Array = _arg1.concat(); var _local5:int; while (_local5 < _arg1.length) { _local4[_local5] = BitmapUtils.rotation(_local4[_local5].clone(), _arg2, _arg3); _local5++; }; return (_local4); } public static function resequenceScale(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Boolean=true):Array{ var _local5:Array = _arg1.concat(); var _local6:int; while (_local6 < _arg1.length) { _local5[_local6] = BitmapUtils.scale(_local5[_local6].clone(), _arg2, _arg3, _arg4); _local6++; }; return (_local5); } public static function resequenceAlpha(_arg1:Array, _arg2:Number):Array{ var _local3:Array = _arg1.concat(); var _local4:int; while (_local4 < _arg1.length) { _local3[_local4] = BitmapUtils.alpha(_local3[_local4].clone(), _arg2); _local4++; }; return (_local3); } public static function resequenceColor(_arg1:Array, _arg2:uint):Array{ var _local3:Array = _arg1.concat(); var _local4:int; while (_local4 < _arg1.length) { _local3[_local4] = BitmapUtils.color(_local3[_local4].clone(), _arg2); _local4++; }; return (_local3); } public static function resequenceTint(_arg1:Array, _arg2:uint, _arg3:Number):Array{ var _local4:Array = _arg1.concat(); var _local5:int; while (_local5 < _arg1.length) { _local4[_local5] = BitmapUtils.tint(_local4[_local5].clone(), _arg2, _arg3); _local5++; }; return (_local4); } } }//package console.bitmapAnimation
Section 189
//BitmapUtils (console.bitmapAnimation.BitmapUtils) package console.bitmapAnimation { import flash.display.*; import flash.geom.*; import fl.motion.*; public class BitmapUtils { public static function rotation(_arg1:BitmapData, _arg2:Number, _arg3:Boolean=true):BitmapData{ var _local4:* = (_arg1.width / 2); var _local5:* = (_arg1.height / 2); var _local6:Matrix = new Matrix(); _local6.translate(-(_local4), -(_local5)); _local6.rotate(((Math.PI * 2) * (_arg2 / 360))); _local6.translate(_local4, _local5); var _local7:BitmapData = new BitmapData(_arg1.width, _arg1.height, true, 0); _local7.draw(_arg1, _local6, null, null, null, _arg3); return (_local7); } public static function scale(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=true):BitmapData{ var _local5:BitmapData = new BitmapData((_arg1.width * Math.abs(_arg2)), (_arg1.height * Math.abs(_arg3)), true, 0); var _local6:* = 0; var _local7:* = 0; if (_arg2 < 0){ _local6 = _arg1.width; }; if (_arg3 < 0){ _local7 = _arg1.height; }; _local5.draw(_arg1, new Matrix(_arg2, 0, 0, _arg3, _local6, _local7), null, null, null, _arg4); return (_local5); } public static function alpha(_arg1:BitmapData, _arg2:Number):BitmapData{ _arg1.colorTransform(_arg1.rect, new Color(1, 1, 1, _arg2, 0, 0, 0, 0)); return (_arg1); } public static function color(_arg1:BitmapData, _arg2:uint):BitmapData{ var _local3:ColorTransform = new ColorTransform(); _local3.color = _arg2; _arg1.colorTransform(_arg1.rect, _local3); return (_arg1); } public static function tint(_arg1:BitmapData, _arg2:uint, _arg3:Number):BitmapData{ var _local4:Color = new Color(); _local4.setTint(_arg2, _arg3); _arg1.colorTransform(_arg1.rect, _local4); return (_arg1); } } }//package console.bitmapAnimation
Section 190
//Time (console.clock.Time) package console.clock { import flash.utils.*; public class Time { private static var _intHours:int = 0; private static var _intMinutes:int = 0; private static var _intSeconds:int = 0; private static var _intMilliSeconds:int = 0; private static var _intHundSeconds:int = 0; private static var _setTime:int; public static function get intHours():int{ return (_intHours); } public static function get intMinutes():int{ return (_intMinutes); } public static function get intSeconds():int{ return (_intSeconds); } public static function get intMilliSeconds():int{ return (_intMilliSeconds); } public static function get intHundSeconds():int{ return (_intHundSeconds); } public static function formatTimeMS(_arg1:int=0):String{ return (calcualteTimeStr(_arg1, "MINUTES")); } public static function formatTimeHMS(_arg1:int=0):String{ return (calcualteTimeStr(_arg1, "FULL")); } public static function formatTimeS(_arg1:int=0):String{ return (calcualteTimeStr(_arg1, "SECONDS")); } public static function formatTimeHMSM(_arg1:int=0):String{ return (calcualteTimeStr(_arg1, "FULL MILLISECONDS")); } public static function formatTimeHMSH(_arg1:int=0):String{ return (calcualteTimeStr(_arg1, "FULL HUNDRETHS")); } public static function set time(_arg1:int):void{ _setTime = _arg1; _intHours = Math.floor((((_arg1 / 1000) / 60) / 60)); _intMinutes = (Math.floor(((_arg1 / 1000) / 60)) - (intHours * 60)); _intSeconds = ((Math.floor((_arg1 / 1000)) - (intMinutes * 60)) - (intHours * 3600)); _intMilliSeconds = Math.ceil((((_arg1 / 1000) - Math.floor((_arg1 / 1000))) * 1000)); _intHundSeconds = Math.floor((intMilliSeconds / 10)); } public static function get time():int{ return (_setTime); } public static function calcualteTimeStr(_arg1, _arg2):String{ time = _arg1; var _local3:* = intHours.toString(); var _local4:* = intMinutes.toString(); var _local5:* = intSeconds.toString(); var _local6:* = intMilliSeconds.toString(); var _local7:* = intHundSeconds.toString(); if ((intHours < 10)){ _local3 = ("0" + intHours.toString()); //unresolved jump }; if ((intMinutes < 10)){ _local4 = ("0" + intMinutes.toString()); //unresolved jump }; if ((intSeconds < 10)){ _local5 = ("0" + intSeconds.toString()); //unresolved jump }; if ((intMilliSeconds < 100)){ _local6 = ("0" + intMilliSeconds.toString()); //unresolved jump }; if ((intMilliSeconds < 10)){ _local6 = ("00" + intMilliSeconds.toString()); //unresolved jump }; if ((intHundSeconds < 10)){ _local7 = ("0" + intHundSeconds.toString()); //unresolved jump }; if ((intHundSeconds > 99)){ _local7 = "99"; //unresolved jump }; var _local8 = ""; switch (_arg2){ case "FULL": _local8 = ((((_local3 + ":") + _local4) + ":") + _local5); break; case "MINUTES": _local8 = ((_local4 + ":") + _local5); break; case "SECONDS": _local8 = _local5; break; case "FULL MILLISECONDS": _local8 = ((((_local4 + ":") + _local5) + ":") + _local6); break; case "FULL HUNDRETHS": _local8 = ((((_local4 + ":") + _local5) + ":") + _local7); break; }; return (_local8); } public static function returnPreFormattedTime(_arg1:int=0, _arg2:String="FULL"):String{ var _local3:* = (getTimer() - _arg1); var _local4:* = calcualteTimeStr(_local3, _arg2); return (_local4); } public static function returnPreFormattedTimeFromNumber(_arg1:int=0, _arg2:String="FULL"):String{ var _local3:* = calcualteTimeStr(_arg1, _arg2); return (_local3); } } }//package console.clock
Section 191
//KokoAction (console.connection.KokoAction) package console.connection { public class KokoAction { public static const PHP:String = "/data.php"; public static const CROSSDOMAIN:String = "/crossdomain.xml"; public static const ACTION:String = "?action="; public static const ACTION_TOKEN:String = "request_token"; public static const ACTION_CLIENT_1:String = "goto_client_link_1"; public static const ACTION_CLIENT_2:String = "goto_client_link_2"; public static const ACTION_CLIENT_3:String = "goto_client_link_3"; public static const ACTION_CLIENT_4:String = "goto_client_link_4"; public static const ACTION_KOKO:String = "goto_koko_link_1"; public static const ACTION_PRIVACY:String = "goto_client_privacy"; public static const ACTION_TERMS:String = "goto_client_terms"; public static const ACTION_DAILY:String = "scores_daily_xml"; public static const ACTION_WEEKLY:String = "scores_weekly_xml"; public static const ACTION_MONTHLY:String = "scores_monthly_xml"; public static const ACTION_ALLTIME:String = "scores_alltime_xml"; public static const ACTION_WORLDRANK:String = "worldrank"; public static const ACTION_FRIEND:String = "send_invite"; public static const ACTION_SUBMIT_SCORES:String = "scores_submit"; public static const ACTION_COMPETITION:String = "competition_submit"; public static const ACTION_LOGIN:String = "user_login"; public static const ACTION_FORGOT_PASSWORD:String = "user_forgot_password"; public static const ACTION_SHARE_DELICIOUS:String = "goto_share_delicious"; public static const ACTION_SHARE_DIGG:String = "goto_share_digg"; public static const ACTION_SHARE_FACEBOOK:String = "goto_share_facebook"; public static const ACTION_SHARE_GOOGLE:String = "goto_share_google"; public static const ACTION_SHARE_REDDIT:String = "goto_share_reddit"; public static const ACTION_SHARE_STUMBLEUPON:String = "goto_share_stumbleupon"; public static const ACTION_SHARE_TWITTER:String = "goto_share_twitter"; public static const ACTION_SHARE_YAHOO:String = "goto_share_yahoo"; public static const ACTION_SHARE_LINKEDIN:String = "goto_share_linkedin"; public static const ACTION_SHARE_MYSPACE:String = "goto_share_myspace"; public static const ACTION_DYNAMIC_BUTTON_1:String = "dynamic_button_1"; private static var _domain:String = ""; public static function get domain():String{ return (_domain); } public static function set domain(_arg1:String):void{ _domain = _arg1; } public static function get url_social_yahoo():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_YAHOO)); } public static function get url_social_twitter():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_TWITTER)); } public static function get url_social_stumbleupon():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_STUMBLEUPON)); } public static function get url_social_reddit():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_REDDIT)); } public static function get url_social_google():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_GOOGLE)); } public static function get url_social_facebook():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_FACEBOOK)); } public static function get url_social_digg():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_DIGG)); } public static function get url_social_delicious():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_DELICIOUS)); } public static function get url_social_linkedin():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_LINKEDIN)); } public static function get url_social_myspace():String{ return ((((_domain + PHP) + ACTION) + ACTION_SHARE_MYSPACE)); } public static function get url_link_terms():String{ return ((((_domain + PHP) + ACTION) + ACTION_TERMS)); } public static function get url_link_privacy():String{ return ((((_domain + PHP) + ACTION) + ACTION_PRIVACY)); } public static function get url_link_koko():String{ return ((((_domain + PHP) + ACTION) + ACTION_KOKO)); } public static function get url_link_client1():String{ return ((((_domain + PHP) + ACTION) + ACTION_CLIENT_1)); } public static function get url_link_client2():String{ return ((((_domain + PHP) + ACTION) + ACTION_CLIENT_2)); } public static function get url_link_client3():String{ return ((((_domain + PHP) + ACTION) + ACTION_CLIENT_3)); } public static function get url_link_client4():String{ return ((((_domain + PHP) + ACTION) + ACTION_CLIENT_4)); } public static function get url_dynamic_button1():String{ return ((((_domain + PHP) + ACTION) + ACTION_DYNAMIC_BUTTON_1)); } public static function get url_action_token():String{ return ((((_domain + PHP) + ACTION) + ACTION_TOKEN)); } public static function get url_action_sendtofriend():String{ return ((((_domain + PHP) + ACTION) + ACTION_FRIEND)); } public static function get url_action_competition():String{ return ((((_domain + PHP) + ACTION) + ACTION_COMPETITION)); } public static function get url_action_submitscore():String{ return ((((_domain + PHP) + ACTION) + ACTION_SUBMIT_SCORES)); } public static function get url_crossdomain():String{ return ((_domain + CROSSDOMAIN)); } public static function get url_php():String{ return ((_domain + PHP)); } public static function get url_userForgotPassword():String{ return ((((_domain + PHP) + ACTION) + ACTION_FORGOT_PASSWORD)); } public static function get var_fullName():String{ return ("player_full_name"); } public static function get var_firstName():String{ return ("player_first_name"); } public static function get var_lastName():String{ return ("player_last_name"); } public static function get var_postCode():String{ return ("player_postcode"); } public static function get var_dateOfBirth():String{ return ("player_dob"); } public static function get var_email():String{ return ("player_email"); } public static function get var_score():String{ return ("player_score"); } public static function get var_secureScore():String{ return ("secure_player_score"); } public static function get var_swearFlag():String{ return ("swear_flag"); } public static function get var_token():String{ return ("token"); } public static function get var_action():String{ return ("action"); } public static function get var_emailArray():String{ return ("friend_email_array"); } public static function get var_optIn():String{ return ("player_optin"); } public static function get var_title():String{ return ("player_title"); } public static function get var_userName():String{ return ("player_username"); } public static function get var_password():String{ return ("player_password"); } public static function get url_scores_daily():String{ return ((((_domain + PHP) + ACTION) + ACTION_DAILY)); } public static function get url_scores_weekly():String{ return ((((_domain + PHP) + ACTION) + ACTION_WEEKLY)); } public static function get url_scores_monthly():String{ return ((((_domain + PHP) + ACTION) + ACTION_MONTHLY)); } public static function get url_scores_alltime():String{ return ((((_domain + PHP) + ACTION) + ACTION_ALLTIME)); } public static function get url_scores_worldrank():String{ return ((((_domain + PHP) + ACTION) + ACTION_WORLDRANK)); } } }//package console.connection
Section 192
//KeyObject (console.control.KeyObject) package console.control { import flash.events.*; import flash.display.*; import console.strings.*; import flash.utils.*; import flash.ui.*; public dynamic class KeyObject extends Proxy { private static var stage:Stage; private static var keysDown:Object; private static var keysTime:Array; private static var keysCombo:Array; private static var timeCapture:Number = 300; private static var lastTime; private static var thisTime; public function KeyObject(_arg1){ construct(_arg1); } public function construct(_arg1, _arg2:Number=300):void{ timeCapture = _arg2; KeyObject.stage = _arg1; keysDown = new Object(); keysTime = new Array(); keysCombo = new Array(); _arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); _arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased); _arg1.addEventListener(Event.ENTER_FRAME, noKeys); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){ return (((_arg1 in Keyboard)) ? Keyboard[_arg1] : -1); } public function isDown(_arg1:uint):Boolean{ return (Boolean((_arg1 in keysDown))); } public function destroy():void{ stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed); stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased); keysDown = new Object(); keysTime = new Array(); keysCombo = new Array(); KeyObject.stage = null; } public function isCombo(_arg1:Array):Boolean{ var _local5:int; var _local2:* = _arg1.length; var _local3:* = keysCombo.length; var _local4:uint; if (_local2 > _local3){ return (false); }; _local5 = 0; while (_local5 < _local2) { return (isinArray(_arg1, keysCombo)); _local5++; }; return (false); } private function isinArray(_arg1:Array, _arg2:Array):Boolean{ var _local3:* = _arg1.toString(); var _local4:* = _arg2.toString(); return (StringUtils.contains(_local4, _local3)); } private function keyPressed(_arg1:KeyboardEvent):void{ var _local5:*; var _local6:*; keysDown[_arg1.keyCode] = true; var _local2:* = getTimer(); lastTime = _local2; var _local3:* = _arg1.keyCode; var _local4:uint = keysTime.length; if (_local4 == 0){ keysTime.push(_local2); keysCombo.push(_local3); } else { _local5 = ((keysTime[(_local4 - 1)]) || (keysTime[0])); _local6 = (_local2 - _local5); if (_local6 > timeCapture){ keysTime = new Array(); keysCombo = new Array(); keysTime.push(_local2); keysCombo.push(_local3); } else { keysTime.push(_local2); keysCombo.push(_local3); }; }; } private function noKeys(_arg1:Event):void{ thisTime = getTimer(); var _local2:* = (thisTime - lastTime); if (_local2 > timeCapture){ keysTime = new Array(); keysCombo = new Array(); }; } private function keyReleased(_arg1:KeyboardEvent):void{ delete keysDown[_arg1.keyCode]; } } }//package console.control
Section 193
//Output (console.debug.Output) package console.debug { import flash.events.*; import flash.display.*; import flash.text.*; import flash.utils.*; import flash.external.*; import flash.system.*; public class Output extends Sprite { public static const COLOR_YELLOW:String = "#f1fa02"; public static const COLOR_RED:String = "#fa0802"; public static const COLOR_ORANGE:String = "#faa002"; public static const COLOR_LIME_GREEN:String = "#7dfa02"; public static const COLOR_GREEN:String = "#02fa13"; public static const COLOR_TEAL:String = "#02fada"; public static const COLOR_LIGHT_BLUE:String = "#00fcff"; public static const COLOR_BLUE:String = "#00ccff"; public static const COLOR_DARK_BLUE:String = "#1195e1"; public static const COLOR_PURPLE:String = "#7f51d4"; public static const COLOR_PINK:String = "#e427f0"; public static const COLOR_ROSE:String = "#f027be"; public static const COLOR_WHITE:String = "#fefdfc"; public static const COLOR_GREY:String = "#666666"; public static const COLOR_LIGHT_GREY:String = "#878787"; private static var _instance:Output; private static var _version:Number = 1; private static var _windowA:TextField; private static var _windowB:TextField; private static var _windowC:TextField; private static var _windowHeight:Number = 140; private static var _titleBar:Sprite; private static var _counter:uint = 0; private static var _last:uint = getTimer(); private static var _fps:String; private static var _mem:String; private static var _toggle:Boolean = false; private static var _formatA:TextFormat = new TextFormat("_sans"); private static var _formatB:TextFormat = new TextFormat("_sans"); private static var _formatC:TextFormat = new TextFormat("_sans", null, null, null, null, null, null, null, TextFormatAlign.CENTER); private static var _bar:Shape = new Shape(); private static var _extBtn:Sprite = new Sprite(); private static var _pauseBtn:Sprite = new Sprite(); private static var _playBtn:Sprite = new Sprite(); private static var _nextBtn:Sprite = new Sprite(); private static var _extensionA:TextField = new TextField(); private static var _extensionB:TextField = new TextField(); private static var _domain:String; private static var _allowScriptAccess:Boolean = true; private static var _currentKeyColor:int = 0; private static var _currentTraceColor:int = 0; private static var _keyColors:Array = [COLOR_DARK_BLUE, COLOR_LIGHT_BLUE]; private static var _traceColors:Array = [COLOR_GREY, COLOR_LIGHT_GREY]; private static var _maxLength:int = 1000; private static var _maxKeyLength:int = 1000; private static var _os:String; private static var _fp:String; private static var _pause:Boolean = false; private static var _storeWindowB:Array; private static var _storeWindowA:Array; private static var _nextInterval:uint; private static var _clearBtn:Sprite = new Sprite(); public function Output(_arg1:Boolean=true, _arg2:Number=1){ if (((_instance) && (_instance.parent))){ _instance.parent.removeChild(_instance); }; _version = _arg2; this.visible = _arg1; var _local3:String = Capabilities.version; var _local4:Array = _local3.split(" "); var _local5:Array = _local4[1].split(","); _os = _local4[0]; _fp = _local5[0]; _extensionA = newWindow(); _extensionB = newWindow(); _extensionA.selectable = true; _extensionB.selectable = true; _extensionA.visible = false; _extensionB.visible = false; addChild((_windowA = newWindow())); addChild((_windowB = newWindow())); addChild((_windowC = newWindow())); addChild(_extensionA); addChild(_extensionB); addChild((_titleBar = newTitleBar())); addEventListener(Event.ADDED_TO_STAGE, added); } private function getBrowser():String{ var browser:String; var strUserAgent = ""; try { strUserAgent = String(ExternalInterface.call("function() {return navigator.userAgent;}")).toLowerCase(); } catch($err:Error) { _allowScriptAccess = false; }; if (strUserAgent.indexOf("firefox") != -1){ browser = "Firefox"; } else { if (strUserAgent.indexOf("msie") != -1){ browser = "Internet Explorer"; } else { if (strUserAgent.indexOf("safari") != -1){ browser = "Safari"; } else { if (strUserAgent.indexOf("chrome") != -1){ browser = "Google Chrome"; } else { if (strUserAgent.indexOf("opera") != -1){ browser = "Opera"; } else { browser = "unknown"; }; }; }; }; }; return (browser); } private function setupExtension():void{ var browser:String; var audio_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Audio: ") + "</font>"); var audio_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.hasAudio) + "</font>\n"); var av_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Cam/Mic Access: ") + "</font>"); var av_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.avHardwareDisable) + "</font>\n"); var access_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Accessibility: ") + "</font>"); var access_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.hasAccessibility) + "</font>\n"); var print_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Printing: ") + "</font>"); var print_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.hasPrinting) + "</font>\n"); var ssl_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Supports Native SSL: ") + "</font>"); var ssl_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.hasTLS) + "</font>\n"); var debug_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Debug Version: ") + "</font>"); var debug_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.isDebugger) + "</font>\n"); var lang_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "System Language: ") + "</font>"); var lang_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.language) + "</font>\n"); var lfa_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Local File Access: ") + "</font>"); var lfa_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.localFileReadDisable) + "</font>\n"); var man_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Flash Player Manufacturer: ") + "</font>"); var man_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.manufacturer) + "</font>\n"); var aspect_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Aspect Ratio: ") + "</font>"); var aspect_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.pixelAspectRatio) + "</font>\n"); var pt_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Player Type: ") + "</font>"); var pt_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.playerType) + "</font>\n"); var col_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Screen Color: ") + "</font>"); var col_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.screenColor) + "</font>\n"); var dpi_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Screen DPI: ") + "</font>"); var dpi_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.screenDPI) + "</font>\n"); var fpv_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Flash Player Version: ") + "</font>"); var fpv_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.version) + "</font>\n"); var os_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Operating System: ") + "</font>"); var os_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + Capabilities.os) + "</font>\n"); var dom_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Domain: ") + "</font>"); var dom_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + _domain) + "</font>\n"); try { browser = String(ExternalInterface.call("function() {return navigator.userAgent;}")).toLowerCase(); } catch($err:Error) { _allowScriptAccess = false; }; var browser_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Browser: ") + "</font>"); var browser_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + browser) + "</font>\n"); var asa_label = (((("<font size='11' face='_sans' color='" + COLOR_WHITE) + "'>") + "Allow Script Access: ") + "</font>"); var asa_value = (((("<font size='11' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + _allowScriptAccess) + "</font>\n"); _extensionA.htmlText = (((((((((((((((((asa_label + asa_value) + audio_label) + audio_value) + av_label) + av_value) + access_label) + access_value) + print_label) + print_value) + ssl_label) + ssl_value) + debug_label) + debug_value) + lang_label) + lang_value) + lfa_label) + lfa_value); _extensionB.htmlText = (((((((((((((((((man_label + man_value) + aspect_label) + aspect_value) + pt_label) + pt_value) + col_label) + col_value) + dpi_label) + dpi_value) + fpv_label) + fpv_value) + os_label) + os_value) + browser_label) + browser_value) + dom_label) + dom_value); } public function set version(_arg1:Number){ _version = _arg1; } public function get version():Number{ return (_version); } private function added(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, added); stage.addEventListener(Event.ENTER_FRAME, enterFrame); stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler); _domain = stage.loaderInfo.url; setupExtension(); } private function enterFrame(_arg1:Event):void{ updateFrameRate(); updateMemoryUsage(); updateSize(); updateToolbar(); } private function toggleHandler(_arg1:MouseEvent):void{ _toggle = !(_toggle); } private function keyHandler(_arg1:KeyboardEvent):void{ if (((((((_arg1.shiftKey) && (_arg1.ctrlKey))) && (_arg1.altKey))) && ((_arg1.keyCode == 75)))){ this.visible = !(this.visible); }; if (((((_arg1.ctrlKey) && (_arg1.shiftKey))) && ((_arg1.keyCode == 83)))){ _toggle = !(_toggle); }; _windowC.htmlText = (_windowC.htmlText + (((("<font size='11' face='_sans' color='" + _keyColors[_currentKeyColor]) + "'>") + _arg1.keyCode.toString()) + "</font>")); _windowC.setTextFormat(_formatC); _currentKeyColor = ((_currentKeyColor)==0) ? 1 : 0; if (_windowC.length > _maxKeyLength){ _windowC.htmlText = _windowC.htmlText.slice(-(_maxKeyLength)); }; _windowC.scrollV = _windowC.maxScrollV; } private function newWindow():TextField{ var _local1:TextField = new TextField(); _local1.border = true; _local1.borderColor = 0; _local1.background = true; _local1.backgroundColor = 0; _local1.alpha = 0.8; _local1.height = (_windowHeight - 15); _local1.setTextFormat(_formatA); _local1.defaultTextFormat = _formatA; _local1.multiline = true; return (_local1); } private function newTitleBar():Sprite{ _bar.graphics.lineStyle(0); _bar.graphics.beginFill(0, 0.8); _bar.graphics.drawRect(0, 0, 18, 15); var _local1:TextField = new TextField(); _local1.autoSize = TextFieldAutoSize.LEFT; _local1.selectable = false; _local1.x = 0; _local1.mouseEnabled = false; _local1.setTextFormat(_formatB); _local1.defaultTextFormat = _formatB; _extBtn.graphics.beginFill(47919, 1); _extBtn.graphics.drawRoundRect(2, 2, 20, 11, 4, 4); _extBtn.graphics.endFill(); _extBtn.graphics.beginFill(0xFFFFFF, 1); _extBtn.graphics.drawRect(6, 6.5, 8, 2); _extBtn.graphics.endFill(); _extBtn.graphics.beginFill(0xFFFFFF, 1); _extBtn.graphics.drawRect(9, 4, 2, 7); _extBtn.graphics.endFill(); _extBtn.addEventListener(MouseEvent.CLICK, extensionHandler); _pauseBtn.graphics.beginFill(47919, 1); _pauseBtn.graphics.drawRoundRect(2, 2, 20, 11, 4, 4); _pauseBtn.graphics.endFill(); _pauseBtn.addEventListener(MouseEvent.CLICK, outputPause); _pauseBtn.graphics.beginFill(0xFFFFFF, 1); _pauseBtn.graphics.drawRect(9, 4, 2, 7); _pauseBtn.graphics.drawRect(13, 4, 2, 7); _pauseBtn.graphics.endFill(); _nextBtn.graphics.beginFill(47919, 1); _nextBtn.graphics.drawRoundRect(2, 2, 20, 11, 4, 4); _nextBtn.graphics.endFill(); var _local2:Number = 6; var _local3:Sprite = new Sprite(); _local3.graphics.beginFill(0xFFFFFF, 1); _local3.graphics.moveTo((_local2 / 2), 0); _local3.graphics.lineTo(_local2, _local2); _local3.graphics.lineTo(0, _local2); _local3.graphics.lineTo((_local2 / 2), 0); _local3.x = 8; _local3.y = 11; _local3.scaleY = -1; _nextBtn.addEventListener(MouseEvent.MOUSE_DOWN, outputNextDown); _nextBtn.addEventListener(MouseEvent.MOUSE_UP, outputNextUp); _nextBtn.addEventListener(MouseEvent.CLICK, outputNextClick); _nextBtn.addChild(_local3); _playBtn.graphics.beginFill(47919, 1); _playBtn.graphics.drawRoundRect(2, 2, 20, 11, 4, 4); _playBtn.graphics.endFill(); _playBtn.addEventListener(MouseEvent.CLICK, outputPlay); var _local4:Sprite = new Sprite(); _local4.graphics.beginFill(0xFFFFFF, 1); _local4.graphics.moveTo((_local2 / 2), 0); _local4.graphics.lineTo(_local2, _local2); _local4.graphics.lineTo(0, _local2); _local4.graphics.lineTo((_local2 / 2), 0); _local4.x = 16; _local4.y = 4; _local4.rotation = 90; _playBtn.addChild(_local4); _clearBtn.graphics.beginFill(0xFF0000, 1); _clearBtn.graphics.drawRoundRect(2, 2, 20, 11, 4, 4); _clearBtn.graphics.endFill(); var _local5:Shape = new Shape(); _local5.graphics.beginFill(0xFFFFFF, 1); _local5.graphics.drawRect(6, 7, 8, 2); _local5.graphics.endFill(); _local5.graphics.beginFill(0xFFFFFF, 1); _local5.graphics.drawRect(9, 4, 2, 8); _local5.graphics.endFill(); _local5.rotation = 45; _local5.x = 10; _local5.y = -5.5; _clearBtn.addChild(_local5); _clearBtn.addEventListener(MouseEvent.CLICK, outputClear); var _local6:Sprite = new Sprite(); _local6.addChild(_bar); _local6.addChild(_local1); _local6.addChild(_extBtn); _local6.addChild(_pauseBtn); _local6.addChild(_clearBtn); _local6.buttonMode = true; _local6.addEventListener(MouseEvent.CLICK, toggleHandler); return (_local6); } private function outputClear(_arg1:MouseEvent):void{ _arg1.stopPropagation(); _windowA.htmlText = ""; _windowB.htmlText = ""; _windowC.htmlText = ""; } private function outputNextDown(_arg1:MouseEvent):void{ _arg1.stopPropagation(); _nextInterval = setInterval(outputNext, 100); } private function outputNextClick(_arg1:MouseEvent):void{ _arg1.stopPropagation(); outputNext(); } private function outputNextUp(_arg1:MouseEvent):void{ _arg1.stopPropagation(); clearInterval(_nextInterval); } private function outputPlay(_arg1:MouseEvent):void{ outputAll(); _storeWindowB = null; _storeWindowA = null; _arg1.stopPropagation(); _titleBar.removeChild(_playBtn); _titleBar.addChild(_pauseBtn); _titleBar.removeChild(_nextBtn); _pause = false; } private function outputAll():void{ var _local1:Boolean; do { _local1 = outputNext(); } while (_local1); } private function outputNext(_arg1:MouseEvent=null):Boolean{ var _local2:*; if (((_storeWindowB) && ((_storeWindowB.length > 0)))){ _local2 = _storeWindowB[0]; _storeWindowB.splice(0, 1); }; if (((_storeWindowA) && ((_storeWindowA.length > 0)))){ _local2 = _storeWindowA[0]; _storeWindowA.splice(0, 1); }; if (((_storeWindowA) && ((_storeWindowA.length == 0)))){ _storeWindowA = null; }; if (((_storeWindowB) && ((_storeWindowB.length == 0)))){ _storeWindowB = null; }; return (((_storeWindowA) || (_storeWindowB))); } private function outputPause(_arg1:MouseEvent):void{ _arg1.stopPropagation(); _titleBar.removeChild(_pauseBtn); _titleBar.addChild(_playBtn); _titleBar.addChild(_nextBtn); _pause = true; } private function extensionHandler(_arg1:MouseEvent):void{ _arg1.stopPropagation(); _extensionA.visible = !(_extensionA.visible); _extensionB.visible = !(_extensionB.visible); } private function updateFrameRate():void{ _counter++; var _local1:uint = getTimer(); var _local2:uint = (_local1 - _last); if (_local2 >= 1000){ _fps = (Number(((_counter / _local2) * 1000)).toFixed(1).toString() + "fps"); _counter = 0; _last = _local1; }; } private function updateMemoryUsage():void{ var _local1:Number = System.totalMemory; var _local2:Number = (_local1 / 0x0400); _mem = (Number((_local2 / 0x0400)).toFixed(1).toString() + "mb"); } private function updateSize():void{ if (!stage){ return; }; _windowA.x = 0; _windowA.y = (stage.stageHeight - _windowA.height); _windowA.width = ((stage.stageWidth / 2) - 16); _windowB.x = (_windowA.x + _windowA.width); _windowB.y = (stage.stageHeight - _windowA.height); _windowB.width = ((stage.stageWidth / 2) - 16); _windowC.x = (_windowB.x + _windowB.width); _windowC.y = (stage.stageHeight - _windowA.height); _windowC.width = 32; _bar.width = stage.stageWidth; _extBtn.x = (stage.stageWidth - 20); _titleBar.y = (_toggle) ? (_windowA.y - _titleBar.height) : (stage.stageHeight - _titleBar.height); _nextBtn.x = (_extBtn.x - (_nextBtn.width + 2)); _pauseBtn.x = (_nextBtn.x - (_pauseBtn.width + 2)); _playBtn.x = _pauseBtn.x; _clearBtn.x = (_pauseBtn.x - (_clearBtn.width + 2)); _extensionA.width = 160; _extensionA.x = 0; _extensionA.height = 160; _extensionA.y = (_titleBar.y - _extensionA.height); _extensionB.width = (stage.stageWidth - _extensionA.width); _extensionB.x = _extensionA.width; _extensionB.height = 160; _extensionB.y = (_titleBar.y - _extensionB.height); _windowA.visible = _toggle; _windowB.visible = _toggle; _windowC.visible = _toggle; } private function updateToolbar():void{ var _local1 = (("<font size='9' face='_sans' color='" + COLOR_PINK) + "'> [ ctrl + shft + s ] </font>"); var _local2 = (((("<font size='9' face='_sans' color='" + COLOR_WHITE) + "'>") + " FR: ") + "</font>"); var _local3 = (((("<font size='9' face='_sans' color='" + COLOR_LIME_GREEN) + "'>") + _fps) + "</font>"); var _local4 = (((("<font size='9' face='_sans' color='" + COLOR_WHITE) + "'>") + " MEM: ") + "</font>"); var _local5 = (((("<font size='9' face='_sans' color='" + COLOR_ORANGE) + "'>") + _mem) + "</font>"); var _local6 = (((("<font size='9' face='_sans' color='" + COLOR_WHITE) + "'>") + " VER: ") + "</font>"); var _local7 = (((("<font size='9' face='_sans' color='" + COLOR_PINK) + "'>") + _version.toString()) + "</font>"); var _local8 = (((("<font size='9' face='_sans' color='" + COLOR_WHITE) + "'>") + " FP: ") + "</font>"); var _local9 = (((("<font size='9' face='_sans' color='" + COLOR_TEAL) + "'>") + _fp.toString()) + "</font>"); var _local10 = (((("<font size='9' face='_sans' color='" + COLOR_WHITE) + "'>") + " OS: ") + "</font>"); var _local11 = (((("<font size='9' face='_sans' color='" + COLOR_GREEN) + "'>") + _os.toString()) + "</font>"); var _local12 = (((("<font size='9' face='_sans' color='" + COLOR_WHITE) + "'>") + " BROW: ") + "</font>"); var _local13 = (((("<font size='9' face='_sans' color='" + COLOR_ORANGE) + "'>") + getBrowser()) + "</font>"); var _local14:TextField = (_titleBar.getChildAt(1) as TextField); _local14.htmlText = ((((((((((((_local1 + _local2) + _local3) + _local4) + _local5) + _local6) + _local7) + _local8) + _local9) + _local10) + _local11) + _local12) + _local13); } public static function trace(_arg1, _arg2:Boolean=true, _arg3:String="#666666", _arg4:Boolean=false):void{ var _local5:String = ((_arg3)==COLOR_GREY) ? _traceColors[_currentTraceColor] : _arg3; _currentTraceColor = ((_currentTraceColor)==0) ? 1 : 0; if (_arg2){ if (((!(_pause)) || (_arg4))){ _windowA.htmlText = (_windowA.htmlText + (((("<font size='11' face='_sans' color='" + _local5) + "'>") + _arg1) + "</font>")); if (_windowA.length > _maxLength){ _windowA.htmlText = _windowA.htmlText.slice(-(_maxLength)); }; _windowA.scrollV = _windowA.maxScrollV; } else { if (!_storeWindowA){ _storeWindowA = []; }; _storeWindowA.push({str:_arg1, window:_arg2, color:_arg3}); }; } else { if (((!(_pause)) || (_arg4))){ _windowB.htmlText = (_windowB.htmlText + (((("<font size='11' face='_sans' color='" + _local5) + "'>") + _arg1) + "</font>")); if (_windowB.length > _maxLength){ _windowB.htmlText = _windowB.htmlText.slice(-(_maxLength)); }; _windowB.scrollV = _windowB.maxScrollV; } else { if (!_storeWindowB){ _storeWindowB = []; }; _storeWindowB.push({str:_arg1, window:_arg2, color:_arg3}); }; }; } public static function heading(_arg1, _arg2:Boolean=true, _arg3:String="#faa002"):void{ var _local4:int = _arg1.length; var _local5:int = ((34 - _local4) / 2); var _local6 = "/"; var _local7:String = _local6; var _local8:int; while (_local8 < _local5) { _local7 = (_local7 + _local6); _local8++; }; } } }//package console.debug
Section 194
//CameraEvent (console.events.CameraEvent) package console.events { import flash.events.*; public class CameraEvent extends Event { private var _target; public static const BEGIN_CAMERA_RENDER:String = "begin_camera_render"; public static const CAMERA_UPDATED:String = "camera_updated"; public function CameraEvent(_arg1:String){ super(_arg1); } } }//package console.events
Section 195
//StaticEventDispatch (console.events.StaticEventDispatch) package console.events { import flash.events.*; public class StaticEventDispatch { protected static var _disp:EventDispatcher; public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ if (_disp == null){ _disp = new EventDispatcher(); }; _disp.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); } public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{ if (_disp == null){ return; }; _disp.removeEventListener(_arg1, _arg2, _arg3); } public static function dispatchEvent(_arg1:Event):void{ if (_disp == null){ return; }; _disp.dispatchEvent(_arg1); } public static function hasEventListener(_arg1:String):Boolean{ return (_disp.hasEventListener(_arg1)); } public static function WillTrigger(_arg1:String):Boolean{ return (_disp.willTrigger(_arg1)); } } }//package console.events
Section 196
//SendReceiveData (console.loaders.SendReceiveData) package console.loaders { import flash.events.*; import flash.net.*; public class SendReceiveData extends EventDispatcher { public var _loader:URLLoader; public var _errorMessage:String; public static const DATA_LOADED:String = "Data Loaded"; public static const DATA_ERROR:String = "Data Error"; public function sendData(_arg1:String, _arg2:URLVariables):void{ var _local3:URLRequest = new URLRequest(_arg1); _local3.data = _arg2; _local3.method = URLRequestMethod.POST; _loader = new URLLoader(); _loader.addEventListener(Event.COMPLETE, onComplete); _loader.addEventListener(IOErrorEvent.IO_ERROR, onError); _loader.addEventListener(ProgressEvent.PROGRESS, onProgress); _loader.load(_local3); } public function onProgress(_arg1:ProgressEvent):void{ } public function onError(_arg1:IOErrorEvent){ _errorMessage = _arg1.text; dispatchEvent(new Event(SendReceiveData.DATA_ERROR)); } public function onComplete(_arg1:Event){ dispatchEvent(new Event(SendReceiveData.DATA_LOADED)); } } }//package console.loaders
Section 197
//OpenURL (console.loadurl.OpenURL) package console.loadurl { import flash.net.*; import console.debug.*; import flash.external.*; public class OpenURL { public static function loadURL(_arg1:String, _arg2:String="_blank"):void{ var url = _arg1; var window = _arg2; var WINDOW_OPEN_FUNCTION = "window.open"; if (ExternalInterface.available){ try { ExternalInterface.call(WINDOW_OPEN_FUNCTION, url, window); Output.trace("EXTERNAL INTERFACE TO URL - SUCCESS"); } catch(e:Error) { navigateToURL(new URLRequest(url), window); Output.trace("EXTERNAL INTERFACE TO URL - FAIL"); Output.trace("Using navigateToUrl instead"); }; } else { navigateToURL(new URLRequest(url), window); Output.trace("EXTERNAL INTERFACE NOT AVAILABLE"); }; } public static function navigateURL(_arg1:String, _arg2:String="_blank"):void{ navigateToURL(new URLRequest(_arg1), _arg2); } public static function navigateURL_JS(_arg1:String):void{ var _local2:* = (("window.open('" + _arg1) + "', 'PopUpWindow');"); var _local3:* = new URLRequest((("javascript:" + _local2) + "void(0);")); navigateToURL(_local3); } } }//package console.loadurl
Section 198
//Trig (console.math.Trig) package console.math { import flash.geom.*; public class Trig { public static function findHypotenuseLength(_arg1:Number, _arg2:Number):Number{ var _local3:* = Math.sqrt((Math.pow(_arg1, 2) + Math.pow(_arg2, 2))); return (_local3); } public static function findAdjascentLength(_arg1, _arg2):Number{ var _local3:* = (Math.cos(_arg1) * _arg2); return (_local3); } public static function findOppositeLength(_arg1, _arg2):Number{ var _local3:* = (Math.sin(_arg1) * _arg2); return (_local3); } public static function convertToDegree(_arg1:Number){ var _local2:* = ((_arg1 * 180) / Math.PI); return (_local2); } public static function convertToRadian(_arg1:Number){ var _local2:* = ((_arg1 * Math.PI) / 180); return (_local2); } public static function findAngle(_arg1, _arg2, _arg3, _arg4):Number{ var _local5:Number = (_arg1 - _arg3); var _local6:Number = (_arg2 - _arg4); var _local7:Number = Math.atan2(_local6, _local5); return (_local7); } public static function findNewXY(_arg1, _arg2, _arg3, _arg4):Point{ var _local5:* = findAdjascentLength(_arg3, _arg4); var _local6:* = findOppositeLength(_arg3, _arg4); var _local7:* = (_arg1 + _local5); var _local8:* = (_arg2 + _local6); var _local9:* = new Point(_local7, _local8); return (_local9); } public static function distanceBetweenPoints(_arg1:Point, _arg2:Point):Number{ var _local3:* = (_arg1.x - _arg2.x); var _local4:* = (_arg1.y - _arg2.y); var _local5:* = findHypotenuseLength(_local3, _local4); return (_local5); } public static function shortRotation(_arg1:Number, _arg2:Number):Number{ var _local3:* = (Math.abs((_arg1 - _arg2)) % 360); if (_local3 > 180){ _local3 = (360 - _local3); }; return (_local3); } public static function longRotation(_arg1:Number, _arg2:Number):Number{ var _local3:* = (Math.abs((_arg1 - _arg2)) % 360); if (_local3 < 180){ _local3 = (360 - _local3); }; return (_local3); } public static function escapeVectorX(_arg1:Number):Number{ return (((180 - _arg1) + 180)); } public static function escapeVectorY(_arg1:Number):Number{ return (((180 - (_arg1 * 2)) + _arg1)); } } }//package console.math
Section 199
//Scores (console.scores.Scores) package console.scores { import flash.events.*; import com.stampy.preloader.*; public class Scores extends EventDispatcher { private var _xmlFile:XMLList; private var _scoresXML_loader:PowerLoader; public function Scores(){ _xmlFile = null; super(); } public function load(_arg1:String){ _scoresXML_loader = new PowerLoader(); _scoresXML_loader.addEventListener(Event.COMPLETE, load_complete); _scoresXML_loader.addEventListener(ProgressEvent.PROGRESS, load_progress); _scoresXML_loader.addEventListener(IOErrorEvent.IO_ERROR, load_error); _scoresXML_loader.load(_arg1); } public function get data():XMLList{ if (_xmlFile != null){ return (new XMLList(_xmlFile[0].scores.entry)); }; return (new XMLList()); } public function set xml(_arg1:XMLList):void{ _xmlFile = _arg1; } private function load_complete(_arg1:Event):void{ _xmlFile = XMLList(_arg1.target.content); dispatchEvent(_arg1); } private function load_progress(_arg1:ProgressEvent):void{ dispatchEvent(_arg1); } private function load_error(_arg1:IOErrorEvent):void{ dispatchEvent(_arg1); } } }//package console.scores
Section 200
//Token (console.security.Token) package console.security { import flash.events.*; import flash.net.*; import com.adobe.crypto.*; import console.loaders.*; public class Token { public static const TOKEN_GENERATED:String = "Token Generated"; private static var _loadedVars:URLVariables; private static var _loadToken:URLLoader; private static var _requestToken:SendReceiveData; private static var _strFinalToken:String; private static var _strOriginalToken:String; private static var _isDebugging:Boolean = true; private static var _strAction:String = "request_token"; private static var _success:Function; private static var _retry:uint = 0; private static var _strUrl:String; public static function request(_arg1:String, _arg2:Function, _arg3:Boolean=true){ _strUrl = _arg1; _isDebugging = _arg3; debug(("DEBUG: Token.request | strURL = " + _arg1)); _success = _arg2; var _local4:URLVariables = new URLVariables(); _local4.action = _strAction; _requestToken = new SendReceiveData(); _requestToken.sendData(_arg1, _local4); _requestToken.addEventListener(SendReceiveData.DATA_LOADED, load); _requestToken.addEventListener(SendReceiveData.DATA_ERROR, loadError); } private static function loadError(_arg1:Error):void{ if (_retry == 0){ _retry++; request(_strUrl, _success, _isDebugging); //unresolved jump }; } public static function secret(_arg1, _arg2:Boolean=true):String{ var _local3:String; var _local4:String; var _local5:String; _isDebugging = _arg2; if (((!((_arg1 == null))) && (!((_strOriginalToken == null))))){ _local3 = _arg1.toString(); _local4 = (_strOriginalToken + _local3); _local5 = MD5.hash(_local4); debug(("DEBUG: Token.secret | encrypted secret = " + _local5)); return (_local5); }; return (""); } public static function get encypted():String{ return (_strFinalToken); } public static function get original():String{ return (_strOriginalToken); } public static function getVar(_arg1:String){ if (_loadedVars[_arg1]){ return (_loadedVars[_arg1]); }; return (null); } private static function load(_arg1:Event):void{ _loadToken = URLLoader(_arg1.target._loader); _loadedVars = new URLVariables(_loadToken.data); _strOriginalToken = _loadedVars.token; debug(("DEBUG: Token.load | original token = " + _strOriginalToken)); _strFinalToken = encrypt(_strOriginalToken); _success(); } public static function encrypt(_arg1:String):String{ var _local2:String = _arg1.substr(28, 8); var _local3:String = MD5.hash(_local2); var _local4:* = Math.ceil((Math.random() * 1000000)); var _local5:* = Math.ceil((Math.random() * 1000000)); var _local6:* = Math.ceil((Math.random() * 1000000)); var _local7:String = (((MD5.hash(_local4) + MD5.hash(_local5)) + _local3) + MD5.hash(_local6)); debug(("DEBUG: Token.encrypt | encrypted token = " + _local7)); return (_local7); } public static function md5Token(_arg1:String):String{ var _local2:String = MD5.hash(_arg1); return (_local2); } private static function debug(_arg1):void{ if (_isDebugging){ }; } } }//package console.security
Section 201
//SoundObject (console.sounds.SoundObject) package console.sounds { import flash.events.*; import com.greensock.*; import flash.media.*; import flash.utils.*; public class SoundObject extends EventDispatcher { private var _sndSound:Sound; private var _channel:SoundChannel; private var _intVolume:Number; private var _isMute:Boolean; private var _intPrevVolume:Number; private var _intLastPosition:Number; private var _isLooping:Boolean; private var _intLoopCount:uint; private var _isPlaying:Boolean; private var _linkage:String; private var _intMaxVolume:Number; private var _onCompleteFunction:Function; private var _onCompleteParams; private var _debug:Boolean; public function SoundObject(_arg1:String):void{ var ClassReference:Class; var strSoundLinkage = _arg1; _intVolume = 1; _isMute = false; _intPrevVolume = 1; _intLastPosition = 0; _isLooping = false; _intLoopCount = 0; _isPlaying = false; _intMaxVolume = 1; _debug = true; super(); _linkage = strSoundLinkage; try { ClassReference = (getDefinitionByName(strSoundLinkage) as Class); _sndSound = (new (ClassReference) as Sound); } catch($err:ReferenceError) { if (_debug){ throw (new ReferenceError((((("SoundUtils has encountered an error creating sound with linkage ID:'" + strSoundLinkage) + "'") + "\n") + "Fix: Check sound asset with linkage ID exists"))); }; }; _channel = new SoundChannel(); } public function addComplete(_arg1:Function, ... _args):void{ _onCompleteFunction = _arg1; _onCompleteParams = _args; _channel.addEventListener(Event.SOUND_COMPLETE, soundComplete); } public function removeComplete():void{ _onCompleteFunction = null; _onCompleteParams = null; if (_channel.hasEventListener(Event.SOUND_COMPLETE)){ _channel.removeEventListener(Event.SOUND_COMPLETE, soundComplete); }; } public function get currentPosition():Number{ return (_channel.position); } public function get length():Number{ return (_sndSound.length); } public function play(_arg1:Boolean, _arg2:uint, _arg3:uint, _arg4:Boolean=false):void{ var newChannel:*; var isLooping = _arg1; var intLoopCount = _arg2; var intStartTime = _arg3; var isTempChannel = _arg4; _isLooping = isLooping; _intLoopCount = intLoopCount; _isPlaying = true; var intRepeatCount:uint = (isLooping) ? intLoopCount : 0; try { if (isTempChannel){ newChannel = new SoundChannel(); newChannel = _sndSound.play(intStartTime, intRepeatCount); newChannel.addEventListener(Event.SOUND_COMPLETE, stop); modifyBespokeChannelVolume(_intVolume, newChannel); } else { _channel = _sndSound.play(intStartTime, intRepeatCount); _channel.addEventListener(Event.SOUND_COMPLETE, stop); modifyVolume(volume); }; } catch(err:Error) { if (_debug){ throw (new ReferenceError("SoundUtils has encountered an error playing a sound @ SoundObject.play() \nFix: Check speakers are plugged in")); }; }; } public function resume():void{ if (!_isPlaying){ play(_isLooping, _intLoopCount, _intLastPosition, false); }; } public function stop(_arg1:Event=null):void{ var evt = _arg1; _isPlaying = false; try { if (evt){ if (evt.target){ if (evt.target.hasEventListener(Event.SOUND_COMPLETE)){ evt.target.removeEventListener(Event.SOUND_COMPLETE, stop); }; if (_channel){ _intLastPosition = _channel.position; }; evt.target.stop(); }; } else { _isPlaying = false; if (_channel){ _intLastPosition = _channel.position; }; _channel.stop(); }; } catch(err:Error) { if (_debug){ throw (new ReferenceError("SoundUtils has encountered an error stopping a sound @ SoundObject.stop() \nFix: Check speakers are plugged in")); }; }; } public function fade(_arg1:Number, _arg2:Number):void{ if (!_isMute){ TweenLite.to(_channel, _arg2, {volume:_arg1}); }; } public function muteOn(_arg1:Number=0):void{ if (!_isMute){ _intPrevVolume = volume; volume = 0; _isMute = true; }; } public function muteOff(_arg1:Number):void{ if (_isMute){ volume = _intPrevVolume; _isMute = false; }; } public function set volume(_arg1:Number):void{ if (!_isMute){ _intVolume = _arg1; modifyVolume(_intVolume); }; } public function set maxVolume(_arg1:Number):void{ if ((((_arg1 >= 0)) && ((_arg1 <= 1)))){ _intMaxVolume = _arg1; volume = _intVolume; }; } public function get volume():Number{ return (_intVolume); } public function get mute():Boolean{ return (_isMute); } public function get isPlaying():Boolean{ return (_isPlaying); } public function get linkage():String{ return (_linkage); } public function get debug():Boolean{ return (_debug); } public function set debug(_arg1:Boolean):void{ _debug = _arg1; } public function get sound():Sound{ return (_sndSound); } public function set sound(_arg1:Sound):void{ _sndSound = _arg1; } private function modifyVolume(_arg1:Number):void{ var mod1:SoundTransform; var value = _arg1; var intValue:Number = (value * _intMaxVolume); try { mod1 = new SoundTransform(); mod1.volume = intValue; _channel.soundTransform = mod1; } catch(evt:Error) { if (_debug){ throw (new ReferenceError("SoundUtils has encountered an error altering a sounds volume @ SoundObject.modifyVolume() \nFix: Check speakers are plugged in")); }; }; } private function modifyBespokeChannelVolume(_arg1:Number, _arg2:SoundChannel):void{ var mod1:SoundTransform; var volume = _arg1; var channel = _arg2; var intValue:Number = (volume * _intMaxVolume); try { mod1 = new SoundTransform(); mod1.volume = intValue; channel.soundTransform = mod1; } catch(evt:Error) { if (_debug){ throw (new ReferenceError("SoundUtils has encountered an error altering a sounds volume @ SoundObject.modifyBespokeChannelVolume() \nFix: Check speakers are plugged in")); }; }; } private function soundComplete(_arg1:Event):void{ _arg1.target.removeEventListener(Event.SOUND_COMPLETE, soundComplete); _onCompleteFunction.apply(null, _onCompleteParams); } } }//package console.sounds
Section 202
//SoundUtils (console.sounds.SoundUtils) package console.sounds { import com.greensock.*; import flash.media.*; import flash.utils.*; public class SoundUtils { private static var _dictSFX:Dictionary = new Dictionary(); private static var _dictMusic:Dictionary = new Dictionary(); private static var _musicMute:Boolean = false; private static var _sfxMute:Boolean = false; private static var _globalMute:Boolean = false; private static var _musicChannelVolume:Number = 1; private static var _sfxChannelVolume:Number = 1; private static var _rememberValue:Boolean = true; private static var _maxSFXVolume = 1; private static var _maxMusicVolume = 1; private static var _debug:Boolean = true; public static function addSFX(_arg1:String, _arg2:Number=1):void{ var _local3:SoundObject = new SoundObject(_arg1); _local3.debug = _debug; _local3.volume = _arg2; _dictSFX[_arg1] = _local3; } public static function addSFXComplete(_arg1:String, _arg2:Function, ... _args){ _args.splice(0, 0, _arg2); _dictSFX[_arg1].addComplete.apply(null, _args); } public static function addMusicComplete(_arg1:String, _arg2:Function, ... _args){ _args.splice(0, 0, _arg2); _dictMusic[_arg1].addComplete.apply(null, _args); } public static function removeSFXComplete(_arg1:String){ _dictSFX[_arg1].removeComplete(); } public static function removeMusicComplete(_arg1:String){ _dictMusic[_arg1].removeComplete(); } public static function addMusic(_arg1:String, _arg2:Number=1):void{ var _local3:SoundObject = new SoundObject(_arg1); _local3.debug = _debug; _local3.volume = _arg2; _dictMusic[_arg1] = _local3; } public static function TrackChannelLastVolume(_arg1:Boolean):void{ _rememberValue = _arg1; } public static function muteAll(_arg1:Number=0):void{ muteSFXChannel(_arg1); muteMusicChannel(_arg1); } public static function muteGlobal():void{ if (!_globalMute){ try { _globalMute = true; SoundMixer.soundTransform = new SoundTransform(0); } catch(evt:Error) { }; } else { _globalMute = false; try { SoundMixer.soundTransform = new SoundTransform(1); } catch(evt:Error) { }; }; } public static function get isGlobalMute():Boolean{ return (_globalMute); } public static function get debug():Boolean{ return (_debug); } public static function set debug(_arg1:Boolean):void{ _debug = _arg1; } public static function muteSFXChannel(_arg1:Number=0):void{ var _local2:SoundObject; var _local3:SoundObject; if (!_sfxMute){ _sfxMute = true; for each (_local2 in _dictSFX) { _local2.muteOn(_arg1); }; } else { _sfxMute = false; for each (_local3 in _dictSFX) { _local3.muteOff(_arg1); }; }; } public static function muteMusicChannel(_arg1:Number=0):void{ var _local2:SoundObject; var _local3:SoundObject; if (!_musicMute){ _musicMute = true; for each (_local2 in _dictMusic) { _local2.muteOn(_arg1); }; } else { _musicMute = false; for each (_local3 in _dictMusic) { _local3.muteOff(_arg1); }; }; } public static function isMusicChannelMute():Boolean{ return (_musicMute); } public static function isSFXChannelMuted():Boolean{ return (_sfxMute); } public static function muteSFX(_arg1:String, _arg2:Number=0):void{ var _local3:*; if ((_dictSFX[_arg1] is SoundObject)){ _local3 = _dictSFX[_arg1]; if (_local3.mute){ _local3.muteOff(_arg2); } else { _local3.muteOn(_arg2); }; }; } public static function muteMusic(_arg1:String, _arg2:Number=0):void{ var _local3:*; if ((_dictMusic[_arg1] is SoundObject)){ _local3 = _dictMusic[_arg1]; if (_local3.mute){ _local3.muteOff(_arg2); } else { _local3.muteOn(_arg2); }; }; } public static function playSFX(_arg1:String, _arg2:Boolean=false, _arg3:uint=999999, _arg4:uint=0, _arg5:Boolean=false):void{ if ((_dictSFX[_arg1] is SoundObject)){ _dictSFX[_arg1].play(_arg2, _arg3, _arg4, _arg5); }; } public static function playMusic(_arg1:String, _arg2:Boolean=false, _arg3:uint=999999, _arg4:uint=0):void{ if ((_dictMusic[_arg1] is SoundObject)){ _dictMusic[_arg1].play(_arg2, _arg3, _arg4); }; } public static function stopSFX(_arg1:String):void{ if ((_dictSFX[_arg1] is SoundObject)){ _dictSFX[_arg1].stop(); }; } public static function stopSFXChannel():void{ var _local1:SoundObject; for each (_local1 in _dictSFX) { _local1.stop(); }; } public static function stopMusicChannel():void{ var _local1:SoundObject; for each (_local1 in _dictMusic) { _local1.stop(); }; } public static function stopMusic(_arg1:String):void{ if ((_dictMusic[_arg1] is SoundObject)){ _dictMusic[_arg1].stop(); }; } public static function resumeSFX(_arg1:String):void{ if ((_dictSFX[_arg1] is SoundObject)){ _dictSFX[_arg1].resume(); }; } public static function resumeSFXChannel():void{ var _local1:SoundObject; for each (_local1 in _dictSFX) { _local1.resume(); }; } public static function resumeMusic(_arg1:String):void{ if ((_dictMusic[_arg1] is SoundObject)){ _dictMusic[_arg1].resume(); }; } public static function resumeMusicChannel():void{ var _local1:SoundObject; for each (_local1 in _dictMusic) { _local1.resume(); }; } public static function fadeSFX(_arg1:String, _arg2:Number, _arg3:Number):void{ if ((_dictSFX[_arg1] is SoundObject)){ _dictSFX[_arg1].fade(_arg2, _arg3); }; } public static function fadeSFXPlay(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:uint=999999, _arg6:uint=0, _arg7:Boolean=false):void{ if ((_dictSFX[_arg1] is SoundObject)){ setVolumeSFX(_arg1, 0); playSFX(_arg1, _arg4, _arg5, _arg6, _arg7); fadeSFX(_arg1, _arg2, _arg3); }; } public static function fadeMusic(_arg1:String, _arg2:Number, _arg3:Number):void{ if ((_dictMusic[_arg1] is SoundObject)){ _dictMusic[_arg1].fade(_arg2, _arg3); }; } public static function fadeMusicStop(_arg1:String, _arg2:Number, _arg3:Number):void{ if ((_dictMusic[_arg1] is SoundObject)){ _dictMusic[_arg1].fade(_arg2, _arg3); TweenLite.to(_dictMusic[_arg1], _arg3, {onComplete:stopMusic, onCompleteParams:[_arg1]}); }; } public static function fadeSFXStop(_arg1:String, _arg2:Number, _arg3:Number):void{ if ((_dictSFX[_arg1] is SoundObject)){ _dictSFX[_arg1].fade(_arg2, _arg3); TweenLite.to(_arg1, _arg3, {onComplete:stopSFX, onCompleteParams:[_arg1]}); }; } public static function fadeMusicPlay(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:uint=999999, _arg6:uint=0):void{ if ((_dictMusic[_arg1] is SoundObject)){ setVolumeMusic(_arg1, 0); playMusic(_arg1, _arg4, _arg5, _arg6); fadeMusic(_arg1, _arg2, _arg3); }; } public static function fadeSFXChannel(_arg1:Number, _arg2:Number):void{ var _local3:SoundObject; for each (_local3 in _dictSFX) { _local3.fade(_arg1, _arg2); }; } public static function fadeMusicChannel(_arg1:Number, _arg2:Number):void{ var _local3:SoundObject; for each (_local3 in _dictMusic) { _local3.fade(_arg1, _arg2); }; } public static function fadeMusicChannelStop(_arg1:Number, _arg2:Number):void{ var _local3:SoundObject; for each (_local3 in _dictMusic) { _local3.fade(_arg1, _arg2); TweenLite.to(_local3, _arg2, {onComplete:stopMusic, onCompleteParams:[_local3.linkage]}); }; } public static function fadeSFXChannelStop(_arg1:Number, _arg2:Number):void{ var _local3:SoundObject; for each (_local3 in _dictSFX) { _local3.fade(_arg1, _arg2); TweenLite.to(_local3, _arg2, {onComplete:stopSFX, onCompleteParams:[_local3.linkage]}); }; } public static function fadeAll(_arg1:Number, _arg2:Number):void{ fadeSFXChannel(_arg1, _arg2); fadeMusicChannel(_arg1, _arg2); } public static function setVolumeSFX(_arg1:String, _arg2:Number):void{ if ((_dictSFX[_arg1] is SoundObject)){ _dictSFX[_arg1].volume = _arg2; }; } public static function setVolumeMusic(_arg1:String, _arg2:Number):void{ if ((_dictMusic[_arg1] is SoundObject)){ _dictMusic[_arg1].volume = _arg2; }; } public static function getLengthMusic(_arg1:String):Number{ var _local2:Number = 0; if ((_dictMusic[_arg1] is SoundObject)){ _local2 = _dictMusic[_arg1].length; }; return (_local2); } public static function getPositionMusic(_arg1:String):Number{ var _local2:Number = 0; if ((_dictMusic[_arg1] is SoundObject)){ _local2 = _dictMusic[_arg1].currentPosition; }; return (_local2); } public static function setMaxVolumeSFX(_arg1:String, _arg2:Number):void{ if ((_dictSFX[_arg1] is SoundObject)){ _dictSFX[_arg1].maxVolume = _arg2; }; } public static function setMaxVolumeMusic(_arg1:String, _arg2:Number):void{ if ((_dictMusic[_arg1] is SoundObject)){ _dictMusic[_arg1].maxVolume = _arg2; }; } public static function setVolumeSFXChannel(_arg1:Number):void{ var _local2:SoundObject; for each (_local2 in _dictSFX) { _local2.volume = _arg1; }; } public static function setVolumeMusicChannel(_arg1:Number):void{ var _local2:SoundObject; for each (_local2 in _dictMusic) { _local2.volume = _arg1; }; } public static function setMaxVolumeSFXChannel(_arg1:Number):void{ var _local2:SoundObject; if (_rememberValue){ _sfxChannelVolume = _arg1; }; _maxSFXVolume = _arg1; for each (_local2 in _dictSFX) { _local2.maxVolume = _arg1; }; } public static function getMaxVolumeSFXChannel():Number{ return (_maxSFXVolume); } public static function setMaxVolumeMusicChannel(_arg1:Number):void{ var _local2:SoundObject; if (_rememberValue){ _musicChannelVolume = _arg1; }; _maxMusicVolume = _arg1; for each (_local2 in _dictMusic) { _local2.maxVolume = _arg1; }; } public static function getMaxVolumeMusicChannel():Number{ return (_maxMusicVolume); } public static function getVolumeSFX(_arg1:String):Number{ return (_dictSFX[_arg1].volume); } public static function getVolumeMusic(_arg1:String):Number{ return (_dictMusic[_arg1].volume); } public static function getVolumeSFXChannel():Number{ return (_sfxChannelVolume); } public static function getVolumeMusicChannel():Number{ return (_musicChannelVolume); } public static function isMusicPlaying(_arg1:String):Boolean{ return (_dictMusic[_arg1].isPlaying); } public static function isSFXPlaying(_arg1:String):Boolean{ return (_dictSFX[_arg1].isPlaying); } public static function tweenMusicSpeed(_arg1:String, _arg2:Number, _arg3:Number=1, _arg4:Number=0):void{ TweenLite.to(_dictMusic[_arg1], _arg2, {delay:_arg4, rate:_arg3}); } public static function setMusicSpeed(_arg1:String, _arg2:Number):void{ _dictMusic[_arg1].rate = _arg2; } public static function tweenSFXSpeed(_arg1:String, _arg2:Number, _arg3:Number=1, _arg4:Number=0):void{ TweenLite.to(_dictSFX[_arg1], _arg2, {delay:_arg4, rate:_arg3}); } public static function setSFXSpeed(_arg1:String, _arg2:Number):void{ _dictSFX[_arg1].rate = _arg2; } } }//package console.sounds
Section 203
//StringUtils (console.strings.StringUtils) package console.strings { public class StringUtils { private function replace(_arg1:String, _arg2:String, _arg3:String):String{ return (_arg1.split(_arg2).join(_arg3)); } public static function afterFirst(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.indexOf(_arg2); if (_local3 == -1){ return (""); }; _local3 = (_local3 + _arg2.length); return (_arg1.substr(_local3)); } public static function afterLast(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.lastIndexOf(_arg2); if (_local3 == -1){ return (""); }; _local3 = (_local3 + _arg2.length); return (_arg1.substr(_local3)); } public static function beginsWith(_arg1:String, _arg2:String):Boolean{ if (_arg1 == null){ return (false); }; return ((_arg1.indexOf(_arg2) == 0)); } public static function beforeFirst(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.indexOf(_arg2); if (_local3 == -1){ return (""); }; return (_arg1.substr(0, _local3)); } public static function beforeLast(_arg1:String, _arg2:String):String{ if (_arg1 == null){ return (""); }; var _local3:int = _arg1.lastIndexOf(_arg2); if (_local3 == -1){ return (""); }; return (_arg1.substr(0, _local3)); } public static function between(_arg1:String, _arg2:String, _arg3:String):String{ var _local6:int; var _local4 = ""; if (_arg1 == null){ return (_local4); }; var _local5:int = _arg1.indexOf(_arg2); if (_local5 != -1){ _local5 = (_local5 + _arg2.length); _local6 = _arg1.indexOf(_arg3, _local5); if (_local6 != -1){ _local4 = _arg1.substr(_local5, (_local6 - _local5)); }; }; return (_local4); } public static function block(_arg1:String, _arg2:uint, _arg3:String="."):Array{ var _local8:String; var _local4:Array = new Array(); if ((((_arg1 == null)) || (!(contains(_arg1, _arg3))))){ return (_local4); }; var _local5:uint; var _local6:uint = _arg1.length; var _local7:RegExp = new RegExp((("[^" + escapePattern(_arg3)) + "]+$")); while (_local5 < _local6) { _local8 = _arg1.substr(_local5, _arg2); if (!contains(_local8, _arg3)){ _local4.push(truncate(_local8, _local8.length)); _local5 = (_local5 + _local8.length); }; _local8 = _local8.replace(_local7, ""); _local4.push(_local8); _local5 = (_local5 + _local8.length); }; return (_local4); } public static function capitalize(_arg1:String, ... _args):String{ var _local3:String = trimLeft(_arg1); if (_args[0] === true){ return (_local3.replace(/^.|\b./g, _upperCase)); }; return (_local3.replace(/(^\w)/, _upperCase)); } public static function contains(_arg1:String, _arg2:String):Boolean{ if (_arg1 == null){ return (false); }; return (!((_arg1.indexOf(_arg2) == -1))); } public static function countOf(_arg1:String, _arg2:String, _arg3:Boolean=true):uint{ if (_arg1 == null){ return (0); }; var _local4:String = escapePattern(_arg2); var _local5:String = (_arg3) ? "g" : "ig"; return (_arg1.match(new RegExp(_local4, _local5)).length); } public static function editDistance(_arg1:String, _arg2:String):uint{ var _local3:uint; var _local5:uint; var _local8:uint; var _local9:String; var _local10:String; if (_arg1 == null){ _arg1 = ""; }; if (_arg2 == null){ _arg2 = ""; }; if (_arg1 == _arg2){ return (0); }; var _local4:Array = new Array(); var _local6:uint = _arg1.length; var _local7:uint = _arg2.length; if (_local6 == 0){ return (_local7); }; if (_local7 == 0){ return (_local6); }; _local3 = 0; while (_local3 <= _local6) { _local4[_local3] = new Array(); _local3++; }; _local3 = 0; while (_local3 <= _local6) { _local4[_local3][0] = _local3; _local3++; }; _local8 = 0; while (_local8 <= _local7) { _local4[0][_local8] = _local8; _local8++; }; _local3 = 1; while (_local3 <= _local6) { _local9 = _arg1.charAt((_local3 - 1)); _local8 = 1; while (_local8 <= _local7) { _local10 = _arg2.charAt((_local8 - 1)); if (_local9 == _local10){ _local5 = 0; } else { _local5 = 1; }; _local4[_local3][_local8] = _minimum((_local4[(_local3 - 1)][_local8] + 1), (_local4[_local3][(_local8 - 1)] + 1), (_local4[(_local3 - 1)][(_local8 - 1)] + _local5)); _local8++; }; _local3++; }; return (_local4[_local6][_local7]); } public static function endsWith(_arg1:String, _arg2:String):Boolean{ return ((_arg1.lastIndexOf(_arg2) == (_arg1.length - _arg2.length))); } public static function hasText(_arg1:String):Boolean{ var _local2:String = removeExtraWhitespace(_arg1); return (!(!(_local2.length))); } public static function isEmpty(_arg1:String):Boolean{ if (_arg1 == null){ return (true); }; return (!(_arg1.length)); } public static function isNumeric(_arg1:String):Boolean{ if (_arg1 == null){ return (false); }; var _local2:RegExp = /^[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?$/; return (_local2.test(_arg1)); } public static function padLeft(_arg1:String, _arg2:String, _arg3:uint):String{ var _local4:String = _arg1; while (_local4.length < _arg3) { _local4 = (_arg2 + _local4); }; return (_local4); } public static function padRight(_arg1:String, _arg2:String, _arg3:uint):String{ var _local4:String = _arg1; while (_local4.length < _arg3) { _local4 = (_local4 + _arg2); }; return (_local4); } public static function properCase(_arg1:String):String{ if (_arg1 == null){ return (""); }; var _local2:String = _arg1.toLowerCase().replace(/\b([^.?;!]+)/, capitalize); return (_local2.replace(/\b[i]\b/, "I")); } public static function quote(_arg1:String):String{ var _local2:RegExp = /[\\"\r\n]/g; return ((("\"" + _arg1.replace(_local2, _quote)) + "\"")); } public static function remove(_arg1:String, _arg2:String, _arg3:Boolean=true):String{ if (_arg1 == null){ return (""); }; var _local4:String = escapePattern(_arg2); var _local5:String = (_arg3) ? "g" : "ig"; return (_arg1.replace(new RegExp(_local4, _local5), "")); } public static function removeExtraWhitespace(_arg1:String):String{ if (_arg1 == null){ return (""); }; var _local2:String = trim(_arg1); return (_local2.replace(/\s+/g, " ")); } public static function reverse(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.split("").reverse().join("")); } public static function reverseWords(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.split(/\s+/).reverse().join("")); } public static function similarity(_arg1:String, _arg2:String):Number{ var _local3:uint = editDistance(_arg1, _arg2); var _local4:uint = Math.max(_arg1.length, _arg2.length); if (_local4 == 0){ return (100); }; return (((1 - (_local3 / _local4)) * 100)); } public static function stripTags(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/<\/?[^>]+>/igm, "")); } public static function swapCase(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/(\w)/, _swapCase)); } public static function trim(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/^\s+|\s+$/g, "")); } public static function trimLeft(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/^\s+/, "")); } public static function trimRight(_arg1:String):String{ if (_arg1 == null){ return (""); }; return (_arg1.replace(/\s+$/, "")); } public static function wordCount(_arg1:String):uint{ if (_arg1 == null){ return (0); }; return (_arg1.match(/\b\w+\b/g).length); } public static function truncate(_arg1:String, _arg2:uint, _arg3:String="..."):String{ if (_arg1 == null){ return (""); }; _arg2 = (_arg2 - _arg3.length); var _local4:String = _arg1; if (_local4.length > _arg2){ _local4 = _local4.substr(0, _arg2); if (/[^\s]/.test(_arg1.charAt(_arg2))){ _local4 = trimRight(_local4.replace(/\w+$|\s+$/, "")); }; _local4 = (_local4 + _arg3); }; return (_local4); } private static function escapePattern(_arg1:String):String{ return (_arg1.replace(/(\]|\[|\{|\}|\(|\)|\*|\+|\?|\.|\\)/g, "\\$1")); } private static function _minimum(_arg1:uint, _arg2:uint, _arg3:uint):uint{ return (Math.min(_arg1, Math.min(_arg2, Math.min(_arg3, _arg1)))); } private static function _quote(_arg1:String, ... _args):String{ switch (_arg1){ case "\\": return ("\\\\"); case "\r": return ("\\r"); case "\n": return ("\\n"); case "\"": return ("\\\""); default: return (""); }; } private static function _upperCase(_arg1:String, ... _args):String{ return (_arg1.toUpperCase()); } private static function _swapCase(_arg1:String, ... _args):String{ var _local3:String = _arg1.toLowerCase(); var _local4:String = _arg1.toUpperCase(); switch (_arg1){ case _local3: return (_local4); case _local4: return (_local3); default: return (_arg1); }; } } }//package console.strings
Section 204
//MochiBot (console.trackers.MochiBot) package console.trackers { import flash.display.*; import flash.net.*; import flash.system.*; public dynamic class MochiBot extends Sprite { public static function track(_arg1:Sprite, _arg2:String):MochiBot{ if (Security.sandboxType == "localWithFile"){ return (null); }; var _local3:MochiBot = new (MochiBot); _arg1.addChild(_local3); Security.allowDomain("*"); Security.allowInsecureDomain("*"); var _local4 = "http://core.mochibot.com/my/core.swf"; var _local5:URLVariables = new URLVariables(); _local5["sb"] = Security.sandboxType; _local5["v"] = Capabilities.version; _local5["swfid"] = _arg2; _local5["mv"] = "8"; _local5["fv"] = "9"; var _local6:String = _local3.root.loaderInfo.loaderURL; if (_local6.indexOf("http") == 0){ _local5["url"] = _local6; } else { _local5["url"] = "local"; }; var _local7:URLRequest = new URLRequest(_local4); _local7.contentType = "application/x-www-form-urlencoded"; _local7.method = URLRequestMethod.POST; _local7.data = _local5; var _local8:Loader = new Loader(); _local3.addChild(_local8); _local8.load(_local7); return (_local3); } } }//package console.trackers
Section 205
//Analytics (console.tracking.Analytics) package console.tracking { import flash.display.*; import com.google.analytics.*; import console.trackers.*; import com.memecounter.*; import flash.utils.*; public class Analytics extends Sprite { public static const SERVICE_MEME:String = "meme"; public static const SERVICE_MOCHI:String = "mochi"; public static const SERVICE_GOOGLE:String = "google"; public static const TRACK_CLICKTHROUGH:String = "clickThrough"; public static const TRACK_EVENT:String = "event"; private static var _instance:Analytics; private static var _allowInstantiation:Boolean; private static var _eventDictionary:Dictionary; private static var _services:Dictionary; private static var _visualDebug:Boolean = false; public function Analytics(){ if (!_allowInstantiation){ throw (new Error("Error: Instantiation failed: Use Analytics.getInstance() instead of new.")); }; } public static function getInstance():Analytics{ if (_instance == null){ _allowInstantiation = true; _instance = new (Analytics); _eventDictionary = new Dictionary(); _services = new Dictionary(); _allowInstantiation = false; }; return (_instance); } public static function addTrackingCode(_arg1:String, _arg2):void{ switch (_arg1){ case SERVICE_GOOGLE: _services[_arg1] = new GATracker(_instance, _arg2, "AS3", _visualDebug); _services[_arg1].trackPageview("Game"); break; case SERVICE_MEME: _services[_arg1] = Tracker; _services[_arg1].init(_arg2, _instance.root); break; case SERVICE_MOCHI: _services[_arg1] = MochiBot.track(_instance, _arg2); break; }; } public static function addTrackingEvent(_arg1:String, _arg2:String, _arg3:String, _arg4=null):void{ _eventDictionary[_arg1] = {service:_arg3, name:_arg1, type:_arg2, code:_arg4}; } public static function dispatchTrackingEvent(_arg1:String):void{ var _local2:Object = _eventDictionary[_arg1]; if (_local2 == null){ throw (new Error((("tracking event" + _arg1) + " does not exist"))); }; switch (_local2.type){ case TRACK_CLICKTHROUGH: switch (_local2.service){ case SERVICE_GOOGLE: if (_services[_local2.service].isReady()){ _services[_local2.service].trackEvent(_local2.type, _local2.name); } else { setTimeout(dispatchTrackingEvent, 1000, _arg1); }; break; case SERVICE_MEME: if (_services[_local2.service].isReady){ _services[_local2.service].kvEvent(_local2.code); } else { setTimeout(dispatchTrackingEvent, 1000, _arg1); }; break; case SERVICE_MOCHI: throw (new Error("mochi tracking service does not support event tracking")); }; break; case TRACK_EVENT: switch (_local2.service){ case SERVICE_GOOGLE: if (_services[_local2.service].isReady()){ _services[_local2.service].trackEvent(_local2.type, _local2.name); } else { setTimeout(dispatchTrackingEvent, 1000, _arg1); }; break; case SERVICE_MEME: if (_services[_local2.service].isReady){ _services[_local2.service].kvClick(_local2.code); } else { setTimeout(dispatchTrackingEvent, 1000, _arg1); }; break; case SERVICE_MOCHI: throw (new Error("mochi tracking service does not support event tracking")); }; break; }; } } }//package console.tracking
Section 206
//LanguageFilter (console.verification.LanguageFilter) package console.verification { import console.strings.*; public class LanguageFilter { private static const _arrAbuse:Array = new Array("bastard", "bitch", "bollock", "bollox", "cunt", "cock", "dick", "fisting", "fuck", "penis", "phedo", "piss", "pussy", "prick", "shit", "slag", "slut", "twat", "wog", "wank", "whore"); public static function containsSwearing(_arg1:String):Boolean{ var _local2:uint = _arrAbuse.length; var _local3:int; while (_local3 < _local2) { if (StringUtils.contains(_arg1.toLowerCase(), _arrAbuse[_local3])){ return (true); }; _local3++; }; return (false); } } }//package console.verification
Section 207
//Character (ecomExpo.game.Character) package ecomExpo.game { import flash.display.*; import ecomExpo.racingEngine.*; import flash.utils.*; public class Character extends MovieClip { public var character:MovieClip; public var arrow:MovieClip; private var _forward:Boolean; private var _movementInterval:uint; private var _speed:Number; private var _moving:Boolean; public function Character(){ _forward = true; _speed = 1; _moving = false; super(); character.stop(); character.contents.gotoAndStop(1); } public function moveForward():void{ if (_moving){ return; }; _moving = true; _forward = true; stopBackward(); startForward(); } public function moveBackward():void{ if (_moving){ return; }; _moving = true; _forward = false; stopForward(); startBackward(); } public function get movingForward():Boolean{ return (_forward); } public function set arrowRotation(_arg1:Number):void{ arrow.rotation = _arg1; } public function get arrowRotation():Number{ return (arrow.rotation); } public function get arrowX():Number{ return (arrow.x); } public function get arrowY():Number{ return (arrow.y); } public function get moving():Boolean{ return (_moving); } public function set speed(_arg1:Number):void{ if (_arg1 < 1.8){ clearInterval(_movementInterval); if (_forward){ character.forward.gotoAndStop(4); } else { character.backward.gotoAndStop(7); }; _moving = false; return; }; _speed = (500 - (_arg1 * 10)); _speed = (_speed / 30); if (_speed < 0){ clearInterval(_movementInterval); if (_forward){ character.forward.gotoAndStop(4); } else { character.backward.gotoAndStop(7); }; _moving = false; }; } public function get speed():Number{ return (_speed); } public function bonus():void{ if (!Collectable.active){ return; }; if (character.contents.currentFrame < character.contents.totalFrames){ character.contents.nextFrame(); }; } private function startForward():void{ character.forward.alpha = 1; clearInterval(_movementInterval); _movementInterval = setInterval(animateForward, _speed); } private function startBackward():void{ character.backward.alpha = 1; clearInterval(_movementInterval); _movementInterval = setInterval(animateBackward, _speed); } private function stopForward():void{ character.forward.alpha = 0; clearInterval(_movementInterval); } private function stopBackward():void{ character.backward.alpha = 0; clearInterval(_movementInterval); } private function animateForward():void{ character.forward.alpha = 1; if (character.forward.currentFrame < character.forward.totalFrames){ character.forward.nextFrame(); } else { character.forward.gotoAndStop(1); }; _moving = false; } private function animateBackward():void{ character.backward.alpha = 1; if (character.backward.currentFrame < character.backward.totalFrames){ character.backward.nextFrame(); } else { character.backward.gotoAndStop(1); }; _moving = false; } } }//package ecomExpo.game
Section 208
//CollectionEvent (ecomExpo.game.CollectionEvent) package ecomExpo.game { import flash.events.*; public class CollectionEvent extends Event { private var _collectionObjectType:String; public static const COLLECTION:String = "collection"; public function CollectionEvent(_arg1:String, _arg2:String):void{ _collectionObjectType = _arg2; super(_arg1); } override public function clone():Event{ return (new CollectionEvent(type, _collectionObjectType)); } public function get collectionObjectType():String{ return (_collectionObjectType); } } }//package ecomExpo.game
Section 209
//CrowdDouble (ecomExpo.game.CrowdDouble) package ecomExpo.game { import flash.display.*; import com.stampy.random.*; public class CrowdDouble extends MovieClip { public function CrowdDouble(){ addFrameScript(0, frame1); this.gotoAndStop(Random.range(1, 6)); } function frame1(){ stop(); } } }//package ecomExpo.game
Section 210
//CrowdMember (ecomExpo.game.CrowdMember) package ecomExpo.game { import flash.display.*; import com.stampy.random.*; public class CrowdMember extends MovieClip { public function CrowdMember(){ addFrameScript(0, frame1); this.gotoAndStop(Random.range(1, 3)); } function frame1(){ stop(); } } }//package ecomExpo.game
Section 211
//CrowdSingle (ecomExpo.game.CrowdSingle) package ecomExpo.game { import flash.display.*; import com.stampy.random.*; public class CrowdSingle extends MovieClip { public function CrowdSingle(){ addFrameScript(0, frame1); this.gotoAndStop(Random.range(1, 6)); } function frame1(){ stop(); } } }//package ecomExpo.game
Section 212
//CrowdTripple (ecomExpo.game.CrowdTripple) package ecomExpo.game { import flash.display.*; import com.stampy.random.*; public class CrowdTripple extends MovieClip { public function CrowdTripple(){ addFrameScript(0, frame1); this.gotoAndStop(Random.range(1, 6)); } function frame1(){ stop(); } } }//package ecomExpo.game
Section 213
//GameState (ecomExpo.game.GameState) package ecomExpo.game { import flash.geom.*; import ecomExpo.racingEngine.*; import com.stampy.random.*; public class GameState { public static var score:uint = 0; public static var character:Character = null; public static var worldWidth:uint = 6931; public static var worldHeight:uint = 4250; public static var debugScale:Number = 2.6; public static var startX:uint = 700; public static var startY:uint = 750; public static var isleSize:uint = 280; public static var stallSize:uint = 465; public static var collectables:uint = 0; public static var bonusX:Number = 0; public static var bonusY:Number = 0; public static var crowdSize:uint = 15; public static var crowdSingleSize:uint = 7; public static var crowdDoubleSize:uint = 4; public static var crowdTrippleSize:uint = 3; public static var racingGame:RacingGame = null; public static var crowdPoints:Array = []; public static var crowdSinglePoints:Array = []; public static var crowdDoublePoints:Array = []; public static var crowdTripplePoints:Array = []; public static var collectableDropPoints:Array = []; public static var collectableOriginalDropPoints:Array = [new Point(4398, 2946), new Point(559, 392), new Point(631, 555), new Point(999, 655), new Point(1226, 694), new Point(1593, 376), new Point(1650, 554), new Point(2014, 597), new Point(2412, 631), new Point(2813, 638), new Point(3389, 642), new Point(3797, 658), new Point(4081, 645), new Point(4364, 624), new Point(4662, 458), new Point(4939, 605), new Point(5412, 667), new Point(5881, 649), new Point(6191, 388), new Point(6593, 662), new Point(6619, 411), new Point(6484, 765), new Point(6528, 945), new Point(6541, 1107), new Point(6644, 1380), new Point(6507, 1745), new Point(6501, 2245), new Point(6562, 2690), new Point(6547, 3297), new Point(6627, 3645), new Point(6698, 3909), new Point(508, 1107), new Point(612, 1204), new Point(611, 1489), new Point(611, 1787), new Point(363, 2147), new Point(622, 2350), new Point(661, 2606), new Point(547, 2805), new Point(589, 3229), new Point(556, 3474), new Point(452, 3752), new Point(658, 3892), new Point(792, 3820), new Point(1103, 3697), new Point(1412, 3670), new Point(1757, 3637), new Point(1940, 3628), new Point(2406, 3664), new Point(2716, 3679), new Point(2900, 3682), new Point(3561, 3897), new Point(3682, 3829), new Point(3950, 3891), new Point(4318, 3925), new Point(4755, 3667), new Point(5252, 3574), new Point(5350, 3627), new Point(5466, 3700), new Point(5753, 3747), new Point(6069, 3678), new Point(879, 1335), new Point(1488, 1321), new Point(1924, 1377), new Point(2278, 1357), new Point(2611, 1358), new Point(3154, 1375), new Point(3473, 1338), new Point(3665, 1358), new Point(3808, 1379), new Point(3923, 1381), new Point(4081, 1378), new Point(4351, 1369), new Point(4490, 1365), new Point(4682, 1357), new Point(4934, 1396), new Point(5322, 1378), new Point(5547, 1373), new Point(5939, 1353), new Point(6154, 1372), new Point(5604, 2062), new Point(5200, 2156), new Point(5108, 2137), new Point(4842, 2099), new Point(4615, 2095), new Point(3932, 2007), new Point(3629, 2114), new Point(2784, 2024), new Point(2490, 2112), new Point(2006, 2141), new Point(1748, 2162), new Point(1624, 2146), new Point(1390, 2115), new Point(1092, 2081), new Point(862, 2076), new Point(916, 2848), new Point(1219, 2762), new Point(1258, 2781), new Point(1342, 2831), new Point(1504, 2883), new Point(1618, 2870), new Point(1793, 2867), new Point(1924, 2859), new Point(2108, 2863), new Point(2358, 2861), new Point(2618, 2855), new Point(2853, 2849), new Point(3099, 2843), new Point(3318, 2837), new Point(3559, 2831), new Point(3785, 2825), new Point(4051, 2818), new Point(4357, 2810), new Point(4685, 2801), new Point(4955, 2800), new Point(5319, 2821), new Point(5731, 2711), new Point(5807, 2814), new Point(6159, 2896), new Point(5802, 3392), new Point(5775, 2692), new Point(5768, 2432), new Point(5751, 1934), new Point(5739, 1588), new Point(5724, 1159), new Point(5714, 883), new Point(5017, 805), new Point(4966, 992), new Point(5126, 1786), new Point(5106, 2025), new Point(5088, 2338), new Point(5078, 2459), new Point(4995, 3050), new Point(4978, 3254), new Point(4227, 3436), new Point(4237, 3291), new Point(4284, 2608), new Point(4294, 2411), new Point(4306, 1928), new Point(4319, 1701), new Point(0x1100, 1204), new Point(4356, 935), new Point(3591, 857), new Point(3587, 1050), new Point(3572, 1577), new Point(3562, 1837), new Point(3541, 2329), new Point(3533, 2521), new Point(3533, 3024), new Point(3546, 3198), new Point(2718, 3294), new Point(2775, 3130), new Point(2834, 2703), new Point(2809, 2497), new Point(2810, 2370), new Point(2769, 1214), new Point(2812, 999), new Point(2720, 829), new Point(1363, 1053), new Point(1377, 853), new Point(1319, 1240), new Point(1356, 1678), new Point(1305, 1918), new Point(1316, 2256), new Point(1322, 2424), new Point(1329, 2610), new Point(1344, 3020), new Point(1350, 3211), new Point(1356, 3370), new Point(2080, 3384), new Point(2055, 3160), new Point(2040, 2670), new Point(2036, 2502), new Point(2032, 2353), new Point(2021, 1943), new Point(2015, 1726), new Point(1999, 1133), new Point(1991, 840)]; public static var walls:Array = [new Rectangle(0, 0, 300, 4250), new Rectangle(300, 0, 6460, 290), new Rectangle(6760, 0, 270, 4250), new Rectangle(300, 4030, 6460, 290), new Rectangle(300, 290, 100, 1700), new Rectangle(300, 2350, 100, 1300), new Rectangle(6660, 750, 100, 465), new Rectangle(6660, 1495, 100, 465), new Rectangle(6660, 2240, 100, 465), new Rectangle(6660, 2985, 100, 465), new Rectangle(700, 290, 700, 200), new Rectangle(1750, 290, 1200, 200), new Rectangle(3300, 290, 1200, 200), new Rectangle(4800, 290, 1200, 200), new Rectangle(6375, 290, 100, 200), new Rectangle(1850, 3830, 1350, 200), new Rectangle(4800, 3830, 450, 200), new Rectangle(5675, 3830, 900, 200)]; public static var gatesA:Array = [new Rectangle(432, 900, 240, 26), new Rectangle(1185, 900, 240, 26), new Rectangle(1930, 900, 240, 26), new Rectangle(2675, 900, 240, 26), new Rectangle(3420, 900, 240, 26), new Rectangle(4165, 900, 240, 26), new Rectangle(4910, 900, 240, 26), new Rectangle(5655, 900, 240, 26), new Rectangle(0x1900, 900, 240, 26), new Rectangle(432, 1700, 240, 26), new Rectangle(1185, 1700, 240, 26), new Rectangle(1930, 1700, 240, 26), new Rectangle(3420, 1700, 240, 26), new Rectangle(4165, 1700, 240, 26), new Rectangle(4910, 1700, 240, 26), new Rectangle(5655, 1700, 240, 26), new Rectangle(0x1900, 1700, 240, 26), new Rectangle(432, 2480, 240, 26), new Rectangle(1185, 2480, 240, 26), new Rectangle(1930, 2480, 240, 26), new Rectangle(2675, 2480, 240, 26), new Rectangle(3420, 2480, 240, 26), new Rectangle(4165, 2480, 240, 26), new Rectangle(4910, 2480, 240, 26), new Rectangle(5655, 2480, 240, 26), new Rectangle(0x1900, 2480, 240, 26), new Rectangle(432, 3250, 240, 26), new Rectangle(1185, 3250, 240, 26), new Rectangle(1930, 3250, 240, 26), new Rectangle(2675, 3250, 240, 26), new Rectangle(3420, 3250, 240, 26), new Rectangle(4165, 3250, 240, 26), new Rectangle(4910, 3250, 240, 26), new Rectangle(5655, 3250, 240, 26), new Rectangle(0x1900, 3250, 240, 26)]; public static var gatesB:Array = [new Rectangle((432 + 480), 500, 26, 240), new Rectangle((1930 + 480), 500, 26, 240), new Rectangle((3420 + 480), 500, 26, 240), new Rectangle((4910 + 480), 500, 26, 240), new Rectangle((432 + 480), (1300 - 60), 26, 240), new Rectangle((1185 + 480), (1300 - 60), 26, 240), new Rectangle((1930 + 480), (1300 - 60), 26, 240), new Rectangle((2675 + 480), (1300 - 60), 26, 240), new Rectangle((3420 + 480), (1300 - 60), 26, 240), new Rectangle((4165 + 480), (1300 - 60), 26, 240), new Rectangle((4910 + 480), (1300 - 60), 26, 240), new Rectangle((5655 + 480), (1300 - 60), 26, 240), new Rectangle((432 + 480), (2080 - 95), 26, 240), new Rectangle((1185 + 480), (2080 - 95), 26, 240), new Rectangle((1930 + 480), (2080 - 95), 26, 240), new Rectangle((2675 + 480), (2080 - 95), 26, 240), new Rectangle((3420 + 480), (2080 - 95), 26, 240), new Rectangle((4165 + 480), (2080 - 95), 26, 240), new Rectangle((4910 + 480), (2080 - 95), 26, 240), new Rectangle((5655 + 480), (2080 - 95), 26, 240), new Rectangle((432 + 480), (2850 - 125), 26, 240), new Rectangle((1185 + 480), (2850 - 125), 26, 240), new Rectangle((1930 + 480), (2850 - 125), 26, 240), new Rectangle((2675 + 480), (2850 - 125), 26, 240), new Rectangle((3420 + 480), (2850 - 125), 26, 240), new Rectangle((4165 + 480), (2850 - 125), 26, 240), new Rectangle((4910 + 480), (2850 - 125), 26, 240), new Rectangle((5655 + 480), (2850 - 125), 26, 240)]; public static function randomCrowd():void{ var _local1:uint; var _local2:Point; var _local3:uint; collectableDropPoints = collectableOriginalDropPoints.concat(); crowdPoints = []; crowdSinglePoints = []; crowdDoublePoints = []; crowdTripplePoints = []; _local3 = 0; while (_local3 < crowdSize) { _local1 = Random.range(0, (collectableDropPoints.length - 1)); _local2 = collectableDropPoints[_local1]; collectableDropPoints.splice(_local1, 1); crowdPoints.push(_local2); _local3++; }; _local3 = 0; while (_local3 < crowdSingleSize) { _local1 = Random.range(0, (collectableDropPoints.length - 1)); _local2 = collectableDropPoints[_local1]; collectableDropPoints.splice(_local1, 1); crowdSinglePoints.push(_local2); _local3++; }; _local3 = 0; while (_local3 < crowdDoubleSize) { _local1 = Random.range(0, (collectableDropPoints.length - 1)); _local2 = collectableDropPoints[_local1]; collectableDropPoints.splice(_local1, 1); crowdDoublePoints.push(_local2); _local3++; }; _local3 = 0; while (_local3 < crowdTrippleSize) { _local1 = Random.range(0, (collectableDropPoints.length - 1)); _local2 = collectableDropPoints[_local1]; collectableDropPoints.splice(_local1, 1); crowdTripplePoints.push(_local2); _local3++; }; } public static function newGame():void{ racingGame = new RacingGame(false); racingGame.tabEnabled = false; racingGame.mouseEnabled = false; racingGame.mouseChildren = false; racingGame.tabChildren = false; racingGame.init(); } public static function destroy():void{ racingGame.destroy(); racingGame = null; } public static function get innerWalls():Array{ var _local3:int; var _local1:Array = []; var _local2:int; while (_local2 < 8) { _local3 = 0; while (_local3 < 4) { _local1.push(new Rectangle((startX + (_local2 * (stallSize + isleSize))), (startY + (_local3 * (stallSize + isleSize))), stallSize, stallSize)); _local3++; }; _local2++; }; _local1.push(new Rectangle(((startX + (2 * (stallSize + isleSize))) + stallSize), (startY + (1 * (stallSize + isleSize))), isleSize, stallSize)); return (_local1); } } }//package ecomExpo.game
Section 214
//GateManager (ecomExpo.game.GateManager) package ecomExpo.game { import flash.geom.*; import com.stampy.points.*; import com.stampy.random.*; public class GateManager { public static const GATES_RANDOMISED:String = "gatesRandomised"; public static const GATES_REMOVED:String = "gatesRemoved"; public static const GATES_ADDED:String = "gatesAdded"; public static const GATES_FREE:String = "gatesFree"; public static var gatesA:Array = [new Rectangle(432, 900, 240, 26), new Rectangle(1185, 900, 240, 26), new Rectangle(1930, 900, 240, 26), new Rectangle(2675, 900, 240, 26), new Rectangle(3420, 900, 240, 26), new Rectangle(4165, 900, 240, 26), new Rectangle(4910, 900, 240, 26), new Rectangle(5655, 900, 240, 26), new Rectangle(0x1900, 900, 240, 26), new Rectangle(432, 1700, 240, 26), new Rectangle(1185, 1700, 240, 26), new Rectangle(1930, 1700, 240, 26), new Rectangle(3420, 1700, 240, 26), new Rectangle(4165, 1700, 240, 26), new Rectangle(4910, 1700, 240, 26), new Rectangle(5655, 1700, 240, 26), new Rectangle(0x1900, 1700, 240, 26), new Rectangle(432, 2480, 240, 26), new Rectangle(1185, 2480, 240, 26), new Rectangle(1930, 2480, 240, 26), new Rectangle(2675, 2480, 240, 26), new Rectangle(3420, 2480, 240, 26), new Rectangle(4165, 2480, 240, 26), new Rectangle(4910, 2480, 240, 26), new Rectangle(5655, 2480, 240, 26), new Rectangle(0x1900, 2480, 240, 26), new Rectangle(432, 3250, 240, 26), new Rectangle(1185, 3250, 240, 26), new Rectangle(1930, 3250, 240, 26), new Rectangle(2675, 3250, 240, 26), new Rectangle(3420, 3250, 240, 26), new Rectangle(4165, 3250, 240, 26), new Rectangle(4910, 3250, 240, 26), new Rectangle(5655, 3250, 240, 26), new Rectangle(0x1900, 3250, 240, 26)]; public static var gatesB:Array = [new Rectangle((432 + 480), 500, 26, 240), new Rectangle((1930 + 480), 500, 26, 240), new Rectangle((3420 + 480), 500, 26, 240), new Rectangle((4910 + 480), 500, 26, 240), new Rectangle((432 + 480), (1300 - 60), 26, 240), new Rectangle((1185 + 480), (1300 - 60), 26, 240), new Rectangle((1930 + 480), (1300 - 60), 26, 240), new Rectangle((2675 + 480), (1300 - 60), 26, 240), new Rectangle((3420 + 480), (1300 - 60), 26, 240), new Rectangle((4165 + 480), (1300 - 60), 26, 240), new Rectangle((4910 + 480), (1300 - 60), 26, 240), new Rectangle((5655 + 480), (1300 - 60), 26, 240), new Rectangle((432 + 480), (2080 - 95), 26, 240), new Rectangle((1185 + 480), (2080 - 95), 26, 240), new Rectangle((1930 + 480), (2080 - 95), 26, 240), new Rectangle((2675 + 480), (2080 - 95), 26, 240), new Rectangle((3420 + 480), (2080 - 95), 26, 240), new Rectangle((4165 + 480), (2080 - 95), 26, 240), new Rectangle((4910 + 480), (2080 - 95), 26, 240), new Rectangle((5655 + 480), (2080 - 95), 26, 240), new Rectangle((432 + 480), (2850 - 125), 26, 240), new Rectangle((1185 + 480), (2850 - 125), 26, 240), new Rectangle((1930 + 480), (2850 - 125), 26, 240), new Rectangle((2675 + 480), (2850 - 125), 26, 240), new Rectangle((3420 + 480), (2850 - 125), 26, 240), new Rectangle((4165 + 480), (2850 - 125), 26, 240), new Rectangle((4910 + 480), (2850 - 125), 26, 240), new Rectangle((5655 + 480), (2850 - 125), 26, 240)]; public static var activeGates:Array = []; public static var updateAllowed:Boolean = false; public static var removeGates:Array = []; public static var oldGates:Array = []; public static var gateState:String; public static var playerPosition:Point = new Point(0, 0); private static var _minGateDistance:Number = 800; public static function generateRandomGates(_arg1:uint):void{ var _local4:String; var _local5:Rectangle; var _local6:Point; var _local7:Number; activeGates = []; var _local2:uint; var _local3:int; while (_local3 < _arg1) { _local4 = (Random.boolean()) ? "A" : "B"; _local5 = GateManager[("gates" + _local4)][Random.range(0, (GateManager[("gates" + _local4)].length - 1))]; _local6 = new Point(_local5.x, _local5.y); _local7 = PointDistance.betweenPoints(_local6, playerPosition); if (_local7 > _minGateDistance){ activeGates.push({rect:_local5, type:_local4}); } else { _local3--; }; _local2++; if (_local2 == 20){ _local3 = _arg1; }; _local3++; }; updateAllowed = true; gateState = GATES_RANDOMISED; } private static function getRelativePosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Point{ _arg1 = ((_arg1 + (_arg3 >> 1)) / 30); _arg2 = ((_arg2 + (_arg4 >> 1)) / 30); return (new Point(_arg1, _arg2)); } private static function getRelativePlayerPosition(_arg1:Point):Point{ _arg1.x = (_arg1.x / 30); _arg1.y = (_arg1.y / 30); return (_arg1); } } }//package ecomExpo.game
Section 215
//TimeDisplay (ecomExpo.game.TimeDisplay) package ecomExpo.game { import flash.events.*; import flash.display.*; import com.greensock.*; import flash.text.*; import console.sounds.*; import console.clock.*; import flash.utils.*; public class TimeDisplay extends MovieClip { public var secs_txt:TextField; public var mins_txt:TextField; public var hunds_txt:TextField; public var score_txt:TextField; public var segment9:MovieClip; public var segment10:MovieClip; public var segment8:MovieClip; public var segment7:MovieClip; public var segment6:MovieClip; public var segment5:MovieClip; public var segment4:MovieClip; public var segment3:MovieClip; public var segment2:MovieClip; public var segment1:MovieClip; private var _timeStarted:uint; private var _timePassed:int; private var _timePaused:uint; private var _timePausedDuration:uint; private var _startTime:uint; private var _timerStyle:String; private var _endTime:uint; private var _bonusCount:uint; private var _bonusInterval:uint; private var _bonusTimeInterval:Number; private var _bonusTime:Number; private var _hurryTime:uint; private var _belowFlag:Boolean; private var _endFlag:Boolean; private var _scoreBonusInterval:uint; public static const TIMER_STYLE_FORWARD:String = "forward"; public static const TIMER_STYLE_BACKWARDS:String = "backwards"; public static const TIMER_COMPLETE:String = "timerComplete"; public static const TIMER_HURRY:String = "timerHurry"; public function TimeDisplay(){ _hurryTime = 10000; _belowFlag = false; _endFlag = false; super(); addEventListener(Event.ADDED_TO_STAGE, onStage); addEventListener(Event.REMOVED_FROM_STAGE, offStage); } public function destroy():void{ clearInterval(_scoreBonusInterval); } public function setTimer(_arg1:uint){ Time.time = (_arg1 * 1000); mins_txt.text = ((Time.intMinutes)>9) ? Time.intMinutes.toString() : ("0" + Time.intMinutes.toString()); secs_txt.text = ((Time.intSeconds)>9) ? Time.intSeconds.toString() : ("0" + Time.intSeconds.toString()); hunds_txt.text = ((Time.intHundSeconds)>9) ? Time.intHundSeconds.toString() : ("0" + Time.intHundSeconds.toString()); } private function scoreBonus():void{ GameState.score = (GameState.score + 100); } public function startTimer(_arg1:String, _arg2:uint, _arg3:uint, _arg4:Number):void{ _scoreBonusInterval = setInterval(scoreBonus, 1000); _bonusTimeInterval = _arg4; _timerStyle = _arg1; _endTime = (_arg3 * 1000); _startTime = (_arg2 * 1000); _timeStarted = getTimer(); _timePaused = 0; _bonusTime = 0; _timePausedDuration = 0; addEventListener(Event.ENTER_FRAME, updateTimer); startBonusTimer(_arg4); } public function stopTimer():void{ clearInterval(_scoreBonusInterval); removeEventListener(Event.ENTER_FRAME, updateTimer); stopBonusTimer(); } public function pauseTimer():void{ clearInterval(_scoreBonusInterval); removeEventListener(Event.ENTER_FRAME, updateTimer); _timePaused = getTimer(); stopBonusTimer(); } public function unpauseTimer():void{ _scoreBonusInterval = setInterval(scoreBonus, 1000); addEventListener(Event.ENTER_FRAME, updateTimer); _timePausedDuration = (_timePausedDuration + (getTimer() - _timePaused)); startBonusTimer(_bonusTimeInterval); } public function collectionMade(_arg1:uint, _arg2:uint):void{ _startTime = (_startTime + (_arg1 * 1000)); GameState.score = (GameState.score + (_bonusCount * _arg2)); showBonusSegments(); } private function startBonusTimer(_arg1:Number):void{ _bonusInterval = setInterval(hideNextBonus, (_arg1 * 1000)); } private function stopBonusTimer():void{ clearInterval(_bonusInterval); clearInterval(_scoreBonusInterval); } private function hideNextBonus():void{ if (_bonusCount < 1){ return; }; TweenMax.to(this[("segment" + _bonusCount)], 0.3, {alpha:0}); _bonusCount--; } private function showBonusSegments():void{ _bonusCount = 10; var _local1 = 1; while (_local1 <= 10) { TweenMax.to(this[("segment" + _local1)], 0.01, {alpha:1}); _local1++; }; } private function updateTimer(_arg1:Event):void{ _timePassed = (getTimer() - (_timeStarted + _timePausedDuration)); switch (_timerStyle){ case TIMER_STYLE_FORWARD: Time.time = _timePassed; if (Time.time == _endTime){ dispatchEvent(new Event(TimeDisplay.TIMER_COMPLETE)); }; break; case TIMER_STYLE_BACKWARDS: Time.time = (((_startTime - _timePassed))>_endTime) ? (_startTime - _timePassed) : _endTime; if ((((Time.time <= (_endTime + _hurryTime))) && (!(_belowFlag)))){ SoundUtils.playSFX("SFX6"); _belowFlag = true; _endFlag = false; dispatchEvent(new Event(TimeDisplay.TIMER_HURRY)); } else { if ((((((Time.time <= (_endTime + (_hurryTime / 2)))) && (_belowFlag))) && (!(_endFlag)))){ _endFlag = true; dispatchEvent(new Event(TimeDisplay.TIMER_HURRY)); } else { if (Time.time > (_endTime + _hurryTime)){ SoundUtils.stopSFX("SFX6"); _belowFlag = false; _endFlag = false; }; }; }; if (Time.time == _endTime){ SoundUtils.stopSFX("SFX6"); dispatchEvent(new Event(TimeDisplay.TIMER_COMPLETE)); }; break; }; mins_txt.text = ((Time.intMinutes)>9) ? Time.intMinutes.toString() : ("0" + Time.intMinutes.toString()); secs_txt.text = ((Time.intSeconds)>9) ? Time.intSeconds.toString() : ("0" + Time.intSeconds.toString()); hunds_txt.text = ((Time.intHundSeconds)>9) ? Time.intHundSeconds.toString() : ("0" + Time.intHundSeconds.toString()); score_txt.text = GameState.score.toString(); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function offStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, offStage); destroy(); } private function init():void{ showBonusSegments(); } } }//package ecomExpo.game
Section 216
//AudioButton (ecomExpo.menus.AudioButton) package ecomExpo.menus { import flash.display.*; import console.sounds.*; public class AudioButton extends MovieClip { public var audio_off:SimpleButton; public var audio_on:SimpleButton; public function AudioButton(){ addFrameScript(0, frame1); this.tabEnabled = false; if (SoundUtils.isGlobalMute){ this.gotoAndStop(2); } else { this.gotoAndStop(1); }; } function frame1(){ stop(); } } }//package ecomExpo.menus
Section 217
//DynamicButton (ecomExpo.menus.DynamicButton) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import com.stampy.services.*; import com.stampy.preloader.*; public class DynamicButton extends MovieClip { private var _imageAddresses:Array; private var _imageLoaders:Array; private var _loadedImages:Array; private var _currentState; private var _loadedCount:uint; private var _registrationPoint:String; private var _hitArea:MovieClip; public static const REGISTRATION_POINT_TOPLEFT:String = "topLeft"; public static const REGISTRATION_POINT_BOTTOMLEFT:String = "bottomLeft"; public static const REGISTRATION_POINT_CENTRE:String = "centre"; public function DynamicButton(_arg1:String, _arg2:String, _arg3:Array=null){ _imageAddresses = []; _imageLoaders = []; _loadedImages = []; _currentState = 0; _loadedCount = 0; super(); _hitArea = new MovieClip(); _loadedImages = _arg3; _registrationPoint = _arg2; if (_arg3.length == 0){ alpha = 0; } else { [(alpha = 1), displayImage()]; }; addEventListener(MouseEvent.MOUSE_OVER, mouseOver); addEventListener(MouseEvent.MOUSE_OUT, mouseOut); var _local4:PHP_Service = new PHP_Service(_arg1); _local4.addEventListener(PHPEvent.DATA_RECIEVED, dataRecieved); _local4.send(); } private function mouseOut(_arg1:MouseEvent):void{ _currentState = 0; displayImage(); } private function mouseOver(_arg1:MouseEvent):void{ _currentState = 1; displayImage(); } private function dataRecieved(_arg1:PHPEvent):void{ _imageAddresses = _arg1.data.button.split(","); loadNext(); } private function loadNext():void{ var _local1:PowerLoader = new PowerLoader(); _local1.addEventListener(Event.COMPLETE, imageLoaded); _local1.load(_imageAddresses[_loadedCount], true); _imageLoaders.push(_local1); } private function imageLoaded(_arg1:Event):void{ var _local2:Sprite = new Sprite(); _local2.addChild(_arg1.target.content); if (_loadedImages[_loadedCount] != null){ TweenMax.to(_loadedImages[_loadedCount], 0.3, {alpha:0}); TweenMax.to(_local2, 0.3, {alpha:1}); }; _loadedImages[_loadedCount] = _local2; _loadedCount++; if (_loadedCount < _imageAddresses.length){ loadNext(); } else { loadComplete(); }; } private function loadComplete():void{ displayImage(); TweenMax.to(this, 0.5, {alpha:1}); } private function displayImage():void{ if (_currentState > (_loadedImages.length - 1)){ return; }; while (this.numChildren > 0) { this.removeChildAt(0); }; switch (_registrationPoint){ case REGISTRATION_POINT_BOTTOMLEFT: _loadedImages[_currentState].y = -(_loadedImages[_currentState].height); break; case REGISTRATION_POINT_CENTRE: _loadedImages[_currentState].x = (-(_loadedImages[_currentState].width) / 2); _loadedImages[_currentState].y = (-(_loadedImages[_currentState].height) / 2); break; case REGISTRATION_POINT_TOPLEFT: _loadedImages[_currentState].x = 0; _loadedImages[_currentState].y = 0; break; }; addChild(_loadedImages[_currentState]); _hitArea.graphics.clear(); _hitArea.graphics.beginFill(0xFF00, 0); _hitArea.graphics.drawRect(_loadedImages[_currentState].x, _loadedImages[_currentState].y, _loadedImages[_currentState].width, _loadedImages[_currentState].height); _hitArea.graphics.endFill(); _hitArea.name = this.name; _hitArea.buttonMode = true; addChild(_hitArea); } } }//package ecomExpo.menus
Section 218
//GameMenu (ecomExpo.menus.GameMenu) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import ecomExpo.game.*; import console.sounds.*; import console.events.*; import flash.utils.*; public class GameMenu extends Menu { public var audioButton_mc:AudioButton; public var time_mc:TimeDisplay; public var timeBonus:MovieClip; public var hurryMessage:MovieClip; private var _debug:Boolean; private var _gameTime:uint; private var _bonusTime:Number; private var _timeBonus_seconds:uint; private var _timeBonus_seconds_min:uint; private var _timeBonus_deplete:uint; private var _segmantBonus_points:uint; private static const HURRY_MESSAGE:String = "hurryMessage"; private static const TIMEBONUS_MESSAGE:String = "timeBonus"; public function GameMenu(){ _debug = false; _gameTime = 40; _bonusTime = 2.5; _timeBonus_seconds = 24; _timeBonus_seconds_min = 4; _timeBonus_deplete = 2; _segmantBonus_points = 1000; super(); this.addEventListener(Event.ADDED_TO_STAGE, onStage); this.addEventListener(Event.REMOVED_FROM_STAGE, offStage); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ newGame(); setupUI(); stage.focus = stage; hideMessages(); introAnimation(); SoundUtils.fadeMusicStop("Music1", 0, 2); SoundUtils.fadeMusicPlay("Music2", 0.6, 2, true); } private function hideMessages():void{ hurryMessage.alpha = 0; timeBonus.alpha = 0; } private function popup(_arg1:String):void{ switch (_arg1){ case TIMEBONUS_MESSAGE: case HURRY_MESSAGE: if (this[_arg1].alpha == 0){ this[_arg1].scaleX = 0; this[_arg1].scaleY = 0; this[_arg1].alpha = 0; TweenMax.to(this[_arg1], 0.5, {scaleX:1, scaleY:1, alpha:1, onComplete:popout, onCompleteParams:[_arg1]}); }; break; }; } private function popout(_arg1:String):void{ switch (_arg1){ case TIMEBONUS_MESSAGE: case HURRY_MESSAGE: TweenMax.to(this[_arg1], 0.5, {delay:0.4, scaleX:1, scaleY:1, alpha:0}); break; }; } private function introAnimation():void{ time_mc.y = -70; time_mc.alpha = 0; setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); TweenMax.to(time_mc, 0.5, {delay:0.1, y:20, alpha:1}); } private function offStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, offStage); } private function setupUI():void{ time_mc.setTimer(_gameTime); setTimeout(startTimer, 2000); } private function startTimer():void{ time_mc.addEventListener(TimeDisplay.TIMER_COMPLETE, timeComplete); time_mc.addEventListener(TimeDisplay.TIMER_HURRY, timeHurry); time_mc.startTimer(TimeDisplay.TIMER_STYLE_BACKWARDS, _gameTime, 0, _bonusTime); } private function timeHurry(_arg1:Event):void{ popup(HURRY_MESSAGE); } private function timeComplete(_arg1:Event):void{ time_mc.removeEventListener(TimeDisplay.TIMER_COMPLETE, timeComplete); dispatchEvent(new MenuTransitionEvent(MenuTransitionEvent.TRANSITION, MenuManager.CURRENT_MENU, MenuManager.GAME_OVER_MENU, MenuTransitions.TRANSITION_BASIC_FADE)); } private function newGame():void{ StaticEventDispatch.addEventListener(CollectionEvent.COLLECTION, collectionMade); GameState.score = 0; GameState.racingGame.x = 0; GameState.racingGame.y = 0; addChildAt(GameState.racingGame, 0); } private function collectionMade(_arg1:CollectionEvent):void{ popup(TIMEBONUS_MESSAGE); if (GameState.character){ GameState.character.bonus(); }; time_mc.collectionMade(_timeBonus_seconds, _segmantBonus_points); _timeBonus_seconds = (((_timeBonus_seconds - _timeBonus_deplete))>=_timeBonus_seconds_min) ? (_timeBonus_seconds - _timeBonus_deplete) : _timeBonus_seconds_min; } } }//package ecomExpo.menus
Section 219
//GameOverMenu (ecomExpo.menus.GameOverMenu) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import flash.text.*; import console.tracking.*; import ecomExpo.game.*; import console.sounds.*; import com.stampy.validation.*; import console.verification.*; import flash.utils.*; public class GameOverMenu extends Menu { public var email_txt:TextField; public var audioButton_mc:AudioButton; public var errorMessage:MovieClip; public var ecom_btn:SimpleButton; public var name_txt:TextField; public var score_txt:TextField; public var privacy_btn:SimpleButton; public var tickBox:TickBox; public var submit_btn:SimpleButton; public var error1:MovieClip; public var homeBTN:MovieClip; public var error2:MovieClip; public var register_btn:SimpleButton; private var _scoreCounter:uint; private var _tickerSpeed:Number; private var _tickerInterval:uint; private var _tickerIncrement:uint; public function GameOverMenu(){ _scoreCounter = new uint(0); _tickerSpeed = new Number(0.1); _tickerIncrement = new uint(333); super(); addFrameScript(0, frame1); this.addEventListener(Event.ADDED_TO_STAGE, onStage); this.addEventListener(Event.REMOVED_FROM_STAGE, offStage); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); addEventListener(MouseEvent.CLICK, mouseClick); init(); } private function offStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, offStage); removeEventListener(MouseEvent.CLICK, mouseClick); } private function mouseClick(_arg1:MouseEvent):void{ switch (_arg1.target.name){ case "submit_btn": if (validForm()){ SoundUtils.playSFX("SFX1"); submitScore(name_txt.text, email_txt.text, GameState.score, ((tickBox.currentFrame == 1) as Boolean), LanguageFilter.containsSwearing(name_txt.text)); dispatchEvent(new MenuTransitionEvent(MenuTransitionEvent.TRANSITION, MenuManager.CURRENT_MENU, MenuManager.HIGHSCORES_MENU, MenuTransitions.TRANSITION_BASIC_FADE)); }; break; }; } private function validForm():Boolean{ clearError(); if (((Validate.email(email_txt.text)) && (Validate.string(name_txt.text)))){ return (true); }; errorMessage.gotoAndStop(2); if (!Validate.email(email_txt.text)){ error2.gotoAndStop(2); }; if (!Validate.string(name_txt.text)){ error1.gotoAndStop(2); }; return (false); } private function clearError():void{ error1.gotoAndStop(1); error2.gotoAndStop(1); errorMessage.gotoAndStop(1); } private function init():void{ tickBox.buttonMode = true; Analytics.dispatchTrackingEvent("GameOverMenu"); homeBTN.tabChildren = false; submit_btn.tabEnabled = false; register_btn.tabEnabled = false; tickBox.tabEnabled = false; privacy_btn.tabEnabled = false; ecom_btn.tabEnabled = false; clearError(); displayScore(); introAnimation(); SoundUtils.fadeMusicStop("Music2", 0, 2); SoundUtils.fadeMusicPlay("Music1", 0.6, 2, true); GameState.destroy(); } private function introAnimation():void{ homeBTN.x = 700; homeBTN.alpha = 0; setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); TweenMax.to(homeBTN, 0.5, {delay:0.1, x:418, alpha:1}); } private function displayScore():void{ _scoreCounter = new uint(0); _tickerInterval = setInterval(updatedateTicker, _tickerSpeed); } private function updatedateTicker():void{ if ((_scoreCounter + _tickerIncrement) < GameState.score){ _scoreCounter = (_scoreCounter + _tickerIncrement); score_txt.text = _scoreCounter.toString(); } else { score_txt.text = GameState.score.toString(); clearInterval(_tickerInterval); }; } function frame1(){ stop(); } } }//package ecomExpo.menus
Section 220
//HighScoresMenu (ecomExpo.menus.HighScoresMenu) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import console.tracking.*; import console.sounds.*; import console.connection.*; import flash.utils.*; import console.scores.*; public class HighScoresMenu extends Menu { public var audioButton_mc:AudioButton; public var ecom_btn:SimpleButton; public var homeBTN:MovieClip; public var loading:MovieClip; private var _highScores:Scores; private var _highScoresData:XMLList; private var _scoreDisplay:Sprite; public function HighScoresMenu(){ addFrameScript(0, frame1); this.addEventListener(Event.ADDED_TO_STAGE, onStage); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ this.tabEnabled = false; this.tabChildren = false; Analytics.dispatchTrackingEvent("HighScoresMenu"); displayLoadingBar(); introAnimation(); } private function displayLoadingBar():void{ loading.alpha = 1; loading.mouseEnabled = true; loading.mouseChildren = true; setTimeout(loadScores, 1500); } private function introAnimation():void{ homeBTN.x = 700; homeBTN.alpha = 0; setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); TweenMax.to(homeBTN, 0.5, {delay:0.1, x:418, alpha:1}); } private function loadScores():void{ TweenMax.to(loading, 0.3, {alpha:0}); loading.mouseEnabled = false; loading.mouseChildren = false; if (((_scoreDisplay) && (_scoreDisplay.parent))){ removeChild(_scoreDisplay); }; _scoreDisplay = new Sprite(); _scoreDisplay.x = 46; _scoreDisplay.y = 103; addChild(_scoreDisplay); _highScores = new Scores(); _highScores.addEventListener(Event.COMPLETE, loadScores_success); _highScores.load(KokoAction.url_scores_weekly); } private function loadScores_success(_arg1:Event):void{ _highScores.removeEventListener(Event.COMPLETE, loadScores_success); _highScoresData = _highScores.data; displayScores(_highScoresData); } private function displayScores(_arg1:XMLList):void{ var _local2:uint; var _local3:String; var _local5:ScoreEntry; var _local7:*; var _local4:uint; var _local6:MovieClip = new MovieClip(); _local6.graphics.beginFill(8454016); _local6.graphics.drawRoundRect(37, 99, 432, 270, 12, 12); _local6.graphics.endFill(); _scoreDisplay.mask = _local6; for each (_local7 in _arg1) { _local5 = new ScoreEntry(); _local5.y = (_local4 * 26); _local5.position_txt.text = (_local4 + 1).toString(); _local5.name_txt.text = _local7.@player_name; _local5.score_txt.text = _local7.@player_score; _local5.alpha = 0; _local5.x = 100; TweenMax.to(_local5, 0.3, {alpha:1, x:0, delay:(_local4 / 10)}); _scoreDisplay.addChild(_local5); _local4++; }; } function frame1(){ stop(); } } }//package ecomExpo.menus
Section 221
//HowMenu (ecomExpo.menus.HowMenu) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import console.tracking.*; import ecomExpo.game.*; import console.sounds.*; import flash.utils.*; public class HowMenu extends Menu { public var audioButton_mc:AudioButton; public var playBTN:MovieClip; public var ecom_btn:SimpleButton; public var homeBTN:MovieClip; public var loading:MovieClip; public function HowMenu(){ this.addEventListener(Event.ADDED_TO_STAGE, onStage); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ this.tabEnabled = false; this.tabChildren = false; Analytics.dispatchTrackingEvent("HowMenu"); introAnimation(); loading.alpha = 0; loading.mouseEnabled = false; loading.mouseChildren = false; addEventListener(MouseEvent.CLICK, mouseClick); } private function mouseClick(_arg1:MouseEvent):void{ if (_arg1.target.name == "PlayHowButtonOver"){ SoundUtils.playSFX("SFX1"); TweenMax.to(loading, 0.3, {alpha:1}); loading.mouseEnabled = true; loading.mouseChildren = true; GameState.newGame(); setTimeout(playNewGame, 2000); }; } private function playNewGame():void{ dispatchEvent(new MenuTransitionEvent(MenuTransitionEvent.TRANSITION, MenuManager.CURRENT_MENU, MenuManager.GAME_MENU, MenuTransitions.TRANSITION_BASIC_FADE)); } private function introAnimation():void{ homeBTN.x = 700; homeBTN.alpha = 0; setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); TweenMax.to(homeBTN, 0.5, {delay:0.1, x:418, alpha:1}); playBTN.x = 700; playBTN.alpha = 0; setTimeout(SoundUtils.playSFX, 600, "SFX4", false, 0, 0, true); TweenMax.to(playBTN, 0.5, {delay:0.6, x:418, alpha:1}); } } }//package ecomExpo.menus
Section 222
//MainMenu (ecomExpo.menus.MainMenu) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import console.tracking.*; import console.sounds.*; import flash.utils.*; public class MainMenu extends Menu { public var audioButton_mc:AudioButton; public var ecom_btn:SimpleButton; public var scoreButton:MovieClip; public var shareButton:MovieClip; public var playButton:MovieClip; public function MainMenu(){ this.addEventListener(Event.ADDED_TO_STAGE, onStage); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ this.tabEnabled = false; this.tabChildren = false; Analytics.dispatchTrackingEvent("MainMenu"); introAnimation(); if (!SoundUtils.isMusicPlaying("Music1")){ SoundUtils.fadeMusicPlay("Music1", 1, 2, true); }; } private function introAnimation():void{ ecom_btn.x = 700; ecom_btn.alpha = 0; setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); TweenMax.to(ecom_btn, 0.5, {delay:0.1, x:513, alpha:1}); playButton.x = 700; playButton.alpha = 0; setTimeout(SoundUtils.playSFX, 400, "SFX4", false, 0, 0, true); TweenMax.to(playButton, 0.5, {delay:0.4, x:427, alpha:1}); scoreButton.x = 700; scoreButton.alpha = 0; setTimeout(SoundUtils.playSFX, 700, "SFX4", false, 0, 0, true); TweenMax.to(scoreButton, 0.5, {delay:0.7, x:427, alpha:1}); shareButton.x = 700; shareButton.alpha = 0; setTimeout(SoundUtils.playSFX, 1000, "SFX4", false, 0, 0, true); TweenMax.to(shareButton, 0.5, {delay:1, x:427, alpha:1}); } } }//package ecomExpo.menus
Section 223
//Menu (ecomExpo.menus.Menu) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import console.tracking.*; import com.stampy.services.*; import console.sounds.*; import console.connection.*; import console.security.*; import console.loadurl.*; import flash.utils.*; public class Menu extends MovieClip { private var _menuAssets:MovieClip; public function Menu(){ deactivate(); this.alpha = 0; addEventListener(Event.ADDED_TO_STAGE, onStage); addEventListener(Event.REMOVED_FROM_STAGE, offStage); } public function activate():void{ this.mouseChildren = true; dispatchEvent(new Event(MenuEvent.ACTIVE)); } public function deactivate():void{ this.mouseChildren = false; this.mouseEnabled = false; dispatchEvent(new Event(MenuEvent.INACTIVE)); } public function hide(_arg1:String):void{ switch (_arg1){ case MenuTransitions.TRANSITION_BASIC_FADE: TweenMax.to(this, 0.5, {alpha:0, onComplete:hideComplete}); break; case MenuTransitions.TRANSITION_INSTANT_SWAP: hideComplete(); break; }; } public function show(_arg1:String):void{ switch (_arg1){ case MenuTransitions.TRANSITION_BASIC_FADE: TweenMax.to(this, 0.5, {alpha:1, onComplete:showComplete}); break; case MenuTransitions.TRANSITION_INSTANT_SWAP: this.alpha = 1; showComplete(); break; }; } public function destroy():void{ } public function submitScore(_arg1:String, _arg2:String, _arg3:uint, _arg4:Boolean, _arg5:Boolean){ var _local6:PHP_Service = new PHP_Service(KokoAction.url_php); _local6.debug = true; _local6.addVariable("action", KokoAction.ACTION_SUBMIT_SCORES); _local6.addVariable(KokoAction.var_token, Token.encypted); _local6.addVariable(KokoAction.var_score, _arg3); _local6.addVariable(KokoAction.var_secureScore, Token.secret(_arg3)); _local6.addVariable(KokoAction.var_fullName, _arg1); _local6.addVariable(KokoAction.var_email, _arg2); _local6.addVariable(KokoAction.var_optIn, new uint(_arg4)); _local6.addVariable(KokoAction.var_swearFlag, new uint(_arg5)); _local6.addEventListener(PHPEvent.DATA_RECIEVED, submitScore_success); _local6.addEventListener(PHPEvent.DATA_FAILED, submitScore_fail); _local6.send(); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); addEventListener(MouseEvent.CLICK, mouseClick); addEventListener(MouseEvent.MOUSE_OVER, mouseOver); addEventListener(MouseEvent.MOUSE_OUT, mouseOut); activate(); } private function offStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, offStage); removeEventListener(MouseEvent.CLICK, mouseClick); removeEventListener(MouseEvent.MOUSE_OVER, mouseOver); removeEventListener(MouseEvent.MOUSE_OUT, mouseOut); deactivate(); } private function submitScore_fail(_arg1:PHPEvent):void{ } private function submitScore_success(_arg1:PHPEvent):void{ } private function mouseOut(_arg1:MouseEvent):void{ switch (_arg1.target.name){ case "ecom_btn": TweenMax.to(_arg1.target, 0.3, {x:513}); break; }; } private function mouseOver(_arg1:MouseEvent):void{ switch (_arg1.target.name){ case "ecom_btn": TweenMax.to(_arg1.target, 0.3, {x:483}); break; case "HighScoreButtonOver": case "PlayGameButtonOver": case "PlayButtonOver": setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); hideAllButtons(_arg1.target.parent, true); TweenMax.to(_arg1.target.parent, 0.3, {x:-30}); _arg1.target.parent.gotoAndStop(2); break; case "HighScoreButtonOut": case "PlayGameButtonOut": case "PlayButtonOut": setTimeout(SoundUtils.playSFX, 100, "SFX5", false, 0, 0, true); hideAllButtons(_arg1.target.parent); break; case "shareButtonOver": setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); hideAllButtons(_arg1.target.parent, true); TweenMax.to(_arg1.target.parent, 0.3, {x:-200}); TweenMax.to(_arg1.target.parent.socialButtons, 0.3, {alpha:1}); _arg1.target.parent.gotoAndStop(2); break; case "shareButtonOut": hideAllButtons(_arg1.target.parent); break; case "twitter": case "facebook": case "linkedin": case "myspace": case "delicious": case "digg": case "stumble": break; case "PlayHowButtonOver": case "HomeButtonOver": setTimeout(SoundUtils.playSFX, 100, "SFX4", false, 0, 0, true); TweenMax.to(_arg1.target.parent, 0.3, {x:-30}); _arg1.target.parent.gotoAndStop(2); break; case "PlayHowButtonOut": case "HomeButtonOut": setTimeout(SoundUtils.playSFX, 100, "SFX5", false, 0, 0, true); TweenMax.to(_arg1.target.parent, 0.3, {x:0}); _arg1.target.parent.gotoAndStop(1); break; }; } private function hideAllButtons(_arg1, _arg2:Boolean=false){ if (((((_arg2) && (!((_arg1.parent.parent.name == "playButton"))))) || (!(_arg2)))){ TweenMax.to(_arg1.parent.parent.playButton.PlayGame, 0.3, {x:0}); _arg1.parent.parent.playButton.PlayGame.gotoAndStop(1); }; if (((((_arg2) && (!((_arg1.parent.parent.name == "scoreButton"))))) || (!(_arg2)))){ TweenMax.to(_arg1.parent.parent.scoreButton.HighScores, 0.3, {x:0}); _arg1.parent.parent.scoreButton.HighScores.gotoAndStop(1); }; if (((((_arg2) && (!((_arg1.parent.parent.name == "shareButton"))))) || (!(_arg2)))){ TweenMax.to(_arg1.parent.parent.shareButton.MenuButtonShare, 0.3, {x:0}); TweenMax.to(_arg1.parent.parent.shareButton.MenuButtonShare.socialButtons, 0.3, {alpha:0}); _arg1.parent.parent.shareButton.MenuButtonShare.gotoAndStop(1); }; } private function mouseClick(_arg1:MouseEvent):void{ switch (_arg1.target.name){ case "tickBox": if (_arg1.target.currentFrame == 1){ _arg1.target.gotoAndStop(2); } else { _arg1.target.gotoAndStop(1); }; break; case "HighScoreButtonOver": dispatchEvent(new MenuTransitionEvent(MenuTransitionEvent.TRANSITION, MenuManager.CURRENT_MENU, MenuManager.HIGHSCORES_MENU, MenuTransitions.TRANSITION_BASIC_FADE)); break; case "PlayGameButtonOver": dispatchEvent(new MenuTransitionEvent(MenuTransitionEvent.TRANSITION, MenuManager.CURRENT_MENU, MenuManager.HOW_TO_PLAY_MENU, MenuTransitions.TRANSITION_BASIC_FADE)); break; case "HomeButtonOver": dispatchEvent(new MenuTransitionEvent(MenuTransitionEvent.TRANSITION, MenuManager.CURRENT_MENU, MenuManager.MAIN_MENU, MenuTransitions.TRANSITION_BASIC_FADE)); break; case "socialButtons": break; case "ecom_btn": Analytics.dispatchTrackingEvent("LinkClient"); OpenURL.navigateURL(KokoAction.url_link_client1); break; case "audio_on": _arg1.target.parent.gotoAndStop(1); SoundUtils.muteGlobal(); break; case "audio_off": _arg1.target.parent.gotoAndStop(2); SoundUtils.muteGlobal(); break; case "twitter": OpenURL.navigateURL(KokoAction.url_social_twitter); break; case "facebook": OpenURL.navigateURL(KokoAction.url_social_facebook); break; case "linkedin": OpenURL.navigateURL(KokoAction.url_social_linkedin); break; case "myspace": OpenURL.navigateURL(KokoAction.url_social_myspace); break; case "delicious": OpenURL.navigateURL(KokoAction.url_social_delicious); break; case "digg": OpenURL.navigateURL(KokoAction.url_social_digg); break; case "stumble": OpenURL.navigateURL(KokoAction.url_social_stumbleupon); break; case "register_btn": Analytics.dispatchTrackingEvent("LinkClient"); OpenURL.navigateURL(KokoAction.url_link_client2); break; case "privacy_btn": Analytics.dispatchTrackingEvent("LinkPrivacy"); OpenURL.navigateURL(KokoAction.url_link_privacy); break; default: return; }; SoundUtils.playSFX("SFX1"); } private function hideComplete():void{ dispatchEvent(new MenuEvent(MenuEvent.HIDDEN)); } private function showComplete():void{ dispatchEvent(new MenuEvent(MenuEvent.VISIBLE)); } } }//package ecomExpo.menus
Section 224
//MenuBackground (ecomExpo.menus.MenuBackground) package ecomExpo.menus { import flash.events.*; import flash.display.*; import console.connection.*; public class MenuBackground extends MovieClip { private var _kokoButton:DynamicButton; public function MenuBackground(){ this.addEventListener(Event.ADDED_TO_STAGE, onStage); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ this.tabEnabled = false; this.tabChildren = false; _kokoButton = new DynamicButton(KokoAction.url_dynamic_button1, DynamicButton.REGISTRATION_POINT_BOTTOMLEFT, []); _kokoButton.name = "koko_btn"; _kokoButton.x = 9; _kokoButton.y = (417 + 26); addChild(_kokoButton); } } }//package ecomExpo.menus
Section 225
//MenuEvent (ecomExpo.menus.MenuEvent) package ecomExpo.menus { import flash.events.*; public class MenuEvent extends Event { public static const HIDDEN:String = "hidden"; public static const VISIBLE:String = "visible"; public static const ACTIVE:String = "active"; public static const INACTIVE:String = "inactive"; public function MenuEvent(_arg1):void{ super(_arg1); } override public function clone():Event{ return (new MenuEvent(type)); } } }//package ecomExpo.menus
Section 226
//MenuManager (ecomExpo.menus.MenuManager) package ecomExpo.menus { import flash.events.*; import flash.display.*; import console.strings.*; import flash.utils.*; public class MenuManager extends MovieClip { private var _menus:Dictionary; private var _transitioningIn:Boolean; private var _transitioningOut:Boolean; public static const MAIN_MENU:String = "MainMenu"; public static const GAME_OVER_MENU:String = "GameOverMenu"; public static const HIGHSCORES_MENU:String = "HighScoresMenu"; public static const HOW_TO_PLAY_MENU:String = "HowMenu"; public static const GAME_MENU:String = "GameMenu"; public static const PRELOAD_MENU:String = "PreloaderMenu"; private static const MENU_PACKAGE:String = "ecomExpo.menus."; public static var PREVIOUS_MENU:String = ""; public static var CURRENT_MENU:String = ""; public function MenuManager(){ _transitioningIn = false; _transitioningOut = false; super(); _menus = new Dictionary(true); addEventListener(Event.ADDED_TO_STAGE, onStage); } public function get previousMenu():String{ return (PREVIOUS_MENU); } public function get currentMenu():String{ return (CURRENT_MENU); } public function showMenu(_arg1:String, _arg2:String):void{ var _local3:Class; if (_menus[_arg1] == null){ _local3 = (getDefinitionByName((MENU_PACKAGE + _arg1)) as Class); _menus[_arg1] = new (_local3); _menus[_arg1].addEventListener(MenuEvent.HIDDEN, menuHidden); _menus[_arg1].addEventListener(MenuEvent.VISIBLE, menuVisible); _menus[_arg1].addEventListener(MenuTransitionEvent.TRANSITION, menuTransition); CURRENT_MENU = _arg1; addChild(_menus[_arg1]); _menus[_arg1].show(_arg2); _transitioningIn = true; }; } public function hideMenu(_arg1:String, _arg2:String):void{ if (_menus[_arg1]){ _menus[_arg1].hide(_arg2); PREVIOUS_MENU = _arg1; _transitioningOut = true; }; } public function transition(_arg1:String, _arg2:String, _arg3:String):void{ if (_arg1 == CURRENT_MENU){ return; }; hideMenu(_arg2, _arg3); showMenu(_arg1, _arg3); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ } private function menuTransition(_arg1:MenuTransitionEvent):void{ transition(_arg1.menuToo, _arg1.menuFrom, _arg1.menuTransition); } private function menuHidden(_arg1:MenuEvent):void{ _menus[getMenuName(_arg1.target)].removeEventListener(MenuEvent.HIDDEN, menuHidden); removeMenu(getMenuName(_arg1.target)); _transitioningOut = false; } private function getMenuName(_arg1):String{ return (StringUtils.afterLast(getQualifiedClassName(_arg1), ":")); } private function menuVisible(_arg1:MenuEvent):void{ _menus[getMenuName(_arg1.target)].removeEventListener(MenuEvent.VISIBLE, menuVisible); _transitioningIn = false; } private function removeMenu(_arg1:String):void{ if (_menus[_arg1] == null){ return; }; if (_menus[_arg1].parent){ _menus[_arg1].parent.removeChild(_menus[_arg1]); }; _menus[_arg1] = null; } } }//package ecomExpo.menus
Section 227
//MenuTransitionEvent (ecomExpo.menus.MenuTransitionEvent) package ecomExpo.menus { import flash.events.*; public class MenuTransitionEvent extends Event { private var _menuFrom:String; private var _menuToo:String; private var _menuTransition:String; public static const TRANSITION:String = "transition"; public function MenuTransitionEvent(_arg1:String, _arg2:String, _arg3:String, _arg4:String):void{ _menuFrom = _arg2; _menuToo = _arg3; _menuTransition = _arg4; super(_arg1); } override public function clone():Event{ return (new MenuTransitionEvent(type, _menuFrom, _menuToo, _menuTransition)); } public function get menuFrom():String{ return (_menuFrom); } public function get menuToo():String{ return (_menuToo); } public function get menuTransition():String{ return (_menuTransition); } } }//package ecomExpo.menus
Section 228
//MenuTransitions (ecomExpo.menus.MenuTransitions) package ecomExpo.menus { public class MenuTransitions { public static const TRANSITION_BASIC_FADE:String = "transitionBasicFade"; public static const TRANSITION_INSTANT_SWAP:String = "transitionInstantSwap"; } }//package ecomExpo.menus
Section 229
//PreloaderMenu (ecomExpo.menus.PreloaderMenu) package ecomExpo.menus { import flash.events.*; import flash.display.*; import com.greensock.*; import console.events.*; import flash.utils.*; public class PreloaderMenu extends Menu { public var audioButton_mc:AudioButton; public var loadingBar:MovieClip; private var _bytesTotal:Number; private var _bytesLoaded:Number; private var _percentLoaded:int; public function PreloaderMenu(){ this.addEventListener(Event.ADDED_TO_STAGE, onStage); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ this.tabEnabled = false; this.tabChildren = false; hideSegments(); stage.addEventListener(Event.ENTER_FRAME, preloading); } private function hideSegments():void{ var _local1 = 1; while (_local1 <= 10) { loadingBar[("segment" + _local1)].alpha = 0; _local1++; }; } private function preloading(_arg1:Event):void{ _bytesTotal = stage.loaderInfo.bytesTotal; _bytesLoaded = stage.loaderInfo.bytesLoaded; _percentLoaded = Math.ceil((_bytesLoaded * (100 / _bytesTotal))); var _local2:* = Math.ceil((_percentLoaded / 10)); var _local3 = 1; while (_local3 <= _local2) { if (loadingBar[("segment" + _local3)].alpha == 0){ TweenMax.to(loadingBar[("segment" + _local3)], 0.3, {alpha:1}); }; _local3++; }; if (_percentLoaded == 100){ stage.removeEventListener(Event.ENTER_FRAME, preloading); preloadComplete(); }; } private function preloadComplete():void{ StaticEventDispatch.dispatchEvent(new Event(Event.COMPLETE)); TweenMax.to(loadingBar, 0.5, {x:-240}); setTimeout(showMainMenu, 500); } private function showMainMenu():void{ dispatchEvent(new MenuTransitionEvent(MenuTransitionEvent.TRANSITION, MenuManager.CURRENT_MENU, MenuManager.MAIN_MENU, MenuTransitions.TRANSITION_INSTANT_SWAP)); } } }//package ecomExpo.menus
Section 230
//TickBox (ecomExpo.menus.TickBox) package ecomExpo.menus { import flash.events.*; import flash.display.*; public class TickBox extends MovieClip { private var _selected:Boolean; public function TickBox(){ _selected = true; super(); addFrameScript(0, frame1); addEventListener(Event.ADDED_TO_STAGE, onStage); } public function get selected():Boolean{ return (_selected); } public function set selected(_arg1:Boolean):void{ _selected = _arg1; if (_selected){ this.gotoAndStop(1); } else { this.gotoAndStop(2); }; } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); init(); } private function init():void{ update(); } private function update():void{ _selected = ((this.currentFrame == 1) as Boolean); } function frame1(){ stop(); } } }//package ecomExpo.menus
Section 231
//AIDriver (ecomExpo.racingEngine.AIDriver) package ecomExpo.racingEngine { import flash.geom.*; import console.math.*; public class AIDriver { private const ARENA_DIAMTER = 2356; private const PNT_ARENA_MIDDLE:Point; private const AI_DRIVER_RESPONSE:uint = 400; private var _pntTarget; private var _targetCar:Car; private var _driverResponseCount; private var _car:Car; private var _playersCar:Car; private var _isDriverRecovering:Boolean; private var _driverRecoverTime:uint; public static var arrCars:Array = new Array(); private static var _isPaused:Boolean = true; public function AIDriver(_arg1, _arg2){ PNT_ARENA_MIDDLE = new Point(1400, 1400); _driverResponseCount = 0; _isDriverRecovering = false; _driverRecoverTime = 0; super(); _car = _arg1; _playersCar = _arg2; createRandomTarget(); } public function controlDecisions(){ var _local1:*; var _local2:*; var _local3:*; var _local4:*; var _local5:*; if (!_isPaused){ if (_targetCar != null){ _pntTarget = new Point(_targetCar.x, _targetCar.y); }; _local1 = new Point(_car.x, _car.y); _local2 = Trig.findAngle(_local1.x, _local1.y, _pntTarget.x, _pntTarget.y); _local3 = (Trig.convertToDegree(_local2) + 180); _local4 = Trig.shortRotation(_local3, _car.rotation); _local5 = Trig.distanceBetweenPoints(_pntTarget, _local1); if (_local4 > 120){ _car.reverse(); } else { _car.accelerate(); }; _car.accelerate(); if (_local4 > 5){ if (_local3 < (_car.rotation % 360)){ _car.steerLeft(); } else { _car.steerRight(); }; }; if (_local5 < 200){ createRandomTarget(); }; }; } private function createRandomTarget():void{ var _local1:*; var _local2:*; var _local3:*; var _local4:uint; if (Math.random() < 0.5){ _local1 = (Math.ceil((Math.random() * (ARENA_DIAMTER / 2))) - 200); _local2 = Trig.convertToRadian(((Math.random() * 360) - 180)); _pntTarget = Trig.findNewXY(PNT_ARENA_MIDDLE.x, PNT_ARENA_MIDDLE.y, _local2, _local1); _targetCar = null; } else { _local3 = arrCars.length; _local4 = (Math.ceil((Math.random() * _local3)) - 1); while (arrCars[_local4] == this) { _local4 = (Math.ceil((Math.random() * _local3)) - 1); }; _targetCar = arrCars[_local4]; }; } public static function set isPaused(_arg1):void{ _isPaused = _arg1; } } }//package ecomExpo.racingEngine
Section 232
//BitmapAnimations (ecomExpo.racingEngine.BitmapAnimations) package ecomExpo.racingEngine { import flash.display.*; import console.bitmapAnimation.*; public class BitmapAnimations { private var _arrSmokeAnimation:Array; private var _smokeBitmapAnimation:BitmapData; private var _arrSparkAnimation1:Array; private var _arrSparkAnimation2:Array; private var _arrSparkAnimation3:Array; private var _arrSparkAnimation4:Array; private var _sparkBitmapAnimation1:BitmapData; private var _sparkBitmapAnimation2:BitmapData; private var _sparkBitmapAnimation3:BitmapData; private var _sparkBitmapAnimation4:BitmapData; public function BitmapAnimations(){ _arrSmokeAnimation = new Array(); _arrSparkAnimation1 = new Array(); _arrSparkAnimation2 = new Array(); _arrSparkAnimation3 = new Array(); _arrSparkAnimation4 = new Array(); super(); _sparkBitmapAnimation1 = new SparkSpriteSheet(0, 0); _arrSparkAnimation1 = BitmapSequenceBuilder.sequence(_sparkBitmapAnimation1, 52, 32, 4); _sparkBitmapAnimation2 = new SparkSpriteSheet1(0, 0); _arrSparkAnimation2 = BitmapSequenceBuilder.sequence(_sparkBitmapAnimation2, 52, 32, 4); _sparkBitmapAnimation3 = new SparkSpriteSheet2(0, 0); _arrSparkAnimation3 = BitmapSequenceBuilder.sequence(_sparkBitmapAnimation3, 52, 32, 4); _sparkBitmapAnimation4 = new SparkSpriteSheet3(0, 0); _arrSparkAnimation4 = BitmapSequenceBuilder.sequence(_sparkBitmapAnimation4, 52, 32, 4); } public function get sparkAnimation1():Array{ return (_arrSparkAnimation1); } public function get sparkAnimation2():Array{ return (_arrSparkAnimation2); } public function get sparkAnimation3():Array{ return (_arrSparkAnimation3); } public function get sparkAnimation4():Array{ return (_arrSparkAnimation4); } } }//package ecomExpo.racingEngine
Section 233
//BitmapCamera (ecomExpo.racingEngine.BitmapCamera) package ecomExpo.racingEngine { import flash.events.*; import flash.display.*; import flash.geom.*; import console.events.*; public class BitmapCamera extends Sprite { private var _intFrameWidth:uint; private var _intFrameHeight:uint; private var _rectFrame:Rectangle; private var _rectBoundary:Rectangle; private var _isBoundarySet:Boolean; private var _intX; private var _intY; private var _intZ; private var _pntCameraMiddle:Point; private var _bmpCameraData:BitmapData; private var _bmpCamera:Bitmap; private var _bitmapWorld:BitmapWorld; public function BitmapCamera(_arg1:uint, _arg2:uint, _arg3:BitmapWorld){ _isBoundarySet = false; _intX = 0; _intY = 0; _intZ = 0; super(); _intFrameWidth = _arg1; _intFrameHeight = _arg2; _rectFrame = new Rectangle(0, 0, _arg1, _arg2); _pntCameraMiddle = new Point((_intFrameWidth / 2), (_intFrameHeight / 2)); _bmpCameraData = new BitmapData(_arg1, _arg2); _bmpCamera = new Bitmap(_bmpCameraData); addChild(_bmpCamera); _bitmapWorld = _arg3; } public function setupBoundary(_arg1, _arg2){ var _local3:* = (_arg1 - _intFrameWidth); var _local4:* = (_arg2 - _intFrameWidth); _rectBoundary = new Rectangle(0, 0, _local3, _local4); _isBoundarySet = true; } public function disableBoundary(){ _isBoundarySet = false; } public function set xPos(_arg1):void{ _intX = (_arg1 - _pntCameraMiddle.x); if (_isBoundarySet){ if (_intX > _rectBoundary.width){ _intX = _rectBoundary.width; } else { if (_intX < 0){ _intX = 0; }; }; }; } public function set yPos(_arg1):void{ _intY = (_arg1 - _pntCameraMiddle.y); if (_isBoundarySet){ if (_intY > _rectBoundary.height){ _intY = _rectBoundary.height; } else { if (_intY < 0){ _intY = 0; }; }; }; } public function set zoom(_arg1):void{ _intZ = _arg1; } public function play(){ addEventListener(Event.ENTER_FRAME, renderFrame); } public function stop(){ removeEventListener(Event.ENTER_FRAME, renderFrame); } private function renderFrame(_arg1:Event){ var _local5:Rectangle; var _local7:Matrix; var _local8:BitmapData; StaticEventDispatch.dispatchEvent(new CameraEvent(CameraEvent.BEGIN_CAMERA_RENDER)); var _local2:* = 1; if (_intZ < 1){ _local2 = _intZ; }; var _local3:* = (_intFrameWidth / _local2); var _local4:* = (_intFrameHeight / _local2); if ((((_local3 > 2800)) || ((_local4 > 2800)))){ _local5 = new Rectangle(_intX, _intY, 2800, 2800); } else { _local5 = new Rectangle(_intX, _intY, _local3, _local4); }; var _local6:BitmapData = _bitmapWorld.renderScene(_local5); if (_intZ != 1){ _local7 = controlZoom(_local6); _local8 = new BitmapData(_intFrameWidth, _intFrameHeight, true, 0); _local8.draw(_local6, _local7, null, null, null, true); _bmpCameraData.copyPixels(_local8, _rectFrame, new Point()); } else { _bmpCameraData.copyPixels(_local6, _rectFrame, new Point()); }; StaticEventDispatch.dispatchEvent(new CameraEvent(CameraEvent.CAMERA_UPDATED)); } private function controlZoom(_arg1):Matrix{ var _local2:Number = (_arg1.width / 2); var _local3:Number = (_arg1.height / 2); var _local4:Matrix = new Matrix(); _local4.translate(-(_local2), -(_local3)); _local4.scale(_intZ, _intZ); _local4.translate(_local2, _local3); return (_local4); } } }//package ecomExpo.racingEngine
Section 234
//BitmapSprite (ecomExpo.racingEngine.BitmapSprite) package ecomExpo.racingEngine { import flash.display.*; import flash.geom.*; import console.math.*; public class BitmapSprite { private var _bmpData:BitmapData; private var _rect:Rectangle; private var _rectDraw:Rectangle; private var _x:int; private var _y:int; private var _matrixTransform:Matrix; private var _scaleX:Number; private var _scaleY:Number; private var _rotation:Number; private var _transformationPoint:Point; public function BitmapSprite(_arg1:BitmapData, _arg2:Rectangle=null){ _matrixTransform = new Matrix(); _scaleX = 1; _scaleY = 1; _rotation = 0; _transformationPoint = new Point(0, 0); super(); _bmpData = _arg1; _rect = (_rectDraw = _arg1.rect); if (_arg2 != null){ _rect = (_rectDraw = _arg2); }; } private function setMatrix(){ _matrixTransform = new Matrix(); _matrixTransform.translate(-(_transformationPoint.x), -(_transformationPoint.y)); _matrixTransform.scale(_scaleX, _scaleY); _matrixTransform.rotate(Trig.convertToRadian(_rotation)); _matrixTransform.translate(_transformationPoint.x, _transformationPoint.y); } public function getRect():Rectangle{ var _local1:Rectangle = _rectDraw; _local1.x = (_x - _transformationPoint.x); _local1.y = (_y - _transformationPoint.y); return (_local1); } public function get bitmapData():BitmapData{ var _local1:Rectangle; var _local2:BitmapData; var _local3:BitmapData; if ((((((_scaleX == 1)) && ((_scaleY == 1)))) && ((_rotation == 0)))){ _rectDraw = _rect; return (_bmpData); }; setMatrix(); _local1 = new Rectangle(0, 0, _rect.width, _rect.height); _local2 = new BitmapData(_rect.width, _rect.height, true, 0); _local2.copyPixels(_bmpData, _local1, new Point(), null, null, true); _local3 = new BitmapData(_rect.width, _rect.height, true, 0); _local3.draw(_local2, _matrixTransform, null, null, null, true); _rectDraw = _local3.rect; return (_local3); } public function set x(_arg1:int):void{ _x = (_arg1 - _transformationPoint.x); } public function set y(_arg1:int):void{ _y = (_arg1 - _transformationPoint.y); } public function set scaleX(_arg1:Number):void{ _scaleX = _arg1; } public function set scaleY(_arg1:Number):void{ _scaleY = _arg1; } public function set rotation(_arg1:Number):void{ _rotation = _arg1; } public function set transformationPoint(_arg1:Point):void{ _transformationPoint = _arg1; } public function set rect(_arg1:Rectangle):void{ _rect = _arg1; _rectDraw = _arg1; } public function set bitmapData(_arg1:BitmapData):void{ _bmpData = _arg1; } public function get x():int{ return ((_x + _transformationPoint.x)); } public function get y():int{ return ((_y + _transformationPoint.y)); } public function get scaleX():Number{ return (_scaleX); } public function get scaleY():Number{ return (_scaleY); } public function get rotation():Number{ return (_rotation); } public function get transformationPoint():Point{ return (_transformationPoint); } public function get rect():Rectangle{ return (_rectDraw); } } }//package ecomExpo.racingEngine
Section 235
//BitmapWorld (ecomExpo.racingEngine.BitmapWorld) package ecomExpo.racingEngine { import flash.display.*; import flash.geom.*; import console.bitmapAnimation.*; public class BitmapWorld { private var _bmpWorldData:BitmapData; private var _arrBitmapSprites:Array; public function BitmapWorld(_arg1, _arg2){ _arrBitmapSprites = new Array(); } public function addChild(_arg1){ _arrBitmapSprites.push(_arg1); } public function addChildAt(_arg1, _arg2:uint){ _arrBitmapSprites.splice(_arg2, 0, _arg1); } public function getChildAt(_arg1){ return (_arrBitmapSprites[_arg1]); } public function get numChildren():uint{ return (_arrBitmapSprites.length); } public function removeChild(_arg1){ var _local4:*; var _local2:uint = this.numChildren; var _local3:int; while (_local3 < _local2) { _local4 = this.getChildAt(_local3); if (_local4 == _arg1){ _arrBitmapSprites.splice(_local3, 1); }; _local3++; }; } public function destroy():void{ _arrBitmapSprites = []; _bmpWorldData.dispose(); _bmpWorldData = null; } public function renderScene(_arg1:Rectangle):BitmapData{ var _local5:*; var _local6:Rectangle; var _local7:Rectangle; var _local8:*; var _local9:*; var _local10:*; var _local11:Matrix; var _local12:BitmapSequence; var _local13:int; if ((((_arg1.width > 2800)) || ((_arg1.height > 2800)))){ _bmpWorldData = new BitmapData(2800, 2800, true, 0); }; _bmpWorldData = new BitmapData(_arg1.width, _arg1.height, true, 0); var _local2:uint = this.numChildren; var _local3:Array = new Array(); var _local4:int; while (_local4 < _local2) { _local5 = this.getChildAt(_local4); _local6 = null; if ((_local5 is BitmapSprite)){ _local6 = _local5.getRect(); } else { _local6 = _local5.getRect(new Sprite()); }; if (_local6.intersects(_arg1)){ _local7 = _local6.intersection(_arg1); _local8 = (_local7.x - _arg1.x); _local9 = (_local7.y - _arg1.y); _local10 = new Point(_local8, _local9); _local7.x = (_local7.x - _local5.x); _local7.y = (_local7.y - _local5.y); if ((((((_local5 is BitmapSprite)) || ((_local5 is Bitmap)))) || ((_local5 is BitmapSequence)))){ if ((_local5 is BitmapSequence)){ _local7.width = _local5.bitmapData.rect.width; _local7.height = _local5.bitmapData.rect.height; }; _bmpWorldData.copyPixels(_local5.bitmapData, _local7, _local10, null, null, true); } else { _local8 = (_local5.x - _arg1.x); _local9 = (_local5.y - _arg1.y); _local10 = new Point(_local8, _local9); _local11 = _local5.transform.matrix; _local11.tx = _local10.x; _local11.ty = _local10.y; _bmpWorldData.draw(_local5, _local11); }; }; if ((_local5 is BitmapSequence)){ _local12 = _local5; if (((_local12.isRemovedAtEnd) && (!(_local12.isPlaying)))){ _local3.push(_local5); }; }; _local4++; }; if (_local3.length > 1){ _local13 = 0; while (_local13 < _local3.length) { removeChild(_local3[_local13]); _local13++; }; }; return (_bmpWorldData); } } }//package ecomExpo.racingEngine
Section 236
//Box2DCollision (ecomExpo.racingEngine.Box2DCollision) package ecomExpo.racingEngine { import Box2D.Collision.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Contacts.*; import ecomExpo.game.*; import console.sounds.*; import console.events.*; import com.stampy.global.*; import flash.utils.*; import console.bitmapAnimation.*; public class Box2DCollision extends b2ContactListener { private const BOX2D_SCALE_FACTOR = 30; private var _collectedBodys:Array; private var _isPlaying:Boolean; private static var _arrRemoveCollectables:Array = new Array(); public function Box2DCollision(){ _collectedBodys = []; _isPlaying = false; super(); } override public function Add(_arg1:b2ContactPoint):void{ var _local2:b2Body; if (((_arg1.shape1.IsSensor()) || (_arg1.shape2.IsSensor()))){ if (_arg1.shape1.IsSensor()){ _local2 = _arg1.shape1.GetBody(); } else { _local2 = _arg1.shape2.GetBody(); }; if (_collectedBodys.lastIndexOf(_local2) == -1){ StaticEventDispatch.dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION, "")); _local2.GetUserData().collect(); _collectedBodys.push(_local2); _arrRemoveCollectables.push(_local2); }; }; } override public function Persist(_arg1:b2ContactPoint):void{ } override public function Remove(_arg1:b2ContactPoint):void{ } override public function Result(_arg1:b2ContactResult):void{ var _local2:* = _arg1.shape1.GetBody().GetUserData(); var _local3:* = _arg1.shape2.GetBody().GetUserData(); var _local4:* = _arg1.normalImpulse; if (_local2 != null){ _local2.damage = (_local2.damage + _local4); }; if (_local3 != null){ _local3.damage = (_local3.damage + _local4); }; var _local5:* = (_arg1.position.x * BOX2D_SCALE_FACTOR); var _local6:* = (_arg1.position.y * BOX2D_SCALE_FACTOR); var _local7:* = Math.ceil((Math.random() * 4)); var _local8:BitmapSequence = new BitmapSequence(Global.vars.bitmapAnimations[("sparkAnimation" + _local7)], 10); _local8.x = (_local5 - 26); _local8.y = (_local6 - 16); _local8.playOnce(true); Global.vars.worldRenderer.addSprite(_local8); playRandomCollisionSound(); } public function playRandomCollisionSound(){ if (_isPlaying){ return; }; _isPlaying = true; var _local1:Array = ["SFX_CRASH1", "SFX_CRASH2", "SFX_CRASH3", "SFX7", "SFX8"]; var _local2:* = (Math.ceil((Math.random() * _local1.length)) - 1); if (!SoundUtils.isSFXPlaying(_local1[_local2])){ SoundUtils.playSFX(_local1[_local2]); }; setTimeout(endPlaying, 100); } private function endPlaying():void{ _isPlaying = false; } public static function get arrBodyRemoval():Array{ var _local1:* = _arrRemoveCollectables.concat(); _arrRemoveCollectables = new Array(); return (_local1); } } }//package ecomExpo.racingEngine
Section 237
//Car (ecomExpo.racingEngine.Car) package ecomExpo.racingEngine { import Box2D.Dynamics.*; import flash.events.*; import flash.display.*; import flash.geom.*; import com.greensock.*; import ecomExpo.game.*; import console.math.*; public class Car { public var _intID:uint; private var _carMC:MovieClip; private var _shadow_mc:MovieClip; private var _wheel1_mc:MovieClip; private var _wheel2_mc:MovieClip; private var _wheel3_mc:MovieClip; private var _wheel4_mc:MovieClip; private var _body:MovieClip; private var _intWidth:Number; private var _intLength:Number; private var _intFrontMass:Number; private var _intRearMass:Number; private var _intSteeringAngle:Number; private var _intSteeringAngleTarget:Number; private var _intSteeringAngleMax:Number; private var _intSteeringAcceleration:Number; private var _isSteeringIdle:Boolean; private var _intSteeringForce:Number; private var _intSidewaysTraction:Number; private var _intEngineForceMax:Number; private var _intEngineForceAcceleration:Number; private var _intEngineForceCurrent:Number; private var _engineStatus:int; private var _strWheelDrive; private var _userDriver:Driver; private var _aiDriver:AIDriver; private var _carBox2D:CarBox2D; private var _intSmokeCount:uint; private var _isSmokeShown:Boolean; private var _maxDamage; private var _character:Character; public static var _numberOfCars:uint = 0; public function Car(){ _intID = 0; _intSteeringAngle = 0; _intSteeringAngleTarget = 0; _intSteeringAngleMax = 45; _intSteeringAcceleration = 10; _isSteeringIdle = true; _intSteeringForce = 0.3; _intSidewaysTraction = 0; _intEngineForceMax = 400; _intEngineForceAcceleration = 60; _intEngineForceCurrent = 0; _engineStatus = 0; _strWheelDrive = CarBox2D.FRONT_WHEEL_DRIVE; _userDriver = null; _aiDriver = null; _carBox2D = null; _intSmokeCount = 0; _isSmokeShown = false; _maxDamage = 2000; super(); init(); } private function init():void{ _numberOfCars++; _intID = _numberOfCars; _carMC = new MovieClip(); _intWidth = 16; _intLength = 46; _intFrontMass = 30; _intRearMass = 30; _strWheelDrive = CarBox2D.FRONT_WHEEL_DRIVE; _intEngineForceMax = 900; _intSidewaysTraction = 1; _shadow_mc = new TrollyShadow(); _shadow_mc.alpha = 0.5; _carMC.addChildAt(_shadow_mc, 0); _body = new MovieClip(); _carMC.addChild(_body); _character = new Character(); GameState.character = _character; _carMC.addChild(_character); StageReference.getStage().addEventListener(KeyboardEvent.KEY_DOWN, keydown); } private function keydown(_arg1:KeyboardEvent):void{ if (String.fromCharCode(_arg1.keyCode) == "M"){ if ((((_carMC.x > 0)) && ((_carMC.y > 0)))){ }; }; } private function updateArrowRotation():void{ var _local1:* = (_character.arrowX - GameState.bonusX); var _local2:* = (_character.arrowY - GameState.bonusY); var _local3:* = Math.atan2(_local2, _local1); if ((((GameState.bonusY == 0)) && ((GameState.bonusX == 0)))){ TweenMax.to(_character.arrow, 0.3, {alpha:0}); } else { TweenMax.to(_character.arrow, 0.3, {alpha:1}); _character.arrowRotation = (((Math.atan2((GameState.bonusY - _carMC.y), (GameState.bonusX - _carMC.x)) * 180) / Math.PI) - _carBox2D.rotation); }; } public function controlCar(){ calculateEngineForces(); correctSteering(); setShadowPosition(); setWheelPositions(); if (_carBox2D != null){ _carBox2D.update(_intEngineForceCurrent, _intSteeringAngle); }; if (_aiDriver != null){ _aiDriver.controlDecisions(); }; updateArrowRotation(); resetCarVariables(); positionMC(); } public function setShadowPosition(){ var _local1:* = Trig.convertToRadian(((_carBox2D.rotation - 90) % 360)); var _local2:Point = Trig.findNewXY(0, 0, _local1, 6); _shadow_mc.x = _local2.x; _shadow_mc.y = -(_local2.y); } public function setWheelPositions(){ } private function resetCarVariables(){ if (_carBox2D != null){ _carBox2D.isHandbrakeOn = false; }; } private function positionMC(){ _carMC.x = _carBox2D.x; _carMC.y = _carBox2D.y; _carMC.rotation = _carBox2D.rotation; _character.speed = _carBox2D.speed; if (_carBox2D.movingForward){ _character.moveForward(); } else { _character.moveBackward(); }; GateManager.playerPosition.x = _carMC.x; GateManager.playerPosition.y = _carMC.y; } public function addBox2D(_arg1:b2World, _arg2:Point, _arg3:Number=0, _arg4:b2DebugDraw=null){ _carBox2D = new CarBox2D(_arg1, _intID); _carBox2D.position = _arg2; _carBox2D.width = _intWidth; _carBox2D.height = _intLength; _carBox2D.frontMass = _intFrontMass; _carBox2D.rearMass = _intRearMass; _carBox2D.vehicleDrive = _strWheelDrive; _carBox2D.sidewaysTraction = _intSidewaysTraction; _carBox2D.rotation = _arg3; _carBox2D.debugData = _arg4; _carBox2D.buildBody(); } public function addUserDriver(_arg1:Driver){ _userDriver = _arg1; } public function addAIDriver(_arg1:AIDriver){ _aiDriver = _arg1; } public function accelerate():void{ _engineStatus = 1; } public function reverse():void{ _engineStatus = 2; } private function calculateEngineForces(){ if (_carBox2D.isHandbrakeOn){ _engineStatus = 3; }; switch (_engineStatus){ case 0: _intEngineForceCurrent = (_intEngineForceCurrent * 0.7); break; case 1: if (_intEngineForceCurrent < _intEngineForceMax){ _intEngineForceCurrent = (_intEngineForceCurrent + (_intEngineForceMax / 10)); }; break; case 2: if (_intEngineForceCurrent > 0.2){ (_intEngineForceCurrent * 0.6); } else { if (_intEngineForceCurrent > (0 - (_intEngineForceMax / 1.1))){ _intEngineForceCurrent = (_intEngineForceCurrent - (_intEngineForceMax / 1.1)); }; }; _intEngineForceCurrent = (0 - (_intEngineForceMax / 2.2)); break; case 3: (_intEngineForceCurrent * 0.3); break; }; _engineStatus = 0; } public function steerLeft(){ steerWheels(-1); } public function steerRight(){ steerWheels(1); } private function steerWheels(_arg1:Number):void{ _intSteeringAngleTarget = (_intSteeringAngleMax * _arg1); _isSteeringIdle = false; _intSteeringAngle = _intSteeringAngleTarget; } private function correctSteering(){ if (_isSteeringIdle){ _intSteeringAngle = 0; }; var _local1:* = (_carBox2D.speed / 10); if (_local1 > 1){ _local1 = 1; }; _isSteeringIdle = true; } public function applyHandbrake(){ _carBox2D.isHandbrakeOn = true; } public function set position(_arg1:Point){ _carBox2D.position = _arg1; } public function set rotation(_arg1:Number){ } public function get mcRef():MovieClip{ return (_carMC); } public function get b2Ref():CarBox2D{ return (_carBox2D); } public function get x():Number{ return (_carMC.x); } public function get y():Number{ return (_carMC.y); } public function get speed():Number{ if (_carBox2D != null){ return (_carBox2D.speed); }; return (0); } public function get rotation():Number{ return (_carBox2D.rotation); } } }//package ecomExpo.racingEngine
Section 238
//CarBox2D (ecomExpo.racingEngine.CarBox2D) package ecomExpo.racingEngine { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; import Box2D.Common.*; import flash.display.*; import flash.geom.*; import console.math.*; public class CarBox2D { private const WHEEL_LATERAL_ANGLE = 3.14159265358979; private const BOX2D_SCALE_FACTOR = 30; private var _boxID; private var _intDamage:Number; private var _carBodyDef:b2BodyDef; private var _carBody:b2Body; private var _worldBox2D:b2World; private var _intBoxWidth:Number; private var _intBoxHeight:Number; private var _intWeight:Number; private var _pntStartPosition:Point; private var _intRotation:Number; private var _weightBodyDef:b2BodyDef; private var _isFrontWheelDrive:Boolean; private var _isRearWheelDrive:Boolean; private var _isFourWheelDrive:Boolean; private var _isHandbrakeApplied:Boolean; private var _intEngineForce:Number; private var _sidewaysTraction:Number; private var _groundFriction:Number; private var _intFrontMass:Number; private var _intRearMass:Number; private var _arrWheels; private var _arrTractionPercentage:Array; private var _debug:b2DebugDraw; private var _leftFrontWheelDef:b2BodyDef; private var _leftFrontWheelBody:b2Body; private var _leftFrontWheelJoint:b2RevoluteJointDef; private var _leftJoint:b2RevoluteJoint; private var _rightFrontWheelDef:b2BodyDef; private var _rightFrontWheelBody:b2Body; private var _rightFrontWheelJoint:b2RevoluteJointDef; private var _rightJoint:b2RevoluteJoint; private var _leftRearWheelDef:b2BodyDef; private var _leftRearWheelBody:b2Body; private var _leftRearWheelJoint:b2PrismaticJointDef; private var _rightRearWheelDef:b2BodyDef; private var _rightRearWheelBody:b2Body; private var _rightRearWheelJoint:b2PrismaticJointDef; private var _isColliding:Boolean; private var _forward:Boolean; public static const FRONT_WHEEL_DRIVE:String = "front"; public static const REAR_WHEEL_DRIVE:String = "rear"; public static const FOUR_WHEEL_DRIVE:String = "four"; public function CarBox2D(_arg1:b2World, _arg2:uint=0){ _boxID = 0; _intDamage = 0; _carBodyDef = new b2BodyDef(); _intBoxWidth = 1; _intBoxHeight = 2; _intWeight = 0.1; _pntStartPosition = new Point(); _intRotation = 0; _weightBodyDef = new b2BodyDef(); _isFrontWheelDrive = false; _isRearWheelDrive = true; _isFourWheelDrive = false; _isHandbrakeApplied = false; _sidewaysTraction = 3; _groundFriction = 2; _intFrontMass = 20; _intRearMass = 5; _arrWheels = new Array("_leftFrontWheelBody", "_rightFrontWheelBody", "_leftRearWheelBody", "_rightRearWheelBody", "_carBody"); _arrTractionPercentage = new Array(0, 0, 0, 0); _isColliding = false; _forward = true; super(); _worldBox2D = _arg1; _boxID = _arg2; } public function buildBody(){ _carBodyDef.linearDamping = 0.1; _carBodyDef.angularDamping = 2; _carBodyDef.position.Set(_pntStartPosition.x, _pntStartPosition.y); _carBodyDef.angle = _intRotation; _carBodyDef.userData = this; _carBody = _worldBox2D.CreateBody(_carBodyDef); var _local1:b2Vec2 = new b2Vec2(_pntStartPosition.x, _pntStartPosition.y); var _local2:b2Vec2 = new b2Vec2(0, (0 + (_intBoxHeight / 2))); var _local3:b2PolygonDef = new b2PolygonDef(); _local3.density = _intFrontMass; _local3.friction = 0; _local3.SetAsOrientedBox(_intBoxWidth, (_intBoxHeight / 2), _local2, 0); _local3.restitution = 0.1; var _local4:b2Vec2 = new b2Vec2(0, (0 - (_intBoxHeight / 2))); var _local5:b2PolygonDef = new b2PolygonDef(); _local5.density = _intRearMass; _local5.friction = 0; _local5.SetAsOrientedBox(_intBoxWidth, (_intBoxHeight / 2), _local4, 0); _local5.restitution = 0.1; _carBody.CreateShape(_local3); _carBody.CreateShape(_local5); _carBody.SetMassFromShapes(); addWheels(_local3.density, _local5.density); } public function addWheels(_arg1, _arg2){ var _local14:b2BodyDef; var _local15:*; var _local16:b2Body; var _local17:b2RevoluteJointDef; var _local18:b2PrismaticJointDef; var _local3:* = (_intBoxWidth / 4); var _local4:* = (_intBoxHeight / 4); var _local5:* = (_intBoxHeight / 1.5); var _local6:* = (_intBoxWidth / 1); var _local7:b2PolygonDef = new b2PolygonDef(); _local7.SetAsBox(_local3, _local4); _local7.density = 1; var _local8:b2Vec2 = _carBody.GetWorldPoint(new b2Vec2(-(_local6), _local5)); var _local9:b2Vec2 = _carBody.GetWorldPoint(new b2Vec2(_local6, _local5)); var _local10:b2Vec2 = _carBody.GetWorldPoint(new b2Vec2(-(_local6), -(_local5))); var _local11:b2Vec2 = _carBody.GetWorldPoint(new b2Vec2(_local6, -(_local5))); var _local12:* = new Array(); _local12.push({pos:_local8, isFront:true}); _local12.push({pos:_local9, isFront:true}); _local12.push({pos:_local10, isFront:false}); _local12.push({pos:_local11, isFront:false}); var _local13:* = 0; while (_local13 < 4) { if ((_local13 <= 1)){ _local7.density = (_arg1 / 2); } else { _local7.density = (_arg2 / 2); }; _local15 = _local12[_local13].pos; _local14 = new b2BodyDef(); _local14.position.Set(_local15.x, _local15.y); _local14.angle = _intRotation; _local14.angularDamping = 0.5; _local14.linearDamping = 0.8; if ((_local13 <= 1)){ _local7.density = (_intFrontMass / 2); } else { _local7.density = (_intRearMass / 2); }; _local16 = _worldBox2D.CreateBody(_local14); _local16.CreateShape(_local7); _local16.SetMassFromShapes(); if (_local12[_local13].isFront){ _local17 = new b2RevoluteJointDef(); _local17.Initialize(_carBody, _local16, _local16.GetWorldCenter()); _local17.enableMotor = true; _local17.maxMotorTorque = 100; switch (_local13){ case 0: _leftJoint = b2RevoluteJoint(_worldBox2D.CreateJoint(_local17)); break; case 1: _rightJoint = b2RevoluteJoint(_worldBox2D.CreateJoint(_local17)); break; }; } else { _local18 = new b2PrismaticJointDef(); _local18.Initialize(_carBody, _local16, _local16.GetWorldCenter(), new b2Vec2(1, 0)); _local18.enableLimit = true; _local18.lowerTranslation = (_local18.upperTranslation = 0); _worldBox2D.CreateJoint(_local18); }; switch (_local13){ case 0: _leftFrontWheelDef = _local14; _leftFrontWheelJoint = _local17; _leftFrontWheelBody = _local16; break; case 1: _rightFrontWheelDef = _local14; _rightFrontWheelJoint = _local17; _rightFrontWheelBody = _local16; break; case 2: _leftRearWheelDef = _local14; _leftRearWheelJoint = _local18; _leftRearWheelBody = _local16; break; case 3: _rightRearWheelDef = _local14; _rightRearWheelJoint = _local18; _rightRearWheelBody = _local16; break; }; _local13++; }; } function addSidewaysTraction(){ var _local2:b2Body; var _local3:Number; var _local4:b2Vec2; var _local5:b2Vec2; var _local6:b2Vec2; var _local7:b2Vec2; var _local8:b2Vec2; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Point; var _local14:Point; var _local15:Number; var _local16:Number; var _local17:b2Vec2; var _local18:b2Vec2; var _local19:*; var _local20:*; var _local21:b2Vec2; var _local22:b2Vec2; var _local1:* = 0; while (_local1 < 4) { _local2 = this[_arrWheels[_local1]]; _local3 = _sidewaysTraction; _local3 = (_local3 * _groundFriction); if (((_isHandbrakeApplied) && ((_local1 > 1)))){ _local3 = (_local3 * 0.25); }; _local4 = _local2.GetLinearVelocity(); _local5 = _local4.Copy(); _local5.Multiply(-1); _local5.Multiply(0.2); _local4.Add(_local5); _local6 = _local2.GetWorldCenter(); _local7 = new b2Vec2((_local6.x + _local4.x), (_local6.y + _local4.y)); _local8 = _local2.GetLocalPoint(_local7); _local9 = Trig.findHypotenuseLength(_local8.x, _local8.y); _local10 = Trig.findAngle(0, 0, _local8.x, _local8.y); _local11 = Trig.findAdjascentLength(_local10, _local9); _local12 = Trig.findOppositeLength(_local10, _local9); _local13 = Trig.findNewXY(0, 0, WHEEL_LATERAL_ANGLE, _local11); _local14 = Trig.findNewXY(0, 0, (-(WHEEL_LATERAL_ANGLE) / 2), _local12); _local15 = (_local11 * (1 - _local3)); _local16 = Math.sqrt(Math.abs((Math.pow(_local9, 2) - Math.pow(_local15, 2)))); if (_local14.y < 0){ _local16 = _local14.y; }; _forward = ((_local14.y >= 0) as Boolean); _local17 = new b2Vec2(-(_local15), _local16); _local18 = _local2.GetWorldPoint(_local17); _local18.Subtract(_local2.GetWorldCenter()); _local2.SetLinearVelocity(_local18); _local19 = (Math.abs(_local15) + Math.abs(_local16)); _local20 = (Math.abs(_local16) / _local19); if (isNaN(_local20)){ _local20 = 1; }; _arrTractionPercentage[_local1] = _local20; if (((!((_debug == null))) && ((_local1 == 1)))){ _local21 = new b2Vec2(_local13.x, _local13.y); _local22 = new b2Vec2(_local14.x, _local14.y); _debug.DrawSegment1(_local2.GetWorldCenter(), _local2.GetWorldPoint(_local17), new b2Color(1, 1, 0)); _debug.DrawSegment1(_local2.GetWorldCenter(), _local2.GetWorldPoint(_local21), new b2Color(0, 1, 1)); _debug.DrawSegment1(_local2.GetWorldCenter(), _local2.GetWorldPoint(_local22), new b2Color(0, 1, 1)); }; _local1++; }; } public function update(_arg1:Number, _arg2:Number):void{ var _local6:*; var _local7:*; var _local8:*; var _local9:*; _intEngineForce = _arg1; if (_isFourWheelDrive){ _intEngineForce = (_intEngineForce / 2); }; if (((_isFrontWheelDrive) || (_isFourWheelDrive))){ _local6 = _leftFrontWheelBody.GetXForm().R.col2.Copy(); _local6.Multiply((_intEngineForce * frontLeftTraction)); _leftFrontWheelBody.ApplyForce(_local6, _leftFrontWheelBody.GetPosition()); _local7 = _rightFrontWheelBody.GetXForm().R.col2.Copy(); _local7.Multiply((_intEngineForce * frontRightTraction)); _rightFrontWheelBody.ApplyForce(_local7, _rightFrontWheelBody.GetPosition()); }; if (((_isRearWheelDrive) || (_isFourWheelDrive))){ _local8 = _leftRearWheelBody.GetXForm().R.col2.Copy(); _local8.Multiply((_intEngineForce * rearLeftTraction)); _leftRearWheelBody.ApplyForce(_local8, _leftRearWheelBody.GetPosition()); _local9 = _rightRearWheelBody.GetXForm().R.col2.Copy(); _local9.Multiply((_intEngineForce * rearRightTraction)); _rightRearWheelBody.ApplyForce(_local9, _rightRearWheelBody.GetPosition()); }; var _local3:* = Trig.convertToRadian(_arg2); var _local4:* = (_local3 - _leftJoint.GetJointAngle()); var _local5:* = (_local3 - _rightJoint.GetJointAngle()); if (_arg2 != 0){ _leftJoint.SetMotorSpeed((6 * _local4)); _rightJoint.SetMotorSpeed((6 * _local5)); } else { _leftJoint.SetMotorSpeed((6 * _local4)); _rightJoint.SetMotorSpeed((6 * _local5)); }; addSidewaysTraction(); } public function set width(_arg1){ _intBoxWidth = (_arg1 / BOX2D_SCALE_FACTOR); } public function set height(_arg1){ _intBoxHeight = (_arg1 / BOX2D_SCALE_FACTOR); } public function set frontMass(_arg1):void{ _intFrontMass = _arg1; } public function set rearMass(_arg1):void{ _intRearMass = _arg1; } public function set position(_arg1:Point){ var _local2:* = (_arg1.x / BOX2D_SCALE_FACTOR); var _local3:* = (_arg1.y / BOX2D_SCALE_FACTOR); _pntStartPosition = new Point(_local2, _local3); } public function set rotation(_arg1){ _intRotation = Trig.convertToRadian(_arg1); } public function get x(){ return ((_carBody.GetPosition().x * BOX2D_SCALE_FACTOR)); } public function get y(){ return ((_carBody.GetPosition().y * BOX2D_SCALE_FACTOR)); } public function get rotation(){ return ((Trig.convertToDegree(_carBody.GetAngle()) + 90)); } public function get speed():Number{ var _local1:* = _carBody.GetLinearVelocity(); var _local2:* = Trig.findHypotenuseLength(_local1.x, _local1.y); return (_local2); } public function get isSleeping():Boolean{ return (_carBody.IsSleeping()); } public function set debugData(_arg1):void{ _debug = _arg1; } public function set isHandbrakeOn(_arg1):void{ _isHandbrakeApplied = _arg1; } public function get isHandbrakeOn():Boolean{ return (_isHandbrakeApplied); } public function set isColliding(_arg1:Boolean):void{ _isColliding = _arg1; } public function set sidewaysTraction(_arg1:Number):void{ _sidewaysTraction = _arg1; } public function set vehicleDrive(_arg1:String){ _isFrontWheelDrive = false; _isRearWheelDrive = false; _isFourWheelDrive = false; switch (_arg1){ case "front": _isFrontWheelDrive = true; break; case "rear": _isRearWheelDrive = true; break; case "four": _isFourWheelDrive = true; break; }; } public function get id():uint{ return (_boxID); } public function set damage(_arg1):void{ _intDamage = _arg1; } public function get damage():Number{ return (_intDamage); } private function get frontLeftTraction():Number{ return (_arrTractionPercentage[0]); } private function get frontRightTraction():Number{ return (_arrTractionPercentage[1]); } private function get rearLeftTraction():Number{ return (_arrTractionPercentage[2]); } private function get rearRightTraction():Number{ return (_arrTractionPercentage[3]); } public function get movingForward():Boolean{ return (_forward); } } }//package ecomExpo.racingEngine
Section 239
//Collectable (ecomExpo.racingEngine.Collectable) package ecomExpo.racingEngine { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.Shapes.*; import flash.display.*; import flash.geom.*; import com.stampy.points.*; import ecomExpo.game.*; import console.sounds.*; import com.stampy.random.*; import com.stampy.global.*; public class Collectable extends MovieClip { private const SCALE_FACTOR:uint = 30; private var _b2World:b2World; private var _b2Body:b2Body; private var _strType:String; private var _collected:Boolean; private var _minBonusDistance:Number; public static const MAX_COLLECTABLES:uint = 1; public static const TYPE_SHIELD = "type_shield"; public static const TYPE_ICE_CUBE = "type_ice_cube"; public static const TYPE_REPAIR = "type_repair"; public static const TYPE_HANDLING = "type_handling"; public static const TYPE_SLIP = "type_slip"; public static const TYPE_INVISIBLE = "type_invisible"; public static const TYPE_NOS = "type_nos"; private static var _intNumberOfCollectables:uint = 0; private static var _active:Boolean = false; public function Collectable(){ _strType = ""; _collected = false; _minBonusDistance = 1500; super(); init(); } private function init():void{ _active = true; this.scaleX = (this.scaleY = 0.6); setPosition(); } private function setPosition():void{ var _local1:uint = Random.range(0, (GameState.collectableDropPoints.length - 1)); var _local2:Point = GameState.collectableDropPoints[_local1]; this.x = _local2.x; this.y = _local2.y; var _local3:Number = PointDistance.betweenPoints(_local2, GateManager.playerPosition); if (_local3 < _minBonusDistance){ setPosition(); } else { Global.vars.worldRenderer.addSprite(this); }; } private function checkPositionValid(_arg1:Point):Boolean{ var _local2:Array = GameState.innerWalls.concat(GameState.walls); var _local3:uint; while (_local3 < _local2.length) { if (_local2[_local3].containsPoint(_arg1)){ return (false); }; _local3++; }; return (true); } private function randomPosition():Point{ var _local1:* = Random.range(0, GameState.worldWidth); return (new Point(new uint(Random.range(50, (GameState.worldWidth - 50))), new uint(Random.range(50, (GameState.worldHeight - 50))))); } public function addBox2D(_arg1:b2World){ _b2World = _arg1; _b2Body = _arg1.CreateBody(new b2BodyDef()); _b2Body.SetUserData(this); _b2Body.SetXForm(new b2Vec2((this.x / SCALE_FACTOR), (this.y / SCALE_FACTOR)), 0); var _local2:b2PolygonDef = new b2PolygonDef(); _local2.SetAsOrientedBox((47 / SCALE_FACTOR), (47 / SCALE_FACTOR)); _local2.isSensor = true; _b2Body.CreateShape(_local2); } public function collect(){ _active = false; SoundUtils.playSFX("SFX2"); this.gotoAndPlay("Collect Item"); removeSpriteFromWorld(); GameState.bonusY = 0; GameState.bonusX = 0; } public function removeSpriteFromWorld(){ if (_collected){ return; }; _collected = true; GameState.collectables--; Global.vars.worldRenderer.removeSprite(this); } public function set type(_arg1):void{ _strType = _arg1; } public static function get numberOfCollectables():uint{ return (_intNumberOfCollectables); } public static function get active():Boolean{ return (_active); } } }//package ecomExpo.racingEngine
Section 240
//Driver (ecomExpo.racingEngine.Driver) package ecomExpo.racingEngine { import flash.events.*; import flash.display.*; import flash.utils.*; import console.control.*; public class Driver extends Sprite { private var _stage:DisplayObject; private var _key:KeyObject; private var _keyDictionary:Dictionary; private static var _isPaused:Boolean = true; public function Driver(_arg1:Boolean=true){ _keyDictionary = new Dictionary(); _stage = StageReference.getStage(); _key = new KeyObject(_stage); addEventListener(Event.ENTER_FRAME, controlUser); } public function addKey(_arg1:uint, _arg2:Function){ _keyDictionary[_arg1] = _arg2; } private function controlUser(_arg1:Event){ var _local2:Object; if (!_isPaused){ for (_local2 in _keyDictionary) { if (_key.isDown(new uint(_local2))){ var _local5 = _keyDictionary; _local5[_local2](); }; }; }; } public static function set isPaused(_arg1):void{ _isPaused = _arg1; } } }//package ecomExpo.racingEngine
Section 241
//PauseEvent (ecomExpo.racingEngine.PauseEvent) package ecomExpo.racingEngine { import flash.events.*; public class PauseEvent extends Event { private var _paused:Boolean; public static const PAUSE:String = "pause"; public function PauseEvent(_arg1:String, _arg2:Boolean){ super(_arg1); _paused = _arg2; } override public function clone():Event{ return (new PauseEvent(type, _paused)); } public function get paused():Boolean{ return (_paused); } } }//package ecomExpo.racingEngine
Section 242
//RacingGame (ecomExpo.racingEngine.RacingGame) package ecomExpo.racingEngine { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; import flash.events.*; import flash.display.*; import flash.geom.*; import ecomExpo.game.*; import console.events.*; import com.stampy.global.*; public class RacingGame extends MovieClip { private const INT_COMPUTER_CARS:uint = 6; private var _playersCar:Car; private var _gameDebug:b2DebugDraw; private var _isDebugShown; private var _intCollectableCount:uint; private var _intCollectabelCountTimeOut:uint; private var _isPaused:Boolean; private var _worldWidth:uint; private var _worldHeight:uint; private var _debugScale:Number; private static var _arrCars:Array; private static var _worldBox2D:WorldBox2D; private static var _bitmapAnimations:BitmapAnimations = new BitmapAnimations(); private static var _worldRenderer:WorldRenderer; public function RacingGame(_arg1:Boolean=true){ _gameDebug = null; _isDebugShown = true; _intCollectableCount = 0; _intCollectabelCountTimeOut = 150; _isPaused = true; _worldWidth = GameState.worldHeight; _worldHeight = GameState.worldHeight; _debugScale = GameState.debugScale; super(); GameState.randomCrowd(); _isDebugShown = _arg1; addEventListener(Event.ADDED_TO_STAGE, buildGame); } private function buildGame(_arg1:Event=null){ removeEventListener(Event.ADDED_TO_STAGE, buildGame); GameState.collectables = 0; _arrCars = new Array(); AIDriver.arrCars = new Array(); StageReference.setStage(this.stage); buildBox2DWorld(); buildWorldRenderer(); var _local2:* = buildPlayersCar(); addEventListener(Event.ENTER_FRAME, updateWorld); addEventListener(KeyboardEvent.KEY_UP, keyboardControl); var _local3:* = 0; while (_local3 < Collectable.MAX_COLLECTABLES) { addNewCollectable(); _local3++; }; buildDebug(); } public function init(){ pauseGame(); } private function buildBox2DWorld(){ _worldBox2D = new WorldBox2D(_worldWidth, _worldHeight); var _local1:Box2DCollision = new Box2DCollision(); _worldBox2D.world.SetContactListener(_local1); } private function buildDebug():void{ if (_isDebugShown){ _gameDebug = new b2DebugDraw(); _gameDebug.m_sprite = new Sprite(); _gameDebug.m_drawScale = _debugScale; _gameDebug.m_fillAlpha = 0.3; _gameDebug.m_lineThickness = 1; _gameDebug.m_drawFlags = (((b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit) | b2DebugDraw.e_centerOfMassBit) | b2DebugDraw.e_jointBit); _gameDebug.SetFlags(_gameDebug.m_drawFlags); addChild(_gameDebug.m_sprite); _worldBox2D.world.SetDebugDraw(_gameDebug); }; } private function buildPlayersCar(){ var _local1:Car = new Car(); _local1.addBox2D(_worldBox2D.world, new Point(1400, 1400), 180, _gameDebug); var _local2:Driver = new Driver(); _local2.addKey(38, _local1.accelerate); _local2.addKey(40, _local1.reverse); _local2.addKey(37, _local1.steerLeft); _local2.addKey(39, _local1.steerRight); _local2.addKey(32, _local1.applyHandbrake); _local1.addUserDriver(_local2); _arrCars.push(_local1); AIDriver.arrCars.push(_local1); _worldRenderer.addCar(_local1, true); return (_local1); } public function pauseGame(){ if (_isPaused){ _isPaused = false; } else { _isPaused = true; }; AIDriver.isPaused = _isPaused; Driver.isPaused = _isPaused; StaticEventDispatch.dispatchEvent(new PauseEvent(PauseEvent.PAUSE, _isPaused)); } private function buildWorldRenderer(){ if (_worldRenderer){ _worldRenderer.destroy(); }; _worldRenderer = new WorldRenderer(); Global.vars.worldRenderer = _worldRenderer; Global.vars.bitmapAnimations = _bitmapAnimations; addChild(_worldRenderer); } public function updateWorld(_arg1:Event){ var _local2:*; var _local3:*; var _local4:*; if (!_isPaused){ _worldBox2D.world.Step((1 / 30), 8); removeCollisionObjects(); checkCollectabeleCount(); _local2 = _arrCars.length; _local3 = 0; while (_local3 < _local2) { _local4 = _arrCars[_local3]; _local4.controlCar(); _local3++; }; }; } private function removeCollisionObjects(){ var i:uint; var collisionArray:* = Box2DCollision.arrBodyRemoval; i = 0; while (i < collisionArray.length) { _worldBox2D.world.DestroyBody(collisionArray[i]); i = (i + 1); }; if (GateManager.gateState == GateManager.GATES_FREE){ while (GateManager.oldGates.length > 0) { try { _worldBox2D.world.DestroyBody(GateManager.oldGates[0]); GateManager.oldGates.splice(0, 1); } catch($err:Error) { }; }; GateManager.gateState = GateManager.GATES_REMOVED; }; } private function keyboardControl(_arg1:KeyboardEvent){ if (_arg1.keyCode == 80){ pauseGame(); }; } private function checkCollectabeleCount(){ _intCollectableCount++; if (_intCollectableCount > _intCollectabelCountTimeOut){ _intCollectableCount = 0; if (GameState.collectables < Collectable.MAX_COLLECTABLES){ addNewCollectable(); }; }; } private function addNewCollectable(){ var _local2:*; GameState.collectables++; var _local1:uint = Math.ceil((Math.random() * 6)); switch (_local1){ case 1: _local2 = new CollectableFlip(); _local2.type = Collectable.TYPE_SLIP; break; case 2: _local2 = new CollectableFreeze(); _local2.type = Collectable.TYPE_ICE_CUBE; break; case 3: _local2 = new CollectableInvisible(); _local2.type = Collectable.TYPE_INVISIBLE; break; case 4: _local2 = new CollectableNos(); _local2.type = Collectable.TYPE_NOS; break; case 5: _local2 = new CollectableShield(); _local2.type = Collectable.TYPE_SHIELD; break; case 6: _local2 = new CollectableSpanner(); _local2.type = Collectable.TYPE_REPAIR; break; }; GameState.bonusX = _local2.x; GameState.bonusY = _local2.y; _local2.addBox2D(_worldBox2D.world); } public function destroy(){ if (!_isPaused){ pauseGame(); }; removeEventListener(Event.ENTER_FRAME, updateWorld); removeEventListener(KeyboardEvent.KEY_UP, keyboardControl); _worldRenderer.destroy(); _worldBox2D.destroy(); AIDriver.arrCars = []; _arrCars = []; _worldBox2D = null; _worldRenderer = null; GameState.collectables = 0; } } }//package ecomExpo.racingEngine
Section 243
//StageReference (ecomExpo.racingEngine.StageReference) package ecomExpo.racingEngine { import flash.display.*; public class StageReference extends DisplayObject { private static var _stage:DisplayObject; public static function setStage(_arg1):void{ _stage = _arg1; } public static function getStage():DisplayObject{ return (_stage); } } }//package ecomExpo.racingEngine
Section 244
//WorldBox2D (ecomExpo.racingEngine.WorldBox2D) package ecomExpo.racingEngine { import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; import flash.display.*; import flash.geom.*; import ecomExpo.game.*; import flash.utils.*; public class WorldBox2D { private const BOX2D_SCALE_FACTOR = 30; private var _world:b2World; private var _worldBox:b2AABB; private var _wallBodyDef:b2BodyDef; private var _boundaryWidth:uint; private var _boundaryHeight:uint; private var _gateInterval:uint; public function WorldBox2D(_arg1:Number, _arg2:Number){ _worldBox = new b2AABB(); _wallBodyDef = new b2BodyDef(); _boundaryWidth = uint((6932 / BOX2D_SCALE_FACTOR)); _boundaryHeight = uint((4500 / BOX2D_SCALE_FACTOR)); super(); var _local3:* = (_arg1 / BOX2D_SCALE_FACTOR); var _local4:* = (_arg2 / BOX2D_SCALE_FACTOR); _worldBox.lowerBound.Set(0, 0); _worldBox.upperBound.Set((_local3 * 2), (_local4 * 2)); var _local5:b2Vec2 = new b2Vec2(0, 0); _world = new b2World(_worldBox, _local5, true); createWalls(); updateGates(); _gateInterval = setInterval(updateGates, 1000); } public function destroy(){ var _local4:*; var _local1:* = _world.GetBodyCount(); var _local2:b2Body = _world.GetBodyList(); var _local3:* = 0; while (_local3 < _local1) { if (_local2 != null){ _local4 = _local2.GetNext(); _world.DestroyBody(_local2); _local2 = _local4; }; _local3++; }; clearInterval(_gateInterval); } public function updateGates():void{ var _local1:uint; var _local2:Rectangle; if (GateManager.gateState == GateManager.GATES_RANDOMISED){ _local1 = 0; while (_local1 < GateManager.activeGates.length) { _local2 = GateManager.activeGates[_local1].rect; newWall(_local2.x, _local2.y, _local2.width, _local2.height, true); _local1++; }; GateManager.gateState = GateManager.GATES_ADDED; }; } public function createWalls(){ var _local1:Rectangle; var _local2:uint; var _local3:Point; _local2 = 0; while (_local2 < GameState.walls.length) { _local1 = GameState.walls[_local2]; newWall(_local1.x, _local1.y, _local1.width, _local1.height); _local2++; }; _local2 = 0; while (_local2 < GameState.innerWalls.length) { _local1 = GameState.innerWalls[_local2]; newWall(_local1.x, _local1.y, _local1.width, _local1.height); _local2++; }; _local2 = 0; while (_local2 < GameState.crowdSinglePoints.length) { _local3 = GameState.crowdSinglePoints[_local2]; newCircle(_local3.x, _local3.y, 0.7); _local2++; }; _local2 = 0; while (_local2 < GameState.crowdDoublePoints.length) { _local3 = GameState.crowdDoublePoints[_local2]; newCircle(_local3.x, _local3.y, 0.9); _local2++; }; _local2 = 0; while (_local2 < GameState.crowdTripplePoints.length) { _local3 = GameState.crowdTripplePoints[_local2]; newCircle(_local3.x, _local3.y, 1.2); _local2++; }; } public function newCircle(_arg1:Number, _arg2:Number, _arg3:Number):void{ var _local4:Number = BOX2D_SCALE_FACTOR; _arg1 = (_arg1 / _local4); _arg2 = (_arg2 / _local4); _wallBodyDef.position.Set(_arg1, _arg2); _wallBodyDef.angle = 0; var _local5:b2CircleDef = new b2CircleDef(); _local5.radius = _arg3; var _local6:b2Body = world.CreateBody(_wallBodyDef); _local6.CreateShape(_local5); var _local7:* = world.CreateBody(_wallBodyDef); } public function newWall(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false):void{ var _local6:Number = BOX2D_SCALE_FACTOR; _arg1 = ((_arg1 + (_arg3 >> 1)) / _local6); _arg2 = ((_arg2 + (_arg4 >> 1)) / _local6); _arg3 = ((_arg3 >> 1) / _local6); _arg4 = ((_arg4 >> 1) / _local6); _wallBodyDef.position.Set(_arg1, _arg2); _wallBodyDef.angle = 0; var _local7:b2PolygonDef = new b2PolygonDef(); _local7.SetAsBox(_arg3, _arg4); var _local8:b2Body = world.CreateBody(_wallBodyDef); _local8.CreateShape(_local7); var _local9:* = world.CreateBody(_wallBodyDef); if (_arg5){ GateManager.oldGates.push(_local8); }; } public function get world():b2World{ return (_world); } } }//package ecomExpo.racingEngine
Section 245
//WorldRenderer (ecomExpo.racingEngine.WorldRenderer) package ecomExpo.racingEngine { import flash.events.*; import flash.display.*; import flash.geom.*; import com.greensock.*; import ecomExpo.game.*; import com.stampy.random.*; import flash.utils.*; public class WorldRenderer extends Sprite { private const GAME_SCALE:int = 1; private const STAGE_WIDTH:int = 650; private const STAGE_HEIGHT:int = 450; private const STAND_STARTX:uint = 700; private const STAND_STARTY:uint = 750; private const ISLE_SIZE:uint = 280; private const STAND_SIZE:uint = 465; private var _intHalfWidth:int; private var _intHalfHeight:int; private var _intArenaWidth:int; private var _intArenaHeight:int; private var _intArenaOffsetMiddleX:int; private var _intArenaOffsetMiddleY:int; private var _intArenaOffsetLeftX:int; private var _intArenaOffsetTopY:int; private var _playersCar; private var _bmpArenaData:BitmapData; private var _bmpArenaSprite:BitmapSprite; private var _bmpBackgroundData:BitmapData; private var _bmpBackground:Bitmap; private var _playersCarMC:MovieClip; private var _bmpCarData:BitmapData; private var _bmpCarSprite:BitmapSprite; private var _worldBitmap:BitmapWorld; private var _worldCamera:BitmapCamera; private var _objZoom; private var _arrCars:Array; private var _floorWidth:uint; private var _floorHeight:uint; private var _boundaryWidth:uint; private var _boundaryHeight:uint; private var _shopFloor; private var _shopWalls; private var _shopWallsShadow; private var _shopWallsOutline; private var _standArray:Array; private var _gates:Sprite; private var _gateTimer:Timer; private var _gateTimeCount:uint; private var _gateSwapTime:uint; private var _gateCount:uint; private static var _crowd; public function WorldRenderer(){ var _local1:Point; var _local2:int; var _local3:Rectangle; var _local6:CrowdSingle; var _local7:CrowdDouble; var _local8:CrowdTripple; var _local9:int; _bmpBackgroundData = new BitmapData(STAGE_WIDTH, STAGE_HEIGHT); _bmpBackground = new Bitmap(_bmpBackgroundData); _objZoom = new Object(); _floorWidth = 6932; _floorHeight = 4500; _boundaryWidth = 6932; _boundaryHeight = 4500; _gateTimeCount = 0; _gateSwapTime = 20; _gateCount = 3; super(); _crowd = new Sprite(); _shopFloor = new Sprite(); _shopFloor.graphics.beginBitmapFill(new FloorTile(0, 0)); _shopFloor.graphics.drawRect(0, 0, _floorWidth, _floorHeight); _shopFloor.graphics.endFill(); _gates = new Sprite(); _shopWalls = new Sprite(); _shopWalls.graphics.beginBitmapFill(new WallTile(0, 0)); _local2 = 0; while (_local2 < GameState.walls.length) { _local3 = GameState.walls[_local2]; _shopWalls.graphics.drawRect(_local3.x, _local3.y, _local3.width, _local3.height); _local2++; }; _shopWalls.graphics.endFill(); var _local4:Number = 10; _shopWallsShadow = new Sprite(); _shopWallsShadow.graphics.beginFill(0, 0.1); _shopWallsShadow.graphics.drawRect(0, 0, (300 + _local4), (4250 - _local4)); _shopWallsShadow.graphics.drawRect((300 + _local4), 0, (6460 - (_local4 * 2)), (290 + _local4)); _shopWallsShadow.graphics.drawRect((6760 - _local4), 0, (270 + _local4), (4250 - _local4)); _shopWallsShadow.graphics.drawRect((300 + _local4), (4030 - _local4), (6460 - (_local4 * 2)), 290); _shopWallsShadow.graphics.drawRect((300 + _local4), (290 + _local4), 100, 1700); _shopWallsShadow.graphics.drawRect((300 + _local4), (2350 - _local4), 100, (1300 + (_local4 * 2))); _shopWallsShadow.graphics.drawRect((6660 - _local4), (750 - _local4), 100, (465 + (_local4 * 2))); _shopWallsShadow.graphics.drawRect((6660 - _local4), (1495 - _local4), 100, (465 + (_local4 * 2))); _shopWallsShadow.graphics.drawRect((6660 - _local4), (2240 - _local4), 100, (465 + (_local4 * 2))); _shopWallsShadow.graphics.drawRect((6660 - _local4), (2985 - _local4), 100, (465 + (_local4 * 2))); _shopWallsShadow.graphics.drawRect((700 - _local4), (290 + _local4), (700 + (_local4 * 2)), 200); _shopWallsShadow.graphics.drawRect((1750 - _local4), (290 + _local4), (1200 + (_local4 * 2)), 200); _shopWallsShadow.graphics.drawRect((3300 - _local4), (290 + _local4), (1200 + (_local4 * 2)), 200); _shopWallsShadow.graphics.drawRect((4800 - _local4), (290 + _local4), (1200 + (_local4 * 2)), 200); _shopWallsShadow.graphics.drawRect((6375 - _local4), (290 + _local4), (100 + (_local4 * 2)), 200); _shopWallsShadow.graphics.drawRect((1850 - _local4), (3830 - _local4), (1350 + (_local4 * 2)), 200); _shopWallsShadow.graphics.drawRect((4800 - _local4), (3830 - _local4), (450 + (_local4 * 2)), 200); _shopWallsShadow.graphics.drawRect((5675 - _local4), (3830 - _local4), (900 + (_local4 * 2)), 200); _shopWallsShadow.graphics.endFill(); _shopWallsOutline = new Sprite(); _shopWallsOutline.graphics.lineStyle(4, 0, 0.4, false, "normal", null, null, 3); _local2 = 0; while (_local2 < GameState.walls.length) { _local3 = GameState.walls[_local2]; _shopWallsOutline.graphics.drawRect(_local3.x, _local3.y, _local3.width, _local3.height); _local2++; }; _shopWallsOutline.graphics.endFill(); _local2 = 0; while (_local2 < GameState.crowdSinglePoints.length) { _local1 = (GameState.crowdSinglePoints[_local2] as Point); _local6 = new CrowdSingle(); _local6.x = _local1.x; _local6.y = _local1.y; _local6.rotation = (Random.range(0, 360) - 180); _crowd.addChild(_local6); _local2++; }; _local2 = 0; while (_local2 < GameState.crowdDoublePoints.length) { _local1 = (GameState.crowdDoublePoints[_local2] as Point); _local7 = new CrowdDouble(); _local7.x = _local1.x; _local7.y = _local1.y; _local7.rotation = (Random.range(0, 360) - 180); _crowd.addChild(_local7); _local2++; }; _local2 = 0; while (_local2 < GameState.crowdTripplePoints.length) { _local1 = (GameState.crowdTripplePoints[_local2] as Point); _local8 = new CrowdTripple(); _local8.x = _local1.x; _local8.y = _local1.y; _local8.rotation = (Random.range(0, 360) - 180); _crowd.addChild(_local8); _local2++; }; _objZoom.zoom = 0; _arrCars = new Array(); _intHalfWidth = (STAGE_WIDTH << 1); _intHalfHeight = (STAGE_HEIGHT << 1); _worldBitmap = new BitmapWorld(STAGE_WIDTH, STAGE_HEIGHT); _worldCamera = new BitmapCamera(STAGE_WIDTH, STAGE_HEIGHT, _worldBitmap); _worldCamera.setupBoundary(_boundaryWidth, _boundaryHeight); addChild(_worldCamera); _worldBitmap.addChild(_shopFloor); _worldBitmap.addChild(_shopWallsShadow); _worldBitmap.addChild(_shopWallsOutline); _worldBitmap.addChild(_shopWalls); _worldBitmap.addChild(_gates); _standArray = []; var _local5:int; while (_local5 < 8) { _local9 = 0; while (_local9 < 4) { if ((((_local5 == 2)) && ((_local9 == 1)))){ addStand(7, _local5, _local9); } else { if ((((_local5 == 3)) && ((_local9 == 1)))){ } else { addStand(Random.range(1, 6), _local5, _local9); }; }; _local9++; }; _local5++; }; _worldBitmap.addChild(_crowd); addEventListener(Event.ENTER_FRAME, renderGame); _worldCamera.play(); startGateTimer(); } private function startGateTimer():void{ GateManager.generateRandomGates(_gateCount); _gateTimer = new Timer(1000, _gateSwapTime); _gateTimer.addEventListener(TimerEvent.TIMER, timerTick); _gateTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerComplete); _gateTimer.start(); } private function timerComplete(_arg1:TimerEvent):void{ _gateTimeCount = 0; _gateTimer.removeEventListener(TimerEvent.TIMER, timerTick); _gateTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerComplete); startGateTimer(); } private function destroyGateTimer():void{ _gateTimeCount = 0; _gateTimer.removeEventListener(TimerEvent.TIMER, timerTick); _gateTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerComplete); } private function timerTick(_arg1:TimerEvent):void{ _gateTimeCount++; if (_gateTimeCount >= (_gateSwapTime - 1)){ GateManager.gateState = GateManager.GATES_FREE; }; } private function addStand(_arg1:uint, _arg2:int, _arg3:int):void{ var _local4:Class = (getDefinitionByName(("Stand" + _arg1)) as Class); var _local5:Bitmap = new Bitmap(new _local4(0, 0)); _local5.x = (STAND_STARTX + (_arg2 * (STAND_SIZE + ISLE_SIZE))); _local5.y = (STAND_STARTY + (_arg3 * (STAND_SIZE + ISLE_SIZE))); _standArray.push(_local5); _worldBitmap.addChild(_local5); } public function addCar(_arg1:Car, _arg2:Boolean=false){ _arrCars.push(_arg1); _worldBitmap.addChild(_arg1.mcRef); if (_arg2){ _playersCar = _arg1; }; } public function destroy(){ var _local1:uint; destroyGateTimer(); GateManager.gateState = ""; GateManager.oldGates = []; GateManager.removeGates = []; GateManager.updateAllowed = false; _shopFloor.graphics.clear(); _shopWalls.graphics.clear(); _shopWallsShadow.graphics.clear(); _shopWallsOutline.graphics.clear(); _local1 = 0; while (_local1 < _crowd.numChildren) { _crowd.getChildAt(0); _crowd.removeChildAt(0); _local1++; }; _local1 = 0; while (_local1 < _standArray.length) { _standArray[_local1].bitmapData.dispose(); _local1++; }; _standArray = []; _worldCamera.stop(); _worldCamera = null; _worldBitmap.destroy(); removeEventListener(Event.ENTER_FRAME, renderGame); } public function addSprite(_arg1){ _worldBitmap.addChild(_arg1); } public function removeSprite(_arg1){ _worldBitmap.removeChild(_arg1); } public function renderGame(_arg1:Event){ var _local2:*; var _local3:uint; _local3 = 0; while (_local3 < _gates.numChildren) { _gates.removeChildAt(0); _local3++; }; _local3 = 0; while (_local3 < GateManager.activeGates.length) { _local2 = ((GateManager.activeGates[_local3].type)=="A") ? new GateA() : new GateB(); _local2.x = GateManager.activeGates[_local3].rect.x; _local2.y = GateManager.activeGates[_local3].rect.y; _gates.addChild(_local2); _local3++; }; var _local4:* = (_playersCar.speed / 10); if (_local4 > 1){ _local4 = 1; }; var _local5:* = (0.9 * _local4); TweenMax.killTweensOf(_objZoom); var _local6:Number = (1.45 - (_local5 / 2)); TweenMax.to(_objZoom, 0.8, {zoom:_local6}); _worldCamera.xPos = _playersCar.x; _worldCamera.yPos = _playersCar.y; _worldCamera.zoom = _objZoom.zoom; } private function removeGate(_arg1):void{ _gates.removeChild(_arg1); } private function scale():void{ } } }//package ecomExpo.racingEngine
Section 246
//ErrorMarker_mc_53 (eracer_fla.ErrorMarker_mc_53) package eracer_fla { import flash.display.*; public dynamic class ErrorMarker_mc_53 extends MovieClip { public function ErrorMarker_mc_53(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 247
//ErrorMessage_mc_54 (eracer_fla.ErrorMessage_mc_54) package eracer_fla { import flash.display.*; public dynamic class ErrorMessage_mc_54 extends MovieClip { public function ErrorMessage_mc_54(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 248
//MenuBTN_HighScores_19 (eracer_fla.MenuBTN_HighScores_19) package eracer_fla { import flash.display.*; public dynamic class MenuBTN_HighScores_19 extends MovieClip { public var HighScoreButtonOver:SimpleButton; public var HighScoreButtonOut:SimpleButton; public function MenuBTN_HighScores_19(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 249
//MenuBTN_Home_36 (eracer_fla.MenuBTN_Home_36) package eracer_fla { import flash.display.*; public dynamic class MenuBTN_Home_36 extends MovieClip { public var HomeButtonOver:SimpleButton; public var HomeButtonOut:SimpleButton; public function MenuBTN_Home_36(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 250
//MenuBTN_PlayGame_15 (eracer_fla.MenuBTN_PlayGame_15) package eracer_fla { import flash.display.*; public dynamic class MenuBTN_PlayGame_15 extends MovieClip { public var PlayGameButtonOut:SimpleButton; public var PlayGameButtonOver:SimpleButton; public function MenuBTN_PlayGame_15(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 251
//MenuBTN_Share_21 (eracer_fla.MenuBTN_Share_21) package eracer_fla { import flash.display.*; public dynamic class MenuBTN_Share_21 extends MovieClip { public var shareButtonOut:SimpleButton; public var shareButtonOver:SimpleButton; public var socialButtons:MovieClip; public function MenuBTN_Share_21(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 252
//MenuBTNHow_Play_34 (eracer_fla.MenuBTNHow_Play_34) package eracer_fla { import flash.display.*; public dynamic class MenuBTNHow_Play_34 extends MovieClip { public var PlayHowButtonOut:SimpleButton; public var PlayHowButtonOver:SimpleButton; public function MenuBTNHow_Play_34(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 253
//MenuButton_HighScores_mc_18 (eracer_fla.MenuButton_HighScores_mc_18) package eracer_fla { import flash.display.*; public dynamic class MenuButton_HighScores_mc_18 extends MovieClip { public var HighScores:MovieClip; public function MenuButton_HighScores_mc_18(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 254
//MenuButton_Home_mc_35 (eracer_fla.MenuButton_Home_mc_35) package eracer_fla { import flash.display.*; public dynamic class MenuButton_Home_mc_35 extends MovieClip { public var MenuButton:MovieClip; public function MenuButton_Home_mc_35(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 255
//MenuButton_PlayGame_mc_14 (eracer_fla.MenuButton_PlayGame_mc_14) package eracer_fla { import flash.display.*; public dynamic class MenuButton_PlayGame_mc_14 extends MovieClip { public var PlayGame:MovieClip; public function MenuButton_PlayGame_mc_14(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 256
//MenuButton_Share_mc_20 (eracer_fla.MenuButton_Share_mc_20) package eracer_fla { import flash.display.*; public dynamic class MenuButton_Share_mc_20 extends MovieClip { public var MenuButtonShare:MovieClip; public function MenuButton_Share_mc_20(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 257
//MenuButtonHow_Play_mc_33 (eracer_fla.MenuButtonHow_Play_mc_33) package eracer_fla { import flash.display.*; public dynamic class MenuButtonHow_Play_mc_33 extends MovieClip { public var MenuButton:MovieClip; public function MenuButtonHow_Play_mc_33(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 258
//p_cartcontents_78 (eracer_fla.p_cartcontents_78) package eracer_fla { import flash.display.*; public dynamic class p_cartcontents_78 extends MovieClip { public function p_cartcontents_78(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 259
//SpriteDump_mc_1 (eracer_fla.SpriteDump_mc_1) package eracer_fla { import flash.display.*; public dynamic class SpriteDump_mc_1 extends MovieClip { public function SpriteDump_mc_1(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 260
//TextLabels_mc_37 (eracer_fla.TextLabels_mc_37) package eracer_fla { import flash.display.*; public dynamic class TextLabels_mc_37 extends MovieClip { public function TextLabels_mc_37(){ addFrameScript(27, frame28); } function frame28(){ stop(); } } }//package eracer_fla
Section 261
//TrollyContainer_mc_62 (eracer_fla.TrollyContainer_mc_62) package eracer_fla { import flash.display.*; public dynamic class TrollyContainer_mc_62 extends MovieClip { public var contents:MovieClip; public var backward:MovieClip; public var forward:MovieClip; public function TrollyContainer_mc_62(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package eracer_fla
Section 262
//Color (fl.motion.Color) package fl.motion { import flash.display.*; import flash.geom.*; public class Color extends ColorTransform { private var _tintColor:Number; private var _tintMultiplier:Number; public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){ this._tintColor = 0; this._tintMultiplier = 0; super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); } public function get brightness():Number{ return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1)); } public function set brightness(_arg1:Number):void{ if (_arg1 > 1){ _arg1 = 1; } else { if (_arg1 < -1){ _arg1 = -1; }; }; var _local2:Number = (1 - Math.abs(_arg1)); var _local3:Number = 0; if (_arg1 > 0){ _local3 = (_arg1 * 0xFF); }; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2)); this.redOffset = (this.greenOffset = (this.blueOffset = _local3)); } public function setTint(_arg1:uint, _arg2:Number):void{ this._tintColor = _arg1; this._tintMultiplier = _arg2; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2))); var _local3:uint = ((_arg1 >> 16) & 0xFF); var _local4:uint = ((_arg1 >> 8) & 0xFF); var _local5:uint = (_arg1 & 0xFF); this.redOffset = Math.round((_local3 * _arg2)); this.greenOffset = Math.round((_local4 * _arg2)); this.blueOffset = Math.round((_local5 * _arg2)); } public function get tintColor():uint{ return (this._tintColor); } public function set tintColor(_arg1:uint):void{ this.setTint(_arg1, this.tintMultiplier); } private function deriveTintColor():uint{ var _local1:Number = (1 / this.tintMultiplier); var _local2:uint = Math.round((this.redOffset * _local1)); var _local3:uint = Math.round((this.greenOffset * _local1)); var _local4:uint = Math.round((this.blueOffset * _local1)); var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4); return (_local5); } public function get tintMultiplier():Number{ return (this._tintMultiplier); } public function set tintMultiplier(_arg1:Number):void{ this.setTint(this.tintColor, _arg1); } private function parseXML(_arg1:XML=null):Color{ var _local3:XML; var _local4:String; var _local5:uint; if (!_arg1){ return (this); }; var _local2:XML = _arg1.elements()[0]; if (!_local2){ return (this); }; for each (_local3 in _local2.attributes()) { _local4 = _local3.localName(); if (_local4 == "tintColor"){ _local5 = (Number(_local3.toString()) as uint); this.tintColor = _local5; } else { this[_local4] = Number(_local3.toString()); }; }; return (this); } public static function fromXML(_arg1:XML):Color{ return (Color(new (Color).parseXML(_arg1))); } public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{ var _local4:Number = (1 - _arg3); var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3))); return (_local5); } public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{ var _local4:Number = (1 - _arg3); var _local5:uint = ((_arg1 >> 24) & 0xFF); var _local6:uint = ((_arg1 >> 16) & 0xFF); var _local7:uint = ((_arg1 >> 8) & 0xFF); var _local8:uint = (_arg1 & 0xFF); var _local9:uint = ((_arg2 >> 24) & 0xFF); var _local10:uint = ((_arg2 >> 16) & 0xFF); var _local11:uint = ((_arg2 >> 8) & 0xFF); var _local12:uint = (_arg2 & 0xFF); var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3)); var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3)); var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3)); var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3)); var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16); return (_local17); } } }//package fl.motion
Section 263
//CollectableFlip (CollectableFlip) package { import ecomExpo.racingEngine.*; public dynamic class CollectableFlip extends Collectable { public function CollectableFlip(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 264
//CollectableFreeze (CollectableFreeze) package { import ecomExpo.racingEngine.*; public dynamic class CollectableFreeze extends Collectable { public function CollectableFreeze(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 265
//CollectableInvisible (CollectableInvisible) package { import ecomExpo.racingEngine.*; public dynamic class CollectableInvisible extends Collectable { public function CollectableInvisible(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 266
//CollectableNos (CollectableNos) package { import ecomExpo.racingEngine.*; public dynamic class CollectableNos extends Collectable { public function CollectableNos(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 267
//CollectableShield (CollectableShield) package { import ecomExpo.racingEngine.*; public dynamic class CollectableShield extends Collectable { public function CollectableShield(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 268
//CollectableSpanner (CollectableSpanner) package { import ecomExpo.racingEngine.*; public dynamic class CollectableSpanner extends Collectable { public function CollectableSpanner(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 269
//CollectableStar (CollectableStar) package { import ecomExpo.racingEngine.*; public dynamic class CollectableStar extends Collectable { public function CollectableStar(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 270
//CollectableTyre (CollectableTyre) package { import ecomExpo.racingEngine.*; public dynamic class CollectableTyre extends Collectable { public function CollectableTyre(){ addFrameScript(20, frame21, 29, frame30); } function frame21(){ gotoAndPlay(1); } function frame30(){ removeSpriteFromWorld(); } } }//package
Section 271
//Document (Document) package { import flash.events.*; import flash.display.*; import flash.net.*; import console.tracking.*; import ecomExpo.menus.*; import console.sounds.*; import console.connection.*; import console.security.*; import console.events.*; import console.loadurl.*; import com.stampy.frames.*; import com.stampy.contextmenu.*; import flash.system.*; public class Document extends MovieClip { private var _menuManager:MenuManager; private var _token:String; private var _country:String; private static const MOCHI:String = new String("de0cea85"); private static const GOOGLE:String = new String("UA-15558198-6"); public function Document(){ addFrameScript(0, frame1, 2, frame3); KokoAction.domain = new String("http://eracer.kokogames.co.uk"); addEventListener(Event.ADDED_TO_STAGE, onStage); addEventListener(Event.REMOVED_FROM_STAGE, offStage); } private function init():void{ tracking(); mouse(); StaticEventDispatch.addEventListener(Event.COMPLETE, loadComplete); crossDomain(); fetchToken(); customContextMenu(); addChild(new MenuBackground()); addChild((_menuManager = new MenuManager())); _menuManager.showMenu(MenuManager.PRELOAD_MENU, MenuTransitions.TRANSITION_BASIC_FADE); } private function customContextMenu():void{ var _local1:CustomContextMenu = new CustomContextMenu(this); _local1.addMenuItem("Ecommerce Expo", false, linkClient, KokoAction.url_link_client1); _local1.addMenuItem("Advergame by KokoDigital", false, linkKoko, KokoAction.url_link_koko); _local1.addMenuItem("Play more games", false, linkKoko, KokoAction.url_link_koko); } private function linkKoko(_arg1:String):void{ Analytics.dispatchTrackingEvent("LinkKoko"); navigateToURL(new URLRequest(_arg1), "_blank"); } private function linkClient(_arg1:String):void{ Analytics.dispatchTrackingEvent("LinkClient"); navigateToURL(new URLRequest(_arg1), "_blank"); } private function loadComplete(_arg1:Event):void{ gotoAndPlay(2); } private function crossDomain():void{ Security.allowDomain("*"); Security.loadPolicyFile(KokoAction.url_crossdomain); } private function fetchToken():void{ Token.request(KokoAction.url_action_token, recievedToken, true); } private function recievedToken():void{ _token = Token.encypted; _country = Token.getVar("country_code"); } private function onStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onStage); FrameUtils.onEnterFrame(3, this, loadSound); init(); } private function loadSound():void{ SoundUtils.addMusic("Music1", 0.6); SoundUtils.addMusic("Music2", 0.6); SoundUtils.addSFX("SFX1"); SoundUtils.addSFX("SFX2"); SoundUtils.addSFX("SFX3"); SoundUtils.addSFX("SFX4"); SoundUtils.addSFX("SFX5"); SoundUtils.addSFX("SFX6"); SoundUtils.addSFX("SFX7"); SoundUtils.addSFX("SFX8"); SoundUtils.addSFX("SFX_CRASH1"); SoundUtils.addSFX("SFX_CRASH2"); SoundUtils.addSFX("SFX_CRASH3"); } private function tracking():void{ addChild(Analytics.getInstance()); Analytics.addTrackingCode(Analytics.SERVICE_GOOGLE, GOOGLE); Analytics.addTrackingCode(Analytics.SERVICE_MOCHI, MOCHI); Analytics.addTrackingEvent("MainMenu", Analytics.TRACK_EVENT, Analytics.SERVICE_GOOGLE); Analytics.addTrackingEvent("HowMenu", Analytics.TRACK_EVENT, Analytics.SERVICE_GOOGLE); Analytics.addTrackingEvent("HighScoresMenu", Analytics.TRACK_EVENT, Analytics.SERVICE_GOOGLE); Analytics.addTrackingEvent("GameOverMenu", Analytics.TRACK_EVENT, Analytics.SERVICE_GOOGLE); Analytics.addTrackingEvent("LinkClient", Analytics.TRACK_CLICKTHROUGH, Analytics.SERVICE_GOOGLE); Analytics.addTrackingEvent("LinkKoko", Analytics.TRACK_CLICKTHROUGH, Analytics.SERVICE_GOOGLE); Analytics.addTrackingEvent("LinkPrivacy", Analytics.TRACK_CLICKTHROUGH, Analytics.SERVICE_GOOGLE); } private function offStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, offStage); removeEventListener(MouseEvent.CLICK, mouseClick); removeChild(_menuManager); _menuManager = null; } private function mouse():void{ addEventListener(MouseEvent.CLICK, mouseClick); } private function mouseClick(_arg1:MouseEvent):void{ switch (_arg1.target.name){ case "koko_btn": SoundUtils.playSFX("SFX1"); Analytics.dispatchTrackingEvent("LinkKoko"); OpenURL.navigateURL(KokoAction.url_link_koko); break; }; } function frame1(){ stop(); } function frame3(){ stop(); } } }//package
Section 272
//FloorTile (FloorTile) package { import flash.display.*; public dynamic class FloorTile extends BitmapData { public function FloorTile(_arg1:int=650, _arg2:int=450){ super(_arg1, _arg2); } } }//package
Section 273
//GateA (GateA) package { import flash.display.*; public dynamic class GateA extends MovieClip { } }//package
Section 274
//GateB (GateB) package { import flash.display.*; public dynamic class GateB extends MovieClip { } }//package
Section 275
//GateC (GateC) package { import flash.display.*; public dynamic class GateC extends MovieClip { } }//package
Section 276
//Koko_off (Koko_off) package { import flash.display.*; public dynamic class Koko_off extends BitmapData { public function Koko_off(_arg1:int=201, _arg2:int=26){ super(_arg1, _arg2); } } }//package
Section 277
//Koko_on (Koko_on) package { import flash.display.*; public dynamic class Koko_on extends BitmapData { public function Koko_on(_arg1:int=201, _arg2:int=26){ super(_arg1, _arg2); } } }//package
Section 278
//Music1 (Music1) package { import flash.media.*; public dynamic class Music1 extends Sound { } }//package
Section 279
//Music2 (Music2) package { import flash.media.*; public dynamic class Music2 extends Sound { } }//package
Section 280
//ScoreEntry (ScoreEntry) package { import flash.display.*; import flash.text.*; public dynamic class ScoreEntry extends MovieClip { public var score_txt:TextField; public var name_txt:TextField; public var position_txt:TextField; } }//package
Section 281
//SFX_CRASH1 (SFX_CRASH1) package { import flash.media.*; public dynamic class SFX_CRASH1 extends Sound { } }//package
Section 282
//SFX_CRASH2 (SFX_CRASH2) package { import flash.media.*; public dynamic class SFX_CRASH2 extends Sound { } }//package
Section 283
//SFX_CRASH3 (SFX_CRASH3) package { import flash.media.*; public dynamic class SFX_CRASH3 extends Sound { } }//package
Section 284
//SFX1 (SFX1) package { import flash.media.*; public dynamic class SFX1 extends Sound { } }//package
Section 285
//SFX2 (SFX2) package { import flash.media.*; public dynamic class SFX2 extends Sound { } }//package
Section 286
//SFX3 (SFX3) package { import flash.media.*; public dynamic class SFX3 extends Sound { } }//package
Section 287
//SFX4 (SFX4) package { import flash.media.*; public dynamic class SFX4 extends Sound { } }//package
Section 288
//SFX5 (SFX5) package { import flash.media.*; public dynamic class SFX5 extends Sound { } }//package
Section 289
//SFX6 (SFX6) package { import flash.media.*; public dynamic class SFX6 extends Sound { } }//package
Section 290
//SFX7 (SFX7) package { import flash.media.*; public dynamic class SFX7 extends Sound { } }//package
Section 291
//SFX8 (SFX8) package { import flash.media.*; public dynamic class SFX8 extends Sound { } }//package
Section 292
//SparkSpriteSheet (SparkSpriteSheet) package { import flash.display.*; public dynamic class SparkSpriteSheet extends BitmapData { public function SparkSpriteSheet(_arg1:int=208, _arg2:int=32){ super(_arg1, _arg2); } } }//package
Section 293
//SparkSpriteSheet1 (SparkSpriteSheet1) package { import flash.display.*; public dynamic class SparkSpriteSheet1 extends BitmapData { public function SparkSpriteSheet1(_arg1:int=208, _arg2:int=32){ super(_arg1, _arg2); } } }//package
Section 294
//SparkSpriteSheet2 (SparkSpriteSheet2) package { import flash.display.*; public dynamic class SparkSpriteSheet2 extends BitmapData { public function SparkSpriteSheet2(_arg1:int=208, _arg2:int=32){ super(_arg1, _arg2); } } }//package
Section 295
//SparkSpriteSheet3 (SparkSpriteSheet3) package { import flash.display.*; public dynamic class SparkSpriteSheet3 extends BitmapData { public function SparkSpriteSheet3(_arg1:int=208, _arg2:int=32){ super(_arg1, _arg2); } } }//package
Section 296
//Stand1 (Stand1) package { import flash.display.*; public dynamic class Stand1 extends BitmapData { public function Stand1(_arg1:int=468, _arg2:int=468){ super(_arg1, _arg2); } } }//package
Section 297
//Stand2 (Stand2) package { import flash.display.*; public dynamic class Stand2 extends BitmapData { public function Stand2(_arg1:int=468, _arg2:int=468){ super(_arg1, _arg2); } } }//package
Section 298
//Stand3 (Stand3) package { import flash.display.*; public dynamic class Stand3 extends BitmapData { public function Stand3(_arg1:int=468, _arg2:int=468){ super(_arg1, _arg2); } } }//package
Section 299
//Stand4 (Stand4) package { import flash.display.*; public dynamic class Stand4 extends BitmapData { public function Stand4(_arg1:int=468, _arg2:int=468){ super(_arg1, _arg2); } } }//package
Section 300
//Stand5 (Stand5) package { import flash.display.*; public dynamic class Stand5 extends BitmapData { public function Stand5(_arg1:int=468, _arg2:int=468){ super(_arg1, _arg2); } } }//package
Section 301
//Stand6 (Stand6) package { import flash.display.*; public dynamic class Stand6 extends BitmapData { public function Stand6(_arg1:int=468, _arg2:int=468){ super(_arg1, _arg2); } } }//package
Section 302
//Stand7 (Stand7) package { import flash.display.*; public dynamic class Stand7 extends BitmapData { public function Stand7(_arg1:int=1220, _arg2:int=468){ super(_arg1, _arg2); } } }//package
Section 303
//TrollyShadow (TrollyShadow) package { import flash.display.*; public dynamic class TrollyShadow extends MovieClip { } }//package
Section 304
//WallTile (WallTile) package { import flash.display.*; public dynamic class WallTile extends BitmapData { public function WallTile(_arg1:int=600, _arg2:int=600){ super(_arg1, _arg2); } } }//package

Library Items

Symbol 1 Bitmap {Koko_on}Used by:321
Symbol 2 Bitmap {Koko_off}Used by:321
Symbol 3 BitmapUsed by:4
Symbol 4 GraphicUses:3Used by:5
Symbol 5 MovieClipUses:4Used by:19 95
Symbol 6 BitmapUsed by:7
Symbol 7 GraphicUses:6Used by:12
Symbol 8 GraphicUsed by:9
Symbol 9 ButtonUses:8Used by:12
Symbol 10 BitmapUsed by:11
Symbol 11 GraphicUses:10Used by:12
Symbol 12 MovieClip {ecomExpo.menus.AudioButton}Uses:7 9 11Used by:19 43 95 135 138 184
Symbol 13 BitmapUsed by:14
Symbol 14 GraphicUses:13Used by:18 133
Symbol 15 BitmapUsed by:16
Symbol 16 GraphicUses:15Used by:17
Symbol 17 MovieClipUses:16Used by:18 35 133
Symbol 18 MovieClipUses:14 17Used by:19
Symbol 19 MovieClip {ecomExpo.menus.PreloaderMenu}Uses:5 12 18Used by:321
Symbol 20 BitmapUsed by:22
Symbol 21 BitmapUsed by:22
Symbol 22 GraphicUses:20 21Used by:23
Symbol 23 MovieClip {ecomExpo.menus.MenuBackground}Uses:22Used by:321
Symbol 24 BitmapUsed by:25
Symbol 25 GraphicUses:24Used by:35
Symbol 26 FontUsed by:27 28 29 30 34 144 145 146 147 148 149 150 151 171 172 173 174 178 296 297 298
Symbol 27 EditableTextUses:26Used by:35
Symbol 28 EditableTextUses:26Used by:35
Symbol 29 EditableTextUses:26Used by:35
Symbol 30 TextUses:26Used by:35
Symbol 31 BitmapUsed by:32
Symbol 32 GraphicUses:31Used by:33
Symbol 33 MovieClipUses:32Used by:35
Symbol 34 EditableTextUses:26Used by:35
Symbol 35 MovieClip {ecomExpo.game.TimeDisplay}Uses:25 27 28 29 30 17 33 34Used by:43
Symbol 36 BitmapUsed by:37
Symbol 37 GraphicUses:36Used by:38
Symbol 38 MovieClipUses:37Used by:39
Symbol 39 MovieClipUses:38Used by:43
Symbol 40 BitmapUsed by:41
Symbol 41 GraphicUses:40Used by:42
Symbol 42 MovieClipUses:41Used by:43
Symbol 43 MovieClip {ecomExpo.menus.GameMenu}Uses:12 35 39 42Used by:321
Symbol 44 BitmapUsed by:45
Symbol 45 GraphicUses:44Used by:48
Symbol 46 BitmapUsed by:47
Symbol 47 GraphicUses:46Used by:48
Symbol 48 ButtonUses:45 47Used by:95 135 138 184
Symbol 49 BitmapUsed by:50
Symbol 50 GraphicUses:49Used by:60 64 93
Symbol 51 FontUsed by:52 59 62 63 66 92
Symbol 52 TextUses:51Used by:60
Symbol 53 GraphicUsed by:54
Symbol 54 ButtonUses:53Used by:60 64 93 105 114
Symbol 55 GraphicUsed by:56
Symbol 56 ButtonUses:55Used by:60 64 93 105 114
Symbol 57 BitmapUsed by:58
Symbol 58 GraphicUses:57Used by:60 64 93
Symbol 59 TextUses:51Used by:60
Symbol 60 MovieClip {eracer_fla.MenuBTN_PlayGame_15}Uses:50 52 54 56 58 59Used by:61
Symbol 61 MovieClip {eracer_fla.MenuButton_PlayGame_mc_14}Uses:60Used by:95
Symbol 62 TextUses:51Used by:64
Symbol 63 TextUses:51Used by:64
Symbol 64 MovieClip {eracer_fla.MenuBTN_HighScores_19}Uses:50 62 54 56 58 63Used by:65
Symbol 65 MovieClip {eracer_fla.MenuButton_HighScores_mc_18}Uses:64Used by:95
Symbol 66 TextUses:51Used by:93
Symbol 67 BitmapUsed by:68
Symbol 68 GraphicUses:67Used by:72
Symbol 69 BitmapUsed by:70
Symbol 70 GraphicUses:69Used by:71 72 75 78 81 84 87 90
Symbol 71 MovieClipUses:70Used by:72 75 78 81 84 87 90
Symbol 72 ButtonUses:68 71 70Used by:91
Symbol 73 BitmapUsed by:74
Symbol 74 GraphicUses:73Used by:75
Symbol 75 ButtonUses:74 71 70Used by:91
Symbol 76 BitmapUsed by:77
Symbol 77 GraphicUses:76Used by:78
Symbol 78 ButtonUses:77 71 70Used by:91
Symbol 79 BitmapUsed by:80
Symbol 80 GraphicUses:79Used by:81
Symbol 81 ButtonUses:80 71 70Used by:91
Symbol 82 BitmapUsed by:83
Symbol 83 GraphicUses:82Used by:84
Symbol 84 ButtonUses:83 71 70Used by:91
Symbol 85 BitmapUsed by:86
Symbol 86 GraphicUses:85Used by:87
Symbol 87 ButtonUses:86 71 70Used by:91
Symbol 88 BitmapUsed by:89
Symbol 89 GraphicUses:88Used by:90
Symbol 90 ButtonUses:89 71 70Used by:91
Symbol 91 MovieClipUses:72 75 78 81 84 87 90Used by:93
Symbol 92 TextUses:51Used by:93
Symbol 93 MovieClip {eracer_fla.MenuBTN_Share_21}Uses:50 66 54 91 56 58 92Used by:94
Symbol 94 MovieClip {eracer_fla.MenuButton_Share_mc_20}Uses:93Used by:95
Symbol 95 MovieClip {ecomExpo.menus.MainMenu}Uses:5 48 12 61 65 94Used by:321
Symbol 96 BitmapUsed by:97
Symbol 97 GraphicUses:96Used by:98
Symbol 98 MovieClipUses:97Used by:135 138
Symbol 99 BitmapUsed by:101
Symbol 100 BitmapUsed by:101
Symbol 101 GraphicUses:99 100Used by:105
Symbol 102 BitmapUsed by:104
Symbol 103 BitmapUsed by:104
Symbol 104 GraphicUses:102 103Used by:105
Symbol 105 MovieClip {eracer_fla.MenuBTNHow_Play_34}Uses:101 54 56 104Used by:106
Symbol 106 MovieClip {eracer_fla.MenuButtonHow_Play_mc_33}Uses:105Used by:135
Symbol 107 BitmapUsed by:108
Symbol 108 GraphicUses:107Used by:114
Symbol 109 BitmapUsed by:110
Symbol 110 GraphicUses:109Used by:114
Symbol 111 BitmapUsed by:113
Symbol 112 BitmapUsed by:113
Symbol 113 GraphicUses:111 112Used by:114
Symbol 114 MovieClip {eracer_fla.MenuBTN_Home_36}Uses:108 110 54 56 113Used by:115
Symbol 115 MovieClip {eracer_fla.MenuButton_Home_mc_35}Uses:114Used by:135 138 184
Symbol 116 BitmapUsed by:118
Symbol 117 BitmapUsed by:118
Symbol 118 GraphicUses:116 117Used by:135
Symbol 119 BitmapUsed by:120
Symbol 120 GraphicUses:119Used by:121
Symbol 121 MovieClipUses:120Used by:122
Symbol 122 MovieClipUses:121Used by:131
Symbol 123 BitmapUsed by:124
Symbol 124 GraphicUses:123Used by:125
Symbol 125 MovieClipUses:124Used by:126
Symbol 126 MovieClipUses:125Used by:131
Symbol 127 BitmapUsed by:128
Symbol 128 GraphicUses:127Used by:129
Symbol 129 MovieClipUses:128Used by:130
Symbol 130 MovieClipUses:129Used by:131
Symbol 131 MovieClip {eracer_fla.TextLabels_mc_37}Uses:122 126 130Used by:135
Symbol 132 GraphicUsed by:134
Symbol 133 MovieClipUses:14 17Used by:134
Symbol 134 MovieClipUses:132 133Used by:135 138
Symbol 135 MovieClip {ecomExpo.menus.HowMenu}Uses:12 98 48 106 115 118 131 134Used by:321
Symbol 136 BitmapUsed by:137
Symbol 137 GraphicUses:136Used by:138
Symbol 138 MovieClip {ecomExpo.menus.HighScoresMenu}Uses:12 98 48 115 137 134Used by:321
Symbol 139 BitmapUsed by:140
Symbol 140 GraphicUses:139Used by:141
Symbol 141 MovieClipUses:140Used by:184
Symbol 142 BitmapUsed by:143
Symbol 143 GraphicUses:142Used by:184
Symbol 144 TextUses:26Used by:184
Symbol 145 EditableTextUses:26Used by:184
Symbol 146 TextUses:26Used by:184
Symbol 147 TextUses:26Used by:184
Symbol 148 TextUses:26Used by:184
Symbol 149 TextUses:26Used by:184
Symbol 150 TextUses:26Used by:152
Symbol 151 TextUses:26Used by:152
Symbol 152 ButtonUses:150 151Used by:184
Symbol 153 BitmapUsed by:154
Symbol 154 GraphicUses:153Used by:157
Symbol 155 BitmapUsed by:156
Symbol 156 GraphicUses:155Used by:157
Symbol 157 MovieClip {ecomExpo.menus.TickBox}Uses:154 156Used by:184
Symbol 158 BitmapUsed by:159
Symbol 159 GraphicUses:158Used by:162
Symbol 160 BitmapUsed by:161
Symbol 161 GraphicUses:160Used by:162
Symbol 162 ButtonUses:159 161Used by:184
Symbol 163 BitmapUsed by:164
Symbol 164 GraphicUses:163Used by:168
Symbol 165 BitmapUsed by:166
Symbol 166 GraphicUses:165Used by:168
Symbol 167 GraphicUsed by:168
Symbol 168 ButtonUses:164 166 167Used by:184
Symbol 169 BitmapUsed by:170
Symbol 170 GraphicUses:169Used by:184
Symbol 171 TextUses:26Used by:184
Symbol 172 TextUses:26Used by:184
Symbol 173 EditableTextUses:26Used by:184
Symbol 174 EditableTextUses:26Used by:184
Symbol 175 BitmapUsed by:176
Symbol 176 GraphicUses:175Used by:177 179
Symbol 177 MovieClip {eracer_fla.ErrorMarker_mc_53}Uses:176Used by:184
Symbol 178 TextUses:26Used by:179
Symbol 179 MovieClip {eracer_fla.ErrorMessage_mc_54}Uses:176 178Used by:184
Symbol 180 BitmapUsed by:181
Symbol 181 GraphicUses:180Used by:184
Symbol 182 BitmapUsed by:183
Symbol 183 GraphicUses:182Used by:184
Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu}Uses:12 141 48 115 143 144 145 146 147 148 149 152 157 162 168 170 171 172 173 174 177 179 181 183Used by:321
Symbol 185 Bitmap {FloorTile}Used by:321
Symbol 186 BitmapUsed by:187 189
Symbol 187 GraphicUses:186Used by:188
Symbol 188 MovieClip {GateA}Uses:187Used by:321
Symbol 189 GraphicUses:186Used by:190
Symbol 190 MovieClip {GateB}Uses:189Used by:321
Symbol 191 BitmapUsed by:192
Symbol 192 GraphicUses:191Used by:193
Symbol 193 MovieClip {GateC}Uses:192Used by:321
Symbol 194 Bitmap {SparkSpriteSheet}Used by:321
Symbol 195 Bitmap {SparkSpriteSheet1}Used by:321
Symbol 196 Bitmap {SparkSpriteSheet2}Used by:321
Symbol 197 Bitmap {SparkSpriteSheet3}Used by:321
Symbol 198 GraphicUsed by:199
Symbol 199 MovieClipUses:198Used by:222 225
Symbol 200 GraphicUsed by:201
Symbol 201 MovieClipUses:200Used by:222
Symbol 202 GraphicUsed by:203
Symbol 203 MovieClipUses:202Used by:222 225
Symbol 204 GraphicUsed by:205
Symbol 205 MovieClipUses:204Used by:222
Symbol 206 GraphicUsed by:207
Symbol 207 MovieClipUses:206Used by:222 225
Symbol 208 GraphicUsed by:209
Symbol 209 MovieClipUses:208Used by:222 225
Symbol 210 GraphicUsed by:211
Symbol 211 MovieClipUses:210Used by:222 225
Symbol 212 GraphicUsed by:213
Symbol 213 MovieClipUses:212Used by:222
Symbol 214 GraphicUsed by:215
Symbol 215 MovieClipUses:214Used by:222 225
Symbol 216 GraphicUsed by:217
Symbol 217 MovieClipUses:216Used by:222 225
Symbol 218 GraphicUsed by:219
Symbol 219 MovieClipUses:218Used by:222 225
Symbol 220 GraphicUsed by:221
Symbol 221 MovieClipUses:220Used by:222
Symbol 222 MovieClipUses:199 201 203 205 207 209 211 213 215 217 219 221Used by:239
Symbol 223 GraphicUsed by:224
Symbol 224 MovieClipUses:223Used by:225
Symbol 225 MovieClipUses:199 219 203 224 207 209 211 215 217Used by:239
Symbol 226 GraphicUsed by:238
Symbol 227 GraphicUsed by:238
Symbol 228 GraphicUsed by:238
Symbol 229 GraphicUsed by:238
Symbol 230 GraphicUsed by:238
Symbol 231 GraphicUsed by:238
Symbol 232 GraphicUsed by:238
Symbol 233 GraphicUsed by:238
Symbol 234 GraphicUsed by:238
Symbol 235 GraphicUsed by:238
Symbol 236 GraphicUsed by:238
Symbol 237 GraphicUsed by:238
Symbol 238 MovieClip {eracer_fla.p_cartcontents_78}Uses:226 227 228 229 230 231 232 233 234 235 236 237Used by:239
Symbol 239 MovieClip {eracer_fla.TrollyContainer_mc_62}Uses:222 225 238Used by:244
Symbol 240 GraphicUsed by:241
Symbol 241 MovieClipUses:240Used by:242
Symbol 242 MovieClipUses:241Used by:243
Symbol 243 MovieClipUses:242Used by:244
Symbol 244 MovieClip {ecomExpo.game.Character}Uses:239 243Used by:321
Symbol 245 BitmapUsed by:246
Symbol 246 GraphicUses:245Used by:247
Symbol 247 MovieClipUses:246Used by:248
Symbol 248 MovieClip {TrollyShadow}Uses:247Used by:321
Symbol 249 GraphicUsed by:250
Symbol 250 MovieClipUses:249Used by:255 259 263 267 268 269 273 274
Symbol 251 BitmapUsed by:253
Symbol 252 BitmapUsed by:253 257 261 265 271
Symbol 253 GraphicUses:251 252Used by:254
Symbol 254 MovieClipUses:253Used by:255 268
Symbol 255 MovieClip {CollectableFreeze}Uses:250 254Used by:321
Symbol 256 BitmapUsed by:257
Symbol 257 GraphicUses:256 252Used by:258
Symbol 258 MovieClipUses:257Used by:259
Symbol 259 MovieClip {CollectableTyre}Uses:250 258Used by:321
Symbol 260 BitmapUsed by:261
Symbol 261 GraphicUses:260 252Used by:262
Symbol 262 MovieClipUses:261Used by:263 274
Symbol 263 MovieClip {CollectableInvisible}Uses:250 262Used by:321
Symbol 264 BitmapUsed by:265
Symbol 265 GraphicUses:264 252Used by:266
Symbol 266 MovieClipUses:265Used by:267 269
Symbol 267 MovieClip {CollectableNos}Uses:250 266Used by:321
Symbol 268 MovieClip {CollectableSpanner}Uses:250 254Used by:321
Symbol 269 MovieClip {CollectableFlip}Uses:250 266Used by:321
Symbol 270 BitmapUsed by:271
Symbol 271 GraphicUses:270 252Used by:272
Symbol 272 MovieClipUses:271Used by:273
Symbol 273 MovieClip {CollectableShield}Uses:250 272Used by:321
Symbol 274 MovieClip {CollectableStar}Uses:250 262Used by:321
Symbol 275 GraphicUsed by:276
Symbol 276 MovieClipUses:275Used by:287 288 290 291 292 294 295
Symbol 277 GraphicUsed by:278
Symbol 278 MovieClipUses:277Used by:287 288 291 292 294 295
Symbol 279 GraphicUsed by:280
Symbol 280 MovieClipUses:279Used by:287 289 290 291 292 294 295
Symbol 281 GraphicUsed by:282
Symbol 282 MovieClipUses:281Used by:287 289 290 291 292 294 295
Symbol 283 GraphicUsed by:284
Symbol 284 MovieClipUses:283Used by:287 288 289 292 294 295
Symbol 285 GraphicUsed by:286
Symbol 286 MovieClipUses:285Used by:287 288 289 290 294 295
Symbol 287 MovieClip {ecomExpo.game.CrowdDouble}Uses:276 278 280 282 284 286Used by:321
Symbol 288 MovieClipUses:286 284 276 278Used by:293
Symbol 289 MovieClipUses:284 282 286 280Used by:293
Symbol 290 MovieClipUses:286 280 276 282Used by:293
Symbol 291 MovieClipUses:282 280 278 276Used by:293
Symbol 292 MovieClipUses:282 280 284 276 278Used by:293
Symbol 293 MovieClip {ecomExpo.game.CrowdMember}Uses:288 289 290 291 292Used by:321
Symbol 294 MovieClip {ecomExpo.game.CrowdSingle}Uses:276 278 280 286 282 284Used by:321
Symbol 295 MovieClip {ecomExpo.game.CrowdTripple}Uses:276 280 282 286 284 278Used by:321
Symbol 296 EditableTextUses:26Used by:299
Symbol 297 EditableTextUses:26Used by:299
Symbol 298 EditableTextUses:26Used by:299
Symbol 299 MovieClip {ScoreEntry}Uses:296 297 298Used by:321
Symbol 300 Bitmap {Stand1}Used by:321
Symbol 301 Bitmap {Stand2}Used by:321
Symbol 302 Bitmap {Stand3}Used by:321
Symbol 303 Bitmap {Stand4}Used by:321
Symbol 304 Bitmap {Stand5}Used by:321
Symbol 305 Bitmap {Stand6}Used by:321
Symbol 306 Bitmap {Stand7}Used by:321
Symbol 307 Bitmap {WallTile}Used by:321
Symbol 308 Sound {Music2}Used by:321
Symbol 309 Sound {Music1}Used by:321
Symbol 310 Sound {SFX8}Used by:321
Symbol 311 Sound {SFX7}Used by:321
Symbol 312 Sound {SFX_CRASH3}Used by:321
Symbol 313 Sound {SFX_CRASH2}Used by:321
Symbol 314 Sound {SFX2}Used by:321
Symbol 315 Sound {SFX3}Used by:321
Symbol 316 Sound {SFX1}Used by:321
Symbol 317 Sound {SFX4}Used by:321
Symbol 318 Sound {SFX5}Used by:321
Symbol 319 Sound {SFX_CRASH1}Used by:321
Symbol 320 Sound {SFX6}Used by:321
Symbol 321 MovieClip {eracer_fla.SpriteDump_mc_1}Uses:43 95 135 138 184 23 19 185 188 190 193 194 195 196 197 244 248 255 259 263 267 268 269 273 274 287 293 294 295 299 2 1 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320Used by:Timeline

Instance Names

"audio_off"Symbol 12 MovieClip {ecomExpo.menus.AudioButton} Frame 1Symbol 9 Button
"audio_on"Symbol 12 MovieClip {ecomExpo.menus.AudioButton} Frame 2Symbol 9 Button
"segment1"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment2"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment3"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment4"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment5"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment6"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment7"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment8"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment9"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"segment10"Symbol 18 MovieClip Frame 1Symbol 17 MovieClip
"audioButton_mc"Symbol 19 MovieClip {ecomExpo.menus.PreloaderMenu} Frame 1Symbol 12 MovieClip {ecomExpo.menus.AudioButton}
"loadingBar"Symbol 19 MovieClip {ecomExpo.menus.PreloaderMenu} Frame 1Symbol 18 MovieClip
"mins_txt"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 27 EditableText
"hunds_txt"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 28 EditableText
"secs_txt"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 29 EditableText
"segment1"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment2"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment3"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment4"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment5"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment6"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment7"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment8"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment9"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"segment10"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 17 MovieClip
"score_txt"Symbol 35 MovieClip {ecomExpo.game.TimeDisplay} Frame 1Symbol 34 EditableText
"audioButton_mc"Symbol 43 MovieClip {ecomExpo.menus.GameMenu} Frame 1Symbol 12 MovieClip {ecomExpo.menus.AudioButton}
"time_mc"Symbol 43 MovieClip {ecomExpo.menus.GameMenu} Frame 1Symbol 35 MovieClip {ecomExpo.game.TimeDisplay}
"hurryMessage"Symbol 43 MovieClip {ecomExpo.menus.GameMenu} Frame 1Symbol 39 MovieClip
"timeBonus"Symbol 43 MovieClip {ecomExpo.menus.GameMenu} Frame 1Symbol 42 MovieClip
"PlayGameButtonOver"Symbol 60 MovieClip {eracer_fla.MenuBTN_PlayGame_15} Frame 1Symbol 54 Button
"PlayGameButtonOut"Symbol 60 MovieClip {eracer_fla.MenuBTN_PlayGame_15} Frame 2Symbol 56 Button
"PlayGame"Symbol 61 MovieClip {eracer_fla.MenuButton_PlayGame_mc_14} Frame 1Symbol 60 MovieClip {eracer_fla.MenuBTN_PlayGame_15}
"HighScoreButtonOver"Symbol 64 MovieClip {eracer_fla.MenuBTN_HighScores_19} Frame 1Symbol 54 Button
"HighScoreButtonOut"Symbol 64 MovieClip {eracer_fla.MenuBTN_HighScores_19} Frame 2Symbol 56 Button
"HighScores"Symbol 65 MovieClip {eracer_fla.MenuButton_HighScores_mc_18} Frame 1Symbol 64 MovieClip {eracer_fla.MenuBTN_HighScores_19}
"delicious"Symbol 91 MovieClip Frame 1Symbol 72 Button
"facebook"Symbol 91 MovieClip Frame 1Symbol 75 Button
"myspace"Symbol 91 MovieClip Frame 1Symbol 78 Button
"twitter"Symbol 91 MovieClip Frame 1Symbol 81 Button
"digg"Symbol 91 MovieClip Frame 1Symbol 84 Button
"linkedin"Symbol 91 MovieClip Frame 1Symbol 87 Button
"stumble"Symbol 91 MovieClip Frame 1Symbol 90 Button
"shareButtonOver"Symbol 93 MovieClip {eracer_fla.MenuBTN_Share_21} Frame 1Symbol 54 Button
"socialButtons"Symbol 93 MovieClip {eracer_fla.MenuBTN_Share_21} Frame 1Symbol 91 MovieClip
"shareButtonOut"Symbol 93 MovieClip {eracer_fla.MenuBTN_Share_21} Frame 2Symbol 56 Button
"MenuButtonShare"Symbol 94 MovieClip {eracer_fla.MenuButton_Share_mc_20} Frame 1Symbol 93 MovieClip {eracer_fla.MenuBTN_Share_21}
"ecom_btn"Symbol 95 MovieClip {ecomExpo.menus.MainMenu} Frame 1Symbol 48 Button
"audioButton_mc"Symbol 95 MovieClip {ecomExpo.menus.MainMenu} Frame 1Symbol 12 MovieClip {ecomExpo.menus.AudioButton}
"playButton"Symbol 95 MovieClip {ecomExpo.menus.MainMenu} Frame 1Symbol 61 MovieClip {eracer_fla.MenuButton_PlayGame_mc_14}
"scoreButton"Symbol 95 MovieClip {ecomExpo.menus.MainMenu} Frame 1Symbol 65 MovieClip {eracer_fla.MenuButton_HighScores_mc_18}
"shareButton"Symbol 95 MovieClip {ecomExpo.menus.MainMenu} Frame 1Symbol 94 MovieClip {eracer_fla.MenuButton_Share_mc_20}
"PlayHowButtonOver"Symbol 105 MovieClip {eracer_fla.MenuBTNHow_Play_34} Frame 1Symbol 54 Button
"PlayHowButtonOut"Symbol 105 MovieClip {eracer_fla.MenuBTNHow_Play_34} Frame 2Symbol 56 Button
"MenuButton"Symbol 106 MovieClip {eracer_fla.MenuButtonHow_Play_mc_33} Frame 1Symbol 105 MovieClip {eracer_fla.MenuBTNHow_Play_34}
"HomeButtonOver"Symbol 114 MovieClip {eracer_fla.MenuBTN_Home_36} Frame 1Symbol 54 Button
"HomeButtonOut"Symbol 114 MovieClip {eracer_fla.MenuBTN_Home_36} Frame 2Symbol 56 Button
"MenuButton"Symbol 115 MovieClip {eracer_fla.MenuButton_Home_mc_35} Frame 1Symbol 114 MovieClip {eracer_fla.MenuBTN_Home_36}
"segment1"Symbol 133 MovieClip Frame 1Symbol 17 MovieClip
"segment2"Symbol 133 MovieClip Frame 5Symbol 17 MovieClip
"segment3"Symbol 133 MovieClip Frame 9Symbol 17 MovieClip
"segment4"Symbol 133 MovieClip Frame 13Symbol 17 MovieClip
"segment5"Symbol 133 MovieClip Frame 17Symbol 17 MovieClip
"segment6"Symbol 133 MovieClip Frame 21Symbol 17 MovieClip
"segment7"Symbol 133 MovieClip Frame 25Symbol 17 MovieClip
"segment8"Symbol 133 MovieClip Frame 29Symbol 17 MovieClip
"segment9"Symbol 133 MovieClip Frame 34Symbol 17 MovieClip
"segment10"Symbol 133 MovieClip Frame 39Symbol 17 MovieClip
"loadingBar"Symbol 134 MovieClip Frame 1Symbol 133 MovieClip
"audioButton_mc"Symbol 135 MovieClip {ecomExpo.menus.HowMenu} Frame 1Symbol 12 MovieClip {ecomExpo.menus.AudioButton}
"ecom_btn"Symbol 135 MovieClip {ecomExpo.menus.HowMenu} Frame 1Symbol 48 Button
"playBTN"Symbol 135 MovieClip {ecomExpo.menus.HowMenu} Frame 1Symbol 106 MovieClip {eracer_fla.MenuButtonHow_Play_mc_33}
"homeBTN"Symbol 135 MovieClip {ecomExpo.menus.HowMenu} Frame 1Symbol 115 MovieClip {eracer_fla.MenuButton_Home_mc_35}
"loading"Symbol 135 MovieClip {ecomExpo.menus.HowMenu} Frame 1Symbol 134 MovieClip
"audioButton_mc"Symbol 138 MovieClip {ecomExpo.menus.HighScoresMenu} Frame 1Symbol 12 MovieClip {ecomExpo.menus.AudioButton}
"ecom_btn"Symbol 138 MovieClip {ecomExpo.menus.HighScoresMenu} Frame 1Symbol 48 Button
"homeBTN"Symbol 138 MovieClip {ecomExpo.menus.HighScoresMenu} Frame 1Symbol 115 MovieClip {eracer_fla.MenuButton_Home_mc_35}
"loading"Symbol 138 MovieClip {ecomExpo.menus.HighScoresMenu} Frame 1Symbol 134 MovieClip
"audioButton_mc"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 12 MovieClip {ecomExpo.menus.AudioButton}
"ecom_btn"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 48 Button
"homeBTN"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 115 MovieClip {eracer_fla.MenuButton_Home_mc_35}
"score_txt"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 145 EditableText
"privacy_btn"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 152 Button
"tickBox"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 157 MovieClip {ecomExpo.menus.TickBox}
"submit_btn"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 162 Button
"register_btn"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 168 Button
"name_txt"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 173 EditableText
"email_txt"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 174 EditableText
"error1"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 177 MovieClip {eracer_fla.ErrorMarker_mc_53}
"error2"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 177 MovieClip {eracer_fla.ErrorMarker_mc_53}
"errorMessage"Symbol 184 MovieClip {ecomExpo.menus.GameOverMenu} Frame 1Symbol 179 MovieClip {eracer_fla.ErrorMessage_mc_54}
"forward"Symbol 239 MovieClip {eracer_fla.TrollyContainer_mc_62} Frame 1Symbol 222 MovieClip
"backward"Symbol 239 MovieClip {eracer_fla.TrollyContainer_mc_62} Frame 1Symbol 225 MovieClip
"contents"Symbol 239 MovieClip {eracer_fla.TrollyContainer_mc_62} Frame 1Symbol 238 MovieClip {eracer_fla.p_cartcontents_78}
"character"Symbol 244 MovieClip {ecomExpo.game.Character} Frame 1Symbol 239 MovieClip {eracer_fla.TrollyContainer_mc_62}
"arrow"Symbol 244 MovieClip {ecomExpo.game.Character} Frame 1Symbol 243 MovieClip
"name_txt"Symbol 299 MovieClip {ScoreEntry} Frame 1Symbol 296 EditableText
"position_txt"Symbol 299 MovieClip {ScoreEntry} Frame 1Symbol 297 EditableText
"score_txt"Symbol 299 MovieClip {ScoreEntry} Frame 1Symbol 298 EditableText

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 11279 bytes "<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmln ..."

Labels

"Collect Item"Symbol 255 MovieClip {CollectableFreeze} Frame 22
"Collect Item"Symbol 259 MovieClip {CollectableTyre} Frame 22
"Collect Item"Symbol 263 MovieClip {CollectableInvisible} Frame 22
"Collect Item"Symbol 267 MovieClip {CollectableNos} Frame 22
"Collect Item"Symbol 268 MovieClip {CollectableSpanner} Frame 22
"Collect Item"Symbol 269 MovieClip {CollectableFlip} Frame 22
"Collect Item"Symbol 273 MovieClip {CollectableShield} Frame 22
"Collect Item"Symbol 274 MovieClip {CollectableStar} Frame 22




http://swfchan.com/27/134405/info.shtml
Created: 9/2 -2019 22:48:20 Last modified: 9/2 -2019 22:48:20 Server time: 21/12 -2024 17:07:34