Section 1
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2CircleDef extends b2ShapeDef {
public var radius:Number;
public var localPosition:b2Vec2;
public function b2CircleDef(){
localPosition = new b2Vec2(0, 0);
super();
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 2
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_localPosition:b2Vec2;
public var m_radius:Number;
public function b2CircleShape(_arg1:b2ShapeDef){
m_localPosition = new b2Vec2();
super(_arg1);
var _local2:b2CircleDef = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local10:Number;
var _local6:b2Mat22 = _arg1.R;
var _local7:Number = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
var _local8:Number = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
var _local9:Number = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
var _local11:Number = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
return (false);
};
var _local12:Number = (_arg4.p2.x - _arg4.p1.x);
var _local13:Number = (_arg4.p2.y - _arg4.p1.y);
var _local14:Number = ((_local9 * _local12) + (_local10 * _local13));
var _local15:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local16:Number = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (false);
};
var _local17:Number = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (true);
};
return (false);
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
public function GetRadius():Number{
return (m_radius);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
_local4 = _arg2.R;
var _local5:Number = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local6:Number = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
var _local7:Number = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local8:Number = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number = (m_localPosition.x - _arg1.x);
var _local3:Number = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22 = _arg2.R;
var _local4:Number = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22 = _arg1.R;
var _local4:Number = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function Copy():b2FilterData{
var _local1:b2FilterData = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
center = new b2Vec2(0, 0);
super();
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertices:Array;
public var vertexCount:int;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
var _local1:int;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 6
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_coreVertices:Array;
public var m_vertices:Array;
private var s_supportVec:b2Vec2;
public var m_centroid:b2Vec2;
public var m_normals:Array;
public var m_obb:b2OBB;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local3:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
var _local2:b2PolygonDef = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
var _local4:int = _local3;
var _local5:int = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB = s_sweptAABB1;
var _local5:b2AABB = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local20:Number;
var _local21:Number;
var _local6:Number = 0;
var _local7:Number = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
var _local12:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local13:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
var _local14:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local15:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
var _local16:Number = (_local14 - _local12);
var _local17:Number = (_local15 - _local13);
var _local18 = -1;
var _local19:int;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (false);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (true);
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
var _local7:Number = 0;
var _local8:Number = (1 / 3);
var _local9:int;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function GetNormals():Array{
return (m_normals);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local11:Number;
_local5 = _arg1.R;
var _local6:Number = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
var _local7:Number = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
var _local8:int;
_local4 = m_coreVertices[0];
var _local9:Number = ((_local4.x * _local6) + (_local4.y * _local7));
var _local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
var _local6:b2Mat22 = _local5;
_local4 = m_obb.extents;
var _local7:Number = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
var _local8:Number = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
var _local9:Number = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
var _local10:Number = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
var _local3:int;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local10:Number;
var _local4:b2Mat22 = _arg1.R;
var _local5:Number = (_arg2.x - _arg1.position.x);
var _local6:Number = (_arg2.y - _arg1.position.y);
var _local7:Number = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
var _local8:Number = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
var _local9:int;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local7:Number;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
_local7 = (1 / 3);
var _local8:int;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
var _local5:Array = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
var _local6:Number = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2Shape {
public var m_next:b2Shape;
public var m_type:int;
public var m_sweepRadius:Number;
public var m_density:Number;
public var m_filter:b2FilterData;
public var m_friction:Number;
public var m_isSensor:Boolean;
public var m_restitution:Number;
public var m_userData;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
return (false);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
var _local3:b2AABB = s_resetAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
var _local4:b2AABB = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB = s_proxyAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var friction:Number;// = 0.2
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var type:int;// = -1
public function b2ShapeDef(){
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number = (upperBound.x - lowerBound.x);
var _local2:Number = (upperBound.y - lowerBound.y);
var _local3:Boolean = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var value:uint;
public var proxyId:uint;
public var stabbingCount:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint = value;
var _local3:uint = proxyId;
var _local4:uint = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues)
package Box2D.Collision {
public class b2BoundValues {
public var lowerValues:Array;
public var upperValues:Array;
public function b2BoundValues(){
lowerValues = [0, 0];
upperValues = [0, 0];
super();
}
}
}//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_bounds:Array;
public var m_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid: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 QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local6:uint;
var _local7:uint;
var _local12:b2Proxy;
var _local4:Array = new Array();
var _local5:Array = new Array();
ComputeBounds(_local4, _local5, _arg1);
var _local8:Array = [_local6];
var _local9:Array = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
var _local10:int;
var _local11:int;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local10:b2Bound;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
var _local8:uint = BinarySearch(_arg5, _arg6, _arg3);
var _local9:uint = BinarySearch(_arg5, _arg6, _arg4);
var _local11:uint = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
var _local3:int;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number = _arg3.lowerBound.x;
var _local5:Number = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
var _local6:Number = _arg3.upperBound.x;
var _local7:Number = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
var _local5:uint = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
var _local6:uint = (2 * m_proxyCount);
var _local7:Array = new Array();
var _local8:Array = new Array();
ComputeBounds(_local7, _local8, _arg1);
var _local9:int;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
var _local10:int;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
var _local4:b2Proxy = m_proxyPool[_arg1];
var _local5:int = (2 * m_proxyCount);
var _local6:int;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
var _local7:int;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local4:Array;
var _local5:b2Bound;
var _local3:int;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local5:int;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
var _local12:uint = (2 * m_proxyCount);
var _local13:b2Proxy = m_proxyPool[_arg1];
var _local14:b2BoundValues = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
var _local15:b2BoundValues = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local6:int;
var _local7:b2Bound;
var _local4:int;
var _local5:int = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local25:Number;
var _local6:int = _arg1.m_vertexCount;
var _local7:Array = _arg1.m_vertices;
var _local8:Array = _arg1.m_normals;
var _local9:int = _arg4.m_vertexCount;
var _local10:Array = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
var _local13:Number = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
var _local14:Number = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
var _local15:Number = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
var _local16:Number = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
var _local20:Number = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local21:Number = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
var _local22:Number = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
var _local23:Number = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
var _local24:Number = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2 = _arg2.lowerBound;
var _local4:b2Vec2 = _arg1.upperBound;
var _local5:Number = (_local3.x - _local4.x);
var _local6:Number = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
var _local7:Number = (_local3.x - _local4.x);
var _local8:Number = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local20:ClipVertex;
var _local23:Number;
var _local7:int = _arg2.m_vertexCount;
var _local8:Array = _arg2.m_normals;
var _local9:int = _arg5.m_vertexCount;
var _local10:Array = _arg5.m_vertices;
var _local11:Array = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
var _local14:Number = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
var _local15:Number = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
var _local16:Number = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
var _local17:int;
var _local18:Number = Number.MAX_VALUE;
var _local19:int;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
var _local21:int = _local17;
var _local22:int = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local17:int;
var _local18:uint;
var _local34:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
var _local7:int;
var _local8:Array = [_local7];
var _local9:Number = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
var _local10:int;
var _local11:Array = [_local10];
var _local12:Number = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
var _local15:b2XForm = new b2XForm();
var _local16:b2XForm = new b2XForm();
var _local19:Number = 0.98;
var _local20:Number = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
var _local21:Array = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
var _local22:int = _local13.m_vertexCount;
var _local23:Array = _local13.m_vertices;
var _local24:b2Vec2 = _local23[_local17];
var _local25:b2Vec2 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
var _local26:b2Vec2 = b2Math.SubtractVV(_local37, _local25);
var _local27:b2Vec2 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
var _local28:b2Vec2 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
var _local29:Number = b2Math.b2Dot(_local28, _local25);
var _local30:Number = -(b2Math.b2Dot(_local27, _local25));
var _local31:Number = b2Math.b2Dot(_local27, _local37);
var _local32:Array = [new ClipVertex(), new ClipVertex()];
var _local33:Array = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
var _local35:int;
var _local36:int;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
var _local6:int = _arg2.m_vertexCount;
var _local7:Array = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
var _local10:Number = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
var _local11:Number = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
var _local12:Number = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
var _local13:Number = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
var _local14:int;
var _local15:Number = -(Number.MAX_VALUE);
var _local16:int;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
var _local17:Number = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
var _local18:int = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
var _local19:Number = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
var _local20:int = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
var _local21:Number = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
var _local10:Number = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local18:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
var _local8:Number = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local9:Number = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
var _local10:Number = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
var _local11:Number = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
var _local12:Number = (_local10 - _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local15:Number = _arg2.m_radius;
var _local16:Number = _arg4.m_radius;
var _local17:Number = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
var _local19:b2ManifoldPoint = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
var _local20:Number = (0.5 * (_local8 + _local10));
var _local21:Number = (0.5 * (_local9 + _local11));
var _local22:Number = (_local20 - _arg3.position.x);
var _local23:Number = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local17:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
var _local13:Number = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
var _local14:Number = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
var _local15:Number = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
var _local16:Number = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
var _local18:int;
var _local19:Number = -(Number.MAX_VALUE);
var _local20:Number = _arg4.m_radius;
var _local21:int = _arg2.m_vertexCount;
var _local22:Array = _arg2.m_vertices;
var _local23:Array = _arg2.m_normals;
var _local24:int;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
var _local25:int = _local18;
var _local26:int = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
var _local27:b2Vec2 = _local22[_local26];
var _local28:Number = (_local27.x - _local11.x);
var _local29:Number = (_local27.y - _local11.y);
var _local30:Number = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
var _local31:Number = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = 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;
}
}
}//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
public function get key():uint{
return (_key);
}
}
}//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2ContactPoint {
public var friction:Number;
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 17
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Distance {
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local4:Number = (100 * Number.MIN_VALUE);
var _local5:int;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
var _local8:Array = s_p1s;
var _local9:Array = s_p2s;
var _local10:Array = s_points;
var _local11:int;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
var _local12:Number = 0;
var _local13 = 20;
var _local14:int;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - _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 ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local35:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
var _local14:b2Vec2 = _arg4[2];
var _local15:Number = _local6.x;
var _local16:Number = _local6.y;
var _local17:Number = _local7.x;
var _local18:Number = _local7.y;
var _local19:Number = _local8.x;
var _local20:Number = _local8.y;
var _local21:Number = (_local17 - _local15);
var _local22:Number = (_local18 - _local16);
var _local23:Number = (_local19 - _local15);
var _local24:Number = (_local20 - _local16);
var _local25:Number = (_local19 - _local17);
var _local26:Number = (_local20 - _local18);
var _local27:Number = -(((_local15 * _local21) + (_local16 * _local22)));
var _local28:Number = ((_local17 * _local21) + (_local18 * _local22));
var _local29:Number = -(((_local15 * _local23) + (_local16 * _local24)));
var _local30:Number = ((_local19 * _local23) + (_local20 * _local24));
var _local31:Number = -(((_local17 * _local25) + (_local18 * _local26)));
var _local32:Number = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
var _local33:Number = ((_local21 * _local24) - (_local22 * _local23));
var _local34:Number = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
var _local36:Number = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
var _local37:Number = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
var _local38:Number = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
var _local39:Number = (_local36 * _local38);
var _local40:Number = (_local37 * _local38);
var _local41:Number = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local9:b2Point = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
var _local10:Number = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
var _local11:Number = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int = _arg3.m_type;
var _local8:int = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local17:Number;
var _local6:b2Vec2 = _arg5[0];
var _local7:b2Vec2 = _arg5[1];
var _local8:b2Vec2 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
var _local12:Number = -(_local7.x);
var _local13:Number = -(_local7.y);
var _local14:Number = (_local6.x - _local7.x);
var _local15:Number = (_local6.y - _local7.y);
var _local16:Number = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var pointCount:int;// = 0
public var normal:b2Vec2;
public var points:Array;
public function b2Manifold(){
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
pointCount = _arg1.pointCount;
var _local2:int;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var separation:Number;
public var localPoint2:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localPoint1:b2Vec2;
public var id:b2ContactID;
public function b2ManifoldPoint(){
localPoint1 = new b2Vec2();
localPoint2 = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 20
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 21
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var proxyId1:uint;
public var userData;// = null
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = b2Settings.USHRT_MAX;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = b2Settings.USHRT_MAX;
public static var b2_tableCapacity:int = b2Settings.b2_maxPairs;
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_hashTable:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
var _local3:int;
var _local4:Array = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
var _local4:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local5:uint = m_hashTable[_local4];
var _local6:b2Pair;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
var _local5:uint = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var userData;// = null
public var lowerBounds:Array;
public var upperBounds:Array;
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Segment {
public var p1:b2Vec2;
public var p2:b2Vec2;
public function b2Segment(){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
}
public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local5:b2Vec2 = _arg3.p1;
var _local6:Number = (_arg3.p2.x - _local5.x);
var _local7:Number = (_arg3.p2.y - _local5.y);
var _local8:Number = (p2.x - p1.x);
var _local9:Number = (p2.y - p1.y);
var _local10:Number = _local9;
var _local11:Number = -(_local8);
var _local12:Number = (100 * Number.MIN_VALUE);
var _local13:Number = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_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.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2TimeOfImpact {
public static var s_xf1:b2XForm = new b2XForm();
public static var s_xf2:b2XForm = new b2XForm();
public static var s_p1:b2Vec2 = new b2Vec2();
public static var s_p2:b2Vec2 = new b2Vec2();
public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local7:Number = _arg1.m_sweepRadius;
var _local8:Number = _arg3.m_sweepRadius;
var _local9:Number = _arg2.t0;
var _local10:Number = (_arg2.c.x - _arg2.c0.x);
var _local11:Number = (_arg2.c.y - _arg2.c0.y);
var _local12:Number = (_arg4.c.x - _arg4.c0.x);
var _local13:Number = (_arg4.c.y - _arg4.c0.y);
var _local14:Number = (_arg2.a - _arg2.a0);
var _local15:Number = (_arg4.a - _arg4.a0);
var _local16:Number = 0;
var _local17:b2Vec2 = s_p1;
var _local18:b2Vec2 = s_p2;
var _local19 = 20;
var _local20:int;
var _local21:Number = 0;
var _local22:Number = 0;
var _local23:Number = 0;
var _local24:Number = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 28
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var id:b2ContactID;
public var v:b2Vec2;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 29
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceEdge:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 30
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function Set(_arg1:Number):void{
var _local2:Number;
_local2 = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local4:Number;
var _local6:Number;
_local2 = col1.x;
var _local3:Number = col2.x;
_local4 = col1.y;
var _local5:Number = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number = col1.x;
var _local5:Number = col2.x;
var _local6:Number = col1.y;
var _local7:Number = col2.y;
var _local8:Number = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity);
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:* = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
var _local4:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
var _local5:b2Mat22 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var a:Number;
public var c:b2Vec2;
public var a0:Number;
public var c0:b2Vec2;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
var _local3:b2Mat22 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var y:Number;
public var x:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function Normalize():Number{
var _local1:Number = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
var _local2:Number = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function CrossVF(_arg1:Number):void{
var _local2:Number = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossFV(_arg1:Number):void{
var _local2:Number = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 34
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var position:b2Vec2;
public var R:b2Mat22;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _r:uint;// = 0
private var _g:uint;// = 0
private var _b:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_angularSlop:Number = 0.0349065850398866;
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = 3.14159265358979;
public static const b2_maxProxies:int = 0x0200;
public static const b2_maxAngularVelocitySquared:Number = 62500;
public static const b2_maxPolygonVertices:int = 8;
public static const b2_velocityThreshold:Number = 1;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxPairs:int = 4096;
public static const b2_maxTOIContactsPerIsland:int = 32;
public static const b2_timeToSleep:Number = 0.5;
public static const b2_maxManifoldPoints:int = 2;
public static const b2_maxAngularVelocity:Number = 250;
public static const b2_maxAngularCorrection:Number = 0.139626340159546;
public static const USHRT_MAX:int = 0xFFFF;
public static const b2_maxLinearVelocity:Number = 200;
public static const b2_maxLinearCorrection:Number = 0.2;
public static const b2_toiSlop:Number = 0.04;
public static const b2_maxLinearVelocitySquared:Number = 40000;
public static function b2Assert(_arg1:Boolean):void{
var _local2:b2Vec2;
if (!_arg1){
_local2.x++;
};
}
}
}//package Box2D.Common
Section 37
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local8:b2ManifoldPoint;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
var _local7:b2ContactPoint = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function GetManifolds():Array{
return (null);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int = m_manifoldCount;
Evaluate(_arg1);
var _local3:int = m_manifoldCount;
var _local4:b2Body = m_shape1.m_body;
var _local5:b2Body = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
var _local1:int;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
var _local3:int = _arg1.m_shape1.m_type;
var _local4:int = _arg1.m_shape2.m_type;
var _local5:b2ContactRegister = s_registers[_local3][_local4];
var _local6:Function = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
var _local4:int = _arg1.m_type;
var _local5:int = _arg2.m_type;
var _local6:b2ContactRegister = s_registers[_local4][_local5];
var _local7:Function = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 39
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var normal:b2Vec2;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var tangentMass:Number;
public var equalizedMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var other:b2Body;
public var prev:b2ContactEdge;
public var contact:b2Contact;
public var next:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
public class b2ContactResult {
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var normal:b2Vec2;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
var _local9:int;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
var _local5:int;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local2:Number = 0;
var _local5:int;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
var _local19:int;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
var _local1:int;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function Evaluate(_arg1:b2ContactListener):void{
}
override public function GetManifolds():Array{
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local6:b2Body = m_shape1.m_body;
var _local7:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
var _local8:Array = [false, false];
var _local9:b2ContactPoint = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local7:b2ContactPoint;
var _local8:int;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
var _local9:Array = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 48
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_u:b2Vec2;
public var m_mass:Number;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
m_inv_dt = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local8:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
m_inv_dt = _arg1.inv_dt;
_local4 = m_body1;
_local5 = m_body2;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
var _local10:Number = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
var _local11:Number = ((_local6 * m_u.y) - (_local7 * m_u.x));
var _local12:Number = ((_local8 * m_u.y) - (_local9 * m_u.x));
var _local13:Number = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = (1 / _local13);
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17))));
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (1 / (_local13 + m_gamma));
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
if (m_frequencyHz > 0){
return (true);
};
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local1 = _local2.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local6:Number = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8));
_local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8));
_local7 = _local6;
var _local9:Number = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
var _local10:Number = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
var _local11:Number = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
var _local12:Number = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var _local13:Number = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
var _local14:Number = (_local13 * m_u.x);
var _local15:Number = (_local13 * m_u.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
_local2 = _local3.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local7:Number = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
var _local10:Number = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
var _local11:Number = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
var _local12:Number = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
var _local13:Number = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
var _local14:Number = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
var _local15:Number = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
var _local16:Number = (_local15 * m_u.x);
var _local17:Number = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
}
}//package Box2D.Dynamics.Joints
Section 49
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2DistanceJointDef extends b2JointDef {
public var localAnchor1:b2Vec2;
public var length:Number;
public var dampingRatio:Number;
public var localAnchor2:b2Vec2;
public var frequencyHz:Number;
public function b2DistanceJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
var _local5:Number = (_arg4.x - _arg3.x);
var _local6:Number = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 50
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_ground2:b2Body;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_ratio:Number;
public var m_revolute2:b2RevoluteJoint;
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_revolute1:b2RevoluteJoint;
public var m_prismatic1:b2PrismaticJoint;
public var m_constant:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
var _local2:int = _arg1.joint1.m_type;
var _local3:int = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_force = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local15:Number;
var _local2:b2Body = m_ground1;
var _local3:b2Body = m_ground2;
var _local4:b2Body = m_body1;
var _local5:b2Body = m_body2;
var _local14:Number = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear1.Set(-(_local6), -(_local7));
m_J.angular1 = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angular2 = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = (1 / _local14);
if (_arg1.warmStarting){
_local15 = (_arg1.dt * m_force);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var _local1:b2Mat22 = m_body2.m_xf.R;
var _local2:Number = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
var _local3:Number = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
var _local4:Number = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3));
_local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3));
_local2 = _local4;
_local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x))));
return (_local4);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local4:Number;
var _local5:Number;
var _local1:Number = 0;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
var _local6:Number = (m_constant - (_local4 + (m_ratio * _local5)));
var _local7:Number = (-(m_mass) * _local6);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((_local1 < b2Settings.b2_linearSlop));
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
var _local4:Number = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
var _local5:Number = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
var _local6:Number = (_arg1.dt * _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 51
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint1:b2Joint;
public var joint2:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 52
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var linear1:b2Vec2;
public var linear2:b2Vec2;
public var angular1:Number;
public var angular2:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 53
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2Joint {
public var m_islandFlag:Boolean;
public var m_body1:b2Body;
public var m_prev:b2Joint;
public var m_next:b2Joint;
public var m_type:int;
public var m_collideConnected:Boolean;
public var m_node1:b2JointEdge;
public var m_node2:b2JointEdge;
public var m_inv_dt:Number;
public var m_userData;
public var m_body2:b2Body;
public static const e_unknownJoint:int = 0;
public static const e_inactiveLimit:int = 0;
public static const e_atUpperLimit:int = 2;
public static const e_atLowerLimit:int = 1;
public static const e_gearJoint:int = 6;
public static const e_revoluteJoint:int = 1;
public static const e_equalLimits:int = 3;
public static const e_distanceJoint:int = 3;
public static const e_pulleyJoint:int = 4;
public static const e_prismaticJoint:int = 2;
public static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_node1 = new b2JointEdge();
m_node2 = new b2JointEdge();
super();
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_body1 = _arg1.body1;
m_body2 = _arg1.body2;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
public function GetBody2():b2Body{
return (m_body2);
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetType():int{
return (m_type);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetReactionTorque():Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce():b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 54
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var body2:b2Body;
public var type:int;
public var userData;
public var collideConnected:Boolean;
public var body1:b2Body;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
public var joint:b2Joint;
}
}//package Box2D.Dynamics.Joints
Section 56
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
private var K1:b2Mat22;
private var K:b2Mat22;
public var m_beta:Number;
public var m_mass:b2Mat22;
private var K2:b2Mat22;
public var m_target:b2Vec2;
public var m_gamma:Number;
public var m_impulse:b2Vec2;
public var m_C:b2Vec2;
public var m_localAnchor:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local3:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
var _local2:Number = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
var _local4:b2Mat22 = m_body2.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
var _local5:Number = m_body2.m_mass;
var _local6:Number = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
var _local7:Number = (((2 * _local5) * _arg1.dampingRatio) * _local6);
var _local8:Number = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local7:Number;
var _local8:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local7 = _local2.m_invMass;
_local8 = _local2.m_invI;
K1.col1.x = _local7;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local7;
K2.col1.x = ((_local8 * _local5) * _local5);
K2.col2.x = ((-(_local8) * _local4) * _local5);
K2.col1.y = ((-(_local8) * _local4) * _local5);
K2.col2.y = ((_local8 * _local4) * _local4);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
var _local9:Number = (_arg1.dt * m_impulse.x);
var _local10:Number = (_arg1.dt * m_impulse.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9))));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetReactionTorque():Number{
return (0);
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local2:b2Body = m_body2;
_local3 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
var _local8:Number = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
var _local9:Number = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x));
_local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y));
var _local10:Number = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
var _local11:Number = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
var _local12:Number = m_impulse.x;
var _local13:Number = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
var _local14:Number = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
var _local15:Number = (_arg1.dt * _local10);
var _local16:Number = (_arg1.dt * _local11);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
}
}
}//package Box2D.Dynamics.Joints
Section 57
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var timeStep:Number;
public var target:b2Vec2;
public var maxForce:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 58
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_refAngle:Number;
public var m_torque:Number;
public var m_motorForce:Number;
public var m_enableLimit:Boolean;
public var m_angularMass:Number;
public var m_maxMotorForce:Number;
public var m_localYAxis1:b2Vec2;
public var m_force:Number;
public var m_motorMass:Number;
public var m_upperTranslation:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_linearJacobian:b2Jacobian;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_localXAxis1.SetV(_arg1.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_linearJacobian.SetZero();
m_linearMass = 0;
m_force = 0;
m_angularMass = 0;
m_torque = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local8:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
var _local4:Number = _local2.m_invMass;
var _local5:Number = _local3.m_invMass;
var _local6:Number = _local2.m_invI;
var _local7:Number = _local3.m_invI;
var _local9:Number = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
var _local10:Number = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
var _local11:Number = (_arg1.dt * _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2));
var _local12:Number = (_local3.m_angularVelocity - _local2.m_angularVelocity);
var _local13:Number = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
var _local14:Number = (_arg1.dt * _local13);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15);
_local17 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce);
_local16 = (m_motorForce - _local17);
_local11 = (_arg1.dt * _local16);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local19);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
};
};
};
_local11 = (_arg1.dt * _local19);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetJointTranslation():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
var _local4:b2Vec2 = _local1.GetWorldPoint(m_localAnchor1);
var _local5:b2Vec2 = _local2.GetWorldPoint(m_localAnchor2);
var _local6:Number = (_local5.x - _local4.x);
var _local7:Number = (_local5.y - _local4.y);
var _local8:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local9:Number = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22 = m_body1.m_xf.R;
var _local2:Number = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
var _local3:Number = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
var _local4:Number = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
var _local5:Number = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5))));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
var _local5:Number = _local3.m_invMass;
var _local6:Number = _local4.m_invMass;
var _local7:Number = _local3.m_invI;
var _local8:Number = _local4.m_invI;
_local9 = _local3.m_xf.R;
var _local11:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local12:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
var _local13:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local14:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
var _local15:Number = (_local3.m_sweep.c.x + _local11);
var _local16:Number = (_local3.m_sweep.c.y + _local12);
var _local17:Number = (_local4.m_sweep.c.x + _local13);
var _local18:Number = (_local4.m_sweep.c.y + _local14);
var _local19:Number = (_local17 - _local15);
var _local20:Number = (_local18 - _local16);
_local9 = _local3.m_xf.R;
var _local21:Number = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
var _local22:Number = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
var _local23:Number = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var _local24:Number = (-(m_linearMass) * _local23);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2));
var _local25:Number = b2Math.b2Abs(_local23);
var _local26:Number = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
var _local27:Number = (-(m_angularMass) * _local26);
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
var _local28:Number = b2Math.b2Abs(_local26);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local31 = ((_local29 * _local19) + (_local30 * _local20));
_local32 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local31 - m_lowerTranslation);
_local25 = b2Math.b2Max(_local25, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local31 - m_upperTranslation);
_local25 = b2Math.b2Max(_local25, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
var _local3:b2Mat22;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
_local3 = _local1.m_xf.R;
var _local4:Number = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
var _local5:Number = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
var _local7:Number = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
var _local9:Number = (_local1.m_sweep.c.x + _local4);
var _local10:Number = (_local1.m_sweep.c.y + _local5);
var _local11:Number = (_local2.m_sweep.c.x + _local7);
var _local12:Number = (_local2.m_sweep.c.y + _local8);
var _local13:Number = (_local11 - _local9);
var _local14:Number = (_local12 - _local10);
var _local15:b2Vec2 = _local1.GetWorldVector(m_localXAxis1);
var _local16:b2Vec2 = _local1.m_linearVelocity;
var _local17:b2Vec2 = _local2.m_linearVelocity;
var _local18:Number = _local1.m_angularVelocity;
var _local19:Number = _local2.m_angularVelocity;
var _local20:Number = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
var _local10:Number = _local2.m_invMass;
var _local11:Number = _local3.m_invMass;
var _local12:Number = _local2.m_invI;
var _local13:Number = _local3.m_invI;
_local4 = _local2.m_xf.R;
var _local14:Number = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
var _local15:Number = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
var _local16:Number = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
var _local17:Number = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y);
m_linearJacobian.linear1.x = -(_local14);
m_linearJacobian.linear1.y = -(_local15);
m_linearJacobian.linear2.x = _local14;
m_linearJacobian.linear2.y = _local15;
m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14)));
m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14));
m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
_local4 = _local2.m_xf.R;
_local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y));
_local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local18);
m_motorJacobian.linear1.y = -(_local19);
m_motorJacobian.linear2.x = _local18;
m_motorJacobian.linear2.y = _local19;
m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18)));
m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18));
m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local20 = (_local16 - _local6);
_local21 = (_local17 - _local7);
_local22 = ((_local18 * _local20) + (_local19 * _local21));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local22 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local22 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit == false){
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
_local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
_local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
_local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
_local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
_local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28));
} else {
m_force = 0;
m_torque = 0;
m_limitForce = 0;
m_motorForce = 0;
};
m_limitPositionImpulse = 0;
}
public function GetMotorForce():Number{
return (m_motorForce);
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 59
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PrismaticJointDef extends b2JointDef {
public var motorSpeed:Number;
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var maxMotorForce:Number;
public var lowerTranslation:Number;
public function b2PrismaticJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
localAxis1 = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxis1.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
localAxis1 = body1.GetLocalVector(_arg4);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 60
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_limitState1:int;
public var m_limitState2:int;
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_maxLength1:Number;
public var m_limitPositionImpulse1:Number;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_constant:Number;
public var m_positionImpulse:Number;
public var m_state:int;
public var m_ratio:Number;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_limitMass1:Number;
public var m_limitMass2:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_limitForce1:Number;
public var m_limitForce2:Number;
public var m_u2:b2Vec2;
public static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_ratio = _arg1.ratio;
m_constant = (_arg1.length1 + (m_ratio * _arg1.length2));
m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var _local1:b2Vec2 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local3:b2Mat22;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local1:b2Body = m_body1;
var _local2:b2Body = m_body2;
var _local4:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local5:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local6:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local7:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local23:Number = 0;
if (m_state == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_pulleyMass) * _local18);
_local20 = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19));
_local19 = (m_positionImpulse - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.SynchronizeTransform();
_local2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local21 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local21);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local21 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local21);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.SynchronizeTransform();
};
return ((_local23 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
var _local10:Number = (_local2.m_sweep.c.x + _local5);
var _local11:Number = (_local2.m_sweep.c.y + _local6);
var _local12:Number = (_local3.m_sweep.c.x + _local8);
var _local13:Number = (_local3.m_sweep.c.y + _local9);
var _local14:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local15:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local16:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local17:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
var _local18:Number = m_u1.Length();
var _local19:Number = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
var _local20:Number = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
var _local21:Number = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
var _local22:Number = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
_local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
_local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
_local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
_local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18);
_local20 = m_force;
m_force = b2Math.b2Max(0, (m_force + _local19));
_local19 = (m_force - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x);
_local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18);
_local20 = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19));
_local19 = (m_limitForce1 - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18);
_local20 = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19));
_local19 = (m_limitForce2 - _local20);
_local16 = ((-(_arg1.dt) * _local19) * m_u2.x);
_local17 = ((-(_arg1.dt) * _local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2 = m_body1.GetWorldPoint(m_localAnchor1);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetLength2():Number{
var _local1:b2Vec2 = m_body2.GetWorldPoint(m_localAnchor2);
var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var _local4:Number = (_local1.x - _local2);
var _local5:Number = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 61
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength1:Number;
public var maxLength2:Number;
public var length1:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var ratio:Number;
public var length2:Number;
public function b2PulleyJointDef(){
groundAnchor1 = new b2Vec2();
groundAnchor2 = new b2Vec2();
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchor1.Set(-1, 1);
groundAnchor2.Set(1, 1);
localAnchor1.Set(-1, 0);
localAnchor2.Set(1, 0);
length1 = 0;
maxLength1 = 0;
length2 = 0;
maxLength2 = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
var _local8:Number = (_arg5.x - _arg3.x);
var _local9:Number = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
var _local10:Number = (_arg6.x - _arg4.x);
var _local11:Number = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
var _local12:Number = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 62
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_pivotMass:b2Mat22;
public var m_motorForce:Number;
public var m_enableLimit:Boolean;
public var m_limitState:int;
public var m_motorMass:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
public var m_pivotForce:b2Vec2;
public var m_enableMotor:Boolean;
public var m_referenceAngle:Number;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_upperAngle:Number;
public var m_lowerAngle:Number;
public var m_maxMotorTorque:Number;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_pivotForce = new b2Vec2();
m_pivotMass = new b2Mat22();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_referenceAngle = _arg1.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local4:b2Mat22;
var _local5:Number;
var _local10:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local2:b2Body = m_body1;
var _local3:b2Body = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
var _local11:Number = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
var _local12:Number = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
var _local13:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
var _local14:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12)));
m_pivotForce.x = (m_pivotForce.x + _local13);
m_pivotForce.y = (m_pivotForce.y + _local14);
var _local15:Number = (_arg1.dt * _local13);
_local16 = (_arg1.dt * _local14);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17);
_local19 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque);
_local18 = (m_motorForce - _local19);
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local21);
} else {
if (m_limitState == e_atLowerLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
} else {
if (m_limitState == e_atUpperLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21));
};
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local6:b2Mat22;
var _local25:Number;
var _local26:Number;
var _local3:b2Body = m_body1;
var _local4:b2Body = m_body2;
var _local5:Number = 0;
_local6 = _local3.m_xf.R;
var _local7:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
var _local8:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
var _local9:Number = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
var _local10:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
var _local11:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11));
_local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11));
_local10 = _local9;
var _local12:Number = (_local3.m_sweep.c.x + _local7);
var _local13:Number = (_local3.m_sweep.c.y + _local8);
var _local14:Number = (_local4.m_sweep.c.x + _local10);
var _local15:Number = (_local4.m_sweep.c.y + _local11);
var _local16:Number = (_local14 - _local12);
var _local17:Number = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
var _local18:Number = _local3.m_invMass;
var _local19:Number = _local4.m_invMass;
var _local20:Number = _local3.m_invI;
var _local21:Number = _local4.m_invI;
K1.col1.x = (_local18 + _local19);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local18 + _local19);
K2.col1.x = ((_local20 * _local8) * _local8);
K2.col2.x = ((-(_local20) * _local7) * _local8);
K2.col1.y = ((-(_local20) * _local7) * _local8);
K2.col2.y = ((_local20 * _local7) * _local7);
K3.col1.x = ((_local21 * _local11) * _local11);
K3.col2.x = ((-(_local21) * _local10) * _local11);
K3.col1.y = ((-(_local21) * _local10) * _local11);
K3.col2.y = ((_local21 * _local10) * _local10);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
var _local22:Number = tImpulse.x;
var _local23:Number = tImpulse.y;
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
var _local24:Number = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local24 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local25 - m_lowerAngle);
_local24 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local25 - m_upperAngle);
_local24 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle));
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local7:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
var _local10:Number = _local2.m_invMass;
var _local11:Number = _local3.m_invMass;
var _local12:Number = _local2.m_invI;
var _local13:Number = _local3.m_invI;
K1.col1.x = (_local10 + _local11);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local10 + _local11);
K2.col1.x = ((_local12 * _local7) * _local7);
K2.col2.x = ((-(_local12) * _local6) * _local7);
K2.col1.y = ((-(_local12) * _local6) * _local7);
K2.col2.y = ((_local12 * _local6) * _local6);
K3.col1.x = ((_local13 * _local9) * _local9);
K3.col2.x = ((-(_local13) * _local8) * _local9);
K3.col1.y = ((-(_local13) * _local8) * _local9);
K3.col2.y = ((_local13 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
} else {
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
}
}//package Box2D.Dynamics.Joints
Section 63
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2RevoluteJointDef extends b2JointDef {
public var upperAngle:Number;
public var enableMotor:Boolean;
public var referenceAngle:Number;
public var motorSpeed:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var lowerAngle:Number;
public var maxMotorTorque:Number;
public function b2RevoluteJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchor1.Set(0, 0);
localAnchor2.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 64
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
public var m_xf:b2XForm;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_type:int;
public var m_linearDamping:Number;
public var m_shapeCount:int;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
m_xf.R.Set(m_sweep.a);
var _local1:b2Mat22 = m_xf.R;
var _local2:b2Vec2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:b2MassData = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
var _local5:b2Mat22 = m_xf.R;
var _local6:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
var _local7:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
var _local4:b2Mat22 = m_xf.R;
var _local5:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
var _local6:Boolean;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local4:b2Shape;
var _local1:b2XForm = s_xf1;
_local1.R.Set(m_sweep.a0);
var _local2:b2Mat22 = _local1.R;
var _local3:b2Vec2 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
var _local5:Boolean;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
var _local5:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
var _local2:b2Shape = m_shapeList;
var _local3:b2Shape;
var _local4:Boolean;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_shapeList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2BodyDef {
public var angularDamping:Number;
public var angle:Number;
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var fixedRotation:Boolean;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData = _arg1.GetFilterData();
var _local4:b2FilterData = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
var _local5:Boolean = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 68
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
if (_arg3 == null){
return;
};
var _local4:b2Contact = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local2:b2Shape = _arg1.m_shape1;
var _local3:b2Shape = _arg1.m_shape2;
var _local4:int = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_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--;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape = (_arg1 as b2Shape);
var _local4:b2Shape = (_arg2 as b2Shape);
var _local5:b2Body = _local3.m_body;
var _local6:b2Body = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
var _local7:b2Contact = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
public function Collide():void{
var _local2:b2Body;
var _local3:b2Body;
var _local1:b2Contact = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 70
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_drawFlags:uint;
public var m_lineThickness:Number;// = 1
public var m_drawScale:Number;// = 1
public var m_sprite:Sprite;
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawFlags = 0;
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 71
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_joints:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
var _local4:int;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
var _local8:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local5:b2Body;
var _local6:Boolean;
var _local3:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
var _local4:Number = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_allowSleep:Boolean;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_debugDraw:b2DebugDraw;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
var _local4:b2BodyDef = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local2:b2Body = _arg1.m_body1;
var _local3:b2Body = _arg1.m_body2;
var _local4:b2XForm = _local2.m_xf;
var _local5:b2XForm = _local3.m_xf;
var _local6:b2Vec2 = _local4.position;
var _local7:b2Vec2 = _local5.position;
var _local8:b2Vec2 = _arg1.GetAnchor1();
var _local9:b2Vec2 = _arg1.GetAnchor2();
var _local10:b2Color = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local11:b2XForm;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
var _local1:uint = m_debugDraw.GetFlags();
var _local7:b2Vec2 = new b2Vec2();
var _local8:b2Vec2 = new b2Vec2();
var _local9:b2Vec2 = new b2Vec2();
var _local10:b2Color = new b2Color(0, 0, 0);
var _local12:b2AABB = new b2AABB();
var _local13:b2AABB = new b2AABB();
var _local14:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.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;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
var _local2:b2JointEdge = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
var _local3:b2Shape = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
var _local5:b2Color = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetContactCount():int{
return (m_contactCount);
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
var _local3:b2Island = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
var _local4:b2Contact = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
var _local5:b2Joint = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
var _local6:int = m_bodyCount;
var _local7:Array = new Array(_local6);
var _local8:b2Body = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array = new Array(_arg3);
var _local5:int = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
var _local6:int;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
var _local8:b2Island = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
var _local9:int = m_bodyCount;
var _local10:Array = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function Validate():void{
m_broadPhase.Validate();
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local3:b2Body;
var _local4:b2Shape;
var _local2:b2Joint = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local5:b2Body;
var _local6:b2Shape;
var _local2:Boolean = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
var _local3:b2Body = _arg1.m_body1;
var _local4:b2Body = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
if (m_lock == true){
return (null);
};
var _local2:b2Body = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
m_lock = true;
var _local3:b2TimeStep = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 75
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
}
}//package caurina.transitions
Section 76
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 77
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 78
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 79
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 80
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 81
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local5:SpecialPropertySplitter;
var _local6:Array;
var _local7:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
if (_specialPropertySplitterList[_args[_local4]]){
_local5 = _specialPropertySplitterList[_args[_local4]];
_local6 = _local5.splitValues(_arg1, null);
_local7 = 0;
while (_local7 < _local6.length) {
_local3.push(_local6[_local7].name);
_local7++;
};
} else {
_local3.push(_args[_local4]);
};
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.74");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e2:Error) {
handleError(tTweening, e2, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e3:Error) {
handleError(tTweening, e3, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e4:Error) {
handleError(tTweening, e4, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
var _local7:Object = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time;
var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay;
var _local10:Array = new Array();
var _local11:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var _local12:Object = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 82
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local3:String;
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local3:String;
var _local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local2:Object = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 83
//BigAssCanvas (com.bit101.display.BigAssCanvas)
package com.bit101.display {
import flash.display.*;
import flash.geom.*;
public class BigAssCanvas extends Sprite {
private var _color:uint;
private var _bitmaps:Array;
private var _height:Number;
private var _width:Number;
private var _transparent:Boolean;
public function BigAssCanvas(_arg1:Number, _arg2:Number, _arg3:Boolean=false, _arg4:uint=0xFFFFFF){
_width = _arg1;
_height = _arg2;
_transparent = _arg3;
_color = _arg4;
makeBitmaps();
}
public function noise(_arg1:int, _arg2:uint=0, _arg3:uint=0xFF, _arg4:uint=7, _arg5:Boolean=false):void{
var _local7:Bitmap;
var _local6:int;
while (_local6 < _bitmaps.length) {
_local7 = (_bitmaps[_local6] as Bitmap);
_local7.bitmapData.noise(_arg1, _arg2, _arg3, _arg4, _arg5);
_local6++;
};
}
public function setPixel32(_arg1:Number, _arg2:Number, _arg3:uint):void{
var _local5:Bitmap;
var _local4:int;
while (_local4 < _bitmaps.length) {
_local5 = (_bitmaps[_local4] as Bitmap);
if ((((((((_arg1 >= _local5.x)) && ((_arg1 < (_local5.x + _local5.width))))) && ((_arg2 >= _local5.y)))) && ((_arg2 < (_local5.y + _local5.height))))){
_local5.bitmapData.setPixel32((_arg1 - _local5.x), (_arg2 - _local5.y), _arg3);
};
_local4++;
};
}
public function fillRect(_arg1:Rectangle, _arg2:uint):void{
var _local4:Bitmap;
var _local5:Rectangle;
var _local3:int;
while (_local3 < _bitmaps.length) {
_local4 = (_bitmaps[_local3] as Bitmap);
_local5 = _arg1.clone();
_arg1.clone().x = (_local5.x - _local4.x);
_local5.y = (_local5.y - _local4.y);
_local4.bitmapData.fillRect(_local5, _arg2);
_local3++;
};
}
public function draw(_arg1:IBitmapDrawable, _arg2:Matrix=null, _arg3:ColorTransform=null, _arg4:String=null, _arg5:Rectangle=null, _arg6:Boolean=false):void{
var _local8:Bitmap;
var _local9:Matrix;
var _local10:Rectangle;
if (_arg2 == null){
_arg2 = new Matrix();
};
var _local7:int;
while (_local7 < _bitmaps.length) {
_local8 = (_bitmaps[_local7] as Bitmap);
_local9 = _arg2.clone();
_arg2.clone().tx = (_local9.tx - _local8.x);
_local9.ty = (_local9.ty - _local8.y);
if (_arg5 != null){
_local10 = _arg5.clone();
_arg5.clone().x = (_local10.x - _local8.x);
_local10.y = (_local10.y - _local8.y);
} else {
_local10 = null;
};
_local8.bitmapData.draw(_arg1, _local9, _arg3, _arg4, _local10, _arg6);
_local7++;
};
}
public function getPixel32(_arg1:Number, _arg2:Number):uint{
var _local4:Bitmap;
var _local3:int;
while (_local3 < _bitmaps.length) {
_local4 = (_bitmaps[_local3] as Bitmap);
if ((((((((_arg1 >= _local4.x)) && ((_arg1 < (_local4.x + _local4.width))))) && ((_arg2 >= _local4.y)))) && ((_arg2 < (_local4.y + _local4.height))))){
return (_local4.bitmapData.getPixel32((_arg1 - _local4.x), (_arg2 - _local4.y)));
};
_local3++;
};
return (0);
}
public function getPixel(_arg1:Number, _arg2:Number):uint{
var _local4:Bitmap;
var _local3:int;
while (_local3 < _bitmaps.length) {
_local4 = (_bitmaps[_local3] as Bitmap);
if ((((((((_arg1 >= _local4.x)) && ((_arg1 < (_local4.x + _local4.width))))) && ((_arg2 >= _local4.y)))) && ((_arg2 < (_local4.y + _local4.height))))){
return (_local4.bitmapData.getPixel((_arg1 - _local4.x), (_arg2 - _local4.y)));
};
_local3++;
};
return (0);
}
public function unlock():void{
var _local2:Bitmap;
var _local1:int;
while (_local1 < _bitmaps.length) {
_local2 = (_bitmaps[_local1] as Bitmap);
_local2.bitmapData.unlock();
_local1++;
};
}
public function lock():void{
var _local2:Bitmap;
var _local1:int;
while (_local1 < _bitmaps.length) {
_local2 = (_bitmaps[_local1] as Bitmap);
_local2.bitmapData.lock();
_local1++;
};
}
public function perlinNoise(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:int, _arg5:Boolean, _arg6:uint=7, _arg7:Boolean=false):void{
var _local10:Bitmap;
var _local11:Array;
var _local12:int;
var _local8:Array = new Array();
var _local9:int;
while (_local9 < _arg3) {
_local8.push(new Point());
_local9++;
};
_local9 = 0;
while (_local9 < _bitmaps.length) {
_local10 = (_bitmaps[_local9] as Bitmap);
_local11 = new Array();
_local12 = 0;
while (_local12 < _local8.length) {
_local11[_local12] = new Point((_local8[_local12].x + _local10.x), (_local8[_local12].y + _local10.y));
_local12++;
};
_local10.bitmapData.perlinNoise(_arg1, _arg2, _arg3, _arg4, false, _arg5, _arg6, _arg7, _local11);
_local9++;
};
}
private function makeBitmaps():void{
var _local3:Number;
var _local4:Number;
var _local5:Bitmap;
_bitmaps = new Array();
var _local1:Number = _height;
var _local2:Number = 0;
while (_local1 > 0) {
_local3 = 0;
_local4 = _width;
while (_local4 > 0) {
_local5 = new Bitmap(new BitmapData(Math.min(2880, _local4), Math.min(2880, _local1), _transparent, _color));
_local5.x = _local3;
_local5.y = _local2;
addChild(_local5);
_bitmaps.push(_local5);
_local4 = (_local4 - _local5.width);
_local3 = (_local3 + _local5.width);
};
_local2 = (_local2 + Math.min(2880, _local1));
_local1 = (_local1 - Math.min(2880, _local1));
};
}
public function copyPixelsOut(_arg1:Rectangle, _arg2:Boolean=true, _arg3:uint=4278190080):BitmapData{
var _local6:Bitmap;
var _local7:Rectangle;
var _local4:BitmapData = new BitmapData(_arg1.width, _arg1.height, true, _arg3);
var _local5:int;
while (_local5 < _bitmaps.length) {
_local6 = (_bitmaps[_local5] as Bitmap);
_local7 = _arg1.clone();
_arg1.clone().x = (_local7.x - _local6.x);
_local7.y = (_local7.y - _local6.y);
if (_local7.intersects(new Rectangle(0, 0, 2880, 2880))){
_local4.copyPixels(_local6.bitmapData, _local7, new Point());
};
_local5++;
};
return (_local4);
}
public function setPixel(_arg1:Number, _arg2:Number, _arg3:uint):void{
var _local5:Bitmap;
var _local4:int;
while (_local4 < _bitmaps.length) {
_local5 = (_bitmaps[_local4] as Bitmap);
if ((((((((_arg1 >= _local5.x)) && ((_arg1 < (_local5.x + _local5.width))))) && ((_arg2 >= _local5.y)))) && ((_arg2 < (_local5.y + _local5.height))))){
_local5.bitmapData.setPixel(Math.round((_arg1 - _local5.x)), Math.round((_arg2 - _local5.y)), _arg3);
};
_local4++;
};
}
public function dispose():void{
var _local1:Bitmap;
while (_bitmaps.length > 0) {
_local1 = (_bitmaps.shift() as Bitmap);
removeChild(_local1);
_local1.bitmapData.dispose();
};
}
}
}//package com.bit101.display
Section 84
//DrawSine (com.midasplayer.extras.DrawSine)
package com.midasplayer.extras {
import flash.display.*;
public class DrawSine extends MovieClip {
private var target_mc:MovieClip;
private var step_x:Number;
private var my_height:Number;
private var stroke_color:Number;// = 0
private var draw_fill:Boolean;// = false
private var stroke_weight:Number;// = 1
private var fill_alpha:Number;
private var fill_height:Number;
private var draw_array;
private var steps:Number;
private var fill_color:Number;// = 0xFF0000
private var my_width:Number;
public function DrawSine(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number){
draw_array = new Array();
super();
target_mc = _arg1;
my_width = _arg2;
my_height = _arg3;
steps = _arg4;
step_x = (_arg2 / steps);
var _local5:* = 0;
while (_local5 < steps) {
draw_array.push({x:(step_x * _local5), y:0});
_local5++;
};
}
public function set_fill(_arg1:Boolean, _arg2:Number, _arg3:Number):void{
draw_fill = _arg1;
fill_color = (stroke_color = _arg2);
fill_alpha = _arg3;
}
public function set_stroke(_arg1:Number, _arg2:Number):void{
stroke_weight = _arg1;
stroke_color = _arg2;
}
public function draw_waves(_arg1:Array):void{
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local2:* = draw_array.length;
var _local3:* = _arg1.length;
var _local4:* = 0;
while (_local4 < _local3) {
_local6 = (((_arg1[_local4].cycles * Math.PI) * 2) / steps);
_local7 = 0;
while (_local7 < _local2) {
if (_local4 == 0){
draw_array[_local7].y = (Math.sin((_arg1[_local4].phase + (_local6 * _local7))) * _arg1[_local4].radius);
} else {
draw_array[_local7].y = (draw_array[_local7].y + (Math.sin((_arg1[_local4].phase + (_local6 * _local7))) * _arg1[_local4].radius));
};
_local7++;
};
_local4++;
};
target_mc.graphics.clear();
if (stroke_weight > 0){
target_mc.graphics.lineStyle(stroke_weight, stroke_color);
};
if (draw_fill){
target_mc.graphics.beginFill(fill_color, fill_alpha);
};
target_mc.graphics.moveTo(draw_array[0].x, draw_array[0].y);
var _local5:* = 1;
while (_local5 < _local2) {
_local8 = draw_array[_local5].x;
_local9 = draw_array[_local5].y;
target_mc.graphics.lineTo(_local8, _local9);
_local5++;
};
if (draw_fill){
target_mc.graphics.lineTo(_local8, (my_height / 2));
target_mc.graphics.lineTo(0, (my_height / 2));
target_mc.graphics.lineTo(0, draw_array[0].y);
target_mc.graphics.endFill();
};
}
}
}//package com.midasplayer.extras
Section 85
//md5 (com.midasplayer.extras.md5)
package com.midasplayer.extras {
public class md5 {
public static const HEX_FORMAT_LOWERCASE:uint = 0;
public static const HEX_FORMAT_UPPERCASE:uint = 1;
public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
public static var hexcase:uint = 0;
public static var b64pad:String = "";
public static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
public static function binl_md5(_arg1:Array, _arg2:Number):Array{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
var _local3:Number = 1732584193;
var _local4:Number = -271733879;
var _local5:Number = -1732584194;
var _local6:Number = 271733878;
var _local7:Number = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 = safe_add(_local3, _local8);
_local4 = safe_add(_local4, _local9);
_local5 = safe_add(_local5, _local10);
_local6 = safe_add(_local6, _local11);
_local7 = (_local7 + 16);
};
return ([_local3, _local4, _local5, _local6]);
}
public static function str2rstr_utf16le(_arg1:String):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) & 0xFF), ((_arg1.charCodeAt(_local3) >>> 8) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function hex_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2hex(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function binl2rstr(_arg1:Array):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local3 >> 5)] >>> (_local3 % 32)) & 0xFF)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2binl(_arg1:String):Array{
var _local2:Number = 0;
var _local3:Array = new Array((_arg1.length >> 2));
_local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2] = 0;
_local2++;
};
_local2 = 0;
while (_local2 < (_arg1.length * 8)) {
_local3[(_local2 >> 5)] = (_local3[(_local2 >> 5)] | ((_arg1.charCodeAt((_local2 / 8)) & 0xFF) << (_local2 % 32)));
_local2 = (_local2 + 8);
};
return (_local3);
}
public static function md5_vm_test():Boolean{
return ((hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"));
}
public static function b64_md5(_arg1:String):String{
return (rstr2b64(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function any_hmac_md5(_arg1:String, _arg2:String, _arg3:String):String{
return (rstr2any(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2)), _arg3));
}
public static function hex_md5(_arg1:String):String{
return (rstr2hex(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function encrypt(_arg1:String):String{
return (hex_md5(_arg1));
}
public static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2hex(_arg1:String):String{
var _local4:Number;
var _local2:String = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
var _local3 = "";
var _local5:Number = 0;
while (_local5 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local5);
_local3 = (_local3 + (_local2.charAt(((_local4 >>> 4) & 15)) + _local2.charAt((_local4 & 15))));
_local5++;
};
return (_local3);
}
public static function any_md5(_arg1:String, _arg2:String):String{
return (rstr2any(rstr_md5(str2rstr_utf8(_arg1)), _arg2));
}
public static function b64_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2b64(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function rstr2b64(_arg1:String):String{
var _local6:Number;
var _local7:Number;
var _local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var _local3 = "";
var _local4:Number = _arg1.length;
var _local5:Number = 0;
while (_local5 < _local4) {
_local6 = (((_arg1.charCodeAt(_local5) << 16) | (((_local5 + 1) < _local4)) ? (_arg1.charCodeAt((_local5 + 1)) << 8) : 0) | (((_local5 + 2) < _local4)) ? _arg1.charCodeAt((_local5 + 2)) : 0);
_local7 = 0;
while (_local7 < 4) {
if (((_local5 * 8) + (_local7 * 6)) > (_arg1.length * 8)){
_local3 = (_local3 + b64pad);
} else {
_local3 = (_local3 + _local2.charAt(((_local6 >>> (6 * (3 - _local7))) & 63)));
};
_local7++;
};
_local5 = (_local5 + 3);
};
return (_local3);
}
public static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
var _local4:Number = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf8(_arg1:String):String{
var _local4:Number;
var _local5:Number;
var _local2 = "";
var _local3:Number = -1;
while (++_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
_local5 = (((_local3 + 1) < _arg1.length)) ? _arg1.charCodeAt((_local3 + 1)) : 0;
if ((((((((0xD800 <= _local4)) && ((_local4 <= 56319)))) && ((0xDC00 <= _local5)))) && ((_local5 <= 57343)))){
_local4 = ((65536 + ((_local4 & 1023) << 10)) + (_local5 & 1023));
_local3++;
};
if (_local4 <= 127){
_local2 = (_local2 + String.fromCharCode(_local4));
} else {
if (_local4 <= 2047){
_local2 = (_local2 + String.fromCharCode((192 | ((_local4 >>> 6) & 31)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 0xFFFF){
_local2 = (_local2 + String.fromCharCode((224 | ((_local4 >>> 12) & 15)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 2097151){
_local2 = (_local2 + String.fromCharCode((240 | ((_local4 >>> 18) & 7)), (128 | ((_local4 >>> 12) & 63)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
};
};
};
};
};
return (_local2);
}
public static function rstr_hmac_md5(_arg1:String, _arg2:String):String{
var _local3:Array = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
var _local4:Array = new Array(16);
var _local5:Array = new Array(16);
var _local6:Number = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
var _local7:Array = binl_md5(_local4.concat(rstr2binl(_arg2)), (0x0200 + (_arg2.length * 8)));
return (binl2rstr(binl_md5(_local5.concat(_local7), (0x0200 + 128))));
}
public static function str2rstr_utf16be(_arg1:String):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(((_arg1.charCodeAt(_local3) >>> 8) & 0xFF), (_arg1.charCodeAt(_local3) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2any(_arg1:String, _arg2:String):String{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local3:Number = _arg2.length;
var _local4:Array = [];
var _local9:Array = ((_arg1.length / 2) as Array);
_local5 = 0;
while (_local5 < _local9.length) {
_local9[_local5] = ((_arg1.charCodeAt((_local5 * 2)) << 8) | _arg1.charCodeAt(((_local5 * 2) + 1)));
_local5++;
};
while (_local9.length > 0) {
_local8 = [];
_local7 = 0;
_local5 = 0;
while (_local5 < _local9.length) {
_local7 = ((_local7 << 16) + _local9[_local5]);
_local6 = Math.floor((_local7 / _local3));
_local7 = (_local7 - (_local6 * _local3));
if ((((_local8.length > 0)) || ((_local6 > 0)))){
_local8[_local8.length] = _local6;
};
_local5++;
};
_local4[_local4.length] = _local7;
_local9 = _local8;
};
var _local10 = "";
_local5 = (_local4.length - 1);
while (_local5 >= 0) {
_local10 = (_local10 + _arg2.charAt(_local4[_local5]));
_local5--;
};
return (_local10);
}
public static function rstr_md5(_arg1:String):String{
return (binl2rstr(binl_md5(rstr2binl(_arg1), (_arg1.length * 8))));
}
}
}//package com.midasplayer.extras
Section 86
//SimpleParticle (com.midasplayer.extras.SimpleParticle)
package com.midasplayer.extras {
import flash.display.*;
public dynamic class SimpleParticle extends Shape {
private var _color:Number;// = 0
private var _size:Number;// = 1
private var _type:String;// = "rect"
public static var RECT:String = "rect";
public static var CIRCLE:String = "circle";
public function get size():Number{
return (_size);
}
public function set size(_arg1:Number){
_size = _arg1;
draw();
}
public function get color():Number{
return (_color);
}
public function set color(_arg1:Number){
_color = _arg1;
draw();
}
public function get type():String{
return (_type);
}
private function draw(){
clear();
graphics.beginFill(_color, 1);
switch (type){
case RECT:
graphics.drawRect((-(size) / 2), (-(size) / 2), size, size);
break;
case CIRCLE:
graphics.drawCircle((-(size) / 2), (-(size) / 2), size);
break;
};
graphics.endFill();
}
public function clear(){
graphics.clear();
}
public function set type(_arg1:String){
_type = _arg1;
draw();
}
}
}//package com.midasplayer.extras
Section 87
//SineWave (com.midasplayer.extras.SineWave)
package com.midasplayer.extras {
public class SineWave {
private var my_cycles:Number;
private var my_radius:Number;
private var my_phase:Number;
private var my_inc:Number;
public function SineWave(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
my_phase = _arg1;
my_cycles = _arg2;
my_radius = _arg3;
my_inc = _arg4;
}
public function set radius(_arg1:Number):void{
my_radius = _arg1;
}
public function get cycles():Number{
return (my_cycles);
}
public function get radius():Number{
return (my_radius);
}
public function set cycles(_arg1:Number):void{
my_cycles = _arg1;
}
public function get phase():Number{
return (my_phase);
}
public function set inc(_arg1:Number):void{
my_inc = _arg1;
}
public function set phase(_arg1:Number):void{
my_phase = _arg1;
}
public function get inc():Number{
return (my_inc);
}
}
}//package com.midasplayer.extras
Section 88
//Water (com.midasplayer.extras.Water)
package com.midasplayer.extras {
import flash.display.*;
public class Water extends MovieClip {
private var m_lines:Array;
public function Water(){
m_lines = new Array();
super();
}
public function decrThickness(_arg1:Boolean):Boolean{
var _local2:int;
var _local3:Boolean;
var _local4:int;
var _local5:Boolean;
if (_arg1){
_local2 = 0;
while (_local2 < m_lines.length) {
_local3 = false;
if (m_lines[_local2].decrThickness()){
_local3 = true;
} else {
return (false);
};
_local2++;
};
return (_local3);
//unresolved jump
};
_local4 = 0;
while (_local4 < m_lines.length) {
_local5 = false;
if (m_lines[_local4].incrThickness()){
_local5 = true;
} else {
return (false);
};
_local4++;
};
return (_local5);
}
public function init(_arg1:Number, _arg2:Number){
var _local3:WaterLine;
var _local5:int;
var _local4:uint = 0xFF0000;
if (this.name == "RED"){
_local4 = 0xFF0000;
_local5 = 1;
};
if (this.name == "GREEN"){
_local4 = 0xFF00;
_local5 = 1;
};
if (this.name == "BLUE"){
_local4 = 2782939;
_local5 = 1;
};
var _local6:* = 0;
while (_local6 < _local5) {
_local3 = new WaterLine();
_local3.addParams(_local4, _arg1, _arg2);
_local3.x = (_local6 * 1.5);
addChild(_local3);
m_lines.push(_local3);
_local6++;
};
}
}
}//package com.midasplayer.extras
Section 89
//WaterLine (com.midasplayer.extras.WaterLine)
package com.midasplayer.extras {
import flash.display.*;
import flash.events.*;
public class WaterLine extends MovieClip {
private var _height:Number;// = 400
private var _line:Shape;
private var _particlesQuantity:Number;// = 20
private var _color:uint;
private var _bubbles:Array;
private var _step:Number;
private var _particles:Array;
private var _lineSize:Number;
public function WaterLine(){
trace("WaterLine()");
}
public function incrThickness():Boolean{
_lineSize = (_lineSize + 0.5);
if (_lineSize >= 5){
return (true);
};
return (false);
}
public function get randomDirection():Number{
return (((Math.round((Math.random() * 1)) * 2) - 1));
}
public function addParams(_arg1:uint, _arg2:Number, _arg3:Number):void{
_color = _arg1;
_height = _arg2;
_lineSize = _arg3;
init();
}
private function createBubbles():void{
var _local2:SimpleParticle;
var _local4:Number;
var _local5:Number;
var _local6:*;
var _local1:Array = [_color, _color];
var _local3:* = 0;
while (_local3 < 5) {
_local2 = new SimpleParticle();
_local2.type = SimpleParticle.CIRCLE;
_local2.size = 0.8;
_local2.color = _local1[Math.round((Math.random() * (_local1.length - 1)))];
_local2.alpha = 1;
addChild(_local2);
_bubbles.push(_local2);
_local3++;
};
for (_local6 in _bubbles) {
_local2 = _bubbles[_local6];
if (!_local2.isOut){
_local2.y = (_local2.y + ((Math.random() * 5) + 10));
_local4 = Math.floor((_local2.y / this._step));
_local2.x = (_local2.x + (((_particles[_local4].x + ((Math.random() * 1) * randomDirection)) - _local2.x) * 0.8));
_local5 = Math.sqrt((Math.pow((mouseX - _local2.x), 2) + Math.pow((mouseY - _local2.y), 2)));
if ((((_local5 < 4)) && (!(_local2.isOut)))){
};
} else {
_local2.y = (_local2.y + _local2.speedY);
_local2.speedY = (_local2.speedY + 3);
_local2.x = (_local2.x + _local2.speedX);
_local2.alpha = (_local2.alpha - 0.005);
};
if ((((_local2.y > _height)) || ((_local2.alpha < 0)))){
_bubbles.splice(_local6, 1);
_local2.parent.removeChild(_local2);
_local2 = null;
};
};
}
private function createLine():void{
var _local1:SimpleParticle;
var _local2:* = 0;
while (_local2 < _particlesQuantity) {
_local1 = new SimpleParticle();
_local1.elasticX = 0;
_local1.yIni = (_local1.y = (_step * _local2));
addChild(_local1);
_particles.push(_local1);
_local2++;
};
}
private function init(){
_line = new Shape();
_line.alpha = 0.8;
addChild(_line);
_bubbles = [];
_particles = [];
_step = (_height / (_particlesQuantity - 1));
createLine();
addEventListener(Event.ENTER_FRAME, animate);
}
private function animate(_arg1:Event):void{
var _local2:SimpleParticle;
var _local3:SimpleParticle;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local9:Number;
var _local8:Number = 10;
var _local10:Number = 3;
_line.graphics.clear();
_line.graphics.moveTo(_particles[0].x, _particles[0].y);
_line.graphics.lineStyle(_lineSize, _color, 1);
var _local11:* = 0;
while (_local11 < _particles.length) {
_local3 = _particles[_local11];
if (_local11 == 0){
_local3.x = (_local3.x + ((((Math.random() * _local10) * randomDirection) - _local3.x) * 0.9));
};
_local2 = ((_local11)>0) ? _particles[(_local11 - 1)] : _local3;
_local7 = Math.sqrt((Math.pow((mouseX - 0), 2) + Math.pow((mouseY - _local3.yIni), 2)));
if (_local7 < _local8){
} else {
_local5 = _local2.x;
_local3.elasticX = ((_local3.elasticX * 0.4) + ((_local5 - _local3.x) * 0.4));
_local3.x = (_local3.x + _local3.elasticX);
};
if (_local11 > 0){
_line.graphics.curveTo(_local2.x, _local2.y, ((_local2.x + _local3.x) / 2), ((_local2.y + _local3.y) / 2));
};
_local11++;
};
}
private function spreadBubble(_arg1:SimpleParticle):void{
_arg1.isOut = true;
parent.parent.addChild(_arg1);
_arg1.size = 1.2;
_arg1.alpha = 0.35;
_arg1.x = (parent.x + _arg1.x);
_arg1.y = (parent.y + _arg1.y);
_arg1.speedY = (-5 - (Math.random() * 10));
_arg1.speedX = (((Math.random() * 15) + 1) * randomDirection);
}
public function decrThickness():Boolean{
_lineSize--;
if (_lineSize <= 0){
return (true);
};
return (false);
}
}
}//package com.midasplayer.extras
Section 90
//WaveEngine (com.midasplayer.extras.WaveEngine)
package com.midasplayer.extras {
import flash.display.*;
import flash.events.*;
public class WaveEngine extends MovieClip {
private var m_wave:DrawSine;
private var m_fillColor:uint;
private var m_num_waves:int;// = 3
private var m_waveHolder:MovieClip;
private var m_sinArr:Array;
private var m_rootRef:MovieClip;
public function WaveEngine(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:uint, _arg5:uint, _arg6:MovieClip){
m_waveHolder = new MovieClip();
m_sinArr = new Array();
super();
m_rootRef = _arg1;
m_waveHolder = _arg6;
m_wave = new DrawSine(m_waveHolder, _arg2, _arg3, 100);
var _local7:* = 0;
while (_local7 < m_num_waves) {
m_sinArr.push(new SineWave(((Math.random() * Math.PI) * 1.5), (Math.random() * 1.5), ((Math.random() * 1.5) + 1), (Math.random() - 0.5)));
_local7++;
};
m_wave.set_stroke(3, _arg5);
m_wave.set_fill(true, _arg4, 100);
m_fillColor = _arg4;
}
public function startWave():void{
m_rootRef.addEventListener(Event.ENTER_FRAME, update);
}
public function getWave():MovieClip{
return (m_waveHolder);
}
private function update(_arg1:Event):void{
var _local2:*;
for (_local2 in m_sinArr) {
m_sinArr[_local2].phase = (m_sinArr[_local2].phase + m_sinArr[_local2].inc);
};
m_wave.set_fill(true, m_fillColor, 1);
m_wave.draw_waves(m_sinArr);
}
public function stopWave():void{
m_rootRef.removeEventListener(Event.ENTER_FRAME, update);
}
public function colorUpdate(_arg1:uint):void{
var _local2:String = ("0x" + _arg1.toString(16));
m_fillColor = uint(_local2);
}
}
}//package com.midasplayer.extras
Section 91
//KingAPI (com.midasplayer.KingAPI)
package com.midasplayer {
import flash.events.*;
import com.midasplayer.extras.*;
import flash.net.*;
import flash.external.*;
public class KingAPI {
public static const LINK_TYPE_RIGHT_CLICK:String = "rightclick";
public static const USER_TYPE_SUBSCRIPTION:int = 3;
public static const LINK_TYPE_HIGHSCORES:String = "highscores";
public static const LINK_TYPE_SIGN:String = "sign";
public static const INITIALIZED_EVENT:String = "initialized";
public static const LINK_TYPE_OTHER_GAMES:String = "other_games";
public static const USER_TYPE_REGISTERED:int = 1;
private static const SAK:String = "ggfd7sday923mdsfd8csfds34";
private static const loadHomeParametersURL:String = "http://www.king.com/servlet/FreeGameServlet?action=load";
public static const LINK_TYPE_LOADER_MOVIE:String = "loader_movie";
private static const bounceURL:String = "http://www.mygame.com/king/bounce.jsp";
public static const LINK_TYPE_PROTECT:String = "protect";
public static const LINK_TYPE_ADD_GAME:String = "add_game";
public static const USER_TYPE_GOLD:int = 2;
public static const USER_TYPE_UNREGISTERED:int = 0;
public static const HOST_BANNED_EVENT:String = "hostBanned";
private static const SK:String = "vf78hxcsjak77cxzhjkwad87s";
private static const loadCountURL:String = "http://www.mygame.com/king/loadcount.jsp";
public static const LINK_TYPE_LOADER_PROGRESS:String = "loader_progress";
private static var check:String = null;
public static var gameName:String;
public static var banned:Boolean = false;
protected static var dispatcher:EventDispatcher;
public static var isHome:Boolean = false;
private static var sessionID:String;
private static var iscore:int = 123;
public static var fromURL:String;
private static var SSK:String = "ng43ui54hy35tdsnd6f54rews";
private static function loadUrlErrorHandler(_arg1:Event):void{
trace(("Unable to load url: " + _arg1));
}
public static function resetScore():void{
iscore = 123;
check = null;
}
public static function openOfflineProtectionLink():void{
openKingPage(LINK_TYPE_PROTECT);
}
public static function init(_arg1:String, _arg2:String):void{
var so:SharedObject;
var rnd1:Number;
var rnd2:Number;
var name = _arg1;
var from = _arg2;
gameName = name;
fromURL = from;
var loadCounter:URLLoader = new URLLoader();
var reqvars:URLVariables = new URLVariables();
reqvars.game = gameName;
reqvars.from = fromURL;
try {
so = SharedObject.getLocal("sessionId");
if (so.data.sessionID == null){
rnd1 = Math.abs(Math.floor((Math.random() * 4294967295)));
rnd2 = Math.abs(Math.floor((Math.random() * 4294967295)));
so.data.sessionID = (rnd1.toString(16) + rnd2.toString(16));
so.flush();
};
sessionID = so.data.sessionID;
} catch(e:Error) {
sessionID = "error";
};
reqvars.session = sessionID;
var request:URLRequest = new URLRequest(((loadCountURL + "?") + reqvars.toString()));
loadCounter.addEventListener(Event.COMPLETE, loadCountHandler);
loadCounter.addEventListener(IOErrorEvent.IO_ERROR, loadUrlErrorHandler);
loadCounter.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loadUrlErrorHandler);
try {
loadCounter.load(request);
} catch(error:Error) {
trace(("Unable to load loadcount url: " + loadCountURL));
trace(error.message);
};
}
private static function loadHomeParametersHandler(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
trace(("loadCounter.data" + _local2.data));
}
public static function submitInternalScore():void{
checkScore();
var _local1:int = ((iscore - 123) / 2);
submitScore(_local1);
}
public static function openOtherGamesLink():void{
openKingPage(LINK_TYPE_OTHER_GAMES);
}
public static function openKingPage(_arg1:String, _arg2:String=null):void{
var _local3:URLVariables = new URLVariables();
_local3.game = gameName;
_local3.from = fromURL;
_local3.type = _arg1;
_local3.session = sessionID;
if (_arg2 != null){
_local3.redirect = _arg2;
};
var _local4 = "_blank";
if (isHome){
_local4 = "_top";
};
navigateToURL(new URLRequest(((bounceURL + "?") + _local3.toString())), _local4);
}
private static function loadCountHandler(_arg1:Event):void{
var vars:URLVariables;
var event = _arg1;
var loadCounter:URLLoader = URLLoader(event.target);
trace(("loadCounter.data :" + loadCounter.data));
try {
vars = new URLVariables(loadCounter.data);
if (vars.h == "true"){
isHome = true;
};
if (vars.b == "true"){
banned = true;
dispatcher.dispatchEvent(new Event(HOST_BANNED_EVENT));
} else {
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
};
trace((("::" + vars.h) + "::"));
trace((("::" + vars.b) + "::"));
} catch(e:Error) {
trace(("Error reading data from loadcount url: " + e));
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
dispatcher = new EventDispatcher();
};
dispatcher.addEventListener(_arg1, _arg2);
}
public static function openLoaderMovieLink():void{
openKingPage(LINK_TYPE_LOADER_MOVIE);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
return;
};
dispatcher.removeEventListener(_arg1, _arg2);
}
public static function submitScore(_arg1:int):void{
var score = _arg1;
var hash:String = md5.encrypt(((((score + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitScore", score, hash);
} else {
openKingPage(LINK_TYPE_HIGHSCORES, ((((("game/" + gameName) + "/submit/") + score) + ":") + hash));
};
} catch(e:Error) {
trace(e);
};
}
public static function submitLevel(_arg1:int):void{
var level = _arg1;
var hash:String = md5.encrypt(((((level + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitLevel", level, hash);
};
} catch(e:Error) {
trace(e);
};
}
public static function openHighscoresLink():void{
openKingPage(LINK_TYPE_HIGHSCORES, (("game/" + gameName) + "/highscores"));
}
public static function openSignLink():void{
if (!isHome){
openKingPage(LINK_TYPE_SIGN);
};
}
public static function openRightClickLink():void{
openKingPage(LINK_TYPE_RIGHT_CLICK);
}
private static function checkScore():void{
if (check != null){
if (check != md5.encrypt(((((iscore + ":") + gameName) + ":") + SK))){
SSK = "ng41ui54hy35tdsnd6f54rews";
};
};
}
public static function addScore(_arg1:int):int{
checkScore();
var _local2:int = ((iscore - 123) / 2);
_local2 = (_local2 + _arg1);
iscore = ((_local2 * 2) + 123);
check = md5.encrypt(((((iscore + ":") + gameName) + ":") + SK));
return (_local2);
}
public static function openLoaderProgressLink():void{
openKingPage(LINK_TYPE_LOADER_PROGRESS);
}
public static function openAddToWebsiteLink():void{
openKingPage(LINK_TYPE_ADD_GAME, "website_content.jsp");
}
public static function submitAchievement(_arg1:String):void{
var achievement = _arg1;
var hash:String = md5.encrypt(((((achievement + ":") + gameName) + ":") + SAK));
try {
if (isHome){
ExternalInterface.call("submitAchievement", achievement, hash);
};
} catch(e:Error) {
trace(e);
};
}
}
}//package com.midasplayer
Section 92
//MainLoader (com.midasplayer.MainLoader)
package com.midasplayer {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.transitions.*;
import com.midasplayer.extras.*;
import flash.media.*;
import fl.transitions.easing.*;
public class MainLoader extends MovieClip {
private var STAGE_WIDTH:Number;// = 650
private var m_waveEngineCrown:WaveEngine;
private var m_streamBlue:Boolean;// = false
private var m_clsRed:Water;
private var m_ferryGreen:MovieClip;
private var m_overBtn:Boolean;// = false
private var m_tween:Tween;
private var m_startColor:ColorTransform;
private var m_dist:Number;
private var m_ferryBlue:MovieClip;
private var m_yellowDest:Number;
private var m_logoHolder:Sprite;
private var m_prevPerc:Number;// = -1
private var m_tweenBounceLogo:Tween;
private var m_bg:Sprite;
private var m_streamHeight:Number;
private var m_step:Number;
private var m_logoFill:Boolean;// = true
private var m_isLoaded:Boolean;// = false
private var m_waveHolderLogo:MovieClip;
private var m_maskRown:MovieClip;
private var m_sun:Sprite;
private var m_mask:MovieClip;
private var m_rootRef:MovieClip;
private var m_crownFill:Boolean;// = false
private var m_clsGreen:Water;
private var m_GREEN:MovieClip;
private var m_loaderContent:Array;
private var m_safari:Boolean;// = false
private var m_bounce:Boolean;// = false
private var m_colorOff:Boolean;// = false
private var m_RED:MovieClip;
private var m_streamGreen:Boolean;// = true
private var MOCHI:String;// = "b041e6b4"
private var m_otherGames:Sprite;
private var m_streamRed:Boolean;// = false
private var STAGE_HEIGHT:Number;// = 500
private var m_ferryRed:MovieClip;
private var m_pressBtn:Boolean;// = false
private var GAME_NAME:String;// = "volt-connect"
private var m_count;// = 0
private var m_play:Sprite;
private var m_sampleLoadPerc:Number;// = -1
private var m_gameFrameRate:int;
private var m_clsBlue:Water;
private var m_endColor:ColorTransform;
private var m_waveHolderCrown:MovieClip;
private var m_BLUE:MovieClip;
private var m_greenDest:Number;
private var m_waveEngineLogo:WaveEngine;
public function MainLoader(){
m_loaderContent = new Array();
m_waveHolderLogo = new MovieClip();
m_waveHolderCrown = new MovieClip();
m_play = new Sprite();
m_otherGames = new Sprite();
m_mask = new MovieClip();
m_maskRown = new MovieClip();
m_RED = new WaterHolderR();
m_GREEN = new WaterHolderG();
m_BLUE = new WaterHolderB();
m_ferryGreen = new ferryGreen();
m_ferryRed = new ferryRed();
m_ferryBlue = new ferryBlue();
super();
addFrameScript(1, frame2);
trace("MainLoader()");
stop();
m_rootRef = this;
m_bg = new Sprite();
m_bg.graphics.beginFill(0x333333, 1);
m_bg.graphics.drawRect(0, 0, STAGE_WIDTH, STAGE_HEIGHT);
m_bg.addEventListener(MouseEvent.CLICK, openKingPage);
m_rootRef.addChild(m_bg);
m_loaderContent.push(m_bg);
stage.scaleMode = StageScaleMode.NO_SCALE;
KingAPI.addEventListener(KingAPI.INITIALIZED_EVENT, onKingApiInit);
KingAPI.addEventListener(KingAPI.HOST_BANNED_EVENT, onKingApiInit);
KingAPI.init(GAME_NAME, root.loaderInfo.url);
}
private function playLoaderMovie():void{
var _local1:MovieClip = new mcFerryLine();
m_rootRef.addChild(m_ferryGreen);
m_rootRef.addChild(m_ferryRed);
m_rootRef.addChild(m_ferryBlue);
m_ferryGreen.x = ((STAGE_WIDTH / 2) - 2);
m_ferryRed.x = ((m_ferryGreen.x - (m_ferryGreen.width / 2)) + 15);
m_ferryBlue.x = ((m_ferryGreen.x + (m_ferryGreen.width / 2)) - 17);
m_ferryBlue.y = (m_ferryGreen.y = (m_ferryRed.y = (m_bg.y + 15)));
m_loaderContent.push(m_ferryGreen);
m_loaderContent.push(m_ferryRed);
m_loaderContent.push(m_ferryBlue);
_local1.x = (STAGE_WIDTH / 2);
_local1.y = ((m_ferryGreen.y + m_ferryGreen.height) - 9);
m_streamHeight = ((STAGE_HEIGHT / 2) - 40);
m_clsRed = m_RED.RED;
m_clsRed.init(m_streamHeight, 1);
m_clsGreen = m_GREEN.GREEN;
m_clsGreen.init(m_streamHeight, 1);
m_clsBlue = m_BLUE.BLUE;
m_clsBlue.init(m_streamHeight, 1);
m_RED.alpha = (m_GREEN.alpha = (m_BLUE.alpha = 0));
m_rootRef.addChild(m_RED);
m_rootRef.addChild(m_GREEN);
m_rootRef.addChild(m_BLUE);
m_loaderContent.push(m_RED);
m_loaderContent.push(m_GREEN);
m_loaderContent.push(m_BLUE);
m_RED.x = ((STAGE_WIDTH / 2) - 22);
m_GREEN.x = ((STAGE_WIDTH / 2) - 4);
m_BLUE.x = ((STAGE_WIDTH / 2) + 16);
m_RED.y = (m_GREEN.y = (m_BLUE.y = _local1.y));
m_waveEngineLogo = new WaveEngine(m_rootRef, 205.8, 120, 0xFF00, 0xFF00, m_waveHolderLogo);
m_waveHolderLogo = m_waveEngineLogo.getWave();
m_rootRef.addChild(m_waveHolderLogo);
m_loaderContent.push(m_waveHolderLogo);
m_waveEngineCrown = new WaveEngine(m_rootRef, 67.5, 100, 0xFFAA00, 0xFFAA00, m_waveHolderCrown);
m_waveHolderCrown = m_waveEngineCrown.getWave();
m_rootRef.addChild(m_waveHolderCrown);
m_loaderContent.push(m_waveHolderCrown);
m_logoHolder = new mcLogoHolder();
m_logoHolder.x = (STAGE_WIDTH / 2);
m_logoHolder.y = ((STAGE_HEIGHT / 2) - 2);
m_logoHolder.mouseEnabled = false;
m_rootRef.addChild(m_logoHolder);
m_loaderContent.push(m_logoHolder);
m_mask = new mcLogoMask();
m_mask.x = m_logoHolder.x;
m_mask.y = m_logoHolder.y;
m_rootRef.addChild(m_mask);
m_loaderContent.push(m_mask);
m_maskRown = new mcCrownMask();
m_maskRown.x = m_logoHolder.x;
m_maskRown.y = m_logoHolder.y;
m_rootRef.addChild(m_maskRown);
m_loaderContent.push(m_maskRown);
m_waveHolderLogo.mask = m_mask;
m_waveHolderLogo.x = ((STAGE_WIDTH / 2) - (m_mask.width / 2));
m_waveHolderLogo.y = (((STAGE_HEIGHT / 2) + (m_mask.height / 2)) + 15);
m_waveHolderCrown.mask = m_maskRown;
m_waveHolderCrown.x = (m_logoHolder.x - (m_maskRown.width / 2));
m_waveHolderCrown.y = (m_logoHolder.y + 4);
m_waveEngineLogo.startWave();
m_waveEngineCrown.startWave();
m_greenDest = ((m_waveHolderLogo.y - (120 / 2)) - 10);
m_yellowDest = (m_waveHolderCrown.y - (100 / 2));
m_dist = (m_waveHolderCrown.y - m_yellowDest);
m_startColor = new ColorTransform();
m_startColor.color = 0xFF00;
m_endColor = new ColorTransform();
m_endColor.color = 35886;
m_play = new mcPlay();
m_play.x = (STAGE_WIDTH / 2);
m_play.y = ((m_logoHolder.y + m_logoHolder.height) - 5);
m_play.buttonMode = true;
m_play.alpha = 0;
m_play.visible = false;
m_play.addEventListener(MouseEvent.MOUSE_UP, onPlayReleased);
m_play.addEventListener(MouseEvent.MOUSE_OVER, onBtnOver);
m_play.addEventListener(MouseEvent.MOUSE_OUT, onBtnOut);
m_rootRef.addChild(m_play);
m_loaderContent.push(m_play);
m_otherGames = new mcOtherGames();
m_otherGames.x = (STAGE_WIDTH / 2);
m_otherGames.y = ((m_play.y + m_play.height) + 15);
m_otherGames.buttonMode = true;
m_otherGames.alpha = 0;
m_otherGames.visible = false;
m_otherGames.addEventListener(MouseEvent.MOUSE_UP, onOtherReleased);
m_otherGames.addEventListener(MouseEvent.MOUSE_OVER, onBtnOver);
m_otherGames.addEventListener(MouseEvent.MOUSE_OUT, onBtnOut);
m_rootRef.addChild(m_otherGames);
m_loaderContent.push(m_otherGames);
m_rootRef.addEventListener(Event.ENTER_FRAME, update);
m_safari = ((stage.loaderInfo.bytesTotal == 0)) ? true : false;
}
private function onLoaderMovieFinished():void{
trace("onGameLoaded()");
m_tween.removeEventListener(TweenEvent.MOTION_CHANGE, tweenTransformCrown);
m_rootRef.removeEventListener(Event.ENTER_FRAME, update);
}
private function onPlayReleased(_arg1:MouseEvent):void{
cleanUp();
gotoGame();
}
private function openKingPage(_arg1:Event):void{
trace(("openKingPage() " + _arg1));
KingAPI.openLoaderMovieLink();
}
private function onBtnOut(_arg1:MouseEvent):void{
_arg1.target.removeEventListener(MouseEvent.MOUSE_DOWN, onBtnPress);
if (m_pressBtn){
_arg1.target.x = (_arg1.target.x - 1);
_arg1.target.y = (_arg1.target.y - 2);
m_pressBtn = false;
};
}
private function onBtnPress(_arg1:MouseEvent):void{
m_pressBtn = true;
_arg1.target.x = (_arg1.target.x + 1);
_arg1.target.y = (_arg1.target.y + 2);
}
private function onKingApiInit(_arg1:Event):void{
trace(("onKingApiInit() :" + _arg1.type));
if (MOCHI != ""){
MochiBot.track(this, MOCHI);
};
m_gameFrameRate = root.stage.frameRate;
root.stage.frameRate = 30;
if (KingAPI.banned){
showBannedScreen();
return;
};
playLoaderMovie();
}
function frame2(){
}
private function onBtnOver(_arg1:MouseEvent):void{
_arg1.target.addEventListener(MouseEvent.MOUSE_DOWN, onBtnPress);
}
private function tweenTransformLogo(_arg1:TweenEvent):void{
m_waveEngineLogo.colorUpdate(interpolateColor(m_startColor, m_endColor, m_tween.position).color);
}
private function cleanUp():void{
m_otherGames.removeEventListener(MouseEvent.MOUSE_UP, onOtherReleased);
m_otherGames.removeEventListener(MouseEvent.MOUSE_DOWN, onBtnPress);
m_otherGames.removeEventListener(MouseEvent.MOUSE_OVER, onBtnOver);
m_otherGames.removeEventListener(MouseEvent.MOUSE_OUT, onBtnOut);
m_play.removeEventListener(MouseEvent.MOUSE_UP, onPlayReleased);
m_play.removeEventListener(MouseEvent.MOUSE_DOWN, onBtnPress);
m_play.removeEventListener(MouseEvent.MOUSE_OVER, onBtnOver);
m_play.removeEventListener(MouseEvent.MOUSE_OUT, onBtnOut);
var _local1:int;
while (_local1 < m_loaderContent.length) {
m_rootRef.removeChild(m_loaderContent[_local1]);
m_loaderContent[_local1] = null;
_local1++;
};
}
private function showBannedScreen():void{
var _local1:Sprite = new mcBannedSign();
_local1.buttonMode = true;
_local1.addEventListener(MouseEvent.CLICK, openKingPage);
m_rootRef.addChild(_local1);
}
private function update(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:MovieClip;
var _local5:Sound;
var _local6:Sound;
if (m_safari){
if (m_rootRef.framesLoaded == m_rootRef.totalFrames){
m_isLoaded = true;
};
} else {
if ((((stage.loaderInfo.bytesLoaded == stage.loaderInfo.bytesTotal)) && (!(m_isLoaded)))){
m_isLoaded = true;
};
};
m_count++;
if (m_streamGreen){
if (m_count == 1){
m_GREEN.height = (m_GREEN.height - m_GREEN.height);
m_GREEN.alpha = 1;
m_ferryGreen.gotoAndStop("on");
};
m_GREEN.height = (m_GREEN.height + 20);
if (m_GREEN.height >= m_streamHeight){
m_GREEN.height = m_streamHeight;
if (m_clsGreen.decrThickness(false)){
m_streamGreen = false;
m_streamBlue = true;
m_count = 0;
};
};
};
if (m_streamBlue){
if (m_count >= 40){
if (m_count == 40){
m_BLUE.height = (m_BLUE.height - m_BLUE.height);
m_BLUE.alpha = 1;
m_ferryBlue.gotoAndStop("on");
m_tween = new Tween(m_waveHolderLogo, "", None.easeNone, 0, 1, 2, true);
m_tween.addEventListener(TweenEvent.MOTION_CHANGE, tweenTransformLogo);
};
m_BLUE.height = (m_BLUE.height + 20);
if (m_BLUE.height >= m_streamHeight){
m_BLUE.height = m_streamHeight;
if (m_clsBlue.decrThickness(false)){
m_streamBlue = false;
};
};
};
};
if (m_logoFill){
if (m_waveHolderLogo.y > m_greenDest){
m_waveHolderLogo.y = (m_waveHolderLogo.y - 0.3);
} else {
m_waveHolderLogo.y = m_greenDest;
if (!m_streamBlue){
m_colorOff = true;
m_waveEngineLogo.stopWave();
};
};
};
if (m_colorOff){
if (m_logoFill){
if (m_clsBlue.decrThickness(true)){
if (m_BLUE.rotation != 180){
m_BLUE.rotation = 180;
m_BLUE.y = (STAGE_HEIGHT / 2);
m_ferryBlue.gotoAndStop("off");
};
m_BLUE.scaleY = (m_BLUE.scaleY - 0.1);
if (m_BLUE.scaleY < 0){
m_BLUE.alpha = 0;
m_colorOff = false;
m_logoFill = false;
m_count = 0;
m_crownFill = true;
m_streamRed = true;
m_startColor = new ColorTransform();
m_startColor.color = 0xFF00;
m_endColor = new ColorTransform();
m_endColor.color = 0xFFAA00;
m_tween.removeEventListener(TweenEvent.MOTION_CHANGE, tweenTransformLogo);
m_tween = new Tween(m_waveHolderCrown, "", None.easeNone, 0, 1, 2, true);
m_tween.addEventListener(TweenEvent.MOTION_CHANGE, tweenTransformCrown);
};
};
};
if (m_crownFill){
if (((m_clsRed.decrThickness(true)) && (m_clsGreen.decrThickness(true)))){
if (m_GREEN.rotation != 180){
m_GREEN.rotation = 180;
m_RED.rotation = 180;
m_GREEN.y = (STAGE_HEIGHT / 2);
m_RED.y = (STAGE_HEIGHT / 2);
m_ferryGreen.gotoAndStop("off");
m_ferryRed.gotoAndStop("off");
};
m_GREEN.scaleY = (m_GREEN.scaleY - 0.1);
m_RED.scaleY = (m_RED.scaleY - 0.1);
if ((((m_GREEN.scaleY < 0)) && ((m_RED.scaleY < 0)))){
m_GREEN.alpha = 0;
m_RED.alpha = 0;
m_colorOff = false;
m_crownFill = false;
m_bounce = true;
m_count = 0;
};
};
};
};
if (m_crownFill){
if (m_sampleLoadPerc == -1){
m_sampleLoadPerc = (100 - (100 * (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal)));
m_step = (m_dist / 100);
};
_local2 = (100 - (100 * (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal)));
_local2 = ((100 * (m_sampleLoadPerc - _local2)) / m_sampleLoadPerc);
if (m_waveHolderCrown.y > m_yellowDest){
if ((m_waveHolderCrown.y - m_step) < m_yellowDest){
m_waveHolderCrown.y = m_yellowDest;
} else {
if (m_isLoaded){
m_waveHolderCrown.y = (m_waveHolderCrown.y - 0.5);
} else {
if (m_prevPerc != _local2){
_local3 = (_local2 - m_prevPerc);
m_waveHolderCrown.y = (m_waveHolderCrown.y - m_step);
m_prevPerc = _local2;
};
};
};
} else {
m_colorOff = true;
m_waveEngineCrown.stopWave();
};
};
if (m_streamRed){
if (m_count >= 20){
if (m_count == 20){
m_RED.height = (m_RED.height - m_RED.height);
m_RED.alpha = 1;
m_ferryRed.gotoAndStop("on");
};
m_RED.height = (m_RED.height + 20);
if (m_RED.height >= m_streamHeight){
m_RED.height = m_streamHeight;
if (m_clsRed.decrThickness(false)){
m_streamRed = false;
};
};
};
};
if (m_bounce){
if (m_count == 1){
_local4 = new mcWaterRing();
_local4.x = (STAGE_WIDTH / 2);
_local4.y = ((STAGE_HEIGHT / 2) + 30);
m_rootRef.addChild(_local4);
m_loaderContent.push(_local4);
};
if (m_count == 2){
_local5 = new sfxBounce();
_local5.play();
};
if (m_count < 3){
m_logoHolder.y = (m_logoHolder.y + 1);
m_waveHolderCrown.y = (m_waveHolderCrown.y + 1);
m_waveHolderLogo.y = (m_waveHolderLogo.y + 1);
m_maskRown.y = (m_maskRown.y + 1);
m_mask.y = (m_mask.y + 1);
};
if ((((m_count > 2)) && ((m_count < 4)))){
m_logoHolder.y = (m_logoHolder.y - 1);
m_waveHolderCrown.y = (m_waveHolderCrown.y - 1);
m_waveHolderLogo.y = (m_waveHolderLogo.y - 1);
m_maskRown.y = (m_maskRown.y - 1);
m_mask.y = (m_mask.y - 1);
};
if (m_count == 4){
_local6 = new sfxBell();
_local6.play();
};
if (m_count == 30){
m_play.visible = true;
m_otherGames.visible = true;
};
if (m_count > 30){
m_play.alpha = (m_play.alpha + 0.05);
if (m_count > 40){
m_otherGames.alpha = (m_otherGames.alpha + 0.05);
};
if ((((m_play.alpha >= 1)) && ((m_otherGames.alpha >= 1)))){
m_bounce = false;
onLoaderMovieFinished();
};
};
};
}
private function onOtherReleased(_arg1:MouseEvent):void{
cleanUp();
KingAPI.openOtherGamesLink();
}
private function interpolateColor(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:ColorTransform = new ColorTransform();
_local4.redMultiplier = (_arg1.redMultiplier + ((_arg2.redMultiplier - _arg1.redMultiplier) * _arg3));
_local4.greenMultiplier = (_arg1.greenMultiplier + ((_arg2.greenMultiplier - _arg1.greenMultiplier) * _arg3));
_local4.blueMultiplier = (_arg1.blueMultiplier + ((_arg2.blueMultiplier - _arg1.blueMultiplier) * _arg3));
_local4.alphaMultiplier = (_arg1.alphaMultiplier + ((_arg2.alphaMultiplier - _arg1.alphaMultiplier) * _arg3));
_local4.redOffset = (_arg1.redOffset + ((_arg2.redOffset - _arg1.redOffset) * _arg3));
_local4.greenOffset = (_arg1.greenOffset + ((_arg2.greenOffset - _arg1.greenOffset) * _arg3));
_local4.blueOffset = (_arg1.blueOffset + ((_arg2.blueOffset - _arg1.blueOffset) * _arg3));
_local4.alphaOffset = (_arg1.alphaOffset + ((_arg2.alphaOffset - _arg1.alphaOffset) * _arg3));
return (_local4);
}
private function gotoGame():void{
root.stage.frameRate = m_gameFrameRate;
m_rootRef.gotoAndStop(2);
}
private function tweenTransformCrown(_arg1:TweenEvent):void{
m_waveEngineCrown.colorUpdate(interpolateColor(m_startColor, m_endColor, m_tween.position).color);
}
}
}//package com.midasplayer
Section 93
//ProcessEvent (com.touchmypixel.events.ProcessEvent)
package com.touchmypixel.events {
import flash.events.*;
public class ProcessEvent extends Event {
public var percentage:Number;// = 0
public static const START = "Process.Start";
public static const COMPLETE = "Process.Complete";
public static const PROGRESS = "Process.Progress";
public function ProcessEvent(_arg1:String, _arg2:Number=0, _arg3:Boolean=false, _arg4:Boolean=false){
this.percentage = _arg2;
if (_arg1 == COMPLETE){
this.percentage = 1;
};
super(_arg1, _arg3, _arg4);
}
}
}//package com.touchmypixel.events
Section 94
//Animation (com.touchmypixel.peepee.utils.Animation)
package com.touchmypixel.peepee.utils {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import com.bit101.display.*;
public class Animation extends Sprite {
private var _cache:Boolean;// = true
public var useSpriteSheet:Boolean;// = false
public var treatAsLoopedGraphic:Boolean;// = false
private var clipData:MovieClip;
public var repeat:Boolean;// = true
public var frames:Array;
public var bitmap:Bitmap;
public var speed:Number;// = 1
private var _totalFrames;
public var bigBitmap:BigAssCanvas;
public var clip:MovieClip;
public var rows:Number;// = 0
public var reverse:Boolean;// = false
private var _playing:Boolean;// = false
public var r:Rectangle;
public var cols:Number;// = 0
public var currentFrame:Number;// = 1
public var onEnd:Function;
public function Animation(){
frames = [];
super();
bitmap = new Bitmap();
bitmap.smoothing = false;
addChild(bitmap);
}
public function set bitmapData(_arg1:BitmapData){
bitmap.bitmapData = _arg1;
}
public function stop():void{
_playing = false;
removeEventListener(Event.ENTER_FRAME, enterFrame);
}
public function buildCacheFromClip2(_arg1:MovieClip):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Matrix;
clip = _arg1;
if (clip["e_bounds"] != null){
_local3 = clip["e_bounds"];
r = new Rectangle(_local3.x, _local3.y, _local3.width, _local3.height);
clip["e_bounds"].visible = false;
} else {
r = clip.getRect(clip);
};
cols = Math.floor((2880 / r.width));
rows = Math.ceil((clip.totalFrames / cols));
bigBitmap = new BigAssCanvas(Math.ceil((cols * clip.width)), Math.ceil((rows * clip.height)), true);
var _local2:* = 0;
while (_local2 <= (clip.totalFrames - 1)) {
clip.gotoAndStop((_local2 + 1));
makeAllChildrenGoToFrame(clip, (_local2 + 1));
_local4 = ((_local2 % cols) * r.width);
_local5 = (Math.floor((_local2 / cols)) * r.height);
_local6 = new Matrix();
_local6.translate(-(r.x), -(r.y));
_local6.scale(clip.scaleX, clip.scaleY);
_local6.translate(_local4, _local5);
bigBitmap.draw(clip, _local6, null, null);
_local2++;
};
_totalFrames = clip.totalFrames;
}
public function gotoAndPlayRandomFrame():void{
gotoAndPlay(Math.ceil((Math.random() * totalFrames)));
}
public function get totalFrames():Number{
return (clip.totalFrames);
}
public function destroy(){
stop();
if (parent){
parent.removeChild(this);
};
}
public function gotoAndStop(_arg1:Number):void{
if (treatAsLoopedGraphic){
if (_arg1 > totalFrames){
_arg1 = (_arg1 % totalFrames);
};
};
currentFrame = _arg1;
goto(currentFrame);
stop();
}
public function get playing():Boolean{
return (_playing);
}
public function play():void{
_playing = true;
addEventListener(Event.ENTER_FRAME, enterFrame, false, 0, true);
}
public function nextFrame(_arg1:Boolean=false):void{
if (_arg1){
currentFrame = (currentFrame + speed);
} else {
currentFrame++;
};
if (currentFrame > totalFrames){
currentFrame = 1;
};
goto(Math.floor(currentFrame));
}
public function gotoAndPlay(_arg1:Number):void{
currentFrame = _arg1;
goto(currentFrame);
play();
}
public function update():void{
stop();
frames = [];
buildCacheFromClip(clip);
}
private function makeAllChildrenGoToFrame(_arg1:MovieClip, _arg2:int):void{
var _local4:*;
var _local3:int;
while (_local3 < _arg1.numChildren) {
_local4 = _arg1.getChildAt(_local3);
if ((_local4 is MovieClip)){
makeAllChildrenGoToFrame(_local4, _arg2);
_local4.gotoAndStop(_arg2);
};
_local3++;
};
}
public function buildCacheFromLibrary(_arg1:String):void{
if (useSpriteSheet){
buildCacheFromClip2(new (getDefinitionByName(_arg1)));
} else {
buildCacheFromClip(new (getDefinitionByName(_arg1)));
};
}
private function goto(_arg1:Number):void{
var _local2:*;
var _local3:Rectangle;
var _local4:Rectangle;
if (!_cache){
if (!clipData){
_local2 = getQualifiedClassName(clip);
clipData = new (getDefinitionByName(_local2));
_local3 = clipData.getRect(clipData);
clipData.x = _local3.x;
clipData.y = _local3.y;
addChild(clipData);
};
clipData.gotoAndStop(_arg1);
} else {
if (useSpriteSheet){
_local4 = r.clone();
_local4.x = (((currentFrame - 1) % cols) * r.width);
_local4.y = (Math.floor(((currentFrame - 1) / cols)) * r.height);
if (bitmapData){
bitmapData.dispose();
};
bitmapData = bigBitmap.copyPixelsOut(_local4);
bitmap.bitmapData = bitmapData;
bitmap.smoothing = true;
} else {
bitmap.bitmapData = frames[(currentFrame - 1)];
bitmap.smoothing = true;
};
};
}
public function buildCacheFromClip(_arg1:MovieClip):void{
var _local3:*;
var _local4:BitmapData;
var _local5:Matrix;
clip = _arg1;
if (clip["e_bounds"] != null){
_local3 = clip["e_bounds"];
r = new Rectangle(_local3.x, _local3.y, _local3.width, _local3.height);
clip["e_bounds"].visible = false;
} else {
r = clip.getRect(clip);
};
var _local2:* = 1;
while (_local2 <= clip.totalFrames) {
clip.gotoAndStop(_local2);
makeAllChildrenGoToFrame(clip, _local2);
_local4 = new BitmapData(r.width, r.height, true, 0);
_local5 = new Matrix();
_local5.translate(-(r.x), -(r.y));
_local5.scale(clip.scaleX, clip.scaleY);
_local4.draw(clip, _local5);
frames.push(_local4);
_local2++;
};
bitmap.x = r.x;
bitmap.y = r.y;
}
public function enterFrame(_arg1:Event=null):void{
if (reverse){
prevFrame(true);
} else {
nextFrame(true);
};
if (currentFrame >= totalFrames){
if (!repeat){
stop();
};
dispatchEvent(new Event(Event.COMPLETE));
if (onEnd != null){
onEnd();
};
};
}
public function get bitmapData():BitmapData{
return (bitmap.bitmapData);
}
public function prevFrame(_arg1:Boolean=false):void{
if (_arg1){
currentFrame = (currentFrame - speed);
} else {
currentFrame--;
};
if (currentFrame < 1){
currentFrame = totalFrames;
};
goto(Math.floor(currentFrame));
}
}
}//package com.touchmypixel.peepee.utils
Section 95
//AnimationCache (com.touchmypixel.peepee.utils.AnimationCache)
package com.touchmypixel.peepee.utils {
import flash.events.*;
import flash.utils.*;
import com.touchmypixel.events.*;
public class AnimationCache extends EventDispatcher {
public var currentlyProcessingItem:uint;// = 0
public var cacheQueue:Array;
private var animations:Object;
public var replaceExisting:Boolean;// = false
private static var instance:AnimationCache;
public function AnimationCache(){
cacheQueue = [];
animations = {};
super();
if (AnimationCache.instance){
throw (new Error("AnimationCache is a Singleton. Don't Instantiate!"));
};
instance = this;
}
public function cacheAnimation(_arg1:String, _arg2:Boolean=false):Animation{
var _local3:Animation;
if (((!(animations[_arg1])) || (replaceExisting))){
_local3 = new Animation();
_local3.useSpriteSheet = _arg2;
_local3.buildCacheFromLibrary(_arg1);
animations[_arg1] = _local3;
} else {
_local3 = animations[_arg1];
};
return (_local3);
}
private function process():void{
var _local1:* = cacheQueue[currentlyProcessingItem++];
if (_local1 != null){
cacheAnimation(_local1);
dispatchEvent(new ProcessEvent(ProcessEvent.PROGRESS, (currentlyProcessingItem / cacheQueue.length)));
setTimeout(process, 1);
} else {
dispatchEvent(new ProcessEvent(ProcessEvent.COMPLETE));
cacheQueue = [];
};
}
public function processQueue(){
currentlyProcessingItem = 0;
dispatchEvent(new ProcessEvent(ProcessEvent.START));
process();
}
public function getAnimation(_arg1):Animation{
var _local2:Animation;
if (!animations[_arg1]){
trace(("MISSING ANIMATION :" + _arg1));
return (null);
};
_local2 = new Animation();
_local2.frames = animations[_arg1].frames;
_local2.bigBitmap = animations[_arg1].bigBitmap;
_local2.bitmap.x = animations[_arg1].bitmap.x;
_local2.bitmap.y = animations[_arg1].bitmap.y;
_local2.cols = animations[_arg1].cols;
_local2.rows = animations[_arg1].rows;
_local2.r = animations[_arg1].r;
_local2.clip = animations[_arg1].clip;
_local2.useSpriteSheet = animations[_arg1].useSpriteSheet;
_local2.gotoAndStop(1);
return (_local2);
}
public function addToBulkCache(_arg1:Array){
var _local2:*;
for each (_local2 in _arg1) {
cacheQueue.push(_local2);
};
}
public static function getInstance():AnimationCache{
return ((instance) ? instance : new (AnimationCache));
}
}
}//package com.touchmypixel.peepee.utils
Section 96
//BaseScrollPane (fl.containers.BaseScrollPane)
package fl.containers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.events.*;
public class BaseScrollPane extends UIComponent {
protected var defaultLineScrollSize:Number;// = 4
protected var _maxHorizontalScrollPosition:Number;// = 0
protected var vScrollBar:Boolean;
protected var disabledOverlay:Shape;
protected var hScrollBar:Boolean;
protected var availableWidth:Number;
protected var _verticalPageScrollSize:Number;// = 0
protected var vOffset:Number;// = 0
protected var _verticalScrollBar:ScrollBar;
protected var useFixedHorizontalScrolling:Boolean;// = false
protected var contentWidth:Number;// = 0
protected var contentHeight:Number;// = 0
protected var _horizontalPageScrollSize:Number;// = 0
protected var background:DisplayObject;
protected var _useBitmpScrolling:Boolean;// = false
protected var contentPadding:Number;// = 0
protected var availableHeight:Number;
protected var _horizontalScrollBar:ScrollBar;
protected var contentScrollRect:Rectangle;
protected var _horizontalScrollPolicy:String;
protected var _verticalScrollPolicy:String;
protected static const SCROLL_BAR_STYLES:Object = {upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {repeatDelay:500, repeatInterval:35, skin:"ScrollPane_upSkin", contentPadding:0, disabledAlpha:0.5};
public function BaseScrollPane(){
contentWidth = 0;
contentHeight = 0;
contentPadding = 0;
vOffset = 0;
_maxHorizontalScrollPosition = 0;
_horizontalPageScrollSize = 0;
_verticalPageScrollSize = 0;
defaultLineScrollSize = 4;
useFixedHorizontalScrolling = false;
_useBitmpScrolling = false;
super();
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize));
setVerticalScrollPosition(_verticalScrollBar.scrollPosition);
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition));
}
public function get verticalScrollPosition():Number{
return (_verticalScrollBar.scrollPosition);
}
protected function drawDisabledOverlay():void{
if (enabled){
if (contains(disabledOverlay)){
removeChild(disabledOverlay);
};
} else {
disabledOverlay.x = (disabledOverlay.y = contentPadding);
disabledOverlay.width = availableWidth;
disabledOverlay.height = availableHeight;
disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number);
addChild(disabledOverlay);
};
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
_verticalScrollBar.scrollPosition = _arg1;
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
}
protected function setContentSize(_arg1:Number, _arg2:Number):void{
if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){
return;
};
contentWidth = _arg1;
contentHeight = _arg2;
invalidate(InvalidationType.SIZE);
}
public function get horizontalScrollPosition():Number{
return (_horizontalScrollBar.scrollPosition);
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
_verticalScrollBar.enabled = _arg1;
_horizontalScrollBar.enabled = _arg1;
super.enabled = _arg1;
}
public function get verticalLineScrollSize():Number{
return (_verticalScrollBar.lineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
protected function calculateAvailableSize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ScrollBar.WIDTH;
_local2 = (contentPadding = Number(getStyleValue("contentPadding")));
_local3 = ((height - (2 * _local2)) - vOffset);
vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3)))));
_local4 = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2));
_local5 = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4);
hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0)))));
if (hScrollBar){
_local3 = (_local3 - _local1);
};
if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){
vScrollBar = true;
_local4 = (_local4 - _local1);
};
availableHeight = (_local3 + vOffset);
availableWidth = _local4;
}
public function get maxVerticalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentHeight - availableHeight)));
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
_horizontalScrollBar.scrollPosition = _arg1;
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
}
public function get horizontalLineScrollSize():Number{
return (_horizontalScrollBar.lineScrollSize);
}
public function set verticalPageScrollSize(_arg1:Number):void{
_verticalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function get useBitmapScrolling():Boolean{
return (_useBitmpScrolling);
}
protected function handleScroll(_arg1:ScrollEvent):void{
if (_arg1.target == _verticalScrollBar){
setVerticalScrollPosition(_arg1.position);
} else {
setHorizontalScrollPosition(_arg1.position);
};
}
public function set verticalLineScrollSize(_arg1:Number):void{
_verticalScrollBar.lineScrollSize = _arg1;
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function set horizontalPageScrollSize(_arg1:Number):void{
_horizontalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){
drawLayout();
};
updateChildren();
super.draw();
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function configUI():void{
var _local1:Graphics;
super.configUI();
contentScrollRect = new Rectangle(0, 0, 85, 85);
_verticalScrollBar = new ScrollBar();
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_verticalScrollBar.visible = false;
_verticalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_verticalScrollBar);
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar = new ScrollBar();
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_horizontalScrollBar.visible = false;
_horizontalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_horizontalScrollBar);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
disabledOverlay = new Shape();
_local1 = disabledOverlay.graphics;
_local1.beginFill(0xFFFFFF);
_local1.drawRect(0, 0, width, height);
_local1.endFill();
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function calculateContentWidth():void{
}
public function get verticalPageScrollSize():Number{
if (isNaN(availableHeight)){
drawNow();
};
return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize);
}
protected function drawLayout():void{
calculateAvailableSize();
calculateContentWidth();
background.width = width;
background.height = height;
if (vScrollBar){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding);
_verticalScrollBar.y = contentPadding;
_verticalScrollBar.height = availableHeight;
} else {
_verticalScrollBar.visible = false;
};
_verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
if (hScrollBar){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.x = contentPadding;
_horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding);
_horizontalScrollBar.width = availableWidth;
} else {
_horizontalScrollBar.visible = false;
};
_horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
drawDisabledOverlay();
}
protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue("skin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function set horizontalLineScrollSize(_arg1:Number):void{
_horizontalScrollBar.lineScrollSize = _arg1;
}
public function get horizontalPageScrollSize():Number{
if (isNaN(availableWidth)){
drawNow();
};
return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize);
}
public function get maxHorizontalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentWidth - availableWidth)));
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function updateChildren():void{
_verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled);
_verticalScrollBar.drawNow();
_horizontalScrollBar.drawNow();
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set useBitmapScrolling(_arg1:Boolean):void{
_useBitmpScrolling = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.containers
Section 97
//CellRenderer (fl.controls.listClasses.CellRenderer)
package fl.controls.listClasses {
import fl.controls.*;
import flash.events.*;
public class CellRenderer extends LabelButton implements ICellRenderer {
protected var _data:Object;
protected var _listData:ListData;
private static var defaultStyles:Object = {upSkin:"CellRenderer_upSkin", downSkin:"CellRenderer_downSkin", overSkin:"CellRenderer_overSkin", disabledSkin:"CellRenderer_disabledSkin", selectedDisabledSkin:"CellRenderer_selectedDisabledSkin", selectedUpSkin:"CellRenderer_selectedUpSkin", selectedDownSkin:"CellRenderer_selectedDownSkin", selectedOverSkin:"CellRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public function CellRenderer():void{
toggle = true;
focusEnabled = false;
}
override protected function toggleSelected(_arg1:MouseEvent):void{
}
override public function get selected():Boolean{
return (super.selected);
}
public function set listData(_arg1:ListData):void{
_listData = _arg1;
label = _listData.label;
setStyle("icon", _listData.icon);
}
override public function set selected(_arg1:Boolean):void{
super.selected = _arg1;
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get listData():ListData{
return (_listData);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
super.setSize(_arg1, _arg2);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = 0;
if (icon != null){
icon.x = _local1;
icon.y = Math.round(((height - icon.height) >> 1));
_local2 = (icon.width + _local1);
};
if (label.length > 0){
textField.visible = true;
_local3 = Math.max(0, ((width - _local2) - (_local1 * 2)));
textField.width = _local3;
textField.height = (textField.textHeight + 4);
textField.x = (_local2 + _local1);
textField.y = Math.round(((height - textField.height) >> 1));
} else {
textField.visible = false;
};
background.width = width;
background.height = height;
}
public function get data():Object{
return (_data);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.listClasses
Section 98
//ICellRenderer (fl.controls.listClasses.ICellRenderer)
package fl.controls.listClasses {
public interface ICellRenderer {
function setSize(_arg1:Number, _arg2:Number):void;
function get listData():ListData;
function get data():Object;
function setMouseState(_arg1:String):void;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function set data(_arg1:Object):void;
function set selected(_arg1:Boolean):void;
function set listData(_arg1:ListData):void;
function get selected():Boolean;
}
}//package fl.controls.listClasses
Section 99
//ListData (fl.controls.listClasses.ListData)
package fl.controls.listClasses {
import fl.core.*;
public class ListData {
protected var _index:uint;
protected var _owner:UIComponent;
protected var _label:String;
protected var _icon:Object;// = null
protected var _row:uint;
protected var _column:uint;
public function ListData(_arg1:String, _arg2:Object, _arg3:UIComponent, _arg4:uint, _arg5:uint, _arg6:uint=0){
_icon = null;
super();
_label = _arg1;
_icon = _arg2;
_owner = _arg3;
_index = _arg4;
_row = _arg5;
_column = _arg6;
}
public function get owner():UIComponent{
return (_owner);
}
public function get label():String{
return (_label);
}
public function get row():uint{
return (_row);
}
public function get index():uint{
return (_index);
}
public function get icon():Object{
return (_icon);
}
public function get column():uint{
return (_column);
}
}
}//package fl.controls.listClasses
Section 100
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 101
//Button (fl.controls.Button)
package fl.controls {
import fl.core.*;
import flash.display.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 102
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 103
//ComboBox (fl.controls.ComboBox)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.data.*;
import fl.managers.*;
import flash.geom.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class ComboBox extends UIComponent implements IFocusManagerComponent {
protected var _dropdownWidth:Number;
protected var highlightedCell:int;// = -1
protected var _prompt:String;
protected var isOpen:Boolean;// = false
protected var list:List;
protected var _rowCount:uint;// = 5
protected var currentIndex:int;
protected var isKeyDown:Boolean;// = false
protected var _labels:Array;
protected var background:BaseButton;
protected var inputField:TextInput;
protected var listOverIndex:uint;
protected var editableValue:String;
protected var _editable:Boolean;// = false
private var collectionItemImport:SimpleCollectionItem;
protected static const BACKGROUND_STYLES:Object = {overSkin:"overSkin", downSkin:"downSkin", upSkin:"upSkin", disabledSkin:"disabledSkin", repeatInterval:"repeatInterval"};
protected static const LIST_STYLES:Object = {upSkin:"comboListUpSkin", overSkin:"comboListOverSkin", downSkin:"comobListDownSkin", disabledSkin:"comboListDisabledSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval", textFormat:"textFormat", disabledAlpha:"disabledAlpha", skin:"listSkin"};
private static var defaultStyles:Object = {upSkin:"ComboBox_upSkin", downSkin:"ComboBox_downSkin", overSkin:"ComboBox_overSkin", disabledSkin:"ComboBox_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, buttonWidth:24, disabledAlpha:null, listSkin:null};
public static var createAccessibilityImplementation:Function;
public function ComboBox(){
_rowCount = 5;
_editable = false;
isOpen = false;
highlightedCell = -1;
isKeyDown = false;
super();
}
protected function drawList():void{
list.rowCount = Math.max(0, Math.min(_rowCount, list.dataProvider.length));
}
public function set imeMode(_arg1:String):void{
inputField.imeMode = _arg1;
}
public function get dropdown():List{
return (list);
}
public function get dropdownWidth():Number{
return (list.width);
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (list.sortItemsOn(_arg1, _arg2));
}
protected function onEnter(_arg1:ComponentEvent):void{
_arg1.stopPropagation();
}
public function removeItemAt(_arg1:uint):void{
list.removeItemAt(_arg1);
invalidate(InvalidationType.DATA);
}
public function open():void{
currentIndex = selectedIndex;
if (((isOpen) || ((length == 0)))){
return;
};
dispatchEvent(new Event(Event.OPEN));
isOpen = true;
addEventListener(Event.ENTER_FRAME, addCloseListener, false, 0, true);
positionList();
list.scrollToSelected();
stage.addChild(list);
}
public function get selectedItem():Object{
return (list.selectedItem);
}
public function set text(_arg1:String):void{
if (!editable){
return;
};
inputField.text = _arg1;
}
public function get labelField():String{
return (list.labelField);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:uint;
var _local4:Number;
var _local5:int;
isKeyDown = true;
if (_arg1.ctrlKey){
switch (_arg1.keyCode){
case Keyboard.UP:
if (highlightedCell > -1){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
break;
case Keyboard.DOWN:
open();
break;
};
return;
};
_arg1.stopPropagation();
_local2 = Math.max(((calculateAvailableHeight() / list.rowHeight) << 0), 1);
_local3 = selectedIndex;
_local4 = ((highlightedCell)==-1) ? selectedIndex : highlightedCell;
_local5 = -1;
switch (_arg1.keyCode){
case Keyboard.SPACE:
if (isOpen){
close();
} else {
open();
};
return;
case Keyboard.ESCAPE:
if (isOpen){
if (highlightedCell > -1){
selectedIndex = selectedIndex;
};
close();
};
return;
case Keyboard.UP:
_local5 = Math.max(0, (_local4 - 1));
break;
case Keyboard.DOWN:
_local5 = Math.min((length - 1), (_local4 + 1));
break;
case Keyboard.PAGE_UP:
_local5 = Math.max((_local4 - _local2), 0);
break;
case Keyboard.PAGE_DOWN:
_local5 = Math.min((_local4 + _local2), (length - 1));
break;
case Keyboard.HOME:
_local5 = 0;
break;
case Keyboard.END:
_local5 = (length - 1);
break;
case Keyboard.ENTER:
if (((_editable) && ((highlightedCell == -1)))){
editableValue = inputField.text;
selectedIndex = -1;
} else {
if (((isOpen) && ((highlightedCell > -1)))){
editableValue = null;
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
};
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER));
close();
return;
default:
if (editable){
break;
};
_local5 = list.getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), _local4);
break;
};
if (_local5 > -1){
if (isOpen){
highlightCell(_local5);
inputField.text = list.itemToLabel(getItemAt(_local5));
} else {
highlightCell();
selectedIndex = _local5;
dispatchEvent(new Event(Event.CHANGE));
};
};
}
public function set dropdownWidth(_arg1:Number):void{
_dropdownWidth = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
super.focusInHandler(_arg1);
if (editable){
stage.focus = inputField.textField;
};
}
protected function onStageClick(_arg1:MouseEvent):void{
if (!isOpen){
return;
};
if (((!(contains((_arg1.target as DisplayObject)))) && (!(list.contains((_arg1.target as DisplayObject)))))){
if (highlightedCell != -1){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
};
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
invalidate(InvalidationType.DATA);
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
isKeyDown = false;
}
protected function onListItemUp(_arg1:MouseEvent):void{
var _local2:*;
stage.removeEventListener(MouseEvent.MOUSE_UP, onListItemUp);
if (((!((_arg1.target is ICellRenderer))) || (!(list.contains((_arg1.target as DisplayObject)))))){
return;
};
editableValue = null;
_local2 = selectedIndex;
selectedIndex = _arg1.target.listData.index;
if (_local2 != selectedIndex){
dispatchEvent(new Event(Event.CHANGE));
};
close();
}
public function removeAll():void{
list.removeAll();
inputField.text = "";
invalidate(InvalidationType.DATA);
}
public function set selectedItem(_arg1:Object):void{
list.selectedItem = _arg1;
invalidate(InvalidationType.SELECTED);
}
protected function highlightCell(_arg1:int=-1):void{
var _local2:ICellRenderer;
if (highlightedCell > -1){
_local2 = list.itemToCellRenderer(getItemAt(highlightedCell));
if (_local2 != null){
_local2.setMouseState("up");
};
};
if (_arg1 == -1){
return;
};
list.scrollToIndex(_arg1);
list.drawNow();
_local2 = list.itemToCellRenderer(getItemAt(_arg1));
if (_local2 != null){
_local2.setMouseState("over");
highlightedCell = _arg1;
};
}
public function itemToLabel(_arg1:Object):String{
if (_arg1 == null){
return ("");
};
return (list.itemToLabel(_arg1));
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
list.addItemAt(_arg1, _arg2);
invalidate(InvalidationType.DATA);
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (list.replaceItemAt(_arg1, _arg2));
}
protected function showPrompt():void{
inputField.text = _prompt;
}
public function set rowCount(_arg1:uint):void{
_rowCount = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get restrict():String{
return (inputField.restrict);
}
protected function setEmbedFonts():void{
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
inputField.textField.embedFonts = _local1;
};
}
public function sortItems(... _args){
return (list.sortItems.apply(list, _args));
}
public function set labelField(_arg1:String):void{
list.labelField = _arg1;
invalidate(InvalidationType.DATA);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
drawTextField();
}
public function set prompt(_arg1:String):void{
if (_arg1 == ""){
_prompt = null;
} else {
_prompt = _arg1;
};
invalidate(InvalidationType.STATE);
}
public function get length():int{
return (list.length);
}
protected function drawTextField():void{
inputField.setStyle("upSkin", "");
inputField.setStyle("disabledSkin", "");
inputField.enabled = enabled;
inputField.editable = _editable;
inputField.textField.selectable = ((enabled) && (_editable));
inputField.mouseEnabled = (inputField.mouseChildren = ((enabled) && (_editable)));
inputField.focusEnabled = false;
if (_editable){
inputField.addEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus, false, 0, true);
inputField.addEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut, false, 0, true);
} else {
inputField.removeEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus);
inputField.removeEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut);
};
}
protected function onInputFieldFocusOut(_arg1:FocusEvent):void{
inputField.removeEventListener(ComponentEvent.ENTER, onEnter);
selectedIndex = selectedIndex;
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
public function get imeMode():String{
return (inputField.imeMode);
}
public function get labelFunction():Function{
return (list.labelFunction);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return ((list.height - (_local1 * 2)));
}
public function get selectedIndex():int{
return (list.selectedIndex);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
isKeyDown = false;
if (isOpen){
if (((!(_arg1.relatedObject)) || (!(list.contains(_arg1.relatedObject))))){
if (((!((highlightedCell == -1))) && (!((highlightedCell == selectedIndex))))){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
};
};
super.focusOutHandler(_arg1);
}
public function get selectedLabel():String{
if (editableValue != null){
return (editableValue);
};
if (selectedIndex == -1){
return (null);
};
return (itemToLabel(selectedItem));
}
public function get text():String{
return (inputField.text);
}
protected function onListChange(_arg1:Event):void{
editableValue = null;
dispatchEvent(_arg1);
invalidate(InvalidationType.SELECTED);
if (isKeyDown){
return;
};
close();
}
protected function onToggleListVisibility(_arg1:MouseEvent):void{
_arg1.stopPropagation();
dispatchEvent(_arg1);
if (isOpen){
close();
} else {
open();
stage.addEventListener(MouseEvent.MOUSE_UP, onListItemUp, false, 0, true);
};
}
override protected function draw():void{
var _local1:*;
_local1 = selectedIndex;
if ((((_local1 == -1)) && (((((!((prompt == null))) || (editable))) || ((length == 0)))))){
_local1 = Math.max(-1, Math.min(_local1, (length - 1)));
} else {
editableValue = null;
_local1 = Math.max(0, Math.min(_local1, (length - 1)));
};
if (list.selectedIndex != _local1){
list.selectedIndex = _local1;
invalidate(InvalidationType.SELECTED, false);
};
if (isInvalid(InvalidationType.STYLES)){
setStyles();
setEmbedFonts();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.STATE)){
drawTextFormat();
drawLayout();
invalidate(InvalidationType.DATA);
};
if (isInvalid(InvalidationType.DATA)){
drawList();
invalidate(InvalidationType.SELECTED, true);
};
if (isInvalid(InvalidationType.SELECTED)){
if ((((_local1 == -1)) && (!((editableValue == null))))){
inputField.text = editableValue;
} else {
if (_local1 > -1){
if (length > 0){
inputField.horizontalScrollPosition = 0;
inputField.text = itemToLabel(list.selectedItem);
};
} else {
if ((((_local1 == -1)) && (!((_prompt == null))))){
showPrompt();
} else {
inputField.text = "";
};
};
};
if (((((editable) && ((selectedIndex > -1)))) && ((stage.focus == inputField.textField)))){
inputField.setSelection(0, inputField.length);
};
};
drawTextField();
super.draw();
}
public function addItem(_arg1:Object):void{
list.addItem(_arg1);
invalidate(InvalidationType.DATA);
}
public function get rowCount():uint{
return (_rowCount);
}
override protected function configUI():void{
super.configUI();
background = new BaseButton();
background.focusEnabled = false;
copyStylesToChild(background, BACKGROUND_STYLES);
background.addEventListener(MouseEvent.MOUSE_DOWN, onToggleListVisibility, false, 0, true);
addChild(background);
inputField = new TextInput();
inputField.focusTarget = (this as IFocusManagerComponent);
inputField.focusEnabled = false;
inputField.addEventListener(Event.CHANGE, onTextInput, false, 0, true);
addChild(inputField);
list = new List();
list.focusEnabled = false;
copyStylesToChild(list, LIST_STYLES);
list.addEventListener(Event.CHANGE, onListChange, false, 0, true);
list.addEventListener(ListEvent.ITEM_CLICK, onListChange, false, 0, true);
list.addEventListener(ListEvent.ITEM_ROLL_OUT, passEvent, false, 0, true);
list.addEventListener(ListEvent.ITEM_ROLL_OVER, passEvent, false, 0, true);
list.verticalScrollBar.addEventListener(Event.SCROLL, passEvent, false, 0, true);
}
protected function positionList():void{
var _local1:Point;
_local1 = localToGlobal(new Point(0, 0));
list.x = _local1.x;
if (((_local1.y + height) + list.height) > stage.stageHeight){
list.y = (_local1.y - list.height);
} else {
list.y = (_local1.y + height);
};
}
public function get value():String{
var _local1:Object;
if (editableValue != null){
return (editableValue);
};
_local1 = selectedItem;
if (((!(_editable)) && (!((_local1.data == null))))){
return (_local1.data);
};
return (itemToLabel(_local1));
}
public function get prompt():String{
return (_prompt);
}
public function set dataProvider(_arg1:DataProvider):void{
_arg1.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
list.dataProvider = _arg1;
invalidate(InvalidationType.DATA);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
if (!_editable){
return;
};
inputField.restrict = _arg1;
}
protected function onTextInput(_arg1:Event):void{
_arg1.stopPropagation();
if (!_editable){
return;
};
editableValue = inputField.text;
selectedIndex = -1;
dispatchEvent(new Event(Event.CHANGE));
}
protected function onInputFieldFocus(_arg1:FocusEvent):void{
inputField.addEventListener(ComponentEvent.ENTER, onEnter, false, 0, true);
close();
}
public function getItemAt(_arg1:uint):Object{
return (list.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (ComboBox.createAccessibilityImplementation != null){
ComboBox.createAccessibilityImplementation(this);
};
}
protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
_local1 = (getStyleValue("buttonWidth") as Number);
_local2 = (getStyleValue("textPadding") as Number);
background.setSize(width, height);
inputField.x = (inputField.y = _local2);
inputField.setSize(((width - _local1) - _local2), (height - _local2));
list.width = (isNaN(_dropdownWidth)) ? width : _dropdownWidth;
background.enabled = enabled;
background.drawNow();
}
public function removeItem(_arg1:Object):Object{
return (list.removeItem(_arg1));
}
private function addCloseListener(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, addCloseListener);
if (!isOpen){
return;
};
stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageClick, false, 0, true);
}
public function get dataProvider():DataProvider{
return (list.dataProvider);
}
public function get textField():TextInput{
return (inputField);
}
protected function setStyles():void{
copyStylesToChild(background, BACKGROUND_STYLES);
copyStylesToChild(list, LIST_STYLES);
}
public function set labelFunction(_arg1:Function):void{
list.labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
protected function drawTextFormat():void{
var _local1:TextFormat;
_local1 = (getStyleValue((_enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local1 == null){
_local1 = new TextFormat();
};
inputField.textField.defaultTextFormat = _local1;
inputField.textField.setTextFormat(_local1);
setEmbedFonts();
}
public function set selectedIndex(_arg1:int):void{
list.selectedIndex = _arg1;
highlightCell();
invalidate(InvalidationType.SELECTED);
}
public function close():void{
highlightCell();
highlightedCell = -1;
if (!isOpen){
return;
};
dispatchEvent(new Event(Event.CLOSE));
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageClick);
isOpen = false;
stage.removeChild(list);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, List.getStyleDefinition()));
}
}
}//package fl.controls
Section 104
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 105
//List (fl.controls.List)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.geom.*;
import flash.utils.*;
import flash.ui.*;
public class List extends SelectableList implements IFocusManagerComponent {
protected var _labelField:String;// = "label"
protected var _rowHeight:Number;// = 20
protected var _cellRenderer:Object;
protected var _iconField:String;// = "icon"
protected var _labelFunction:Function;
protected var _iconFunction:Function;
private static var defaultStyles:Object = {focusRectSkin:null, focusRectPadding:null};
public static var createAccessibilityImplementation:Function;
public function List(){
_rowHeight = 20;
_labelField = "label";
_iconField = "icon";
super();
}
public function get iconField():String{
return (_iconField);
}
protected function doKeySelection(_arg1:int, _arg2:Boolean, _arg3:Boolean):void{
var _local4:Boolean;
var _local5:int;
var _local6:Array;
var _local7:int;
var _local8:int;
_local4 = false;
if (_arg2){
_local6 = [];
_local7 = lastCaretIndex;
_local8 = _arg1;
if (_local7 == -1){
_local7 = ((caretIndex)!=-1) ? caretIndex : _arg1;
};
if (_local7 > _local8){
_local8 = _local7;
_local7 = _arg1;
};
_local5 = _local7;
while (_local5 <= _local8) {
_local6.push(_local5);
_local5++;
};
selectedIndices = _local6;
caretIndex = _arg1;
_local4 = true;
} else {
selectedIndex = _arg1;
caretIndex = (lastCaretIndex = _arg1);
_local4 = true;
};
if (_local4){
dispatchEvent(new Event(Event.CHANGE));
};
invalidate(InvalidationType.DATA);
}
override protected function drawList():void{
var _local1:Rectangle;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:ICellRenderer;
var _local7:Dictionary;
var _local8:Dictionary;
var _local9:Boolean;
var _local10:String;
var _local11:Object;
var _local12:Sprite;
var _local13:String;
listHolder.x = (listHolder.y = contentPadding);
_local1 = listHolder.scrollRect;
_local1.x = _horizontalScrollPosition;
_local1.y = (Math.floor(_verticalScrollPosition) % rowHeight);
listHolder.scrollRect = _local1;
listHolder.cacheAsBitmap = useBitmapScrolling;
_local2 = Math.floor((_verticalScrollPosition / rowHeight));
_local3 = Math.min(length, ((_local2 + rowCount) + 1));
_local7 = (renderedItems = new Dictionary(true));
_local4 = _local2;
while (_local4 < _local3) {
_local7[_dataProvider.getItemAt(_local4)] = true;
_local4++;
};
_local8 = new Dictionary(true);
while (activeCellRenderers.length > 0) {
_local6 = (activeCellRenderers.pop() as ICellRenderer);
_local5 = _local6.data;
if ((((_local7[_local5] == null)) || ((invalidItems[_local5] == true)))){
availableCellRenderers.push(_local6);
} else {
_local8[_local5] = _local6;
invalidItems[_local5] = true;
};
list.removeChild((_local6 as DisplayObject));
};
invalidItems = new Dictionary(true);
_local4 = _local2;
while (_local4 < _local3) {
_local9 = false;
_local5 = _dataProvider.getItemAt(_local4);
if (_local8[_local5] != null){
_local9 = true;
_local6 = _local8[_local5];
delete _local8[_local5];
} else {
if (availableCellRenderers.length > 0){
_local6 = (availableCellRenderers.pop() as ICellRenderer);
} else {
_local6 = (getDisplayObjectInstance(getStyleValue("cellRenderer")) as ICellRenderer);
_local12 = (_local6 as Sprite);
if (_local12 != null){
_local12.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true);
_local12.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true);
_local12.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true);
_local12.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true);
_local12.doubleClickEnabled = true;
_local12.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true);
if (_local12["setStyle"] != null){
for (_local13 in rendererStyles) {
var _local16 = _local12;
_local16["setStyle"](_local13, rendererStyles[_local13]);
};
};
};
};
};
list.addChild((_local6 as Sprite));
activeCellRenderers.push(_local6);
_local6.y = (rowHeight * (_local4 - _local2));
_local6.setSize((availableWidth + _maxHorizontalScrollPosition), rowHeight);
_local10 = itemToLabel(_local5);
_local11 = null;
if (_iconFunction != null){
_local11 = _iconFunction(_local5);
} else {
if (_iconField != null){
_local11 = _local5[_iconField];
};
};
if (!_local9){
_local6.data = _local5;
};
_local6.listData = new ListData(_local10, _local11, this, _local4, _local4, 0);
_local6.selected = !((_selectedIndices.indexOf(_local4) == -1));
if ((_local6 is UIComponent)){
(_local6 as UIComponent).drawNow();
};
_local4++;
};
}
public function get iconFunction():Function{
return (_iconFunction);
}
public function set iconField(_arg1:String):void{
if (_arg1 == _iconField){
return;
};
_iconField = _arg1;
invalidate(InvalidationType.DATA);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.SPACE:
if (caretIndex == -1){
caretIndex = 0;
};
doKeySelection(caretIndex, _arg1.shiftKey, _arg1.ctrlKey);
scrollToSelected();
break;
default:
_local2 = getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), selectedIndex);
if (_local2 > -1){
selectedIndex = _local2;
scrollToSelected();
};
break;
};
_arg1.stopPropagation();
}
override public function itemToLabel(_arg1:Object):String{
if (_labelFunction != null){
return (String(_labelFunction(_arg1)));
};
return (((_arg1[_labelField])!=null) ? String(_arg1[_labelField]) : "");
}
public function get labelField():String{
return (_labelField);
}
override protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
var _local4:int;
var _local5:int;
var _local6:int;
_local4 = Math.max(Math.floor((calculateAvailableHeight() / rowHeight)), 1);
_local5 = -1;
_local6 = 0;
switch (_arg1){
case Keyboard.UP:
if (caretIndex > 0){
_local5 = (caretIndex - 1);
};
break;
case Keyboard.DOWN:
if (caretIndex < (length - 1)){
_local5 = (caretIndex + 1);
};
break;
case Keyboard.PAGE_UP:
if (caretIndex > 0){
_local5 = Math.max((caretIndex - _local4), 0);
};
break;
case Keyboard.PAGE_DOWN:
if (caretIndex < (length - 1)){
_local5 = Math.min((caretIndex + _local4), (length - 1));
};
break;
case Keyboard.HOME:
if (caretIndex > 0){
_local5 = 0;
};
break;
case Keyboard.END:
if (caretIndex < (length - 1)){
_local5 = (length - 1);
};
break;
};
if (_local5 >= 0){
doKeySelection(_local5, _arg2, _arg3);
scrollToSelected();
};
}
public function set labelField(_arg1:String):void{
if (_arg1 == _labelField){
return;
};
_labelField = _arg1;
invalidate(InvalidationType.DATA);
}
public function set rowCount(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
_local2 = Number(getStyleValue("contentPadding"));
_local3 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0;
height = (((rowHeight * _arg1) + (2 * _local2)) + _local3);
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
list.x = -(_arg1);
super.setHorizontalScrollPosition(_arg1, true);
}
public function set iconFunction(_arg1:Function):void{
if (_iconFunction == _arg1){
return;
};
_iconFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function get labelFunction():Function{
return (_labelFunction);
}
override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
invalidate(InvalidationType.SCROLL);
super.setVerticalScrollPosition(_arg1, true);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0));
}
override protected function draw():void{
var _local1:Boolean;
_local1 = !((contentHeight == (rowHeight * length)));
contentHeight = (rowHeight * length);
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
if (_cellRenderer != getStyleValue("cellRenderer")){
_invalidateList();
_cellRenderer = getStyleValue("cellRenderer");
};
};
if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){
drawLayout();
};
if (isInvalid(InvalidationType.RENDERER_STYLES)){
updateRendererStyles();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){
drawList();
};
updateChildren();
validate();
}
override protected function configUI():void{
useFixedHorizontalScrolling = true;
_horizontalScrollPolicy = ScrollPolicy.AUTO;
_verticalScrollPolicy = ScrollPolicy.AUTO;
super.configUI();
}
override public function get rowCount():uint{
return (Math.ceil((calculateAvailableHeight() / rowHeight)));
}
override protected function initializeAccessibility():void{
if (List.createAccessibilityImplementation != null){
List.createAccessibilityImplementation(this);
};
}
override public function scrollToIndex(_arg1:int):void{
var _local2:uint;
var _local3:uint;
drawNow();
_local2 = (Math.floor(((_verticalScrollPosition + availableHeight) / rowHeight)) - 1);
_local3 = Math.ceil((_verticalScrollPosition / rowHeight));
if (_arg1 < _local3){
verticalScrollPosition = (_arg1 * rowHeight);
} else {
if (_arg1 > _local2){
verticalScrollPosition = (((_arg1 + 1) * rowHeight) - availableHeight);
};
};
}
public function get rowHeight():Number{
return (_rowHeight);
}
public function set labelFunction(_arg1:Function):void{
if (_labelFunction == _arg1){
return;
};
_labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function set rowHeight(_arg1:Number):void{
_rowHeight = _arg1;
invalidate(InvalidationType.SIZE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition()));
}
}
}//package fl.controls
Section 106
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 107
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 108
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const OFF:String = "off";
public static const ON:String = "on";
public static const AUTO:String = "auto";
}
}//package fl.controls
Section 109
//SelectableList (fl.controls.SelectableList)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
import fl.containers.*;
import flash.ui.*;
public class SelectableList extends BaseScrollPane implements IFocusManagerComponent {
protected var invalidItems:Dictionary;
protected var renderedItems:Dictionary;
protected var listHolder:Sprite;
protected var _allowMultipleSelection:Boolean;// = false
protected var lastCaretIndex:int;// = -1
protected var _selectedIndices:Array;
protected var availableCellRenderers:Array;
protected var list:Sprite;
protected var caretIndex:int;// = -1
protected var updatedRendererStyles:Object;
protected var preChangeItems:Array;
protected var activeCellRenderers:Array;
protected var rendererStyles:Object;
protected var _verticalScrollPosition:Number;
protected var _dataProvider:DataProvider;
protected var _horizontalScrollPosition:Number;
private var collectionItemImport:SimpleCollectionItem;
protected var _selectable:Boolean;// = true
private static var defaultStyles:Object = {skin:"List_skin", cellRenderer:CellRenderer, contentPadding:null, disabledAlpha:null};
public static var createAccessibilityImplementation:Function;
public function SelectableList(){
_allowMultipleSelection = false;
_selectable = true;
caretIndex = -1;
lastCaretIndex = -1;
super();
activeCellRenderers = [];
availableCellRenderers = [];
invalidItems = new Dictionary(true);
renderedItems = new Dictionary(true);
_selectedIndices = [];
if (dataProvider == null){
dataProvider = new DataProvider();
};
verticalScrollPolicy = ScrollPolicy.AUTO;
rendererStyles = {};
updatedRendererStyles = {};
}
protected function drawList():void{
}
public function set allowMultipleSelection(_arg1:Boolean):void{
if (_arg1 == _allowMultipleSelection){
return;
};
_allowMultipleSelection = _arg1;
if (((!(_arg1)) && ((_selectedIndices.length > 1)))){
_selectedIndices = [_selectedIndices.pop()];
invalidate(InvalidationType.DATA);
};
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (_dataProvider.sortOn(_arg1, _arg2));
}
public function removeItemAt(_arg1:uint):Object{
return (_dataProvider.removeItemAt(_arg1));
}
public function get selectedItem():Object{
return (((_selectedIndices.length)==0) ? null : _dataProvider.getItemAt(selectedIndex));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
};
}
public function get selectable():Boolean{
return (_selectable);
}
public function itemToCellRenderer(_arg1:Object):ICellRenderer{
var _local2:*;
var _local3:ICellRenderer;
if (_arg1 != null){
for (_local2 in activeCellRenderers) {
_local3 = (activeCellRenderers[_local2] as ICellRenderer);
if (_local3.data == _arg1){
return (_local3);
};
};
};
return (null);
}
public function getNextIndexAtLetter(_arg1:String, _arg2:int=-1):int{
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:String;
if (length == 0){
return (-1);
};
_arg1 = _arg1.toUpperCase();
_local3 = (length - 1);
_local4 = 0;
while (_local4 < _local3) {
_local5 = ((_arg2 + 1) + _local4);
if (_local5 > (length - 1)){
_local5 = (_local5 - length);
};
_local6 = getItemAt(_local5);
if (_local6 == null){
break;
};
_local7 = itemToLabel(_local6);
if (_local7 == null){
} else {
if (_local7.charAt(0).toUpperCase() == _arg1){
return (_local5);
};
};
_local4++;
};
return (-1);
}
public function invalidateList():void{
_invalidateList();
invalidate(InvalidationType.DATA);
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
list.mouseChildren = _enabled;
}
public function get selectedIndices():Array{
return (_selectedIndices.concat());
}
public function set selectable(_arg1:Boolean):void{
if (_arg1 == _selectable){
return;
};
if (!_arg1){
selectedIndices = [];
};
_selectable = _arg1;
}
public function itemToLabel(_arg1:Object):String{
return (_arg1["label"]);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
_dataProvider.addItemAt(_arg1, _arg2);
invalidateList();
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (_dataProvider.replaceItemAt(_arg1, _arg2));
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:uint;
_local2 = _arg1.startIndex;
_local3 = _arg1.endIndex;
_local4 = _arg1.changeType;
if (_local4 == DataChangeType.INVALIDATE_ALL){
clearSelection();
invalidateList();
} else {
if (_local4 == DataChangeType.INVALIDATE){
_local5 = 0;
while (_local5 < _arg1.items.length) {
invalidateItem(_arg1.items[_local5]);
_local5++;
};
} else {
if (_local4 == DataChangeType.ADD){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
_selectedIndices[_local5] = (_selectedIndices[_local5] + (_local2 - _local3));
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
if (_selectedIndices[_local5] <= _local3){
delete _selectedIndices[_local5];
} else {
_selectedIndices[_local5] = (_selectedIndices[_local5] - ((_local2 - _local3) + 1));
};
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE_ALL){
clearSelection();
} else {
if (_local4 == DataChangeType.REPLACE){
} else {
selectedItems = preChangeItems;
preChangeItems = null;
};
};
};
};
};
};
invalidate(InvalidationType.DATA);
}
protected function _invalidateList():void{
availableCellRenderers = [];
while (activeCellRenderers.length > 0) {
list.removeChild((activeCellRenderers.pop() as DisplayObject));
};
}
protected function updateRendererStyles():void{
var _local1:Array;
var _local2:uint;
var _local3:uint;
var _local4:String;
_local1 = availableCellRenderers.concat(activeCellRenderers);
_local2 = _local1.length;
_local3 = 0;
while (_local3 < _local2) {
if (_local1[_local3].setStyle == null){
} else {
for (_local4 in updatedRendererStyles) {
_local1[_local3].setStyle(_local4, updatedRendererStyles[_local4]);
};
_local1[_local3].drawNow();
};
_local3++;
};
updatedRendererStyles = {};
}
public function set selectedItem(_arg1:Object):void{
var _local2:int;
_local2 = _dataProvider.getItemIndex(_arg1);
selectedIndex = _local2;
}
public function sortItems(... _args){
return (_dataProvider.sort.apply(_dataProvider, _args));
}
public function removeAll():void{
_dataProvider.removeAll();
}
protected function handleCellRendererChange(_arg1:Event):void{
var _local2:ICellRenderer;
var _local3:uint;
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
_dataProvider.invalidateItemAt(_local3);
}
protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _horizontalScrollPosition){
return;
};
_local3 = (_arg1 - _horizontalScrollPosition);
_horizontalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.HORIZONTAL, _local3, _arg1));
};
}
public function scrollToSelected():void{
scrollToIndex(selectedIndex);
}
public function invalidateItem(_arg1:Object):void{
if (renderedItems[_arg1] == null){
return;
};
invalidItems[_arg1] = true;
invalidate(InvalidationType.DATA);
}
protected function handleCellRendererClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
var _local4:int;
var _local5:int;
var _local6:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
if (((!(dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)))) || (!(_selectable)))){
return;
};
_local4 = selectedIndices.indexOf(_local3);
if (!_allowMultipleSelection){
if (_local4 != -1){
return;
};
_local2.selected = true;
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
} else {
if (_arg1.shiftKey){
_local6 = ((_selectedIndices.length)>0) ? _selectedIndices[0] : _local3;
_selectedIndices = [];
if (_local6 > _local3){
_local5 = _local6;
while (_local5 >= _local3) {
_selectedIndices.push(_local5);
_local5--;
};
} else {
_local5 = _local6;
while (_local5 <= _local3) {
_selectedIndices.push(_local5);
_local5++;
};
};
caretIndex = _local3;
} else {
if (_arg1.ctrlKey){
if (_local4 != -1){
_local2.selected = false;
_selectedIndices.splice(_local4, 1);
} else {
_local2.selected = true;
_selectedIndices.push(_local3);
};
caretIndex = _local3;
} else {
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
};
};
};
dispatchEvent(new Event(Event.CHANGE));
invalidate(InvalidationType.DATA);
}
public function get length():uint{
return (_dataProvider.length);
}
public function get allowMultipleSelection():Boolean{
return (_allowMultipleSelection);
}
protected function onPreChange(_arg1:DataChangeEvent):void{
switch (_arg1.changeType){
case DataChangeType.REMOVE:
case DataChangeType.ADD:
case DataChangeType.INVALIDATE:
case DataChangeType.REMOVE_ALL:
case DataChangeType.REPLACE:
case DataChangeType.INVALIDATE_ALL:
break;
default:
preChangeItems = selectedItems;
break;
};
}
public function getRendererStyle(_arg1:String, _arg2:int=-1):Object{
return (rendererStyles[_arg1]);
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _verticalScrollPosition){
return;
};
_local3 = (_arg1 - _verticalScrollPosition);
_verticalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _local3, _arg1));
};
}
protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
public function set selectedIndices(_arg1:Array):void{
if (!_selectable){
return;
};
_selectedIndices = ((_arg1)==null) ? [] : _arg1.concat();
invalidate(InvalidationType.SELECTED);
}
public function get selectedIndex():int{
return (((_selectedIndices.length)==0) ? -1 : _selectedIndices[(_selectedIndices.length - 1)]);
}
override protected function draw():void{
super.draw();
}
override protected function configUI():void{
super.configUI();
listHolder = new Sprite();
addChild(listHolder);
listHolder.scrollRect = contentScrollRect;
list = new Sprite();
listHolder.addChild(list);
}
public function addItem(_arg1:Object):void{
_dataProvider.addItem(_arg1);
invalidateList();
}
protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:String;
_local2 = (_arg1.target as ICellRenderer);
_local3 = ((_arg1.type)==MouseEvent.ROLL_OVER) ? ListEvent.ITEM_ROLL_OVER : ListEvent.ITEM_ROLL_OUT;
dispatchEvent(new ListEvent(_local3, false, false, _local2.listData.column, _local2.listData.row, _local2.listData.index, _local2.data));
}
public function clearRendererStyle(_arg1:String, _arg2:int=-1):void{
delete rendererStyles[_arg1];
updatedRendererStyles[_arg1] = null;
invalidate(InvalidationType.RENDERER_STYLES);
}
protected function handleCellRendererDoubleClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
dispatchEvent(new ListEvent(ListEvent.ITEM_DOUBLE_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data));
}
public function get rowCount():uint{
return (0);
}
public function isItemSelected(_arg1:Object):Boolean{
return ((selectedItems.indexOf(_arg1) > -1));
}
public function set dataProvider(_arg1:DataProvider):void{
if (_dataProvider != null){
_dataProvider.removeEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange);
_dataProvider.removeEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange);
};
_dataProvider = _arg1;
_dataProvider.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
_dataProvider.addEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange, false, 0, true);
clearSelection();
invalidateList();
}
override protected function drawLayout():void{
super.drawLayout();
contentScrollRect = listHolder.scrollRect;
contentScrollRect.width = availableWidth;
contentScrollRect.height = availableHeight;
listHolder.scrollRect = contentScrollRect;
}
public function getItemAt(_arg1:uint):Object{
return (_dataProvider.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (SelectableList.createAccessibilityImplementation != null){
SelectableList.createAccessibilityImplementation(this);
};
}
public function scrollToIndex(_arg1:int):void{
}
public function removeItem(_arg1:Object):Object{
return (_dataProvider.removeItem(_arg1));
}
public function get dataProvider():DataProvider{
return (_dataProvider);
}
public function set maxHorizontalScrollPosition(_arg1:Number):void{
_maxHorizontalScrollPosition = _arg1;
invalidate(InvalidationType.SIZE);
}
public function setRendererStyle(_arg1:String, _arg2:Object, _arg3:uint=0):void{
if (rendererStyles[_arg1] == _arg2){
return;
};
updatedRendererStyles[_arg1] = _arg2;
rendererStyles[_arg1] = _arg2;
invalidate(InvalidationType.RENDERER_STYLES);
}
public function invalidateItemAt(_arg1:uint):void{
var _local2:Object;
_local2 = _dataProvider.getItemAt(_arg1);
if (_local2 != null){
invalidateItem(_local2);
};
}
public function set selectedItems(_arg1:Array):void{
var _local2:Array;
var _local3:uint;
var _local4:int;
if (_arg1 == null){
selectedIndices = null;
return;
};
_local2 = [];
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _dataProvider.getItemIndex(_arg1[_local3]);
if (_local4 != -1){
_local2.push(_local4);
};
_local3++;
};
selectedIndices = _local2;
}
public function clearSelection():void{
selectedIndex = -1;
}
override public function get maxHorizontalScrollPosition():Number{
return (_maxHorizontalScrollPosition);
}
public function get selectedItems():Array{
var _local1:Array;
var _local2:uint;
_local1 = [];
_local2 = 0;
while (_local2 < _selectedIndices.length) {
_local1.push(_dataProvider.getItemAt(_selectedIndices[_local2]));
_local2++;
};
return (_local1);
}
public function set selectedIndex(_arg1:int):void{
selectedIndices = ((_arg1)==-1) ? null : [_arg1];
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition()));
}
}
}//package fl.controls
Section 110
//TextInput (fl.controls.TextInput)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextInput(){
_editable = true;
_html = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
public function get restrict():String{
return (textField.restrict);
}
public function get textWidth():Number{
return (textField.textWidth);
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():int{
return (textField.length);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (_imeMode);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
public function get text():String{
return (textField.text);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function get htmlText():String{
return (textField.htmlText);
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
override public function setFocus():void{
stage.focus = textField;
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 111
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 112
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 113
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 114
//DataProvider (fl.data.DataProvider)
package fl.data {
import flash.events.*;
import fl.events.*;
public class DataProvider extends EventDispatcher {
protected var data:Array;
public function DataProvider(_arg1:Object=null){
if (_arg1 == null){
data = [];
} else {
data = getDataFromObject(_arg1);
};
}
protected function dispatchPreChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.PRE_DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
public function invalidateItemAt(_arg1:int):void{
checkIndex(_arg1, (data.length - 1));
dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _arg1);
}
public function getItemIndex(_arg1:Object):int{
return (data.indexOf(_arg1));
}
protected function getDataFromObject(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:XML;
var _local7:XMLList;
var _local8:XML;
var _local9:XMLList;
var _local10:XML;
var _local11:XMLList;
var _local12:XML;
if ((_arg1 is Array)){
_local3 = (_arg1 as Array);
if (_local3.length > 0){
if ((((_local3[0] is String)) || ((_local3[0] is Number)))){
_local2 = [];
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = {label:String(_local3[_local4]), data:_local3[_local4]};
_local2.push(_local5);
_local4++;
};
return (_local2);
};
};
return (_arg1.concat());
} else {
if ((_arg1 is DataProvider)){
return (_arg1.toArray());
};
if ((_arg1 is XML)){
_local6 = (_arg1 as XML);
_local2 = [];
_local7 = _local6.*;
for each (_local8 in _local7) {
_arg1 = {};
_local9 = _local8.attributes();
for each (_local10 in _local9) {
_arg1[_local10.localName()] = _local10.toString();
};
_local11 = _local8.*;
for each (_local12 in _local11) {
if (_local12.hasSimpleContent()){
_arg1[_local12.localName()] = _local12.toString();
};
};
_local2.push(_arg1);
};
return (_local2);
//unresolved jump
};
};
throw (new ((!NULL! + !NULL!) + " to Array or DataProvider.").TypeError(!NULL!));
}
public function removeItemAt(_arg1:uint):Object{
var _local2:Array;
checkIndex(_arg1, (data.length - 1));
dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1);
_local2 = data.splice(_arg1, 1);
dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1);
return (_local2[0]);
}
public function addItem(_arg1:Object):void{
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
data.push(_arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
}
public function sortOn(_arg1:Object, _arg2:Object=null){
var _local3:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local3 = data.sortOn(_arg1, _arg2);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local3);
}
public function sort(... _args){
var _local2:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local2 = data.sort.apply(data, _args);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local2);
}
public function addItems(_arg1:Object):void{
addItemsAt(_arg1, data.length);
}
public function concat(_arg1:Object):void{
addItems(_arg1);
}
public function clone():DataProvider{
return (new DataProvider(data));
}
public function toArray():Array{
return (data.concat());
}
public function get length():uint{
return (data.length);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
checkIndex(_arg2, data.length);
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
data.splice(_arg2, 0, _arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
}
public function getItemAt(_arg1:uint):Object{
checkIndex(_arg1, (data.length - 1));
return (data[_arg1]);
}
override public function toString():String{
return ((("DataProvider [" + data.join(" , ")) + "]"));
}
public function invalidateItem(_arg1:Object):void{
var _local2:uint;
_local2 = getItemIndex(_arg1);
if (_local2 == -1){
return;
};
invalidateItemAt(_local2);
}
protected function dispatchChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
protected function checkIndex(_arg1:int, _arg2:int):void{
if ((((_arg1 > _arg2)) || ((_arg1 < 0)))){
throw (new RangeError((((("DataProvider index (" + _arg1) + ") is not in acceptable range (0 - ") + _arg2) + ")")));
};
}
public function addItemsAt(_arg1:Object, _arg2:uint):void{
var _local3:Array;
checkIndex(_arg2, data.length);
_local3 = getDataFromObject(_arg1);
dispatchPreChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
data.splice.apply(data, [_arg2, 0].concat(_local3));
dispatchChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
}
public function replaceItem(_arg1:Object, _arg2:Object):Object{
var _local3:int;
_local3 = getItemIndex(_arg2);
if (_local3 != -1){
return (replaceItemAt(_arg1, _local3));
};
return (null);
}
public function removeItem(_arg1:Object):Object{
var _local2:int;
_local2 = getItemIndex(_arg1);
if (_local2 != -1){
return (removeItemAt(_local2));
};
return (null);
}
public function merge(_arg1:Object):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Object;
_local2 = getDataFromObject(_arg1);
_local3 = _local2.length;
_local4 = data.length;
dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
_local5 = 0;
while (_local5 < _local3) {
_local6 = _local2[_local5];
if (getItemIndex(_local6) == -1){
data.push(_local6);
};
_local5++;
};
if (data.length > _local4){
dispatchChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
} else {
dispatchChangeEvent(DataChangeType.ADD, [], -1, -1);
};
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
var _local3:Array;
checkIndex(_arg2, (data.length - 1));
_local3 = [data[_arg2]];
dispatchPreChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
data[_arg2] = _arg1;
dispatchChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
return (_local3[0]);
}
public function invalidate():void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, DataChangeType.INVALIDATE_ALL, data.concat(), 0, data.length));
}
public function removeAll():void{
var _local1:Array;
_local1 = data.concat();
dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
data = [];
dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
}
}
}//package fl.data
Section 115
//SimpleCollectionItem (fl.data.SimpleCollectionItem)
package fl.data {
public dynamic class SimpleCollectionItem {
public var label:String;
public var data:String;
public function toString():String{
return ((((("[SimpleCollectionItem: " + label) + ",") + data) + "]"));
}
}
}//package fl.data
Section 116
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 117
//DataChangeEvent (fl.events.DataChangeEvent)
package fl.events {
import flash.events.*;
public class DataChangeEvent extends Event {
protected var _items:Array;
protected var _endIndex:uint;
protected var _changeType:String;
protected var _startIndex:uint;
public static const PRE_DATA_CHANGE:String = "preDataChange";
public static const DATA_CHANGE:String = "dataChange";
public function DataChangeEvent(_arg1:String, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{
super(_arg1);
_changeType = _arg2;
_startIndex = _arg4;
_items = _arg3;
_endIndex = ((_arg5)==-1) ? _startIndex : _arg5;
}
public function get changeType():String{
return (_changeType);
}
public function get startIndex():uint{
return (_startIndex);
}
public function get items():Array{
return (_items);
}
override public function clone():Event{
return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex));
}
override public function toString():String{
return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable"));
}
public function get endIndex():uint{
return (_endIndex);
}
}
}//package fl.events
Section 118
//DataChangeType (fl.events.DataChangeType)
package fl.events {
public class DataChangeType {
public static const ADD:String = "add";
public static const REMOVE:String = "remove";
public static const REMOVE_ALL:String = "removeAll";
public static const CHANGE:String = "change";
public static const REPLACE:String = "replace";
public static const INVALIDATE:String = "invalidate";
public static const INVALIDATE_ALL:String = "invalidateAll";
public static const SORT:String = "sort";
}
}//package fl.events
Section 119
//ListEvent (fl.events.ListEvent)
package fl.events {
import flash.events.*;
public class ListEvent extends Event {
protected var _index:int;
protected var _item:Object;
protected var _columnIndex:int;
protected var _rowIndex:int;
public static const ITEM_DOUBLE_CLICK:String = "itemDoubleClick";
public static const ITEM_ROLL_OUT:String = "itemRollOut";
public static const ITEM_ROLL_OVER:String = "itemRollOver";
public static const ITEM_CLICK:String = "itemClick";
public function ListEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:int=-1, _arg7:Object=null){
super(_arg1, _arg2, _arg3);
_rowIndex = _arg5;
_columnIndex = _arg4;
_index = _arg6;
_item = _arg7;
}
public function get rowIndex():Object{
return (_rowIndex);
}
public function get index():int{
return (_index);
}
public function get item():Object{
return (_item);
}
public function get columnIndex():int{
return (_columnIndex);
}
override public function clone():Event{
return (new ListEvent(type, bubbles, cancelable, _columnIndex, _rowIndex));
}
override public function toString():String{
return (formatToString("ListEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "index", "item"));
}
}
}//package fl.events
Section 120
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 121
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 122
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 123
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 124
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 125
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 126
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 127
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 128
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 129
//Base (TheGame.GameTemplate.Base)
package TheGame.GameTemplate {
import flash.display.*;
public class Base extends MovieClip {
public function Base(){
tabEnabled = false;
}
public function afterCreate(){
}
public function beforeDelete(){
}
function beforeDeleteForAll(_arg1:DisplayObjectContainer){
var _local3:*;
if (_arg1 != null){
if ((_arg1 is Base)){
(_arg1 as Base).beforeDelete();
} else {
if ((_arg1 is BaseSprite)){
(_arg1 as BaseSprite).beforeDelete();
};
};
};
var _local2:* = 0;
while (_local2 < _arg1.numChildren) {
_local3 = _arg1.getChildAt(_local2);
if ((_local3 is DisplayObjectContainer)){
beforeDeleteForAll(_local3);
};
_local2++;
};
}
}
}//package TheGame.GameTemplate
Section 130
//BaseSprite (TheGame.GameTemplate.BaseSprite)
package TheGame.GameTemplate {
import flash.display.*;
public class BaseSprite extends Sprite {
public function afterCreate(){
}
public function beforeDelete(){
}
}
}//package TheGame.GameTemplate
Section 131
//ButtonSoundOnOff (TheGame.GameTemplate.ButtonSoundOnOff)
package TheGame.GameTemplate {
import flash.display.*;
import flash.events.*;
import TheGame.*;
public class ButtonSoundOnOff extends Base {
var mouth_mc:MovieClip;
var head_mc:MovieClip;
public var inside_mc:MovieClip;
var frameMouth:Number;// = 5
var myGame:Game;
public function ButtonSoundOnOff(){
head_mc = inside_mc.head_mc_;
mouth_mc = inside_mc.head_mc_.mouth_mc_;
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, onClickSound);
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOverSound);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOutSound);
this.scaleX = (this.scaleY = 1);
}
public function initButton(_arg1:Game){
myGame = _arg1;
setVolOnOff(1);
mouth_mc.gotoAndStop(frameMouth);
}
function onMouseOverSound(_arg1:Event){
if (myGame.flagSoundOn){
mouth_mc.play();
};
}
function forOnMouseOutSound(){
if (myGame.flagSoundOn){
mouth_mc.gotoAndStop(frameMouth);
};
}
function onClickSound(_arg1:Event){
myGame.flagSoundOn = !(myGame.flagSoundOn);
setVolOnOff(1);
mouth_mc.visible = (myGame.flagSoundOn) ? true : false;
}
function onMouseOutSound(_arg1:Event){
forOnMouseOutSound();
}
override public function beforeDelete(){
this.removeEventListener(MouseEvent.CLICK, onClickSound);
this.removeEventListener(MouseEvent.MOUSE_OVER, onMouseOverSound);
this.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOutSound);
}
public function choiceOnOff():String{
return ((myGame.flagSoundOn) ? "on" : "off");
}
public function setVolOnOff(_arg1:Number){
var _local2:Number;
if (myGame.mainSound != null){
_local2 = (myGame.flagSoundOn) ? _arg1 : 0;
myGame.mainSound.setVol((_local2 * myGame.musicVol));
head_mc.gotoAndStop(("s_" + choiceOnOff()));
};
}
}
}//package TheGame.GameTemplate
Section 132
//GameBase (TheGame.GameTemplate.GameBase)
package TheGame.GameTemplate {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.ui.*;
public class GameBase extends Base {
protected var cap_txt:TextField;
var currentScreen:ScreenBase;
protected var screens_mc:Sprite;
var _currentNextBtn:MyBtn;
public var saver:Saver;
protected var caption_mc:MovieClip;
var _userName:String;
protected var copyright_txt:TextField;
public static var projectName:String;
public static var gameClass:Class;
public function GameBase(){
saver = new Saver("AllGame");
saver.isAutoSave = true;
_userName = saver.getData("userName", "");
Lang.init(saver.getData("lang", 0));
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);
}
override public function beforeDelete(){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);
}
protected function set Caption(_arg1:String){
cap_txt.text = ((_arg1)!="") ? Lang.txt(_arg1) : _arg1;
cap_txt.visible = (caption_mc.visible = !((_arg1 == "")));
}
protected function swapFrame(_arg1:ScreenBase){
if (currentScreen){
currentNextBtn = null;
beforeDeleteForAll(currentScreen);
screens_mc.removeChild(currentScreen);
};
screens_mc.addChild((currentScreen = _arg1));
stage.focus = stage;
currentScreen.afterCreate();
}
public function set currentNextBtn(_arg1:MyBtn):void{
_currentNextBtn = _arg1;
if (_currentNextBtn){
_currentNextBtn.Active = true;
};
}
public function set saveCurLang(_arg1:String):void{
saver.setData("lang", Lang.curLangInd);
}
function onKeyPress(_arg1:KeyboardEvent){
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.NUMPAD_ENTER)))){
if (currentNextBtn != null){
currentNextBtn.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
};
}
public function set userName(_arg1:String):void{
_userName = _arg1;
saver.setData("userName", _userName);
}
protected function goFrame(_arg1:ScreenBase, _arg2:String=""){
_arg1.myGame_ = this;
swapFrame(_arg1);
Caption = _arg2;
}
public function get userName():String{
return (_userName);
}
public function get currentNextBtn():MyBtn{
return (_currentNextBtn);
}
}
}//package TheGame.GameTemplate
Section 133
//Lang (TheGame.GameTemplate.Lang)
package TheGame.GameTemplate {
public class Lang {
var rus:String;
var ger:String;
var spa:String;
var eng:String;
protected static var allowLangs:Array = ["eng", "rus"];
protected static var Texts:Object;
static var curLang:String;
protected static var _curLangInd:Number;
public function Lang(_arg1:String, _arg2:String=null, _arg3:String=null, _arg4:String=null){
eng = _arg1;
spa = (_arg4) ? _arg4 : _arg1;
ger = (_arg3) ? _arg3 : _arg1;
rus = (_arg2) ? _arg2 : _arg1;
}
function get text():String{
return (this[curLang]);
}
static function set curLangInd(_arg1:Number){
_curLangInd = _arg1;
}
static function swapLanguage(_arg1:Number=-1):Number{
if (_arg1 == -1){
curLangInd++;
if (curLangInd >= allowLangs.length){
curLangInd = 0;
};
} else {
curLangInd = _arg1;
};
curLang = allowLangs[curLangInd];
return (curLangInd);
}
static function get curLangInd():Number{
return (_curLangInd);
}
static function txt(_arg1:String):String{
var _local2:Lang = (Texts[_arg1] as Lang);
if (_local2 != null){
return (_local2.text);
};
return (_arg1);
}
static function init(_arg1:Number=-1){
swapLanguage(_arg1);
Texts = {myCarrier:new Lang("My Carrier", "Моя карьера", "Meine Karriere", ""), freeStyle:new Lang("World Freestyle", "Мировой фристайл", "Welttrickski", ""), next:new Lang("Next", "Дальше", "Weiter", ""), menu:new Lang("Menu", "Меню", "Menu", ""), mainMenu:new Lang("Main menu", "Главное меню", "Hauptmenu", ""), play:new Lang(" Play", " Игра", " Spielen", ""), moreGames:new Lang("More games", "Другие игры", "Mehr Spiele", ""), newGame:new Lang("From beginning", "С начала", "Von Anfang an", ""), changePers:new Lang("Change jumper", "Сменить прыгуна", "Springer zu ersetzen", ""), toStar:new Lang("Star competition!", "Соревнование за звезду!", "Wettkampf fur den Sternen!", ""), exit:new Lang("Exit", "Выход", "Austritt", ""), again:new Lang("Again", "Ещё раз", "Wieder", ""), cancel:new Lang("Cancel", "Отмена", "Abbrechen", ""), submit:new Lang("Submit record", "Выложить рекорд", "Rekord zu vorlegen ", ""), go_jump:new Lang("Jump!", "Вперёд!", "Springen!", ""), missEdu:new Lang("Miss Education", "Пропустить обучение", "Ausbildung zu uberspringen", ""), victory:new Lang("Victory!", "Победа!", "Sieg!", ""), skillUp:new Lang("Level up", "Повышение уровня", "Erhohung des Niveaus", ""), selectNewElement:new Lang("Learn new element", "Изучите новый элемент", "Studieren Sie neue Element", ""), select:new Lang("Choose jumper", "Выберите прыгуна", "Wahlen Sie den Springer", ""), guide:new Lang("Guide", "Руководство пользователя", "Anleitung", ""), end:new Lang("Finish", "Конец", "Ende", ""), levelGood:new Lang("Level complete!", "Уровень пройден!", "Niveau ist durchgehen!", ""), levelBad:new Lang("Level fail...", "Уровень не пройден...", "Niveau ist nicht durchgehen...", ""), records:new Lang("World records", "Мировые рекорды", "Weltrekorde", ""), name1:new Lang("Mariana", "Мариана", "Mariahna", ""), name2:new Lang("Arashi", "Араши", "Araschi", ""), name3:new Lang("Alena", "Алёна", "Alena", ""), name4:new Lang("Brayan", "Браян", "Brayan", ""), evolution:new Lang("Evolution", "Прогресс", "Fortschritt", ""), langName:new Lang(" English", " Русский", " Deutsch", " S"), myBest:new Lang("My best", "Личный рекорд", "Mein Rekord", ""), newRec:new Lang("New record!", "Новый рекорд!", "Neu Rekord", ""), result:new Lang("My result", "Мой результат", "Mein Resultat", ""), credits:new Lang("Credits", "Авторы", "Autoren", ""), enterName:new Lang("Enter your name", "Введите Ваше имя", "Fuhren Sie Ihren Namen ein", ""), tryAgain:new Lang("Try again", "Ещё раз", "Wieder", ""), SelectDif:new Lang("Select difficulty", "Выберите сложность", "Wahlen Sie die Schwierigkeitsgrad", ""), diff_easy:new Lang("Easy", "Лёгкая", "Leicht", ""), diff_normal:new Lang("Normal", "Нормальная", "Normal", ""), diff_hard:new Lang("Hard", "Трудная", "Schwierig", ""), tryHard:new Lang("Try high difficulty ;)", "Попробуйте высокую сложность ;)", "Wahlen Sie die hoch Schwierigkeitsgrad ;)", ""), time:new Lang("Time", "Время", "Zeit", ""), and:new Lang("and", "и", "und", ""), in_:new Lang("in", "в", "in", ""), or_:new Lang("or", "или", "oder", ""), repeat:new Lang("repeat", "повтор", "Wiederholung", ""), power:new Lang("Power", "Сила", "Kraft", ""), rotation:new Lang("Rotation", "Вращение", "Drehen", ""), points:new Lang("Points", "Очки", "Punkten", ""), points2:new Lang("points", "очков", "Punkten", ""), pointsLevel:new Lang("Points for level", "Очков за уровень", "Punkten fur Niveau", ""), pointsTotal:new Lang("Total points", "Всего очков", "Summe Punkten", ""), down:new Lang("down", "вниз", "hinunter", ""), up:new Lang("up", "вверх", "hinauf", ""), left:new Lang("left", "влево", "links", ""), right:new Lang("right", "вправо", "rechts", ""), funClub:new Lang("Fan-zone", "Фан-клуб", "Fan-Klub", ""), allDone:new Lang("Now free style!", "А теперь - фристайл!", "Und Jetzt - Trickski!", ""), tipQuick:new Lang("You need 1 star", "Требуется 1 звезда", "Es ist notig 1 Stern", ""), tipFull:new Lang("The mode executed by this charachter", "Режим уже пройден этим персонажем", "Das Regime ist von dieser Person schon durchgegangen", ""), exec2:new Lang("Execute 2 imperative elements (overhead)", "Выполните 2 обязательных элемента (наверху)", "Erfullen Sie 2 Pflichtubungen (oben)", ""), guide:new Lang(((" You need execute 5 imperative elements, which are overhead. \n\n " + " After imperative program you can get more points in free style. \n\n ") + " Remember! You should land straight and closer to vertical line to jump higher."), ((" Требуется выполнить 5 обязательных элементов, которые отображаются вверху. \n\n " + " После обязательных элементов Вы можете набрать очки за счёт выполнения свободной программы. \n\n") + " Помните! Чтобы лучше выпрыгивать, надо приземляться прямо и ближе к вертикали."), ((" Es ist erforderlich, 5 Pflichtubungen zu erfullen, die oben dargestellt werden. \n\n " + " Nach den obligatorischen Elementen, konnen Sie die Punkte fur die Rechnung der Ausfuhrung des freien Programms zusammennehmen. \n\n") + " Sie erinnern sich! Um besser herauszuspringen, muss man gerade und naher zur Vertikale landen."), ""), badLanding:new Lang("Incorrect landing", "Неправильное приземление", "Unrichtig Landung", ""), youMade:new Lang("You made", "Вы сделали", "Sie haben gemacht", ""), creditsText:new Lang(((("Develop - Vadim Pechersky \n" + "Graphics - Maxim Yurchenko \n") + "Music - FlashKit.com \n") + "Team - "), ((("Разработка - Вадим Печерский \n" + "Графика - Максим Юрченко \n") + "Музыка - FlashKit.com \n") + "Команда - "), ((("Entwicklung - Vadim Pechersky \n" + "Graphik - Maxim Yurchenko \n") + "Musik - FlashKit.com \n") + "Mannschaft - "), ""), tuck:new Lang("Tuck", "Группировка", "Gruppierung", ""), pike:new Lang("Pike", "Согнувшись", "Sich biegen", ""), straight:new Lang("Straight", "Прогнувшись", "Sich durchbiegen", ""), straddle:new Lang("Straddle", "Шпагат", "Spagat", ""), tilt:new Lang("Tilt", "Наклон", "Neigung", ""), swallow:new Lang("Swallow", "Ласточка", "Schwalbe", ""), wheel:new Lang("Wheel", "Колесо", "Rad", ""), ring:new Lang("Ring", "Кольцо", "Ring", ""), triangle:new Lang("Triangle", "Треугольник", "Dreieck", ""), fife:new Lang("Fife", "Дудка", "Rohrpfeife", ""), freefall:new Lang("Free fall", "Свободное падение", "Freifall", ""), hurdle:new Lang("Hurdle", "Барьер", "Barriere", ""), prayer:new Lang("Prayer", "Молитва", "Gebet", ""), knees:new Lang("Knees", "Колени", "Knie", ""), front:new Lang("front", "вперёд", "vorwarts", ""), back:new Lang("back", "назад", "ruckwarts", ""), ballin:new Lang("ball in", "на спину", "auf den Rucken", ""), ballout:new Lang("ball out", "со спины", "Von des Ruckens", ""), stand:new Lang("stand", "станьте", "steigen Sie", ""), beStraight:new Lang("straight", "прямо", "aufrecht", ""), before:new Lang("before", "перед", "vor", ""), every_new_:new Lang("every new", "каждым новым", "jeder neuen", ""), jump:new Lang("jump", "прыжком", "Sprung", ""), elementsOnTop:new Lang("Elements, that you need to do, will appear overhead.", "Элементы, которые Вам нужно сделать, появляются наверху.", "Die Elemente, die Sie machen mussen, erscheinen oben.", ""), exec1elementOnTop:new Lang("Execute element overhead. ", "Выполните элемент наверху. ", "Erfullen Sie das Element oben. ", ""), hold:new Lang("Hold", "Держите", "Presse", ""), inFlight:new Lang("in flight", "в полёте", "im Flug", ""), toShape:new Lang("to shape", "чтобы принять положение", "um die Lage zu einnehmen", ""), toRotate:new Lang("to rotate", "чтобы сделать оборот", "um die Umlauf zu machen", "")};
}
}
}//package TheGame.GameTemplate
Section 134
//MyBtn (TheGame.GameTemplate.MyBtn)
package TheGame.GameTemplate {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.*;
import flash.filters.*;
public class MyBtn extends Base {
public var scaleUp:Number;// = 0.8
var textFilters:Object;
var backFilters:Object;
var appearSteps:Number;// = 7
var flagOverUp:Boolean;// = false
var backFilters2:Object;
var minWidth:Number;
var tAppear:Number;
var back2_mc:Sprite;
var text:String;
var x_txt:TextField;
public var back_mc_:MovieClip;
public var scaleStart:Number;// = 0.7
var counterBlink:Number;// = 0
public var fil2:MovieClip;
public var active_mc_:MovieClip;
var myAppearClip:DisplayObject;
public var x_txt_:TextField;
var isActive:Boolean;// = false
var finalScaleX:Number;
var back_mc:Sprite;
var active_mc:Sprite;
public var myPointer:PointerMenuBtn;
var flagBig:Boolean;// = false
public var back2_mc_:MovieClip;
public function MyBtn(){
stop();
x_txt = this["x_txt_"];
active_mc = this["active_mc_"];
back_mc = this["back_mc_"];
back2_mc = this["back2_mc_"];
var _local1:DropShadowFilter = new DropShadowFilter(0, 45, 1199984, 1, 5, 5, 1.37, 1);
var _local2:DropShadowFilter = (_local1.clone() as DropShadowFilter);
_local2.color = 0xCCCC;
var _local3:DropShadowFilter = (_local1.clone() as DropShadowFilter);
_local2.color = 26265;
var _local4:ColorMatrixFilter = back_mc.filters[0];
var _local5:ColorMatrixFilter = fil2.filters[0];
var _local6:DropShadowFilter = new DropShadowFilter(2, 88, 91260, 1, 7, 7, 1.2, 1);
var _local7:DropShadowFilter = new DropShadowFilter(0, 45, 16777164, 1, 7, 7, 1.2, 1);
textFilters = {up:[_local1], over:[_local2], down:[_local3]};
backFilters = {up:[_local4], over:[_local4], down:[_local5]};
backFilters2 = {up:[_local6], over:[_local7], down:[_local6]};
buttonMode = true;
addEventListener(MouseEvent.MOUSE_OVER, mouseOverUp);
addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
addEventListener(MouseEvent.MOUSE_UP, mouseOverUp);
forMouseOut();
x_txt.mouseEnabled = false;
Active = Active;
}
override public function beforeDelete(){
removeEventListener(MouseEvent.MOUSE_OVER, mouseOverUp);
removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);
removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
removeEventListener(MouseEvent.MOUSE_UP, mouseOverUp);
removeEventListener(Event.ENTER_FRAME, onEnterFrameNext);
}
public function set Text(_arg1:String){
text = _arg1;
x_txt.text = Lang.txt(text);
if (x_txt.textWidth > minWidth){
x_txt.autoSize = "center";
};
back_mc.width = (x_txt.width + 20);
back2_mc.width = (back_mc.width * 1.03);
active_mc.width = (back_mc.width * 1.01);
}
function get Active():Boolean{
return (isActive);
}
function trace1Filter(_arg1:DisplayObject, _arg2){
var _local3:DropShadowFilter;
var _local4:ColorMatrixFilter;
if ((_arg2 is DropShadowFilter)){
_local3 = (_arg2 as DropShadowFilter);
};
if ((_arg2 is ColorMatrixFilter)){
_local4 = (_arg2 as ColorMatrixFilter);
};
}
public function get MinWidth():Number{
return (minWidth);
}
function mouseOverUp(_arg1){
flagOverUp = true;
x_txt.filters = textFilters.over;
back_mc.filters = backFilters.over;
back2_mc.filters = backFilters2.over;
x_txt.textColor = 0xFFFFFF;
if (((!((scaleX == scaleUp))) || (!((scaleY == scaleUp))))){
scaleX = (scaleY = scaleUp);
};
if (myPointer != null){
myPointer.gotoAndStop((myPointer.findMyIndex(this) + 2));
};
}
public function startEndBlink(_arg1:Boolean){
if (!_arg1){
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, onEnterFrameNext);
};
} else {
addEventListener(Event.ENTER_FRAME, onEnterFrameNext);
};
}
function onEnterFrameNext(_arg1:Event){
if (flagOverUp){
return;
};
if (counterBlink < 10){
counterBlink = (counterBlink + 1);
} else {
if (!flagBig){
scaleX = (scaleY = scaleUp);
} else {
scaleX = (scaleY = scaleStart);
};
flagBig = !(flagBig);
counterBlink = 0;
};
}
function set Active(_arg1:Boolean){
isActive = _arg1;
active_mc.visible = isActive;
}
public function get Text():String{
return (text);
}
public function forMouseOut(){
flagOverUp = false;
x_txt.filters = textFilters.up;
back_mc.filters = backFilters.up;
back2_mc.filters = backFilters2.up;
x_txt.textColor = 0xFFFFFF;
scaleX = (scaleY = scaleStart);
if (myPointer != null){
myPointer.gotoAndStop(0);
};
}
function mouseDown(_arg1){
x_txt.filters = textFilters.down;
back_mc.filters = backFilters.down;
back2_mc.filters = backFilters2.down;
x_txt.textColor = 12507121;
}
function traceFilters(){
}
public function set MinWidth(_arg1:Number):void{
minWidth = _arg1;
}
function mouseOut(_arg1){
forMouseOut();
}
}
}//package TheGame.GameTemplate
Section 135
//MyFunc (TheGame.GameTemplate.MyFunc)
package TheGame.GameTemplate {
import flash.utils.*;
public class MyFunc {
public static function getClass(_arg1:String):Class{
return ((getDefinitionByName(_arg1) as Class));
}
public static function random(_arg1:int):int{
return (Math.floor((Math.random() * _arg1)));
}
public static function cloneArray(_arg1:Array):Array{
var _local2:Array = new Array(_arg1.length);
var _local3:* = 0;
while (_local3 < _arg1.length) {
_local2[_local3] = _arg1[_local3];
_local3++;
};
return (_local2);
}
public static function hrefTo(_arg1:String="FlashTeam.ru", _arg2:String="http://games.flashteam.ru"):String{
return ((((("<a href='" + _arg2) + "' target='_blank'><u><b>") + _arg1) + "</b></u></a>"));
}
}
}//package TheGame.GameTemplate
Section 136
//PopupWindow (TheGame.GameTemplate.PopupWindow)
package TheGame.GameTemplate {
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import flash.text.*;
import TheGame.Screens.*;
import TheGame.*;
public class PopupWindow extends Base {
var play_on_f_button:MyBtn;
public var again_btn_:myBtnBig;
public var walkthrough_btn_:myBtnBig;
public var backside_mc_:MovieClip;
public var title_txt:TextField;
public var fon_mc_:MovieClip;
var more_games_button:MyBtn;
public var next2_btn_:myBtnBig;
var backside_mc:MovieClip;
var myLevel:Level;
var startY:Number;
public var message_txt:TextField;
var fon_mc:Sprite;
public var play_on_f_btn_:myBtnBigcopy2;
var next2_button:MyBtn;
var buttonX:Number;
var buttonY:Number;
var walk_button:MyBtn;
var messageTxt:TextField;
public var more_games_btn_:myBtnBig;
var again_button:MyBtn;
var titleTxt:TextField;
public function PopupWindow(){
visible = false;
startY = y;
y = -170;
fon_mc = fon_mc_;
fon_mc.addEventListener(MouseEvent.CLICK, onFonClick);
backside_mc = backside_mc_;
titleTxt = title_txt;
messageTxt = message_txt;
messageTxt.alpha = 0;
again_button = again_btn_;
next2_button = next2_btn_;
walk_button = walkthrough_btn_;
play_on_f_button = play_on_f_btn_;
more_games_button = more_games_btn_;
again_button.visible = (next2_button.visible = (walk_button.visible = (play_on_f_button.visible = (more_games_button.visible = false))));
buttonX = next2_button.x;
buttonY = next2_button.y;
gotoAndStop(1);
}
override public function beforeDelete(){
fon_mc.removeEventListener(MouseEvent.CLICK, onFonClick);
next2_button.removeEventListener(MouseEvent.CLICK, onClickEnd);
messageTxt.removeEventListener(Event.ENTER_FRAME, onEnterFrameMess);
if (myLevel != null){
next2_button.removeEventListener(MouseEvent.CLICK, myLevel.onClickNext);
again_button.removeEventListener(MouseEvent.CLICK, myLevel.goGameAgain);
walk_button.removeEventListener(MouseEvent.CLICK, myLevel.goWalk);
more_games_button.removeEventListener(MouseEvent.CLICK, myLevel.goMoreGames);
};
}
function showButton(_arg1:MyBtn){
_arg1.visible = true;
_arg1.x = buttonX;
_arg1.y = buttonY;
}
function onClickEnd(_arg1:Event){
myLevel.myGame.goAtFrame(Game.FRAME_SUBMIT);
next2_button.removeEventListener(MouseEvent.CLICK, onClickEnd);
}
private function onFonClick(_arg1:MouseEvent):void{
}
function onFacebook(_arg1:Event){
Game.openPage(Game.LINK_BETWEEN_LEVEL);
}
public function showMessage(_arg1:Level, _arg2:String="", _arg3:String="", _arg4:Boolean=false){
var _local5:Number;
if (visible == true){
return;
};
Tweener.addTween(this, {time:1, transition:"easeOutQuart", y:startY, onComplete:endTweener});
myLevel = _arg1;
showMe(true);
if (_arg3 == ""){
gotoAndStop(2);
titleTxt.text = ("\n\n" + _arg2);
} else {
gotoAndStop(1);
titleTxt.text = _arg2;
};
messageTxt.text = _arg3;
if (_arg4){
showButton(next2_button);
play_on_f_button.visible = true;
play_on_f_button.addEventListener(MouseEvent.CLICK, onFacebook);
_local5 = (myLevel.myNumber + 2);
if (_local5 <= LevelsInfo.kLevels){
next2_button.x = (next2_button.x - 15);
next2_button.Text = ("next level " + _local5);
next2_button.addEventListener(MouseEvent.CLICK, myLevel.onClickNext);
} else {
next2_button.Text = "next";
next2_button.addEventListener(MouseEvent.CLICK, onClickEnd);
myLevel.myGame.myGameOver = true;
play_on_f_button.x = (play_on_f_button.x + 30);
};
} else {
showButton(again_button);
more_games_button.visible = true;
again_button.addEventListener(MouseEvent.CLICK, myLevel.goGameAgain);
more_games_button.addEventListener(MouseEvent.CLICK, myLevel.goMoreGames);
};
}
function onEnterFrameMess(_arg1:Event){
if (messageTxt.alpha < 1){
messageTxt.alpha = (messageTxt.alpha + 0.1);
} else {
messageTxt.alpha = 1;
messageTxt.removeEventListener(Event.ENTER_FRAME, onEnterFrameMess);
};
}
public function showMe(_arg1:Boolean){
visible = _arg1;
}
function endTweener(){
messageTxt.addEventListener(Event.ENTER_FRAME, onEnterFrameMess);
}
}
}//package TheGame.GameTemplate
Section 137
//Saver (TheGame.GameTemplate.Saver)
package TheGame.GameTemplate {
import flash.net.*;
public class Saver {
var isAutoSave:Boolean;// = false
var myName:String;
var onSaving:Boolean;// = true
var so:SharedObject;
public function Saver(_arg1:String){
myName = _arg1;
init();
}
public function getData(_arg1:String, _arg2){
var _local3:* = so.data[_arg1];
if ((((_local3 == null)) && (!((_arg2 == null))))){
trace((_arg1 + " is null"));
_local3 = _arg2;
setData(_arg1, _local3);
_local3 = _arg2;
};
return (_local3);
}
public function removeMe(){
so.clear();
}
function getMyProperty(_arg1:String, _arg2){
this[_arg1] = getData(_arg1, _arg2);
}
protected function init(){
so = SharedObject.getLocal(((GameBase.projectName + "_") + myName));
}
public function setData(_arg1:String, _arg2){
if (onSaving){
so.data[_arg1] = _arg2;
};
if (((isAutoSave) && (onSaving))){
so.flush();
};
}
function saveMyProperty(_arg1:String){
setData(_arg1, this[_arg1]);
}
}
}//package TheGame.GameTemplate
Section 138
//ScreenBase (TheGame.GameTemplate.ScreenBase)
package TheGame.GameTemplate {
public class ScreenBase extends Base {
public var myGame_:GameBase;
public function Screen(){
}
override public function beforeDelete(){
}
}
}//package TheGame.GameTemplate
Section 139
//SoundFabric (TheGame.GameTemplate.SoundFabric)
package TheGame.GameTemplate {
import flash.media.*;
import flash.utils.*;
public class SoundFabric {
var sound_str:String;
var isPlay:Boolean;
var loops:Number;// = 1
public var sChannel:SoundChannel;
var s:Sound;
var offsetMs:Number;// = 0
var vol:Number;// = 1
public function SoundFabric(_arg1:String, _arg2:Number=0, _arg3:Number=1, _arg4:Number=1){
trace(("Sound " + [_arg1, _arg2, _arg3, _arg4]));
sound_str = _arg1;
offsetMs = _arg2;
loops = _arg3;
vol = _arg4;
s = new (getDefinitionByName(sound_str));
play();
}
public function stop(){
isPlay = false;
sChannel.stop();
}
function setVol(_arg1){
vol = _arg1;
var _local2:SoundTransform = sChannel.soundTransform;
_local2.volume = vol;
sChannel.soundTransform = _local2;
}
function play(){
isPlay = true;
sChannel = s.play(offsetMs, loops);
setVol(vol);
}
}
}//package TheGame.GameTemplate
Section 140
//EditPanel (TheGame.MyPhysics.EditPanel)
package TheGame.MyPhysics {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.*;
import TheGame.GameTemplate.*;
import flash.utils.*;
import flash.ui.*;
public class EditPanel extends Base {
var stat_txt:TextField;
var rot_txt:TextField;
var scotch_txt:TextField;
public var bonus_txt_:TextField;
public var depthMinus_btn_:SimpleButton;
var depthPlus_btn:SimpleButton;
public var bonus_type_mc_:ComboBox;
var xs_txt:TextField;
var del_btn:SimpleButton;
public var del_btn_:SimpleButton;
var swim_txt:TextField;
public var xToY_btn:MovieClip;
public var swim_txt_:TextField;
public var prop_txt_:TextField;
var comboNewVolt:ComboBox;
public var rot_txt_:TextField;
var bonus_type:ComboBox;
public var simple_txt_:TextField;
public var under_mc:MovieClip;
var bonus_txt:TextField;
var simple_txt:TextField;
var dens_mc:ComboBox;
public var depthPlus_btn_:SimpleButton;
var depthMinus_btn:SimpleButton;
var lastAddedObj:PhysicsMovie;
var prop_txt:TextField;
public var combo_world:ComboBox;
var comboWorld:ComboBox;
public var physWorld:PhysicsWorld;
public var yToX_btn:MovieClip;
private var physMov:PhysicsMovie;
public var xs_txt_:TextField;
public var scotch_txt_:TextField;
public var fon_btn_:SimpleButton;
var ys_txt:TextField;
public var dens_mc_:ComboBox;
public var combo_new_volt:ComboBox;
var attachedClips:Array;
var fon_btn:SimpleButton;
var combo_mc:ComboBox;
public var stat_txt_:TextField;
public var ys_txt_:TextField;
public function EditPanel(){
alpha = 0.8;
del_btn = del_btn_;
fon_btn = fon_btn_;
depthMinus_btn = depthMinus_btn_;
depthPlus_btn = depthPlus_btn_;
prop_txt = prop_txt_;
dens_mc = dens_mc_;
comboWorld = combo_world;
comboNewVolt = combo_new_volt;
rot_txt = rot_txt_;
xs_txt = xs_txt_;
ys_txt = ys_txt_;
bonus_txt = bonus_txt_;
bonus_type = bonus_type_mc_;
rot_txt.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
xs_txt.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
ys_txt.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
bonus_txt.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
dens_mc.addEventListener(Event.CHANGE, onChangeDensity);
bonus_type.addEventListener(Event.CHANGE, onChangeDensity);
yToX_btn.addEventListener(MouseEvent.CLICK, yToX);
xToY_btn.addEventListener(MouseEvent.CLICK, xToY);
del_btn.addEventListener(MouseEvent.CLICK, delElement);
fon_btn.addEventListener(MouseEvent.CLICK, changeFon);
depthMinus_btn.addEventListener(MouseEvent.CLICK, onClickDepthMinus);
depthPlus_btn.addEventListener(MouseEvent.CLICK, onClickDepthPlus);
combo_mc = new ComboBox();
combo_mc.rowCount = 20;
combo_mc.x = 22;
combo_mc.y = 55;
this.addChild(combo_mc);
combo_mc.addEventListener(Event.CLOSE, onCloseCombo);
combo_mc.addEventListener(Event.CHANGE, onSelectItem);
combo_mc.addItem({label:""});
this.mouseEnabled = true;
this.mouseChildren = true;
under_mc.mouseEnabled = true;
under_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag);
under_mc.addEventListener(MouseEvent.MOUSE_UP, drop);
simple_txt = simple_txt_;
scotch_txt = scotch_txt_;
stat_txt = stat_txt_;
swim_txt = swim_txt_;
simple_txt.text = "1";
scotch_txt.text = (stat_txt.text = (swim_txt.text = "0"));
}
private function onKey(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.NUMPAD_ENTER)))){
changeProp((_arg1.currentTarget as TextField));
};
}
function yToX(_arg1){
xs_txt.text = ys_txt.text;
changeProp(xs_txt);
}
override public function beforeDelete(){
rot_txt.removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
xs_txt.removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
ys_txt.removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
bonus_txt.removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
dens_mc.removeEventListener(Event.CHANGE, onChangeDensity);
bonus_type.removeEventListener(Event.CHANGE, onChangeDensity);
yToX_btn.removeEventListener(MouseEvent.CLICK, yToX);
xToY_btn.removeEventListener(MouseEvent.CLICK, xToY);
del_btn.removeEventListener(MouseEvent.CLICK, delElement);
fon_btn.removeEventListener(MouseEvent.CLICK, changeFon);
depthMinus_btn.removeEventListener(MouseEvent.CLICK, onClickDepthMinus);
depthPlus_btn.removeEventListener(MouseEvent.CLICK, onClickDepthPlus);
combo_mc.removeEventListener(Event.CLOSE, onCloseCombo);
combo_mc.removeEventListener(Event.CHANGE, onSelectItem);
under_mc.removeEventListener(MouseEvent.MOUSE_DOWN, drag);
under_mc.removeEventListener(MouseEvent.MOUSE_UP, drop);
}
function onClickDepthPlus(_arg1:Event){
changeDepth(1);
}
function onClickDepthMinus(_arg1:Event){
changeDepth(-1);
}
function changeProp(_arg1:TextField=null){
if (physMov == null){
return;
};
physMov.rotation = Number(rot_txt.text);
physMov.scaleX = Number(xs_txt.text);
physMov.scaleY = Number(ys_txt.text);
physMov.myDensity = Number(dens_mc.selectedLabel);
if ((physMov as PhysicsMovieBonus) != null){
(physMov as PhysicsMovieBonus).changeBonus(bonus_txt.text, bonus_type.selectedItem.data);
};
}
public function drag(_arg1:MouseEvent):void{
this.startDrag();
alpha = 0.4;
}
function get currentItem():String{
return (combo_mc.selectedItem.label);
}
function addItem(){
if (currentItem == ""){
return;
};
if (((!((lastAddedObj == null))) && (!(lastAddedObj.wasTouched)))){
physWorld.deleteObj(lastAddedObj);
};
lastAddedObj = physWorld.addObjAndEdit(currentItem, (this.x + 100), (this.y + 200));
}
public function onSelectItem(_arg1:Event):void{
addItem();
}
public function showProps(_arg1:PhysicsMovie){
if (physMov != null){
physMov.isCurEdit = false;
};
physMov = _arg1;
physMov.isCurEdit = true;
prop_txt.text = getQualifiedClassName(physMov);
rot_txt.text = physMov.rotation.toString();
xs_txt.text = physMov.scaleX.toString();
ys_txt.text = physMov.scaleY.toString();
dens_mc.text = physMov.myDensity.toString();
if ((physMov as PhysicsMovieBonus) != null){
(physMov as PhysicsMovieBonus).myMC.stop();
bonus_txt.text = (physMov as PhysicsMovieBonus).sizeBonus.toString();
findStartValueCombo(bonus_type, (physMov as PhysicsMovieBonus).typeBonus.toString());
changeVis(true);
} else {
changeVis(false);
};
}
function delElement(_arg1){
physWorld.deleteObj(physMov);
physMov = null;
}
function onChangeDensity(_arg1){
changeProp();
}
function changeVis(_arg1:Boolean){
bonus_txt.visible = _arg1;
bonus_type.alpha = (_arg1) ? 1 : 0;
bonus_type.visible = (bonus_type.textField.visible = _arg1);
comboNewVolt.x = comboWorld.x;
comboNewVolt.y = bonus_txt.y;
comboNewVolt.alpha = (_arg1) ? 0 : 1;
comboNewVolt.visible = (comboNewVolt.textField.visible = !(_arg1));
}
function xToY(_arg1){
ys_txt.text = xs_txt.text;
changeProp(ys_txt);
}
public function onCloseCombo(_arg1:Event):void{
}
public function initMe(_arg1:Array){
attachedClips = _arg1;
var _local2:* = 0;
while (_local2 < attachedClips.length) {
combo_mc.addItem({label:getQualifiedClassName(attachedClips[_local2])});
_local2++;
};
}
function findStartValueCombo(_arg1:ComboBox, _arg2:String){
var _local3:* = 0;
while (_arg1.getItemAt(_local3).data != _arg2.toLowerCase()) {
_local3++;
};
_arg1.selectedIndex = _local3;
}
public function initOnBegin(_arg1:Number){
prop_txt.text = "";
rot_txt.text = "";
xs_txt.text = "";
ys_txt.text = "";
dens_mc.text = "";
var _local2:XML = LevelsInfo.levelInfo[_arg1];
var _local3:Array = _local2.@kVolts.split("_");
findStartValueCombo(comboWorld, _local2.@worldZone);
simple_txt.text = _local3[0];
stat_txt.text = _local3[1];
scotch_txt.text = _local3[2];
swim_txt.text = _local3[3];
findStartValueCombo(comboNewVolt, _local2.@firstVolt);
changeVis(false);
}
public function drop(_arg1:MouseEvent):void{
this.stopDrag();
alpha = 0.8;
}
public function onTextIn(_arg1:Event):void{
var _local2:TextField = (_arg1.currentTarget as TextField);
changeProp(_local2);
}
function changeDepth(_arg1:Number){
var _local5:PhysicsMovie;
var _local2:DisplayObjectContainer = physMov.parent;
var _local3:Number = _local2.getChildIndex(physMov);
var _local4:Number = (_local3 + _arg1);
if ((((_local4 >= 0)) && ((_local4 < _local2.numChildren)))){
_local5 = PhysicsMovie(_local2.getChildAt(_local4));
_local2.swapChildrenAt(_local3, _local4);
physWorld.swapObjs(physMov, _local5);
};
}
function changeFon(_arg1):void{
if (physWorld.levelFon_mc.currentFrame < physWorld.levelFon_mc.totalFrames){
physWorld.levelFon_mc.nextFrame();
} else {
physWorld.levelFon_mc.gotoAndStop(1);
};
}
}
}//package TheGame.MyPhysics
Section 141
//Physics1Shape (TheGame.MyPhysics.Physics1Shape)
package TheGame.MyPhysics {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import TheGame.GameTemplate.*;
public class Physics1Shape extends BaseSprite {
public var p1:MovieClip;
public var p3:MovieClip;
public var p5:MovieClip;
public var p7:MovieClip;
public var p2:MovieClip;
public var p4:MovieClip;
public var p6:MovieClip;
public var p8:MovieClip;
var myPhysMovie:PhysicsMovie;
public var myShape:b2Shape;
var myDef:Object;
public function Physics1Shape(){
myPhysMovie = (parent as PhysicsMovie);
if (myPhysMovie.myShapes == null){
myPhysMovie.myShapes = [];
};
myPhysMovie.myShapes.push(this);
visible = false;
}
override public function beforeDelete(){
}
}
}//package TheGame.MyPhysics
Section 142
//PhysicsContactListener (TheGame.MyPhysics.PhysicsContactListener)
package TheGame.MyPhysics {
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import TheGame.*;
public class PhysicsContactListener extends b2ContactListener {
var physWorld:PhysicsWorld;
public function PhysicsContactListener(_arg1:PhysicsWorld){
physWorld = _arg1;
}
override public function Add(_arg1:b2ContactPoint):void{
addContact(_arg1);
}
override public function Persist(_arg1:b2ContactPoint):void{
}
override public function Remove(_arg1:b2ContactPoint):void{
}
override public function Result(_arg1:b2ContactResult):void{
}
function addContact(_arg1:b2ContactPoint){
var _local4:PhysicsMovie;
var _local5:PhysicsMovie;
var _local6:PhysicsMovieBonus;
var _local7:*;
var _local8:PhysicsMovie;
var _local9:Volt;
var _local10:PhysicsMovieNoContact;
var _local11:Volt;
var _local12:PhysicsMovie;
var _local13:Volt;
var _local14:Volt;
var _local15:PhysicsMovie;
var _local2:* = _arg1.shape1.m_body.m_userData;
var _local3:* = _arg1.shape2.m_body.m_userData;
if ((((_local2 == null)) || ((_local3 == null)))){
return;
};
if (_local2 != null){
_local4 = (_local2 as PhysicsMovie);
};
if (_local3 != null){
_local5 = (_local3 as PhysicsMovie);
};
if (((!(((_local4 as PhysicsMovieBonus) == null))) || (!(((_local5 as PhysicsMovieBonus) == null))))){
_local6 = ((((_local4 as PhysicsMovieBonus))!=null) ? _local4 : _local5 as PhysicsMovieBonus);
_local7 = (((_local6)==_local4) ? _local5 : _local4 as Volt);
if ((_local7 as Volt) != null){
_local6.addBonus();
Game.iAmGame.playSound("SndBonus");
};
};
if (((!(((_local4 as PhysicsMovWater) == null))) || (!(((_local5 as PhysicsMovWater) == null))))){
_local8 = (((_local4 as PhysicsMovWater))!=null) ? _local5 : _local4;
if (!_local8.swimIfCan()){
trace([_local8.name, Game.stringForWater]);
_local8.strForContact = Game.stringForWater;
Game.iAmGame.playSound("SndWater", 0.9);
};
} else {
if (((!(((_local4 as PhysicsMovieNoContact) == null))) || (!(((_local5 as PhysicsMovieNoContact) == null))))){
if (((!(((_local4 as Volt) == null))) || (!(((_local5 as Volt) == null))))){
_local9 = ((((_local4 as Volt))!=null) ? _local4 : _local5 as Volt);
_local10 = (((_local9)==_local4) ? _local5 : _local4 as PhysicsMovieNoContact);
_local9.strForContact = Game.stringForNoContact;
_local10.fixContact(_local9);
Game.iAmGame.playSound("SndNoContact", 3);
};
} else {
if (((!(((_local4 as Volt) == null))) || (!(((_local5 as Volt) == null))))){
_local11 = ((((_local4 as Volt))!=null) ? _local4 : _local5 as Volt);
_local12 = ((_local11)==_local4) ? _local5 : _local4;
if ((_local12 as Volt) != null){
_local13 = (_local12 as Volt);
};
if ((((_local11.id == Volt.VOLT_SCOTCH)) || (((!((_local13 == null))) && ((_local13.id == Volt.VOLT_SCOTCH)))))){
_local14 = ((_local11.id)==Volt.VOLT_SCOTCH) ? _local11 : _local13;
_local15 = ((_local14)!=_local11) ? _local11 : _local12;
_local14.doScotch(_local15, _arg1.position);
};
};
};
};
}
}
}//package TheGame.MyPhysics
Section 143
//PhysicsMovie (TheGame.MyPhysics.PhysicsMovie)
package TheGame.MyPhysics {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import TheGame.GameTemplate.*;
import flash.utils.*;
public class PhysicsMovie extends BaseSprite {
var bodyDef:b2BodyDef;
var flagAddSplashes:Boolean;// = false
public var isSwimDown:Boolean;// = false
public var myDensity;
var myRestitution;
protected var physWorld:PhysicsWorld;
public var aBody:b2Body;
public var strForContact:String;// = ""
protected var objInfoParams:Array;
var myXmlObj:XML;
protected var collideMyBits:Number;// = 1
var wasDrag:Boolean;
public var myShapes:Array;
public var myFriction;
protected var canSwimInWater:Boolean;// = false
public var isCurEdit:Boolean;// = false
var myXmlS:String;
protected var collideMaskBits:Number;// = 1
var wasTouched:Boolean;// = false
public static var cantSwimMaskBits:Number = 1;
static var defaultDensity = 0;
public static var waterMyBits:Number = 2;
public static var lastDrag:PhysicsMovie;
public static var mainDensity:Number = 0.02;
public static var waterMaskBits:Number = 3;
static var defaultRestitution = 0.5;
static var defaultFriction = 0.5;
public function PhysicsMovie(){
objInfoParams = ["x", "y", "scaleX", "scaleY", "rotation", "myDensity", "sizeBonus", "typeBonus"];
super();
cacheAsBitmap = true;
myDensity = defaultDensity;
collideMaskBits = waterMaskBits;
}
protected function onKey(_arg1:KeyboardEvent):void{
if (_arg1.charCode == String("d").charCodeAt(0)){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, lastDrag.onKey);
physWorld.deleteObj(this);
};
}
public function setAllMyBitsB2(_arg1:Array, _arg2:Boolean){
var _local3:b2Shape;
for each (_local3 in _arg1) {
setToShapeMyBits(_local3);
if (_arg2){
physWorld.m_world.Refilter(_local3);
};
};
}
public function drawBody(_arg1:b2Body){
var _local2:MovieClip = (this.parent.addChild(new Symbol1Bloon()) as MovieClip);
_local2.scaleX = (_local2.scaleY = 5);
_arg1.m_userData = _local2;
}
public function setObjectInfo(_arg1:XML){
var _local2:String;
var _local3:*;
if (_arg1 != null){
myXmlObj = _arg1;
} else {
_arg1 = myXmlObj;
};
if (_arg1 == null){
return;
};
for each (_local2 in objInfoParams) {
_local3 = _arg1.attribute(_local2)[0];
if (_local3 == null){
} else {
if (!isNaN(Number(_local3))){
_local3 = Number(_local3);
};
this[_local2] = _local3;
};
};
}
override public function beforeDelete(){
this.removeEventListener(Event.ENTER_FRAME, onCanNotSwim);
removeEventListener(MouseEvent.MOUSE_DOWN, drag);
removeEventListener(MouseEvent.MOUSE_UP, drop);
removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function getObjectInfo():XML{
var _local3:String;
var _local4:*;
if (isSwimDown){
return (null);
};
var _local1:String = getQualifiedClassName(this);
var _local2:XML = new XML((("<" + _local1) + "/>"));
for each (_local3 in objInfoParams) {
if (((((this as PhysicsMovieBonus) == null)) && ((((_local3 == "sizeBonus")) || ((_local3 == "typeBonus")))))){
} else {
_local4 = this[_local3];
if ((_local4 is Number)){
_local4 = (Math.round((_local4 * 1000)) / 1000);
};
_local2.attribute(_local3)[0] = _local4;
};
};
return (_local2);
}
protected function removeMovie(){
this.alpha = 0;
this.visible = false;
parent.removeChild(this);
}
public function setToShapeMyBits(_arg1:b2Shape){
_arg1.m_filter.categoryBits = collideMyBits;
_arg1.m_filter.maskBits = collideMaskBits;
}
public function setAllMyBits(_arg1:Boolean){
var _local3:Physics1Shape;
var _local2:Array = [];
for each (_local3 in myShapes) {
_local2.push(_local3.myShape);
};
setAllMyBitsB2(_local2, _arg1);
}
protected function addSplashes(){
}
public function drawJoint(_arg1:b2Joint){
var _local2:MovieClip = (this.parent.addChild(new electrcLine_copy()) as MovieClip);
_arg1.m_userData = _local2;
}
public function createMyObject(){
var _local1:Number;
var _local6:Physics1Shape;
var _local7:b2ShapeDef;
var _local8:b2Vec2;
var _local9:b2CircleDef;
var _local10:b2PolygonDef;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:b2PolygonDef;
var _local15:Number;
var _local16:DisplayObject;
var _local17:b2Vec2;
bodyDef = new b2BodyDef();
bodyDef.userData = this;
bodyDef.position.Set((x / physWorld.myScale), (y / physWorld.myScale));
bodyDef.angle = ((rotation / 180) * Math.PI);
aBody = physWorld.m_world.CreateBody(bodyDef);
var _local2:Number = Math.abs(scaleX);
var _local3:Number = Math.abs(scaleY);
var _local4:Number = Math.round((scaleX / _local2));
var _local5:Number = Math.round((scaleY / _local3));
for each (_local6 in myShapes) {
_local8 = new b2Vec2((((_local6.x * _local2) * _local4) / physWorld.myScale), (((_local6.y * _local3) * _local5) / physWorld.myScale));
if ((_local6 is physCircle)){
_local9 = new b2CircleDef();
_local9.radius = (((_local6.width * _local2) / 2) / physWorld.myScale);
_local9.localPosition = _local8;
_local7 = _local9;
} else {
if ((_local6 is physRect)){
_local1 = _local6.rotation;
_local6.rotation = 0;
_local10 = new b2PolygonDef();
_local11 = (_local6.width * _local2);
_local12 = (_local6.height * _local3);
_local13 = _local1;
if ((((_local4 == -1)) && ((_local5 == -1)))){
} else {
if (_local4 == -1){
_local13 = -(_local13);
} else {
if (_local5 == -1){
_local13 = (180 - _local13);
};
};
};
_local10.SetAsOrientedBox(((_local11 / 2) / physWorld.myScale), ((_local12 / 2) / physWorld.myScale), _local8, ((_local13 * Math.PI) / 180));
_local6.rotation = _local1;
_local7 = _local10;
} else {
if (_local6["p1"] != null){
_local1 = _local6.rotation;
_local6.rotation = 0;
_local14 = new b2PolygonDef();
_local14.vertexCount = 8;
_local15 = 0;
while (true) {
_local16 = (_local6[("p" + (_local15 + 1))] as DisplayObject);
if (_local16 == null){
_local14.vertexCount = _local15;
break;
};
_local17 = new b2Vec2((((_local16.x * _local6.scaleX) * _local2) / physWorld.myScale), (((_local16.y * _local6.scaleY) * _local3) / physWorld.myScale));
_local14.vertices[_local15] = _local17;
_local15++;
};
_local6.rotation = _local1;
_local7 = _local14;
} else {
continue;
};
};
};
_local7.density = (myDensity * mainDensity);
_local7.friction = ((myFriction)!=null) ? myFriction : defaultFriction;
_local7.restitution = ((myRestitution)!=null) ? myRestitution : defaultRestitution;
_local6.myShape = aBody.CreateShape(_local7);
};
aBody.SetMassFromShapes();
setAllMyBits(false);
}
protected function doubleClick(_arg1){
var _local2:PhysicsMovie = physWorld.duplicateObjAndEdit(this);
physWorld.myEditPanel.showProps(_local2);
}
protected function drag(_arg1){
wasTouched = true;
wasDrag = false;
this.startDrag();
addEventListener(MouseEvent.MOUSE_MOVE, onMove);
if (lastDrag){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, lastDrag.onKey);
};
lastDrag = this;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function initMe(_arg1:PhysicsWorld){
physWorld = _arg1;
addMeToWorld();
}
function onCanNotSwim(_arg1:Event){
if (this.alpha > 0){
this.alpha = (this.alpha - 1);
if (!flagAddSplashes){
flagAddSplashes = true;
addSplashes();
};
} else {
removeMovie();
this.removeEventListener(Event.ENTER_FRAME, onCanNotSwim);
};
}
public function swimIfCan():Boolean{
if (!canSwimInWater){
collideMaskBits = cantSwimMaskBits;
setAllMyBits(true);
isSwimDown = true;
this.addEventListener(Event.ENTER_FRAME, onCanNotSwim);
};
return (canSwimInWater);
}
protected function onMove(_arg1:MouseEvent):void{
wasDrag = true;
}
public function makeEditable(){
buttonMode = true;
mouseChildren = false;
mouseEnabled = true;
doubleClickEnabled = true;
addEventListener(MouseEvent.MOUSE_DOWN, drag);
addEventListener(MouseEvent.MOUSE_UP, drop);
addEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
}
protected function drop(_arg1){
this.stopDrag();
removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
physWorld.myEditPanel.showProps(this);
if (!wasDrag){
};
}
private function addMeToWorld(){
if (physWorld.physObjs == null){
physWorld.physObjs = [];
};
physWorld.physObjs.push(this);
}
}
}//package TheGame.MyPhysics
Section 144
//PhysicsMovieBloon (TheGame.MyPhysics.PhysicsMovieBloon)
package TheGame.MyPhysics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
public class PhysicsMovieBloon extends PhysicsMovie {
var pusherBody:b2Body;
var pusherBodyDef:b2BodyDef;
var jointDef:b2PrismaticJointDef;
var myJoint:b2PrismaticJoint;
function createPusher(){
pusherBodyDef = new b2BodyDef();
pusherBodyDef.position.Set(aBody.GetPosition().x, (aBody.GetPosition().y + 2));
pusherBody = physWorld.m_world.CreateBody(pusherBodyDef);
var _local1:b2PolygonDef = new b2PolygonDef();
_local1.SetAsBox(0.01, 0.01);
var _local2:b2Shape = pusherBody.CreateShape(_local1);
_local2.m_filter.categoryBits = 4;
_local2.m_filter.maskBits = 4;
}
override public function createMyObject(){
super.createMyObject();
canSwimInWater = true;
createPusher();
createJoint();
myDensity = 0.5;
}
override public function beforeDelete(){
}
function createJoint(){
var _local1:b2Vec2 = new b2Vec2(0, -1);
jointDef = new b2PrismaticJointDef();
jointDef.Initialize(pusherBody, aBody, pusherBody.GetWorldCenter(), _local1);
jointDef.maxMotorForce = 1;
jointDef.motorSpeed = 0.3;
jointDef.enableMotor = true;
myJoint = (physWorld.m_world.CreateJoint(jointDef) as b2PrismaticJoint);
}
}
}//package TheGame.MyPhysics
Section 145
//PhysicsMovieBonus (TheGame.MyPhysics.PhysicsMovieBonus)
package TheGame.MyPhysics {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.*;
public class PhysicsMovieBonus extends PhysicsMovie {
var boxMC:MovieClip;
var myMC:MovieClip;
var boxTxt:TextField;
var typeBonus:Number;// = 0
var strForType:String;// = "n_"
public var inside_mc:MovieClip;
var sizeBonus:Number;// = 0
public function PhysicsMovieBonus(){
myMC = this.inside_mc;
myMC.addEventListener(Event.ENTER_FRAME, onEnterFrameAppearance);
}
override public function createMyObject(){
super.createMyObject();
}
function addBonus(){
myMC.addEventListener(Event.ENTER_FRAME, onEnterFrameDisappearance);
}
function changeBonus(_arg1:String, _arg2:Number){
sizeBonus = Number(_arg1);
boxTxt.text = _arg1;
typeBonus = _arg2;
boxMC.gotoAndStop((strForType + _arg2.toString()));
}
function onEnterFrameDisappearance(_arg1:Event){
if (myMC.currentFrame <= 1){
myMC.visible = false;
this.aBody.DestroyShape(this.aBody.m_shapeList);
this.physWorld.myKVolts[typeBonus] = (Number(this.physWorld.myKVolts[typeBonus]) + sizeBonus).toString();
Game.currentLevel.counterVolt.updatePopulationTxt();
Game.currentLevel.counterVolt.checkCurrentVolt();
myMC.removeEventListener(Event.ENTER_FRAME, onEnterFrameDisappearance);
} else {
myMC.gotoAndStop((myMC.currentFrame - 1));
};
}
override public function beforeDelete(){
myMC.removeEventListener(Event.ENTER_FRAME, onEnterFrameAppearance);
myMC.removeEventListener(Event.ENTER_FRAME, onEnterFrameDisappearance);
}
function onEnterFrameAppearance(_arg1:Event){
if (myMC.currentFrame >= myMC.totalFrames){
myMC.gotoAndStop(myMC.totalFrames);
myMC.removeEventListener(Event.ENTER_FRAME, onEnterFrameAppearance);
};
if (myMC.currentFrame == 9){
boxMC = myMC.box_mc;
boxTxt = boxMC.box_txt;
boxTxt.text = sizeBonus.toString();
boxMC.gotoAndStop((strForType + typeBonus.toString()));
};
}
}
}//package TheGame.MyPhysics
Section 146
//PhysicsMovieNoContact (TheGame.MyPhysics.PhysicsMovieNoContact)
package TheGame.MyPhysics {
import flash.events.*;
import TheGame.*;
public class PhysicsMovieNoContact extends PhysicsMovie {
var myVolt:Volt;
function fixContact(_arg1:Volt){
myVolt = _arg1;
myVolt.addEventListener(Event.ENTER_FRAME, myVolt.onCanNotSwim);
}
override public function beforeDelete(){
if (myVolt != null){
myVolt.removeEventListener(Event.ENTER_FRAME, myVolt.onCanNotSwim);
};
}
}
}//package TheGame.MyPhysics
Section 147
//PhysicsMovieSpin (TheGame.MyPhysics.PhysicsMovieSpin)
package TheGame.MyPhysics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
public class PhysicsMovieSpin extends PhysicsMovie {
var jointRevDef:b2RevoluteJointDef;
var twisterShape:b2Shape;
var twisterBodyDef:b2BodyDef;
var twisterBody:b2Body;
var jointRev:b2RevoluteJoint;
var twisterShapeDef:b2PolygonDef;
function createRevJoint(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2){
jointRevDef = new b2RevoluteJointDef();
jointRevDef.Initialize(_arg1, _arg2, _arg3);
jointRevDef.enableMotor = true;
jointRevDef.motorSpeed = 1;
jointRevDef.maxMotorTorque = 10;
jointRev = (physWorld.m_world.CreateJoint(jointRevDef) as b2RevoluteJoint);
}
function createTwister(){
twisterBodyDef = new b2BodyDef();
twisterBodyDef.position.Set(aBody.GetPosition().x, aBody.GetPosition().y);
twisterBody = physWorld.m_world.CreateBody(twisterBodyDef);
twisterShapeDef = new b2PolygonDef();
twisterShapeDef.SetAsBox(0.01, 0.01);
twisterShape = twisterBody.CreateShape(twisterShapeDef);
twisterShape.m_filter.categoryBits = 4;
twisterShape.m_filter.maskBits = 4;
}
override public function createMyObject(){
var _local1:Physics1Shape;
super.createMyObject();
this.myDensity = 0.5;
this.aBody.m_shapeList.m_density = this.myDensity;
this.aBody.SetMassFromShapes();
createTwister();
createRevJoint(aBody, twisterBody, aBody.GetWorldCenter());
for each (_local1 in myShapes) {
_local1.myShape.m_filter.categoryBits = 8;
_local1.myShape.m_filter.maskBits = 9;
physWorld.m_world.Refilter(_local1.myShape);
};
}
override public function beforeDelete(){
}
}
}//package TheGame.MyPhysics
Section 148
//PhysicsMovWater (TheGame.MyPhysics.PhysicsMovWater)
package TheGame.MyPhysics {
public class PhysicsMovWater extends PhysicsMovie {
public function PhysicsMovWater(){
myFriction = 1;
myRestitution = 0.8;
collideMyBits = waterMyBits;
}
override public function beforeDelete(){
}
override public function createMyObject(){
super.createMyObject();
}
}
}//package TheGame.MyPhysics
Section 149
//PhysicsWorld (TheGame.MyPhysics.PhysicsWorld)
package TheGame.MyPhysics {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import TheGame.GameTemplate.*;
import flash.utils.*;
import flash.system.*;
public class PhysicsWorld extends Base {
public var m_world:b2World;
public var physObjs:Array;
public var myEditPanel:EditPanel;
public var worldZone:String;
public var objects_mc:Sprite;
public var firstAppVolt:String;
public var myKVolts:Array;
public var levelFon_mc:MovieClip;
public var myScale:Number;// = 32
public function PhysicsWorld(){
levelFon_mc = this["levelFon_mc_"];
levelFon_mc.stop();
objects_mc = new Sprite();
this.addChild(objects_mc);
}
override public function beforeDelete(){
}
public function addObjAndEdit(_arg1:String, _arg2:Number, _arg3:Number):PhysicsMovie{
trace("edit > add");
var _local4:PhysicsMovie = addPhysMovie(null, _arg1);
_local4.makeEditable();
_local4.x = _arg2;
_local4.y = _arg3;
return (_local4);
}
public function getFullLevelText():XML{
var _local4:Number;
var _local5:*;
var _local6:PhysicsMovie;
var _local7:XML;
var _local1:XML = <world/>
;
_local1.@backFrame = levelFon_mc.currentFrame.toString();
_local1.@quality = stage.quality.toString();
_local1.@kVolts = ((((((myEditPanel.simple_txt.text + "_") + myEditPanel.stat_txt.text) + "_") + myEditPanel.scotch_txt.text) + "_") + myEditPanel.swim_txt.text);
_local1.@worldZone = myEditPanel.comboWorld.selectedItem.data;
_local1.@firstVolt = myEditPanel.comboNewVolt.selectedItem.data;
var _local2:Array = [];
if (physObjs != null){
_local4 = 0;
_local5 = 0;
while (_local5 < physObjs.length) {
_local6 = physObjs[_local5];
if ((_local6 as border_level) != null){
} else {
_local7 = _local6.getObjectInfo();
if (_local7 != null){
_local1.children()[_local4] = _local7;
_local4++;
};
};
_local5++;
};
};
var _local3 = "";
_local3 = (_local1.toXMLString() + "\n");
trace(_local3);
System.setClipboard(_local3);
return (_local1);
}
public function swapObjs(_arg1:PhysicsMovie, _arg2:PhysicsMovie){
var _local3:Number = physObjs.indexOf(_arg1);
var _local4:Number = physObjs.indexOf(_arg2);
var _local5:* = physObjs[_local3];
physObjs[_local3] = physObjs[_local4];
physObjs[_local4] = _local5;
}
protected function resetLevelInfo(){
var _local1:PhysicsMovie;
for each (_local1 in physObjs) {
_local1.setObjectInfo(null);
};
}
public function deleteObj(_arg1:PhysicsMovie){
var _local3:PhysicsMovie;
trace("edit > delete");
var _local2:* = 0;
while (_local2 < physObjs.length) {
_local3 = physObjs[_local2];
if (_arg1 == _local3){
_arg1.parent.removeChild(_arg1);
physObjs.splice(_local2, 1);
break;
};
_local2++;
};
}
public function buildLevelData(_arg1:XML){
var _local2:XML = _arg1;
var _local3:String = _local2.@kVolts;
myKVolts = _local3.split("_");
worldZone = _local2.@worldZone;
}
protected function addPhysMovie(_arg1:XML=null, _arg2:String=null):PhysicsMovie{
if (_arg2 == null){
_arg2 = _arg1.name();
};
var _local3:Class = Class(getDefinitionByName(_arg2));
var _local4:PhysicsMovie = new (_local3);
objects_mc.addChild(_local4);
if (_arg1 != null){
_local4.setObjectInfo(_arg1);
};
_local4.initMe(this);
return (_local4);
}
public function getFromMeObjects(){
var _local1:PhysicsMovie;
for each (_local1 in physObjs) {
_local1.createMyObject();
};
}
public function duplicateObjAndEdit(_arg1:PhysicsMovie):PhysicsMovie{
trace("edit > duplicate");
var _local2:PhysicsMovie = addPhysMovie(_arg1.getObjectInfo());
_local2.makeEditable();
return (_local2);
}
public function buildLevel(_arg1:XML){
var _local6:PhysicsMovie;
var _local2:XML = _arg1;
levelFon_mc.gotoAndStop(Number(_local2.@backFrame));
var _local3:String = _local2.@quality;
stage.quality = ((_local3)!=null) ? _local3 : StageQuality.HIGH;
firstAppVolt = _local2.@firstVolt;
if (_local2.@worldZone == "standard"){
_local6 = new border_level();
objects_mc.addChild(_local6);
_local6.initMe(this);
};
var _local4:Number = _local2.children().length();
var _local5:* = 0;
while (_local5 < _local4) {
addPhysMovie(_local2.children()[_local5]);
_local5++;
};
}
protected function makeEditable(){
var _local1:PhysicsMovie;
for each (_local1 in physObjs) {
_local1.makeEditable();
};
}
}
}//package TheGame.MyPhysics
Section 150
//CreditsScreen (TheGame.Screens.CreditsScreen)
package TheGame.Screens {
import flash.display.*;
import flash.events.*;
import TheGame.GameTemplate.*;
public class CreditsScreen extends Screen {
var menu_button:MyBtn;
public var game_border:MovieClip;
public var menu_btn:myBtnBig;
public function CreditsScreen(){
menu_button = menu_btn;
menu_button.addEventListener(MouseEvent.CLICK, onClickMenu);
}
override public function beforeDelete(){
myGame.gameBorder.visible = true;
menu_button.removeEventListener(MouseEvent.CLICK, onClickMenu);
}
override public function afterCreate(){
myGame.gameBorder.visible = false;
}
}
}//package TheGame.Screens
Section 151
//Level (TheGame.Screens.Level)
package TheGame.Screens {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.*;
import TheGame.GameTemplate.*;
import flash.utils.*;
import com.midasplayer.*;
import flash.ui.*;
public class Level extends Screen {
public var again_btn_:myBtnBig;
public var walkthrough_btn_:myBtnBig;
public var exit_btn_:myBtnBig;
var next_btn:MyBtn;
public var connect_mc:MovieClip;
public var myNumber:Number;
public var connect_txt:TextField;
public var counterVolt:VoltModeBtn;
public var workZone_mc_:workZone;
public var counter_time:counter_timer;
public var modeGame:String;
public var workZone_mc:WorkZone;
var exit_btn:MyBtn;
public var next_btn_:myBtnBig;
public var button_pause_:button_pause;
public var winEnd:PopupWindow;
public var winEnd_:windowInGame;
public var counter_volt:voltMode;
var walk_btn:MyBtn;
public var counterTime:CounterTimer;
public var more_games_btn_:myBtnBig;
var pauseTimer:Timer;
public var buttonPause:PauseBtn;
var more_games_btn:MyBtn;
var again_btn:MyBtn;
public static const MODE_LEVEL:String = "level";
public static const MODE_TOWER:String = "tower";
public function Level(){
workZone_mc = workZone_mc_;
connect_txt = connect_mc.connect_txt_;
winEnd = winEnd_;
again_btn = again_btn_;
exit_btn = exit_btn_;
next_btn = next_btn_;
walk_btn = walkthrough_btn_;
more_games_btn = more_games_btn_;
again_btn.addEventListener(MouseEvent.CLICK, goGameAgain);
exit_btn.addEventListener(MouseEvent.CLICK, goExit);
walk_btn.addEventListener(MouseEvent.CLICK, goWalk);
more_games_btn.addEventListener(MouseEvent.CLICK, goMoreGames);
next_btn.visible = (more_games_btn.visible = false);
more_games_btn.x = walk_btn.x;
more_games_btn.y = walk_btn.y;
buttonPause = button_pause_;
buttonPause.initStop(this);
connect_txt.text = "";
modeGame = MODE_LEVEL;
counterVolt = counter_volt;
counterTime = counter_time;
}
public function onClickNext(_arg1:Event){
myGame.goToGame(MODE_LEVEL, (myNumber + 1), true);
}
override public function beforeDelete(){
myGame.lastStateVoltModeBtn = counterVolt.currentVolt;
myGame.gameBorder.visible = true;
workZone_mc.beforeDelete();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDownSpace);
again_btn.removeEventListener(MouseEvent.CLICK, goGameAgain);
exit_btn.removeEventListener(MouseEvent.CLICK, goExit);
walk_btn.removeEventListener(MouseEvent.CLICK, goWalk);
more_games_btn.removeEventListener(MouseEvent.CLICK, goMoreGames);
if (pauseTimer != null){
pauseTimer.stop();
pauseTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onPauseTimer);
} else {
if (myGame.catcher){
myGame.catcher.end();
};
};
}
public function goGameAgain(_arg1:MouseEvent){
forGoGameAgain();
}
function onKeyDownSpace(_arg1:KeyboardEvent){
if ((((((_arg1.keyCode == Keyboard.SPACE)) || ((_arg1.charCode == String("r").charCodeAt(0))))) || ((_arg1.charCode == String("R").charCodeAt(0))))){
forGoGameAgain();
};
}
public function forGoGameAgain(){
if (modeGame == MODE_LEVEL){
myGame.goToGame(modeGame, myNumber);
} else {
myGame.goToGame(modeGame);
};
}
private function goExit(_arg1:MouseEvent):void{
buttonPause.removeStop();
trace(("myGame.myGameOver " + myGame.myGameOver));
if (((myGame.myGameOver) && ((myGame.scoreGame > myGame.lastSubmitRecord)))){
myGame.goAtFrame(Game.FRAME_SUBMIT);
} else {
myGame.goAtFrame(Game.FRAME_SELECT_GAME);
};
}
function onPauseTimer(_arg1:Event){
myGame.catcher.end();
myGame.goAtFrame(Game.FRAME_SELECT_GAME);
}
private function goSubmit(_arg1:MouseEvent){
myGame.goAtFrame(Game.FRAME_SUBMIT);
}
public function showVoltModes(_arg1:Array){
counterVolt.init(_arg1, this, 0);
}
public function goWalk(_arg1:Event){
Game.openPage(Game.LINK_WALKTHROUGH);
}
public function levelFailed(_arg1:String){
workZone_mc.transferAllVoltInState(Volt.STATE_SAD);
winEnd.showMessage(this, _arg1, "", false);
counterTime.stopWork();
workZone_mc.mouseVoltFalse();
}
public function levelSuccess(){
if (myGame.flagWalk){
pauseTimer = new Timer(500, 1);
pauseTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onPauseTimer);
pauseTimer.start();
return;
};
workZone_mc.transferAllVoltInState(Volt.STATE_GLAD);
workZone_mc.mouseVoltFalse();
var _local1:Number = counterTime.stopWork();
var _local2:Number = (counterVolt.endLevelVolt() * 100);
myGame.scoreGame = (_local2 + _local1);
myGame.openOneLevel((myNumber + 1));
winEnd.showMessage(this, "Level done! ", ((((("Time score - " + _local1) + "\nUnused volts score - ") + _local2) + "\nTotal game score - ") + myGame.scoreGame.toString()), true);
trace(("KING " + (myNumber + 1)));
if (KingAPI.isHome){
KingAPI.submitLevel((myNumber + 1));
};
}
override public function afterCreate(){
Game.currentLevel = this;
myGame.gameBorder.visible = false;
workZone_mc.initLevel(this);
connect_txt.text = ("LEVEL " + (myNumber + 1).toString());
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownSpace);
myGame.addWalkthrough();
}
public function goMoreGames(_arg1:Event){
Game.openPage(Game.LINK_MORE_GAMES);
}
}
}//package TheGame.Screens
Section 152
//MenuScreen (TheGame.Screens.MenuScreen)
package TheGame.Screens {
import flash.events.*;
import TheGame.*;
import TheGame.GameTemplate.*;
public class MenuScreen extends Screen {
public var play_on_f_btn_:myBtnBigcopy;
var play_on_f_btn:MyBtn;
public var pointer_mc_:pointer_for_menu_button;
var pointer_mc:PointerMenuBtn;
public function MenuScreen(){
play_on_f_btn = play_on_f_btn_;
play_on_f_btn.addEventListener(MouseEvent.CLICK, onPlayF);
}
override public function beforeDelete(){
}
function onPlayF(_arg1:Event){
Game.openPage(Game.LINK_PLAY_VOLT_CONNECT_FACEBOOK);
}
override public function afterCreate(){
pointer_mc = pointer_mc_;
pointer_mc.afterCreatePointer(myGame);
}
}
}//package TheGame.Screens
Section 153
//Screen (TheGame.Screens.Screen)
package TheGame.Screens {
import flash.events.*;
import TheGame.*;
import TheGame.GameTemplate.*;
public class Screen extends ScreenBase {
function onClickMenu(_arg1:Event){
myGame.goAtFrame(Game.FRAME_MENU);
}
public function set myGame(_arg1:Game){
myGame_ = _arg1;
}
public function get myGame():Game{
return ((myGame_ as Game));
}
}
}//package TheGame.Screens
Section 154
//SelectGame (TheGame.Screens.SelectGame)
package TheGame.Screens {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.*;
import TheGame.GameTemplate.*;
public class SelectGame extends Screen {
public var mode_evolution_:MovieClip;
var menu_button:MyBtn;
public var score_txt:TextField;
public var scoreTxt:TextField;
public var game_border:MovieClip;
var mode_high_btn:MovieClip;
public var menu_btn:myBtnBig;
var mode_evolution:MovieClip;
public function SelectGame(){
mode_evolution = mode_evolution_;
menu_button = menu_btn;
menu_button.addEventListener(MouseEvent.CLICK, onClickMenu);
scoreTxt = score_txt;
stop();
}
override public function beforeDelete(){
myGame.gameBorder.visible = true;
var _local1:* = 0;
while (_local1 < LevelsInfo.kLevels) {
if (myGame.openLevel[_local1] == 1){
(mode_evolution[("lev" + (_local1 + 1))] as ButtonLevel).beforeDeleteButtonLevel();
};
_local1++;
};
menu_button.removeEventListener(MouseEvent.CLICK, onClickMenu);
}
private function clickHighMode(_arg1:MouseEvent):void{
myGame.goToGame(Level.MODE_TOWER);
}
override public function afterCreate(){
myGame.gameBorder.visible = false;
scoreTxt.text = ("TOTAL SCORE\n" + myGame.scoreGame);
if (myGame.openLevel[0] == 0){
myGame.openOneLevel(0);
};
trace(("open " + myGame.openLevel));
gotoAndStop(myGame.findLastLevel());
var _local1:* = 0;
while (_local1 < LevelsInfo.kLevels) {
(mode_evolution[("lev" + (_local1 + 1))] as ButtonLevel).initButton(this, _local1, myGame.openLevel[_local1]);
_local1++;
};
}
}
}//package TheGame.Screens
Section 155
//Submit (TheGame.Screens.Submit)
package TheGame.Screens {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.*;
import TheGame.GameTemplate.*;
public class Submit extends Screen {
var map_btn:MyBtn;
public var score_txt:TextField;
var submit_btn:MyBtn;
public var map_btn_:myBtnBig;
public var submit_btn_:myBtnBig;
public var game_border:MovieClip;
public var menu_btn_:myBtnBig;
var menu_btn:MyBtn;
var scoreTxt:TextField;
public function Submit(){
menu_btn = menu_btn_;
submit_btn = submit_btn_;
map_btn = map_btn_;
menu_btn.addEventListener(MouseEvent.CLICK, goMenu);
submit_btn.addEventListener(MouseEvent.CLICK, onClickSubmit);
map_btn.addEventListener(MouseEvent.CLICK, onClickMap);
scoreTxt = score_txt;
}
override public function beforeDelete(){
myGame.gameBorder.visible = true;
menu_btn.removeEventListener(MouseEvent.CLICK, goMenu);
submit_btn.removeEventListener(MouseEvent.CLICK, onClickSubmit);
map_btn.removeEventListener(MouseEvent.CLICK, onClickMap);
}
function goMenu(_arg1:Event){
myGame.submitNewRecord(false);
myGame.goAtFrame(Game.FRAME_MENU);
}
function onClickSubmit(_arg1:Event){
myGame.submitNewRecord(true);
myGame.goAtFrame(Game.FRAME_MENU);
}
function onClickMap(_arg1:Event){
myGame.submitNewRecord(false);
myGame.goAtFrame(Game.FRAME_SELECT_GAME);
}
override public function afterCreate(){
myGame.gameBorder.visible = false;
scoreTxt.text = myGame.scoreGame.toString();
}
}
}//package TheGame.Screens
Section 156
//AnimForButtonLevel (TheGame.AnimForButtonLevel)
package TheGame {
import TheGame.GameTemplate.*;
public class AnimForButtonLevel extends Base {
public function AnimForButtonLevel(){
this.gotoAndPlay(MyFunc.random(this.totalFrames));
}
override public function beforeDelete(){
}
}
}//package TheGame
Section 157
//ButtonFunflow (TheGame.ButtonFunflow)
package TheGame {
import flash.events.*;
import TheGame.GameTemplate.*;
public class ButtonFunflow extends Base {
public var myPointer:PointerMenuBtn;
var text:String;// = "funflow"
public function ButtonFunflow(){
gotoAndStop("out");
addEventListener(MouseEvent.CLICK, onClickFunflow);
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
}
function onRollOver(_arg1:Event){
gotoAndStop("over");
if (myPointer != null){
myPointer.gotoAndStop((myPointer.findMyIndex(this) + 2));
};
}
function onClickFunflow(_arg1:Event){
Game.openPage(Game.LINK_FUNFLOW_LOGO);
}
override public function afterCreate(){
}
override public function beforeDelete(){
removeEventListener(MouseEvent.CLICK, onClickFunflow);
removeEventListener(MouseEvent.ROLL_OVER, onRollOver);
removeEventListener(MouseEvent.ROLL_OUT, onRollOut);
}
public function get Text():String{
return (text);
}
function onRollOut(_arg1:Event){
gotoAndStop("out");
if (myPointer != null){
myPointer.gotoAndStop(0);
};
}
}
}//package TheGame
Section 158
//ButtonLevel (TheGame.ButtonLevel)
package TheGame {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.Screens.*;
import TheGame.GameTemplate.*;
public class ButtonLevel extends Base {
public var for_event_:MovieClip;
var myScreen:SelectGame;
var forEvent:MovieClip;
var openFlag:Boolean;// = false
public var x_txt_:TextField;
public var x_txt:TextField;
public var myLevel:Number;
var oldText:String;// = ""
var startY:Number;
public function ButtonLevel(){
stop();
x_txt = x_txt_;
startY = x_txt.y;
forEvent = for_event_;
}
function changeFormatTxt(_arg1:String){
if (_arg1 == "over_level"){
x_txt.textColor = 0xFF9900;
x_txt.y = (startY + 3);
x_txt.scaleX = (x_txt.scaleY = 1.1);
} else {
x_txt.y = startY;
x_txt.scaleX = (x_txt.scaleY = 1);
x_txt.textColor = ((_arg1)=="open_level") ? 12190138 : 12476677;
};
}
public function beforeDeleteButtonLevel(){
forEvent.removeEventListener(MouseEvent.CLICK, clickOneLevel);
forEvent.removeEventListener(MouseEvent.ROLL_OVER, onRollOverLevel);
forEvent.removeEventListener(MouseEvent.ROLL_OUT, onRollOutLevel);
}
override public function beforeDelete(){
forEvent.removeEventListener(MouseEvent.CLICK, clickOneLevel);
forEvent.removeEventListener(MouseEvent.ROLL_OVER, onRollOverLevel);
forEvent.removeEventListener(MouseEvent.ROLL_OUT, onRollOutLevel);
}
function clickOneLevel(_arg1:MouseEvent){
myScreen.myGame.goToGame(Level.MODE_LEVEL, myLevel);
}
public function initButton(_arg1:SelectGame, _arg2:Number, _arg3:Number){
myScreen = _arg1;
myLevel = _arg2;
openFlag = ((_arg3)==1) ? true : false;
x_txt.text = (myLevel + 1).toString();
if (openFlag){
buttonMode = true;
forEvent.addEventListener(MouseEvent.CLICK, clickOneLevel);
forEvent.addEventListener(MouseEvent.ROLL_OVER, onRollOverLevel);
forEvent.addEventListener(MouseEvent.ROLL_OUT, onRollOutLevel);
} else {
gotoAndStop("close_level");
changeFormatTxt("close_level");
};
}
function onRollOutLevel(_arg1:Event){
gotoAndStop("open_level");
changeFormatTxt("open_level");
if (oldText != ""){
myScreen.scoreTxt.text = oldText;
oldText = "";
};
}
function onRollOverLevel(_arg1:Event){
gotoAndStop("over_level");
changeFormatTxt("over_level");
oldText = myScreen.scoreTxt.text;
myScreen.scoreTxt.text = ("LEVEL SCORE\n" + myScreen.myGame.scoreForLevel[myLevel]);
}
}
}//package TheGame
Section 159
//CounterTimer (TheGame.CounterTimer)
package TheGame {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import TheGame.GameTemplate.*;
public class CounterTimer extends Base {
var myTxt:TextField;
var saveCalcSecond:Number;// = -1
var clock_mc:MovieClip;
var calcSecond:Number;
var startValue:Number;// = 200
var _currentValue:Number;
public var clock_mc_:MovieClip;
public var my_txt:TextField;
public function CounterTimer(){
myTxt = my_txt;
clock_mc = clock_mc_;
currentValue = startValue;
}
function onEnterFrameMy(_arg1:Event){
if (calcSecond < 23){
calcSecond = (calcSecond + 1);
} else {
calcSecond = 0;
if (currentValue > 0){
currentValue = (currentValue - 1);
} else {
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameMy);
};
};
};
}
function startWork(){
calcSecond = ((saveCalcSecond)!=-1) ? saveCalcSecond : 0;
saveCalcSecond = -1;
this.addEventListener(Event.ENTER_FRAME, onEnterFrameMy);
clock_mc.play();
}
public function set currentValue(_arg1:Number):void{
_currentValue = _arg1;
myTxt.text = _arg1.toString();
}
override public function beforeDelete(){
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameMy);
}
public function stopWork():Number{
calcSecond = 0;
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameMy);
};
clock_mc.stop();
return (currentValue);
}
public function pauseWork(){
saveCalcSecond = calcSecond;
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameMy);
};
clock_mc.stop();
}
public function get currentValue():Number{
return (_currentValue);
}
}
}//package TheGame
Section 160
//FirstAppearanceVolt (TheGame.FirstAppearanceVolt)
package TheGame {
import flash.display.*;
import flash.events.*;
import TheGame.Screens.*;
import TheGame.GameTemplate.*;
public class FirstAppearanceVolt extends Base {
var myFrame:String;
public var inside_mc_:MovieClip;
public var next_btn:myBtnBig;
var myLevel:Level;
var inside_mc:MovieClip;
var next_button:MyBtn;
function onClickNext(_arg1:Event){
visible = false;
myLevel.counterTime.startWork();
myLevel.removeChild(this);
}
function initMe(_arg1:Level, _arg2:String){
myLevel = _arg1;
myFrame = (_arg2 + "_frame");
next_button = next_btn;
next_button.addEventListener(MouseEvent.CLICK, onClickNext);
inside_mc = inside_mc_;
inside_mc.gotoAndStop(myFrame);
myLevel.counterTime.pauseWork();
}
override public function beforeDelete(){
next_button.removeEventListener(MouseEvent.CLICK, onClickNext);
}
}
}//package TheGame
Section 161
//Game (TheGame.Game)
package TheGame {
import flash.display.*;
import flash.events.*;
import TheGame.MyPhysics.*;
import com.touchmypixel.peepee.utils.*;
import flash.text.*;
import TheGame.Screens.*;
import TheGame.GameTemplate.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import com.midasplayer.*;
import flash.ui.*;
public class Game extends GameBase {
var _flagSoundOn:Boolean;
var arrayGoodMusic:Array;
var musics_menu:Array;
public var game_border:MovieClip;
public var mouseMc:MovieClip;
var _lastSubmitRecord:Number;// = 0
var musics_game:Array;
private var _scoreGame:Number;// = 0
public var catcher:MouseCatcher;
public var caption_mc_:MovieClip;
var clipMouse:MovieClip;
public var cap_txt_:TextField;
public var gameBorder:MovieClip;
var _lastStateVoltModeBtn:Number;
var last_music:String;// = ""
public var screens_mc_:MovieClip;
public var flagWalk:Boolean;// = false
public var mainSound:SoundFabric;
var _myGameOver:Boolean;
var _openLevel:Array;
public var button_sound_:button_for_sound;
public var editPanel_mc:EditPanel;
var _flagFirstAppVolt:Array;
public var copyright_txt_:TextField;
var lastInd:Number;
public var isWrite:Boolean;// = false
var _scoreForLevel:Array;
public var mouse_mc:MovieClip;
public var musicVol:Number;// = 0.9
var buttonSound:ButtonSoundOnOff;
public static const LINK_FUNFLOW_LOGO:String = "http://apps.facebook.com/funflow/games/?ref=volt-connect_funflow";
public static const FRAME_SUBMIT:String = "submit";
public static const LINK_DOWNLOAD_GAME:String = "http://apps.facebook.com/funflow/download.jsp?ref=volt-connect";
public static const FRAME_CREDITS:String = "credits";
public static const FRAME_MENU:String = "menu";
public static const LINK_MORE_GAMES:String = "http://apps.facebook.com/funflow/games/?ref=volt-connect";
public static const LINK_BETWEEN_LEVEL:String = "http://www.facebook.com/sharer.php?u=http%3A%2F%2Ffacebook.king.com%2Ffacebook%2Fkinggames%2Fgames%2Fshare.jsp%3FgameId%3D75";
public static const FRAME_SELECT_GAME:String = "select_game";
public static const FRAME_GAME:String = "game";
public static const LINK_PLAY_VOLT_CONNECT_FACEBOOK:String = "http://apps.facebook.com/funflow/games/?gameId=75&ref=volt-connect";
public static const LINK_WALKTHROUGH:String = "http://apps.facebook.com/funflow/games/?gameId=75&ref=volt-connect_solutions&solutions=1";
public static var stringForNoContact:String = "I'm killed...";
public static var currentLevel:Level;
public static var iAmGame:Game;
public static var voltAnimationCache:AnimationCache;
public static var stringForWater:String = "I can't swim!";
public function Game(){
var _local4:String;
musics_game = ["loop01", "loop02", "loop03", "loop05"];
musics_menu = ["Breathless"];
arrayGoodMusic = [[0, 1], [0, 1, 2, 3], [0, 1, 2, 3], [0, 3]];
GameBase.projectName = "VoltConnect";
super();
copyright_txt = copyright_txt_;
cap_txt = cap_txt_;
caption_mc = caption_mc_;
screens_mc = screens_mc_;
gameBorder = game_border;
buttonSound = button_sound_;
mouseMc = mouse_mc;
editPanel_mc = new editPanel();
editPanel_mc.initMe([pBall, pBall2, pBallSpin, pBallSpin2, pBloon1, pBloon2, pBoard, pBoard2, pBonusBox, pBox1, pBox2, pBox3, pCane1, pCane2, pCane3, pNoContact, pNoContactLittle, pNoContactBig, pEgg, pGround1, pOval, pOval2, pPlank, pPlatform1, pPlatform2, pPlatform3, pPuddle, pStone, pWater, volt1, volt2, volt3, volt4]);
editPanel_mc.visible = false;
addChild(editPanel_mc);
voltAnimationCache = AnimationCache.getInstance();
voltAnimationCache.replaceExisting = true;
var _local1:Array = ["glad", "sad", "usual"];
var _local2:* = 0;
while (_local2 < 4) {
for each (_local4 in _local1) {
voltAnimationCache.cacheAnimation(Volt.getLibraryName(_local2, _local4));
};
_local2++;
};
voltAnimationCache.cacheAnimation("electric_line_in");
var _local3:Number = Volt.minD;
while (_local3 <= Volt.maxD) {
voltAnimationCache.cacheAnimation(("electric_line_in_" + String(_local3)));
_local3 = (_local3 + Volt.jointStepX);
};
goAtFrame(Game.FRAME_MENU);
_scoreForLevel = saver.getData("scoreLevel", initArray());
_lastSubmitRecord = saver.getData("lastSubmitRec", 0);
_scoreGame = summArray(_scoreForLevel);
_openLevel = saver.getData("openLevelInGame", initArray());
_flagSoundOn = saver.getData("flagSoundOnOff", true);
_myGameOver = saver.getData("myGameOv", false);
_flagFirstAppVolt = saver.getData("flFirstAppVolt", []);
_lastStateVoltModeBtn = saver.getData("lastStateVoltMode", 0);
if (flagWalk){
_openLevel = initArray(1);
};
randomNextMusic(null);
buttonSound.initButton(this);
useSpecialMouseClip(true);
iAmGame = this;
}
private function onAdditionalEvent(_arg1:EventMousePlay):void{
if (_arg1.name == "click"){
currentLevel.workZone_mc.mouseClick(null);
};
if (_arg1.name == "count_volt"){
currentLevel.counterVolt.onSelect(null);
};
if (_arg1.name == "stripe_up_over"){
currentLevel.workZone_mc.forOnStripeOver(currentLevel.workZone_mc.stripe_up);
};
if (_arg1.name == "stripe_down_over"){
currentLevel.workZone_mc.forOnStripeOver(currentLevel.workZone_mc.stripe_down);
};
if (_arg1.name == "stripe_up_out"){
currentLevel.workZone_mc.forOnStripeOut(currentLevel.workZone_mc.stripe_up);
};
if (_arg1.name == "stripe_down_out"){
currentLevel.workZone_mc.forOnStripeOut(currentLevel.workZone_mc.stripe_down);
};
}
public function findLastLevel():Number{
var _local1:* = 0;
while (_local1 < _openLevel.length) {
if (_openLevel[_local1] == 0){
return (_local1);
};
_local1++;
};
return (_openLevel.length);
}
public function set flagSoundOn(_arg1:Boolean):void{
_flagSoundOn = _arg1;
saver.setData("flagSoundOnOff", _flagSoundOn);
}
public function get flagFirstAppVolt():Array{
return (_flagFirstAppVolt);
}
public function useSpecialMouseClip(_arg1:Boolean){
if (_arg1){
mouseMc.startDrag(true);
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveMouse);
stage.addEventListener(MouseEvent.CLICK, showMyMouse);
Mouse.hide();
} else {
mouseMc.stopDrag();
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveMouse);
stage.removeEventListener(MouseEvent.CLICK, showMyMouse);
Mouse.show();
};
mouseMc.mouseEnabled = false;
}
public function set flagFirstAppVolt(_arg1:Array):void{
_flagFirstAppVolt = _arg1;
saver.setData("flFirstAppVolt", _flagFirstAppVolt);
}
public function setRandomMusic(_arg1:Array, _arg2:Boolean=false){
var _local3:Number;
var _local4:String;
if (((!((_arg1 == null))) && ((_arg1.length > 0)))){
do {
_local3 = MyFunc.random(_arg1.length);
_local4 = _arg1[_local3];
} while ((((_local4 == last_music)) && (_arg2)));
if (_local4 != last_music){
if (mainSound != null){
mainSound.stop();
};
mainSound = new SoundFabric(_local4, 0, 1000000, ((flagSoundOn) ? 1 : 0 * musicVol));
last_music = _local4;
};
} else {
if (mainSound != null){
mainSound.stop();
mainSound = null;
last_music = null;
};
};
}
override public function beforeDelete(){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveMouse);
stage.removeEventListener(MouseEvent.CLICK, showMyMouse);
mainSound.sChannel.removeEventListener(Event.SOUND_COMPLETE, randomNextMusic);
}
public function goToGame(_arg1:String, _arg2:Number=0, _arg3:Boolean=false){
var _local4:Level = new level();
_local4.modeGame = _arg1;
_local4.myNumber = _arg2;
goFrame(_local4);
stage.focus = stage;
}
public function get lastStateVoltModeBtn():Number{
return (_lastStateVoltModeBtn);
}
private function showMyMouse(_arg1:MouseEvent):void{
Mouse.hide();
}
public function get scoreGame():Number{
return (_scoreGame);
}
public function openOneLevel(_arg1:Number){
_openLevel[_arg1] = 1;
openLevel = _openLevel;
}
public function set openLevel(_arg1:Array):void{
_openLevel = _arg1;
saver.setData("openLevelInGame", _openLevel);
}
public function captureOut(_arg1){
if (!isWrite){
return;
};
if (currentLevel.workZone_mc.stripe_up == _arg1){
catcher.captureAdditional(<stripe_up_out/>
);
};
if (currentLevel.workZone_mc.stripe_down == _arg1){
catcher.captureAdditional(<stripe_down_out/>
);
};
}
function initArray(_arg1:Number=0):Array{
var _local2:Array = [];
var _local3:* = 0;
while (_local3 < LevelsInfo.kLevels) {
_local2[_local3] = _arg1;
_local3++;
};
return (_local2);
}
public function get myGameOver():Boolean{
return (_myGameOver);
}
public function playSound(_arg1:String, _arg2:Number=1){
var _local3:Number = (Game.iAmGame.flagSoundOn) ? _arg2 : 0;
new SoundFabric(_arg1, 0, 1, _local3);
}
public function get lastSubmitRecord():Number{
return (_lastSubmitRecord);
}
public function get flagSoundOn():Boolean{
return (_flagSoundOn);
}
public function set scoreGame(_arg1:Number):void{
trace(("scoreForLevel " + scoreForLevel));
if (scoreForLevel[currentLevel.myNumber] < _arg1){
_scoreGame = 0;
scoreForLevel[currentLevel.myNumber] = _arg1;
_scoreGame = summArray(scoreForLevel);
};
}
public function set lastStateVoltModeBtn(_arg1:Number):void{
_lastStateVoltModeBtn = _arg1;
saver.setData("lastStateVoltMode", _lastStateVoltModeBtn);
}
public function submitNewRecord(_arg1:Boolean){
lastSubmitRecord = scoreGame;
trace(("lastSubmitRecord " + lastSubmitRecord));
if (_arg1){
KingAPI.submitScore(lastSubmitRecord);
};
}
public function set scoreForLevel(_arg1:Array):void{
_scoreForLevel = _arg1;
saver.setData("scoreLevel", _scoreForLevel);
}
public function get openLevel():Array{
return (_openLevel);
}
public function set myGameOver(_arg1:Boolean):void{
_myGameOver = _arg1;
saver.setData("myGameOv", _myGameOver);
}
function moveMouse(_arg1:MouseEvent){
mouseMc.x = mouseX;
mouseMc.y = mouseY;
_arg1.updateAfterEvent();
}
public function captureClick(_arg1:Boolean=true){
if (catcher){
if (!_arg1){
catcher.captureAdditional(<count_volt/>
);
} else {
catcher.captureAdditional(<click/>
);
};
};
}
public function goAtFrame(_arg1:String){
mouseMc.gotoAndStop(5);
switch (_arg1){
case Game.FRAME_MENU:
goFrame(new menu_screen_clip());
break;
case Game.FRAME_CREDITS:
goFrame(new credits_screen_clip());
break;
case Game.FRAME_SUBMIT:
goFrame(new screenSubmit());
break;
case Game.FRAME_SELECT_GAME:
goFrame(new screenSelectGame(), "");
break;
};
}
public function captureOver(_arg1){
if (!isWrite){
return;
};
if (currentLevel.workZone_mc.stripe_up == _arg1){
catcher.captureAdditional(<stripe_up_over/>
);
};
if (currentLevel.workZone_mc.stripe_down == _arg1){
catcher.captureAdditional(<stripe_down_over/>
);
};
}
public function get scoreForLevel():Array{
return (_scoreForLevel);
}
function randomNextMusic(_arg1:Event){
var _local2:Number;
if (mainSound != null){
mainSound.sChannel.removeEventListener(Event.SOUND_COMPLETE, randomNextMusic);
_local2 = arrayGoodMusic[lastInd][MyFunc.random(arrayGoodMusic[lastInd].length)];
} else {
_local2 = 2;
};
lastInd = _local2;
mainSound = new SoundFabric(musics_game[_local2], 0, 1, ((flagSoundOn) ? 1 : 0 * musicVol));
mainSound.sChannel.addEventListener(Event.SOUND_COMPLETE, randomNextMusic);
}
function summArray(_arg1:Array):Number{
var _local2:Number = 0;
var _local3:* = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + _arg1[_local3]);
_local3++;
};
return (_local2);
}
private function onClickBtn(_arg1:MouseEvent):void{
catcher.end();
}
public function addWalkthrough(){
if (!flagWalk){
return;
};
if (!isWrite){
clipMouse = mouseMc;
clipMouse.stop();
};
if (catcher){
catcher.removeEventListener(MouseCatcher.EVENT_ADDITIONAL, onAdditionalEvent);
};
catcher = new MouseCatcher();
addChild(catcher);
catcher.clipMouse = clipMouse;
catcher.begin(isWrite, (isWrite) ? null : WalkInfo.walkInfo[currentLevel.myNumber]);
if (!isWrite){
catcher.addEventListener(MouseCatcher.EVENT_ADDITIONAL, onAdditionalEvent);
};
}
public function set lastSubmitRecord(_arg1:Number):void{
_lastSubmitRecord = _arg1;
saver.setData("lastSubmitRec", _lastSubmitRecord);
}
public static function openPage(_arg1:String){
var _local2:URLVariables = new URLVariables();
var _local3 = "_blank";
navigateToURL(new URLRequest(_arg1), _local3);
}
}
}//package TheGame
Section 162
//HelpText (TheGame.HelpText)
package TheGame {
import flash.events.*;
import TheGame.GameTemplate.*;
public class HelpText extends Base {
var flagDecrease:Boolean;// = true
public function HelpText(){
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHelp);
}
override public function beforeDelete(){
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameHelp);
}
function onEnterFrameHelp(_arg1:Event){
if (flagDecrease){
alpha = (alpha - 0.1);
if (alpha <= 0){
flagDecrease = false;
};
} else {
alpha = (alpha + 0.1);
if (alpha >= 1){
alpha = 1;
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameHelp);
};
};
}
}
}//package TheGame
Section 163
//LevelsInfo (TheGame.LevelsInfo)
package TheGame {
public class LevelsInfo {
public static var levelInfo:Array = [<world backFrame="9" quality="HIGH" kVolts="3_0_0_0" worldZone="standard" firstVolt="usual">
<volt1 x="221" y="357"/>
<volt1 x="452" y="359"/>
<pCane3 x="27" y="244" scaleX="1" scaleY="1" rotation="125" myDensity="0"/>
<pBloon1 x="558" y="245" scaleX="1" scaleY="1" rotation="-30" myDensity="0"/>
<pBloon2 x="600" y="213" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBox2 x="26" y="352" scaleX="0.6" scaleY="1" rotation="30" myDensity="0"/>
<pBox2 x="616" y="343" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pOval2 x="76" y="377" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<pGround1 x="310" y="431" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="198" y="431" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="13" quality="HIGH" kVolts="4_0_0_0" worldZone="standard" firstVolt="null">
<volt1 x="342" y="322"/>
<volt1 x="369" y="128"/>
<pEgg x="352" y="253" scaleX="0.6" scaleY="0.6" rotation="-110" myDensity="0"/>
<pEgg x="362" y="267" scaleX="0.6" scaleY="0.6" rotation="-140" myDensity="0"/>
<pPlatform1 x="368" y="241" scaleX="1" scaleY="1.1" rotation="0" myDensity="0"/>
<pPlatform2 x="325" y="433" scaleX="1.2" scaleY="1" rotation="0" myDensity="0"/>
<pCane2 x="85" y="271" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBox3 x="51" y="413" scaleX="1" scaleY="1" rotation="10" myDensity="0"/>
<pCane1 x="567" y="289" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="324" y="441" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="10" quality="HIGH" kVolts="3_1_0_0" worldZone="standard" firstVolt="flying">
<volt1 x="218" y="375"/>
<volt1 x="101" y="246"/>
<pStone x="199" y="416" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pPlank x="11" y="246" scaleX="1" scaleY="1" rotation="-80" myDensity="0"/>
<pOval2 x="11" y="359" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBoard x="52" y="277" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBoard2 x="49" y="131" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBox1 x="16" y="94" scaleX="1" scaleY="1" rotation="5" myDensity="0"/>
<pStone x="172" y="414" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="238" y="416" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="276" y="409" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="390" y="219" scaleX="1" scaleY="1" rotation="10" myDensity="0"/>
<pStone x="383" y="249" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="367" y="279" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="402" y="289" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="428" y="220" scaleX="1" scaleY="1" rotation="10" myDensity="0"/>
<pStone x="422" y="251" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<volt1 x="391" y="182"/>
<pStone x="440" y="281" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBox2 x="621" y="303" scaleX="0.6" scaleY="1" rotation="10" myDensity="0"/>
<pBox3 x="621" y="390" scaleX="1" scaleY="1" rotation="-10" myDensity="0"/>
<pWater x="325" y="445" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBoard2 x="405" y="316" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="14" quality="HIGH" kVolts="1_2_0_0" worldZone="standard" firstVolt="null">
<volt1 x="93" y="339"/>
<volt1 x="524" y="358"/>
<pBox2 x="155" y="397" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<pBox3 x="108" y="419" scaleX="1" scaleY="1" rotation="5" myDensity="0"/>
<pBox1 x="156" y="431" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBox2 x="211" y="432" scaleX="1" scaleY="1" rotation="6" myDensity="0"/>
<pBloon1 x="97" y="277" scaleX="1" scaleY="1.2" rotation="0" myDensity="0.5"/>
<pPlank x="182" y="373" scaleX="1" scaleY="1" rotation="7" myDensity="0"/>
<pEgg x="509" y="391" scaleX="1" scaleY="1" rotation="-20" myDensity="0"/>
<pEgg x="544" y="390" scaleX="1" scaleY="1" rotation="20" myDensity="0"/>
<pOval2 x="523" y="464" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="326" y="443" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBloon1 x="579" y="318" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon2 x="346" y="205" scaleX="1" scaleY="1" rotation="0" myDensity="1"/>
</world>
, <world backFrame="6" quality="HIGH" kVolts="4_0_0_0" worldZone="standard" firstVolt="sticking">
<volt1 x="129" y="124"/>
<volt3 x="316" y="152"/>
<pCane2 x="38" y="247" scaleX="0.8" scaleY="0.9" rotation="30" myDensity="0"/>
<volt1 x="492" y="266"/>
<pBallSpin x="319" y="208" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<volt1 x="127" y="266"/>
<volt1 x="482" y="123"/>
<pBoard x="101" y="157" scaleX="0.8" scaleY="1" rotation="0" myDensity="0"/>
<pCane1 x="493" y="409" scaleX="0.8" scaleY="0.8" rotation="0" myDensity="0"/>
<pCane1 x="550" y="402" scaleX="0.8" scaleY="0.8" rotation="0" myDensity="0"/>
<pEgg x="558" y="258" scaleX="1" scaleY="1.1" rotation="0" myDensity="0"/>
<pBoard2 x="523" y="300" scaleX="0.8" scaleY="1" rotation="0" myDensity="0"/>
<pEgg x="557" y="184" scaleX="1" scaleY="-1.1" rotation="0" myDensity="0"/>
<pPlank x="520" y="152" scaleX="0.6" scaleY="1" rotation="0" myDensity="0"/>
<pCane3 x="31" y="358" scaleX="-0.7" scaleY="1" rotation="0" myDensity="0"/>
<pCane1 x="142" y="406" scaleX="0.8" scaleY="0.8" rotation="0" myDensity="0"/>
<pPlank x="75" y="289" scaleX="0.8" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="323" y="446" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="5" quality="HIGH" kVolts="2_0_3_0" worldZone="standard" firstVolt="null">
<volt1 x="532" y="225"/>
<volt1 x="119" y="228"/>
<pBox1 x="122" y="266" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBox1 x="533" y="265" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBloon2 x="439" y="299" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon1 x="325" y="282" scaleX="1.3" scaleY="1.5" rotation="0" myDensity="0.5"/>
<pBloon2 x="224" y="298" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pPlatform1 x="123" y="374" scaleX="0.7" scaleY="0.9" rotation="0" myDensity="0"/>
<pBox2 x="534" y="348" scaleX="0.8" scaleY="1.3" rotation="0" myDensity="0"/>
<pBoard2 x="535" y="410" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="310" y="441" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="6" quality="HIGH" kVolts="1_0_0_6" worldZone="standard" firstVolt="water">
<pCane3 x="88" y="248" scaleX="0.8" scaleY="0.9" rotation="0" myDensity="0"/>
<volt1 x="502" y="166"/>
<volt1 x="146" y="162"/>
<volt4 x="339" y="387"/>
<pPlatform1 x="145" y="249" scaleX="0.8" scaleY="0.8" rotation="0" myDensity="0"/>
<pOval x="116" y="365" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pPlatform2 x="117" y="386" scaleX="1" scaleY="0.7" rotation="0" myDensity="0"/>
<pCane2 x="535" y="298" scaleX="0.9" scaleY="0.9" rotation="-10" myDensity="0"/>
<pCane2 x="500" y="301" scaleX="0.9" scaleY="0.9" rotation="170" myDensity="0"/>
<pCane2 x="500" y="301" scaleX="0.9" scaleY="0.9" rotation="170" myDensity="0"/>
<pOval x="517" y="438" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="318" y="421" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pPlank x="521" y="190" scaleX="0.4" scaleY="1.5" rotation="0" myDensity="0"/>
</world>
, <world backFrame="4" quality="HIGH" kVolts="4_0_0_0" worldZone="standard" firstVolt="null">
<pBox3 x="565" y="393" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<volt1 x="208" y="96"/>
<pBox2 x="246" y="444" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane2 x="148" y="340" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pEgg x="127" y="426" scaleX="1" scaleY="1" rotation="20" myDensity="0"/>
<pWater x="324" y="441" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<volt4 x="245" y="391"/>
<volt4 x="563" y="326"/>
<pBallSpin2 x="211" y="205" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBloon2 x="331" y="96" scaleX="1" scaleY="1.3" rotation="0" myDensity="0"/>
<pBloon2 x="506" y="117" scaleX="1" scaleY="1.3" rotation="0" myDensity="0"/>
<pCane3 x="408" y="235" scaleX="1" scaleY="1" rotation="-120" myDensity="0"/>
</world>
, <world backFrame="12" quality="HIGH" kVolts="5_2_0_0" worldZone="high" firstVolt="null">
<volt1 x="139" y="-115"/>
<volt3 x="194" y="323"/>
<volt3 x="435" y="328"/>
<volt1 x="507" y="-125"/>
<pStone x="272" y="408" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane2 x="31" y="213" scaleX="1" scaleY="1" rotation="-20" myDensity="0"/>
<pStone x="363" y="406" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pOval2 x="28" y="411" scaleX="1" scaleY="1" rotation="10" myDensity="0"/>
<pCane2 x="575" y="25" scaleX="-1" scaleY="1" rotation="-30" myDensity="0"/>
<pBox2 x="508" y="-82" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<pCane2 x="74" y="26" scaleX="1" scaleY="1" rotation="30" myDensity="0"/>
<pBox2 x="138" y="-78" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<pCane2 x="319" y="362" scaleX="1" scaleY="1" rotation="80" myDensity="0.1"/>
<pEgg x="9" y="107" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pCane2 x="607" y="205" scaleX="-1" scaleY="-1" rotation="0" myDensity="0"/>
<pEgg x="629" y="99" scaleX="1" scaleY="-1" rotation="90" myDensity="0"/>
<pEgg x="595" y="336" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pOval2 x="608" y="421" scaleX="1" scaleY="1" rotation="10" myDensity="0"/>
<pWater x="314" y="445" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="7" quality="HIGH" kVolts="12_0_0_0" worldZone="high" firstVolt="null">
<volt1 x="389" y="325"/>
<volt1 x="224" y="323"/>
<pPlank x="321" y="343" scaleX="3" scaleY="1" rotation="0" myDensity="0"/>
<volt2 x="334" y="-55"/>
<volt2 x="445" y="-178"/>
<volt2 x="216" y="-179"/>
<volt2 x="547" y="-52"/>
<volt2 x="102" y="-52"/>
<pBall x="113" y="440" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBall x="517" y="437" scaleX="1" scaleY="1" rotation="40" myDensity="0"/>
<pCane1 x="24" y="481" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane1 x="604" y="485" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="4" quality="HIGH" kVolts="3_0_0_0" worldZone="standard" firstVolt="null">
<volt1 x="381" y="141"/>
<volt1 x="35" y="86"/>
<pCane2 x="211" y="153" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pCane3 x="443" y="210" scaleX="1" scaleY="1" rotation="-100" myDensity="0"/>
<pBox2 x="32" y="151" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane1 x="528" y="337" scaleX="1" scaleY="0.7" rotation="80" myDensity="0"/>
<pCane2 x="288" y="407" scaleX="1" scaleY="1" rotation="70" myDensity="0"/>
<pWater x="332" y="485" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="1" quality="HIGH" kVolts="16_0_0_0" worldZone="standard" firstVolt="null">
<pEgg x="187" y="392" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<volt1 x="509" y="370"/>
<volt1 x="148" y="370"/>
<pPlatform2 x="90" y="476" scaleX="1.3" scaleY="1" rotation="0" myDensity="0"/>
<pEgg x="475" y="396" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<pPlatform2 x="571" y="480" scaleX="1.3" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="335" y="454" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="7" quality="HIGH" kVolts="6_3_0_0" worldZone="standard" firstVolt="null">
<pBox2 x="145" y="122" scaleX="-1" scaleY="-1" rotation="0" myDensity="0"/>
<pBox3 x="480" y="128" scaleX="1" scaleY="-1" rotation="0" myDensity="0"/>
<volt3 x="66" y="97"/>
<volt3 x="568" y="96"/>
<pBox3 x="79" y="423" scaleX="1" scaleY="1" rotation="-30" myDensity="0"/>
<pOval x="603" y="409" scaleX="0.8" scaleY="0.8" rotation="30" myDensity="0"/>
<pPlank x="294" y="428" scaleX="-1" scaleY="-1" rotation="-15" myDensity="0"/>
<pWater x="317" y="453" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pGround1 x="322" y="31" scaleX="1" scaleY="-1" rotation="0" myDensity="0"/>
<pCane2 x="638" y="198" scaleX="-1" scaleY="1" rotation="0" myDensity="0"/>
<pCane1 x="474" y="77" scaleX="1" scaleY="1.1" rotation="90" myDensity="0"/>
<pCane1 x="169" y="76" scaleX="1" scaleY="1.1" rotation="90" myDensity="0"/>
<pCane2 x="4" y="197" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBall x="321" y="77" scaleX="0.2" scaleY="0.2" rotation="0" myDensity="0"/>
<pBall x="12" y="77" scaleX="0.2" scaleY="0.2" rotation="0" myDensity="0"/>
<pBall x="625" y="81" scaleX="0.2" scaleY="0.2" rotation="0" myDensity="0"/>
<pBloon2 x="410" y="321" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="11" quality="HIGH" kVolts="10_2_0_0" worldZone="high" firstVolt="null">
<pCane1 x="307" y="203" scaleX="1" scaleY="1.1" rotation="90" myDensity="0.5"/>
<volt3 x="313" y="225"/>
<pPlatform1 x="312" y="336" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBall2 x="27" y="443" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pOval2 x="547" y="426" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<volt1 x="17" y="-49"/>
<volt1 x="605" y="-37"/>
<pWater x="317" y="454" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBonusBox x="306" y="-45" scaleX="1" scaleY="1" rotation="0" myDensity="0" sizeBonus="2" typeBonus="1"/>
<pBloon1 x="379" y="-98" scaleX="1.2" scaleY="1.2" rotation="0" myDensity="0"/>
<pBloon1 x="237" y="-129" scaleX="1.2" scaleY="1.8" rotation="0" myDensity="0"/>
<pBoard2 x="305" y="-12" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pPlatform1 x="10" y="47" scaleX="-0.8" scaleY="0.8" rotation="0" myDensity="0"/>
<pPlatform1 x="628" y="64" scaleX="0.9" scaleY="0.9" rotation="0" myDensity="0"/>
</world>
, <world backFrame="4" quality="HIGH" kVolts="4_0_0_0" worldZone="standard" firstVolt="null">
<volt1 x="540" y="183"/>
<volt1 x="137" y="188"/>
<pBoard2 x="332" y="220" scaleX="3" scaleY="0.5" rotation="0" myDensity="0.1"/>
<pBall2 x="334" y="262" scaleX="0.3" scaleY="0.3" rotation="0" myDensity="0"/>
<pWater x="292" y="463" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBloon1 x="63" y="338" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon2 x="207" y="87" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon2 x="509" y="370" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon1 x="426" y="125" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBall2 x="1" y="485" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBall2 x="23" y="-12" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBall2 x="626" y="464" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBall2 x="614" y="-6" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="6" quality="HIGH" kVolts="6_0_1_0" worldZone="standard" firstVolt="null">
<volt1 x="599" y="179"/>
<pCane3 x="27" y="161" scaleX="1" scaleY="1" rotation="-100" myDensity="0"/>
<pCane2 x="458" y="249" scaleX="1" scaleY="1" rotation="60" myDensity="0"/>
<pOval x="584" y="222" scaleX="0.5" scaleY="0.5" rotation="-30" myDensity="0"/>
<pCane2 x="461" y="364" scaleX="1" scaleY="1" rotation="60" myDensity="0"/>
<pCane1 x="67" y="321" scaleX="1" scaleY="1" rotation="20" myDensity="0"/>
<volt1 x="595" y="289"/>
<pOval x="582" y="334" scaleX="0.5" scaleY="0.5" rotation="-30" myDensity="0"/>
<volt3 x="72" y="170"/>
<pWater x="314" y="441" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane2 x="455" y="140" scaleX="1" scaleY="1" rotation="60" myDensity="0"/>
<pOval x="584" y="108" scaleX="0.5" scaleY="0.5" rotation="-30" myDensity="0"/>
<volt1 x="589" y="61"/>
<pGround1 x="651" y="243" scaleX="1" scaleY="1" rotation="-90" myDensity="0"/>
<pBoard x="-14" y="424" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="2" quality="HIGH" kVolts="6_0_0_0" worldZone="standard" firstVolt="null">
<volt1 x="328" y="140"/>
<volt1 x="128" y="140"/>
<volt1 x="528" y="140"/>
<pBox2 x="38" y="421" scaleX="0.9" scaleY="0.9" rotation="22" myDensity="0"/>
<pWater x="324" y="441" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBloon1 x="95" y="99" scaleX="1.2" scaleY="1.2" rotation="-10" myDensity="0"/>
<pBox1 x="128" y="180" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBloon2 x="288" y="84" scaleX="1" scaleY="0.9" rotation="-12" myDensity="0"/>
<pBloon1 x="377" y="108" scaleX="1" scaleY="1" rotation="15" myDensity="0"/>
<pBox2 x="331" y="180" scaleX="0.7" scaleY="0.6" rotation="0" myDensity="0"/>
<pBloon2 x="572" y="96" scaleX="1" scaleY="0.8" rotation="12" myDensity="0"/>
<pBox3 x="530" y="180" scaleX="1" scaleY="0.5" rotation="0" myDensity="0"/>
<pBox2 x="333" y="259" scaleX="0.7" scaleY="0.6" rotation="0" myDensity="0"/>
</world>
, <world backFrame="1" quality="HIGH" kVolts="2_0_0_0" worldZone="standard" firstVolt="null">
<volt1 x="177" y="33"/>
<volt1 x="482" y="332"/>
<pCane3 x="237" y="174" scaleX="1.5" scaleY="1.5" rotation="-70" myDensity="0"/>
<pBall x="225" y="21" scaleX="0.4" scaleY="0.4" rotation="0" myDensity="0.5"/>
<pStone x="482" y="389" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBoard x="484" y="369" scaleX="0.6" scaleY="1.2" rotation="0" myDensity="0"/>
<pStone x="471" y="427" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pEgg x="69" y="424" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pEgg x="150" y="428" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="498" y="435" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="332" y="464" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBox2 x="108" y="372" scaleX="0.6" scaleY="0.6" rotation="0" myDensity="0"/>
<pCane2 x="111" y="393" scaleX="0.5" scaleY="0.5" rotation="80" myDensity="0"/>
</world>
, <world backFrame="8" quality="HIGH" kVolts="1_2_1_0" worldZone="standard" firstVolt="null">
<volt1 x="514" y="207"/>
<volt1 x="134" y="259"/>
<pCane1 x="117" y="373" scaleX="0.5" scaleY="0.6" rotation="0" myDensity="0"/>
<pBox1 x="119" y="298" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane2 x="538" y="345" scaleX="0.5" scaleY="0.8" rotation="-5" myDensity="0"/>
<pBox2 x="535" y="245" scaleX="0.6" scaleY="0.6" rotation="0" myDensity="0"/>
<pBall2 x="321" y="240" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<pWater x="327" y="441" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<volt4 x="233" y="402"/>
<pBloon1 x="243" y="35" scaleX="0.5" scaleY="0.9" rotation="0" myDensity="0"/>
<pBloon1 x="397" y="36" scaleX="0.5" scaleY="0.9" rotation="0" myDensity="0"/>
<pBloon1 x="161" y="47" scaleX="0.6" scaleY="0.7" rotation="0" myDensity="0"/>
<pCane1 x="201" y="89" scaleX="0.3" scaleY="0.3" rotation="90" myDensity="0"/>
<pBloon1 x="483" y="54" scaleX="0.6" scaleY="0.6" rotation="0" myDensity="0"/>
<pCane1 x="439" y="90" scaleX="0.3" scaleY="0.3" rotation="90" myDensity="0"/>
</world>
, <world backFrame="6" quality="HIGH" kVolts="7_1_0_0" worldZone="standard" firstVolt="null">
<volt1 x="324" y="188"/>
<volt1 x="53" y="190"/>
<volt1 x="590" y="187"/>
<pBox2 x="326" y="234" scaleX="0.5" scaleY="0.7" rotation="0" myDensity="0"/>
<pPlank x="118" y="216" scaleX="0.7" scaleY="1" rotation="0" myDensity="0"/>
<pBallSpin2 x="167" y="215" scaleX="-1" scaleY="-1" rotation="0" myDensity="0"/>
<pPlank x="525" y="212" scaleX="0.7" scaleY="1" rotation="0" myDensity="0"/>
<pBallSpin x="480" y="215" scaleX="-1" scaleY="-1" rotation="30" myDensity="0"/>
<pPlatform1 x="327" y="335" scaleX="0.8" scaleY="0.8" rotation="0" myDensity="0"/>
<pBox1 x="54" y="403" scaleX="1" scaleY="1" rotation="-10" myDensity="0"/>
<pStone x="616" y="399" scaleX="1" scaleY="1" rotation="20" myDensity="0"/>
<pWater x="321" y="436" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="3" quality="HIGH" kVolts="5_1_0_0" worldZone="standard" firstVolt="null">
<volt1 x="564" y="203"/>
<volt1 x="65" y="205"/>
<pPlatform1 x="573" y="321" scaleX="1" scaleY="1.1" rotation="0" myDensity="0"/>
<volt4 x="327" y="400"/>
<pCane1 x="27" y="358" scaleX="0.9" scaleY="0.9" rotation="0" myDensity="0"/>
<volt3 x="334" y="102"/>
<pCane2 x="73" y="354" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBall x="623" y="410" scaleX="0.5" scaleY="0.5" rotation="0" myDensity="0"/>
<pBox2 x="60" y="408" scaleX="1" scaleY="1" rotation="30" myDensity="0"/>
<pWater x="330" y="428" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane3 x="559" y="150" scaleX="1" scaleY="1" rotation="100" myDensity="0"/>
<pBoard2 x="26" y="236" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBloon1 x="242" y="36" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane1 x="362" y="91" scaleX="0.9" scaleY="0.9" rotation="90" myDensity="0"/>
<pBall x="616" y="218" scaleX="0.2" scaleY="0.2" rotation="0" myDensity="0"/>
</world>
, <world backFrame="2" quality="HIGH" kVolts="2_1_1_0" worldZone="standard" firstVolt="null">
<volt1 x="606" y="101"/>
<volt1 x="31" y="103"/>
<pNoContact x="562" y="229" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBoard2 x="605" y="141" scaleX="0.3" scaleY="1" rotation="0" myDensity="0"/>
<pBoard2 x="34" y="135" scaleX="0.3" scaleY="1" rotation="0" myDensity="0"/>
<pNoContactLittle x="135" y="371" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<volt1 x="305" y="309"/>
<pNoContact x="81" y="229" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBoard2 x="306" y="341" scaleX="0.3" scaleY="1" rotation="0" myDensity="0"/>
<pBoard2 x="128" y="49" scaleX="0.3" scaleY="1" rotation="0" myDensity="0"/>
<pBonusBox x="305" y="172" scaleX="1" scaleY="1" rotation="0" myDensity="0" sizeBonus="12" typeBonus="0"/>
<pNoContactBig x="349" y="371" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pBallSpin2 x="552" y="355" scaleX="0.3" scaleY="0.3" rotation="0" myDensity="0"/>
<pBallSpin2 x="93" y="360" scaleX="0.3" scaleY="0.3" rotation="20" myDensity="0"/>
<pNoContactLittle x="499" y="84" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pBallSpin2 x="549" y="91" scaleX="0.3" scaleY="0.3" rotation="0" myDensity="0"/>
<pNoContactLittle x="393" y="85" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pPlank x="266" y="432" scaleX="3.5" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="3" quality="HIGH" kVolts="5_0_0_0" worldZone="standard" firstVolt="null">
<volt1 x="70" y="387"/>
<volt1 x="321" y="173"/>
<pCane2 x="407" y="225" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pStone x="353" y="428" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="444" y="425" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="70" y="427" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="169" y="428" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="545" y="418" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="611" y="351" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="638" y="350" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="259" y="425" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="336" y="450" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pNoContactBig x="216" y="347" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pNoContactLittle x="480" y="345" scaleX="1" scaleY="1" rotation="90" myDensity="0"/>
<pNoContactLittle x="538" y="308" scaleX="0.9" scaleY="0.9" rotation="0" myDensity="0"/>
<pStone x="636" y="387" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pStone x="639" y="416" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
</world>
, <world backFrame="4" quality="HIGH" kVolts="0_0_0_3" worldZone="standard" firstVolt="null">
<pBloon1 x="186" y="286" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon1 x="231" y="276" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon1 x="377" y="203" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon1 x="451" y="356" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pBloon1 x="503" y="367" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<pWater x="345" y="439" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pBonusBox x="359" y="135" scaleX="1" scaleY="1" rotation="0" myDensity="0.5" sizeBonus="4" typeBonus="3"/>
<pBloon1 x="330" y="206" scaleX="1" scaleY="1" rotation="0" myDensity="0.5"/>
<volt4 x="202" y="258"/>
<volt4 x="324" y="379"/>
<volt4 x="480" y="339"/>
<pPlank x="-48" y="150" scaleX="1" scaleY="1" rotation="10" myDensity="0"/>
<volt4 x="31" y="246"/>
<volt4 x="32" y="146"/>
<pPlank x="-63" y="261" scaleX="1" scaleY="1" rotation="1" myDensity="0"/>
<volt4 x="612" y="178"/>
<pPlank x="696" y="196" scaleX="-1" scaleY="1" rotation="-5" myDensity="0"/>
</world>
, <world backFrame="4" quality="HIGH" kVolts="4_0_0_0" worldZone="high" firstVolt="null">
<pCane1 x="378" y="268" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<volt4 x="31" y="393"/>
<pBoard2 x="379" y="404" scaleX="0.3" scaleY="1" rotation="0" myDensity="0"/>
<pWater x="346" y="429" scaleX="1" scaleY="1" rotation="0" myDensity="0"/>
<pCane3 x="462" y="159" scaleX="1" scaleY="1" rotation="-110" myDensity="0"/>
<pCane3 x="297" y="159" scaleX="1" scaleY="-1" rotation="-70" myDensity="0"/>
<volt1 x="465" y="-113"/>
<pCane1 x="379" y="-9" scaleX="0.8" scaleY="1" rotation="0" myDensity="0"/>
<pCane3 x="451" y="26" scaleX="0.95" scaleY="0.95" rotation="-100" myDensity="0"/>
<pCane3 x="299" y="12" scaleX="0.95" scaleY="-0.95" rotation="-70" myDensity="0"/>
<pCane3 x="314" y="-115" scaleX="0.8" scaleY="-0.9" rotation="-80" myDensity="0"/>
<pCane3 x="449" y="-121" scaleX="0.9" scaleY="0.8" rotation="-110" myDensity="0"/>
<pCane1 x="380" y="-289" scaleX="0.65" scaleY="1" rotation="0" myDensity="0"/>
<pCane3 x="445" y="-272" scaleX="0.7" scaleY="0.7" rotation="-120" myDensity="0"/>
<pCane2 x="384" y="-663" scaleX="0.6" scaleY="0.5" rotation="-110" myDensity="0"/>
<pCane3 x="322" y="-253" scaleX="0.7" scaleY="-0.8" rotation="-80" myDensity="0"/>
<pCane3 x="325" y="-412" scaleX="0.6" scaleY="-0.7" rotation="-70" myDensity="0"/>
<pCane3 x="429" y="-402" scaleX="0.6" scaleY="0.6" rotation="-100" myDensity="0"/>
<pCane1 x="381" y="-553" scaleX="0.5" scaleY="0.9" rotation="0" myDensity="0"/>
<pCane3 x="341" y="-540" scaleX="0.5" scaleY="-0.5" rotation="-70" myDensity="0"/>
<pCane3 x="419" y="-544" scaleX="0.5" scaleY="0.4" rotation="-120" myDensity="0"/>
<pBonusBox x="385" y="-698" scaleX="1" scaleY="1" rotation="0" myDensity="0" sizeBonus="4" typeBonus="3"/>
<pBonusBox x="518" y="-268" scaleX="1" scaleY="1" rotation="0" myDensity="0" sizeBonus="5" typeBonus="0"/>
<pBonusBox x="262" y="-379" scaleX="1" scaleY="1" rotation="0" myDensity="0" sizeBonus="4" typeBonus="0"/>
<volt4 x="203" y="390"/>
<volt4 x="558" y="386"/>
<pBonusBox x="460" y="-514" scaleX="1" scaleY="1" rotation="0" myDensity="0" sizeBonus="5" typeBonus="0"/>
<volt4 x="62" y="394"/>
<volt4 x="337" y="390"/>
</world>
];
public static function get kLevels():Number{
return (levelInfo.length);
}
}
}//package TheGame
Section 164
//PauseBtn (TheGame.PauseBtn)
package TheGame {
import flash.display.*;
import flash.events.*;
import TheGame.Screens.*;
import TheGame.GameTemplate.*;
public class PauseBtn extends Base {
var base_mc:MovieClip;
var myWZ:WorkZone;
var stopNow:Boolean;// = false
var myLevel:Level;
public var base_mc_:MovieClip;
public function PauseBtn(){
this.visible = false;
base_mc = base_mc_;
forOnRollOutPause();
}
function forOnRollOutPause(){
gotoAndStop((playOrStop() + "_out"));
}
public function removeStop(){
this.visible = false;
removeEL();
}
override public function beforeDelete(){
removeEL();
if (myWZ != null){
myWZ.removeEventListener(Event.ENTER_FRAME, myWZ.showWorld);
};
}
function removeEL(){
base_mc.removeEventListener(MouseEvent.ROLL_OVER, onRollOverPause);
base_mc.removeEventListener(MouseEvent.ROLL_OUT, onRollOutPause);
base_mc.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDownPause);
base_mc.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpPause);
}
function onRollOverPause(_arg1:Event){
forOnRollOverPause();
}
function onMouseDownPause(_arg1:Event){
gotoAndStop((playOrStop() + "_down"));
}
public function initStop(_arg1:Level){
myLevel = _arg1;
this.visible = true;
base_mc.addEventListener(MouseEvent.ROLL_OVER, onRollOverPause);
base_mc.addEventListener(MouseEvent.ROLL_OUT, onRollOutPause);
base_mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownPause);
base_mc.addEventListener(MouseEvent.MOUSE_UP, onMouseUpPause);
}
function onMouseUpPause(_arg1:Event){
myWZ = myLevel.workZone_mc;
if (!stopNow){
myWZ.stopAllPhysics();
myLevel.counterTime.pauseWork();
} else {
myWZ.addEventListener(Event.ENTER_FRAME, myWZ.showWorld);
myLevel.counterTime.startWork();
};
stopNow = !(stopNow);
forOnRollOverPause();
}
function playOrStop():String{
return ((stopNow) ? "stop" : "play");
}
function onRollOutPause(_arg1:Event){
forOnRollOutPause();
}
function forOnRollOverPause(){
gotoAndStop((playOrStop() + "_over"));
}
}
}//package TheGame
Section 165
//PointerMenuBtn (TheGame.PointerMenuBtn)
package TheGame {
import flash.events.*;
import TheGame.GameTemplate.*;
public class PointerMenuBtn extends Base {
var txtButton:Array;
public var myGame:Game;
var funflow_button:ButtonFunflow;
public var play_btn:myBtnBig;
var more_games_button:MyBtn;
var play_button:MyBtn;
public var highscores_btn:myBtnBig;
public var funflow_clip:hor_funflow;
public var download_game_btn:myBtnBig;
var download_game_button:MyBtn;
public var more_games_btn:myBtnBig;
public var credits_btn:myBtnBig;
var highscores_button:MyBtn;
var credits_button:MyBtn;
public function PointerMenuBtn(){
txtButton = [];
super();
gotoAndStop(0);
}
function onClickMoreGames(_arg1:Event){
Game.openPage(Game.LINK_MORE_GAMES);
}
override public function beforeDelete(){
play_button.removeEventListener(MouseEvent.CLICK, onClickPlay);
highscores_button.removeEventListener(MouseEvent.CLICK, onClickHighscores);
download_game_button.removeEventListener(MouseEvent.CLICK, onClickDownloadGame);
credits_button.removeEventListener(MouseEvent.CLICK, onClickCredits);
more_games_button.removeEventListener(MouseEvent.CLICK, onClickMoreGames);
}
public function findMyIndex(_arg1):Number{
var _local2:* = 0;
while (_local2 < txtButton.length) {
if (txtButton[_local2] == _arg1.Text){
return (_local2);
};
_local2++;
};
return (-1);
}
function onClickPlay(_arg1:Event){
myGame.goAtFrame(Game.FRAME_SELECT_GAME);
}
function onClickHighscores(_arg1:Event){
Game.openPage(Game.LINK_PLAY_VOLT_CONNECT_FACEBOOK);
}
function onClickDownloadGame(_arg1:Event){
Game.openPage(Game.LINK_DOWNLOAD_GAME);
}
public function afterCreatePointer(_arg1:Game){
myGame = _arg1;
play_button = play_btn;
highscores_button = highscores_btn;
download_game_button = download_game_btn;
credits_button = credits_btn;
more_games_button = more_games_btn;
funflow_button = funflow_clip;
play_button.addEventListener(MouseEvent.CLICK, onClickPlay);
highscores_button.addEventListener(MouseEvent.CLICK, onClickHighscores);
download_game_button.addEventListener(MouseEvent.CLICK, onClickDownloadGame);
credits_button.addEventListener(MouseEvent.CLICK, onClickCredits);
more_games_button.addEventListener(MouseEvent.CLICK, onClickMoreGames);
initMyBtn(play_button);
initMyBtn(highscores_button);
initMyBtn(download_game_button);
initMyBtn(more_games_button);
initMyBtn(credits_button);
initMyBtn(funflow_button);
}
function initMyBtn(_arg1){
txtButton.push(_arg1.Text);
_arg1.myPointer = this;
if (_arg1 != funflow_button){
_arg1.scaleStart = 0.9;
_arg1.scaleUp = 1;
_arg1.forMouseOut();
};
}
function onClickCredits(_arg1:Event){
myGame.goAtFrame(Game.FRAME_CREDITS);
}
}
}//package TheGame
Section 166
//WalkInfo (TheGame.WalkInfo)
package TheGame {
public class WalkInfo {
public static var walkInfo:Array = [<way>
<move x="63" y="104" k="7"/>
<move x="62" y="108"/>
<move x="66" y="117"/>
<move x="74" y="134"/>
<move x="78" y="139" k="3"/>
<move x="79" y="147"/>
<move x="85" y="159"/>
<move x="99" y="186"/>
<move x="123" y="219"/>
<move x="143" y="256"/>
<move x="164" y="304"/>
<move x="184" y="339"/>
<move x="199" y="359"/>
<move x="206" y="366" k="1"/>
<move x="209" y="371"/>
<move x="211" y="379"/>
<move x="216" y="388"/>
<move x="216" y="390" k="15"/>
<move x="216" y="390"/>
<move x="216" y="390" k="2"/>
<move x="217" y="390"/>
<move x="217" y="388"/>
<move x="220" y="387"/>
<move x="226" y="386"/>
<move x="233" y="386"/>
<move x="241" y="386"/>
<move x="246" y="386"/>
<move x="254" y="386"/>
<move x="260" y="391"/>
<move x="266" y="391"/>
<move x="273" y="391"/>
<move x="281" y="389"/>
<move x="284" y="386"/>
<move x="291" y="382"/>
<move x="296" y="378"/>
<move x="299" y="376"/>
<move x="300" y="372"/>
<move x="301" y="368" k="3"/>
<move x="302" y="368" k="2"/>
<move x="303" y="366" k="5"/>
<click x="303" y="366"/>
<move x="303" y="366" k="1"/>
<move x="309" y="365"/>
<move x="314" y="364"/>
<move x="318" y="363"/>
<move x="324" y="361"/>
<move x="329" y="360"/>
<move x="337" y="360"/>
<move x="344" y="360"/>
<move x="348" y="360"/>
<move x="353" y="360"/>
<move x="359" y="360"/>
<move x="364" y="360"/>
<move x="368" y="360"/>
<move x="370" y="360"/>
<move x="372" y="360" k="1"/>
<move x="374" y="360" k="6"/>
<click x="374" y="360"/>
<move x="374" y="360" k="11"/>
</way>
, <way>
<move x="132" y="59" k="11"/>
<move x="132" y="60"/>
<move x="144" y="76"/>
<move x="152" y="91"/>
<move x="163" y="103"/>
<move x="171" y="118"/>
<move x="182" y="137"/>
<move x="197" y="161"/>
<move x="208" y="187"/>
<move x="215" y="207"/>
<move x="219" y="221"/>
<move x="221" y="238"/>
<move x="223" y="253"/>
<move x="226" y="265"/>
<move x="233" y="286"/>
<move x="241" y="303"/>
<move x="245" y="314"/>
<move x="249" y="324"/>
<move x="253" y="334"/>
<move x="260" y="346"/>
<move x="262" y="349" k="3"/>
<move x="262" y="341"/>
<move x="262" y="334"/>
<move x="262" y="328"/>
<move x="262" y="325" k="14"/>
<click x="262" y="325"/>
<move x="262" y="325" k="4"/>
<move x="263" y="321"/>
<move x="269" y="308"/>
<move x="277" y="296"/>
<move x="281" y="285"/>
<move x="284" y="275"/>
<move x="284" y="269"/>
<move x="284" y="264"/>
<move x="284" y="258"/>
<move x="286" y="253"/>
<move x="287" y="251"/>
<move x="289" y="250"/>
<move x="291" y="250" k="1"/>
<move x="293" y="250" k="9"/>
<click x="293" y="250"/>
<move x="293" y="250"/>
<move x="295" y="249"/>
<move x="297" y="242"/>
<move x="300" y="230"/>
<move x="305" y="209"/>
<move x="309" y="192"/>
<move x="312" y="181"/>
<move x="312" y="177" k="3"/>
<move x="312" y="175"/>
<move x="312" y="173" k="12"/>
<click x="312" y="173"/>
<move x="312" y="173" k="11"/>
</way>
, <way>
<move x="192" y="72" k="16"/>
<move x="192" y="74"/>
<move x="194" y="83"/>
<move x="197" y="96"/>
<move x="197" y="100"/>
<move x="198" y="102"/>
<move x="204" y="110"/>
<move x="215" y="129"/>
<move x="248" y="176"/>
<move x="283" y="211"/>
<move x="325" y="244"/>
<move x="363" y="267"/>
<move x="390" y="285"/>
<move x="405" y="293"/>
<move x="427" y="311"/>
<move x="454" y="340"/>
<move x="470" y="362"/>
<move x="478" y="378"/>
<move x="483" y="394"/>
<move x="490" y="409"/>
<move x="494" y="420"/>
<move x="496" y="424"/>
<move x="498" y="428"/>
<move x="500" y="428"/>
<move x="504" y="430"/>
<move x="509" y="433"/>
<move x="513" y="435"/>
<move x="519" y="438"/>
<move x="522" y="443"/>
<move x="525" y="446" k="8"/>
<count_volt x="525" y="446"/>
<move x="525" y="448"/>
<move x="521" y="446"/>
<move x="513" y="440"/>
<move x="501" y="434"/>
<move x="477" y="424"/>
<move x="451" y="412"/>
<move x="438" y="405"/>
<move x="419" y="394"/>
<move x="412" y="390"/>
<move x="406" y="385"/>
<move x="392" y="378"/>
<move x="372" y="360"/>
<move x="346" y="337"/>
<move x="325" y="323"/>
<move x="311" y="312"/>
<move x="301" y="306"/>
<move x="291" y="301"/>
<move x="287" y="299"/>
<move x="282" y="294"/>
<move x="276" y="292"/>
<move x="272" y="290"/>
<move x="268" y="290"/>
<move x="266" y="288"/>
<move x="262" y="286"/>
<move x="258" y="285"/>
<move x="256" y="284"/>
<move x="254" y="284"/>
<move x="251" y="282"/>
<move x="250" y="282"/>
<move x="248" y="282"/>
<move x="246" y="282"/>
<move x="245" y="283"/>
<move x="242" y="288"/>
<move x="239" y="292"/>
<move x="238" y="296" k="11"/>
<click x="238" y="296"/>
<move x="238" y="296" k="1"/>
<move x="236" y="295"/>
<move x="227" y="287"/>
<move x="215" y="282"/>
<move x="205" y="281"/>
<move x="194" y="277"/>
<move x="189" y="276"/>
<move x="183" y="273"/>
<move x="179" y="271"/>
<move x="175" y="270" k="21"/>
<click x="175" y="270"/>
<move x="175" y="270" k="2"/>
<move x="187" y="267"/>
<move x="209" y="261"/>
<move x="229" y="257"/>
<move x="252" y="252"/>
<move x="258" y="250"/>
<move x="267" y="246"/>
<move x="275" y="241"/>
<move x="278" y="238"/>
<move x="286" y="234"/>
<move x="291" y="231"/>
<move x="297" y="225"/>
<move x="304" y="223"/>
<move x="306" y="223" k="1"/>
<move x="308" y="223"/>
<move x="312" y="223"/>
<move x="313" y="223"/>
<move x="317" y="223" k="1"/>
<move x="319" y="222"/>
<move x="321" y="221" k="23"/>
<move x="321" y="224" k="8"/>
<click x="321" y="224"/>
<move x="321" y="224" k="12"/>
</way>
, <way>
<move x="263" y="104" k="16"/>
<move x="268" y="113"/>
<move x="278" y="128"/>
<move x="290" y="143"/>
<move x="300" y="159"/>
<move x="311" y="174"/>
<move x="321" y="187"/>
<move x="330" y="200"/>
<move x="340" y="216"/>
<move x="351" y="236"/>
<move x="361" y="259"/>
<move x="375" y="285"/>
<move x="395" y="319"/>
<move x="417" y="345"/>
<move x="432" y="367"/>
<move x="444" y="383"/>
<move x="453" y="394"/>
<move x="460" y="401"/>
<move x="464" y="407"/>
<move x="472" y="415"/>
<move x="482" y="425"/>
<move x="491" y="434"/>
<move x="498" y="442"/>
<move x="500" y="449"/>
<move x="503" y="452"/>
<move x="505" y="452" k="1"/>
<move x="507" y="452" k="1"/>
<move x="509" y="452"/>
<move x="511" y="452"/>
<move x="512" y="452" k="7"/>
<count_volt x="512" y="452"/>
<move x="512" y="452" k="1"/>
<move x="513" y="450" k="1"/>
<move x="510" y="442"/>
<move x="501" y="426"/>
<move x="481" y="403"/>
<move x="462" y="387"/>
<move x="444" y="374"/>
<move x="423" y="358"/>
<move x="406" y="346"/>
<move x="391" y="333"/>
<move x="381" y="326"/>
<move x="375" y="321"/>
<move x="365" y="317"/>
<move x="359" y="315"/>
<move x="351" y="311"/>
<move x="345" y="308"/>
<move x="341" y="305"/>
<move x="339" y="303" k="2"/>
<move x="331" y="310"/>
<move x="327" y="310"/>
<move x="323" y="315"/>
<move x="321" y="316" k="15"/>
<click x="321" y="316"/>
<move x="321" y="316" k="2"/>
<move x="333" y="316"/>
<move x="354" y="320"/>
<move x="368" y="324"/>
<move x="375" y="324"/>
<move x="381" y="324"/>
<move x="386" y="325"/>
<move x="394" y="327"/>
<move x="397" y="329"/>
<move x="399" y="330"/>
<move x="405" y="332"/>
<move x="409" y="334"/>
<move x="412" y="337"/>
<move x="418" y="341" k="2"/>
<move x="421" y="341"/>
<move x="425" y="341"/>
<move x="429" y="341"/>
<move x="430" y="341"/>
<move x="434" y="341" k="1"/>
<move x="436" y="341" k="7"/>
<click x="436" y="341"/>
<move x="436" y="341" k="2"/>
<move x="432" y="341"/>
<move x="428" y="341"/>
<move x="421" y="340"/>
<move x="413" y="339"/>
<move x="406" y="339"/>
<move x="400" y="338"/>
<move x="396" y="338"/>
<move x="393" y="338" k="1"/>
<move x="391" y="338"/>
<move x="387" y="338"/>
<move x="387" y="336" k="8"/>
<move x="385" y="339"/>
<move x="383" y="350"/>
<move x="384" y="355"/>
<move x="386" y="359"/>
<move x="387" y="360"/>
<move x="388" y="360"/>
<move x="394" y="360"/>
<move x="396" y="360" k="7"/>
<click x="396" y="360"/>
<move x="396" y="360" k="7"/>
<move x="398" y="360" k="3"/>
<move x="398" y="358"/>
</way>
, <way>
<move x="334" y="96" k="17"/>
<move x="334" y="100"/>
<move x="336" y="106"/>
<move x="347" y="121"/>
<move x="351" y="125"/>
<move x="353" y="128"/>
<move x="357" y="131"/>
<move x="364" y="136"/>
<move x="369" y="142"/>
<move x="374" y="147"/>
<move x="381" y="151"/>
<move x="387" y="155"/>
<move x="395" y="161"/>
<move x="399" y="162"/>
<move x="402" y="168"/>
<move x="409" y="177"/>
<move x="413" y="185"/>
<move x="415" y="188"/>
<move x="416" y="192"/>
<move x="416" y="197"/>
<move x="418" y="204"/>
<move x="418" y="208"/>
<move x="418" y="210" k="7"/>
<move x="419" y="210"/>
<move x="422" y="201"/>
<move x="423" y="195"/>
<move x="424" y="195"/>
<move x="424" y="191" k="6"/>
<move x="427" y="193"/>
<move x="428" y="195"/>
<move x="429" y="197"/>
<move x="429" y="201"/>
<move x="429" y="203"/>
<move x="429" y="205"/>
<move x="430" y="207"/>
<move x="430" y="209" k="4"/>
<move x="431" y="209" k="5"/>
<move x="433" y="208"/>
<move x="435" y="208"/>
<move x="437" y="205"/>
<move x="439" y="202"/>
<move x="441" y="202" k="3"/>
<move x="438" y="192"/>
<move x="434" y="185"/>
<move x="431" y="181"/>
<move x="429" y="181" k="4"/>
<move x="432" y="186"/>
<move x="432" y="191"/>
<move x="435" y="197" k="2"/>
<move x="437" y="198" k="9"/>
<click x="437" y="198"/>
<move x="439" y="198" k="4"/>
<move x="439" y="196"/>
<move x="428" y="188"/>
<move x="403" y="179"/>
<move x="376" y="175"/>
<move x="345" y="173"/>
<move x="325" y="173"/>
<move x="298" y="173"/>
<move x="275" y="175"/>
<move x="257" y="179"/>
<move x="240" y="187"/>
<move x="219" y="190"/>
<move x="201" y="193"/>
<move x="192" y="196"/>
<move x="191" y="202"/>
<move x="191" y="204"/>
<move x="191" y="206"/>
<move x="191" y="207"/>
<move x="192" y="210" k="5"/>
<move x="193" y="210" k="1"/>
<move x="193" y="208"/>
<move x="193" y="206"/>
<move x="193" y="204"/>
<move x="193" y="202" k="33"/>
<click x="193" y="202"/>
<move x="193" y="202" k="11"/>
</way>
, <way>
<move x="417" y="94" k="18"/>
<move x="417" y="97"/>
<move x="417" y="105"/>
<move x="418" y="114"/>
<move x="418" y="124"/>
<move x="420" y="144"/>
<move x="427" y="173"/>
<move x="439" y="209"/>
<move x="452" y="260"/>
<move x="466" y="311"/>
<move x="484" y="365"/>
<move x="509" y="408"/>
<move x="523" y="443"/>
<move x="535" y="462"/>
<move x="538" y="462" k="2"/>
<move x="540" y="462"/>
<move x="542" y="461"/>
<move x="545" y="459"/>
<move x="548" y="457"/>
<move x="550" y="456"/>
<move x="552" y="455" k="3"/>
<move x="554" y="455" k="1"/>
<move x="556" y="455"/>
<move x="558" y="454" k="5"/>
<count_volt x="558" y="454"/>
<move x="558" y="454" k="2"/>
<move x="554" y="451"/>
<move x="542" y="443"/>
<move x="507" y="427"/>
<move x="417" y="385"/>
<move x="367" y="359"/>
<move x="347" y="348"/>
<move x="341" y="344"/>
<move x="329" y="334"/>
<move x="311" y="317"/>
<move x="291" y="292"/>
<move x="275" y="272"/>
<move x="261" y="249"/>
<move x="250" y="227"/>
<move x="241" y="214"/>
<move x="240" y="212" k="2"/>
<move x="235" y="209"/>
<move x="232" y="208"/>
<move x="228" y="208"/>
<move x="226" y="208"/>
<move x="224" y="209"/>
<move x="222" y="209"/>
<move x="219" y="209"/>
<move x="215" y="209"/>
<move x="213" y="209"/>
<move x="211" y="208"/>
<move x="209" y="208"/>
<move x="207" y="207" k="9"/>
<click x="207" y="207"/>
<move x="207" y="207"/>
<move x="208" y="207"/>
<move x="216" y="205"/>
<move x="220" y="204"/>
<move x="230" y="202"/>
<move x="240" y="201"/>
<move x="247" y="201"/>
<move x="250" y="202"/>
<move x="256" y="202"/>
<move x="263" y="202"/>
<move x="267" y="202"/>
<move x="270" y="202" k="1"/>
<move x="276" y="202"/>
<move x="283" y="203"/>
<move x="291" y="206"/>
<move x="295" y="206"/>
<move x="299" y="206"/>
<move x="302" y="206" k="7"/>
<move x="300" y="206"/>
<move x="298" y="206" k="6"/>
<click x="298" y="206"/>
<move x="298" y="206" k="2"/>
<move x="313" y="206"/>
<move x="355" y="206"/>
<move x="393" y="204"/>
<move x="401" y="204"/>
<move x="403" y="204"/>
<move x="408" y="204"/>
<move x="423" y="206"/>
<move x="428" y="206"/>
<move x="429" y="204" k="2"/>
<move x="431" y="204"/>
<move x="437" y="204"/>
<move x="438" y="204"/>
<move x="442" y="204" k="1"/>
<move x="446" y="203" k="7"/>
<click x="446" y="203"/>
<move x="446" y="203"/>
<move x="444" y="203"/>
<move x="436" y="203"/>
<move x="429" y="202"/>
<move x="419" y="196"/>
<move x="406" y="193"/>
<move x="399" y="190"/>
<move x="397" y="189"/>
<move x="395" y="189"/>
<move x="393" y="189"/>
<move x="391" y="189"/>
<move x="390" y="189" k="13"/>
<click x="390" y="189"/>
<move x="390" y="189" k="11"/>
</way>
, <way>
<move x="479" y="64" k="4"/>
<move x="481" y="72"/>
<move x="488" y="97"/>
<move x="496" y="119"/>
<move x="503" y="136"/>
<move x="505" y="153"/>
<move x="514" y="182"/>
<move x="519" y="201"/>
<move x="514" y="211"/>
<move x="514" y="217"/>
<move x="514" y="225"/>
<move x="514" y="233"/>
<move x="514" y="236"/>
<move x="514" y="240"/>
<move x="514" y="247"/>
<move x="514" y="251"/>
<move x="514" y="255"/>
<move x="514" y="258" k="1"/>
<move x="514" y="260" k="1"/>
<move x="515" y="261" k="1"/>
<move x="517" y="262" k="1"/>
<move x="518" y="264" k="2"/>
<move x="520" y="264" k="8"/>
<click x="520" y="264"/>
<move x="520" y="264" k="3"/>
<move x="520" y="269"/>
<move x="520" y="277"/>
<move x="520" y="285"/>
<move x="520" y="294"/>
<move x="520" y="304"/>
<move x="520" y="311"/>
<move x="520" y="315"/>
<move x="520" y="319"/>
<move x="520" y="322"/>
<move x="520" y="326"/>
<move x="519" y="330"/>
<move x="519" y="331" k="7"/>
<click x="519" y="331"/>
<move x="519" y="331"/>
<move x="517" y="331"/>
<move x="509" y="335"/>
<move x="498" y="339"/>
<move x="491" y="341"/>
<move x="487" y="342"/>
<move x="482" y="344"/>
<move x="476" y="347"/>
<move x="470" y="350"/>
<move x="469" y="352"/>
<move x="465" y="354"/>
<move x="464" y="356"/>
<move x="460" y="358"/>
<move x="459" y="360"/>
<move x="458" y="364"/>
<move x="456" y="365" k="1"/>
<move x="456" y="367" k="7"/>
<click x="456" y="367"/>
<move x="456" y="367" k="1"/>
<move x="454" y="367"/>
<move x="441" y="372"/>
<move x="428" y="372"/>
<move x="412" y="373"/>
<move x="405" y="377"/>
<move x="397" y="379"/>
<move x="395" y="380" k="1"/>
<move x="393" y="380" k="9"/>
<click x="393" y="380"/>
<move x="393" y="380" k="1"/>
<move x="391" y="380"/>
<move x="379" y="376"/>
<move x="347" y="376"/>
<move x="316" y="376"/>
<move x="302" y="377"/>
<move x="286" y="377"/>
<move x="275" y="377"/>
<move x="271" y="377"/>
<move x="266" y="377"/>
<move x="260" y="377"/>
<move x="256" y="378" k="12"/>
<click x="256" y="378"/>
<move x="256" y="378" k="2"/>
<move x="251" y="370"/>
<move x="241" y="360"/>
<move x="235" y="353"/>
<move x="226" y="342"/>
<move x="221" y="333"/>
<move x="213" y="321"/>
<move x="209" y="318"/>
<move x="207" y="315"/>
<move x="204" y="313"/>
<move x="200" y="311"/>
<move x="196" y="309"/>
<move x="193" y="306" k="11"/>
<click x="193" y="306"/>
<move x="193" y="306" k="2"/>
<move x="193" y="302"/>
<move x="191" y="295"/>
<move x="189" y="283"/>
<move x="184" y="270"/>
<move x="181" y="260"/>
<move x="181" y="258" k="2"/>
<move x="181" y="256"/>
<move x="181" y="253" k="10"/>
<click x="181" y="253"/>
<move x="181" y="253" k="12"/>
</way>
, <way>
<move x="556" y="74" k="2"/>
<move x="546" y="80"/>
<move x="510" y="88"/>
<move x="468" y="88"/>
<move x="430" y="91"/>
<move x="391" y="91"/>
<move x="361" y="89"/>
<move x="347" y="78"/>
<move x="323" y="73" k="1"/>
<move x="321" y="77"/>
<move x="317" y="85"/>
<move x="313" y="93"/>
<move x="311" y="95"/>
<move x="310" y="97"/>
<move x="307" y="100"/>
<move x="299" y="108"/>
<move x="295" y="111"/>
<move x="292" y="112"/>
<move x="290" y="112"/>
<move x="288" y="111" k="6"/>
<click x="288" y="111"/>
<move x="288" y="111" k="4"/>
<move x="288" y="114"/>
<move x="292" y="124"/>
<move x="306" y="149"/>
<move x="324" y="183"/>
<move x="342" y="220"/>
<move x="355" y="240"/>
<move x="370" y="253"/>
<move x="391" y="264"/>
<move x="412" y="278"/>
<move x="449" y="297"/>
<move x="467" y="307"/>
<move x="473" y="310" k="1"/>
<move x="475" y="310" k="3"/>
<move x="477" y="309" k="30"/>
<move x="479" y="309"/>
<move x="480" y="309"/>
<move x="482" y="309" k="2"/>
<move x="484" y="309" k="5"/>
<move x="486" y="309" k="12"/>
<click x="486" y="309"/>
<move x="486" y="309" k="3"/>
<move x="486" y="310"/>
<move x="484" y="311"/>
<move x="475" y="315"/>
<move x="467" y="322"/>
<move x="461" y="325"/>
<move x="454" y="325"/>
<move x="447" y="325"/>
<move x="435" y="325"/>
<move x="422" y="325"/>
<move x="412" y="326"/>
<move x="408" y="332"/>
<move x="407" y="334"/>
<move x="405" y="335" k="15"/>
<click x="405" y="335"/>
<move x="405" y="335" k="2"/>
<move x="399" y="338"/>
<move x="387" y="345"/>
<move x="373" y="353"/>
<move x="367" y="356"/>
<move x="361" y="360"/>
<move x="351" y="366" k="1"/>
<move x="350" y="368" k="1"/>
<move x="348" y="368"/>
<move x="343" y="367"/>
<move x="341" y="366" k="1"/>
<move x="341" y="364"/>
<move x="341" y="362"/>
<move x="341" y="360" k="7"/>
<click x="341" y="360"/>
<move x="341" y="360" k="12"/>
</way>
, <way>
<move x="595" y="131" k="7"/>
<move x="573" y="144"/>
<move x="533" y="164"/>
<move x="482" y="190"/>
<move x="468" y="197"/>
<move x="462" y="198"/>
<move x="437" y="206"/>
<move x="393" y="218"/>
<move x="355" y="222"/>
<move x="324" y="224"/>
<move x="293" y="226"/>
<move x="272" y="227"/>
<move x="259" y="227"/>
<move x="247" y="226"/>
<move x="233" y="219"/>
<move x="229" y="218"/>
<move x="222" y="218"/>
<move x="216" y="218"/>
<move x="212" y="219"/>
<move x="210" y="219"/>
<move x="209" y="220"/>
<move x="207" y="221" k="25"/>
<move x="207" y="219"/>
<move x="204" y="214" k="1"/>
<move x="230" y="231"/>
<move x="349" y="291"/>
<move x="436" y="339"/>
<move x="479" y="379"/>
<stripe_down_over x="493" y="396"/>
<move x="504" y="408"/>
<move x="507" y="410" k="1"/>
<move x="508" y="414"/>
<move x="512" y="422"/>
<move x="516" y="430"/>
<stripe_down_out x="519" y="434"/>
<move x="519" y="439" k="1"/>
<move x="520" y="443"/>
<move x="520" y="447" k="7"/>
<count_volt x="520" y="447"/>
<move x="520" y="447" k="1"/>
<move x="514" y="438"/>
<stripe_down_over x="509" y="431"/>
<stripe_down_out x="500" y="425"/>
<stripe_down_over x="492" y="420"/>
<move x="442" y="395"/>
<stripe_down_out x="407" y="376"/>
<move x="356" y="344"/>
<move x="324" y="323"/>
<move x="299" y="303"/>
<move x="284" y="290"/>
<move x="270" y="279"/>
<move x="256" y="263"/>
<move x="244" y="254"/>
<move x="234" y="246"/>
<move x="223" y="240"/>
<move x="217" y="237"/>
<move x="209" y="233"/>
<move x="205" y="229"/>
<move x="199" y="226"/>
<move x="198" y="224" k="6"/>
<move x="198" y="231"/>
<move x="199" y="235" k="9"/>
<click x="199" y="235"/>
<move x="199" y="235" k="4"/>
<move x="219" y="238"/>
<move x="277" y="245"/>
<move x="326" y="251"/>
<move x="371" y="251"/>
<move x="389" y="251"/>
<move x="399" y="251"/>
<move x="405" y="251"/>
<move x="413" y="250"/>
<move x="420" y="248"/>
<move x="427" y="248"/>
<move x="439" y="243"/>
<move x="445" y="243" k="8"/>
<click x="445" y="243"/>
<move x="445" y="243" k="4"/>
<move x="438" y="248"/>
<move x="430" y="254"/>
<move x="420" y="262"/>
<move x="414" y="267"/>
<move x="405" y="273"/>
<move x="396" y="276"/>
<move x="384" y="278"/>
<move x="371" y="281"/>
<move x="359" y="284"/>
<move x="345" y="289"/>
<move x="338" y="293"/>
<move x="333" y="297"/>
<move x="329" y="299"/>
<move x="325" y="303"/>
<move x="320" y="310"/>
<move x="316" y="311"/>
<move x="313" y="312"/>
<move x="310" y="313"/>
<move x="308" y="313" k="9"/>
<move x="306" y="313" k="2"/>
<move x="306" y="311"/>
<move x="306" y="309"/>
<move x="308" y="305"/>
<move x="309" y="303"/>
<move x="310" y="297"/>
<move x="312" y="294"/>
<move x="314" y="289"/>
<move x="319" y="282"/>
<move x="319" y="274" k="2"/>
<move x="319" y="272" k="4"/>
<move x="319" y="270"/>
<move x="317" y="270" k="1"/>
<move x="317" y="268" k="2"/>
<move x="316" y="266" k="3"/>
<move x="315" y="264" k="1"/>
<move x="314" y="262" k="24"/>
<move x="314" y="260"/>
<move x="314" y="255"/>
<move x="314" y="251"/>
<move x="314" y="247"/>
<move x="314" y="246" k="4"/>
<move x="314" y="244" k="7"/>
<move x="312" y="244" k="1"/>
<move x="312" y="245"/>
<move x="311" y="251"/>
<move x="311" y="253"/>
<move x="311" y="255"/>
<move x="311" y="258" k="2"/>
<move x="311" y="260" k="18"/>
<move x="309" y="260"/>
<move x="307" y="260"/>
<move x="306" y="258"/>
<move x="303" y="255" k="9"/>
<move x="301" y="255" k="1"/>
<move x="299" y="255"/>
<move x="296" y="252"/>
<move x="292" y="251"/>
<move x="290" y="249" k="2"/>
<move x="289" y="249"/>
<move x="287" y="248" k="5"/>
<click x="287" y="248"/>
<move x="287" y="248" k="1"/>
<move x="292" y="247"/>
<move x="298" y="253"/>
<move x="313" y="257"/>
<move x="322" y="259"/>
<move x="327" y="259"/>
<move x="334" y="259"/>
<move x="338" y="259"/>
<move x="340" y="259"/>
<move x="341" y="259"/>
<move x="348" y="256"/>
<move x="352" y="255" k="1"/>
<move x="354" y="255"/>
<move x="355" y="255" k="5"/>
<click x="355" y="255"/>
<move x="357" y="254" k="1"/>
<move x="359" y="244"/>
<move x="362" y="231"/>
<move x="365" y="210"/>
<move x="366" y="187"/>
<move x="366" y="172"/>
<move x="366" y="164"/>
<move x="363" y="159"/>
<move x="361" y="155"/>
<move x="359" y="151"/>
<move x="355" y="143"/>
<move x="354" y="136"/>
<move x="351" y="129"/>
<move x="351" y="121"/>
<move x="347" y="111"/>
<move x="347" y="109" k="1"/>
<move x="346" y="107" k="1"/>
<move x="343" y="101"/>
<move x="342" y="96"/>
<stripe_up_over x="341" y="94"/>
<move x="341" y="92" k="1"/>
<move x="339" y="91" k="2"/>
<move x="338" y="89" k="10"/>
<stripe_up_out x="335" y="95"/>
<move x="330" y="103"/>
<move x="327" y="110"/>
<move x="325" y="116"/>
<move x="317" y="128"/>
<move x="302" y="143"/>
<move x="279" y="157"/>
<move x="262" y="165"/>
<move x="260" y="166" k="1"/>
<move x="261" y="163"/>
<move x="266" y="155"/>
<move x="269" y="144"/>
<move x="279" y="123"/>
<move x="282" y="102"/>
<stripe_up_over x="283" y="83"/>
<move x="283" y="75" k="13"/>
<move x="282" y="84"/>
<move x="280" y="93"/>
<stripe_up_out x="279" y="97"/>
<move x="277" y="108"/>
<move x="276" y="121"/>
<move x="276" y="133"/>
<move x="276" y="136"/>
<move x="272" y="149"/>
<move x="262" y="173"/>
<move x="252" y="193"/>
<move x="238" y="218"/>
<move x="227" y="250"/>
<move x="217" y="274"/>
<move x="215" y="276" k="2"/>
<move x="214" y="278"/>
<move x="208" y="287"/>
<move x="205" y="297"/>
<move x="203" y="309"/>
<move x="203" y="315"/>
<move x="203" y="319" k="1"/>
<move x="203" y="320" k="4"/>
<move x="202" y="314"/>
<move x="199" y="311"/>
<move x="199" y="309" k="5"/>
<move x="197" y="309" k="1"/>
<move x="195" y="309"/>
<move x="195" y="307"/>
<move x="193" y="307" k="10"/>
<click x="193" y="307"/>
<move x="193" y="307" k="2"/>
<move x="194" y="306"/>
<move x="209" y="303"/>
<move x="240" y="300"/>
<move x="278" y="300"/>
<move x="320" y="300"/>
<move x="358" y="300"/>
<move x="382" y="298"/>
<move x="397" y="295"/>
<move x="403" y="292"/>
<move x="410" y="290"/>
<move x="418" y="289"/>
<move x="428" y="288"/>
<move x="449" y="293"/>
<move x="461" y="295"/>
<move x="463" y="296"/>
<move x="465" y="297" k="3"/>
<move x="465" y="298" k="2"/>
<move x="465" y="300" k="21"/>
<click x="465" y="300"/>
<move x="465" y="300" k="11"/>
</way>
, <way>
<move x="501" y="183" k="7"/>
<move x="497" y="183"/>
<move x="491" y="183"/>
<move x="484" y="185"/>
<move x="472" y="185"/>
<move x="441" y="183"/>
<move x="398" y="173"/>
<move x="386" y="166"/>
<move x="380" y="154"/>
<move x="375" y="133" k="1"/>
<move x="372" y="130" k="2"/>
<move x="367" y="122"/>
<move x="362" y="113"/>
<stripe_up_over x="354" y="94"/>
<move x="345" y="85"/>
<move x="341" y="84" k="1"/>
<move x="334" y="80"/>
<move x="333" y="78"/>
<move x="331" y="72"/>
<move x="330" y="70" k="2"/>
<move x="329" y="68"/>
<move x="327" y="68"/>
<move x="327" y="66" k="10"/>
<move x="325" y="65" k="1"/>
<move x="325" y="68"/>
<move x="325" y="75"/>
<move x="321" y="84"/>
<move x="321" y="88"/>
<move x="320" y="89"/>
<stripe_up_out x="317" y="97"/>
<move x="309" y="124"/>
<move x="299" y="160"/>
<move x="291" y="196"/>
<move x="285" y="215"/>
<move x="285" y="217"/>
<move x="284" y="219"/>
<move x="281" y="224"/>
<move x="278" y="232"/>
<move x="282" y="239"/>
<move x="289" y="246"/>
<move x="296" y="256"/>
<move x="296" y="257"/>
<move x="296" y="265"/>
<move x="297" y="270"/>
<move x="297" y="278"/>
<move x="297" y="281"/>
<move x="297" y="283"/>
<move x="297" y="285" k="2"/>
<move x="295" y="285" k="1"/>
<move x="293" y="285" k="8"/>
<click x="293" y="285"/>
<move x="293" y="285" k="3"/>
<move x="298" y="281"/>
<move x="322" y="277"/>
<move x="345" y="277"/>
<move x="369" y="280"/>
<move x="379" y="281"/>
<move x="381" y="281" k="1"/>
<move x="381" y="285" k="2"/>
<move x="383" y="289" k="1"/>
<move x="385" y="289" k="4"/>
<move x="387" y="289"/>
<move x="389" y="289"/>
<move x="391" y="289"/>
<move x="393" y="288"/>
<move x="394" y="288"/>
<move x="396" y="287"/>
<move x="398" y="286" k="6"/>
<click x="398" y="286"/>
<move x="400" y="286" k="1"/>
<move x="402" y="285" k="1"/>
<move x="407" y="285"/>
<move x="420" y="283"/>
<move x="437" y="281"/>
<move x="454" y="281"/>
<move x="459" y="283"/>
<move x="460" y="284"/>
<move x="463" y="287"/>
<move x="467" y="290"/>
<move x="471" y="292"/>
<move x="475" y="292"/>
<move x="478" y="292"/>
<move x="481" y="290" k="9"/>
<click x="481" y="290"/>
<move x="481" y="290" k="7"/>
<move x="473" y="290"/>
<move x="451" y="288"/>
<move x="418" y="293"/>
<move x="393" y="296"/>
<move x="348" y="308"/>
<move x="320" y="311"/>
<move x="302" y="312"/>
<move x="284" y="317"/>
<move x="260" y="320"/>
<move x="238" y="324"/>
<move x="226" y="325"/>
<move x="218" y="325"/>
<move x="214" y="325"/>
<move x="213" y="325"/>
<move x="209" y="323"/>
<move x="206" y="320"/>
<move x="205" y="316"/>
<move x="204" y="314" k="1"/>
<move x="204" y="310"/>
<move x="204" y="307"/>
<move x="202" y="305"/>
<move x="202" y="301"/>
<move x="200" y="298" k="1"/>
<move x="194" y="293"/>
<move x="192" y="292"/>
<move x="190" y="288"/>
<move x="189" y="285"/>
<move x="187" y="284" k="7"/>
<click x="187" y="284"/>
<move x="187" y="284" k="5"/>
<move x="187" y="293"/>
<move x="187" y="303"/>
<move x="197" y="325"/>
<move x="211" y="342"/>
<move x="220" y="353"/>
<move x="221" y="368"/>
<move x="221" y="385"/>
<move x="219" y="388" k="1"/>
<move x="211" y="388"/>
<move x="205" y="388" k="2"/>
<move x="203" y="388" k="1"/>
<move x="201" y="388"/>
<move x="199" y="393"/>
<stripe_down_over x="199" y="395"/>
<move x="197" y="396"/>
<move x="197" y="398" k="5"/>
<stripe_down_out x="206" y="390"/>
<move x="228" y="375"/>
<move x="255" y="358"/>
<move x="263" y="348"/>
<move x="271" y="342"/>
<move x="291" y="324"/>
<move x="300" y="309"/>
<move x="303" y="306" k="5"/>
<move x="293" y="298"/>
<move x="288" y="291"/>
<move x="280" y="279"/>
<move x="272" y="268"/>
<move x="271" y="265" k="5"/>
<move x="276" y="273" k="10"/>
<click x="276" y="273"/>
<move x="276" y="273" k="1"/>
<move x="279" y="286"/>
<move x="281" y="300"/>
<move x="282" y="317"/>
<move x="275" y="328"/>
<move x="269" y="335"/>
<move x="264" y="339"/>
<move x="263" y="345"/>
<move x="263" y="350"/>
<move x="263" y="360"/>
<move x="261" y="366"/>
<move x="261" y="368" k="4"/>
<move x="262" y="368"/>
<move x="264" y="368"/>
<move x="264" y="370" k="1"/>
<move x="265" y="370" k="3"/>
<click x="265" y="370"/>
<move x="265" y="368"/>
<move x="265" y="362"/>
<move x="265" y="354"/>
<move x="265" y="351" k="6"/>
<click x="265" y="351"/>
<move x="265" y="351" k="2"/>
<move x="265" y="354"/>
<move x="266" y="360" k="2"/>
<move x="266" y="362"/>
<move x="265" y="365"/>
<move x="262" y="373"/>
<move x="262" y="377"/>
<move x="262" y="382"/>
<move x="262" y="386"/>
<move x="261" y="391"/>
<stripe_down_over x="261" y="395"/>
<move x="261" y="402"/>
<move x="261" y="408"/>
<move x="261" y="413"/>
<move x="262" y="426"/>
<move x="262" y="434"/>
<move x="262" y="436" k="7"/>
<move x="262" y="434"/>
<move x="262" y="430"/>
<move x="262" y="428"/>
<move x="262" y="424"/>
<move x="262" y="417"/>
<move x="262" y="397"/>
<stripe_down_out x="264" y="389"/>
<move x="267" y="338"/>
<move x="273" y="313"/>
<move x="273" y="298"/>
<move x="273" y="283"/>
<move x="275" y="272"/>
<move x="275" y="265"/>
<move x="275" y="258"/>
<move x="275" y="254"/>
<move x="275" y="252"/>
<move x="272" y="247"/>
<move x="271" y="246"/>
<move x="269" y="245"/>
<move x="264" y="239" k="4"/>
<move x="264" y="237"/>
<move x="264" y="232"/>
<move x="263" y="226"/>
<move x="262" y="222"/>
<move x="262" y="217"/>
<move x="262" y="213" k="10"/>
<click x="262" y="213"/>
<move x="262" y="213" k="2"/>
<move x="259" y="206"/>
<move x="255" y="199"/>
<move x="254" y="195" k="7"/>
<click x="254" y="195"/>
<move x="254" y="195" k="1"/>
<move x="255" y="201"/>
<move x="258" y="210"/>
<move x="263" y="223"/>
<move x="263" y="236"/>
<move x="260" y="245"/>
<move x="259" y="251"/>
<move x="259" y="255"/>
<move x="261" y="261"/>
<move x="265" y="264" k="1"/>
<move x="268" y="269"/>
<move x="268" y="272"/>
<move x="268" y="274"/>
<move x="268" y="278" k="1"/>
<move x="268" y="282" k="8"/>
<click x="268" y="282"/>
<move x="268" y="282"/>
<move x="268" y="283"/>
<move x="268" y="287" k="1"/>
<move x="265" y="296"/>
<move x="261" y="310"/>
<move x="258" y="319"/>
<move x="258" y="327"/>
<move x="258" y="332"/>
<move x="258" y="338"/>
<move x="259" y="343"/>
<move x="259" y="349"/>
<move x="259" y="355"/>
<move x="259" y="360"/>
<move x="260" y="364"/>
<move x="260" y="366"/>
<move x="261" y="368" k="5"/>
<move x="262" y="370"/>
<move x="264" y="373"/>
<move x="264" y="375" k="8"/>
<click x="264" y="375"/>
<move x="264" y="375" k="2"/>
<move x="262" y="371"/>
<move x="262" y="369"/>
<move x="261" y="363"/>
<move x="260" y="360"/>
<move x="259" y="358" k="7"/>
<click x="259" y="358"/>
<move x="259" y="358" k="4"/>
<move x="259" y="359"/>
<move x="259" y="367"/>
<move x="259" y="372"/>
<move x="259" y="380"/>
<move x="259" y="392"/>
<stripe_down_over x="259" y="395"/>
<move x="260" y="409"/>
<move x="258" y="437"/>
<move x="258" y="443" k="10"/>
<move x="258" y="441"/>
<move x="258" y="439"/>
<move x="260" y="434"/>
<move x="264" y="423"/>
<move x="268" y="408"/>
<stripe_down_out x="273" y="391"/>
<move x="281" y="354"/>
<move x="283" y="326"/>
<move x="283" y="291"/>
<move x="283" y="270"/>
<move x="286" y="260"/>
<move x="286" y="257"/>
<move x="286" y="251"/>
<move x="284" y="251"/>
<move x="277" y="248"/>
<move x="270" y="248"/>
<move x="263" y="244"/>
<move x="259" y="243"/>
<move x="257" y="243" k="7"/>
<click x="257" y="243"/>
<move x="257" y="243" k="2"/>
<move x="257" y="244"/>
<move x="259" y="250"/>
<move x="261" y="253"/>
<move x="267" y="259"/>
<move x="271" y="261"/>
<move x="274" y="262"/>
<move x="276" y="264"/>
<move x="284" y="266"/>
<move x="292" y="268"/>
<move x="296" y="270"/>
<move x="300" y="271"/>
<move x="301" y="272"/>
<move x="303" y="273"/>
<move x="304" y="275"/>
<move x="306" y="276"/>
<move x="308" y="277"/>
<move x="314" y="278"/>
<move x="315" y="278" k="9"/>
<click x="315" y="278"/>
<move x="315" y="278" k="7"/>
<move x="313" y="278" k="2"/>
<move x="314" y="278"/>
</way>
, <way>
<move x="445" y="222" k="10"/>
<move x="443" y="222" k="1"/>
<move x="433" y="222"/>
<move x="414" y="219"/>
<move x="343" y="193"/>
<move x="284" y="170"/>
<move x="247" y="151"/>
<move x="226" y="139"/>
<move x="205" y="126"/>
<move x="189" y="115"/>
<move x="168" y="107"/>
<move x="151" y="104"/>
<move x="147" y="104"/>
<move x="140" y="104"/>
<move x="128" y="104"/>
<move x="120" y="104"/>
<move x="116" y="101"/>
<move x="114" y="99" k="8"/>
<click x="114" y="99"/>
<move x="114" y="99" k="3"/>
<move x="124" y="105"/>
<move x="157" y="127"/>
<move x="183" y="143"/>
<move x="211" y="164"/>
<move x="256" y="194"/>
<move x="299" y="219"/>
<move x="351" y="245"/>
<move x="395" y="266"/>
<move x="421" y="278"/>
<move x="444" y="291"/>
<move x="457" y="297"/>
<move x="464" y="299"/>
<move x="468" y="299"/>
<move x="474" y="299"/>
<move x="475" y="299"/>
<move x="477" y="298"/>
<move x="483" y="297"/>
<move x="485" y="297"/>
<move x="486" y="297" k="1"/>
<move x="488" y="297"/>
<move x="491" y="298"/>
<move x="492" y="299"/>
<move x="494" y="299" k="1"/>
<move x="497" y="301" k="2"/>
<move x="501" y="302"/>
<move x="503" y="303"/>
<move x="505" y="303"/>
<move x="507" y="304" k="10"/>
<click x="507" y="304"/>
<move x="507" y="304" k="9"/>
<move x="508" y="302"/>
<move x="508" y="300"/>
<move x="510" y="297"/>
<move x="512" y="293"/>
<move x="513" y="287"/>
<move x="513" y="285"/>
<move x="513" y="283"/>
<move x="513" y="281" k="1"/>
<move x="511" y="280"/>
<move x="507" y="280"/>
<move x="505" y="280"/>
<move x="503" y="280" k="1"/>
<move x="501" y="280" k="8"/>
<move x="502" y="280"/>
<move x="504" y="280"/>
<move x="508" y="280"/>
<move x="512" y="280"/>
<move x="515" y="280"/>
<move x="523" y="280"/>
<move x="529" y="280"/>
<move x="534" y="280"/>
<move x="538" y="280"/>
<move x="544" y="280"/>
<move x="549" y="280"/>
<move x="551" y="280" k="2"/>
<move x="545" y="281"/>
<move x="541" y="281" k="1"/>
<move x="539" y="281"/>
<move x="538" y="281"/>
<move x="532" y="281"/>
<move x="528" y="282"/>
<move x="521" y="284"/>
<move x="518" y="285"/>
<move x="514" y="287"/>
<move x="510" y="292"/>
<move x="509" y="294" k="1"/>
<move x="508" y="296" k="1"/>
<move x="508" y="297"/>
<move x="508" y="299" k="8"/>
<click x="508" y="299"/>
<move x="508" y="299" k="3"/>
<move x="509" y="300" k="7"/>
</way>
, <way>
<move x="412" y="278" k="11"/>
<move x="376" y="272"/>
<move x="364" y="272"/>
<move x="337" y="272"/>
<move x="314" y="273"/>
<move x="302" y="274" k="6"/>
<move x="289" y="271"/>
<move x="273" y="268"/>
<move x="260" y="264"/>
<move x="248" y="264"/>
<move x="228" y="267"/>
<move x="194" y="285"/>
<move x="156" y="299"/>
<move x="125" y="314"/>
<move x="114" y="319"/>
<move x="105" y="322"/>
<move x="104" y="322" k="2"/>
<move x="104" y="326"/>
<move x="100" y="337"/>
<move x="94" y="346"/>
<move x="92" y="350"/>
<move x="88" y="350"/>
<move x="72" y="350"/>
<move x="66" y="350" k="1"/>
<move x="64" y="350" k="4"/>
<click x="64" y="350"/>
<move x="64" y="350" k="3"/>
<move x="77" y="344"/>
<move x="88" y="340"/>
<move x="96" y="336"/>
<move x="98" y="336"/>
<move x="101" y="335"/>
<move x="105" y="332"/>
<move x="107" y="330"/>
<move x="107" y="328"/>
<move x="108" y="323"/>
<move x="109" y="323"/>
<move x="109" y="321"/>
<move x="109" y="319" k="4"/>
<move x="106" y="313"/>
<move x="105" y="309"/>
<move x="103" y="305" k="1"/>
<move x="102" y="303" k="1"/>
<move x="101" y="301" k="3"/>
<move x="101" y="299" k="1"/>
<click x="101" y="299"/>
<move x="101" y="299"/>
<move x="101" y="295"/>
<move x="107" y="292"/>
<move x="125" y="281"/>
<move x="136" y="275"/>
<move x="138" y="275" k="1"/>
<move x="148" y="272"/>
<move x="156" y="269"/>
<move x="164" y="269"/>
<move x="166" y="268"/>
<move x="169" y="268"/>
<move x="171" y="268" k="2"/>
<move x="173" y="268" k="2"/>
<move x="174" y="269"/>
<move x="176" y="270" k="3"/>
<move x="176" y="272" k="1"/>
<move x="176" y="274"/>
<move x="175" y="276" k="7"/>
<click x="175" y="276"/>
<move x="175" y="276" k="1"/>
<move x="150" y="259"/>
<move x="132" y="251"/>
<move x="126" y="250"/>
<move x="119" y="242"/>
<move x="114" y="239"/>
<move x="110" y="233"/>
<move x="105" y="228" k="1"/>
<move x="104" y="226" k="15"/>
<click x="104" y="226"/>
<move x="104" y="226" k="1"/>
<move x="107" y="224"/>
<move x="136" y="209"/>
<move x="173" y="192"/>
<move x="184" y="188"/>
<move x="185" y="186"/>
<move x="185" y="182" k="5"/>
<move x="183" y="180" k="14"/>
<move x="181" y="180" k="4"/>
<move x="179" y="181" k="8"/>
<click x="179" y="181"/>
<move x="179" y="181" k="2"/>
<move x="198" y="186"/>
<move x="246" y="217"/>
<move x="289" y="235"/>
<move x="353" y="265"/>
<move x="447" y="310"/>
<move x="487" y="334"/>
<move x="508" y="351"/>
<move x="515" y="357" k="2"/>
<move x="522" y="361"/>
<move x="542" y="362"/>
<move x="559" y="363"/>
<move x="568" y="364"/>
<move x="580" y="369"/>
<move x="584" y="371" k="5"/>
<move x="586" y="372" k="4"/>
<move x="587" y="372" k="1"/>
<move x="591" y="371" k="6"/>
<move x="595" y="370"/>
<move x="597" y="369"/>
<move x="599" y="369" k="1"/>
<move x="602" y="369" k="2"/>
<click x="602" y="369"/>
<move x="602" y="369" k="1"/>
<move x="593" y="360"/>
<move x="573" y="341"/>
<move x="560" y="332"/>
<move x="553" y="324"/>
<move x="544" y="315"/>
<move x="540" y="313"/>
<move x="537" y="310"/>
<move x="529" y="309" k="10"/>
<move x="530" y="309" k="3"/>
<click x="530" y="309"/>
<move x="530" y="309"/>
<move x="535" y="307"/>
<move x="562" y="298"/>
<move x="584" y="290"/>
<move x="593" y="285" k="2"/>
<move x="599" y="283" k="2"/>
<move x="599" y="281" k="1"/>
<move x="601" y="279" k="8"/>
<click x="601" y="279"/>
<move x="601" y="279" k="1"/>
<move x="588" y="271"/>
<move x="562" y="261"/>
<move x="558" y="255"/>
<move x="551" y="245"/>
<move x="547" y="240"/>
<move x="544" y="235"/>
<move x="544" y="234"/>
<move x="542" y="231"/>
<move x="539" y="229" k="10"/>
<click x="539" y="229"/>
<move x="539" y="229" k="1"/>
<move x="545" y="225"/>
<move x="557" y="220"/>
<move x="572" y="210"/>
<move x="582" y="199"/>
<move x="590" y="195"/>
<move x="595" y="193" k="1"/>
<move x="597" y="193"/>
<move x="603" y="190" k="11"/>
<click x="603" y="190"/>
<move x="603" y="190" k="5"/>
<move x="599" y="189"/>
<move x="577" y="178"/>
<move x="571" y="175"/>
<move x="561" y="170"/>
<move x="548" y="165"/>
<move x="545" y="162"/>
<move x="541" y="161"/>
<move x="529" y="156"/>
<move x="521" y="153" k="5"/>
<move x="527" y="150"/>
<move x="537" y="147" k="10"/>
<click x="537" y="147"/>
<move x="537" y="147" k="9"/>
<move x="532" y="149"/>
<move x="512" y="149"/>
<move x="484" y="143"/>
<move x="459" y="140"/>
<move x="435" y="136"/>
<move x="407" y="132"/>
<move x="383" y="130"/>
<move x="344" y="125"/>
<move x="324" y="124"/>
<move x="279" y="135"/>
<move x="233" y="139"/>
<move x="196" y="140"/>
<move x="168" y="142"/>
<move x="149" y="145"/>
<move x="132" y="147"/>
<move x="131" y="147" k="6"/>
<click x="131" y="147"/>
<move x="131" y="147" k="2"/>
<move x="136" y="143"/>
<move x="160" y="133"/>
<move x="189" y="125"/>
<move x="199" y="121"/>
<move x="203" y="117"/>
<move x="208" y="115" k="1"/>
<move x="208" y="114" k="1"/>
<move x="206" y="112"/>
<move x="200" y="112" k="1"/>
<move x="198" y="112" k="4"/>
<move x="196" y="112" k="3"/>
<click x="196" y="112"/>
<move x="196" y="112" k="3"/>
<move x="185" y="104"/>
<move x="176" y="97"/>
<move x="166" y="90"/>
<move x="164" y="86" k="1"/>
<move x="164" y="85" k="1"/>
<move x="165" y="85" k="3"/>
<move x="175" y="85"/>
<move x="179" y="85" k="3"/>
<click x="179" y="85"/>
<move x="179" y="85" k="1"/>
<move x="179" y="83"/>
<move x="183" y="80"/>
<move x="206" y="78"/>
<move x="216" y="79"/>
<move x="223" y="78"/>
<move x="227" y="78"/>
<move x="231" y="78" k="1"/>
<move x="235" y="79"/>
<move x="237" y="79"/>
<move x="245" y="87" k="1"/>
<move x="253" y="90"/>
<move x="269" y="94"/>
<move x="277" y="102"/>
<move x="283" y="108"/>
<move x="298" y="119"/>
<move x="308" y="123" k="1"/>
<click x="308" y="123"/>
<move x="308" y="123"/>
<move x="313" y="124"/>
<move x="341" y="132"/>
<move x="367" y="148"/>
<move x="386" y="166"/>
<move x="395" y="185"/>
<move x="400" y="193"/>
<move x="400" y="195"/>
<move x="400" y="198"/>
<move x="398" y="206"/>
<move x="403" y="219"/>
<move x="433" y="270"/>
<move x="442" y="284"/>
<move x="442" y="288"/>
<move x="444" y="294"/>
<move x="444" y="298"/>
<move x="444" y="300" k="1"/>
<move x="446" y="300" k="1"/>
<move x="446" y="296"/>
<click x="446" y="296"/>
<move x="446" y="296" k="2"/>
<move x="458" y="295"/>
<move x="459" y="289"/>
<move x="459" y="283"/>
<move x="459" y="280"/>
<move x="457" y="274"/>
<move x="443" y="244"/>
<move x="437" y="235"/>
<move x="417" y="206"/>
<move x="407" y="192"/>
</way>
, <way>
<move x="291" y="189" k="3"/>
<move x="287" y="189"/>
<move x="280" y="186"/>
<move x="276" y="186"/>
<move x="258" y="189"/>
<move x="216" y="190"/>
<move x="181" y="190"/>
<move x="169" y="190"/>
<move x="165" y="190"/>
<move x="160" y="190"/>
<move x="150" y="191"/>
<move x="140" y="192"/>
<move x="133" y="192"/>
<move x="121" y="193"/>
<move x="109" y="193"/>
<move x="94" y="193"/>
<move x="88" y="193"/>
<move x="84" y="191"/>
<move x="80" y="190"/>
<move x="75" y="189"/>
<move x="74" y="187" k="9"/>
<click x="74" y="187"/>
<move x="74" y="187" k="1"/>
<move x="74" y="188"/>
<move x="74" y="198"/>
<move x="74" y="210"/>
<move x="74" y="222"/>
<move x="74" y="232"/>
<move x="74" y="249"/>
<move x="74" y="259"/>
<move x="74" y="261"/>
<move x="74" y="263"/>
<move x="74" y="265"/>
<move x="74" y="266"/>
<move x="74" y="268"/>
<move x="71" y="272" k="2"/>
<move x="70" y="274" k="6"/>
<click x="70" y="274"/>
<move x="70" y="274" k="1"/>
<move x="71" y="275"/>
<move x="99" y="277"/>
<move x="166" y="277"/>
<move x="228" y="272"/>
<move x="282" y="262"/>
<move x="320" y="250"/>
<move x="350" y="240"/>
<move x="397" y="229"/>
<move x="448" y="217"/>
<move x="502" y="205"/>
<move x="534" y="197"/>
<move x="544" y="194" k="1"/>
<move x="550" y="194"/>
<move x="561" y="194"/>
<move x="569" y="195" k="1"/>
<move x="570" y="195"/>
<move x="572" y="194" k="2"/>
<move x="576" y="194"/>
<move x="580" y="194" k="7"/>
<click x="580" y="194"/>
<move x="580" y="194"/>
<move x="581" y="201"/>
<move x="581" y="211"/>
<move x="585" y="222"/>
<move x="591" y="237"/>
<move x="596" y="246"/>
<move x="600" y="251"/>
<move x="601" y="253"/>
<move x="601" y="258"/>
<move x="601" y="266"/>
<move x="601" y="268" k="8"/>
<click x="601" y="268"/>
<move x="602" y="271"/>
<move x="597" y="285"/>
<move x="585" y="328"/>
<move x="575" y="389"/>
<move x="569" y="432"/>
<move x="565" y="450"/>
<move x="562" y="459"/>
<move x="559" y="464"/>
<move x="556" y="467"/>
<move x="547" y="472"/>
<move x="540" y="472"/>
<move x="536" y="471"/>
<move x="532" y="469"/>
<move x="529" y="467"/>
<move x="527" y="466" k="5"/>
<count_volt x="526" y="464"/>
<move x="523" y="456"/>
<move x="520" y="454"/>
<move x="519" y="450"/>
<move x="516" y="443"/>
<move x="514" y="439"/>
<move x="504" y="409"/>
<move x="485" y="365"/>
<move x="466" y="307"/>
<move x="447" y="259"/>
<move x="424" y="226"/>
<move x="424" y="224" k="4"/>
<move x="424" y="227"/>
<move x="424" y="239"/>
<move x="428" y="248"/>
<move x="429" y="250"/>
<move x="430" y="256"/>
<move x="434" y="263"/>
<move x="438" y="265"/>
<move x="441" y="268"/>
<move x="444" y="269" k="1"/>
<move x="446" y="269"/>
<move x="448" y="269"/>
<move x="452" y="269"/>
<move x="454" y="269"/>
<move x="455" y="269"/>
<move x="456" y="270"/>
<move x="458" y="270" k="5"/>
<click x="458" y="270"/>
<move x="458" y="270" k="1"/>
<move x="417" y="267"/>
<move x="371" y="270"/>
<move x="318" y="270"/>
<move x="276" y="272"/>
<move x="251" y="280"/>
<move x="228" y="284"/>
<move x="214" y="289"/>
<move x="196" y="291"/>
<move x="188" y="290"/>
<move x="181" y="286"/>
<move x="171" y="284"/>
<move x="161" y="280"/>
<move x="155" y="279" k="3"/>
<move x="155" y="277"/>
<move x="158" y="276"/>
<move x="160" y="276"/>
<move x="166" y="276"/>
<move x="167" y="276" k="5"/>
<move x="165" y="276"/>
<move x="159" y="273"/>
<move x="157" y="273"/>
<move x="155" y="273" k="8"/>
<click x="155" y="273"/>
<move x="155" y="273" k="1"/>
<move x="156" y="273"/>
<move x="162" y="277"/>
<move x="183" y="289"/>
<move x="205" y="298"/>
<move x="217" y="299"/>
<move x="218" y="301"/>
<move x="237" y="309"/>
<move x="277" y="322"/>
<move x="321" y="342"/>
<move x="352" y="368"/>
<move x="379" y="407"/>
<move x="400" y="428"/>
<move x="413" y="438" k="2"/>
<move x="424" y="440"/>
<move x="439" y="440"/>
<move x="452" y="440"/>
<move x="461" y="446"/>
<move x="474" y="452"/>
<move x="482" y="454" k="4"/>
<move x="480" y="454" k="3"/>
<count_volt x="478" y="454"/>
<move x="476" y="446"/>
<move x="472" y="438"/>
<move x="467" y="424"/>
<move x="456" y="405"/>
<move x="446" y="387"/>
<move x="429" y="368"/>
<move x="394" y="338"/>
<move x="373" y="316"/>
<move x="348" y="299"/>
<move x="324" y="288"/>
<move x="315" y="282"/>
<move x="305" y="278"/>
<move x="297" y="274"/>
<move x="294" y="267"/>
<move x="287" y="258"/>
<move x="283" y="253"/>
<move x="274" y="244"/>
<move x="268" y="241"/>
<move x="262" y="236" k="3"/>
<move x="260" y="234"/>
<move x="254" y="233"/>
<move x="251" y="231"/>
<move x="249" y="227"/>
<move x="248" y="225"/>
<move x="246" y="223"/>
<move x="245" y="215"/>
<move x="245" y="212" k="6"/>
<move x="245" y="208"/>
<move x="245" y="202"/>
<move x="245" y="199"/>
<move x="245" y="197" k="13"/>
<click x="245" y="197"/>
<move x="245" y="197" k="2"/>
<move x="252" y="201"/>
<move x="265" y="215"/>
<move x="284" y="241"/>
<move x="317" y="283"/>
<move x="363" y="346"/>
<move x="394" y="392"/>
<move x="427" y="445"/>
<move x="458" y="479"/>
<move x="466" y="485"/>
<move x="467" y="488"/>
<move x="474" y="489"/>
<move x="492" y="483"/>
<move x="512" y="472"/>
<move x="515" y="466"/>
<move x="516" y="460"/>
<move x="516" y="455"/>
<move x="516" y="453"/>
<move x="517" y="452" k="7"/>
<count_volt x="517" y="452"/>
<move x="517" y="452" k="1"/>
<move x="515" y="444"/>
<move x="499" y="426"/>
<move x="476" y="403"/>
<move x="449" y="357"/>
<move x="425" y="333"/>
<move x="401" y="314"/>
<move x="387" y="304"/>
<move x="376" y="294"/>
<move x="373" y="291"/>
<move x="367" y="285"/>
<move x="357" y="278"/>
<move x="351" y="274"/>
<move x="347" y="269"/>
<move x="343" y="265"/>
<move x="337" y="261"/>
<move x="333" y="252"/>
<move x="324" y="245"/>
<move x="317" y="242"/>
<move x="311" y="240"/>
<move x="308" y="238"/>
<move x="306" y="237"/>
<move x="301" y="236"/>
<move x="297" y="236" k="1"/>
<move x="295" y="236"/>
<move x="292" y="237" k="2"/>
<move x="288" y="237"/>
<move x="284" y="237"/>
<move x="283" y="237"/>
<move x="281" y="237" k="4"/>
<move x="282" y="237"/>
<move x="288" y="235"/>
<move x="292" y="235"/>
<move x="295" y="234" k="4"/>
<click x="296" y="232"/>
<move x="300" y="232"/>
<move x="302" y="232"/>
<move x="306" y="231" k="1"/>
<move x="309" y="230" k="1"/>
<move x="313" y="230"/>
<move x="318" y="230"/>
<move x="335" y="225"/>
<move x="344" y="220"/>
<move x="354" y="216"/>
<move x="364" y="213"/>
<move x="369" y="211"/>
<move x="370" y="211"/>
<move x="372" y="210"/>
<move x="376" y="210"/>
<move x="378" y="210" k="12"/>
<click x="378" y="210"/>
<move x="378" y="210" k="11"/>
</way>
, <way>
<move x="198" y="178"/>
<move x="213" y="191"/>
<move x="225" y="204"/>
<move x="244" y="212"/>
<move x="265" y="227"/>
<move x="286" y="240"/>
<move x="303" y="252"/>
<move x="325" y="268"/>
<move x="369" y="296"/>
<move x="407" y="337"/>
<move x="431" y="355"/>
<move x="444" y="373"/>
<move x="453" y="386"/>
<move x="455" y="393"/>
<stripe_down_over x="455" y="395"/>
<move x="459" y="407"/>
<move x="464" y="411"/>
<move x="473" y="419"/>
<move x="479" y="419"/>
<stripe_down_out x="485" y="424"/>
<move x="497" y="429"/>
<move x="504" y="436"/>
<move x="511" y="441"/>
<move x="515" y="446"/>
<move x="518" y="450"/>
<move x="519" y="450" k="3"/>
<move x="520" y="451" k="2"/>
<count_volt x="520" y="451"/>
<move x="520" y="451"/>
<move x="519" y="449"/>
<move x="518" y="447" k="1"/>
<move x="517" y="445"/>
<move x="514" y="436"/>
<stripe_down_over x="509" y="427"/>
<stripe_down_out x="489" y="392"/>
<move x="472" y="356"/>
<move x="460" y="328"/>
<move x="454" y="318"/>
<move x="447" y="305"/>
<move x="437" y="293"/>
<move x="431" y="283"/>
<move x="425" y="274"/>
<move x="419" y="265"/>
<move x="416" y="258"/>
<move x="411" y="248"/>
<move x="410" y="246" k="3"/>
<move x="406" y="245"/>
<move x="404" y="244" k="5"/>
<click x="404" y="244"/>
<move x="404" y="244"/>
<move x="399" y="235"/>
<move x="387" y="218"/>
<move x="380" y="201"/>
<move x="374" y="190"/>
<move x="365" y="181"/>
<move x="363" y="178"/>
<move x="359" y="172"/>
<move x="358" y="168"/>
<move x="356" y="165" k="3"/>
<move x="352" y="162"/>
<move x="345" y="156"/>
<move x="343" y="155" k="8"/>
<move x="343" y="156"/>
<move x="352" y="167"/>
<move x="377" y="205"/>
<move x="398" y="241"/>
<move x="425" y="302"/>
<move x="453" y="345"/>
<move x="462" y="366"/>
<move x="466" y="384"/>
<move x="469" y="394"/>
<stripe_down_over x="470" y="396"/>
<move x="473" y="411"/>
<move x="474" y="415"/>
<move x="474" y="421"/>
<move x="474" y="428"/>
<stripe_down_out x="479" y="433"/>
<move x="482" y="447"/>
<move x="482" y="454"/>
<move x="481" y="459" k="7"/>
<count_volt x="479" y="459"/>
<move x="477" y="453"/>
<move x="477" y="447"/>
<stripe_down_over x="472" y="428"/>
<stripe_down_out x="459" y="392"/>
<move x="444" y="359"/>
<move x="418" y="313"/>
<move x="394" y="270"/>
<move x="378" y="244"/>
<move x="368" y="220"/>
<move x="358" y="201"/>
<move x="356" y="191"/>
<move x="355" y="188"/>
<move x="351" y="180"/>
<move x="350" y="173"/>
<move x="349" y="166"/>
<move x="349" y="158"/>
<move x="349" y="157"/>
<move x="349" y="155"/>
<move x="348" y="153" k="4"/>
<move x="346" y="150"/>
<move x="346" y="148" k="11"/>
<click x="346" y="148"/>
<move x="346" y="148" k="2"/>
<move x="343" y="143"/>
<move x="340" y="135"/>
<move x="336" y="126"/>
<move x="335" y="119"/>
<move x="334" y="113" k="1"/>
<move x="332" y="109"/>
<move x="332" y="105" k="1"/>
<move x="332" y="103"/>
<move x="332" y="101"/>
<move x="332" y="98"/>
<move x="332" y="96" k="2"/>
<stripe_up_over x="332" y="94"/>
<move x="331" y="90"/>
<move x="331" y="87"/>
<move x="330" y="85"/>
<move x="330" y="83"/>
<move x="330" y="81"/>
<move x="330" y="79" k="4"/>
<stripe_up_out x="322" y="96"/>
<move x="318" y="104"/>
<move x="309" y="117"/>
<move x="299" y="137"/>
<move x="295" y="152"/>
<move x="291" y="162"/>
<move x="287" y="173"/>
<move x="284" y="177"/>
<move x="283" y="179" k="1"/>
<move x="282" y="183"/>
<move x="281" y="189"/>
<move x="280" y="196"/>
<move x="278" y="202"/>
<move x="278" y="207" k="2"/>
<move x="278" y="209"/>
<move x="278" y="211"/>
<move x="278" y="212"/>
<move x="278" y="214"/>
<move x="278" y="220"/>
<move x="278" y="223" k="2"/>
<move x="278" y="225"/>
<move x="280" y="228"/>
<move x="281" y="228" k="6"/>
<click x="281" y="228"/>
<move x="281" y="228"/>
<move x="283" y="215"/>
<move x="285" y="195"/>
<move x="290" y="170"/>
<move x="291" y="153"/>
<move x="291" y="146"/>
<move x="291" y="144"/>
<move x="291" y="141"/>
<move x="291" y="137" k="3"/>
<move x="294" y="137" k="2"/>
<move x="296" y="137" k="6"/>
<click x="296" y="137"/>
<move x="296" y="137" k="3"/>
<move x="298" y="137"/>
<move x="302" y="137"/>
<move x="313" y="137"/>
<move x="323" y="134"/>
<move x="333" y="131"/>
<move x="339" y="129"/>
<move x="341" y="128"/>
<move x="344" y="128"/>
<move x="346" y="128"/>
<move x="346" y="129"/>
<move x="346" y="131" k="1"/>
<move x="347" y="133" k="7"/>
<click x="347" y="133"/>
<move x="347" y="133" k="1"/>
<move x="343" y="126"/>
<move x="336" y="113"/>
<move x="332" y="104"/>
<move x="326" y="98"/>
<stripe_up_over x="324" y="94"/>
<move x="319" y="92"/>
<move x="317" y="92"/>
<move x="315" y="92" k="3"/>
<move x="313" y="92"/>
<stripe_up_out x="313" y="95"/>
<move x="313" y="105"/>
<move x="312" y="112"/>
<move x="311" y="120"/>
<move x="309" y="129"/>
<move x="309" y="135"/>
<move x="309" y="140" k="11"/>
<click x="309" y="140"/>
<move x="309" y="140"/>
<move x="309" y="138"/>
<move x="307" y="128"/>
<move x="302" y="115"/>
<move x="298" y="107"/>
<move x="292" y="101"/>
<stripe_up_over x="289" y="91"/>
<move x="288" y="87"/>
<move x="287" y="83" k="4"/>
<move x="287" y="86"/>
<move x="287" y="88"/>
<move x="285" y="89"/>
<stripe_up_out x="289" y="96"/>
<move x="292" y="103"/>
<move x="296" y="108"/>
<move x="292" y="115"/>
<move x="292" y="122"/>
<move x="292" y="124" k="2"/>
<move x="290" y="124"/>
<move x="289" y="127"/>
<move x="287" y="130"/>
<move x="282" y="135"/>
<move x="281" y="137"/>
<move x="281" y="139"/>
<move x="279" y="140" k="7"/>
<click x="279" y="140"/>
<move x="279" y="140" k="1"/>
<move x="279" y="142"/>
<move x="290" y="153"/>
<move x="318" y="181"/>
<move x="372" y="224"/>
<move x="407" y="246"/>
<move x="455" y="304"/>
<move x="471" y="341"/>
<move x="478" y="357"/>
<move x="487" y="376"/>
<move x="490" y="385"/>
<move x="492" y="393"/>
<stripe_down_over x="493" y="397"/>
<move x="495" y="402"/>
<move x="498" y="412"/>
<move x="500" y="415"/>
<stripe_down_out x="503" y="423"/>
<move x="505" y="431"/>
<move x="506" y="438"/>
<move x="506" y="440"/>
<move x="506" y="441"/>
<move x="507" y="442"/>
<move x="509" y="442"/>
<move x="511" y="442"/>
<move x="515" y="442" k="1"/>
<move x="519" y="442" k="4"/>
<count_volt x="519" y="442"/>
<stripe_down_over x="510" y="415"/>
<stripe_down_out x="500" y="376"/>
<move x="456" y="275"/>
<move x="419" y="193"/>
<move x="392" y="147"/>
<move x="364" y="121"/>
<move x="341" y="112"/>
<move x="319" y="95"/>
<stripe_up_over x="311" y="91"/>
<move x="303" y="87" k="1"/>
<move x="300" y="89"/>
<move x="298" y="93"/>
<stripe_up_out x="295" y="96"/>
<move x="294" y="98"/>
<move x="294" y="99"/>
<move x="294" y="105"/>
<move x="296" y="111"/>
<move x="296" y="113" k="8"/>
<move x="297" y="113" k="1"/>
<move x="297" y="109"/>
<move x="304" y="97"/>
<move x="304" y="95" k="6"/>
<click x="304" y="95"/>
<move x="304" y="95" k="5"/>
<move x="309" y="97"/>
<move x="336" y="113"/>
<move x="369" y="130"/>
<move x="401" y="148"/>
<move x="437" y="167"/>
<move x="451" y="168"/>
<move x="467" y="158"/>
<move x="469" y="152"/>
<move x="473" y="150"/>
<move x="476" y="148"/>
<move x="482" y="146"/>
<move x="494" y="143"/>
<move x="504" y="141"/>
<move x="516" y="141"/>
<move x="519" y="140"/>
<move x="521" y="140"/>
<move x="523" y="140"/>
<move x="525" y="140"/>
<move x="527" y="143"/>
<move x="530" y="146"/>
<move x="530" y="147" k="8"/>
<click x="530" y="147"/>
<move x="531" y="154"/>
<move x="533" y="184"/>
<move x="545" y="267"/>
<move x="547" y="312"/>
<move x="550" y="339"/>
<move x="550" y="355"/>
<move x="550" y="370"/>
<stripe_down_over x="543" y="402"/>
<stripe_down_out x="533" y="419"/>
<move x="524" y="435" k="1"/>
<move x="522" y="435"/>
<move x="520" y="435"/>
<move x="512" y="438"/>
<move x="503" y="441"/>
<move x="495" y="442" k="1"/>
<stripe_down_over x="493" y="444"/>
<stripe_down_out x="491" y="446"/>
<move x="484" y="450"/>
<move x="479" y="453"/>
<move x="479" y="454" k="5"/>
<count_volt x="479" y="454"/>
<move x="479" y="448"/>
<move x="476" y="440"/>
<stripe_down_over x="471" y="431"/>
<stripe_down_out x="460" y="388"/>
<move x="454" y="366"/>
<move x="449" y="331"/>
<move x="438" y="287"/>
<move x="427" y="256"/>
<move x="419" y="239"/>
<move x="410" y="221"/>
<move x="403" y="205"/>
<move x="402" y="199"/>
<move x="396" y="188"/>
<move x="391" y="174"/>
<move x="388" y="167"/>
<move x="385" y="160"/>
<move x="382" y="154"/>
<move x="379" y="149"/>
<move x="378" y="147"/>
<move x="376" y="143" k="6"/>
<move x="377" y="142" k="4"/>
<move x="367" y="142"/>
<move x="362" y="142" k="2"/>
<move x="360" y="141" k="4"/>
<move x="358" y="141" k="7"/>
<click x="358" y="141"/>
<move x="358" y="141" k="2"/>
<move x="367" y="141"/>
<move x="379" y="140"/>
<move x="386" y="137"/>
<move x="393" y="134"/>
<move x="402" y="130"/>
<move x="417" y="125"/>
<move x="435" y="122"/>
<move x="439" y="121"/>
<move x="441" y="121"/>
<move x="443" y="120"/>
<move x="448" y="120"/>
<move x="452" y="119" k="5"/>
<move x="450" y="119"/>
<move x="448" y="119"/>
<move x="446" y="119"/>
<move x="442" y="119"/>
<move x="440" y="119"/>
<move x="437" y="120"/>
<move x="435" y="120" k="1"/>
<move x="433" y="121"/>
<move x="431" y="121" k="1"/>
<move x="429" y="121" k="3"/>
<click x="429" y="121"/>
<move x="429" y="121" k="2"/>
<move x="427" y="121"/>
<move x="425" y="121"/>
<move x="420" y="121"/>
<move x="415" y="124"/>
<move x="413" y="127"/>
<move x="411" y="135"/>
<move x="413" y="151"/>
<move x="423" y="187"/>
<move x="446" y="243"/>
<move x="464" y="298"/>
<move x="487" y="351"/>
<move x="504" y="392"/>
<stripe_down_over x="513" y="400"/>
<move x="518" y="418"/>
<move x="518" y="426"/>
<stripe_down_out x="520" y="431"/>
<move x="520" y="433"/>
<move x="520" y="441"/>
<move x="518" y="447"/>
<move x="518" y="449" k="5"/>
<count_volt x="518" y="449"/>
<stripe_down_over x="507" y="422"/>
<stripe_down_out x="485" y="391"/>
<move x="381" y="310"/>
<move x="323" y="275"/>
<move x="228" y="219"/>
<move x="140" y="178"/>
<move x="113" y="158"/>
<move x="112" y="152"/>
<move x="116" y="147"/>
<move x="116" y="140"/>
<move x="117" y="135"/>
<move x="117" y="133"/>
<move x="117" y="131" k="6"/>
<move x="117" y="128"/>
<move x="115" y="125"/>
<move x="113" y="125"/>
<move x="111" y="125" k="2"/>
<move x="109" y="125" k="6"/>
<click x="109" y="125"/>
<move x="109" y="125" k="3"/>
<move x="117" y="128"/>
<move x="138" y="135"/>
<move x="168" y="150"/>
<move x="206" y="176"/>
<move x="252" y="223"/>
<move x="296" y="283"/>
<move x="327" y="330"/>
<move x="359" y="365"/>
<move x="365" y="367"/>
<move x="365" y="361"/>
<move x="365" y="359" k="1"/>
<move x="367" y="371"/>
<move x="381" y="394"/>
<stripe_down_over x="396" y="410"/>
<move x="415" y="436"/>
<move x="427" y="452"/>
<move x="433" y="460"/>
<move x="436" y="460" k="1"/>
<move x="437" y="457"/>
<stripe_down_out x="442" y="452"/>
<stripe_down_over x="445" y="448"/>
<stripe_down_out x="459" y="445"/>
<move x="465" y="445"/>
<move x="468" y="446"/>
<move x="469" y="447"/>
<move x="471" y="447" k="3"/>
<count_volt x="471" y="447"/>
<stripe_down_over x="470" y="426"/>
<stripe_down_out x="460" y="391"/>
<move x="433" y="332"/>
<move x="404" y="276"/>
<move x="378" y="224"/>
<move x="354" y="183"/>
<move x="344" y="164"/>
<move x="336" y="152"/>
<move x="330" y="144"/>
<move x="320" y="135"/>
<move x="302" y="124"/>
<move x="287" y="119"/>
<move x="280" y="115" k="1"/>
<move x="278" y="115"/>
<move x="270" y="113"/>
<move x="259" y="106"/>
<move x="250" y="99"/>
<stripe_up_over x="246" y="90"/>
<move x="238" y="74"/>
<move x="234" y="66" k="1"/>
<move x="234" y="64" k="10"/>
<move x="238" y="79"/>
<stripe_up_out x="245" y="97"/>
<move x="255" y="137"/>
<move x="260" y="156"/>
<move x="263" y="164"/>
<move x="263" y="178"/>
<move x="259" y="184"/>
<move x="260" y="192"/>
<move x="264" y="202"/>
<move x="267" y="212"/>
<move x="267" y="220"/>
<move x="267" y="222" k="2"/>
<move x="267" y="223" k="3"/>
<move x="265" y="226"/>
<move x="263" y="228"/>
<move x="263" y="233"/>
<move x="262" y="235" k="16"/>
<click x="262" y="235"/>
<move x="262" y="235" k="1"/>
<move x="260" y="236"/>
<move x="256" y="236"/>
<move x="243" y="236"/>
<move x="231" y="237"/>
<move x="225" y="238"/>
<move x="215" y="238"/>
<move x="205" y="238"/>
<move x="202" y="238"/>
<move x="200" y="238" k="3"/>
<move x="200" y="236"/>
<move x="200" y="234" k="10"/>
<move x="202" y="234"/>
<move x="204" y="234" k="1"/>
<move x="206" y="234"/>
<move x="208" y="234"/>
<move x="210" y="235"/>
<move x="212" y="235" k="5"/>
<click x="212" y="235"/>
<move x="213" y="235" k="5"/>
<move x="215" y="235"/>
<move x="215" y="236" k="4"/>
</way>
, <way>
<click x="116" y="187" k="1"/>
<move x="116" y="187" k="14"/>
<move x="117" y="187"/>
<move x="119" y="187"/>
<move x="131" y="187"/>
<move x="165" y="187"/>
<move x="211" y="189"/>
<move x="225" y="190" k="1"/>
<move x="227" y="190"/>
<move x="227" y="191"/>
<move x="228" y="197"/>
<move x="228" y="201" k="6"/>
<click x="228" y="201"/>
<move x="229" y="202"/>
<move x="265" y="202"/>
<move x="347" y="202"/>
<move x="400" y="202"/>
<move x="409" y="198"/>
<move x="420" y="195"/>
<move x="435" y="195"/>
<move x="456" y="200"/>
<move x="466" y="203" k="10"/>
<click x="466" y="203"/>
<move x="464" y="203"/>
<move x="454" y="200"/>
<move x="423" y="198"/>
<move x="369" y="201"/>
<move x="316" y="205"/>
<move x="288" y="207"/>
<move x="278" y="208" k="1"/>
<move x="276" y="208" k="3"/>
<move x="279" y="208"/>
<move x="286" y="208"/>
<move x="295" y="208"/>
<move x="303" y="208" k="1"/>
<move x="305" y="208" k="4"/>
<click x="305" y="208"/>
<move x="305" y="208"/>
<move x="310" y="206"/>
<move x="328" y="200"/>
<move x="334" y="198" k="2"/>
<move x="335" y="197"/>
<move x="339" y="197" k="2"/>
<move x="341" y="197" k="3"/>
<move x="343" y="197" k="5"/>
<click x="343" y="197"/>
<move x="343" y="197" k="11"/>
</way>
, <way>
<move x="394" y="275"/>
<move x="499" y="248"/>
<move x="527" y="234"/>
<move x="558" y="217"/>
<move x="592" y="200"/>
<move x="615" y="186"/>
<move x="618" y="181" k="7"/>
<move x="604" y="175"/>
<move x="592" y="168"/>
<move x="588" y="162"/>
<move x="577" y="155"/>
<move x="564" y="149"/>
<move x="551" y="146"/>
<move x="539" y="145"/>
<move x="536" y="142" k="4"/>
<move x="537" y="142" k="7"/>
<click x="537" y="142"/>
<move x="537" y="142" k="1"/>
<move x="534" y="152"/>
<move x="526" y="181"/>
<move x="517" y="217"/>
<move x="511" y="242"/>
<move x="510" y="247"/>
<move x="510" y="251"/>
<move x="510" y="253"/>
<move x="511" y="254"/>
<move x="517" y="254"/>
<move x="527" y="245"/>
<move x="530" y="243" k="7"/>
<click x="530" y="243"/>
<move x="530" y="243" k="6"/>
<move x="524" y="246" k="1"/>
<move x="523" y="246"/>
<move x="518" y="249"/>
<move x="508" y="253"/>
<move x="502" y="256"/>
<move x="497" y="258"/>
<move x="493" y="261" k="2"/>
<move x="491" y="258"/>
<move x="503" y="234"/>
<move x="529" y="177"/>
<move x="538" y="134"/>
<move x="535" y="114"/>
<move x="528" y="104" k="1"/>
<move x="523" y="106"/>
<move x="520" y="109"/>
<move x="515" y="107"/>
<move x="511" y="107" k="1"/>
<move x="512" y="117"/>
<move x="517" y="167"/>
<move x="528" y="291"/>
<move x="542" y="338"/>
<move x="575" y="373"/>
<move x="579" y="384"/>
<move x="581" y="393"/>
<move x="587" y="402"/>
<move x="588" y="403"/>
<move x="581" y="417"/>
<move x="571" y="432"/>
<move x="570" y="434"/>
<move x="568" y="435" k="3"/>
<count_volt x="568" y="435"/>
<move x="568" y="435"/>
<move x="568" y="426"/>
<move x="551" y="377"/>
<move x="530" y="343"/>
<move x="497" y="285"/>
<move x="472" y="234"/>
<move x="465" y="214"/>
<move x="457" y="201"/>
<move x="455" y="197"/>
<move x="451" y="191"/>
<move x="442" y="181"/>
<move x="430" y="168"/>
<move x="410" y="153"/>
<move x="399" y="139"/>
<move x="397" y="138" k="3"/>
<click x="397" y="138"/>
<move x="397" y="138"/>
<move x="401" y="138"/>
<move x="432" y="147"/>
<move x="442" y="147" k="1"/>
<move x="449" y="151"/>
<move x="474" y="156"/>
<move x="483" y="159" k="16"/>
<move x="479" y="164"/>
<move x="477" y="174"/>
<move x="477" y="187"/>
<move x="477" y="195"/>
<move x="481" y="205"/>
<move x="483" y="209"/>
<move x="483" y="212"/>
<move x="483" y="214"/>
<move x="483" y="216"/>
<move x="484" y="220"/>
<move x="484" y="222"/>
<move x="482" y="226"/>
<move x="482" y="230"/>
<move x="482" y="234" k="1"/>
<move x="482" y="236" k="4"/>
<move x="488" y="239"/>
<move x="514" y="251"/>
<move x="545" y="265"/>
<move x="558" y="271"/>
<move x="564" y="271"/>
<move x="564" y="269"/>
<move x="557" y="269"/>
<move x="529" y="260"/>
<move x="434" y="228"/>
<move x="332" y="205"/>
<move x="261" y="179"/>
<move x="261" y="175"/>
<move x="262" y="173"/>
<move x="263" y="166"/>
<move x="263" y="162"/>
<move x="263" y="161" k="1"/>
<move x="259" y="168"/>
<move x="235" y="201"/>
<move x="202" y="234"/>
<move x="191" y="254"/>
<move x="191" y="260"/>
<move x="190" y="268"/>
<move x="188" y="270"/>
<move x="181" y="273"/>
<move x="162" y="273"/>
<move x="154" y="273"/>
<move x="150" y="273"/>
<move x="149" y="269"/>
<move x="146" y="263"/>
<move x="143" y="259"/>
<move x="141" y="258" k="1"/>
<move x="136" y="255"/>
<move x="134" y="255"/>
<move x="129" y="253"/>
<move x="126" y="252" k="8"/>
<click x="126" y="252"/>
<move x="126" y="252"/>
<move x="131" y="251"/>
<move x="146" y="246"/>
<move x="169" y="239"/>
<move x="178" y="233"/>
<move x="190" y="222"/>
<move x="193" y="215"/>
<move x="199" y="206"/>
<move x="199" y="200" k="3"/>
<move x="197" y="200"/>
<move x="192" y="203"/>
<move x="186" y="204"/>
<move x="184" y="204" k="4"/>
<move x="182" y="204"/>
<move x="176" y="201"/>
<move x="174" y="198" k="4"/>
<move x="172" y="198"/>
<move x="162" y="198"/>
<move x="160" y="198" k="12"/>
<move x="158" y="198" k="6"/>
<click x="158" y="198"/>
<move x="158" y="198" k="3"/>
<move x="162" y="199"/>
<move x="180" y="207"/>
<move x="191" y="212"/>
<move x="194" y="215"/>
<move x="199" y="223"/>
<move x="204" y="229"/>
<move x="209" y="232"/>
<move x="215" y="232"/>
<move x="216" y="232"/>
<move x="219" y="229"/>
<move x="220" y="221"/>
<move x="222" y="215" k="1"/>
<move x="225" y="213"/>
<move x="231" y="207" k="10"/>
<click x="231" y="207"/>
<move x="231" y="207" k="11"/>
</way>
, <way>
<move x="47" y="327" k="15"/>
<move x="49" y="327" k="6"/>
<move x="51" y="327"/>
<move x="55" y="327"/>
<move x="66" y="320"/>
<move x="81" y="313"/>
<move x="90" y="305"/>
<move x="105" y="299"/>
<move x="144" y="295"/>
<move x="176" y="288"/>
<move x="189" y="281"/>
<move x="225" y="262"/>
<move x="273" y="237"/>
<move x="295" y="227" k="4"/>
<move x="298" y="226"/>
<move x="306" y="226"/>
<move x="315" y="226"/>
<move x="316" y="226" k="1"/>
<move x="320" y="225"/>
<move x="326" y="224" k="1"/>
<move x="328" y="224"/>
<move x="329" y="223" k="1"/>
<move x="331" y="223"/>
<move x="333" y="222" k="37"/>
<click x="333" y="222"/>
<move x="333" y="222" k="2"/>
<move x="334" y="220"/>
<move x="340" y="213"/>
<move x="343" y="207"/>
<move x="344" y="204"/>
<move x="346" y="198"/>
<move x="351" y="192"/>
<move x="355" y="182"/>
<move x="358" y="176"/>
<move x="360" y="175" k="2"/>
<move x="362" y="175"/>
<move x="363" y="175"/>
<move x="365" y="174" k="1"/>
<move x="367" y="174"/>
<move x="369" y="174"/>
<move x="371" y="174" k="2"/>
<move x="373" y="174" k="6"/>
<click x="373" y="174"/>
<move x="373" y="174"/>
<move x="369" y="174"/>
<move x="361" y="176"/>
<move x="354" y="176"/>
<move x="342" y="181"/>
<move x="330" y="181"/>
<move x="316" y="181"/>
<move x="309" y="180"/>
<move x="302" y="177" k="1"/>
<move x="300" y="176" k="1"/>
<move x="297" y="173"/>
<move x="296" y="169"/>
<move x="290" y="164" k="7"/>
<click x="290" y="164"/>
<move x="290" y="164" k="9"/>
<move x="292" y="162"/>
<move x="302" y="161"/>
<move x="315" y="157"/>
<move x="336" y="153"/>
<move x="357" y="150"/>
<move x="360" y="150"/>
<move x="362" y="150"/>
<move x="369" y="150"/>
<move x="379" y="150"/>
<move x="389" y="149"/>
<move x="398" y="149"/>
<move x="406" y="147"/>
<move x="420" y="147"/>
<move x="433" y="147"/>
<move x="440" y="147"/>
<move x="442" y="147"/>
<move x="444" y="147"/>
<move x="446" y="147" k="1"/>
<move x="448" y="148"/>
<move x="450" y="149" k="5"/>
<move x="452" y="149" k="9"/>
<move x="453" y="150"/>
<move x="455" y="153"/>
<move x="456" y="154" k="7"/>
<click x="456" y="154"/>
<move x="456" y="154" k="2"/>
<move x="422" y="160"/>
<move x="370" y="160"/>
<move x="286" y="160"/>
<move x="247" y="161"/>
<move x="232" y="161"/>
<move x="230" y="161" k="1"/>
<move x="226" y="161"/>
<move x="224" y="161"/>
<move x="219" y="161"/>
<move x="213" y="162"/>
<move x="212" y="164"/>
<move x="211" y="166" k="7"/>
<click x="211" y="166"/>
<move x="211" y="166" k="11"/>
</way>
, <way>
<move x="127" y="385" k="6"/>
<move x="138" y="380"/>
<move x="170" y="373"/>
<move x="201" y="372"/>
<move x="219" y="372"/>
<move x="233" y="372"/>
<move x="252" y="372"/>
<move x="273" y="373"/>
<move x="301" y="375"/>
<move x="314" y="375"/>
<move x="331" y="372"/>
<move x="341" y="369"/>
<move x="344" y="369"/>
<move x="352" y="368"/>
<move x="362" y="365"/>
<move x="370" y="365"/>
<move x="377" y="365"/>
<move x="388" y="368"/>
<move x="413" y="374"/>
<move x="428" y="378"/>
<move x="431" y="378" k="13"/>
<click x="431" y="378"/>
<move x="431" y="378" k="2"/>
<move x="431" y="376"/>
<move x="431" y="370"/>
<move x="431" y="368"/>
<move x="431" y="363"/>
<move x="431" y="359"/>
<move x="430" y="354"/>
<move x="427" y="351"/>
<move x="423" y="348"/>
<move x="419" y="343"/>
<move x="417" y="339"/>
<move x="414" y="333"/>
<move x="412" y="329"/>
<move x="412" y="323" k="2"/>
<move x="412" y="321"/>
<move x="412" y="319" k="5"/>
<click x="412" y="319"/>
<move x="412" y="319" k="11"/>
</way>
, <way>
<move x="190" y="386" k="1"/>
<move x="192" y="379"/>
<move x="194" y="375"/>
<move x="196" y="372"/>
<move x="198" y="361"/>
<move x="201" y="345"/>
<move x="202" y="333"/>
<move x="202" y="324"/>
<move x="202" y="316"/>
<move x="201" y="314"/>
<move x="196" y="308"/>
<move x="192" y="302"/>
<move x="188" y="299"/>
<move x="186" y="299" k="2"/>
<move x="186" y="302"/>
<move x="187" y="307"/>
<move x="187" y="309"/>
<move x="187" y="311"/>
<move x="189" y="313" k="2"/>
<move x="190" y="313"/>
<move x="192" y="313" k="8"/>
<click x="192" y="313"/>
<move x="192" y="309"/>
<move x="194" y="297"/>
<move x="196" y="282"/>
<move x="196" y="270"/>
<move x="201" y="254"/>
<move x="202" y="245"/>
<move x="205" y="245"/>
<move x="207" y="244"/>
<move x="213" y="242"/>
<move x="217" y="241"/>
<move x="221" y="240"/>
<move x="223" y="239"/>
<move x="226" y="239" k="3"/>
<move x="227" y="237" k="2"/>
<click x="227" y="237"/>
<move x="227" y="237" k="2"/>
<move x="233" y="237"/>
<move x="260" y="239"/>
<move x="283" y="240"/>
<move x="304" y="234"/>
<move x="325" y="227"/>
<move x="346" y="224"/>
<move x="360" y="224"/>
<move x="364" y="224"/>
<move x="366" y="224" k="1"/>
<move x="369" y="224"/>
<move x="375" y="224"/>
<move x="380" y="224"/>
<move x="386" y="224"/>
<move x="391" y="223"/>
<move x="394" y="222"/>
<move x="396" y="222"/>
<move x="400" y="222"/>
<move x="407" y="222"/>
<move x="412" y="221" k="1"/>
<move x="414" y="221"/>
<move x="420" y="220"/>
<move x="424" y="219"/>
<move x="427" y="219"/>
<move x="433" y="216"/>
<move x="439" y="214" k="11"/>
<click x="439" y="214"/>
<move x="439" y="214" k="4"/>
<move x="437" y="214"/>
<move x="435" y="214" k="1"/>
<move x="433" y="214"/>
<move x="431" y="212"/>
<move x="425" y="212"/>
<move x="423" y="212"/>
<move x="414" y="208"/>
<move x="402" y="204"/>
<move x="384" y="200"/>
<move x="378" y="199"/>
<move x="372" y="199"/>
<move x="369" y="199"/>
<move x="364" y="197"/>
<move x="361" y="194"/>
<move x="356" y="196" k="1"/>
<move x="353" y="194"/>
<move x="349" y="193"/>
<move x="342" y="190"/>
<move x="334" y="186"/>
<move x="331" y="184"/>
<move x="330" y="182" k="4"/>
<move x="328" y="180"/>
<move x="327" y="178"/>
<move x="324" y="174"/>
<move x="322" y="170"/>
<move x="317" y="167" k="1"/>
<move x="314" y="163"/>
<move x="310" y="157" k="1"/>
<move x="308" y="158"/>
<move x="305" y="166"/>
<move x="303" y="172"/>
<move x="302" y="175"/>
<move x="301" y="177" k="4"/>
<move x="305" y="179"/>
<move x="308" y="181" k="19"/>
<move x="310" y="181" k="14"/>
<move x="312" y="181" k="1"/>
<move x="314" y="180"/>
<move x="315" y="180" k="9"/>
<move x="317" y="180"/>
<move x="319" y="179" k="1"/>
<move x="321" y="179" k="18"/>
<click x="321" y="179"/>
<move x="321" y="179" k="11"/>
</way>
, <way>
<move x="269" y="357"/>
<move x="273" y="329"/>
<move x="293" y="296"/>
<move x="310" y="269"/>
<move x="320" y="245"/>
<move x="341" y="207"/>
<move x="353" y="187"/>
<move x="364" y="176"/>
<move x="368" y="167"/>
<move x="374" y="161"/>
<move x="388" y="153"/>
<move x="400" y="147"/>
<move x="411" y="142"/>
<move x="423" y="136"/>
<move x="433" y="131"/>
<move x="439" y="129"/>
<move x="453" y="127"/>
<move x="467" y="126"/>
<move x="483" y="123"/>
<move x="501" y="123"/>
<move x="505" y="123"/>
<move x="507" y="123"/>
<move x="509" y="122"/>
<move x="510" y="122"/>
<move x="512" y="122"/>
<move x="517" y="119"/>
<move x="521" y="117"/>
<move x="523" y="117"/>
<move x="525" y="116"/>
<move x="528" y="115"/>
<move x="530" y="113"/>
<move x="533" y="113" k="7"/>
<click x="533" y="113"/>
<move x="533" y="113"/>
<move x="529" y="113"/>
<move x="517" y="110"/>
<move x="502" y="108"/>
<move x="481" y="105"/>
<move x="459" y="103"/>
<move x="449" y="101"/>
<move x="445" y="101" k="1"/>
<move x="443" y="102"/>
<move x="443" y="104" k="4"/>
<click x="443" y="104"/>
<move x="443" y="104" k="1"/>
<move x="435" y="112"/>
<move x="419" y="125"/>
<move x="400" y="139"/>
<move x="386" y="149"/>
<move x="381" y="150"/>
<move x="379" y="151" k="7"/>
<click x="379" y="151"/>
<move x="380" y="151"/>
<move x="382" y="151"/>
<move x="387" y="160"/>
<move x="399" y="192"/>
<move x="420" y="241"/>
<move x="433" y="278"/>
<move x="457" y="327"/>
<move x="466" y="351"/>
<move x="477" y="377"/>
<move x="494" y="397"/>
<move x="500" y="402" k="2"/>
<move x="503" y="410"/>
<move x="506" y="418"/>
<move x="511" y="431"/>
<move x="512" y="437"/>
<move x="515" y="440"/>
<move x="515" y="444" k="2"/>
<move x="516" y="446" k="3"/>
<count_volt x="516" y="446"/>
<move x="500" y="418"/>
<move x="486" y="394"/>
<move x="450" y="348"/>
<move x="423" y="307"/>
<move x="397" y="259"/>
<move x="379" y="229"/>
<move x="353" y="198"/>
<move x="332" y="184"/>
<move x="326" y="180" k="1"/>
<move x="325" y="178"/>
<move x="323" y="172"/>
<move x="317" y="167"/>
<move x="316" y="167"/>
<move x="314" y="167"/>
<move x="312" y="167"/>
<move x="308" y="163"/>
<move x="299" y="157"/>
<move x="295" y="156" k="6"/>
<click x="295" y="156"/>
<move x="296" y="156" k="1"/>
<move x="298" y="156"/>
<move x="303" y="163"/>
<move x="317" y="179"/>
<move x="340" y="225"/>
<move x="362" y="276"/>
<move x="394" y="340"/>
<move x="406" y="367"/>
<move x="407" y="369" k="1"/>
<move x="404" y="362"/>
<move x="381" y="329"/>
<move x="305" y="282"/>
<move x="247" y="249"/>
<move x="212" y="210"/>
<move x="204" y="185"/>
<move x="198" y="170"/>
<move x="186" y="157"/>
<move x="170" y="143"/>
<move x="149" y="131"/>
<move x="117" y="122"/>
<move x="99" y="120"/>
<move x="96" y="120" k="2"/>
<move x="94" y="120" k="7"/>
<click x="94" y="120"/>
<move x="94" y="120"/>
<move x="94" y="118"/>
<move x="122" y="113"/>
<move x="147" y="104"/>
<move x="162" y="102"/>
<move x="170" y="99"/>
<move x="171" y="97" k="2"/>
<move x="171" y="100" k="4"/>
<click x="171" y="100"/>
<move x="171" y="100" k="1"/>
<move x="174" y="102"/>
<move x="189" y="109"/>
<move x="199" y="110"/>
<move x="201" y="110" k="1"/>
<move x="208" y="111"/>
<move x="212" y="113"/>
<move x="216" y="115"/>
<move x="222" y="115"/>
<move x="224" y="115"/>
<move x="225" y="115" k="4"/>
<click x="225" y="115"/>
<move x="225" y="115" k="4"/>
<move x="225" y="116"/>
<move x="223" y="119"/>
<move x="223" y="121"/>
<move x="222" y="125"/>
<move x="222" y="128"/>
<move x="222" y="130" k="1"/>
</way>
, <way>
<move x="342" y="341" k="14"/>
<move x="342" y="339"/>
<move x="342" y="331"/>
<move x="342" y="323"/>
<move x="339" y="308"/>
<move x="336" y="296"/>
<move x="336" y="286"/>
<move x="335" y="280"/>
<move x="331" y="267"/>
<move x="327" y="259"/>
<move x="319" y="245"/>
<move x="314" y="232"/>
<move x="307" y="217"/>
<move x="296" y="193"/>
<move x="288" y="181"/>
<move x="280" y="174"/>
<move x="273" y="168"/>
<move x="263" y="161"/>
<move x="253" y="159"/>
<move x="244" y="155"/>
<move x="238" y="149"/>
<move x="232" y="140"/>
<move x="230" y="138" k="4"/>
<move x="230" y="134"/>
<move x="230" y="132" k="1"/>
<move x="230" y="130"/>
<move x="230" y="129"/>
<move x="230" y="127" k="2"/>
<move x="231" y="124"/>
<move x="232" y="123" k="1"/>
<move x="237" y="121"/>
<move x="241" y="121"/>
<move x="243" y="120" k="4"/>
<move x="243" y="118" k="1"/>
<move x="243" y="116"/>
<move x="243" y="114"/>
<move x="243" y="112" k="1"/>
<click x="243" y="112"/>
<move x="243" y="112"/>
<move x="244" y="112"/>
<move x="244" y="118"/>
<move x="245" y="123"/>
<move x="250" y="131"/>
<move x="262" y="144"/>
<move x="285" y="156"/>
<move x="305" y="166"/>
<move x="341" y="177"/>
<move x="362" y="191"/>
<move x="394" y="196"/>
<move x="411" y="198"/>
<move x="424" y="201"/>
<move x="429" y="205"/>
<move x="441" y="211"/>
<move x="442" y="211"/>
<move x="444" y="210"/>
<move x="448" y="209" k="1"/>
<move x="452" y="208"/>
<move x="455" y="206"/>
<move x="464" y="200"/>
<move x="466" y="198"/>
<move x="468" y="198"/>
<move x="469" y="199" k="14"/>
<move x="471" y="199"/>
<click x="471" y="199"/>
<move x="471" y="199" k="2"/>
<move x="471" y="206"/>
<move x="477" y="238"/>
<move x="495" y="288"/>
<move x="516" y="337"/>
<move x="525" y="366"/>
<move x="531" y="391"/>
<move x="532" y="403"/>
<move x="532" y="411"/>
<move x="532" y="418"/>
<move x="530" y="424"/>
<move x="529" y="435"/>
<move x="527" y="443"/>
<move x="526" y="447"/>
<move x="525" y="449" k="3"/>
<move x="524" y="451" k="2"/>
<count_volt x="524" y="451"/>
<move x="522" y="451"/>
<move x="520" y="451"/>
<move x="513" y="447"/>
<move x="503" y="442"/>
<move x="478" y="433"/>
<move x="449" y="424"/>
<move x="416" y="411"/>
<move x="380" y="399"/>
<move x="354" y="388"/>
<move x="340" y="382"/>
<move x="331" y="376"/>
<move x="312" y="363"/>
<move x="299" y="356"/>
<move x="285" y="348"/>
<move x="275" y="342"/>
<move x="267" y="336"/>
<move x="264" y="334"/>
<move x="262" y="331"/>
<move x="257" y="328"/>
<move x="252" y="326"/>
<move x="247" y="324"/>
<move x="240" y="321"/>
<move x="233" y="316"/>
<move x="223" y="308"/>
<move x="214" y="298"/>
<move x="208" y="289"/>
<move x="204" y="281"/>
<move x="204" y="276"/>
<move x="203" y="268"/>
<move x="203" y="265"/>
<move x="203" y="261"/>
<move x="203" y="259"/>
<move x="203" y="258"/>
<move x="203" y="256"/>
<move x="203" y="252"/>
<move x="203" y="250"/>
<move x="203" y="249"/>
<move x="203" y="247"/>
<move x="203" y="245"/>
<move x="203" y="243" k="2"/>
<click x="203" y="243"/>
<move x="204" y="242"/>
<move x="205" y="235"/>
<move x="205" y="231"/>
<move x="205" y="229"/>
<move x="201" y="224"/>
<move x="197" y="223"/>
<move x="195" y="222" k="1"/>
<move x="193" y="222"/>
<move x="182" y="218"/>
<move x="170" y="218"/>
<move x="154" y="213"/>
<move x="149" y="208" k="18"/>
<click x="149" y="208"/>
<move x="149" y="208" k="1"/>
<move x="149" y="209"/>
<move x="149" y="221"/>
<move x="150" y="229"/>
<move x="153" y="242"/>
<move x="157" y="256"/>
<move x="161" y="272"/>
<move x="162" y="281"/>
<move x="165" y="291"/>
<move x="174" y="310"/>
<move x="181" y="318"/>
<move x="185" y="319"/>
<move x="188" y="321"/>
<move x="190" y="322" k="8"/>
<click x="190" y="322"/>
<move x="190" y="322" k="1"/>
<move x="190" y="324"/>
<move x="191" y="329"/>
<move x="192" y="330"/>
<move x="195" y="335"/>
<move x="195" y="337" k="3"/>
<move x="197" y="338"/>
<move x="197" y="340"/>
</way>
, <way>
<move x="86" y="471" k="2"/>
<move x="111" y="470"/>
<move x="149" y="472"/>
<move x="202" y="475"/>
<move x="270" y="479"/>
<move x="304" y="479"/>
<move x="379" y="477"/>
<move x="411" y="471"/>
<move x="416" y="469"/>
<move x="419" y="466"/>
<move x="430" y="460"/>
<move x="444" y="455"/>
<move x="461" y="450"/>
<move x="473" y="446"/>
<move x="488" y="444"/>
<move x="511" y="442"/>
<move x="531" y="442"/>
<move x="549" y="440" k="4"/>
<move x="535" y="446"/>
<move x="525" y="451"/>
<move x="521" y="453"/>
<move x="520" y="454"/>
<move x="518" y="454" k="5"/>
<count_volt x="518" y="454"/>
<move x="518" y="454"/>
<move x="516" y="452"/>
<move x="508" y="441" k="1"/>
<move x="452" y="408"/>
<move x="413" y="381"/>
<move x="373" y="352"/>
<move x="344" y="330"/>
<move x="309" y="307"/>
<move x="271" y="281"/>
<move x="259" y="272"/>
<move x="252" y="261"/>
<move x="250" y="257"/>
<move x="250" y="253" k="1"/>
<move x="250" y="249"/>
<move x="251" y="245"/>
<move x="252" y="244" k="1"/>
<move x="252" y="240"/>
<move x="252" y="236"/>
<move x="252" y="231"/>
<move x="251" y="229"/>
<move x="251" y="227" k="9"/>
<move x="252" y="229"/>
<move x="254" y="233" k="10"/>
<click x="254" y="233"/>
<move x="254" y="233"/>
<move x="263" y="236"/>
<move x="285" y="254"/>
<move x="338" y="276"/>
<move x="378" y="296"/>
<move x="426" y="330"/>
<move x="464" y="358"/>
<move x="494" y="373"/>
<move x="520" y="388"/>
<move x="531" y="395"/>
<move x="533" y="399"/>
<move x="536" y="405"/>
<move x="537" y="413"/>
<move x="540" y="420"/>
<move x="543" y="424"/>
<move x="547" y="430"/>
<move x="552" y="432"/>
<move x="558" y="437"/>
<move x="561" y="438"/>
<move x="563" y="438" k="1"/>
<move x="566" y="438"/>
<move x="567" y="439"/>
<move x="568" y="441"/>
<move x="568" y="444"/>
<move x="568" y="446" k="4"/>
<count_volt x="568" y="446"/>
<move x="568" y="446"/>
<move x="565" y="443"/>
<move x="560" y="429"/>
<move x="553" y="421"/>
<move x="510" y="383"/>
<move x="451" y="345"/>
<move x="411" y="314"/>
<move x="369" y="268"/>
<move x="315" y="220"/>
<move x="254" y="195"/>
<move x="206" y="161"/>
<move x="184" y="148"/>
<move x="149" y="134"/>
<move x="122" y="119"/>
<move x="111" y="112"/>
<move x="100" y="100"/>
<move x="94" y="92"/>
<move x="91" y="85"/>
<move x="87" y="80"/>
<move x="86" y="76"/>
<move x="86" y="70"/>
<move x="83" y="64"/>
<move x="77" y="55"/>
<move x="76" y="49" k="3"/>
<move x="76" y="48"/>
<move x="81" y="47"/>
<move x="91" y="46"/>
<move x="96" y="46" k="16"/>
<click x="96" y="46"/>
<move x="96" y="46" k="10"/>
<move x="99" y="48"/>
<move x="110" y="54"/>
<move x="115" y="54"/>
<move x="116" y="55" k="1"/>
<move x="120" y="58"/>
<move x="128" y="63"/>
<move x="131" y="64" k="1"/>
<move x="134" y="66" k="20"/>
<move x="140" y="75"/>
<move x="141" y="77" k="3"/>
<move x="144" y="80"/>
<move x="146" y="81"/>
<move x="146" y="83"/>
<move x="146" y="87" k="2"/>
<move x="148" y="90"/>
<move x="150" y="90"/>
<move x="152" y="90"/>
<move x="155" y="93"/>
<move x="157" y="94" k="1"/>
<move x="160" y="96"/>
<move x="160" y="98" k="3"/>
<move x="164" y="100" k="1"/>
<move x="166" y="101"/>
<move x="168" y="102" k="4"/>
<move x="170" y="102" k="1"/>
<move x="172" y="103" k="1"/>
<move x="173" y="103" k="2"/>
<move x="175" y="103"/>
<move x="177" y="103" k="1"/>
<move x="177" y="105" k="26"/>
<move x="175" y="104"/>
<move x="174" y="102"/>
<move x="172" y="101" k="93"/>
<click x="172" y="101"/>
<move x="172" y="101" k="10"/>
<move x="170" y="101"/>
<move x="163" y="110"/>
<move x="152" y="115"/>
<move x="141" y="120"/>
<move x="116" y="134"/>
<move x="93" y="146"/>
<move x="65" y="161"/>
<move x="46" y="169"/>
<move x="39" y="176"/>
<move x="37" y="179"/>
<move x="35" y="184"/>
<move x="32" y="191"/>
<move x="29" y="197"/>
<move x="28" y="205"/>
<move x="27" y="214"/>
<move x="27" y="220"/>
<move x="28" y="224" k="1"/>
<move x="30" y="224"/>
<move x="34" y="224"/>
<move x="36" y="224"/>
<move x="38" y="224"/>
<move x="39" y="224"/>
<move x="40" y="222" k="1"/>
<move x="40" y="220"/>
<move x="40" y="218"/>
<move x="40" y="214" k="1"/>
<move x="40" y="212" k="3"/>
<move x="40" y="211"/>
<move x="40" y="209"/>
<move x="40" y="207"/>
<move x="40" y="205" k="2"/>
<move x="40" y="203"/>
<move x="40" y="200" k="2"/>
<move x="40" y="198"/>
<move x="40" y="196" k="6"/>
<click x="40" y="196"/>
<move x="40" y="196" k="1"/>
<move x="40" y="197"/>
<move x="40" y="205"/>
<move x="40" y="212"/>
<move x="40" y="217"/>
<move x="40" y="225"/>
<move x="35" y="240"/>
<move x="31" y="255"/>
<move x="26" y="265"/>
<move x="23" y="271"/>
<move x="22" y="275" k="1"/>
<move x="22" y="277"/>
<move x="22" y="279"/>
<move x="23" y="280"/>
<move x="24" y="282" k="1"/>
<move x="26" y="283" k="1"/>
<move x="28" y="284" k="7"/>
<click x="28" y="284"/>
<move x="28" y="284" k="3"/>
<move x="31" y="299"/>
<move x="33" y="314"/>
<move x="35" y="324"/>
<move x="35" y="331"/>
<move x="35" y="341"/>
<move x="35" y="346"/>
<move x="35" y="354"/>
<move x="35" y="356"/>
<move x="35" y="359"/>
<move x="35" y="361" k="9"/>
<move x="35" y="363" k="8"/>
<click x="35" y="363"/>
<move x="35" y="363"/>
<move x="34" y="367"/>
<move x="31" y="378"/>
<move x="31" y="382"/>
<move x="44" y="396"/>
<move x="70" y="408"/>
<move x="129" y="421"/>
<move x="157" y="425"/>
<move x="185" y="431"/>
<move x="231" y="435"/>
<move x="292" y="442"/>
<move x="350" y="442" k="1"/>
<move x="456" y="436"/>
<move x="495" y="428"/>
<move x="528" y="414"/>
<move x="549" y="401"/>
<move x="561" y="384"/>
<move x="578" y="357"/>
<move x="595" y="326"/>
<move x="607" y="296"/>
<move x="618" y="272"/>
<move x="621" y="257"/>
<move x="627" y="242"/>
<move x="626" y="234"/>
<move x="624" y="231"/>
<move x="624" y="227"/>
<move x="622" y="226" k="2"/>
<move x="622" y="224"/>
<move x="620" y="224"/>
<move x="618" y="222"/>
<move x="615" y="216"/>
<move x="613" y="214"/>
<move x="613" y="212" k="2"/>
<move x="612" y="210" k="3"/>
<move x="611" y="208" k="7"/>
<click x="611" y="208"/>
<move x="611" y="208" k="1"/>
<move x="611" y="212"/>
<move x="613" y="225"/>
<move x="615" y="242"/>
<move x="621" y="260"/>
<move x="621" y="268"/>
<move x="620" y="274"/>
<move x="620" y="275"/>
<move x="619" y="281"/>
<move x="614" y="288"/>
<move x="614" y="294"/>
<move x="611" y="297"/>
<move x="609" y="298" k="11"/>
<click x="609" y="298"/>
<move x="609" y="298"/>
<move x="608" y="302"/>
<move x="608" y="309"/>
<move x="608" y="319"/>
<move x="608" y="326" k="1"/>
<move x="606" y="341"/>
<move x="606" y="350"/>
<move x="606" y="355"/>
<move x="605" y="361"/>
<move x="605" y="366"/>
<move x="606" y="376"/>
<move x="606" y="380"/>
<move x="607" y="382"/>
<move x="608" y="384"/>
<move x="610" y="384"/>
<move x="610" y="385"/>
<move x="611" y="385" k="3"/>
<move x="612" y="385" k="6"/>
<click x="612" y="385"/>
<move x="612" y="385" k="2"/>
<move x="612" y="391"/>
<move x="612" y="411" k="5"/>
<move x="610" y="411"/>
<move x="595" y="411"/>
<move x="585" y="411"/>
<move x="583" y="410" k="1"/>
<move x="577" y="410"/>
<move x="571" y="410"/>
<move x="563" y="410"/>
<move x="559" y="410"/>
<move x="556" y="410" k="8"/>
<click x="556" y="410"/>
<move x="556" y="410" k="1"/>
<move x="548" y="410"/>
<move x="528" y="411"/>
<move x="517" y="412"/>
<move x="512" y="412"/>
<move x="503" y="412"/>
<move x="497" y="412"/>
<move x="496" y="412"/>
<move x="488" y="411"/>
<move x="483" y="411"/>
<move x="481" y="411" k="9"/>
<click x="481" y="411"/>
<move x="481" y="411" k="1"/>
<move x="475" y="413"/>
<move x="450" y="414"/>
<move x="400" y="421"/>
<move x="382" y="421"/>
<move x="380" y="421" k="5"/>
<move x="382" y="415"/>
<move x="384" y="414"/>
<move x="386" y="413" k="1"/>
<move x="388" y="412" k="7"/>
<click x="388" y="412"/>
<move x="388" y="412" k="3"/>
<move x="368" y="415"/>
<move x="362" y="415"/>
<move x="351" y="417"/>
<move x="346" y="417"/>
<move x="337" y="420"/>
<move x="320" y="420"/>
<move x="316" y="420"/>
<move x="314" y="420"/>
<move x="311" y="420"/>
<move x="309" y="420" k="5"/>
<move x="307" y="418"/>
<move x="304" y="416" k="7"/>
<click x="304" y="416"/>
<move x="304" y="416" k="2"/>
<move x="298" y="411"/>
<move x="292" y="408"/>
<move x="288" y="408" k="1"/>
<move x="279" y="407"/>
<move x="273" y="407"/>
<move x="272" y="407"/>
<move x="270" y="407"/>
<move x="266" y="407"/>
<move x="258" y="404"/>
<move x="252" y="401" k="1"/>
<move x="250" y="401"/>
<move x="247" y="401"/>
<move x="241" y="401"/>
<move x="238" y="403"/>
<move x="234" y="405"/>
<move x="230" y="407"/>
<move x="228" y="409" k="1"/>
<move x="226" y="410" k="6"/>
<click x="226" y="410"/>
<move x="226" y="410"/>
<move x="226" y="412"/>
<move x="218" y="417"/>
<move x="208" y="423"/>
<move x="188" y="424"/>
<move x="177" y="424"/>
<move x="176" y="424" k="4"/>
<move x="176" y="422"/>
<move x="176" y="418"/>
<move x="176" y="416"/>
<move x="173" y="412"/>
<move x="171" y="411" k="20"/>
<click x="171" y="411"/>
<move x="171" y="411" k="2"/>
<move x="163" y="411"/>
<move x="132" y="421"/>
<move x="119" y="423"/>
<move x="113" y="423"/>
<move x="102" y="423"/>
<move x="85" y="423"/>
<move x="77" y="423" k="4"/>
<move x="77" y="419" k="2"/>
<move x="77" y="417" k="10"/>
<click x="77" y="417"/>
<move x="77" y="417" k="11"/>
</way>
, <way>
<move x="566" y="298" k="6"/>
<move x="564" y="298"/>
<move x="542" y="301"/>
<move x="493" y="308"/>
<move x="458" y="313"/>
<move x="415" y="328"/>
<move x="399" y="330"/>
<move x="372" y="336"/>
<move x="344" y="342"/>
<move x="319" y="345"/>
<move x="294" y="353"/>
<move x="279" y="358"/>
<move x="261" y="364"/>
<move x="248" y="368"/>
<move x="241" y="368"/>
<move x="237" y="371"/>
<move x="227" y="374"/>
<move x="212" y="376"/>
<move x="197" y="378"/>
<move x="190" y="378"/>
<move x="188" y="378"/>
<move x="185" y="380"/>
<move x="183" y="380" k="1"/>
<move x="181" y="380"/>
<move x="179" y="381" k="1"/>
<move x="175" y="382"/>
<move x="171" y="384"/>
<move x="169" y="385" k="4"/>
<move x="167" y="385" k="5"/>
<click x="167" y="385"/>
<move x="168" y="385"/>
<move x="181" y="386"/>
<move x="212" y="386"/>
<move x="228" y="386"/>
<move x="244" y="386"/>
<move x="252" y="386"/>
<move x="255" y="386"/>
<move x="259" y="386" k="1"/>
<move x="261" y="386"/>
<move x="262" y="386" k="9"/>
<click x="262" y="386"/>
<move x="264" y="386"/>
<move x="274" y="386"/>
<move x="289" y="386"/>
<move x="304" y="386"/>
<move x="314" y="389"/>
<move x="324" y="390"/>
<move x="326" y="390"/>
<move x="329" y="388" k="1"/>
<move x="330" y="386" k="1"/>
<move x="331" y="386" k="1"/>
<move x="335" y="386"/>
<move x="338" y="387"/>
<move x="340" y="387"/>
<move x="345" y="387"/>
<move x="347" y="387"/>
<move x="349" y="387" k="1"/>
<move x="353" y="387"/>
<move x="357" y="387" k="3"/>
<click x="357" y="387"/>
<move x="358" y="387"/>
<move x="377" y="387"/>
<move x="412" y="388"/>
<move x="431" y="394" k="4"/>
<move x="434" y="391"/>
<move x="439" y="388"/>
<move x="443" y="387" k="1"/>
<move x="445" y="385" k="5"/>
<click x="445" y="385"/>
<move x="451" y="384"/>
<move x="474" y="382"/>
<move x="501" y="375"/>
<move x="515" y="375"/>
<move x="525" y="375"/>
<move x="535" y="375"/>
<move x="541" y="375" k="10"/>
<click x="541" y="375"/>
<move x="541" y="375" k="11"/>
</way>
, <way>
<move x="536" y="210" k="1"/>
<move x="487" y="206"/>
<move x="445" y="197"/>
<move x="414" y="194"/>
<move x="387" y="189"/>
<move x="374" y="185" k="1"/>
<move x="333" y="173"/>
<move x="297" y="162"/>
<move x="257" y="151"/>
<move x="227" y="147"/>
<move x="223" y="147" k="6"/>
<move x="220" y="149"/>
<move x="218" y="151"/>
<move x="216" y="151"/>
<move x="214" y="152" k="1"/>
<move x="212" y="153" k="8"/>
<click x="212" y="153"/>
<move x="212" y="153" k="1"/>
<move x="219" y="143"/>
<move x="229" y="134"/>
<move x="234" y="130"/>
<move x="243" y="125"/>
<move x="247" y="122"/>
<move x="259" y="113"/>
<move x="263" y="111"/>
<move x="270" y="107"/>
<move x="274" y="106"/>
<move x="280" y="104"/>
<move x="281" y="102"/>
<move x="291" y="102"/>
<move x="296" y="102"/>
<move x="302" y="102"/>
<move x="305" y="102"/>
<move x="319" y="102"/>
<move x="321" y="102" k="3"/>
<move x="323" y="102" k="2"/>
<click x="323" y="102"/>
<move x="323" y="102" k="3"/>
<move x="323" y="105"/>
<move x="321" y="115"/>
<move x="321" y="125"/>
<move x="319" y="137"/>
<move x="321" y="157"/>
<move x="333" y="183"/>
<move x="338" y="201"/>
<move x="355" y="226" k="1"/>
<move x="390" y="262"/>
<move x="413" y="288"/>
<move x="441" y="313"/>
<move x="445" y="320"/>
<move x="448" y="323"/>
<move x="449" y="325"/>
<move x="451" y="328"/>
<move x="454" y="333"/>
<move x="456" y="336"/>
<move x="462" y="341"/>
<move x="466" y="343"/>
<move x="469" y="346"/>
<move x="470" y="349"/>
<move x="473" y="352"/>
<move x="477" y="356"/>
<move x="484" y="362"/>
<move x="489" y="367"/>
<move x="490" y="369" k="1"/>
<move x="492" y="369" k="5"/>
<move x="494" y="369"/>
<click x="494" y="369"/>
<move x="495" y="369" k="1"/>
<move x="496" y="370"/>
<move x="497" y="372" k="4"/>
<move x="499" y="373" k="1"/>
<move x="499" y="375" k="6"/>
<move x="499" y="377" k="2"/>
<move x="501" y="377"/>
<move x="505" y="377"/>
<move x="507" y="377"/>
<move x="510" y="377"/>
<move x="514" y="377"/>
<move x="516" y="377"/>
<move x="522" y="377"/>
<move x="524" y="377"/>
<move x="527" y="378" k="1"/>
<move x="533" y="378"/>
<move x="535" y="378"/>
<move x="536" y="378"/>
<move x="540" y="378"/>
<move x="542" y="378"/>
<move x="545" y="378" k="6"/>
<click x="545" y="378"/>
<move x="545" y="378" k="3"/>
<move x="543" y="378"/>
<move x="537" y="378"/>
<move x="524" y="382"/>
<move x="509" y="382"/>
<move x="492" y="382"/>
<move x="472" y="382"/>
<move x="460" y="383"/>
<move x="455" y="383"/>
<move x="449" y="383"/>
<move x="447" y="383"/>
<move x="444" y="383"/>
<move x="436" y="379"/>
<move x="432" y="379"/>
<move x="429" y="378"/>
<move x="424" y="376"/>
<move x="418" y="375"/>
<move x="415" y="375"/>
<move x="411" y="375"/>
<move x="407" y="374" k="12"/>
<click x="407" y="374"/>
<move x="407" y="374" k="5"/>
<move x="406" y="372" k="1"/>
<move x="406" y="370" k="1"/>
<move x="405" y="368"/>
<move x="403" y="367"/>
<move x="399" y="365"/>
<move x="392" y="361"/>
<move x="388" y="359"/>
<move x="383" y="358"/>
<move x="377" y="358"/>
<move x="374" y="358"/>
<move x="368" y="356"/>
<move x="356" y="349"/>
<move x="346" y="348"/>
<move x="340" y="348"/>
<move x="339" y="348" k="1"/>
<move x="337" y="348"/>
<move x="333" y="346" k="1"/>
<move x="331" y="346"/>
<move x="329" y="346"/>
<move x="327" y="343"/>
<move x="326" y="342"/>
<move x="325" y="340"/>
<move x="325" y="338"/>
<move x="325" y="336"/>
<move x="325" y="334" k="1"/>
<move x="324" y="332" k="5"/>
<click x="324" y="332"/>
<move x="324" y="332" k="3"/>
<move x="322" y="330"/>
<move x="321" y="328"/>
<move x="317" y="327"/>
<move x="313" y="327"/>
<move x="310" y="327"/>
<move x="306" y="326"/>
<move x="300" y="326"/>
<move x="294" y="323"/>
<move x="289" y="323"/>
<move x="285" y="323"/>
<move x="279" y="324"/>
<move x="274" y="329"/>
<move x="270" y="334"/>
<move x="269" y="340"/>
<move x="269" y="346"/>
<move x="269" y="351"/>
<move x="269" y="353"/>
<move x="267" y="357"/>
<move x="266" y="361"/>
<move x="264" y="366"/>
<move x="263" y="368"/>
<move x="261" y="370" k="1"/>
<move x="258" y="375"/>
<move x="256" y="375"/>
<move x="254" y="375"/>
<move x="252" y="377"/>
<move x="250" y="378"/>
<move x="250" y="379"/>
<move x="248" y="379" k="3"/>
<move x="248" y="380" k="10"/>
<move x="242" y="381"/>
<move x="240" y="381"/>
<move x="238" y="384"/>
<move x="233" y="390"/>
<move x="230" y="393" k="2"/>
<move x="228" y="394" k="3"/>
<move x="224" y="396"/>
<move x="218" y="397" k="1"/>
<move x="216" y="397" k="1"/>
<move x="214" y="394"/>
<move x="213" y="392"/>
<move x="211" y="390" k="2"/>
<move x="207" y="388"/>
<move x="199" y="386"/>
<move x="194" y="385"/>
<move x="184" y="383"/>
<move x="183" y="383"/>
<move x="179" y="382" k="7"/>
<move x="180" y="382"/>
<move x="181" y="380"/>
<move x="185" y="380" k="1"/>
<move x="187" y="381" k="16"/>
<move x="188" y="382" k="1"/>
<click x="188" y="382"/>
<move x="188" y="382" k="11"/>
</way>
, <way>
<move x="584" y="227" k="5"/>
<move x="584" y="225"/>
<move x="567" y="211"/>
<move x="528" y="190"/>
<move x="512" y="178"/>
<move x="499" y="159"/>
<move x="492" y="141"/>
<move x="483" y="122"/>
<move x="477" y="104"/>
<move x="475" y="99"/>
<stripe_up_over x="475" y="94"/>
<move x="475" y="91"/>
<move x="475" y="85"/>
<move x="475" y="80"/>
<move x="475" y="74" k="25"/>
<move x="469" y="94"/>
<stripe_up_out x="465" y="121"/>
<move x="451" y="185"/>
<move x="450" y="191" k="2"/>
<move x="450" y="195"/>
<move x="444" y="204"/>
<move x="441" y="206"/>
<move x="440" y="208" k="3"/>
<move x="438" y="209" k="6"/>
<click x="438" y="209"/>
<move x="438" y="209"/>
<move x="440" y="205"/>
<move x="442" y="195"/>
<move x="445" y="187"/>
<move x="445" y="179"/>
<move x="445" y="174"/>
<move x="446" y="166"/>
<move x="446" y="160"/>
<move x="446" y="156"/>
<move x="448" y="151"/>
<move x="449" y="150" k="1"/>
<move x="455" y="149"/>
<move x="459" y="149"/>
<move x="462" y="149" k="7"/>
<click x="462" y="149"/>
<move x="462" y="149" k="1"/>
<move x="470" y="132"/>
<stripe_up_over x="475" y="93"/>
<move x="475" y="39"/>
<stripe_up_out x="475" y="32"/>
<stripe_up_over x="475" y="28"/>
<stripe_up_out x="475" y="23"/>
<stripe_up_over x="475" y="19"/>
<move x="475" y="19" k="10"/>
<stripe_up_out x="475" y="22"/>
<stripe_up_over x="475" y="28"/>
<stripe_up_out x="475" y="34"/>
<stripe_up_over x="475" y="46"/>
<move x="477" y="69"/>
<move x="481" y="92"/>
<stripe_up_out x="483" y="101"/>
<move x="485" y="119"/>
<move x="485" y="120"/>
<move x="485" y="122"/>
<move x="485" y="130"/>
<move x="483" y="138"/>
<move x="480" y="144"/>
<move x="480" y="150" k="2"/>
<move x="480" y="152"/>
<move x="481" y="152"/>
<move x="485" y="152" k="4"/>
<move x="487" y="152" k="6"/>
<click x="487" y="152"/>
<move x="487" y="152" k="4"/>
<move x="487" y="150"/>
<move x="486" y="148"/>
<move x="478" y="145"/>
<move x="463" y="142"/>
<move x="451" y="142"/>
<move x="448" y="142" k="1"/>
<move x="439" y="148"/>
<move x="431" y="148"/>
<move x="429" y="150"/>
<move x="427" y="150"/>
<move x="422" y="150"/>
<move x="408" y="150"/>
<move x="398" y="150"/>
<move x="388" y="150"/>
<move x="383" y="150" k="1"/>
<move x="381" y="150" k="1"/>
<move x="379" y="150"/>
<move x="376" y="150"/>
<move x="374" y="150"/>
<move x="372" y="150" k="4"/>
<move x="370" y="149" k="1"/>
<move x="368" y="149"/>
<move x="364" y="148"/>
<move x="363" y="148" k="1"/>
<move x="361" y="148"/>
<move x="359" y="148" k="5"/>
<click x="359" y="148"/>
<move x="359" y="148"/>
<move x="357" y="145"/>
<move x="352" y="133"/>
<move x="347" y="112"/>
<move x="344" y="95"/>
<stripe_up_over x="341" y="86"/>
<move x="336" y="65"/>
<move x="336" y="63" k="22"/>
<move x="344" y="91"/>
<stripe_up_out x="353" y="111"/>
<move x="360" y="139"/>
<move x="360" y="149"/>
<move x="358" y="154"/>
<move x="356" y="158"/>
<move x="356" y="160" k="3"/>
<move x="356" y="162" k="1"/>
<move x="357" y="164" k="2"/>
<move x="359" y="165"/>
<move x="360" y="167" k="8"/>
<move x="360" y="175"/>
<move x="360" y="181"/>
<move x="360" y="186" k="7"/>
<move x="360" y="179"/>
<move x="361" y="177" k="1"/>
<move x="361" y="175" k="8"/>
<click x="361" y="175"/>
<move x="361" y="173"/>
<move x="357" y="168"/>
<move x="343" y="161"/>
<move x="328" y="159"/>
<move x="318" y="155" k="3"/>
<move x="312" y="155"/>
<move x="308" y="157"/>
<move x="305" y="157" k="1"/>
<move x="297" y="157"/>
<move x="293" y="158" k="7"/>
<move x="293" y="156" k="6"/>
<move x="291" y="156" k="5"/>
<click x="291" y="156"/>
<move x="291" y="156" k="6"/>
<move x="291" y="154"/>
<move x="306" y="148"/>
<move x="331" y="143"/>
<move x="352" y="138"/>
<move x="385" y="128"/>
<move x="406" y="119"/>
<move x="422" y="112"/>
<move x="427" y="109"/>
<move x="428" y="107"/>
<move x="429" y="102"/>
<move x="433" y="97"/>
<stripe_up_over x="434" y="93"/>
<move x="436" y="83"/>
<move x="436" y="81" k="4"/>
<move x="441" y="85" k="9"/>
<move x="441" y="87" k="2"/>
<move x="442" y="94"/>
<stripe_up_out x="442" y="98"/>
<move x="446" y="134"/>
<move x="446" y="161"/>
<move x="446" y="181"/>
<move x="446" y="195"/>
<move x="446" y="201"/>
<move x="443" y="206"/>
<move x="441" y="211"/>
<move x="436" y="216"/>
<move x="431" y="220"/>
<move x="431" y="222"/>
<move x="429" y="223" k="5"/>
<move x="427" y="223" k="7"/>
<click x="427" y="223"/>
<move x="427" y="223" k="1"/>
<move x="425" y="223"/>
<move x="425" y="219"/>
<move x="424" y="211"/>
<move x="424" y="204"/>
<move x="424" y="198"/>
<move x="423" y="191"/>
<move x="422" y="187"/>
<move x="418" y="182"/>
<move x="418" y="179" k="1"/>
<move x="418" y="175"/>
<move x="418" y="171"/>
<move x="418" y="170"/>
<move x="418" y="168" k="1"/>
<move x="418" y="166"/>
<move x="418" y="164"/>
<move x="414" y="162" k="6"/>
<move x="410" y="160"/>
<move x="408" y="160"/>
<move x="406" y="160" k="15"/>
<move x="407" y="160" k="2"/>
<move x="409" y="161"/>
<move x="411" y="161"/>
<move x="413" y="161"/>
<move x="415" y="161" k="8"/>
<click x="415" y="161"/>
<move x="415" y="161" k="1"/>
<move x="416" y="151"/>
<move x="419" y="136"/>
<move x="420" y="113"/>
<stripe_up_over x="424" y="92"/>
<move x="423" y="79"/>
<move x="423" y="72" k="19"/>
<move x="423" y="73"/>
<move x="428" y="91"/>
<stripe_up_out x="433" y="104"/>
<move x="438" y="125"/>
<move x="446" y="139"/>
<move x="447" y="141" k="1"/>
<move x="447" y="145"/>
<move x="443" y="150"/>
<move x="433" y="157"/>
<move x="420" y="166"/>
<move x="411" y="168"/>
<move x="398" y="170"/>
<move x="392" y="169"/>
<move x="383" y="166"/>
<move x="376" y="163"/>
<move x="375" y="161" k="1"/>
<move x="373" y="160"/>
<move x="370" y="158"/>
<move x="369" y="158"/>
<move x="367" y="158" k="14"/>
<move x="367" y="161"/>
<move x="367" y="163" k="12"/>
<move x="375" y="161"/>
<move x="425" y="149"/>
<move x="443" y="145" k="5"/>
<move x="443" y="146"/>
<move x="442" y="150"/>
<move x="439" y="155"/>
<move x="438" y="159" k="5"/>
<move x="436" y="159" k="6"/>
<click x="436" y="159"/>
<move x="436" y="155"/>
<move x="436" y="151"/>
<move x="434" y="146"/>
<move x="430" y="140"/>
<move x="429" y="138"/>
<move x="427" y="137"/>
<move x="419" y="133"/>
<move x="408" y="130"/>
<move x="393" y="126"/>
<move x="377" y="120"/>
<move x="370" y="116"/>
<move x="368" y="112"/>
<move x="366" y="111" k="8"/>
<click x="366" y="111"/>
<move x="366" y="111" k="4"/>
<move x="366" y="104"/>
<stripe_up_over x="367" y="91"/>
<move x="371" y="70"/>
<move x="372" y="66" k="17"/>
<move x="379" y="82"/>
<stripe_up_out x="389" y="99"/>
<move x="397" y="108"/>
<move x="407" y="124"/>
<move x="411" y="131"/>
<move x="413" y="139"/>
<move x="416" y="151"/>
<move x="420" y="162"/>
<move x="420" y="169"/>
<move x="420" y="175"/>
<move x="420" y="180"/>
<move x="420" y="184"/>
<move x="419" y="188"/>
<move x="418" y="191" k="1"/>
<move x="418" y="193"/>
<move x="417" y="195" k="2"/>
<move x="415" y="191" k="1"/>
<move x="413" y="191"/>
<move x="411" y="191" k="28"/>
<click x="411" y="191"/>
<move x="411" y="191"/>
<move x="409" y="191"/>
<move x="406" y="186"/>
<move x="400" y="180"/>
<move x="388" y="171"/>
<move x="377" y="165"/>
<move x="371" y="162"/>
<move x="368" y="159"/>
<move x="364" y="154"/>
<move x="362" y="153"/>
<move x="361" y="151" k="18"/>
<move x="362" y="151" k="17"/>
<click x="362" y="151"/>
<move x="362" y="151"/>
<move x="362" y="145"/>
<move x="362" y="135"/>
<move x="362" y="132"/>
<move x="360" y="120"/>
<move x="360" y="115"/>
<move x="360" y="111"/>
<move x="360" y="107"/>
<move x="360" y="106"/>
<move x="360" y="104"/>
<move x="360" y="102"/>
<move x="360" y="100"/>
<move x="360" y="98" k="3"/>
<move x="360" y="96"/>
<move x="360" y="95" k="7"/>
<click x="360" y="95"/>
<move x="360" y="95" k="6"/>
<move x="366" y="104"/>
<move x="370" y="116"/>
<move x="376" y="131"/>
<move x="385" y="145"/>
<move x="399" y="172"/>
<move x="410" y="193"/>
<move x="411" y="202"/>
<move x="414" y="210"/>
<move x="414" y="224"/>
<move x="415" y="239"/>
<move x="416" y="249"/>
<move x="416" y="263"/>
<move x="416" y="278"/>
<move x="418" y="292"/>
<move x="419" y="309"/>
<move x="417" y="329"/>
<move x="410" y="354"/>
<move x="407" y="364"/>
<move x="405" y="368"/>
<move x="405" y="386"/>
<stripe_down_over x="405" y="409"/>
<move x="407" y="425"/>
<move x="409" y="428" k="2"/>
<move x="412" y="425"/>
<move x="416" y="420"/>
<move x="419" y="412"/>
<move x="419" y="408" k="3"/>
<move x="419" y="406" k="6"/>
<move x="419" y="404"/>
<move x="419" y="401" k="5"/>
<move x="418" y="399" k="2"/>
<move x="418" y="396"/>
<stripe_down_out x="423" y="393"/>
<move x="436" y="381"/>
<move x="442" y="374"/>
<move x="446" y="364"/>
<move x="452" y="351"/>
<move x="457" y="333"/>
<move x="464" y="311"/>
<move x="464" y="302"/>
<move x="463" y="300"/>
<move x="462" y="294"/>
<move x="460" y="284"/>
<move x="459" y="276"/>
<move x="461" y="266"/>
<move x="463" y="262" k="1"/>
<move x="465" y="262"/>
<move x="467" y="262"/>
<move x="469" y="259"/>
<move x="470" y="259" k="4"/>
<move x="472" y="263"/>
<move x="474" y="268"/>
<move x="475" y="270" k="1"/>
<move x="477" y="271" k="1"/>
<move x="478" y="273"/>
<move x="479" y="275" k="6"/>
<move x="476" y="271"/>
<move x="474" y="267" k="2"/>
<move x="473" y="265" k="8"/>
<click x="473" y="265"/>
<move x="473" y="265"/>
<move x="474" y="277"/>
<move x="478" y="293"/>
<move x="479" y="307"/>
<move x="479" y="319"/>
<move x="479" y="327"/>
<move x="479" y="331" k="12"/>
<click x="479" y="331"/>
<move x="479" y="331"/>
<move x="479" y="336"/>
<move x="480" y="351"/>
<move x="480" y="364"/>
<move x="477" y="386"/>
<stripe_down_over x="474" y="399"/>
<move x="473" y="406"/>
<move x="473" y="412"/>
<move x="473" y="413" k="11"/>
<move x="474" y="405"/>
<stripe_down_out x="478" y="394"/>
<move x="484" y="374"/>
<move x="484" y="364"/>
<move x="481" y="354"/>
<move x="481" y="335"/>
<move x="481" y="321"/>
<move x="480" y="313"/>
<move x="479" y="307"/>
<move x="479" y="298"/>
<move x="479" y="291"/>
<move x="479" y="287"/>
<move x="479" y="279"/>
<move x="478" y="275"/>
<move x="478" y="274"/>
<move x="478" y="272" k="1"/>
<move x="478" y="268"/>
<move x="478" y="266" k="8"/>
<click x="478" y="266"/>
<move x="478" y="266"/>
<move x="478" y="280"/>
<move x="478" y="309"/>
<move x="478" y="347"/>
<move x="478" y="375"/>
<move x="478" y="381" k="2"/>
<move x="477" y="373"/>
<move x="478" y="367"/>
<move x="478" y="366" k="2"/>
<move x="478" y="367"/>
<move x="478" y="369"/>
<move x="479" y="371" k="4"/>
<move x="480" y="373"/>
<move x="482" y="374" k="3"/>
<move x="484" y="374" k="1"/>
<move x="485" y="372" k="4"/>
<move x="483" y="372" k="3"/>
<move x="483" y="368" k="6"/>
<move x="482" y="366" k="1"/>
<move x="481" y="364"/>
<move x="479" y="363" k="8"/>
<click x="479" y="363"/>
<move x="479" y="363" k="1"/>
<move x="479" y="366"/>
<move x="475" y="377"/>
<stripe_down_over x="468" y="396"/>
<move x="465" y="406"/>
<move x="459" y="421"/>
<move x="458" y="423" k="2"/>
<move x="458" y="424" k="13"/>
<move x="461" y="419"/>
<move x="470" y="406"/>
<stripe_down_out x="474" y="393"/>
<move x="483" y="375"/>
<move x="488" y="361"/>
<move x="491" y="347"/>
<move x="494" y="335"/>
<move x="497" y="325"/>
<move x="498" y="321"/>
<move x="498" y="317"/>
<move x="498" y="313" k="8"/>
<click x="498" y="313"/>
<move x="498" y="313" k="1"/>
<move x="498" y="320"/>
<move x="496" y="324"/>
<move x="490" y="326"/>
<move x="484" y="327"/>
<move x="475" y="329"/>
<move x="465" y="330"/>
<move x="460" y="330"/>
<move x="450" y="330"/>
<move x="446" y="332"/>
<move x="440" y="332"/>
<move x="434" y="332"/>
<move x="431" y="332"/>
<move x="427" y="331"/>
<move x="425" y="331" k="3"/>
<move x="425" y="332" k="2"/>
<move x="424" y="334" k="2"/>
<move x="423" y="336" k="4"/>
<move x="422" y="338"/>
<move x="418" y="343"/>
<move x="414" y="348"/>
<move x="410" y="350" k="10"/>
<click x="410" y="350"/>
<move x="410" y="350" k="1"/>
<move x="407" y="345"/>
<move x="395" y="339"/>
<move x="371" y="336"/>
<move x="333" y="336"/>
<move x="308" y="342"/>
<move x="293" y="343"/>
<move x="284" y="343"/>
<move x="278" y="344"/>
<move x="275" y="346"/>
<move x="273" y="346"/>
<move x="271" y="347"/>
<move x="270" y="349" k="8"/>
<click x="270" y="349"/>
<move x="270" y="349" k="4"/>
<move x="271" y="349" k="1"/>
<move x="273" y="349" k="6"/>
<move x="275" y="352"/>
<move x="264" y="348"/>
<move x="228" y="344"/>
<move x="192" y="329"/>
<move x="171" y="320"/>
<move x="140" y="316"/>
<move x="122" y="318"/>
<move x="105" y="319"/>
<move x="90" y="319"/>
<move x="71" y="320"/>
<move x="60" y="316"/>
<move x="50" y="315"/>
<move x="44" y="315" k="10"/>
<click x="44" y="315"/>
<move x="44" y="315" k="1"/>
<move x="49" y="314"/>
<move x="62" y="316"/>
<move x="76" y="324"/>
<move x="81" y="327"/>
<move x="91" y="331"/>
<move x="110" y="334"/>
<move x="114" y="336" k="2"/>
<move x="115" y="336"/>
<move x="119" y="336"/>
<move x="121" y="336"/>
<move x="123" y="336" k="15"/>
<click x="123" y="336"/>
<move x="123" y="336" k="3"/>
<move x="126" y="336"/>
<move x="134" y="336"/>
<move x="138" y="336"/>
<move x="140" y="336" k="2"/>
<move x="145" y="332" k="1"/>
<move x="146" y="331"/>
</way>
];
}
}//package TheGame
Section 167
//Volt (TheGame.Volt)
package TheGame {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.events.*;
import TheGame.MyPhysics.*;
import com.touchmypixel.peepee.utils.*;
import flash.geom.*;
import flash.text.*;
import TheGame.Screens.*;
import TheGame.GameTemplate.*;
import flash.utils.*;
public class Volt extends PhysicsMovie {
var tempConnectLength:Number;// = 0
var connectedVolts:Array;
var volt_in_an_usual:Animation;
public var id:Number;// = 0
var volt_adding:Sprite;
var volt_in:Sprite;
var myWorkZone:WorkZone;
var myT:Timer;
var volt_in_mc:MovieClip;
var _physBody:b2Body;
var startShine:MovieClip;
var maxTempConnects:Number;// = 3
var minDSqr:Number;
var myState:String;
var _ownId:Number;
var _physSatellite:b2Body;
var constConnects:Array;
var maxConnects:Number;// = 6
var volt_in_an:Animation;
var pStart:Point;
var maxDSqr:Number;
var insideMeVolt:MovieClip;
var physSatConnect:b2Joint;
var isStart:Boolean;// = true
var volt_in_an_sad:Animation;
private var isBecameMovie:Boolean;// = false
var myB2Shapes:Array;
public var ownId_txt:TextField;
var indexSplice:Number;// = -10
public var tempConnect:VoltJoint;
var scotchedTo_arr:Array;
var volt_in_an_glad:Animation;
public static const VOLT_SWIM:Number = 3;
public static const maxD:Number = 100;
public static const STATE_SAD:String = "sad";
public static const jointStepX:Number = 10;
public static const VOLT_SIMPLE:Number = 0;
public static const VOLT_STAT:Number = 1;
public static const STATE_USUAL:String = "usual";
public static const STATE_GLAD:String = "glad";
public static const VOLT_SCOTCH:Number = 2;
public static const minD:Number = 40;
public function Volt(){
minDSqr = Math.pow(minD, 2);
maxDSqr = Math.pow(maxD, 2);
super();
objInfoParams = ["x", "y"];
cacheAsBitmap = false;
tempConnect = null;
constConnects = [];
connectedVolts = [];
insideMeVolt = (addChild(new MovieClip()) as MovieClip);
}
function getDensity():Number{
switch (id){
default:
return ((1 * mainDensity));
};
}
private function traceInfoIfOn(_arg1):void{
if (this.hitTestPoint(root.mouseX, root.mouseY, false)){
trace(name, id, rotation);
};
}
override public function beforeDelete(){
if (myT != null){
myT.stop();
myT.removeEventListener(TimerEvent.TIMER, onMyTimer);
};
}
function setIdByClass(){
var _local1:String = getQualifiedClassName(this);
switch (_local1){
case "volt1":
id = 0;
break;
case "volt2":
id = 1;
break;
case "volt3":
id = 2;
break;
case "volt4":
id = 3;
break;
};
}
override protected function addSplashes(){
var _local1:MovieClip;
if (this.strForContact == Game.stringForWater){
_local1 = (this.parent.addChild(new wat_mc()) as MovieClip);
_local1.x = this.x;
_local1.y = this.y;
};
}
function getFrames(_arg1:String="usual"):Number{
switch (id){
case VOLT_SIMPLE:
switch (_arg1){
case STATE_USUAL:
return (27);
case STATE_SAD:
return (16);
case STATE_GLAD:
return (13);
};
break;
case VOLT_STAT:
switch (_arg1){
case STATE_USUAL:
return (15);
case STATE_SAD:
return (17);
case STATE_GLAD:
return (17);
};
break;
case VOLT_SCOTCH:
switch (_arg1){
case STATE_USUAL:
return (16);
case STATE_SAD:
return (13);
case STATE_GLAD:
return (16);
};
break;
case VOLT_SWIM:
switch (_arg1){
case STATE_USUAL:
return (19);
case STATE_SAD:
return (12);
case STATE_GLAD:
return (21);
};
break;
};
return (1);
}
public function get physSatellite():b2Body{
return (_physSatellite);
}
override public function setAllMyBits(_arg1:Boolean){
setAllMyBitsB2(myB2Shapes, _arg1);
}
public function set physSatellite(_arg1:b2Body):void{
_physSatellite = _arg1;
}
function toConstConnect():Boolean{
if (tempConnect != null){
constConnects.push(tempConnect);
tempConnect.becomeConst();
tempConnect = null;
return (true);
};
return (false);
}
override public function getObjectInfo():XML{
if (isStart){
return (super.getObjectInfo());
};
return (null);
}
override public function createMyObject(){
}
public function set physBody(_arg1:b2Body):void{
_physBody = _arg1;
aBody = _arg1;
}
public function delConstConnect(_arg1:VoltJoint){
var _local2:* = 0;
while (_local2 < constConnects.length) {
if (constConnects[_local2] == _arg1){
constConnects.splice(_local2, 1);
break;
};
_local2++;
};
}
public function set ownId(_arg1:Number):void{
_ownId = _arg1;
}
function onMyTimer(_arg1:Event){
myWorkZone.myLevelFailed();
myWorkZone.myLevel.levelFailed(strForContact);
delMeFromWorkZone();
}
public function findMyNeighbours(_arg1:Array):Array{
var _local2:Volt;
var _local3:Volt;
for each (_local2 in _arg1) {
if (_local2 == this){
return ([]);
};
};
_arg1.push(this);
for each (_local3 in connectedVolts) {
_local3.findMyNeighbours(_arg1);
};
return (_arg1);
}
function makeState(_arg1:String="usual", _arg2:Boolean=false){
myState = _arg1;
if (((!((volt_in == null))) && ((volt_in == volt_in_mc)))){
volt_in_mc.in_mc.gotoAndPlay(_arg1);
if (_arg2){
volt_in_mc.in_mc.gotoAndPlay((volt_in_mc.in_mc.currentFrame + MyFunc.random(getFrames(_arg1))));
};
} else {
if (volt_in != null){
insideMeVolt.removeChild(volt_in);
};
volt_adding.visible = (_arg1 == STATE_USUAL);
switch (_arg1){
case STATE_GLAD:
volt_in_an = volt_in_an_glad;
break;
case STATE_SAD:
volt_in_an = volt_in_an_sad;
break;
default:
volt_in_an = volt_in_an_usual;
break;
};
volt_in = volt_in_an;
insideMeVolt.addChild(volt_in);
volt_in_an.play();
if (_arg2){
volt_in_an.gotoAndPlay(MyFunc.random(getFrames(_arg1)));
};
};
}
override public function initMe(_arg1:PhysicsWorld){
super.initMe(_arg1);
myWorkZone = (physWorld as WorkZone);
setIdByClass();
if (id == VOLT_SWIM){
collideMaskBits = waterMaskBits;
canSwimInWater = true;
maxConnects = 6;
};
if (id == VOLT_STAT){
maxConnects = 2;
};
if (id == VOLT_SCOTCH){
maxConnects = 6;
};
myWorkZone.addVoltPhysics(this);
volt_in_an_usual = Game.voltAnimationCache.getAnimation(getLibraryName(id, STATE_USUAL));
volt_in_an_glad = Game.voltAnimationCache.getAnimation(getLibraryName(id, STATE_GLAD));
volt_in_an_sad = Game.voltAnimationCache.getAnimation(getLibraryName(id, STATE_SAD));
var _local2:Point = getAnimationPoint();
volt_adding = (new (getDefinitionByName(getAddingLibraryName(id))) as MovieClip);
volt_adding.x = _local2.x;
volt_adding.y = _local2.y;
insideMeVolt.addChild(volt_adding);
volt_adding.scaleX = (volt_adding.scaleY = 0.5);
makeState(STATE_USUAL, true);
insideMeVolt.swapChildren(volt_adding, volt_in);
volt_in_mc = (new (getDefinitionByName(("volt_in" + String((id + 1))))) as MovieClip);
if (((isStart) && ((myWorkZone.myLevel.modeGame == Level.MODE_LEVEL)))){
createShine(true);
};
}
override public function swimIfCan():Boolean{
var _local1:Boolean = super.swimIfCan();
if (!_local1){
voltDestroyed();
};
return (_local1);
}
public function createShine(_arg1:Boolean){
if (startShine != null){
removeChild(startShine);
};
startShine = (addChild((_arg1) ? new startVoltClip() : new startVoltClip2()) as MovieClip);
switch (id){
case VOLT_SCOTCH:
startShine.x = (startShine.x - 27);
startShine.y = (startShine.y - 27);
break;
case VOLT_SIMPLE:
startShine.x = (startShine.x - 28);
startShine.y = (startShine.y - 25);
break;
case VOLT_STAT:
startShine.x = (startShine.x - 29);
startShine.y = (startShine.y - 27);
break;
case VOLT_SWIM:
startShine.x = (startShine.x - 29);
startShine.y = (startShine.y - 31);
break;
};
swapChildren(startShine, insideMeVolt);
}
function voltDestroyed(){
makeState(STATE_SAD);
delAllConstConnects();
if ((((strForContact == Game.stringForNoContact)) && (!((tempConnect == null))))){
tempConnect.removeTempMe();
};
myT = new Timer(1, 1);
myT.addEventListener(TimerEvent.TIMER, onMyTimer);
myT.start();
}
public function get physBody():b2Body{
return (_physBody);
}
public function delAllConstConnects(){
var _local1:VoltJoint;
while (constConnects.length > 0) {
_local1 = constConnects[0];
_local1.removeMe();
};
}
public function delConnectedVolt(_arg1:Volt){
var _local2:* = 0;
while (_local2 < connectedVolts.length) {
if (connectedVolts[_local2] == _arg1){
connectedVolts.splice(_local2, 1);
break;
};
_local2++;
};
}
function becomeMovie(){
if (!isBecameMovie){
isBecameMovie = true;
insideMeVolt.removeChild(volt_in);
volt_in = volt_in_mc;
insideMeVolt.addChild(volt_in);
makeState(myState);
if (volt_adding != null){
volt_adding.visible = false;
};
};
}
private function voltFunc(_arg1:String, _arg2=null){
if (_arg2 == null){
var _local3 = volt_in;
_local3[_arg1]();
} else {
_local3 = volt_in;
_local3[_arg1](_arg2);
};
}
public function doScotch(_arg1:PhysicsMovie, _arg2:b2Vec2){
var _local3:b2DistanceJointDef;
var _local4:b2JointDef;
var _local5:b2Joint;
var _local6:PhysicsMovie;
if (_arg1 == null){
return;
};
if (scotchedTo_arr == null){
scotchedTo_arr = [];
} else {
for each (_local6 in scotchedTo_arr) {
if (_local6 == _arg1){
return;
};
};
};
scotchedTo_arr.push(_arg1);
_local3 = new b2DistanceJointDef();
_local3.Initialize(_arg1.aBody, physSatellite, _arg2, aBody.GetWorldCenter());
_local3.collideConnected = true;
_local4 = _local3;
_local5 = physWorld.m_world.CreateJoint(_local4);
}
function addToMyShapes(_arg1:b2Shape){
if (myB2Shapes == null){
myB2Shapes = [];
};
if (myShapes == null){
myShapes = [];
};
myB2Shapes.push(_arg1);
myShapes.push(_arg1);
}
override protected function removeMovie(){
var _local3:*;
var _local4:b2Body;
var _local1:VoltSpirit = new VoltSpirit();
_local1.startMotion(this);
super.removeMovie();
var _local2:* = 0;
while (_local2 < myWorkZone.volts.length) {
if (this == myWorkZone.volts[_local2]){
indexSplice = _local2;
voltDestroyed();
_local3 = 0;
while (_local3 < myShapes.length) {
_local4 = (myShapes[_local3] as b2Shape).m_body;
if (_local4 != null){
myWorkZone.m_world.DestroyBody(b2Shape(myShapes[_local3]).m_body);
};
_local3++;
};
myShapes = [];
break;
};
_local2++;
};
}
function getAnimationPoint():Point{
switch (id){
case VOLT_SIMPLE:
return (new Point(110, 169));
case VOLT_STAT:
return (new Point(110, 172));
case VOLT_SCOTCH:
return (new Point(110, 169));
case VOLT_SWIM:
return (new Point(110, 169));
};
return (null);
}
function delMeFromWorkZone(){
if (indexSplice != -10){
myWorkZone.volts.splice(indexSplice, 1);
indexSplice = -10;
};
}
public function get ownId():Number{
return (_ownId);
}
public static function getMaxTempConnects(_arg1:Number):Number{
switch (_arg1){
case VOLT_STAT:
return (1);
default:
return (3);
};
}
public static function getLibraryName(_arg1:Number, _arg2:String):String{
return (((("volt_in" + String((_arg1 + 1))) + "_") + _arg2));
}
public static function getAddingLibraryName(_arg1:Number):String{
return ((("volt_in" + String((_arg1 + 1))) + "_adding"));
}
}
}//package TheGame
Section 168
//VoltFlying (TheGame.VoltFlying)
package TheGame {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import TheGame.MyPhysics.*;
public class VoltFlying extends Volt {
var pusherBody:b2Body;
var jointDef:b2PrismaticJointDef;
var pusherBodyDef:b2BodyDef;
var myJoint:b2PrismaticJoint;
function createPusher(){
pusherBodyDef = new b2BodyDef();
pusherBodyDef.position.Set(aBody.GetPosition().x, (aBody.GetPosition().y + 2));
pusherBody = physWorld.m_world.CreateBody(pusherBodyDef);
var _local1:b2PolygonDef = new b2PolygonDef();
_local1.SetAsBox(0.01, 0.01);
var _local2:b2Shape = pusherBody.CreateShape(_local1);
_local2.m_filter.categoryBits = 4;
_local2.m_filter.maskBits = 4;
}
function createJoint(){
var _local1:b2Vec2 = new b2Vec2(0, -1);
jointDef = new b2PrismaticJointDef();
jointDef.Initialize(pusherBody, aBody, pusherBody.GetWorldCenter(), _local1);
jointDef.maxMotorForce = 0.5;
jointDef.motorSpeed = 0.4;
jointDef.enableMotor = true;
myJoint = (physWorld.m_world.CreateJoint(jointDef) as b2PrismaticJoint);
}
override public function initMe(_arg1:PhysicsWorld){
super.initMe(_arg1);
createPusher();
createJoint();
}
}
}//package TheGame
Section 169
//VoltJoint (TheGame.VoltJoint)
package TheGame {
import flash.display.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import flash.events.*;
import com.touchmypixel.peepee.utils.*;
import TheGame.GameTemplate.*;
public class VoltJoint extends Base {
var m_world:b2World;
public var line_mc:MovieClip;
var startWidth:Number;
var connectedVolt2:Volt;
public var mask_mc:MovieClip;
var joint:b2Joint;
var clipLine_mc:Animation;
var connectedVolt1:Volt;
var isRemoved:Boolean;// = false
var dist:Number;
var myWorkZone:WorkZone;
var counterWidth:Number;// = 0
public function VoltJoint(){
attachLineMovie("electric_line_in");
clipLine_mc.mask = mask_mc;
}
function getMyWidth():Number{
return ((myWorkZone.myScale * Math.sqrt(myWorkZone.getDistSqr(connectedVolt1.x, connectedVolt1.y, connectedVolt2.x, connectedVolt2.y))));
}
function attachLineMovie(_arg1:String){
clipLine_mc = Game.voltAnimationCache.getAnimation(_arg1);
addChild(clipLine_mc);
clipLine_mc.gotoAndPlay((MyFunc.random(clipLine_mc.totalFrames) + 1));
}
public function becomeConst(){
removeChild(clipLine_mc);
var _local1:Number = (Math.round((mask_mc.width / Volt.jointStepX)) * Volt.jointStepX);
clipLine_mc.mask = null;
mask_mc.visible = false;
attachLineMovie(("electric_line_in_" + String(_local1)));
startWidth = getMyWidth();
this.addEventListener(Event.ENTER_FRAME, onEnFrWidth);
}
function onEnFrWidth(_arg1:Event){
if (counterWidth > 5){
counterWidth = 0;
if (getMyWidth() > (startWidth + 1000)){
removeMe();
};
} else {
counterWidth = (counterWidth + 1);
};
}
public function removeTempMe(){
parent.removeChild(this);
isRemoved = true;
}
override public function beforeDelete(){
this.removeEventListener(Event.ENTER_FRAME, onEnFrWidth);
}
public function removeMe(){
if (!isRemoved){
m_world.DestroyJoint(joint);
if (parent != null){
parent.removeChild(this);
};
connectedVolt1.delConnectedVolt(connectedVolt2);
connectedVolt2.delConnectedVolt(connectedVolt1);
connectedVolt1.delConstConnect(this);
connectedVolt2.delConstConnect(this);
myWorkZone.delConnect(this);
isRemoved = true;
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, onEnFrWidth);
};
};
}
}
}//package TheGame
Section 170
//VoltModeBtn (TheGame.VoltModeBtn)
package TheGame {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.Screens.*;
import TheGame.GameTemplate.*;
public class VoltModeBtn extends Base {
var myVolts:MovieClip;
var numberVolts:Number;// = 4
var myPlate:MovieClip;
var _currentVolt:Number;
public var volts_pic:MovieClip;
var allKol:Array;
public var volts_plate:MovieClip;
public var border_pic:MovieClip;
var myBorder:MovieClip;
private var myLevel:Level;
public static var kInfinity:Number = 1000;
public function VoltModeBtn(){
myBorder = border_pic;
myVolts = volts_pic;
myPlate = volts_plate;
}
function showEnableVolt(){
var _local1:* = 1;
while (_local1 < (allKol.length + 1)) {
changeVisible(_local1, ((allKol[(_local1 - 1)])!=0) ? true : false);
_local1++;
};
}
public function init(_arg1:Array, _arg2:Level, _arg3:Number){
allKol = _arg1;
myLevel = _arg2;
buttonMode = true;
currentVolt = _arg3;
checkCurrentVolt();
addEventListener(MouseEvent.CLICK, onSelect);
showEnableVolt();
}
override public function beforeDelete(){
removeEventListener(MouseEvent.CLICK, onSelect);
}
private function destruct(){
removeEventListener(MouseEvent.CLICK, onSelect);
}
public function updatePopulationTxt(){
var _local2:TextField;
var _local1:* = 0;
while (_local1 < allKol.length) {
_local2 = myBorder[("population_" + (_local1 + 1))];
_local2.text = allKol[_local1].toString();
_local2.textColor = ((_local1)==currentVolt) ? 0xFFFFFF : 0xFFFFFF;
_local1++;
};
showEnableVolt();
}
public function get currentVolt():Number{
return (_currentVolt);
}
public function endLevelVolt():Number{
var _local1:Number = 0;
var _local2:* = 0;
while (_local2 < allKol.length) {
_local1 = (_local1 + Number(allKol[_local2]));
_local2++;
};
return (_local1);
}
public function decreaseK():Boolean{
if (allKol[currentVolt] == 0){
return (false);
};
if (allKol[currentVolt] < kInfinity){
allKol[currentVolt] = (allKol[currentVolt] - 1);
};
updatePopulationTxt();
return (true);
}
function changeVisible(_arg1:Number, _arg2:Boolean){
myVolts[("v_" + _arg1)].visible = (myPlate[("plate_" + _arg1)].visible = (myBorder[("population_" + _arg1)].visible = (myBorder[("c_" + _arg1)].visible = _arg2)));
if (_arg2){
myBorder[("dark_" + _arg1)].visible = ((_arg1)!=(currentVolt + 1)) ? _arg2 : !(_arg2);
myBorder[("r_" + _arg1)].visible = !(myBorder[("dark_" + _arg1)].visible);
} else {
myBorder[("dark_" + _arg1)].visible = (myBorder[("r_" + _arg1)].visible = _arg2);
};
}
public function checkCurrentVolt(){
var _local1:Array;
var _local2:*;
if (allKol[currentVolt] == 0){
_local1 = [];
_local2 = 0;
while (_local2 < allKol.length) {
if (allKol[_local2] != 0){
_local1.push(_local2);
};
_local2++;
};
if (_local1.length != 0){
currentVolt = _local1[0];
};
};
}
public function set currentVolt(_arg1:Number):void{
_currentVolt = _arg1;
updatePopulationTxt();
}
public function onSelect(_arg1:MouseEvent):void{
var _local3:Point;
var _local2:* = 0;
while (_local2 < numberVolts) {
_local3 = myLevel.workZone_mc.mousePoint(false);
if (myVolts[("v_" + (_local2 + 1))].hitTestPoint(_local3.x, _local3.y, true)){
currentVolt = _local2;
myLevel.myGame.captureClick(false);
};
_local2++;
};
}
}
}//package TheGame
Section 171
//VoltSpirit (TheGame.VoltSpirit)
package TheGame {
import flash.display.*;
import flash.events.*;
import TheGame.GameTemplate.*;
public class VoltSpirit extends Base {
var insideMe:MovieClip;
var myParent;
function onEnterFrameInside(_arg1:Event){
if (insideMe.currentFrame >= insideMe.totalFrames){
insideMe.removeEventListener(Event.ENTER_FRAME, onEnterFrameInside);
myParent.removeChild(insideMe);
};
}
override public function beforeDelete(){
insideMe.removeEventListener(Event.ENTER_FRAME, onEnterFrameInside);
}
function findMySpirit(_arg1:Number):DisplayObject{
switch (_arg1){
case Volt.VOLT_SIMPLE:
return (new spirit_usual_clip());
case Volt.VOLT_STAT:
return (new spirit_flying_clip());
case Volt.VOLT_SWIM:
return (new spirit_water_clip());
case Volt.VOLT_SCOTCH:
return (new spirit_sticking_clip());
};
return (null);
}
public function startMotion(_arg1:Volt){
myParent = _arg1.parent;
insideMe = (myParent.addChild(findMySpirit(_arg1.id)) as MovieClip);
insideMe.x = _arg1.x;
insideMe.y = _arg1.y;
insideMe.addEventListener(Event.ENTER_FRAME, onEnterFrameInside);
}
}
}//package TheGame
Section 172
//WorkZone (TheGame.WorkZone)
package TheGame {
import flash.display.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import TheGame.MyPhysics.*;
import flash.geom.*;
import TheGame.Screens.*;
import TheGame.GameTemplate.*;
import flash.utils.*;
public class WorkZone extends PhysicsWorld {
var firstVoltPoints:Array;
public var myH:Number;
var canNowConnect:Boolean;// = true
var kTimeSteps:int;
var nowH:Number;// = 0
var editLevel_btn:MovieClip;
public var myLevel:Level;
public var myW:Number;
var allWorlObjects:MovieClip;
var timer:Timer;
var m_iterations:int;
public var stripe_down:MovieClip;
var volts_mc:MovieClip;
public var levelNo:Number;
var maxH:Number;// = 0
var dyk:Number;
public var isEditLevel:Boolean;// = false
var volts:Array;
var towerStartY:Number;// = -1
var plat_mc:MovieClip;
public var mask_mc_:workZonePlat;
var stripeStep:Number;// = 10
var voltOwnId:Number;
var enginePerFrame:int;
var appVolt:FirstAppearanceVolt;
var highestVolt:Volt;
public var mask_mc:MovieClip;
var m_timeStep:Number;
var connects_mc:MovieClip;
var tAllVoltEnd:Timer;
var connects:Array;
var isVizualize:Boolean;// = true
public var stripe_up:MovieClip;
var editPanel_mc:EditPanel;
var tLevelFailed:Timer;
var grounds_mc:MovieClip;
public var levelFon_mc_:MovieClip;
var isNewConnect:Boolean;// = false
var newConnectLines:Array;
var Lzone:Number;// = 20
var Hzone:Number;// = 15
var stepI:int;// = 0
public static const WORLD_LONG_RIGHT:String = "right";
public static const WORLD_STANDARD:String = "standard";
public static const WORLD_HIGH:String = "high";
public function WorkZone(){
mask_mc = mask_mc_;
myW = mask_mc.width;
myH = mask_mc.height;
addChild((allWorlObjects = new MovieClip()));
allWorlObjects.addChild((connects_mc = new MovieClip()));
allWorlObjects.addChild((grounds_mc = new MovieClip()));
allWorlObjects.addChild((volts_mc = new MovieClip()));
addChild((plat_mc = new workZonePlat()));
addChild((stripe_up = new rollover_stripe()));
addChild((stripe_down = new rollover_stripe()));
addChild((editLevel_btn = new edit_btn()));
editLevel_btn.x = 605;
editLevel_btn.y = 35;
editLevel_btn.visible = false;
this.mask = mask_mc;
plat_mc.addEventListener(MouseEvent.CLICK, mouseClick);
stripe_up.addEventListener(MouseEvent.CLICK, mouseClick);
stripe_down.addEventListener(MouseEvent.CLICK, mouseClick);
editLevel_btn.addEventListener(MouseEvent.CLICK, editLevel);
editLevel_btn.buttonMode = true;
stripe_down.y = 390;
}
function onStripeOver(_arg1:MouseEvent){
myLevel.myGame.captureOver(_arg1.target);
forOnStripeOver(_arg1.target);
}
private function showCurrentHeight():void{
var highestValue:Number = 0;
if (((volts) && ((volts.length > 0)))){
volts.sort(function (_arg1:Volt, _arg2:Volt):Number{
return ((_arg1.y - _arg2.y));
});
highestVolt = volts[0];
highestValue = Math.round((highestVolt.physBody.GetWorldCenter().y * 10));
};
if (worldZone == WORLD_HIGH){
return;
};
if (towerStartY == -1){
towerStartY = highestValue;
};
nowH = (towerStartY - highestValue);
if (maxH < nowH){
maxH = nowH;
};
if (nowH < 0){
myLevel.winEnd.showMe(true);
};
}
public function stopAllPhysics(){
removeEventListener(Event.ENTER_FRAME, showWorld);
}
override public function beforeDelete(){
if (((!((tLevelFailed == null))) && (tLevelFailed.running))){
tLevelFailed.stop();
};
stopAllPhysics();
plat_mc.removeEventListener(MouseEvent.CLICK, mouseClick);
removeEventListener(Event.ENTER_FRAME, showWorld);
plat_mc.removeEventListener(MouseEvent.CLICK, mouseClick);
stripe_up.removeEventListener(MouseEvent.CLICK, mouseClick);
stripe_down.removeEventListener(MouseEvent.CLICK, mouseClick);
editLevel_btn.removeEventListener(MouseEvent.CLICK, editLevel);
stripe_up.removeEventListener(MouseEvent.MOUSE_OVER, onStripeOver);
stripe_down.removeEventListener(MouseEvent.MOUSE_OVER, onStripeOver);
stripe_up.removeEventListener(MouseEvent.MOUSE_OUT, onStripeOut);
stripe_down.removeEventListener(MouseEvent.MOUSE_OUT, onStripeOut);
removeEventListener(Event.ENTER_FRAME, lookHighTower);
removeEventListener(Event.ENTER_FRAME, scrollMove);
if (timer != null){
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, onTimerForTimer);
};
if (tAllVoltEnd != null){
tAllVoltEnd.stop();
tAllVoltEnd.removeEventListener(TimerEvent.TIMER, onLevelFailed);
};
enableUserMouse(true);
}
public function mouseVoltTrue(){
if (((!((appVolt == null))) && (appVolt.visible))){
mouseVoltFalse();
return;
};
myLevel.myGame.mouseMc.gotoAndStop((Game.currentLevel.counterVolt.currentVolt + 1));
myLevel.myGame.mouseMc.mouseEnabled = false;
myLevel.myGame.mouseMc.mouseChildren = false;
}
public function mousePoint(_arg1:Boolean=true):Point{
var _local2:Point = new Point(myLevel.myGame.mouseMc.x, myLevel.myGame.mouseMc.y);
if (_arg1){
_local2.x = (_local2.x - allWorlObjects.x);
_local2.y = (_local2.y - allWorlObjects.y);
};
return (_local2);
}
private function initPhysics():void{
var _local1:b2AABB = new b2AABB();
var _local2:Number = (-(Lzone) / 2);
var _local3:Number = (-(Hzone) / 2);
var _local4:Number = ((Lzone * 3) / 2);
var _local5:Number = ((Hzone * 3) / 2);
switch (worldZone){
case WORLD_STANDARD:
break;
case WORLD_HIGH:
_local3 = (-10 * Hzone);
_local5 = (3 * Hzone);
break;
case WORLD_LONG_RIGHT:
_local4 = (10 * Lzone);
break;
};
_local1.lowerBound.Set(_local2, _local3);
_local1.upperBound.Set(_local4, _local5);
var _local6:b2Vec2 = new b2Vec2(0, 10);
var _local7:Boolean;
m_world = new b2World(_local1, _local6, _local7);
var _local8:PhysicsContactListener = new PhysicsContactListener(this);
m_world.SetContactListener(_local8);
}
function getDistSqr(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 - _arg1) * (_arg3 - _arg1)) + ((_arg4 - _arg2) * (_arg4 - _arg2))));
}
public function forOnStripeOut(_arg1){
(_arg1 as MovieClip).alpha = 0;
dyk = 0;
removeEventListener(Event.ENTER_FRAME, scrollMove);
}
private function initLevelData():void{
volts = [];
connects = [];
newConnectLines = [];
voltOwnId = 0;
buildLevelData(LevelsInfo.levelInfo[levelNo]);
myLevel.showVoltModes(myKVolts);
if ((((myLevel.modeGame == Level.MODE_TOWER)) || ((worldZone == WORLD_HIGH)))){
stripe_up.visible = (stripe_down.visible = true);
stripe_up.alpha = (stripe_down.alpha = 0);
if (((!(myLevel.myGame.flagWalk)) || (((myLevel.myGame.flagWalk) && (myLevel.myGame.isWrite))))){
stripe_up.addEventListener(MouseEvent.MOUSE_OVER, onStripeOver);
stripe_down.addEventListener(MouseEvent.MOUSE_OVER, onStripeOver);
stripe_up.addEventListener(MouseEvent.MOUSE_OUT, onStripeOut);
stripe_down.addEventListener(MouseEvent.MOUSE_OUT, onStripeOut);
};
} else {
stripe_up.visible = (stripe_down.visible = false);
};
if (myLevel.modeGame == Level.MODE_TOWER){
addEventListener(Event.ENTER_FRAME, lookHighTower);
};
if (isWalkShow){
enableUserMouse(false);
};
}
function addRect(_arg1:Object, _arg2:Number=0.3){
var _local3:Number = _arg1.x1;
var _local4:Number = _arg1.y1;
var _local5:Number = _arg1.x2;
var _local6:Number = _arg1.y2;
var _local7:Number = (_local5 - _local3);
var _local8:Number = (_local6 - _local4);
var _local9:Number = (_local3 + (_local7 / 2));
var _local10:Number = (_local4 + (_local8 / 2));
var _local11:* = 20;
var _local12:* = 2.6;
var _local13:b2PolygonDef = new b2PolygonDef();
_local13.SetAsBox((_local7 / 2), (_local8 / 2));
_local13.friction = _arg2;
_local13.density = 0;
addPhysicsBody(new invisBox(), grounds_mc, _local9, _local10, _local7, _local8, _local13);
}
public function highestVoltFunc(_arg1:Volt, _arg2:Volt):Number{
return (-((_arg1.physBody.GetWorldCenter().y - _arg2.physBody.GetWorldCenter().y)));
}
function showConnect(_arg1:Volt, _arg2:Point, _arg3:Number, _arg4:VoltJoint):MovieClip{
if (_arg4 == null){
_arg4 = ((isVizualize) ? new electrcLine() : new line1() as VoltJoint);
connects_mc.addChild(_arg4);
mouseVoltTrue();
_arg1.tempConnect = _arg4;
};
isNewConnect = true;
_arg4.x = _arg1.x;
_arg4.y = _arg1.y;
_arg4.rotation = ((Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x)) * 180) / Math.PI);
_arg4.mask_mc.width = _arg3;
_arg4.dist = _arg3;
return (_arg4);
}
function addFirstVolt(){
var _local1:*;
if (firstAppVolt != "null"){
_local1 = 0;
while (_local1 < myLevel.myGame.flagFirstAppVolt.length) {
if (myLevel.myGame.flagFirstAppVolt[_local1] == firstAppVolt){
return;
};
_local1++;
};
appVolt = (myLevel.addChild(new first_appearance_volt_clip()) as FirstAppearanceVolt);
appVolt.initMe(myLevel, firstAppVolt);
myLevel.myGame.flagFirstAppVolt.push(firstAppVolt);
};
}
function allVoltEnd():Boolean{
var _local1:* = 0;
while (_local1 < myKVolts.length) {
if (myKVolts[_local1] != 0){
return (false);
};
_local1++;
};
return (true);
}
private function scrollMove(_arg1:Event):void{
dyk = (dyk + (dyk / Math.abs(dyk)));
changeY(dyk);
}
public function addVolt(_arg1:Point, _arg2:Number):Volt{
var _local3:Class = (getDefinitionByName(("volt" + (_arg2 + 1))) as Class);
var _local4:* = (new (_local3) as ((_arg2)!=Volt.VOLT_STAT) ? Volt : VoltFlying);
_local4.id = _arg2;
_local4.isStart = false;
_local4.x = _arg1.x;
_local4.y = _arg1.y;
_local4.initMe(this);
return (_local4);
}
function enableAddVolt():Boolean{
var _local1:*;
for each (_local1 in physObjs) {
if (_local1.hitTestPoint(mousePoint(false).x, mousePoint(false).y, true)){
mouseVoltFalse();
return (false);
};
};
return (true);
}
function addPhysicsBody(_arg1:Sprite, _arg2:MovieClip, _arg3:Number, _arg4:Number, _arg5, _arg6, _arg7:b2ShapeDef):b2Body{
var _local8:b2BodyDef = new b2BodyDef();
_local8.position.Set(_arg3, _arg4);
_local8.userData = _arg1;
if (((!((_arg2 == null))) && (!((_arg1 == null))))){
if (isVizualize){
_arg2.addChild(_arg1);
} else {
_arg1.visible = false;
_arg2.addChild(new point1());
};
};
if (_arg5 != null){
_arg1.width = (myScale * _arg5);
};
if (_arg6 != null){
_arg1.height = (myScale * _arg6);
};
var _local9:b2Body = m_world.CreateBody(_local8);
var _local10:b2Shape = _local9.CreateShape(_arg7);
_local9.SetMassFromShapes();
return (_local9);
}
public function ifAllConstConnected():Boolean{
var _local3:Volt;
var _local4:Number;
var _local5:Volt;
var _local6:Boolean;
var _local7:*;
var _local1:Array = (volts[0] as Volt).findMyNeighbours([]);
var _local2:Number = 0;
for each (_local3 in _local1) {
if (_local3.isStart){
_local2++;
};
};
_local4 = 0;
for each (_local5 in volts) {
if (_local5.isStart){
_local4++;
};
};
_local6 = (_local2 == _local4);
if (_local6){
myLevel.levelSuccess();
stopAllPhysics();
_local7 = 0;
while (_local7 < volts.length) {
volts[_local7].createShine(false);
_local7++;
};
};
return (_local6);
}
private function initLevelPhysics():void{
buildLevel(LevelsInfo.levelInfo[levelNo]);
getFromMeObjects();
}
public function initLevel(_arg1:Level){
myLevel = _arg1;
levelNo = myLevel.myNumber;
editPanel_mc = (myLevel.myGame_ as Game).editPanel_mc;
var _local2:Number = stage.frameRate;
addEventListener(Event.ENTER_FRAME, showWorld);
enginePerFrame = 2;
kTimeSteps = (_local2 * enginePerFrame);
m_timeStep = (1 / kTimeSteps);
m_iterations = 10;
initLevelData();
initPhysics();
initLevelPhysics();
showLevelInfo();
myLevel.counterTime.startWork();
if (!myLevel.myGame.flagWalk){
addFirstVolt();
};
}
function enableUserMouse(_arg1:Boolean){
myLevel.counterVolt.buttonMode = (myLevel.buttonMode = _arg1);
myLevel.counterVolt.mouseEnabled = (myLevel.mouseEnabled = _arg1);
myLevel.counterVolt.mouseChildren = (myLevel.mouseChildren = _arg1);
myLevel.myGame.useSpecialMouseClip(_arg1);
}
function showTempConnects(_arg1:Boolean=true){
var distSqr:Number;
var v1:Volt;
var maxTempConnects:Number;
var lineInfo:Object;
var v:Volt;
var dist:Number;
var isMouse = _arg1;
var p:Point = mousePoint();
var mX:Number = (isMouse) ? p.x : -1000;
var mY:Number = (isMouse) ? p.y : -1000;
isNewConnect = false;
newConnectLines = [];
var newLinesInfo:Array = [];
for each (v1 in volts) {
v1.tempConnectLength = 0;
if (v1.isSwimDown){
} else {
distSqr = getDistSqr(v1.x, v1.y, mX, mY);
if ((((((distSqr > v1.minDSqr)) && ((distSqr < v1.maxDSqr)))) && ((v1.constConnects.length < v1.maxConnects)))){
dist = Math.sqrt(distSqr);
newLinesInfo.push({dist:dist, v:v1});
};
};
};
maxTempConnects = Volt.getMaxTempConnects(this.myLevel.counterVolt.currentVolt);
if (newLinesInfo.length > maxTempConnects){
newLinesInfo.sort(function (_arg1, _arg2):Number{
return ((_arg1.dist - _arg2.dist));
});
newLinesInfo.length = maxTempConnects;
};
for each (lineInfo in newLinesInfo) {
(lineInfo.v as Volt).tempConnectLength = lineInfo.dist;
};
for each (v in volts) {
if (v.tempConnectLength > 0){
newConnectLines.push(showConnect(v, new Point(mX, mY), v.tempConnectLength, v.tempConnect));
} else {
removeVoltTempConnect(v);
};
};
if (newConnectLines.length == 0){
mouseVoltFalse();
};
}
function delConnect(_arg1:VoltJoint){
var _local2:* = 0;
while (_local2 < connects.length) {
if (connects[_local2] == _arg1){
connects.splice(_local2);
break;
};
_local2++;
};
}
public function forOnStripeOver(_arg1){
switch (_arg1){
case stripe_up:
dyk = 1;
break;
case stripe_down:
dyk = -1;
break;
};
addEventListener(Event.ENTER_FRAME, scrollMove);
}
public function mouseVoltFalse(){
myLevel.myGame.mouseMc.gotoAndStop(5);
}
function onLevelFailed(_arg1:Event){
if (((allVoltEnd()) && (!(ifAllConstConnected())))){
myLevel.levelFailed("No more volts...");
myLevelFailed();
};
}
function showWorld(_arg1){
var _local5:*;
var _local6:Sprite;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Sprite;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Volt;
var _local2:* = 0;
while (_local2 < enginePerFrame) {
stepI++;
m_world.Step(m_timeStep, m_iterations);
_local2++;
};
if (!m_world.m_lock){
_local5 = 0;
while (_local5 < volts.length) {
if ((((volts[_local5].id == Volt.VOLT_SCOTCH)) && (volts[_local5].flagForDoScotch))){
volts[_local5].doScotch();
};
_local5++;
};
};
var _local3:b2Body = m_world.m_bodyList;
while (_local3) {
if ((_local3.m_userData is Sprite)){
_local6 = (_local3.m_userData as Sprite);
_local7 = _local3.GetPosition();
_local6.x = (_local7.x * myScale);
_local6.y = (_local7.y * myScale);
_local8 = (_local3.GetAngle() * (180 / Math.PI));
_local6.rotation = _local8;
if ((_local6 is Volt)){
if (Math.abs(Math.round(_local8)) >= 2){
(_local6 as Volt).becomeMovie();
} else {
_local6.rotation = 0;
};
};
};
_local3 = _local3.m_next;
};
var _local4:b2Joint = m_world.GetJointList();
while (_local4) {
if ((_local4.m_userData is Sprite)){
_local9 = (_local4.m_userData as Sprite);
_local10 = _local4.GetBody1().GetPosition();
_local11 = _local4.GetBody2().GetPosition();
_local9.x = (_local10.x * myScale);
_local9.y = (_local10.y * myScale);
_local9.rotation = (Math.atan2((_local11.y - _local10.y), (_local11.x - _local10.x)) * (180 / Math.PI));
};
_local4 = _local4.GetNext();
};
if (((enableAddVolt()) && (!((myLevel.counterVolt.allKol[myLevel.counterVolt._currentVolt] == 0))))){
if (canNowConnect){
showTempConnects();
};
} else {
for each (_local12 in volts) {
removeVoltTempConnect(_local12);
};
};
if ((((myLevel.modeGame == Level.MODE_TOWER)) || ((worldZone == WORLD_HIGH)))){
showCurrentHeight();
};
}
public function transferAllVoltInState(_arg1:String){
var _local2:* = 0;
while (_local2 < volts.length) {
volts[_local2].makeState(_arg1, true);
_local2++;
};
}
public function myLevelFailed(){
stopAllPhysics();
showTempConnects(false);
}
function addVoltPhysics(_arg1:Volt):Volt{
var _local5:MovieClip;
var _local2:Point = new Point((_arg1.x / myScale), (_arg1.y / myScale));
_arg1.ownId = voltOwnId++;
volts.push(_arg1);
var _local3:b2CircleDef = new b2CircleDef();
_local3.radius = ((26 / 2) / myScale);
_local3.density = _arg1.getDensity();
_local3.friction = 0.2;
_local3.restitution = 0.2;
var _local4:b2Body = addPhysicsBody(_arg1, volts_mc, _local2.x, _local2.y, null, null, _local3);
_arg1.physBody = _local4;
var _local6:b2CircleDef = new b2CircleDef();
_local6.radius = 0.2;
_local6.density = (0.1 * PhysicsMovie.mainDensity);
_local6.friction = 0.8;
_local6.restitution = 0.1;
var _local7:b2Body = addPhysicsBody(_local5, volts_mc, _local2.x, _local2.y, null, null, _local6);
_arg1.physSatellite = _local7;
var _local8:b2RevoluteJointDef = new b2RevoluteJointDef();
_local8.Initialize(_local7, _arg1.physBody, _arg1.physBody.GetWorldCenter());
_local8.collideConnected = false;
_local8.maxMotorTorque = 0.5;
_arg1.physSatConnect = m_world.CreateJoint(_local8);
_arg1.addToMyShapes(_local4.GetShapeList());
_arg1.addToMyShapes(_local7.GetShapeList());
return (_arg1);
}
private function lookHighTower(_arg1:Event):void{
changeY(0);
}
private function changeY(_arg1:Number, _arg2:Number=INF):void{
var _local3:Point = mousePoint(false);
var _local4:Number = ((_arg2)!=Infinity) ? _arg2 : (allWorlObjects.y + _arg1);
if (_local4 > getMaxY()){
_local4 = getMaxY();
stripe_up.alpha = 0;
} else {
if (stripe_up.hitTestPoint(_local3.x, _local3.y, false)){
stripe_up.alpha = 1;
};
};
if (_local4 < 0){
_local4 = 0;
stripe_down.alpha = 0;
} else {
if (stripe_down.hitTestPoint(_local3.x, _local3.y, false)){
stripe_down.alpha = 1;
};
};
objects_mc.y = (allWorlObjects.y = _local4);
}
function onStripeOut(_arg1:MouseEvent){
myLevel.myGame.captureOut(_arg1.target);
forOnStripeOut(_arg1.target);
}
function removeVoltTempConnect(_arg1:Volt){
if (_arg1.tempConnect != null){
if (_arg1.tempConnect.parent == connects_mc){
connects_mc.removeChild(_arg1.tempConnect);
};
_arg1.tempConnect = null;
};
}
function get isWalkShow():Boolean{
return (((myLevel.myGame.flagWalk) && (!(myLevel.myGame.isWrite))));
}
private function editLevel(_arg1:MouseEvent):void{
var _local2:Volt;
var _local3:Sprite;
isEditLevel = !(isEditLevel);
if (isEditLevel){
for each (_local2 in volts) {
if (!_local2.isStart){
_local2.parent.removeChild(_local2);
};
};
for each (_local3 in connects) {
_local3.parent.removeChild(_local3);
};
resetLevelInfo();
stopAllPhysics();
editLevel_btn.gotoAndStop(2);
makeEditable();
editPanel_mc.visible = true;
editPanel_mc.physWorld = this;
editPanel_mc.initOnBegin(levelNo);
myEditPanel = editPanel_mc;
plat_mc.mouseEnabled = false;
if (worldZone != WORLD_HIGH){
stripe_up.mouseEnabled = false;
stripe_down.mouseEnabled = false;
};
} else {
LevelsInfo.levelInfo[levelNo] = getFullLevelText();
editPanel_mc.visible = false;
myLevel.goGameAgain(null);
};
}
private function showLevelInfo():void{
if (myLevel.modeGame == Level.MODE_LEVEL){
ifAllConstConnected();
} else {
showCurrentHeight();
};
}
function onTimerForTimer(_arg1:Event){
canNowConnect = true;
}
public function mouseClick(_arg1:MouseEvent){
var _local2:Volt;
var _local3:Volt;
var _local4:Number;
var _local5:*;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2PrismaticJointDef;
var _local12:b2DistanceJointDef;
var _local13:b2JointDef;
if (!enableAddVolt()){
return;
};
if (((((isNewConnect) && ((newConnectLines.length >= 1)))) && (!(grounds_mc.hitTestPoint(mousePoint(false).x, mousePoint(false).y, true))))){
if (!this.myLevel.counterVolt.decreaseK()){
return;
};
if (((myLevel.myGame.isWrite) && (myLevel.myGame.flagWalk))){
myLevel.myGame.captureClick(true);
};
_local2 = addVolt(mousePoint(), this.myLevel.counterVolt.currentVolt);
_local2.constConnects = _local2.constConnects.concat(newConnectLines);
this.myLevel.counterVolt.checkCurrentVolt();
mouseVoltFalse();
for each (_local3 in volts) {
if (((!((_local3.tempConnect == null))) && (!((_local3 == _local2))))){
_local6 = _local3.physBody.GetWorldCenter();
_local7 = _local2.physBody.GetWorldCenter();
_local8 = Math.sqrt(getDistSqr(_local6.x, _local6.y, _local7.x, _local7.y));
_local9 = new b2Vec2(((_local6.x + _local7.x) / 2), ((_local6.y + _local7.y) / 2));
_local10 = new b2Vec2(0, 1);
_local11 = new b2PrismaticJointDef();
_local11.Initialize(_local3.physSatellite, _local2.physSatellite, _local9, _local10);
_local11.collideConnected = true;
_local12 = new b2DistanceJointDef();
_local12.Initialize(_local3.physSatellite, _local2.physSatellite, _local3.physSatellite.GetWorldCenter(), _local2.physSatellite.GetWorldCenter());
_local12.collideConnected = true;
_local13 = _local12;
_local13.userData = _local3.tempConnect;
_local3.tempConnect.joint = m_world.CreateJoint(_local13);
_local3.tempConnect.m_world = m_world;
_local3.tempConnect.connectedVolt1 = _local3;
_local3.tempConnect.connectedVolt2 = _local2;
_local3.tempConnect.myWorkZone = this;
_local3.toConstConnect();
_local3.connectedVolts.push(_local2);
_local2.connectedVolts.push(_local3);
};
};
connects = connects.concat(newConnectLines);
newConnectLines = [];
isNewConnect = false;
canNowConnect = false;
timer = new Timer(400, 1);
timer.addEventListener(TimerEvent.TIMER, onTimerForTimer);
timer.start();
showLevelInfo();
_local4 = 0;
for each (_local5 in this.physObjs) {
if ((_local5 as PhysicsMovieBonus) != null){
trace(("найден бонус " + allVoltEnd()));
_local4 = 3000;
};
};
if (((allVoltEnd()) && (!(ifAllConstConnected())))){
tAllVoltEnd = new Timer(_local4, 1);
tAllVoltEnd.addEventListener(TimerEvent.TIMER, onLevelFailed);
tAllVoltEnd.start();
};
};
}
private function getMaxY():Number{
return ((((Hzone * 0.5) - highestVolt.physBody.GetWorldCenter().y) * myScale));
}
}
}//package TheGame
Section 173
//allClip_29 (VoltConnectKing_fla.allClip_29)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class allClip_29 extends MovieClip {
public function allClip_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VoltConnectKing_fla
Section 174
//Timeline_513 (VoltConnectKing_fla.Timeline_513)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class Timeline_513 extends MovieClip {
public function Timeline_513(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package VoltConnectKing_fla
Section 175
//Timeline_520 (VoltConnectKing_fla.Timeline_520)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class Timeline_520 extends MovieClip {
public function Timeline_520(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package VoltConnectKing_fla
Section 176
//volt_in_in1_100 (VoltConnectKing_fla.volt_in_in1_100)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in1_100 extends MovieClip {
public function volt_in_in1_100(){
addFrameScript(26, frame27, 46, frame47, 63, frame64);
}
function frame47(){
gotoAndPlay("sad");
}
function frame27(){
gotoAndPlay("usual");
}
function frame64(){
gotoAndPlay("glad");
}
}
}//package VoltConnectKing_fla
Section 177
//volt_in_in1_glad_107 (VoltConnectKing_fla.volt_in_in1_glad_107)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in1_glad_107 extends MovieClip {
public function volt_in_in1_glad_107(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndPlay("glad");
}
}
}//package VoltConnectKing_fla
Section 178
//volt_in_in1_sad_109 (VoltConnectKing_fla.volt_in_in1_sad_109)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in1_sad_109 extends MovieClip {
public function volt_in_in1_sad_109(){
addFrameScript(15, frame16);
}
function frame16(){
gotoAndPlay("sad");
}
}
}//package VoltConnectKing_fla
Section 179
//volt_in_in1_usual_111 (VoltConnectKing_fla.volt_in_in1_usual_111)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in1_usual_111 extends MovieClip {
public function volt_in_in1_usual_111(){
addFrameScript(26, frame27);
}
function frame27(){
gotoAndPlay("usual");
}
}
}//package VoltConnectKing_fla
Section 180
//volt_in_in2_113 (VoltConnectKing_fla.volt_in_in2_113)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in2_113 extends MovieClip {
public function volt_in_in2_113(){
addFrameScript(14, frame15, 36, frame37, 58, frame59);
}
function frame37(){
gotoAndPlay("sad");
}
function frame15(){
gotoAndPlay("usual");
}
function frame59(){
gotoAndPlay("glad");
}
}
}//package VoltConnectKing_fla
Section 181
//volt_in_in2_glad_123 (VoltConnectKing_fla.volt_in_in2_glad_123)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in2_glad_123 extends MovieClip {
public function volt_in_in2_glad_123(){
addFrameScript(16, frame17);
}
function frame17(){
gotoAndPlay("glad");
}
}
}//package VoltConnectKing_fla
Section 182
//volt_in_in2_sad_125 (VoltConnectKing_fla.volt_in_in2_sad_125)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in2_sad_125 extends MovieClip {
public function volt_in_in2_sad_125(){
addFrameScript(16, frame17);
}
function frame17(){
gotoAndPlay("sad");
}
}
}//package VoltConnectKing_fla
Section 183
//volt_in_in2_usual_127 (VoltConnectKing_fla.volt_in_in2_usual_127)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in2_usual_127 extends MovieClip {
public function volt_in_in2_usual_127(){
addFrameScript(14, frame15);
}
function frame15(){
gotoAndPlay("usual");
}
}
}//package VoltConnectKing_fla
Section 184
//volt_in_in3_129 (VoltConnectKing_fla.volt_in_in3_129)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in3_129 extends MovieClip {
public function volt_in_in3_129(){
addFrameScript(15, frame16, 32, frame33, 52, frame53);
}
function frame16(){
gotoAndPlay("usual");
}
function frame53(){
gotoAndPlay("glad");
}
function frame33(){
gotoAndPlay("sad");
}
}
}//package VoltConnectKing_fla
Section 185
//volt_in_in3_glad_134 (VoltConnectKing_fla.volt_in_in3_glad_134)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in3_glad_134 extends MovieClip {
public function volt_in_in3_glad_134(){
addFrameScript(15, frame16);
}
function frame16(){
gotoAndPlay("glad");
}
}
}//package VoltConnectKing_fla
Section 186
//volt_in_in3_sad_136 (VoltConnectKing_fla.volt_in_in3_sad_136)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in3_sad_136 extends MovieClip {
public function volt_in_in3_sad_136(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndPlay("sad");
}
}
}//package VoltConnectKing_fla
Section 187
//volt_in_in3_usual_138 (VoltConnectKing_fla.volt_in_in3_usual_138)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in3_usual_138 extends MovieClip {
public function volt_in_in3_usual_138(){
addFrameScript(15, frame16);
}
function frame16(){
gotoAndPlay("usual");
}
}
}//package VoltConnectKing_fla
Section 188
//volt_in_in4_140 (VoltConnectKing_fla.volt_in_in4_140)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in4_140 extends MovieClip {
public function volt_in_in4_140(){
addFrameScript(18, frame19, 34, frame35, 59, frame60);
}
function frame19(){
gotoAndPlay("usual");
}
function frame60(){
gotoAndPlay("glad");
}
function frame35(){
gotoAndPlay("sad");
}
}
}//package VoltConnectKing_fla
Section 189
//volt_in_in4_glad_147 (VoltConnectKing_fla.volt_in_in4_glad_147)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in4_glad_147 extends MovieClip {
public function volt_in_in4_glad_147(){
addFrameScript(20, frame21);
}
function frame21(){
gotoAndPlay("glad");
}
}
}//package VoltConnectKing_fla
Section 190
//volt_in_in4_sad_149 (VoltConnectKing_fla.volt_in_in4_sad_149)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in4_sad_149 extends MovieClip {
public function volt_in_in4_sad_149(){
addFrameScript(11, frame12);
}
function frame12(){
gotoAndPlay("sad");
}
}
}//package VoltConnectKing_fla
Section 191
//volt_in_in4_usual_151 (VoltConnectKing_fla.volt_in_in4_usual_151)
package VoltConnectKing_fla {
import flash.display.*;
public dynamic class volt_in_in4_usual_151 extends MovieClip {
public function volt_in_in4_usual_151(){
addFrameScript(18, frame19);
}
function frame19(){
gotoAndPlay("usual");
}
}
}//package VoltConnectKing_fla
Section 192
//ball1 (ball1)
package {
import flash.display.*;
public dynamic class ball1 extends MovieClip {
}
}//package
Section 193
//border_level (border_level)
package {
import TheGame.MyPhysics.*;
public dynamic class border_level extends PhysicsMovie {
}
}//package
Section 194
//btLevel (btLevel)
package {
import TheGame.*;
public dynamic class btLevel extends ButtonLevel {
}
}//package
Section 195
//button_for_sound (button_for_sound)
package {
import TheGame.GameTemplate.*;
public dynamic class button_for_sound extends ButtonSoundOnOff {
}
}//package
Section 196
//button_pause (button_pause)
package {
import TheGame.*;
public dynamic class button_pause extends PauseBtn {
}
}//package
Section 197
//CellRenderer_disabledSkin (CellRenderer_disabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_disabledSkin extends MovieClip {
}
}//package
Section 198
//CellRenderer_downSkin (CellRenderer_downSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_downSkin extends MovieClip {
}
}//package
Section 199
//CellRenderer_overSkin (CellRenderer_overSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_overSkin extends MovieClip {
}
}//package
Section 200
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip {
}
}//package
Section 201
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDownSkin extends MovieClip {
}
}//package
Section 202
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedOverSkin extends MovieClip {
}
}//package
Section 203
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedUpSkin extends MovieClip {
}
}//package
Section 204
//CellRenderer_upSkin (CellRenderer_upSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_upSkin extends MovieClip {
}
}//package
Section 205
//ComboBox_disabledSkin (ComboBox_disabledSkin)
package {
import flash.display.*;
public dynamic class ComboBox_disabledSkin extends MovieClip {
}
}//package
Section 206
//ComboBox_downSkin (ComboBox_downSkin)
package {
import flash.display.*;
public dynamic class ComboBox_downSkin extends MovieClip {
}
}//package
Section 207
//ComboBox_overSkin (ComboBox_overSkin)
package {
import flash.display.*;
public dynamic class ComboBox_overSkin extends MovieClip {
}
}//package
Section 208
//ComboBox_upSkin (ComboBox_upSkin)
package {
import flash.display.*;
public dynamic class ComboBox_upSkin extends MovieClip {
}
}//package
Section 209
//counter_timer (counter_timer)
package {
import TheGame.*;
public dynamic class counter_timer extends CounterTimer {
}
}//package
Section 210
//credits_screen_clip (credits_screen_clip)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.Screens.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class credits_screen_clip extends CreditsScreen {
public function credits_screen_clip(){
__setProp_menu_btn_credits_screen_();
}
function __setProp_menu_btn_credits_screen_(){
try {
menu_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
menu_btn.MinWidth = 0;
menu_btn.Text = "menu";
try {
menu_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 211
//edit_btn (edit_btn)
package {
import flash.display.*;
public dynamic class edit_btn extends MovieClip {
public function edit_btn(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 212
//editPanel (editPanel)
package {
import flash.display.*;
import flash.events.*;
import TheGame.MyPhysics.*;
import fl.data.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class editPanel extends EditPanel {
public var j0;
public var j1;
public var j2;
public var j3;
public var collProp0:Object;
public var collProp1:Object;
public var collProp3:Object;
public var collObj0:DataProvider;
public var collObj1:DataProvider;
public var collObj2:DataProvider;
public var collObj3:DataProvider;
public var collProp2:Object;
public var itemObj1:SimpleCollectionItem;
public var itemObj3:SimpleCollectionItem;
public var itemObj0:SimpleCollectionItem;
public var collProps1:Array;
public var collProps3:Array;
public var collProps0:Array;
public var itemObj2:SimpleCollectionItem;
public var collProps2:Array;
public var i0:int;
public var i1:int;
public var i2:int;
public var i3:int;
public function editPanel(){
__setProp_bonus_type_mc__editPanel_();
__setProp_combo_new_volt_editPanel_();
__setProp_dens_mc__editPanel_Layer6_0();
__setProp_combo_world_editPanel_Layer6_0();
}
function __setProp_dens_mc__editPanel_Layer6_0(){
try {
dens_mc_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
collObj2 = new DataProvider();
collProps2 = [{label:0, data:0}, {label:0.5, data:0.5}, {label:1, data:1}];
i2 = 0;
while (i2 < collProps2.length) {
itemObj2 = new SimpleCollectionItem();
collProp2 = collProps2[i2];
for (j2 in collProp2) {
itemObj2[j2] = collProp2[j2];
};
collObj2.addItem(itemObj2);
i2++;
};
dens_mc_.dataProvider = collObj2;
dens_mc_.editable = true;
dens_mc_.enabled = true;
dens_mc_.prompt = "";
dens_mc_.restrict = "";
dens_mc_.rowCount = 10;
dens_mc_.visible = true;
try {
dens_mc_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_bonus_type_mc__editPanel_(){
try {
bonus_type_mc_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
collObj0 = new DataProvider();
collProps0 = [{label:"simple", data:0}, {label:"stat", data:1}, {label:"scotch", data:2}, {label:"swim", data:3}];
i0 = 0;
while (i0 < collProps0.length) {
itemObj0 = new SimpleCollectionItem();
collProp0 = collProps0[i0];
for (j0 in collProp0) {
itemObj0[j0] = collProp0[j0];
};
collObj0.addItem(itemObj0);
i0++;
};
bonus_type_mc_.dataProvider = collObj0;
bonus_type_mc_.editable = false;
bonus_type_mc_.enabled = true;
bonus_type_mc_.prompt = "";
bonus_type_mc_.restrict = "";
bonus_type_mc_.rowCount = 10;
bonus_type_mc_.visible = true;
try {
bonus_type_mc_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_combo_world_editPanel_Layer6_0(){
try {
combo_world["componentInspectorSetting"] = true;
} catch(e:Error) {
};
collObj3 = new DataProvider();
collProps3 = [{label:"standard", data:"standard"}, {label:"high", data:"high"}, {label:"long-right", data:"right"}];
i3 = 0;
while (i3 < collProps3.length) {
itemObj3 = new SimpleCollectionItem();
collProp3 = collProps3[i3];
for (j3 in collProp3) {
itemObj3[j3] = collProp3[j3];
};
collObj3.addItem(itemObj3);
i3++;
};
combo_world.dataProvider = collObj3;
combo_world.editable = false;
combo_world.enabled = true;
combo_world.prompt = "";
combo_world.restrict = "";
combo_world.rowCount = 5;
combo_world.visible = true;
try {
combo_world["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_combo_new_volt_editPanel_(){
try {
combo_new_volt["componentInspectorSetting"] = true;
} catch(e:Error) {
};
collObj1 = new DataProvider();
collProps1 = [{label:"no new volts", data:"null"}, {label:"usual", data:"usual"}, {label:"flying", data:"flying"}, {label:"water", data:"water"}, {label:"sticking", data:"sticking"}];
i1 = 0;
while (i1 < collProps1.length) {
itemObj1 = new SimpleCollectionItem();
collProp1 = collProps1[i1];
for (j1 in collProp1) {
itemObj1[j1] = collProp1[j1];
};
collObj1.addItem(itemObj1);
i1++;
};
combo_new_volt.dataProvider = collObj1;
combo_new_volt.editable = false;
combo_new_volt.enabled = true;
combo_new_volt.prompt = "";
combo_new_volt.restrict = "";
combo_new_volt.rowCount = 5;
combo_new_volt.visible = true;
try {
combo_new_volt["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 213
//electrcLine (electrcLine)
package {
import TheGame.*;
public dynamic class electrcLine extends VoltJoint {
}
}//package
Section 214
//electrcLine_copy (electrcLine_copy)
package {
import flash.display.*;
public dynamic class electrcLine_copy extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 215
//electric_line_in (electric_line_in)
package {
import flash.display.*;
public dynamic class electric_line_in extends MovieClip {
}
}//package
Section 216
//electric_line_in_100 (electric_line_in_100)
package {
import flash.display.*;
public dynamic class electric_line_in_100 extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 217
//electric_line_in_40 (electric_line_in_40)
package {
import flash.display.*;
public dynamic class electric_line_in_40 extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 218
//electric_line_in_50 (electric_line_in_50)
package {
import flash.display.*;
public dynamic class electric_line_in_50 extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 219
//electric_line_in_60 (electric_line_in_60)
package {
import flash.display.*;
public dynamic class electric_line_in_60 extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 220
//electric_line_in_70 (electric_line_in_70)
package {
import flash.display.*;
public dynamic class electric_line_in_70 extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 221
//electric_line_in_80 (electric_line_in_80)
package {
import flash.display.*;
public dynamic class electric_line_in_80 extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 222
//electric_line_in_90 (electric_line_in_90)
package {
import flash.display.*;
public dynamic class electric_line_in_90 extends MovieClip {
public var mask_mc:MovieClip;
}
}//package
Section 223
//EventMousePlay (EventMousePlay)
package {
import flash.events.*;
public class EventMousePlay extends Event {
public var xml:XML;
public var x:Number;
public var y:Number;
public var name:String;
public function EventMousePlay(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String, _arg5:XML, _arg6:Boolean=false, _arg7:Boolean=false){
super(_arg1, _arg6, _arg7);
this.x = _arg2;
this.y = _arg3;
this.name = _arg4;
this.xml = _arg5;
}
override public function toString():String{
return (formatToString("EventMousePlay", "type", "x", "y", "name", "xml", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new EventMousePlay(type, x, y, name, xml, bubbles, cancelable));
}
}
}//package
Section 224
//ferryBlue (ferryBlue)
package {
import flash.display.*;
public dynamic class ferryBlue extends MovieClip {
public function ferryBlue(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 225
//ferryGreen (ferryGreen)
package {
import flash.display.*;
public dynamic class ferryGreen extends MovieClip {
public function ferryGreen(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 226
//ferryRed (ferryRed)
package {
import flash.display.*;
public dynamic class ferryRed extends MovieClip {
public function ferryRed(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 227
//first_appearance_volt_clip (first_appearance_volt_clip)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class first_appearance_volt_clip extends FirstAppearanceVolt {
public function first_appearance_volt_clip(){
__setProp_next_btn_first_appearance_volt_();
}
function __setProp_next_btn_first_appearance_volt_(){
try {
next_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
next_btn.MinWidth = 0;
next_btn.Text = "next";
try {
next_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 228
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 229
//game (game)
package {
import TheGame.*;
public dynamic class game extends Game {
}
}//package
Section 230
//Help2 (Help2)
package {
import TheGame.*;
public dynamic class Help2 extends HelpText {
}
}//package
Section 231
//Help3 (Help3)
package {
import TheGame.*;
public dynamic class Help3 extends HelpText {
}
}//package
Section 232
//Help4 (Help4)
package {
import TheGame.*;
public dynamic class Help4 extends HelpText {
}
}//package
Section 233
//Help6 (Help6)
package {
import TheGame.*;
public dynamic class Help6 extends HelpText {
}
}//package
Section 234
//Help7 (Help7)
package {
import TheGame.*;
public dynamic class Help7 extends HelpText {
}
}//package
Section 235
//Help8 (Help8)
package {
import TheGame.*;
public dynamic class Help8 extends HelpText {
}
}//package
Section 236
//hitZone (hitZone)
package {
import flash.display.*;
public dynamic class hitZone extends MovieClip {
}
}//package
Section 237
//hor_funflow (hor_funflow)
package {
import TheGame.*;
public dynamic class hor_funflow extends ButtonFunflow {
}
}//package
Section 238
//hor_funflow_2 (hor_funflow_2)
package {
import TheGame.*;
public dynamic class hor_funflow_2 extends ButtonFunflow {
}
}//package
Section 239
//hor_funflow_3 (hor_funflow_3)
package {
import TheGame.*;
public dynamic class hor_funflow_3 extends ButtonFunflow {
}
}//package
Section 240
//invisBox (invisBox)
package {
import flash.display.*;
public dynamic class invisBox extends MovieClip {
}
}//package
Section 241
//level (level)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.Screens.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class level extends Level {
public function level(){
__setProp_again_btn__level_Btns();
__setProp_exit_btn__level_Btns();
__setProp_next_btn__level_Btns();
__setProp_walkthrough_btn__level_Btns();
__setProp_more_games_btn__level_Btns();
}
function __setProp_more_games_btn__level_Btns(){
try {
more_games_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_games_btn_.MinWidth = 0;
more_games_btn_.Text = "more games";
try {
more_games_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_walkthrough_btn__level_Btns(){
try {
walkthrough_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
walkthrough_btn_.MinWidth = 0;
walkthrough_btn_.Text = "walkthrough";
try {
walkthrough_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_again_btn__level_Btns(){
try {
again_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
again_btn_.MinWidth = 0;
again_btn_.Text = "again";
try {
again_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_exit_btn__level_Btns(){
try {
exit_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
exit_btn_.MinWidth = 0;
exit_btn_.Text = "exit ";
try {
exit_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_next_btn__level_Btns(){
try {
next_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
next_btn_.MinWidth = 0;
next_btn_.Text = "next";
try {
next_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 242
//level1_objs (level1_objs)
package {
import TheGame.MyPhysics.*;
public dynamic class level1_objs extends PhysicsWorld {
}
}//package
Section 243
//line1 (line1)
package {
import TheGame.*;
public dynamic class line1 extends VoltJoint {
}
}//package
Section 244
//List_skin (List_skin)
package {
import flash.display.*;
public dynamic class List_skin extends MovieClip {
}
}//package
Section 245
//loop01 (loop01)
package {
import flash.media.*;
public dynamic class loop01 extends Sound {
}
}//package
Section 246
//loop02 (loop02)
package {
import flash.media.*;
public dynamic class loop02 extends Sound {
}
}//package
Section 247
//loop03 (loop03)
package {
import flash.media.*;
public dynamic class loop03 extends Sound {
}
}//package
Section 248
//loop05 (loop05)
package {
import flash.media.*;
public dynamic class loop05 extends Sound {
}
}//package
Section 249
//mcBannedSign (mcBannedSign)
package {
import flash.display.*;
public dynamic class mcBannedSign extends MovieClip {
public var bg:MovieClip;
}
}//package
Section 250
//mcCrownMask (mcCrownMask)
package {
import flash.display.*;
public dynamic class mcCrownMask extends MovieClip {
}
}//package
Section 251
//mcFerryLine (mcFerryLine)
package {
import flash.display.*;
public dynamic class mcFerryLine extends MovieClip {
}
}//package
Section 252
//mcLogoHolder (mcLogoHolder)
package {
import flash.display.*;
public dynamic class mcLogoHolder extends MovieClip {
}
}//package
Section 253
//mcLogoMask (mcLogoMask)
package {
import flash.display.*;
public dynamic class mcLogoMask extends MovieClip {
}
}//package
Section 254
//mcOtherGames (mcOtherGames)
package {
import flash.display.*;
public dynamic class mcOtherGames extends MovieClip {
}
}//package
Section 255
//mcPlay (mcPlay)
package {
import flash.display.*;
public dynamic class mcPlay extends MovieClip {
}
}//package
Section 256
//mcWaterRing (mcWaterRing)
package {
import flash.display.*;
public dynamic class mcWaterRing extends MovieClip {
public function mcWaterRing(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package
Section 257
//menu_screen_clip (menu_screen_clip)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.Screens.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class menu_screen_clip extends MenuScreen {
public function menu_screen_clip(){
__setProp_play_on_f_btn__menu_screen_Layer1_0();
}
function __setProp_play_on_f_btn__menu_screen_Layer1_0(){
try {
play_on_f_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
play_on_f_btn_.MinWidth = 0;
play_on_f_btn_.Text = "play volts on iii";
try {
play_on_f_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 258
//mini_funflow (mini_funflow)
package {
import TheGame.*;
public dynamic class mini_funflow extends ButtonFunflow {
}
}//package
Section 259
//MochiBot (MochiBot)
package {
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
Section 260
//MouseCatcher (MouseCatcher)
package {
import flash.display.*;
import flash.events.*;
import flash.system.*;
public class MouseCatcher extends MovieClip {
public var clipMouse:MovieClip;
var lastNote:XML;
var t:Number;
var isWrite:Boolean;
var justMadeSpecial:Boolean;// = false
var iXml:Number;// = 0
var xml:XML;
public static const EVENT_ADDITIONAL:String = "additional event";
private function captureMove(_arg1:Event):void{
var _local2:XML = <move/>
;
if (!justMadeSpecial){
addAction(_local2);
};
justMadeSpecial = false;
}
public function begin(_arg1:Boolean, _arg2:XML):void{
isWrite = _arg1;
xml = new XML(_arg2);
t = new Date().getTime();
if (isWrite){
xml = <way/>
;
addEventListener(Event.ENTER_FRAME, captureMove);
} else {
addEventListener(Event.ENTER_FRAME, showAction);
};
}
public function captureAdditional(_arg1:XML):void{
addAction(_arg1);
justMadeSpecial = true;
}
private function addAction(_arg1:XML){
var _local3:Number;
var _local2:Number = new Date().getTime();
_arg1.@x = root.mouseX;
_arg1.@y = root.mouseY;
if (((((((((lastNote) && ((lastNote.name() == "move")))) && ((_arg1.name() == "move")))) && ((lastNote.@x == _arg1.@x)))) && ((lastNote.@y == _arg1.@y)))){
_local3 = Number(lastNote.@k);
if (isNaN(_local3)){
lastNote.@k = 1;
} else {
++_local3;
lastNote.@k = _local3;
};
} else {
lastNote = _arg1;
xml.children()[iXml] = _arg1;
iXml++;
};
t = _local2;
}
private function showAction(_arg1:Event):void{
var _local4:Number;
var _local5:Number;
var _local2:XML = xml.children()[iXml];
if (_local2 == null){
trace("end");
end();
return;
};
var _local3:Number = Number(_local2.@k);
if (((isNaN(_local3)) || ((_local3 == 0)))){
_local4 = Number(_local2.@x);
_local5 = Number(_local2.@y);
clipMouse.x = _local4;
clipMouse.y = _local5;
if (_local2.name() != "move"){
dispatchEvent(new EventMousePlay(EVENT_ADDITIONAL, _local4, _local5, _local2.name(), _local2));
};
iXml++;
} else {
--_local3;
_local2.@k = _local3;
};
}
public function end():void{
if (isWrite){
removeEventListener(Event.ENTER_FRAME, captureMove);
System.setClipboard(xml.toString());
trace(xml);
} else {
removeEventListener(Event.ENTER_FRAME, showAction);
};
}
}
}//package
Section 261
//myBtnBig (myBtnBig)
package {
import TheGame.GameTemplate.*;
public dynamic class myBtnBig extends MyBtn {
}
}//package
Section 262
//myBtnBigcopy (myBtnBigcopy)
package {
import TheGame.GameTemplate.*;
public dynamic class myBtnBigcopy extends MyBtn {
}
}//package
Section 263
//myBtnBigcopy2 (myBtnBigcopy2)
package {
import TheGame.GameTemplate.*;
public dynamic class myBtnBigcopy2 extends MyBtn {
}
}//package
Section 264
//pBall (pBall)
package {
import TheGame.MyPhysics.*;
public dynamic class pBall extends PhysicsMovie {
}
}//package
Section 265
//pBall2 (pBall2)
package {
import TheGame.MyPhysics.*;
public dynamic class pBall2 extends PhysicsMovie {
}
}//package
Section 266
//pBallSpin (pBallSpin)
package {
import TheGame.MyPhysics.*;
public dynamic class pBallSpin extends PhysicsMovieSpin {
}
}//package
Section 267
//pBallSpin2 (pBallSpin2)
package {
import TheGame.MyPhysics.*;
public dynamic class pBallSpin2 extends PhysicsMovieSpin {
}
}//package
Section 268
//pBloon1 (pBloon1)
package {
import TheGame.MyPhysics.*;
public dynamic class pBloon1 extends PhysicsMovieBloon {
}
}//package
Section 269
//pBloon2 (pBloon2)
package {
import TheGame.MyPhysics.*;
public dynamic class pBloon2 extends PhysicsMovieBloon {
}
}//package
Section 270
//pBoard (pBoard)
package {
import TheGame.MyPhysics.*;
public dynamic class pBoard extends PhysicsMovie {
}
}//package
Section 271
//pBoard2 (pBoard2)
package {
import TheGame.MyPhysics.*;
public dynamic class pBoard2 extends PhysicsMovie {
}
}//package
Section 272
//pBonusBox (pBonusBox)
package {
import TheGame.MyPhysics.*;
public dynamic class pBonusBox extends PhysicsMovieBonus {
}
}//package
Section 273
//pBox1 (pBox1)
package {
import TheGame.MyPhysics.*;
public dynamic class pBox1 extends PhysicsMovie {
}
}//package
Section 274
//pBox2 (pBox2)
package {
import TheGame.MyPhysics.*;
public dynamic class pBox2 extends PhysicsMovie {
}
}//package
Section 275
//pBox3 (pBox3)
package {
import TheGame.MyPhysics.*;
public dynamic class pBox3 extends PhysicsMovie {
}
}//package
Section 276
//pCane1 (pCane1)
package {
import TheGame.MyPhysics.*;
public dynamic class pCane1 extends PhysicsMovie {
}
}//package
Section 277
//pCane2 (pCane2)
package {
import TheGame.MyPhysics.*;
public dynamic class pCane2 extends PhysicsMovie {
}
}//package
Section 278
//pCane3 (pCane3)
package {
import TheGame.MyPhysics.*;
public dynamic class pCane3 extends PhysicsMovie {
}
}//package
Section 279
//pEgg (pEgg)
package {
import TheGame.MyPhysics.*;
public dynamic class pEgg extends PhysicsMovie {
}
}//package
Section 280
//pGround1 (pGround1)
package {
import TheGame.MyPhysics.*;
public dynamic class pGround1 extends PhysicsMovie {
}
}//package
Section 281
//physCircle (physCircle)
package {
import TheGame.MyPhysics.*;
public dynamic class physCircle extends Physics1Shape {
}
}//package
Section 282
//physOval (physOval)
package {
import TheGame.MyPhysics.*;
public dynamic class physOval extends Physics1Shape {
}
}//package
Section 283
//physRect (physRect)
package {
import TheGame.MyPhysics.*;
public dynamic class physRect extends Physics1Shape {
}
}//package
Section 284
//physTrapec1 (physTrapec1)
package {
import TheGame.MyPhysics.*;
public dynamic class physTrapec1 extends PhysicsMovie {
}
}//package
Section 285
//physTrapecia (physTrapecia)
package {
import TheGame.MyPhysics.*;
public dynamic class physTrapecia extends Physics1Shape {
}
}//package
Section 286
//pNoContact (pNoContact)
package {
import TheGame.MyPhysics.*;
public dynamic class pNoContact extends PhysicsMovieNoContact {
}
}//package
Section 287
//pNoContactBig (pNoContactBig)
package {
import TheGame.MyPhysics.*;
public dynamic class pNoContactBig extends PhysicsMovieNoContact {
}
}//package
Section 288
//pNoContactLittle (pNoContactLittle)
package {
import TheGame.MyPhysics.*;
public dynamic class pNoContactLittle extends PhysicsMovieNoContact {
}
}//package
Section 289
//point1 (point1)
package {
import flash.display.*;
public dynamic class point1 extends MovieClip {
}
}//package
Section 290
//pointer_for_menu_button (pointer_for_menu_button)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class pointer_for_menu_button extends PointerMenuBtn {
public function pointer_for_menu_button(){
__setProp_play_btn_pointer_for_menu_button_();
__setProp_download_game_btn_pointer_for_menu_button_();
__setProp_highscores_btn_pointer_for_menu_button_();
__setProp_more_games_btn_pointer_for_menu_button_();
__setProp_credits_btn_pointer_for_menu_button_();
}
function __setProp_more_games_btn_pointer_for_menu_button_(){
try {
more_games_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_games_btn.MinWidth = 180;
more_games_btn.Text = "more games";
try {
more_games_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_credits_btn_pointer_for_menu_button_(){
try {
credits_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
credits_btn.MinWidth = 180;
credits_btn.Text = "credits";
try {
credits_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_download_game_btn_pointer_for_menu_button_(){
try {
download_game_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
download_game_btn.MinWidth = 180;
download_game_btn.Text = "download";
try {
download_game_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_play_btn_pointer_for_menu_button_(){
try {
play_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
play_btn.MinWidth = 180;
play_btn.Text = "start";
try {
play_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_highscores_btn_pointer_for_menu_button_(){
try {
highscores_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
highscores_btn.MinWidth = 180;
highscores_btn.Text = "highscores";
try {
highscores_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 291
//pOval (pOval)
package {
import TheGame.MyPhysics.*;
public dynamic class pOval extends PhysicsMovie {
}
}//package
Section 292
//pOval2 (pOval2)
package {
import TheGame.MyPhysics.*;
public dynamic class pOval2 extends PhysicsMovie {
}
}//package
Section 293
//pPlank (pPlank)
package {
import TheGame.MyPhysics.*;
public dynamic class pPlank extends PhysicsMovie {
}
}//package
Section 294
//pPlatform1 (pPlatform1)
package {
import TheGame.MyPhysics.*;
public dynamic class pPlatform1 extends PhysicsMovie {
}
}//package
Section 295
//pPlatform2 (pPlatform2)
package {
import TheGame.MyPhysics.*;
public dynamic class pPlatform2 extends PhysicsMovie {
}
}//package
Section 296
//pPlatform3 (pPlatform3)
package {
import TheGame.MyPhysics.*;
public dynamic class pPlatform3 extends PhysicsMovie {
}
}//package
Section 297
//pPuddle (pPuddle)
package {
import TheGame.MyPhysics.*;
public dynamic class pPuddle extends PhysicsMovie {
}
}//package
Section 298
//pStone (pStone)
package {
import TheGame.MyPhysics.*;
public dynamic class pStone extends PhysicsMovie {
}
}//package
Section 299
//pWater (pWater)
package {
import TheGame.MyPhysics.*;
public dynamic class pWater extends PhysicsMovWater {
}
}//package
Section 300
//rollover_stripe (rollover_stripe)
package {
import flash.display.*;
public dynamic class rollover_stripe extends MovieClip {
}
}//package
Section 301
//screenSelectGame (screenSelectGame)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.Screens.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class screenSelectGame extends SelectGame {
public function screenSelectGame(){
__setProp_menu_btn_screenSelectGame_Button_0();
}
function __setProp_menu_btn_screenSelectGame_Button_0(){
try {
menu_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
menu_btn.MinWidth = 0;
menu_btn.Text = "menu";
try {
menu_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 302
//screenSubmit (screenSubmit)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.Screens.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class screenSubmit extends Submit {
public function screenSubmit(){
__setProp_submit_btn__screenSubmit_();
__setProp_menu_btn__screenSubmit_();
__setProp_map_btn__screenSubmit_();
}
function __setProp_map_btn__screenSubmit_(){
try {
map_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
map_btn_.MinWidth = 0;
map_btn_.Text = "go to map";
try {
map_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_submit_btn__screenSubmit_(){
try {
submit_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
submit_btn_.MinWidth = 0;
submit_btn_.Text = "submit record";
try {
submit_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_menu_btn__screenSubmit_(){
try {
menu_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
menu_btn_.MinWidth = 0;
menu_btn_.Text = "menu";
try {
menu_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 303
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 304
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 305
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 306
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 307
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 308
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 309
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 310
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 311
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 312
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 313
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 314
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 315
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 316
//sfxBell (sfxBell)
package {
import flash.media.*;
public dynamic class sfxBell extends Sound {
}
}//package
Section 317
//sfxBounce (sfxBounce)
package {
import flash.media.*;
public dynamic class sfxBounce extends Sound {
}
}//package
Section 318
//SndBonus (SndBonus)
package {
import flash.media.*;
public dynamic class SndBonus extends Sound {
}
}//package
Section 319
//SndNoContact (SndNoContact)
package {
import flash.media.*;
public dynamic class SndNoContact extends Sound {
}
}//package
Section 320
//SndWater (SndWater)
package {
import flash.media.*;
public dynamic class SndWater extends Sound {
}
}//package
Section 321
//spirit_flying_clip (spirit_flying_clip)
package {
import flash.display.*;
public dynamic class spirit_flying_clip extends MovieClip {
public function spirit_flying_clip(){
addFrameScript(74, frame75);
}
function frame75(){
stop();
}
}
}//package
Section 322
//spirit_sticking_clip (spirit_sticking_clip)
package {
import flash.display.*;
public dynamic class spirit_sticking_clip extends MovieClip {
public function spirit_sticking_clip(){
addFrameScript(74, frame75);
}
function frame75(){
stop();
}
}
}//package
Section 323
//spirit_usual_clip (spirit_usual_clip)
package {
import flash.display.*;
public dynamic class spirit_usual_clip extends MovieClip {
public function spirit_usual_clip(){
addFrameScript(74, frame75);
}
function frame75(){
stop();
}
}
}//package
Section 324
//spirit_water_clip (spirit_water_clip)
package {
import flash.display.*;
public dynamic class spirit_water_clip extends MovieClip {
public function spirit_water_clip(){
addFrameScript(74, frame75);
}
function frame75(){
stop();
}
}
}//package
Section 325
//startVoltClip (startVoltClip)
package {
import flash.display.*;
public dynamic class startVoltClip extends MovieClip {
public function startVoltClip(){
addFrameScript(57, frame58);
}
function frame58(){
gotoAndPlay(1);
}
}
}//package
Section 326
//startVoltClip2 (startVoltClip2)
package {
import flash.display.*;
public dynamic class startVoltClip2 extends MovieClip {
public function startVoltClip2(){
addFrameScript(30, frame31);
}
function frame31(){
gotoAndPlay(1);
}
}
}//package
Section 327
//Symbol1Bloon (Symbol1Bloon)
package {
import flash.display.*;
public dynamic class Symbol1Bloon extends MovieClip {
}
}//package
Section 328
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 329
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package
Section 330
//wat_mc (wat_mc)
package {
import flash.display.*;
public dynamic class wat_mc extends MovieClip {
}
}//package
Section 331
//WaterHolderB (WaterHolderB)
package {
import flash.display.*;
import com.midasplayer.extras.*;
public dynamic class WaterHolderB extends MovieClip {
public var BLUE:Water;
}
}//package
Section 332
//WaterHolderG (WaterHolderG)
package {
import flash.display.*;
import com.midasplayer.extras.*;
public dynamic class WaterHolderG extends MovieClip {
public var GREEN:Water;
}
}//package
Section 333
//WaterHolderR (WaterHolderR)
package {
import flash.display.*;
import com.midasplayer.extras.*;
public dynamic class WaterHolderR extends MovieClip {
public var RED:Water;
}
}//package
Section 334
//ver_funflow (ver_funflow)
package {
import TheGame.*;
public dynamic class ver_funflow extends ButtonFunflow {
}
}//package
Section 335
//windowInGame (windowInGame)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import TheGame.GameTemplate.*;
import flash.net.*;
import flash.media.*;
import flash.utils.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class windowInGame extends PopupWindow {
public function windowInGame(){
__setProp_next2_btn__windowInGame_();
__setProp_more_games_btn__windowInGame_();
__setProp_walkthrough_btn__windowInGame_();
__setProp_play_on_f_btn__windowInGame_Layer9_0();
__setProp_again_btn__windowInGame_Layer9_0();
}
function __setProp_next2_btn__windowInGame_(){
try {
next2_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
next2_btn_.MinWidth = 0;
next2_btn_.Text = "next";
try {
next2_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_walkthrough_btn__windowInGame_(){
try {
walkthrough_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
walkthrough_btn_.MinWidth = 0;
walkthrough_btn_.Text = "walkthrough";
try {
walkthrough_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_more_games_btn__windowInGame_(){
try {
more_games_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_games_btn_.MinWidth = 0;
more_games_btn_.Text = "more games";
try {
more_games_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_play_on_f_btn__windowInGame_Layer9_0(){
try {
play_on_f_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
play_on_f_btn_.MinWidth = 0;
play_on_f_btn_.Text = "share on iii";
try {
play_on_f_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function __setProp_again_btn__windowInGame_Layer9_0(){
try {
again_btn_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
again_btn_.MinWidth = 0;
again_btn_.Text = "again";
try {
again_btn_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 336
//volt_in1 (volt_in1)
package {
import flash.display.*;
public dynamic class volt_in1 extends MovieClip {
public var in_mc:MovieClip;
}
}//package
Section 337
//volt_in1_adding (volt_in1_adding)
package {
import flash.display.*;
public dynamic class volt_in1_adding extends MovieClip {
}
}//package
Section 338
//volt_in1_glad (volt_in1_glad)
package {
import flash.display.*;
public dynamic class volt_in1_glad extends MovieClip {
}
}//package
Section 339
//volt_in1_sad (volt_in1_sad)
package {
import flash.display.*;
public dynamic class volt_in1_sad extends MovieClip {
}
}//package
Section 340
//volt_in1_usual (volt_in1_usual)
package {
import flash.display.*;
public dynamic class volt_in1_usual extends MovieClip {
}
}//package
Section 341
//volt_in2 (volt_in2)
package {
import flash.display.*;
public dynamic class volt_in2 extends MovieClip {
public var in_mc:MovieClip;
}
}//package
Section 342
//volt_in2_adding (volt_in2_adding)
package {
import flash.display.*;
public dynamic class volt_in2_adding extends MovieClip {
}
}//package
Section 343
//volt_in2_glad (volt_in2_glad)
package {
import flash.display.*;
public dynamic class volt_in2_glad extends MovieClip {
}
}//package
Section 344
//volt_in2_sad (volt_in2_sad)
package {
import flash.display.*;
public dynamic class volt_in2_sad extends MovieClip {
}
}//package
Section 345
//volt_in2_usual (volt_in2_usual)
package {
import flash.display.*;
public dynamic class volt_in2_usual extends MovieClip {
}
}//package
Section 346
//volt_in3 (volt_in3)
package {
import flash.display.*;
public dynamic class volt_in3 extends MovieClip {
public var in_mc:MovieClip;
}
}//package
Section 347
//volt_in3_adding (volt_in3_adding)
package {
import flash.display.*;
public dynamic class volt_in3_adding extends MovieClip {
}
}//package
Section 348
//volt_in3_glad (volt_in3_glad)
package {
import flash.display.*;
public dynamic class volt_in3_glad extends MovieClip {
}
}//package
Section 349
//volt_in3_sad (volt_in3_sad)
package {
import flash.display.*;
public dynamic class volt_in3_sad extends MovieClip {
}
}//package
Section 350
//volt_in3_usual (volt_in3_usual)
package {
import flash.display.*;
public dynamic class volt_in3_usual extends MovieClip {
}
}//package
Section 351
//volt_in4 (volt_in4)
package {
import flash.display.*;
public dynamic class volt_in4 extends MovieClip {
public var in_mc:MovieClip;
}
}//package
Section 352
//volt_in4_adding (volt_in4_adding)
package {
import flash.display.*;
public dynamic class volt_in4_adding extends MovieClip {
}
}//package
Section 353
//volt_in4_glad (volt_in4_glad)
package {
import flash.display.*;
public dynamic class volt_in4_glad extends MovieClip {
}
}//package
Section 354
//volt_in4_sad (volt_in4_sad)
package {
import flash.display.*;
public dynamic class volt_in4_sad extends MovieClip {
}
}//package
Section 355
//volt_in4_usual (volt_in4_usual)
package {
import flash.display.*;
public dynamic class volt_in4_usual extends MovieClip {
}
}//package
Section 356
//volt1 (volt1)
package {
import TheGame.*;
public dynamic class volt1 extends Volt {
}
}//package
Section 357
//volt2 (volt2)
package {
import TheGame.*;
public dynamic class volt2 extends VoltFlying {
}
}//package
Section 358
//volt3 (volt3)
package {
import TheGame.*;
public dynamic class volt3 extends Volt {
}
}//package
Section 359
//volt4 (volt4)
package {
import TheGame.*;
public dynamic class volt4 extends Volt {
}
}//package
Section 360
//voltMode (voltMode)
package {
import TheGame.*;
public dynamic class voltMode extends VoltModeBtn {
}
}//package
Section 361
//workZone (workZone)
package {
import TheGame.*;
public dynamic class workZone extends WorkZone {
}
}//package
Section 362
//workZonePlat (workZonePlat)
package {
import flash.display.*;
public dynamic class workZonePlat extends MovieClip {
}
}//package
Section 363
//Глаза1 (Глаза1)
package {
import TheGame.*;
public dynamic class Глаза1 extends AnimForButtonLevel {
}
}//package
Section 364
//Глаза3 (Глаза3)
package {
import TheGame.*;
public dynamic class Глаза3 extends AnimForButtonLevel {
}
}//package