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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
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;
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
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.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function 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.Common.Math.*;
import Box2D.Collision.Shapes.*;
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.Common.Math.*;
import Box2D.Collision.Shapes.*;
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.Common.Math.*;
import Box2D.Collision.Shapes.*;
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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local8:b2ManifoldPoint;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
var _local7:b2ContactPoint = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function 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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var normal:b2Vec2;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var tangentMass:Number;
public var equalizedMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var other:b2Body;
public var prev:b2ContactEdge;
public var contact:b2Contact;
public var next:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local6:b2Body = m_shape1.m_body;
var _local7:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
var _local8:Array = [false, false];
var _local9:b2ContactPoint = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function 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.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Dynamics.*;
import Box2D.Common.Math.*;
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.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
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.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2BodyDef {
public var angularDamping:Number;
public var angle:Number;
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var fixedRotation:Boolean;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData = _arg1.GetFilterData();
var _local4:b2FilterData = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
var _local5:Boolean = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 68
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_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.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
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.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
public class b2DestructionListener {
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
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.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_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
//Background (com.gamezhero.api.as3.gui.Background)
package com.gamezhero.api.as3.gui {
import flash.display.*;
public class Background extends MovieClip {
private var _goal:MovieClip;
private var _bg:MovieClip;
public function Background(_arg1:MovieClip){
_goal = _arg1;
_goal.addChild(this);
ini();
iniEvents();
}
public function remove():void{
clearEvents();
_goal.removeChild(this);
}
private function clearEvents():void{
}
public function update(_arg1:Number, _arg2:Number):void{
this.x = 0;
this.y = 0;
this.width = (_arg1 + 100);
this.height = (_arg2 + 100);
}
private function getBg():MovieClip{
var _local1:MovieClip = new MovieClip();
_local1.graphics.beginFill(0, 1);
_local1.graphics.lineStyle(0, 0, 0);
_local1.graphics.moveTo(0, 0);
_local1.graphics.lineTo(1000, 0);
_local1.graphics.lineTo(1000, 1000);
_local1.graphics.lineTo(0, 1000);
_local1.graphics.lineTo(0, 0);
_local1.graphics.endFill();
return (_local1);
}
private function ini():void{
_bg = getBg();
this.addChild(_bg);
}
private function iniEvents():void{
}
}
}//package com.gamezhero.api.as3.gui
Section 76
//Indicator (com.gamezhero.api.as3.gui.Indicator)
package com.gamezhero.api.as3.gui {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class Indicator extends MovieClip {
private var _timer:Timer;
private var _goal:MovieClip;
private var _indicator:MovieClip;
private var _dalpha:Number;
private var _info_text:TextField;
private var _arr:Array;
private var _n:uint;// = 10
private var _timer_2:Timer;
private var _current:Number;// = 0
public function Indicator(_arg1:MovieClip){
_dalpha = (360 / _n);
_arr = new Array();
super();
_goal = _arg1;
_goal.addChild(this);
ini();
iniEvents();
}
public function setSize(_arg1:Number, _arg2:Number):void{
this.visible = true;
this.width = _arg1;
this.height = _arg2;
}
public function remove():void{
clearEvents();
_goal.removeChild(this);
}
private function getItem():MovieClip{
var _local1:MovieClip = new MovieClip();
_local1.graphics.beginFill(0xFFFFFF, 1);
_local1.graphics.lineStyle(0, 0, 0);
_local1.graphics.moveTo(32.3, -5.7);
_local1.graphics.curveTo(30, -3.3, 30, 0);
_local1.graphics.curveTo(30, 3.3, 32.3, 5.6);
_local1.graphics.curveTo(34.7, 8, 38.05, 8);
_local1.graphics.lineTo(57, 8);
_local1.graphics.curveTo(60.3, 8, 62.6, 5.6);
_local1.graphics.curveTo(65, 3.3, 65, 0);
_local1.graphics.curveTo(65, -3.3, 62.6, -5.7);
_local1.graphics.curveTo(60.3, -8, 57, -8);
_local1.graphics.lineTo(38.05, -8);
_local1.graphics.curveTo(34.7, -8, 32.3, -5.7);
_local1.graphics.endFill();
_indicator.addChild(_local1);
return (_local1);
}
private function clearEvents():void{
_timer.removeEventListener(TimerEvent.TIMER, updateIndicator);
_timer_2.removeEventListener(TimerEvent.TIMER, updateCurrent);
}
public function setPos(_arg1:Number, _arg2:Number):void{
this.visible = true;
this.x = _arg1;
this.y = _arg2;
}
private function updateIndicator(_arg1:TimerEvent=null):void{
var _local2:uint;
while (_local2 < _n) {
_arr[_local2].alpha = (_arr[_local2].alpha - 0.07);
if (_arr[_local2].alpha <= 0){
_arr[_local2].alpha = 0;
};
_local2++;
};
_arg1.updateAfterEvent();
}
public function createInfoText():void{
_info_text = new TextField();
var _local1:TextFormat = new TextFormat();
_local1.color = 0xFFFFFF;
_local1.size = 11;
_local1.font = "Arial";
_info_text.defaultTextFormat = _local1;
_info_text.autoSize = TextFieldAutoSize.CENTER;
_indicator.addChild(_info_text);
var _local2:Number = 100;
var _local3:Number = 20;
_local2 = _info_text.width;
_local3 = _info_text.height;
_info_text.x = (-(_local2) / 2);
_info_text.y = -10;
}
public function update(_arg1:Number, _arg2:Number):void{
this.visible = true;
this.x = (_arg1 / 2);
this.y = (_arg2 / 2);
}
private function iniEvents():void{
_timer.addEventListener(TimerEvent.TIMER, updateIndicator);
_timer.start();
_timer_2.addEventListener(TimerEvent.TIMER, updateCurrent);
_timer_2.start();
}
public function setVal(_arg1:String):void{
_info_text.text = _arg1;
}
private function getBorder():MovieClip{
var _local1:Number = 10;
var _local2:Number = 150;
var _local3:Number = 150;
var _local4:MovieClip = new MovieClip();
_local4.graphics.beginFill(0x333333, 1);
_local4.graphics.moveTo(_local1, 0);
_local4.graphics.lineTo((_local2 - _local1), 0);
_local4.graphics.curveTo(_local2, 0, _local2, _local1);
_local4.graphics.lineTo(_local2, _local1);
_local4.graphics.lineTo(_local2, (_local3 - _local1));
_local4.graphics.curveTo(_local2, _local3, (_local2 - _local1), _local3);
_local4.graphics.lineTo((_local2 - _local1), _local3);
_local4.graphics.lineTo(_local1, _local3);
_local4.graphics.curveTo(0, _local3, 0, (_local3 - _local1));
_local4.graphics.lineTo(0, (_local3 - _local1));
_local4.graphics.lineTo(0, _local1);
_local4.graphics.curveTo(0, 0, _local1, 0);
_local4.graphics.lineTo(_local1, 0);
_local4.graphics.endFill();
_indicator.addChild(_local4);
_local4.x = (-(_local4.width) / 2);
_local4.y = (-(_local4.height) / 2);
return (_local4);
}
private function ini():void{
var _local2:MovieClip;
this.visible = false;
_timer = new Timer((1000 / 40), 0);
_timer_2 = new Timer((1000 / 20), 0);
_indicator = new MovieClip();
this.addChild(_indicator);
getBorder();
var _local1:uint;
while (_local1 < _n) {
_local2 = getItem();
_local2.rotation = (_dalpha * _local1);
_local2.alpha = 0.2;
_arr.push(_local2);
_local1++;
};
createInfoText();
}
private function updateCurrent(_arg1:TimerEvent=null):void{
_current++;
if (_current >= _arr.length){
_current = 0;
};
_arr[_current].alpha = 1;
_arg1.updateAfterEvent();
}
}
}//package com.gamezhero.api.as3.gui
Section 77
//URL (com.gamezhero.api.as3.utils.URL)
package com.gamezhero.api.as3.utils {
public class URL {
private var _scheme:String;
private var _host:String;
private var _query:String;
private var _path:String;
private var _userinfo:String;
private var _port:String;
private var _url:String;
private var _fragment:String;
private static const PATTERN:RegExp = /^([A-Za-z0-9_+.]{1,8}:\/\/)?([!-~]+@)?([^\/?#:]*)(:[0-9]*)?(\/[^?#]*)?(\?[^#]*)?(\#.*)?/i;
public function URL(_arg1:String):void{
var _local2:Array = _arg1.match(URL.PATTERN);
_url = _local2[0];
_scheme = _local2[1];
_userinfo = _local2[2];
_host = _local2[3];
_port = _local2[4];
_path = _local2[5];
_query = _local2[6];
_fragment = _local2[7];
}
public function get port():int{
return (((_port.length <= 0)) ? undefined : int(_port.substring(1, _port.length)));
}
public function get fragment():String{
return (((_fragment.length <= 0)) ? undefined : _fragment);
}
public function get query():Object{
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local1:Object = {raw:undefined, parsed:undefined};
if (((_query) && ((_query.length > 0)))){
_local1.raw = _query;
_local2 = _query.substring(1, _query.length);
_local3 = _local2.split("&");
_local1.parsed = ((_local3.length > 0)) ? {} : undefined;
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4].split("=");
_local1.parsed[_local5[0]] = _local5[1];
_local4++;
};
};
return (_local1);
}
public function get scheme():String{
return (((_scheme.length <= 0)) ? undefined : _scheme.substring(0, (_scheme.length - 3)));
}
public function get host():String{
return (((_host.length <= 0)) ? undefined : _host);
}
public function get path():String{
return (((_path.length <= 0)) ? undefined : _path);
}
public function get url():String{
return (((_url.length <= 0)) ? undefined : _url);
}
public function get userinfo():Object{
var _local2:Array;
var _local1:Object = {user:undefined, pass:undefined};
if (_userinfo){
_local2 = _userinfo.substring(0, (_userinfo.length - 1)).split(":");
_local1.user = (_local2[0]) ? _local2[0] : _local1.user;
_local1.pass = (_local2[1]) ? _local2[1] : _local1.pas;
};
return (_local1);
}
}
}//package com.gamezhero.api.as3.utils
Section 78
//GamePreloader (com.gamezhero.api.as3.GamePreloader)
package com.gamezhero.api.as3 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import com.google.analytics.*;
import flash.utils.*;
import com.gamezhero.api.as3.gui.*;
import flash.ui.*;
public class GamePreloader extends MovieClip {
private var _indicator:Indicator;
private var _obj_listener_preloader:Object;
private var _gamezhero_code_preloader:Number;
private var _quality_old:String;
private var _rate_old:Number;
private var _send_name_connection_preloader:String;
private var _recived_name_connection_preloader:String;
private var _obj:Object;
private var _scale_old:String;
private var _preloader_active_flag:Boolean;// = false
private var _urls:Dictionary;
private var _timer:Timer;
private var _loader_preloader_skin:Loader;
private var _bg:Background;
private var _recive_localconnection_preloader:LocalConnection;
private var _error_flag:Boolean;// = false
private var _in_target:String;
private var _align_old:String;
private var _send_localconnection_preloader:LocalConnection;
private var _par:MovieClip;
private var _amount_try:uint;// = 10
private var _in_url:String;// = "null"
private var _tracker:GATracker;
private var _debug_flag:Boolean;// = false
public static const finish:String = "PRELOAD_COMPLETE";
public function GamePreloader(_arg1:MovieClip, _arg2:Object=null){
var par = _arg1;
var iniObject = _arg2;
_timer = new Timer((1000 / 10), 0);
_obj = new Object();
_urls = new Dictionary();
_recive_localconnection_preloader = new LocalConnection();
_send_localconnection_preloader = new LocalConnection();
_loader_preloader_skin = new Loader();
_obj_listener_preloader = new Object();
super();
_par = par;
_par.addChild(this);
if (iniObject != null){
_obj = iniObject;
};
try {
_debug_flag = _obj["debug"];
} catch(e:Error) {
_debug_flag = false;
};
_bg = new Background(this);
_indicator = new Indicator(this);
_gamezhero_code_preloader = new Date().getTime();
_recived_name_connection_preloader = ("_recived_gamezhero_preloader_" + _gamezhero_code_preloader);
_send_name_connection_preloader = ("_send_gamezhero_preloader_" + _gamezhero_code_preloader);
iniLocalConnectionsPreloader();
iniEvents();
iniStage();
iniGoogleAnalitics();
}
private function ioErrorHandler(_arg1:IOErrorEvent=null):void{
beginScenario2();
}
private function preloaderLoaderError(_arg1:Event=null):void{
beginScenario2();
}
private function preloaderLoaderComplete(_arg1:Event=null):void{
}
private function actionDone(_arg1:TimerEvent=null):void{
var _local2:Event;
this.alpha = (this.alpha - 1);
if (this.alpha <= 1){
this.alpha = 0;
clearEvents();
clearStageEvents();
clearTimers();
setStageSettings();
_local2 = new Event(finish);
this.dispatchEvent(_local2);
_indicator.remove();
_bg.remove();
_par.removeChild(this);
};
_arg1.updateAfterEvent();
}
private function gotoAction(_arg1:MouseEvent=null):void{
trace((((("gotoAction 2 " + _in_url) + " ") + _in_target) + " "));
if (_in_url != "null"){
GamezheroGlobal.getURL(_in_url, _in_target);
_in_url = "null";
};
}
private function iniStage(_arg1:Event=null):void{
var event = _arg1;
this.removeEventListener(Event.ENTER_FRAME, iniStage);
try {
getStageSettings();
iniStageSettings();
iniContextMenu();
iniStageEvents();
if (_debug_flag == false){
loadPreloaderSkin();
} else {
beginScenario2();
};
} catch(e:Error) {
_amount_try--;
if (_amount_try <= 0){
beginScenario2();
} else {
this.addEventListener(Event.ENTER_FRAME, iniStage);
};
};
}
private function resizeAction(_arg1:Event=null):void{
var obj:Object;
var event = _arg1;
obj = new Object();
try {
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
} catch(e:Error) {
obj.width = 550;
obj.height = 400;
};
if ((((_error_flag == false)) && ((_preloader_active_flag == true)))){
try {
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([117, 112, 100, 97, 116, 101, 80, 111, 115]), obj);
} catch(e:Error) {
beginScenario2();
};
};
_indicator.update(obj.width, obj.height);
_bg.update(obj.width, obj.height);
}
private function getStageSettings():void{
_scale_old = stage.scaleMode;
_align_old = stage.align;
_rate_old = stage.frameRate;
_quality_old = stage.quality;
}
private function beginScenario2():void{
_error_flag = true;
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, updatePreloader2);
_timer.start();
}
private function iniEvents():void{
_par.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_loader_preloader_skin.contentLoaderInfo.addEventListener(Event.INIT, preloaderLoaderInit);
_loader_preloader_skin.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, preloaderLoaderError);
_recive_localconnection_preloader.addEventListener(StatusEvent.STATUS, onStatusRecivePreloader);
_recive_localconnection_preloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorRecivePreloader);
_send_localconnection_preloader.addEventListener(StatusEvent.STATUS, onStatusSendPreloader);
_send_localconnection_preloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendPreloader);
}
private function updatePreloader2(_arg1:TimerEvent=null):void{
var obj:Object;
var event = _arg1;
iniStageSettings();
var proc:Number = (_par.loaderInfo.bytesLoaded / _par.loaderInfo.bytesTotal);
_indicator.setVal((Math.round((proc * 100)) + " %"));
if (proc >= 1){
action();
};
obj = new Object();
try {
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
} catch(e:Error) {
obj.width = 550;
obj.height = 400;
};
event.updateAfterEvent();
}
private function iniContextMenu():void{
var _local5:String;
var _local6:ContextMenuItem;
var _local1:String = GamezheroGlobal.getDomain(_par.stage);
var _local2:String = GamezheroGlobal.gameName;
_obj.gamezhero_url = (((("http://www.gamezhero.com/?utm_campaign=" + _local2) + "&utm_source=") + _local1) + "&utm_medium=preloader");
_obj.gamezhero_menu = {Free Online Games @ Gamezhero.com:(((("http://www.gamezhero.com/?utm_campaign=" + _local2) + "&utm_source=") + _local1) + "&utm_medium=context_menu"), Send To Friends:(((((("http://www.gamezhero.com/sendtofriends/" + _local2) + "-onlinegames.html?utm_campaign=") + _local2) + "&utm_source=") + _local1) + "&utm_medium=send_to_friends_context_menu"), Put This Game To Your Blog or Site:(((((("http://www.gamezhero.com/freewebsitegames/" + _local2) + "-onlinegames.html?utm_campaign=") + _local2) + "&utm_source=") + _local1) + "&utm_medium=free_web_site_games_context")};
var _local3:ContextMenu = new ContextMenu();
_local3.hideBuiltInItems();
var _local4:ContextMenuBuiltInItems = _local3.builtInItems;
_local4.quality = true;
_local4.print = true;
for (_local5 in _obj.gamezhero_menu) {
_local6 = new ContextMenuItem(_local5);
_urls[_local6] = _obj.gamezhero_menu[_local5];
_local6.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, getURLContextMenu);
_local3.customItems.push(_local6);
};
this.parent.contextMenu = _local3;
}
private function getInfo():Object{
var _local1:UserInfo = new UserInfo(_par);
return ((_local1 as Object));
}
private function onStatusRecivePreloader(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
beginScenario2();
break;
};
}
private function iniLocalConnectionsPreloader():void{
_obj_listener_preloader = new Object();
_obj_listener_preloader.preloaderOk = function ():void{
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([105, 110, 105, 80, 114, 101, 108, 111, 97, 100, 101, 114]), getInfo());
beginScenario1();
};
_obj_listener_preloader.preloaderGetUrlAction = function (_arg1:String, _arg2:String):void{
var url = _arg1;
var target = _arg2;
try {
_tracker.trackEvent("preloader", "click", GamezheroGlobal.gameName);
} catch(e:Error) {
};
gotoActionIni(url, target);
};
_obj_listener_preloader.finishAction = function (_arg1:Object):void{
action();
};
var dom:String = GamezheroGlobal.toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
_recive_localconnection_preloader.allowInsecureDomain(dom);
_recive_localconnection_preloader.allowDomain(dom);
_recive_localconnection_preloader.client = _obj_listener_preloader;
try {
_recive_localconnection_preloader.connect(_recived_name_connection_preloader);
} catch(e:Error) {
beginScenario2();
};
_send_localconnection_preloader.allowInsecureDomain(dom);
_send_localconnection_preloader.allowDomain(dom);
}
private function gotoActionIni(_arg1:String, _arg2:String):void{
trace((((("gotoAction 1 " + _arg1) + " ") + _arg2) + " "));
_in_url = _arg1;
_in_target = _arg2;
gotoAction();
}
private function onStatusSendPreloader(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
beginScenario2();
break;
};
}
private function iniGoogleAnalitics():void{
try {
_tracker = new GATracker(this, "UA-262190-1", "AS3", false);
_tracker.trackEvent("preloader", "loading", GamezheroGlobal.gameName);
} catch(e:Error) {
};
}
private function getURLContextMenu(_arg1:ContextMenuEvent=null):void{
GamezheroGlobal.getURL(_urls[_arg1.target], "_blank");
}
private function iniStageEvents():void{
stage.addEventListener(Event.RESIZE, resizeAction);
resizeAction();
}
public function action(_arg1:Event=null):void{
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, actionDone);
_timer.start();
}
private function iniStageSettings():void{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 20;
stage.quality = StageQuality.HIGH;
}
private function clearEvents():void{
_par.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
this.removeEventListener(Event.ENTER_FRAME, iniStage);
_loader_preloader_skin.contentLoaderInfo.removeEventListener(Event.INIT, preloaderLoaderInit);
_loader_preloader_skin.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, preloaderLoaderError);
_recive_localconnection_preloader.removeEventListener(StatusEvent.STATUS, onStatusRecivePreloader);
_recive_localconnection_preloader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorRecivePreloader);
_recive_localconnection_preloader.client = {};
_recive_localconnection_preloader.close();
_recive_localconnection_preloader = new LocalConnection();
_send_localconnection_preloader.removeEventListener(StatusEvent.STATUS, onStatusSendPreloader);
_send_localconnection_preloader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendPreloader);
_send_localconnection_preloader = new LocalConnection();
}
private function updatePreloader1(_arg1:TimerEvent=null):void{
var obj:Object;
var event = _arg1;
iniStageSettings();
var proc:Number = (_par.loaderInfo.bytesLoaded / _par.loaderInfo.bytesTotal);
_indicator.setVal("Loading...");
obj = new Object();
try {
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
} catch(e:Error) {
obj.width = 550;
obj.height = 400;
};
obj.loaded = proc;
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([117, 112, 100, 97, 116, 101, 80, 114, 101, 108, 111, 97, 100, 101, 114]), obj);
event.updateAfterEvent();
}
private function loadPreloaderSkin():void{
var url:String = (GamezheroGlobal.toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 112, 114, 101, 108, 111, 97, 100, 101, 114, 47, 112, 114, 101, 108, 111, 97, 100, 101, 114, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + String(_gamezhero_code_preloader));
var request:URLRequest = new URLRequest(url);
try {
_loader_preloader_skin.load(request);
addChild(_loader_preloader_skin);
} catch(e:Error) {
beginScenario2();
};
}
private function preloaderLoaderInit(_arg1:Event=null):void{
var _local2:Timer = new Timer(200, 1);
_local2.addEventListener(TimerEvent.TIMER, checkPreloader);
_local2.start();
}
private function checkPreloader(_arg1:TimerEvent=null):void{
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([112, 114, 101, 108, 111, 97, 100, 101, 114, 73, 115, 79, 107]), null);
}
private function clearStageEvents():void{
try {
stage.removeEventListener(Event.RESIZE, resizeAction);
} catch(e:Error) {
};
}
private function onErrorRecivePreloader(_arg1:SecurityErrorEvent=null):void{
beginScenario2();
}
private function moveAction(_arg1:MouseEvent=null):void{
}
private function beginScenario1():void{
_preloader_active_flag = true;
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, updatePreloader1);
_timer.start();
resizeAction();
}
private function clearTimers():void{
_timer.removeEventListener(TimerEvent.TIMER, updatePreloader1);
_timer.removeEventListener(TimerEvent.TIMER, updatePreloader2);
_timer.removeEventListener(TimerEvent.TIMER, actionDone);
}
private function onErrorSendPreloader(_arg1:SecurityErrorEvent=null):void{
beginScenario2();
}
private function setStageSettings():void{
stage.scaleMode = _scale_old;
stage.align = _align_old;
stage.frameRate = _rate_old;
stage.quality = _quality_old;
}
}
}//package com.gamezhero.api.as3
Section 79
//GamezheroApi (com.gamezhero.api.as3.GamezheroApi)
package com.gamezhero.api.as3 {
import flash.events.*;
import flash.display.*;
import flash.system.*;
public class GamezheroApi {
private static var _score_continue_function:Function;
private static var _preloader_next_step_function:Function;
private static var _preloader_goal:MovieClip;
private static var _score_submit_function:Function;
private static var _score_error_function:Function;
private static var _score_goal:MovieClip;
private static function scoreSubmitAction(_arg1:Event=null):void{
_score_submit_function.apply();
}
public static function preloader(_arg1:MovieClip, _arg2:Function):void{
var _local3:GamePreloader;
_preloader_goal = (_arg1 as MovieClip);
_preloader_next_step_function = _arg2;
if (GamezheroGlobal.gameName == "unset"){
trace("Error. GamezheroApi don't ini !");
} else {
_local3 = new GamePreloader(_preloader_goal, {debug:false});
_local3.addEventListener(GamePreloader.finish, preloaderNextStep);
};
}
public static function ini(_arg1:String):void{
Security.allowDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "data.gamezhero.com", "*.gamezhero.com");
Security.allowInsecureDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "data.gamezhero.com", "*.gamezhero.com");
GamezheroGlobal.gameName = _arg1;
}
private static function scoreErrorAction(_arg1:Event=null):void{
_score_error_function.apply();
}
public static function linkSendToFrined():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/sendtofriends/" + GamezheroGlobal.gameName) + "-games.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=send_to_friend"), "_blank");
}
private static function scoreContinueAction(_arg1:Event=null):void{
_score_continue_function.apply();
}
public static function score(_arg1:MovieClip, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Function, _arg7:Function, _arg8:Function, _arg9:Object=null):void{
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Object;
var _local14:SubmitArea;
GamezheroGlobal.gameCode = _arg2;
_score_goal = (_arg1 as MovieClip);
_score_submit_function = _arg6;
_score_continue_function = _arg7;
_score_error_function = _arg8;
if (GamezheroGlobal.gameName == "unset"){
trace("Error. GamezheroApi don't ini !");
} else {
_local10 = _arg3;
_local11 = _arg4;
_local12 = _arg5;
_local13 = _arg9;
if (_local13 == null){
_local13 = {border:{width:4, color:0xFFFFFF, alpha:100}, background:{topColor:0x999999, bottomColor:0x666666, topAlpha:100, bottomAlpha:100, cornerRadius:10}, language:"ENG"};
};
_local14 = new SubmitArea(_score_goal, _local11, _local12, _local10, _local13);
_local14.addEventListener(SubmitArea.SUBMITED, scoreSubmitAction);
_local14.addEventListener(SubmitArea.CONTINUE, scoreContinueAction);
_local14.addEventListener(SubmitArea.ERROR, scoreErrorAction);
};
}
private static function preloaderNextStep(_arg1:Event=null):void{
_preloader_next_step_function.apply();
}
public static function linkTopScore():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/topscore/" + GamezheroGlobal.gameName) + "/top100.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=top_score"), "_blank");
}
public static function linkMoreGames():void{
GamezheroGlobal.getURL((((("http://www.gamezhero.com/?utm_campaign=" + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=more_free_games"), "_blank");
}
public static function linkZorroLogo():void{
GamezheroGlobal.getURL((((("http://www.gamezhero.com/?utm_campaign=" + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=zorro_logo"), "_blank");
}
public static function linkPublish():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/freewebsitegames/" + GamezheroGlobal.gameName) + "-games.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=free_web_site_games"), "_blank");
}
}
}//package com.gamezhero.api.as3
Section 80
//GamezheroGlobal (com.gamezhero.api.as3.GamezheroGlobal)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.net.*;
import com.gamezhero.api.as3.utils.*;
import flash.external.*;
public class GamezheroGlobal {
public static const SAFARI:String = "safari";
public static const FIREFOX:String = "firefox";
public static const CHROME:String = "chrome";
public static const IE:String = "ie";
public static const OPERA:String = "opera";
public static var gameNameVar:String = "unset";
public static var host:String = "error";
public static var browser:String = "unset";
public static var gameCodeVar:String = "unset";
public static function getDomain(_arg1:Stage=null):String{
var url:URL;
var stage = _arg1;
if (host != "error"){
return (host);
};
try {
url = new URL(stage.loaderInfo.url);
host = url.host;
if (url.host == null){
host = "local";
};
} catch(e:Error) {
host = "error";
};
return (host);
}
public static function toText(_arg1:Array):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
public static function getURL(_arg1:String, _arg2:String):void{
var _local3:URLRequest = new URLRequest(_arg1);
navigateToURL(_local3, _arg2);
}
public static function get gameName():String{
return (gameNameVar);
}
public static function getBrowser():String{
var st:String;
if (browser == "unset"){
if (ExternalInterface.available){
try {
st = ExternalInterface.call("function (){ return navigator['userAgent']}");
st = st.toLowerCase();
if (st.indexOf("firefox") != -1){
browser = FIREFOX;
} else {
if (st.indexOf("chrome") != -1){
browser = CHROME;
} else {
if (st.indexOf("safari") != -1){
browser = SAFARI;
} else {
if (st.indexOf("opera") != -1){
browser = OPERA;
} else {
browser = IE;
};
};
};
};
} catch(e:Error) {
browser = IE;
};
} else {
browser = IE;
};
};
return (browser);
}
public static function set gameName(_arg1:String):void{
gameNameVar = _arg1;
}
public static function set gameCode(_arg1:String):void{
gameCodeVar = _arg1;
}
public static function get gameCode():String{
return (gameCodeVar);
}
}
}//package com.gamezhero.api.as3
Section 81
//SubmitArea (com.gamezhero.api.as3.SubmitArea)
package com.gamezhero.api.as3 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.text.*;
import flash.utils.*;
import com.gamezhero.api.as3.gui.*;
public class SubmitArea extends MovieClip {
private var reciveLocalConnection_engine:LocalConnection;
private var sendLocalConnection_skin:LocalConnection;
private var score_value:Number;// = 0
private var sendNameConnection_skin:String;
private var x_pos:Number;// = 0
private var y_pos:Number;// = 0
private var _indicator:Indicator;
private var score:Number;
private var goal:MovieClip;
private var skin_mc:MovieClip;
private var loader_skin:Loader;
private var gamezheroCode_engine:Number;
private var engine_mc:MovieClip;
private var skin_info:Object;
private var _loader:URLVariables;
private var reciveLocalConnection_skin:LocalConnection;
private var recivedNameConnection_engine:String;
private var sendLocalConnection_engine:LocalConnection;
private var sendNameConnection_engine:String;
private var _loader_url:String;// = "null"
private var objListenerSkin:Object;
public var versionGame:String;// = "2.0"
private var gamezheroCode_skin:Number;
private var loader_engine:Loader;
private var objListenerEngine:Object;
private var recivedNameConnection_skin:String;
private var infoText:TextField;
public static const SUBMITED:String = "gamezhero_submited";
public static const CONTINUE:String = "gamezhero_continue";
public static const ERROR:String = "gamezhero_error";
public function SubmitArea(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object){
reciveLocalConnection_skin = new LocalConnection();
sendLocalConnection_skin = new LocalConnection();
reciveLocalConnection_engine = new LocalConnection();
sendLocalConnection_engine = new LocalConnection();
loader_skin = new Loader();
loader_engine = new Loader();
objListenerSkin = new Object();
objListenerEngine = new Object();
_loader = new URLVariables();
super();
gamezheroCode_skin = new Date().getTime();
gamezheroCode_engine = gamezheroCode_skin;
recivedNameConnection_skin = ("_send_gamezhero_skin_" + gamezheroCode_skin);
sendNameConnection_skin = ("_recive_gamezhero_skin_" + gamezheroCode_skin);
recivedNameConnection_engine = ("_send_gamezhero_engine_" + gamezheroCode_engine);
sendNameConnection_engine = ("_recive_gamezhero_engine_" + gamezheroCode_engine);
iniLocalConnectionsSkin();
iniLocalConnectionsEngine();
iniSubmitArea(_arg1, _arg2, _arg3, _arg4, _arg5);
iniEvents();
}
private function iniSkin():void{
loader_skin.x = x_pos;
loader_skin.y = y_pos;
infoText.text = "";
try {
_indicator.remove();
} catch(e:Error) {
};
sendLocalConnection_skin.send(sendNameConnection_skin, "iniSkin", skin_info);
}
private function loadSkin():void{
infoText.text = "Loading Skin...";
var url:String = (toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 115, 99, 111, 114, 101, 47, 115, 107, 105, 110, 47, 115, 107, 105, 110, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + gamezheroCode_skin);
var request:URLRequest = new URLRequest(url);
try {
loader_skin.load(request);
addChild(loader_skin);
} catch(e:Error) {
infoText.text = "Error Loading Skin...";
errorAction();
};
}
public function submitAction(_arg1:String=""):void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(SUBMITED));
}
private function diactivateAllEvents():void{
loader_skin.contentLoaderInfo.removeEventListener(Event.INIT, skinLoaderInit);
loader_skin.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, skinLoaderError);
loader_engine.contentLoaderInfo.removeEventListener(Event.INIT, engineLoaderInit);
loader_engine.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, engineLoaderError);
reciveLocalConnection_skin.removeEventListener(StatusEvent.STATUS, onStatusReciveSkin);
reciveLocalConnection_skin.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveSkin);
sendLocalConnection_skin.removeEventListener(StatusEvent.STATUS, onStatusSendSkin);
sendLocalConnection_skin.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendSkin);
reciveLocalConnection_engine.removeEventListener(StatusEvent.STATUS, onStatusReciveEngine);
reciveLocalConnection_engine.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveEngine);
sendLocalConnection_engine.removeEventListener(StatusEvent.STATUS, onStatusSendEngine);
sendLocalConnection_engine.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendEngine);
}
private function onStatusReciveEngine(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Recive From Engine'";
break;
};
}
public function createInfoText():void{
infoText = new TextField();
infoText.autoSize = TextFieldAutoSize.LEFT;
var _local1:TextFormat = new TextFormat();
_local1.color = 0xFFFFFF;
_local1.size = 11;
_local1.font = "Arial";
infoText.defaultTextFormat = _local1;
this.addChild(infoText);
infoText.x = 10;
infoText.y = 10;
infoText.visible = false;
}
private function iniEvents():void{
loader_skin.contentLoaderInfo.addEventListener(Event.INIT, skinLoaderInit);
loader_skin.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, skinLoaderError);
loader_engine.contentLoaderInfo.addEventListener(Event.INIT, engineLoaderInit);
loader_engine.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, engineLoaderError);
reciveLocalConnection_skin.addEventListener(StatusEvent.STATUS, onStatusReciveSkin);
reciveLocalConnection_skin.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveSkin);
sendLocalConnection_skin.addEventListener(StatusEvent.STATUS, onStatusSendSkin);
sendLocalConnection_skin.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendSkin);
reciveLocalConnection_engine.addEventListener(StatusEvent.STATUS, onStatusReciveEngine);
reciveLocalConnection_engine.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveEngine);
sendLocalConnection_engine.addEventListener(StatusEvent.STATUS, onStatusSendEngine);
sendLocalConnection_engine.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendEngine);
}
private function engineLoaderError(_arg1:Event=null):void{
infoText.text = "Error Loading Engine...";
errorAction();
}
private function onStatusReciveSkin(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Recive From Skin'";
break;
};
}
private function engineLoaderInit(_arg1:Event=null):void{
infoText.text = "Check Engine Connection...";
var _local2:Timer = new Timer(200, 1);
_local2.addEventListener(TimerEvent.TIMER, checkEngine);
_local2.start();
}
private function onStatusSendEngine(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Send To Engine'";
break;
};
}
private function checkSkin(_arg1:TimerEvent=null):void{
sendLocalConnection_skin.send(sendNameConnection_skin, "skinIsOk");
}
private function iniLocalConnectionsSkin():void{
objListenerSkin = new Object();
objListenerSkin.skinOk = function ():void{
loadEngine();
};
objListenerSkin.submitAction = function (_arg1:String):void{
sendLocalConnection_engine.send(sendNameConnection_engine, toText([115, 101, 110, 100, 83, 99, 111, 114, 101]), _arg1);
};
objListenerSkin.errorInputActin = function ():void{
};
objListenerSkin.continueAction = function ():void{
continueAction();
};
var dom:String = toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
reciveLocalConnection_skin.allowInsecureDomain(dom);
reciveLocalConnection_skin.allowDomain(dom);
reciveLocalConnection_skin.client = objListenerSkin;
reciveLocalConnection_skin.connect(recivedNameConnection_skin);
sendLocalConnection_skin.allowInsecureDomain(dom);
sendLocalConnection_skin.allowDomain(dom);
}
private function onErrorReciveSkin(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function onStatusSendSkin(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Send To Skin'";
break;
};
}
private function onErrorSendSkin(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function skinLoaderInit(_arg1:Event=null):void{
infoText.text = "Check Skin Connection... ";
var _local2:Timer = new Timer(200, 1);
_local2.addEventListener(TimerEvent.TIMER, checkSkin);
_local2.start();
}
public function continueAction():void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(CONTINUE));
}
private function onErrorReciveEngine(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function sendScoreAction(_arg1:MouseEvent=null):void{
var _local2:URLRequest;
if (_loader_url != "null"){
_local2 = new URLRequest(_loader_url);
_local2.method = URLRequestMethod.POST;
_local2.data = _loader;
navigateToURL(_local2, "_blank");
_loader = new URLVariables();
_loader_url = "null";
submitAction();
};
}
private function toText(_arg1:Array):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
private function iniSubmitArea(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object):void{
goal = (_arg1 as MovieClip);
goal.addChild(this);
x_pos = _arg2;
y_pos = _arg3;
score_value = Math.abs(Math.round(_arg4));
skin_info = _arg5;
skin_info.score = score_value;
skin_info.gameName = GamezheroGlobal.gameName;
skin_info.gameCode = GamezheroGlobal.gameCode;
skin_info.domain = GamezheroGlobal.getDomain(goal.stage);
_indicator = new Indicator(goal);
_indicator.setSize(50, 50);
_indicator.setPos(30, 30);
createInfoText();
loadSkin();
}
private function deleteAll():void{
this.removeChild(infoText);
this.removeChild(loader_skin);
this.removeChild(loader_engine);
try {
_indicator.remove();
} catch(e:Error) {
};
goal.removeChild(this);
}
private function onErrorSendEngine(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function loadEngine():void{
infoText.text = "Loading Engine...";
var url:String = (toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 115, 99, 111, 114, 101, 47, 101, 110, 103, 105, 110, 101, 47, 101, 110, 103, 105, 110, 101, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + gamezheroCode_engine);
var request:URLRequest = new URLRequest(url);
try {
loader_engine.load(request);
addChild(loader_engine);
} catch(e:Error) {
infoText.text = "Error Loading Engine...";
errorAction();
};
}
public function errorAction():void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(ERROR));
}
private function iniLocalConnectionsEngine():void{
objListenerEngine = new Object();
objListenerEngine.engineOk = function ():void{
sendLocalConnection_engine.send(sendNameConnection_engine, "iniEngine", skin_info);
infoText.text = "Engine Connections...";
};
objListenerEngine.engineError = function ():void{
infoText.text = "Error Engine...";
};
objListenerEngine.submitActionDone = function (_arg1:Object):void{
sendScore(_arg1);
};
objListenerEngine.engineActivated = function ():void{
iniSkin();
};
var dom:String = toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
reciveLocalConnection_engine.allowDomain(dom);
reciveLocalConnection_engine.allowInsecureDomain(dom);
reciveLocalConnection_engine.client = objListenerEngine;
reciveLocalConnection_engine.connect(recivedNameConnection_engine);
sendLocalConnection_engine.allowDomain(dom);
sendLocalConnection_engine.allowInsecureDomain(dom);
}
private function moveAction(_arg1:MouseEvent=null):void{
}
private function sendScore(_arg1:Object):void{
var _local2:String;
_loader = new URLVariables();
_loader_url = _arg1.url;
for (_local2 in _arg1.vars) {
_loader[_local2] = _arg1.vars[_local2];
};
sendScoreAction();
}
private function checkEngine(_arg1:TimerEvent=null):void{
sendLocalConnection_engine.send(sendNameConnection_engine, "engineIsOk");
}
private function fromText(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
private function skinLoaderError(_arg1:Event=null):void{
infoText.text = "Error Loading Skin...";
errorAction();
}
}
}//package com.gamezhero.api.as3
Section 82
//UserInfo (com.gamezhero.api.as3.UserInfo)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.system.*;
import flash.external.*;
public class UserInfo {
public var flash_domain:String;
private var _stage:Stage;
public var ad_zone:String;// = "preloader"
public var flash_height:Number;
public var flash_vars:Object;
public var referrer:String;
public var flash_url:String;
public var browser:String;
public var href:String;
private var _goal:MovieClip;
public var flash_width:Number;
public var game_name:String;
public var api_version:String;// = "AS3 - v3.0"
public var publisher:String;// = "gamezhero"
public var capabilities:String;
public function UserInfo(_arg1:MovieClip){
var g = _arg1;
_goal = g;
try {
_stage = _goal.stage;
} catch(e:Error) {
};
super();
iniInfo();
}
private function iniInfo():void{
var i:String;
this["publisher"] = "gamezhero";
this["ad_zone"] = "preloader";
this["api_version"] = "AS3 - v3.0";
this["flash_vars"] = new Object();
this["capabilities"] = Capabilities.serverString;
if (ExternalInterface.available){
try {
this["href"] = ExternalInterface.call("function (){return document.location.href}");
} catch(e:Error) {
this["href"] = "-1";
};
try {
this["browser"] = ExternalInterface.call("function (){var st = ''; for (i in navigator){ if (typeof(navigator[i])!='function'){ st+=i+'='+navigator[i]+'&'; }} return st}");
} catch(e:Error) {
this["browser"] = "-1";
};
try {
this["referrer"] = ExternalInterface.call("function (){return document.referrer}");
} catch(e:Error) {
this["referrer"] = "-1";
};
} else {
this["href"] = "-1";
this["browser"] = "-1";
this["referrer"] = "-1";
};
this["game_name"] = GamezheroGlobal.gameName;
this["flash_domain"] = GamezheroGlobal.getDomain();
try {
this["flash_width"] = _stage.stageWidth;
this["flash_height"] = _stage.stageHeight;
this["flash_url"] = _stage.root.loaderInfo.url;
} catch(e:Error) {
};
try {
for (i in _stage.root.loaderInfo.parameters) {
this["flash_vars"][i] = _stage.root.loaderInfo.parameters[i];
};
} catch(e:Error) {
};
}
}
}//package com.gamezhero.api.as3
Section 83
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function isEmpty():Boolean{
return (_empty);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 84
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
}
}//package com.google.analytics.campaign
Section 85
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local4:CampaignTracker;
var _local8:CampaignTracker;
var _local9:int;
var _local3:CampaignInfo = new CampaignInfo();
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
var _local3:Variables = new Variables(_arg1);
var _local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker = getOrganicCampaign();
var _local3:CampaignTracker = new CampaignTracker();
var _local4:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
var _local5:Variables = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3:String = _local2.hostName;
var _local4:String = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 86
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){
this.id = _arg1;
this.source = _arg2;
this.clickId = _arg3;
this.name = _arg4;
this.medium = _arg5;
this.term = _arg6;
this.content = _arg7;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var _local1:Array = [];
_addIfNotEmpty(_local1, "utmcid=", id);
_addIfNotEmpty(_local1, "utmcsr=", source);
_addIfNotEmpty(_local1, "utmgclid=", clickId);
_addIfNotEmpty(_local1, "utmccn=", name);
_addIfNotEmpty(_local1, "utmcmd=", medium);
_addIfNotEmpty(_local1, "utmctr=", term);
_addIfNotEmpty(_local1, "utmcct=", content);
return (_local1.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{
if (_arg3 != ""){
_arg3 = _arg3.split("+").join("%20");
_arg3 = _arg3.split(" ").join("%20");
_arg1.push((_arg2 + _arg3));
};
}
public function fromTrackerString(_arg1:String):void{
var _local2:String = _arg1.split(CampaignManager.trackingDelimiter).join("&");
var _local3:Variables = new Variables(_local2);
if (_local3.hasOwnProperty("utmcid")){
this.id = _local3["utmcid"];
};
if (_local3.hasOwnProperty("utmcsr")){
this.source = _local3["utmcsr"];
};
if (_local3.hasOwnProperty("utmccn")){
this.name = _local3["utmccn"];
};
if (_local3.hasOwnProperty("utmcmd")){
this.medium = _local3["utmcmd"];
};
if (_local3.hasOwnProperty("utmctr")){
this.term = _local3["utmctr"];
};
if (_local3.hasOwnProperty("utmcct")){
this.content = _local3["utmcct"];
};
if (_local3.hasOwnProperty("utmgclid")){
this.clickId = _local3["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 87
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 88
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _data:Object;
private var _OBJ:Object;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _utma:UTMA;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmx:UTMX;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){
var _local5:String;
super();
_config = _arg1;
_debug = _arg2;
_data = _arg4;
_volatile = _arg3;
if (_volatile){
_OBJ = new Object();
if (_data){
for (_local5 in _data) {
_OBJ[_local5] = _data[_local5];
};
};
};
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
try {
flushStatus = _SO.flush();
} catch(e:Error) {
_debug.warning("Error...Could not write SharedObject to disk");
};
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmx():UTMX{
if (!hasUTMX()){
_createUMTX();
};
return (_utmx);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
var _local3:String = toLinkerParams();
var _local4:String = _arg1;
var _local5:Array = _arg1.split("#");
if (_local3){
if (_arg2){
if (1 >= _local5.length){
_local4 = (_local4 + ("#" + _local3));
} else {
_local4 = (_local4 + ("&" + _local3));
};
} else {
if (1 >= _local5.length){
if (_arg1.indexOf("?") > -1){
_local4 = (_local4 + "&");
} else {
_local4 = (_local4 + "?");
};
_local4 = (_local4 + _local3);
} else {
_local4 = _local5[0];
if (_arg1.indexOf("?") > -1){
_local4 = (_local4 + "&");
} else {
_local4 = (_local4 + "?");
};
_local4 = (_local4 + ((_local3 + "#") + _local5[1]));
};
};
};
return (_local4);
}
public function generateCookiesHash():Number{
var _local1 = "";
_local1 = (_local1 + utma.valueOf());
_local1 = (_local1 + utmb.valueOf());
_local1 = (_local1 + utmc.valueOf());
_local1 = (_local1 + utmx.valueOf());
_local1 = (_local1 + utmz.valueOf());
_local1 = (_local1 + utmv.valueOf());
return (Utils.generateHash(_local1));
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMX():Boolean{
if (_utmx){
return (true);
};
return (false);
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _createUMTX():void{
_utmx = new UTMX();
_utmx.proxy = this;
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(_arg1:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = _arg1;
};
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
private function _onFlushStatus(_arg1:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
public function toLinkerParams():String{
var _local1 = "";
_local1 = (_local1 + utma.toURLString());
_local1 = (_local1 + ("&" + utmb.toURLString()));
_local1 = (_local1 + ("&" + utmc.toURLString()));
_local1 = (_local1 + ("&" + utmx.toURLString()));
_local1 = (_local1 + ("&" + utmz.toURLString()));
_local1 = (_local1 + ("&" + utmv.toURLString()));
_local1 = (_local1 + ("&__utmk=" + generateCookiesHash()));
return (_local1);
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(_arg1:String, _arg2):void{
if (isVolatile()){
_OBJ[_arg1] = _arg2;
} else {
_SO.data[_arg1] = _arg2;
};
}
public function createSO():void{
var saveSO:Boolean;
UTMZ.defaultTimespan = _config.conversionTimeout;
UTMB.defaultTimespan = _config.sessionTimeout;
if (!_volatile){
try {
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
} catch(e:Error) {
if (_debug.active){
_debug.warning(((("Shared Object " + _config.cookieName) + " failed to be set\nreason: ") + e.message));
};
};
saveSO = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
saveSO = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
saveSO = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
saveSO = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (!hasUTMX()){
_createUMTX();
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
saveSO = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
saveSO = true;
};
};
if (saveSO){
save();
};
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 89
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
public class DocumentInfo {
private var _pageURL:String;
private var _utmr:String;
private var _config:Configuration;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String = _info.locationPath;
var _local3:String = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
if (_arg1 == ""){
_arg1 = "/";
};
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 90
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){
_debug = _arg3;
if (_arg1 == null){
_arg1 = DomainNameMode.auto;
};
_mode = _arg1;
if (_arg1 == DomainNameMode.custom){
this.name = _arg2;
} else {
_name = _arg2;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(_arg1:DomainNameMode):void{
_mode = _arg1;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(_arg1:String):void{
if (((!((_arg1.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek);
};
_name = _arg1;
}
}
}//package com.google.analytics.core
Section 91
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 92
//Ecommerce (com.google.analytics.core.Ecommerce)
package com.google.analytics.core {
import com.google.analytics.debug.*;
import com.google.analytics.ecommerce.*;
public class Ecommerce {
private var _debug:DebugConfiguration;
private var _trans:Array;
public function Ecommerce(_arg1:DebugConfiguration){
this._debug = _arg1;
_trans = new Array();
}
public function getTransLength():Number{
return (_trans.length);
}
public function getTransFromArray(_arg1:Number):Transaction{
return (_trans[_arg1]);
}
public function addTransaction(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String, _arg8:String):Transaction{
var _local9:Transaction;
_local9 = getTransaction(_arg1);
if (_local9 == null){
_local9 = new Transaction(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
_trans.push(_local9);
} else {
_local9.affiliation = _arg2;
_local9.total = _arg3;
_local9.tax = _arg4;
_local9.shipping = _arg5;
_local9.city = _arg6;
_local9.state = _arg7;
_local9.country = _arg8;
};
return (_local9);
}
public function getTransaction(_arg1:String):Transaction{
var _local2:Number;
_local2 = 0;
while (_local2 < _trans.length) {
if (_trans[_local2].id == _arg1){
return (_trans[_local2]);
};
_local2++;
};
return (null);
}
}
}//package com.google.analytics.core
Section 93
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.data.*;
import com.google.analytics.utils.*;
public class EventInfo {
private var _ext10:X10;
private var _isEventHit:Boolean;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 94
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 95
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 96
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.utils.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_info = _arg4;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(_arg1:IOErrorEvent):void{
var _local2:String = _lastRequest.url;
var _local3:String = String((_requests.length - 1));
var _local4 = (("Gif Request #" + _local3) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local2.indexOf("?") > -1){
_local2 = _local2.split("?")[0];
};
_local2 = _shortenURL(_local2);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable"));
};
_debug.failure(_local4);
} else {
_debug.warning(_local4);
};
_removeListeners(_arg1.target);
}
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:String;
var _local6:URLRequest;
var _local7:URLRequest;
_utmac = _arg1;
if (!_arg2){
_arg2 = new Variables();
};
_arg2.URIencode = false;
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
_arg2.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){
if (_arg4){
updateToken();
};
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){
if (((!(_arg3)) && (_arg4))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
_arg2.utmwv = utmwv;
_arg2.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
_arg2.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
_arg2.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
_local5 = _info.locationSWFPath;
if (_local5.lastIndexOf("/") > 0){
_local5 = _local5.substring(0, _local5.lastIndexOf("/"));
};
_local6 = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
_local6.url = _config.localGIFpath;
} else {
_local6.url = (_local5 + _config.localGIFpath);
};
_local6.url = (_local6.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local6);
} else {
sendRequest(_local6);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
_local7 = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
_local7.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
_local7.url = _config.remoteGIFpath;
} else {
_local7.url = _config.remoteGIFpath;
};
};
_arg2.utmac = utmac;
_arg2.utmcc = encodeURIComponent(utmcc);
_local7.url = (_local7.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local7);
} else {
sendRequest(_local7);
};
};
};
};
}
public function onSecurityError(_arg1:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(_arg1.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var _local1:Array = [];
if (_buffer.hasUTMA()){
_local1.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
_local1.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
_local1.push((_buffer.utmv.toURLString() + ";"));
};
return (_local1.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(_arg1:URLRequest):void{
var request = _arg1;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
try {
loader.load(request, context);
} catch(e:Error) {
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
};
}
private function _removeListeners(_arg1:Object):void{
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_arg1.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var _local2:Number;
var _local1:Number = new Date().getTime();
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek);
};
if (_local2 >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity);
_buffer.utmb.lastTime = _local1;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(_arg1:String):String{
var _local2:Array;
if (_arg1.length > 60){
_local2 = _arg1.split("/");
while (_arg1.length > 60) {
_local2.shift();
_arg1 = ("../" + _local2.join("/"));
};
};
return (_arg1);
}
private function _debugSend(_arg1:URLRequest):void{
var _local3:String;
var _local2 = "";
switch (_debug.mode){
case VisualDebugMode.geek:
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url);
break;
case VisualDebugMode.advanced:
_local3 = _arg1.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(_local2, _arg1, this);
_alertcount++;
}
public function onComplete(_arg1:Event):void{
var _local2:String = _arg1.target.loader.name;
_requests[_local2].complete();
var _local3 = (("Gif Request #" + _local2) + " sent");
var _local4:String = _requests[_local2].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local4.indexOf("?") > -1){
_local4 = _local4.split("?")[0];
};
_local4 = _shortenURL(_local4);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local3 = (_local3 + ((" to \"" + _local4) + "\""));
};
_debug.success(_local3);
} else {
_debug.info(_local3);
};
_removeListeners(_arg1.target);
}
}
}//package com.google.analytics.core
Section 97
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.utils.*;
public class IdleTimer {
private var _stage:Stage;
private var _loop:Timer;
private var _lastMove:int;
private var _inactivity:Number;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number = _arg1.idleLoop;
var _local6:Number = _arg1.idleTimeout;
var _local7:Number = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 98
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get count():int{
return (_sources.length);
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 99
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 100
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var end:int;
public var request:URLRequest;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var _local1:Array = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function complete():void{
end = getTimer();
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
}
}//package com.google.analytics.core
Section 101
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 102
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){
this.tracker = _arg1;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:int;
if (tracker == null){
return;
};
if (size() > 0){
_local4 = _ar.length;
while (_local5 < _local4) {
_local1 = _ar.shift();
_local2 = (_local1.name as String);
_local3 = (_local1.args as Array);
if (((!((_local2 == null))) && ((_local2 in tracker)))){
(tracker[_local2] as Function).apply(tracker, _local3);
};
_local5++;
};
};
}
public function enqueue(_arg1:String, ... _args):Boolean{
if (_arg1 == null){
return (false);
};
_ar.push({name:_arg1, args:_args});
return (true);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
enqueue("link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
enqueue("addOrganic", _arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
enqueue("setAllowLinker", _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4);
return (true);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLinkerUrl' method for the moment."));
};
return ("");
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(_arg1:String=""):void{
enqueue("trackPageview", _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
enqueue("setClientInfo", _arg1);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
enqueue("linkByPost", _arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
enqueue("setCookieTimeout", _arg1);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(_arg1:Boolean):void{
enqueue("setDetectFlash", _arg1);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(_arg1:String):void{
enqueue("setCampNameKey", _arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function createEventTracker(_arg1:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setVar(_arg1:String):void{
enqueue("setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
enqueue("setDomainName", _arg1);
}
public function setCampSourceKey(_arg1:String):void{
enqueue("setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
}
public function setCampContentKey(_arg1:String):void{
enqueue("setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(_arg1:Boolean):void{
enqueue("setAllowAnchor", _arg1);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(_arg1:String):void{
enqueue("setLocalGifPath", _arg1);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(_arg1:String):void{
enqueue("setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
enqueue("setSampleRate", _arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
enqueue("setDetectTitle", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
enqueue("setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
enqueue("addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
enqueue("setCampNOKey", _arg1);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(_arg1:String):void{
enqueue("cookiePathCopy", _arg1);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(_arg1:Boolean):void{
enqueue("setCampaignTrack", _arg1);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
enqueue("setCampTermKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
enqueue("addIgnoredRef", _arg1);
}
public function setCampMediumKey(_arg1:String):void{
enqueue("setCampMediumKey", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
enqueue("setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 103
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 104
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
var _local3:Array = [" ", "\n", "\r", "\t"];
var _local4:String = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local4:int;
var _local5:int;
var _local2 = 1;
var _local3:int;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 105
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(_arg1:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(_arg1:Date):void;
function set expiration(_arg1:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 106
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.sessionId = _arg2;
this.firstTime = _arg3;
this.lastTime = _arg4;
this.currentTime = _arg5;
this.sessionCount = _arg6;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function set currentTime(_arg1:Number):void{
_currentTime = _arg1;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set sessionId(_arg1:Number):void{
_sessionId = _arg1;
update();
}
public function set sessionCount(_arg1:Number):void{
_sessionCount = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(_arg1:Number):void{
_firstTime = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 107
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.trackCount = _arg2;
this.token = _arg3;
this.lastTime = _arg4;
}
public function set token(_arg1:Number):void{
_token = _arg1;
update();
}
public function set trackCount(_arg1:Number):void{
_trackCount = _arg1;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 108
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 109
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
protected var fields:Array;
private var _timespan:Number;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local2:String;
var _local1:int;
var _local3:int;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var _local1:String;
var _local2:int;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int = fields.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date = new Date();
var _local2:Number = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var _local2:String;
var _local3:*;
var _local4:Array;
var _local1:Array = [];
var _local5 = "";
var _local6:int;
while (_local6 < fields.length) {
_local2 = fields[_local6];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local6++;
};
if (isEmpty()){
return ("-");
};
return (("" + _local1.join(".")));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toSharedObject():Object{
var _local2:String;
var _local3:*;
var _local1:Object = {};
var _local4:int;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local3:String;
var _local4:*;
var _local2:Array = [];
var _local5:int = fields.length;
var _local6:int;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
var _local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 110
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(_arg1:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = _arg1;
}
public function set hash(_arg1:Number):void{
_hash = _arg1;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 111
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(_arg1:Number=NaN, _arg2:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.value = _arg2;
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set value(_arg1:String):void{
_value = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 112
//UTMX (com.google.analytics.data.UTMX)
package com.google.analytics.data {
public class UTMX extends UTMCookie {
private var _value:String;
public function UTMX(){
super("utmx", "__utmx", ["value"], 0);
_value = "-";
}
public function get value():String{
return (_value);
}
public function set value(_arg1:String):void{
_value = _arg1;
}
}
}//package com.google.analytics.data
Section 113
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.campaignCreation = _arg2;
this.campaignSessions = _arg3;
this.responseCount = _arg4;
this.campaignTracking = _arg5;
}
public function set responseCount(_arg1:Number):void{
_responseCount = _arg1;
update();
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set campaignCreation(_arg1:Number):void{
_campaignCreation = _arg1;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(_arg1:Number):void{
_campaignSessions = _arg1;
update();
}
public function set campaignTracking(_arg1:String):void{
_campaignTracking = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 114
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _minimum:int;
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _projectData:Object;
private var _value:String;// = "v"
public function X10(){
_set = [_key, _value];
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
private function _renderProject(_arg1:Object):String{
var _local4:int;
var _local5:Array;
var _local2 = "";
var _local3:Boolean;
var _local6:int = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local3:String;
var _local4:int;
var _local2:Array = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
var _local2:Array = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local2:String;
var _local1:Array = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:* = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local3:int;
var _local4:String;
var _local5:String;
var _local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 115
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.net.*;
import flash.text.*;
public class _Style {
public var failureColor:uint;
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var warningColor:uint;
public var infoColor:uint;
public var alertColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
private var _defaultSheet:String;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 116
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var autoClose:Boolean;// = true
public var actionOnNextLine:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
var _local8:int;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
private function _defineActions():void{
var _local3:AlertAction;
var _local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
var _local2:Array = [];
var _local4:int;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
protected function spaces(_arg1:int):String{
var _local2 = "";
var _local3 = " ";
var _local4:int;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 117
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var activator:String;
public var name:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 118
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 119
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 120
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint;
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){
if (_arg2 == null){
_arg2 = Align.bottom;
};
super("", "uiLabel", _arg1, _arg2, _arg3);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(_arg1:String):void{
write(_arg1, true);
}
private function _getLinesToDisplay(_arg1:int=0):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + _arg1);
} else {
if ((((_linediff > 0)) && ((_arg1 < 0)))){
_linediff = (_linediff + _arg1);
};
};
_local3 = ((_lines.length - maxLines) + _linediff);
_local4 = (_local3 + maxLines);
_local2 = _lines.slice(_local3, _local4);
} else {
_local2 = _lines;
};
return (_local2);
}
private function onKey(_arg1:KeyboardEvent=null):void{
var _local2:Array;
switch (_arg1.keyCode){
case Keyboard.DOWN:
_local2 = _getLinesToDisplay(1);
break;
case Keyboard.UP:
_local2 = _getLinesToDisplay(-1);
break;
default:
_local2 = null;
};
if (_local2 == null){
return;
};
text = _local2.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
} else {
};
return (!NULL!);
}
public function write(_arg1:String, _arg2:Boolean=false):void{
var _local3:Array;
if (_arg1.indexOf("") > -1){
_local3 = _arg1.split("\n");
} else {
_local3 = [_arg1];
};
var _local4 = "";
var _local5 = "";
if (_arg2){
_local4 = "<b>";
_local5 = "</b>";
};
var _local6:int;
while (_local6 < _local3.length) {
_lines.push(((_local4 + _local3[_local6]) + _local5));
_local6++;
};
var _local7:Array = _getLinesToDisplay();
text = _local7.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 121
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import com.google.analytics.core.*;
import flash.net.*;
import flash.utils.*;
public class DebugConfiguration {
public var showHideKey:Number;// = 32
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;// = 8
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(_arg1:Boolean):void{
_verbose = _arg1;
}
public function set mode(_arg1):void{
if ((_arg1 is String)){
switch (_arg1){
case "geek":
_arg1 = VisualDebugMode.geek;
break;
case "advanced":
_arg1 = VisualDebugMode.advanced;
break;
case "basic":
default:
_arg1 = VisualDebugMode.basic;
};
};
_mode = _arg1;
}
public function success(_arg1:String):void{
if (layout){
layout.createSuccessAlert(_arg1);
};
if (traceOutput){
trace((("[+] " + _arg1) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(_arg1);
};
if (traceOutput){
trace((("## " + _arg1) + " ##"));
};
}
private function _filter(_arg1:VisualDebugMode=null):Boolean{
return (((_arg1) && ((int(_arg1) >= int(this.mode)))));
}
public function failure(_arg1:String):void{
if (layout){
layout.createFailureAlert(_arg1);
};
if (traceOutput){
trace((("[-] " + _arg1) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(_arg1:String):void{
var _local7:Array;
var _local8:int;
var _local2:Array = [];
var _local3 = "";
var _local4 = "";
if (this.mode == VisualDebugMode.geek){
_local3 = (getTimer() + " - ");
_local4 = (new Array(_local3.length).join(" ") + " ");
};
if (_arg1.indexOf("\n") > -1){
_local7 = _arg1.split("\n");
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] == ""){
} else {
if (_local8 == 0){
_local2.push((_local3 + _local7[_local8]));
} else {
_local2.push((_local4 + _local7[_local8]));
};
};
_local8++;
};
} else {
_local2.push((_local3 + _arg1));
};
var _local5:int = _local2.length;
var _local6:int;
while (_local6 < _local5) {
trace(_local2[_local6]);
_local6++;
};
}
public function alert(_arg1:String):void{
if (layout){
layout.createAlert(_arg1);
};
if (traceOutput){
trace((("!! " + _arg1) + " !!"));
};
}
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(_arg1);
};
if (traceOutput){
trace(_arg1);
};
}
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(_arg1, _arg2, _arg3);
};
if (traceOutput){
trace(((">> " + _arg1) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 122
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 123
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 124
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
public interface ILayout {
function createAlert(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(_arg1:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 125
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 126
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = _arg1;
_tag = _arg2;
if (_arg4 == null){
_arg4 = Align.none;
};
this.alignement = _arg4;
this.stickToEdge = _arg5;
if (_arg3 == 0){
_arg3 = Style.backgroundColor;
};
_color = _arg3;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var _local1:Graphics = _background.graphics;
_local1.clear();
_local1.beginFill(_color);
var _local2:uint = _textField.width;
var _local3:uint = _textField.height;
if (forcedWidth > 0){
_local2 = forcedWidth;
};
Background.drawRounded(this, _local1, _local2, _local3);
_local1.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(_arg1:String, _arg2:String=""):void{
if (_arg1 == ""){
return;
};
if (_arg2 == ""){
_arg2 = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>"));
_text = (_text + _arg1);
_draw();
resize();
}
public function set text(_arg1:String):void{
if (_arg1 == ""){
_arg1 = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>");
_text = _arg1;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(_arg1:String):void{
_tag = _arg1;
text = "";
}
public function onLink(_arg1:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 127
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){
_display = _arg2;
_debug = _arg1;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(_arg1:KeyboardEvent=null):void{
switch (_arg1.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(_arg1:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasWarning = true;
var _local2:Warning = new Warning(_arg1, _debug.warningTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function bringToFront(_arg1:DisplayObject):void{
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1));
}
public function createFailureAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new FailureAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function init():void{
var _local1 = 10;
var _local2:uint = (_display.stage.stageWidth - (_local1 * 2));
var _local3:uint = (_display.stage.stageHeight - (_local1 * 2));
var _local4:Panel = new Panel("analytics", _local2, _local3);
_local4.alignement = Align.top;
_local4.stickToEdge = false;
_local4.title = ("Google Analytics v" + GATracker.version);
_mainPanel = _local4;
addToStage(_local4);
bringToFront(_local4);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{
var _local4:Panel;
var _local3:DisplayObject = _display.stage.getChildByName(_arg1);
if (_local3){
_local4 = (_local3 as Panel);
_local4.addData(_arg2);
} else {
trace((("panel \"" + _arg1) + "\" not found"));
};
}
private function _clearInfo(_arg1:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{
var _local6:String;
var _local3 = "\n";
var _local4:Array = [];
var _local5:Array = _arg1.split(_local3);
if (_arg2 == 0){
_arg2 = _maxCharPerLine;
};
var _local7:int;
while (_local7 < _local5.length) {
_local6 = _local5[_local7];
while (_local6.length > _arg2) {
_local4.push(_local6.substr(0, _arg2));
_local6 = _local6.substring(_arg2);
};
_local4.push(_local6);
_local7++;
};
return (_local4.join(_local3));
}
private function _clearGRAlert(_arg1:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new SuccessAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(_arg1:String):void{
_arg1 = _filterMaxChars(_arg1);
var _local2:Alert = new Alert(_arg1, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", _local2);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function createInfo(_arg1:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasInfo = true;
var _local2:Info = new Info(_arg1, _debug.infoTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(_arg1);
};
}
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
var message = _arg1;
var request = _arg2;
var ref = _arg3;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(_arg1:DisplayObject):void{
_display.stage.addChild(_arg1);
}
private function _clearWarning(_arg1:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{
var _local4:Panel = new Panel(_arg1, _arg2, _arg3);
_local4.alignement = Align.center;
_local4.stickToEdge = false;
addToStage(_local4);
bringToFront(_local4);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 128
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var top:int;
public var left:int;
public var bottom:int;
public var right:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 129
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){
_name = _arg1;
this.name = _arg1;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = _arg2;
forcedHeight = _arg3;
this.baseAlpha = _arg6;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = _arg2;
_data.forcedHeight = _arg3;
_data.mouseEnabled = false;
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (_arg7 == null){
_arg7 = Align.none;
};
this.alignement = _arg7;
this.stickToEdge = _arg8;
if (_arg4 == 0){
_arg4 = Style.backgroundColor;
};
_backgroundColor = _arg4;
if (_arg5 == 0){
_arg5 = Style.borderColor;
};
_borderColor = _arg5;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(_arg1:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(_arg1:Boolean):void{
_stickToEdge = _arg1;
_title.stickToEdge = _arg1;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var _local1:uint;
var _local2:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
_local1 = forcedWidth;
_local2 = forcedHeight;
} else {
_local1 = _title.width;
_local2 = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = _local1;
forcedHeight = _local2;
};
var _local3:Graphics = _background.graphics;
_local3.clear();
_local3.beginFill(_backgroundColor);
Background.drawRounded(this, _local3, _local1, _local2);
_local3.endFill();
var _local4:Graphics = _data.graphics;
_local4.clear();
_local4.beginFill(_backgroundColor, 0);
Background.drawRounded(this, _local4, _local1, _local2);
_local4.endFill();
var _local5:Graphics = _border.graphics;
_local5.clear();
_local5.lineStyle(0.1, _borderColor);
Background.drawRounded(this, _local5, _local1, _local2);
_local5.endFill();
var _local6:Graphics = _mask.graphics;
_local6.clear();
_local6.beginFill(_backgroundColor);
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1));
_local6.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(_arg1:DisplayObject):void{
_data.addChild(_arg1);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(_arg1:String):void{
_title.text = _arg1;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 130
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 131
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 132
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class UISprite extends Sprite {
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedHeight:uint;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
protected function onResize(_arg1:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 133
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 134
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 135
//Item (com.google.analytics.ecommerce.Item)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Item {
private var _price:String;
private var _id:String;
private var _sku:String;
private var _category:String;
private var _quantity:String;
private var _name:String;
public function Item(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String){
this._id = _arg1;
this._sku = _arg2;
this._name = _arg3;
this._category = _arg4;
this._price = _arg5;
this._quantity = _arg6;
}
public function set sku(_arg1:String):void{
_sku = _arg1;
}
public function get price():String{
return (_price);
}
public function get name():String{
return (_name);
}
public function get quantity():String{
return (_quantity);
}
public function set name(_arg1:String):void{
_name = _arg1;
}
public function set price(_arg1:String):void{
_price = _arg1;
}
public function get id():String{
return (_id);
}
public function get sku():String{
return (_sku);
}
public function set quantity(_arg1:String):void{
_quantity = _arg1;
}
public function toGifParams():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.post = ["utmt", "utmtid", "utmipc", "utmipn", "utmiva", "utmipr", "utmiqt"];
_local1.utmt = "item";
_local1.utmtid = _id;
_local1.utmipc = _sku;
_local1.utmipn = _name;
_local1.utmiva = _category;
_local1.utmipr = _price;
_local1.utmiqt = _quantity;
return (_local1);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function set category(_arg1:String):void{
_category = _arg1;
}
public function get category():String{
return (_category);
}
}
}//package com.google.analytics.ecommerce
Section 136
//Transaction (com.google.analytics.ecommerce.Transaction)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Transaction {
private var _items:Array;
private var _total:String;
private var _vars:Variables;
private var _shipping:String;
private var _city:String;
private var _state:String;
private var _country:String;
private var _tax:String;
private var _affiliation:String;
private var _id:String;
public function Transaction(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String, _arg8:String){
this._id = _arg1;
this._affiliation = _arg2;
this._total = _arg3;
this._tax = _arg4;
this._shipping = _arg5;
this._city = _arg6;
this._state = _arg7;
this._country = _arg8;
_items = new Array();
}
public function get total():String{
return (_total);
}
public function getItemFromArray(_arg1:Number):Item{
return (_items[_arg1]);
}
public function set total(_arg1:String):void{
_total = _arg1;
}
public function getItem(_arg1:String):Item{
var _local2:Number;
_local2 = 0;
while (_local2 < _items.length) {
if (_items[_local2].sku == _arg1){
return (_items[_local2]);
};
_local2++;
};
return (null);
}
public function getItemsLength():Number{
return (_items.length);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String):void{
var _local6:Item;
_local6 = getItem(_arg1);
if (_local6 == null){
_local6 = new Item(_id, _arg1, _arg2, _arg3, _arg4, _arg5);
_items.push(_local6);
} else {
_local6.name = _arg2;
_local6.category = _arg3;
_local6.price = _arg4;
_local6.quantity = _arg5;
};
}
public function set shipping(_arg1:String):void{
_shipping = _arg1;
}
public function get country():String{
return (_country);
}
public function get state():String{
return (_state);
}
public function set tax(_arg1:String):void{
_tax = _arg1;
}
public function set affiliation(_arg1:String):void{
_affiliation = _arg1;
}
public function set state(_arg1:String):void{
_state = _arg1;
}
public function get id():String{
return (_id);
}
public function get tax():String{
return (_tax);
}
public function toGifParams():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmt = "tran";
_local1.utmtid = id;
_local1.utmtst = affiliation;
_local1.utmtto = total;
_local1.utmttx = tax;
_local1.utmtsp = shipping;
_local1.utmtci = city;
_local1.utmtrg = state;
_local1.utmtco = country;
_local1.post = ["utmtid", "utmtst", "utmtto", "utmttx", "utmtsp", "utmtci", "utmtrg", "utmtco"];
return (_local1);
}
public function get affiliation():String{
return (_affiliation);
}
public function get city():String{
return (_city);
}
public function get shipping():String{
return (_shipping);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function set city(_arg1:String):void{
_city = _arg1;
}
public function set country(_arg1:String):void{
_country = _arg1;
}
}
}//package com.google.analytics.ecommerce
Section 137
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 138
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 139
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _language:String;
private var _host:String;
private var _pathname:String;
private var _location:String;
private var _search:String;
private var _characterSet:String;
private var _title:String;
private var _protocol:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function cacheProperties():void{
if (!isAvailable()){
return;
};
var _local1:Object = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
}
}//package com.google.analytics.external
Section 140
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.system.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 141
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
var _local2:String = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local4:String;
var _local5:String;
var _local1:Protocols = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _local2:String = _dom.protocol;
var _local3:String = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String = _dom.language;
var _local2:String = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 142
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 143
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
}
}//package com.google.analytics.utils
Section 144
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(_arg1:String=""){
_url = _arg1.toLowerCase();
}
public function get domain():String{
var _local1:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
_local1 = hostName.split(".");
switch (_local1.length){
case 2:
return (hostName);
case 3:
if (_local1[1] == "co"){
return (hostName);
};
_local1.shift();
return (_local1.join("."));
case 4:
_local1.shift();
return (_local1.join("."));
};
};
return ("");
}
public function get path():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if (_local1.charAt(0) != "/"){
_local1 = ("/" + _local1);
};
return (_local1);
}
public function get protocol():Protocols{
var _local1:String = _url.split("://")[0];
switch (_local1){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf("/") > -1){
_local1 = _local1.split("/")[0];
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (_local1);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[1];
} else {
_local1 = "";
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 145
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _localInfo:Environment;
private var _applicationProduct:String;
private var _version:Version;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get vendorProductToken():String{
var _local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProductToken():String{
var _local1:String = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 146
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){
pre = [];
post = [];
super();
if (_arg1){
decode(_arg1);
};
if (_arg2){
this.pre = _arg2;
};
if (_arg3){
this.post = _arg3;
};
}
private function _join(_arg1:Variables):void{
var _local2:String;
if (!_arg1){
return;
};
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function join(... _args):void{
var _local2:int = _args.length;
var _local3:int;
while (_local3 < _local2) {
if (!(_args[_local3] is Variables)){
} else {
_join(_args[_local3]);
};
_local3++;
};
}
public function toString():String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local1:Array = [];
for (_local3 in this) {
_local2 = this[_local3];
if (URIencode){
_local2 = encodeURI(_local2);
};
_local1.push(((_local3 + "=") + _local2));
};
if (sort){
_local1.sort();
};
if (pre.length > 0){
pre.reverse();
_local5 = 0;
while (_local5 < pre.length) {
_local7 = pre[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local7) == 0){
_local1.unshift(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
pre.reverse();
};
if (post.length > 0){
_local5 = 0;
while (_local5 < post.length) {
_local8 = post[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local8) == 0){
_local1.push(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
};
return (_local1.join("&"));
}
public function decode(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Array;
if (_arg1 == ""){
return;
};
if (_arg1.charAt(0) == "?"){
_arg1 = _arg1.substr(1, _arg1.length);
};
if (_arg1.indexOf("&") > -1){
_local2 = _arg1.split("&");
} else {
_local2 = [_arg1];
};
var _local7:int;
while (_local7 < _local2.length) {
_local3 = _local2[_local7];
if (_local3.indexOf("=") > -1){
_local6 = _local3.split("=");
_local4 = _local6[0];
_local5 = decodeURI(_local6[1]);
this[_local4] = _local5;
};
_local7++;
};
}
public function toURLVariables():URLVariables{
var _local2:String;
var _local1:URLVariables = new URLVariables();
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 147
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _revision:uint;
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _major:uint;
private var _minor:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var _local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local4:Array;
var _local3:Version = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 148
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){
var _local4:String;
var _local5:String;
var _local6:String;
super();
_account = _arg1;
_debug = _arg2;
_proxy = _arg3;
if (!_checkGAJS()){
_local4 = "";
_local4 = (_local4 + "ga.js not found, be sure to check if\n");
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
_local4 = (_local4 + "is included in the HTML.");
_debug.warning(_local4);
throw (new Error(_local4));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
_local5 = "";
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n");
_local5 = (_local5 + "we create it");
_debug.info(_local5, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(_arg1)){
_createTrackingObject(_arg1);
} else {
if (_checkTrackingObject(_arg1)){
_linkTrackingObject(_arg1);
} else {
_local6 = "";
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n"));
_local6 = (_local6 + "Bridge object not created.");
_debug.warning(_local6);
throw (new Error(_local6));
};
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )"));
_call("_link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_call("_addOrganic", _arg1);
}
public function setAllowLinker(_arg1:Boolean):void{
_debug.info((("setAllowLinker( " + _arg1) + " )"));
_call("_setAllowLinker", _arg1);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
_debug.info((((("getLinkerUrl(" + _arg1) + ", ") + _arg2) + ")"));
return (_call("_getLinkerUrl", _arg1, _arg2));
}
private function _linkTrackingObject(_arg1:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_debug.info((("setClientInfo( " + _arg1) + " )"));
_call("_setClientInfo", _arg1);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5 = 2;
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = 3;
};
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){
_local5 = 4;
};
switch (_local5){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4));
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3));
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2));
};
}
public function setCookieTimeout(_arg1:int):void{
_debug.info((("setCookieTimeout( " + _arg1) + " )"));
_call("_setCookieTimeout", _arg1);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
_call("_trackPageview", _arg1);
}
private function _checkValidTrackingObject(_arg1:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, _arg1));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented"));
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _call(_arg1:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(_arg1:String):Boolean{
var _local2:Boolean = _proxy.hasProperty(_arg1);
var _local3:Boolean = _proxy.hasProperty((_arg1 + "._getAccount"));
return (((_local2) && (_local3)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(_arg1:String):void{
_debug.info((("setCampNameKey( " + _arg1) + " )"));
_call("_setCampNameKey", _arg1);
}
public function setDetectFlash(_arg1:Boolean):void{
_debug.info((("setDetectFlash( " + _arg1) + " )"));
_call("_setDetectFlash", _arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(_arg1:String):void{
_debug.info((("setVar( " + _arg1) + " )"));
_call("_setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
_debug.info((("setDomainName( " + _arg1) + " )"));
_call("_setDomainName", _arg1);
}
public function hasTrackingAccount(_arg1:String):Boolean{
if (Utils.validateAccount(_arg1)){
return (_checkValidTrackingObject(_arg1));
};
return (_checkTrackingObject(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_debug.info((("setCampSourceKey( " + _arg1) + " )"));
_call("_setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )"));
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setCampContentKey(_arg1:String):void{
_debug.info((("setCampContentKey( " + _arg1) + " )"));
_call("_setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(_arg1:Boolean):void{
_debug.info((("setAllowAnchor( " + _arg1) + " )"));
_call("_setAllowAnchor", _arg1);
}
public function setLocalGifPath(_arg1:String):void{
_debug.info((("setLocalGifPath( " + _arg1) + " )"));
_call("_setLocalGifPath", _arg1);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(_arg1:String):void{
_debug.info((("setCookiePath( " + _arg1) + " )"));
_call("_setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
_debug.info((("setSampleRate( " + _arg1) + " )"));
_call("_setSampleRate", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_debug.info((("setAllowHash( " + _arg1) + " )"));
_call("_setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_call("_addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
_debug.info((("setCampNOKey( " + _arg1) + " )"));
_call("_setCampNOKey", _arg1);
}
public function cookiePathCopy(_arg1:String):void{
_debug.info((("cookiePathCopy( " + _arg1) + " )"));
_call("_cookiePathCopy", _arg1);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(_arg1:Boolean):void{
_debug.info((("setDetectTitle( " + _arg1) + " )"));
_call("_setDetectTitle", _arg1);
}
private function _createTrackingObject(_arg1:String):void{
_proxy.call(_createTrackingObject_js, _arg1);
}
public function setCampaignTrack(_arg1:Boolean):void{
_debug.info((("setCampaignTrack( " + _arg1) + " )"));
_call("_setCampaignTrack", _arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
_debug.info((("setCampTermKey( " + _arg1) + " )"));
_call("_setCampTermKey", _arg1);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(_arg1:String):void{
_debug.info((("setCampMediumKey( " + _arg1) + " )"));
_call("_setCampMediumKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_call("_addIgnoredRef", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
_debug.info((("setSessionTimeout( " + _arg1) + " )"));
_call("_setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 149
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var hasSiteOverlay:Boolean;// = false
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
public var allowAnchor:Boolean;// = false
private var _domain:Domain;
private var _trackingLimitPerSession:int;// = 500
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get cookieName():String{
return (_cookieName);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 150
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(_arg1:String):void;
function setDetectTitle(_arg1:Boolean):void;
function setLocalRemoteServerMode():void;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(_arg1:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(_arg1:Boolean):void;
function setAllowLinker(_arg1:Boolean):void;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(_arg1:String):void;
function setCampNameKey(_arg1:String):void;
function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function clearIgnoredRef():void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void;
function getDetectFlash():Boolean;
function setCampaignTrack(_arg1:Boolean):void;
function createEventTracker(_arg1:String):EventTracker;
function setCookieTimeout(_arg1:int):void;
function setAllowAnchor(_arg1:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(_arg1:String=""):void;
function setLocalGifPath(_arg1:String):void;
function getVersion():String;
function getLocalGifPath():String;
function getServiceMode():ServerOperationMode;
function setVar(_arg1:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(_arg1:String):void;
function addIgnoredRef(_arg1:String):void;
function setClientInfo(_arg1:Boolean):void;
function setCookiePath(_arg1:String):void;
function setSampleRate(_arg1:Number):void;
function setSessionTimeout(_arg1:int):void;
function setRemoteServerMode():void;
function setDomainName(_arg1:String):void;
function addIgnoredOrganic(_arg1:String):void;
function setAllowHash(_arg1:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(_arg1:String):void;
function getClientInfo():Boolean;
function cookiePathCopy(_arg1:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 151
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.ecommerce.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _ecom:Ecommerce;
private var _account:String;
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals, _arg8:Ecommerce){
var _local9:String;
super();
_account = _arg1;
_config = _arg2;
_debug = _arg3;
_info = _arg4;
_buffer = _arg5;
_gifRequest = _arg6;
_adSense = _arg7;
_ecom = _arg8;
if (!Utils.validateAccount(_arg1)){
_local9 = (("Account \"" + _arg1) + "\" is not valid.");
_debug.warning(_local9);
throw (new Error(_local9));
};
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_config.organic.addSource(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_config.allowLinker = _arg1;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
_initData();
_debug.info((((("getLinkerUrl( " + _arg1) + ", ") + _arg2.toString()) + " )"));
return (_buffer.getLinkerUrl(_arg1, _arg2));
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
_initData();
var _local5:Boolean;
var _local6 = 2;
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2);
if (_arg3){
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3);
_local6 = 3;
};
if (!isNaN(_arg4)){
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4);
_local6 = 4;
};
if (_local5){
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_local5 = false;
};
switch (_local6){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
};
return (_local5);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(_arg1);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + _arg1) + " ) failed"));
};
}
public function setCookieTimeout(_arg1:int):void{
_config.conversionTimeout = _arg1;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
var _local1:Number;
var _local2:Number;
var _local4:Transaction;
_initData();
var _local3:Array = new Array();
if (_takeSample()){
_local1 = 0;
while (_local1 < _ecom.getTransLength()) {
_local4 = _ecom.getTransFromArray(_local1);
_local3.push(_local4.toGifParams());
_local2 = 0;
while (_local2 < _local4.getItemsLength()) {
_local3.push(_local4.getItemFromArray(_local2).toGifParams());
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < _local3.length) {
_gifRequest.send(_account, _local3[_local1]);
_local1++;
};
};
}
public function setClientInfo(_arg1:Boolean):void{
_config.detectClientInfo = _arg1;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning("linkByPost not implemented in AS3 mode");
}
private function _initData():void{
var _local1:String;
var _local2:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "_initData 0");
_local1 = (_local1 + ("\ndomain name: " + _config.domainName));
_local1 = (_local1 + ("\ndomain hash: " + _domainHash));
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
_debug.info(("Search: " + _info.locationSearch));
_debug.info(("CampaignTrackig: " + _buffer.utmz.campaignTracking));
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "_initData (misc)");
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4)));
_local2 = (_local2 + ("\nprotocol: " + _info.protocol));
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
_local2 = (_local2 + ("\nlanguage: " + _info.language));
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash()));
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent));
_debug.info(_local2, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(_arg1:X10=null):void{
var _local2:Variables;
var _local3:EventInfo;
var _local4:Variables;
var _local5:Variables;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
_local3 = new EventInfo(true, _x10Module, _arg1);
_local4 = _local3.toVariables();
_local5 = _renderMetricsSearchVariables();
_local2.join(_local4, _local5);
_gifRequest.send(_account, _local2, false, true);
};
}
public function setDetectFlash(_arg1:Boolean):void{
_config.detectFlash = _arg1;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(_arg1:String):void{
_config.campaignKey.UCCN = _arg1;
var _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCN]"));
} else {
_debug.info(_local2);
};
}
private function _formatReferrer():String{
var _local2:String;
var _local3:URL;
var _local4:URL;
var _local1:String = _info.referrer;
if ((((_local1 == "")) || ((_local1 == "localhost")))){
_local1 = "-";
} else {
_local2 = _info.domainName;
_local3 = new URL(_local1);
_local4 = new URL(("http://" + _local2));
if (_local3.hostName == _local2){
return ("-");
};
if (_local4.domain == _local3.domain){
if (_local4.subDomain != _local3.subDomain){
_local1 = "0";
};
};
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){
_local1 = "-";
};
};
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced);
return (_local1);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
var _local7:Transaction;
_local7 = _ecom.getTransaction(_arg1);
if (_local7 == null){
_local7 = _ecom.addTransaction(_arg1, "", "", "", "", "", "", "");
};
_local7.addItem(_arg2, _arg3, _arg4, _arg5.toString(), _arg6.toString());
if (_debug.active){
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
};
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(_arg1:String):void{
var _local2:Variables;
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = encodeURI(_arg1);
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + _arg1) + " )"));
if (_takeSample()){
_local2 = new Variables();
_local2.utmt = "var";
_gifRequest.send(_account, _local2);
};
} else {
_debug.warning((("setVar \"" + _arg1) + "\" is ignored"));
};
}
public function setDomainName(_arg1:String):void{
if (_arg1 == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (_arg1 == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = _arg1;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var _local1:String;
if (_config.domain.mode == DomainNameMode.auto){
_local1 = _info.domainName;
if (_local1.substring(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_config.domain.name = _local1;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_ecom.addTransaction(_arg1, _arg2, _arg3.toString(), _arg4.toString(), _arg5.toString(), _arg6, _arg7, _arg8);
if (_debug.active){
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " );"));
};
}
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{
var _local4:Variables;
var _local2:Variables = new Variables();
_local2.URIencode = true;
var _local3:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense);
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
_local4 = _campaignInfo.toVariables();
};
var _local5:Variables = _browserInfo.toVariables();
_local2.join(_local3.toVariables(), _local5, _local4);
return (_local2);
}
public function setCampContentKey(_arg1:String):void{
_config.campaignKey.UCCT = _arg1;
var _local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCT]"));
} else {
_debug.info(_local2);
};
}
private function _handleCookie():void{
var _local1:String;
var _local2:String;
var _local3:Array;
var _local4:String;
if (_config.allowLinker){
};
_buffer.createSO();
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "AdSense sid found\n");
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "AdSense sid found (new visitor)\n");
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local2, VisualDebugMode.geek);
};
};
if (_adSense.vid){
_local3 = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(_local3[0]);
_buffer.utma.firstTime = Number(_local3[1]);
if (_debug.verbose){
_local4 = "";
_local4 = (_local4 + "AdSense vid found (new visitor)\n");
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n"));
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")"));
_debug.info(_local4, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(_arg1:String):void{
_config.campaignKey.UCSR = _arg1;
var _local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCSR]"));
} else {
_debug.info(_local2);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(_arg1:String):void{
_config.localGIFpath = _arg1;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(_arg1:Boolean):void{
_config.allowAnchor = _arg1;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var _local1:String = _config.domainName;
var _local2 = (_local1.indexOf("www.google.") < 0);
var _local3 = (_local1.indexOf(".google.") < 0);
var _local4 = (_local1.indexOf("google.") < 0);
var _local5 = (_local1.indexOf("google.org") > -1);
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5)));
}
public function setSampleRate(_arg1:Number):void{
if (_arg1 < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = _arg1;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(_arg1:String):void{
_config.cookiePath = _arg1;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(_arg1:Boolean):void{
_config.allowDomainHash = _arg1;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var _local1 = "";
_local1 = (_local1 + _info.appName);
_local1 = (_local1 + _info.appVersion);
_local1 = (_local1 + _info.language);
_local1 = (_local1 + _info.platform);
_local1 = (_local1 + _info.userAgent.toString());
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
_local1 = (_local1 + _info.referrer);
return (Utils.generateHash(_local1));
}
public function setCampNOKey(_arg1:String):void{
_config.campaignKey.UCNO = _arg1;
var _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCNO]"));
} else {
_debug.info(_local2);
};
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_config.organic.addIgnoredKeyword(_arg1);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(_arg1:String):void{
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented"));
}
public function setDetectTitle(_arg1:Boolean):void{
_config.detectTitle = _arg1;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(_arg1:String):void{
_config.campaignKey.UCTR = _arg1;
var _local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCTR]"));
} else {
_debug.info(_local2);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(_arg1:String=""):void{
var _local2:Variables;
var _local3:Variables;
var _local4:Variables;
var _local5:EventInfo;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
_local5 = new EventInfo(false, _x10Module);
_local3 = _local5.toVariables();
};
_local4 = _renderMetricsSearchVariables(_arg1);
_local2.join(_local3, _local4);
_gifRequest.send(_account, _local2);
};
}
public function setCampaignTrack(_arg1:Boolean):void{
_config.campaignTracking = _arg1;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_config.organic.addIgnoredReferral(_arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(_arg1:String):void{
_config.campaignKey.UCMD = _arg1;
var _local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCMD]"));
} else {
_debug.info(_local2);
};
}
private function _getUniqueSessionId():Number{
var _local1:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek);
return (_local1);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(_arg1:int):void{
_config.sessionTimeout = _arg1;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
var targetUrl = _arg1;
var useHash = _arg2;
_initData();
var out:String = _buffer.getLinkerUrl(targetUrl, useHash);
var request:URLRequest = new URLRequest(out);
_debug.info((("link( " + [targetUrl, useHash].join(",")) + " )"));
try {
navigateToURL(request, "_top");
} catch(e:Error) {
_debug.warning(("An error occured in link() msg: " + e.message));
};
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 152
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set account(_arg1:String):void;
function get config():Configuration;
function get mode():String;
function set config(_arg1:Configuration):void;
function set mode(_arg1:String):void;
function set debug(_arg1:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(_arg1:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 153
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 154
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _ecom:Ecommerce;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
return (_tracker.getLinkerUrl(_arg1, _arg2));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function isReady():Boolean{
return (_ready);
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var _local2:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_ecom = new Ecommerce(_debug);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense, _ecom));
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 155
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 156
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 157
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 158
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 159
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 160
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 161
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 162
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 163
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 164
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 165
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 166
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import com.kongregate.as3.client.services.*;
import flash.display.*;
import flash.system.*;
import flash.utils.*;
import com.kongregate.as3.client.events.*;
import flash.net.*;
import flash.errors.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 167
//LivePreviewParent (fl.livepreview.LivePreviewParent)
package fl.livepreview {
import flash.display.*;
import flash.utils.*;
import flash.external.*;
public class LivePreviewParent extends MovieClip {
public var myInstance:DisplayObject;
public function LivePreviewParent(){
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
myInstance = getChildAt(0);
onResize(stage.width, stage.height);
if (ExternalInterface.available){
ExternalInterface.addCallback("onResize", onResize);
ExternalInterface.addCallback("onUpdate", onUpdate);
};
}
public function onUpdate(... _args):void{
var name:String;
var value:*;
var updateArray = _args;
var i:int;
while ((i + 1) < updateArray.length) {
try {
name = String(updateArray[i]);
value = updateArray[(i + 1)];
if ((((typeof(value) == "object")) && (value.__treatAsCollectionSpecialSauce__))){
updateCollection(value, name);
} else {
myInstance[name] = value;
};
} catch(e:Error) {
};
i = (i + 2);
};
}
public function onResize(_arg1:Number, _arg2:Number):void{
var width = _arg1;
var height = _arg2;
var setSizeFn:Function;
try {
setSizeFn = myInstance["setSize"];
} catch(e:Error) {
setSizeFn = null;
};
if (setSizeFn != null){
setSizeFn(width, height);
} else {
myInstance.width = width;
myInstance.height = height;
};
}
private function updateCollection(_arg1:Object, _arg2:String):void{
var _local7:Object;
var _local8:Object;
var _local9:*;
var _local3:Class = Class(getDefinitionByName(_arg1.collectionClass));
var _local4:Class = Class(getDefinitionByName(_arg1.collectionItemClass));
var _local5:Object = new (_local3);
var _local6:int;
while (_local6 < _arg1.collectionArray.length) {
_local7 = new (_local4);
_local8 = _arg1.collectionArray[_local6];
for (_local9 in _local8) {
_local7[_local9] = _local8[_local9];
};
_local5.addItem(_local7);
_local6++;
};
myInstance[_arg2] = (_local5 as _local3);
}
}
}//package fl.livepreview
Section 168
//Back (fl.transitions.easing.Back)
package fl.transitions.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 169
//Bounce (fl.transitions.easing.Bounce)
package fl.transitions.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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 easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package fl.transitions.easing
Section 170
//Elastic (fl.transitions.easing.Elastic)
package fl.transitions.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
}
}//package fl.transitions.easing
Section 171
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 172
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 173
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 174
//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 175
//TweenFilterLite (gs.TweenFilterLite)
package gs {
import flash.filters.*;
import flash.utils.*;
public class TweenFilterLite extends TweenLite {
protected var _matrix:Array;
protected var _hf:Boolean;// = false
protected var _roundProps:Boolean;
protected var _cmf:ColorMatrixFilter;
protected var _filters:Array;
protected var _endMatrix:Array;
protected var _timeScale:Number;
protected var _clrsa:Array;
public static var removeTween:Function = TweenLite.removeTween;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
private static var _lumB:Number = 0.072169;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var version:Number = 9.3;
private static var _lumG:Number = 0.71516;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _lumR:Number = 0.212671;
protected static var _globalTimeScale:Number = 1;
public function TweenFilterLite(_arg1:Object, _arg2:Number, _arg3:Object){
_filters = [];
super(_arg1, _arg2, _arg3);
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenFilterLite)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (TweenLite.version < 9.3){
trace("TweenFilterLite error! Please update your TweenLite class or try deleting your ASO files. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
};
}
override public function killVars(_arg1:Object):void{
if (TweenLite.overwriteManager.enabled){
TweenLite.overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, ((_filters) || ([])));
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:int;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local7:int;
var _local8:String;
if (((!(_arg1)) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, masterList[this.target]);
};
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
_arg2 = (_arg2 + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter roundProps timeScale ");
if (((!((this.vars.timeScale == null))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = [this.target, "timeScale", this.target.timeScale, (this.vars.timeScale - this.target.timeScale), "timeScale"];
};
_roundProps = Boolean((this.vars.roundProps is Array));
if (_isDisplayObject){
if (this.vars.blurFilter != null){
_local4 = this.vars.blurFilter;
addFilter("blurFilter", _local4, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, ((_local4.quality) || (2))));
};
if (this.vars.glowFilter != null){
_local4 = this.vars.glowFilter;
addFilter("glowFilter", _local4, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((_local4.strength) || (1)), ((_local4.quality) || (2)), _local4.inner, _local4.knockout));
};
if (this.vars.colorMatrixFilter != null){
_local4 = this.vars.colorMatrixFilter;
_local5 = addFilter("colorMatrixFilter", _local4, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = _local5.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_endMatrix = _local4.matrix;
} else {
if (_local4.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, _local4.brightness);
_endMatrix = setContrast(_endMatrix, _local4.contrast);
_endMatrix = setHue(_endMatrix, _local4.hue);
_endMatrix = setSaturation(_endMatrix, _local4.saturation);
_endMatrix = setThreshold(_endMatrix, _local4.threshold);
if (!isNaN(_local4.colorize)){
_endMatrix = colorize(_endMatrix, _local4.colorize, _local4.amount);
} else {
if (!isNaN(_local4.color)){
_endMatrix = colorize(_endMatrix, _local4.color, _local4.amount);
};
};
};
_local3 = 0;
while (_local3 < _endMatrix.length) {
if (((!((_matrix[_local3] == _endMatrix[_local3]))) && (!((_matrix[_local3] == undefined))))){
this.tweens[this.tweens.length] = [_matrix, _local3.toString(), _matrix[_local3], (_endMatrix[_local3] - _matrix[_local3]), "colorMatrixFilter"];
};
_local3++;
};
};
if (this.vars.dropShadowFilter != null){
_local4 = this.vars.dropShadowFilter;
addFilter("dropShadowFilter", _local4, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_local4.quality) || (2)), _local4.inner, _local4.knockout, _local4.hideObject));
};
if (this.vars.bevelFilter != null){
_local4 = this.vars.bevelFilter;
addFilter("bevelFilter", _local4, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_local4.quality) || (2))));
};
if (this.vars.runBackwards == true){
_local3 = (_clrsa.length - 1);
while (_local3 > -1) {
_local6 = _clrsa[_local3];
_clrsa[_local3].sr = (_local6.sr + _local6.cr);
_local6.cr = (_local6.cr * -1);
_local6.sg = (_local6.sg + _local6.cg);
_local6.cg = (_local6.cg * -1);
_local6.sb = (_local6.sb + _local6.cb);
_local6.cb = (_local6.cb * -1);
_local6.f[_local6.p] = (((_local6.sr << 16) | (_local6.sg << 8)) | _local6.sb);
_local3--;
};
};
super.initTweenVals(true, _arg2);
} else {
super.initTweenVals(_arg1, _arg2);
};
if (_roundProps){
_local3 = (this.vars.roundProps.length - 1);
while (_local3 > -1) {
_local8 = this.vars.roundProps[_local3];
_local7 = (this.tweens.length - 1);
while (_local7 > -1) {
if ((((this.tweens[_local7][1] == _local8)) && ((this.tweens[_local7][0] == this.target)))){
this.tweens[_local7][5] = true;
break;
};
_local7--;
};
_local3--;
};
};
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function get timeScale():Number{
return (_timeScale);
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:Number;
var _local7:int;
var _local8:Array;
var _local9:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
if (!_roundProps){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
} else {
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
if (_local4[5]){
_local6 = (_local4[2] + (_local3 * _local4[3]));
_local7 = ((_local6)<0) ? -1 : 1;
_local4[0][_local4[1]] = ((((_local6 % 1) * _local7))>0.5) ? (int(_local6) + _local7) : int(_local6);
} else {
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
};
_local5--;
};
};
if (_hf){
_local5 = (_clrsa.length - 1);
while (_local5 > -1) {
_local4 = _clrsa[_local5];
_local4.f[_local4.p] = ((((_local4.sr + (_local3 * _local4.cr)) << 16) | ((_local4.sg + (_local3 * _local4.cg)) << 8)) | (_local4.sb + (_local3 * _local4.cb)));
_local5--;
};
if (_cmf != null){
ColorMatrixFilter(_cmf).matrix = _matrix;
};
_local8 = this.target.filters;
_local5 = 0;
while (_local5 < _filters.length) {
_local9 = (_local8.length - 1);
while (_local9 > -1) {
if ((_local8[_local9] is _filters[_local5].type)){
_local8.splice(_local9, 1, _filters[_local5].filter);
break;
};
_local9--;
};
_local5++;
};
this.target.filters = _local8;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
private function addFilter(_arg1:String, _arg2:Object, _arg3:Class, _arg4:Array, _arg5:BitmapFilter):Object{
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Object;
var _local12:Object;
var _local6:Object = {type:_arg3, name:_arg1};
var _local7:Array = this.target.filters;
_local8 = 0;
while (_local8 < _local7.length) {
if ((_local7[_local8] is _arg3)){
_local6.filter = _local7[_local8];
break;
};
_local8++;
};
if (_local6.filter == undefined){
_local6.filter = _arg5;
_local7[_local7.length] = _local6.filter;
this.target.filters = _local7;
};
_local8 = 0;
while (_local8 < _arg4.length) {
_local9 = _arg4[_local8];
if (_arg2[_local9] != undefined){
if ((((((_local9 == "color")) || ((_local9 == "highlightColor")))) || ((_local9 == "shadowColor")))){
_local11 = HEXtoRGB(_local6.filter[_local9]);
_local12 = HEXtoRGB(_arg2[_local9]);
_clrsa[_clrsa.length] = {f:_local6.filter, p:_local9, sr:_local11.rb, cr:(_local12.rb - _local11.rb), sg:_local11.gb, cg:(_local12.gb - _local11.gb), sb:_local11.bb, cb:(_local12.bb - _local11.bb)};
} else {
if ((((((((_local9 == "quality")) || ((_local9 == "inner")))) || ((_local9 == "knockout")))) || ((_local9 == "hideObject")))){
_local6.filter[_local9] = _arg2[_local9];
} else {
if (typeof(_arg2[_local9]) == "number"){
_local10 = (_arg2[_local9] - _local6.filter[_local9]);
} else {
_local10 = Number(_arg2[_local9]);
};
this.tweens[this.tweens.length] = [_local6.filter, _local9, _local6.filter[_local9], _local10, _arg1];
};
};
};
_local8++;
};
_filters[_filters.length] = _local6;
_hf = true;
return (_local6);
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenFilterLite)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 176
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _subTweens:Array;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
public var gc:Boolean;
protected var _isDisplayObject:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
protected var _specialVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 9.3;
public static var masterList:Dictionary = new Dictionary(false);
public static var currentTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_classInitted){
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
_isDisplayObject = Boolean((((_arg1 is DisplayObject)) || (_arg1.hasOwnProperty("isTweenProxy"))));
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = Boolean((this.vars.alpha > 0));
};
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
this.tweens = [];
_subTweens = [];
_hst = (this.initted = false);
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((masterList[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
masterList[_arg1] = [];
};
masterList[_arg1].push(this);
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((_specialVars.visible == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = _specialVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (masterList[this.target] == undefined){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
masterList[this.target].push(this);
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function clear():void{
this.tweens = [];
_subTweens = [];
this.vars = {};
_hst = (_hasUpdate = false);
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local6:String;
_subTweens[_subTweens.length] = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
for (_local6 in _arg4) {
if (typeof(_arg4[_local6]) == "number"){
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], (_arg4[_local6] - _arg3[_local6]), _arg1];
} else {
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], Number(_arg4[_local6]), _arg1];
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:ColorTransform;
var _local7:ColorTransform;
var _local8:Object;
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local5.length) {
if (((!((this.target[_local4] == _local5[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = [this.target, _local4.toString(), this.target[_local4], (_local5[_local4] - this.target[_local4]), _local4.toString()];
};
_local4++;
};
} else {
if (((((!((typeof(_specialVars.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (this.target.hasOwnProperty("transform")))){
_local6 = this.target.transform.colorTransform;
_local7 = new ColorTransform();
if (_specialVars.alpha != undefined){
_local7.alphaMultiplier = _specialVars.alpha;
delete _specialVars.alpha;
} else {
_local7.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_specialVars.tint == null))) && (!((_specialVars.tint == ""))))) || ((_specialVars.tint == 0)))))){
_local7.color = _specialVars.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local6, endColor:_local7});
};
if (((!((_specialVars.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_specialVars.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
if (((!((_specialVars.visible == null))) && (_isDisplayObject))){
addSubTween("visible", visibleProxy, {}, {}, {tween:this});
};
for (_local3 in _specialVars) {
if ((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_specialVars[_local3]) == "number"){
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], (_specialVars[_local3] - this.target[_local3]), _local3];
} else {
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], Number(_specialVars[_local3]), _local3];
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local8 = this.tweens[_local4];
_local8[2] = (_local8[2] + _local8[3]);
_local8[3] = (_local8[3] * -1);
_local4--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function frameProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function visibleProxy(_arg1:Object, _arg2:Number):void{
var _local3:TweenLite = _arg1.info.tween;
if (_local3.duration == _arg2){
if (((!((_local3.vars.runBackwards == true))) && ((_local3.ease == _local3.vars.ease)))){
_local3.target.visible = _local3.vars.visible;
};
} else {
if (_local3.target.visible != true){
_local3.target.visible = true;
};
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && (!((masterList[_arg1] == undefined))))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6 == null){
} else {
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
};
_local5--;
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function tintProxy(_arg1:Object, _arg2:Number=0):void{
var _local3:Number = _arg1.target.progress;
var _local4:Number = (1 - _local3);
var _local5:Object = _arg1.info.color;
var _local6:Object = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local5.redMultiplier * _local4) + (_local6.redMultiplier * _local3)), ((_local5.greenMultiplier * _local4) + (_local6.greenMultiplier * _local3)), ((_local5.blueMultiplier * _local4) + (_local6.blueMultiplier * _local3)), ((_local5.alphaMultiplier * _local4) + (_local6.alphaMultiplier * _local3)), ((_local5.redOffset * _local4) + (_local6.redOffset * _local3)), ((_local5.greenOffset * _local4) + (_local6.greenOffset * _local3)), ((_local5.blueOffset * _local4) + (_local6.blueOffset * _local3)), ((_local5.alphaOffset * _local4) + (_local6.alphaOffset * _local3)));
}
public static function volumeProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.soundTransform = _arg1.target;
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local4:Array;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 177
//MochiBot (mochi.MochiBot)
package mochi {
import flash.display.*;
import flash.system.*;
import flash.net.*;
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 mochi
Section 178
//MochiDigits (mochi.MochiDigits)
package mochi {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi
Section 179
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 180
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__ms_";
private static var _servicesURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
public static var netup:Boolean = true;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
};
return (_local2);
}
public static function getVersion():String{
return ("1.43");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
public static function get id():String{
return (_id);
}
private static function urlOptions(_arg1:Object):Object{
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
var _local3:String = _arg1.loaderInfo.parameters.mochiad_options;
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_listenChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
trace("connected!");
_connecting = false;
_connected = true;
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var id = _arg1;
var clip = _arg2;
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servicesURL != undefined){
_servicesURL = urlOptions(clip).servicesURL;
};
MochiServices.allowDomains(_servicesURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
var f:Function = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor((Math.random() * 99999))));
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var req:URLRequest = new URLRequest(_servicesURL);
var vars:URLVariables = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 181
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.2.0.3958";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 182
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 183
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 184
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 185
//FlexLoader (mx.core.FlexLoader)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexLoader extends Loader {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexLoader(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 186
//FlexShape (mx.core.FlexShape)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexShape extends Shape {
mx_internal static const VERSION:String = "3.2.0.3958";
public function FlexShape(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 187
//FlexVersion (mx.core.FlexVersion)
package mx.core {
import mx.resources.*;
public class FlexVersion {
public static const VERSION_2_0_1:uint = 33554433;
public static const CURRENT_VERSION:uint = 50331648;
public static const VERSION_3_0:uint = 50331648;
public static const VERSION_2_0:uint = 33554432;
public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
mx_internal static const VERSION:String = "3.2.0.3958";
private static var compatibilityVersionChanged:Boolean = false;
private static var _compatibilityErrorFunction:Function;
private static var _compatibilityVersion:uint = 50331648;
private static var compatibilityVersionRead:Boolean = false;
mx_internal static function changeCompatibilityVersionString(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:uint = parseInt(_local2[0]);
var _local4:uint = parseInt(_local2[1]);
var _local5:uint = parseInt(_local2[2]);
_compatibilityVersion = (((_local3 << 24) + (_local4 << 16)) + _local5);
}
public static function set compatibilityVersion(_arg1:uint):void{
var _local2:String;
if (_arg1 == _compatibilityVersion){
return;
};
if (compatibilityVersionChanged){
if (compatibilityErrorFunction == null){
_local2 = ResourceManager.getInstance().getString("core", VERSION_ALREADY_SET);
throw (new Error(_local2));
};
compatibilityErrorFunction(_arg1, VERSION_ALREADY_SET);
};
if (compatibilityVersionRead){
if (compatibilityErrorFunction == null){
_local2 = ResourceManager.getInstance().getString("core", VERSION_ALREADY_READ);
throw (new Error(_local2));
};
compatibilityErrorFunction(_arg1, VERSION_ALREADY_READ);
};
_compatibilityVersion = _arg1;
compatibilityVersionChanged = true;
}
public static function get compatibilityVersion():uint{
compatibilityVersionRead = true;
return (_compatibilityVersion);
}
public static function set compatibilityErrorFunction(_arg1:Function):void{
_compatibilityErrorFunction = _arg1;
}
public static function set compatibilityVersionString(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:uint = parseInt(_local2[0]);
var _local4:uint = parseInt(_local2[1]);
var _local5:uint = parseInt(_local2[2]);
compatibilityVersion = (((_local3 << 24) + (_local4 << 16)) + _local5);
}
public static function get compatibilityErrorFunction():Function{
return (_compatibilityErrorFunction);
}
public static function get compatibilityVersionString():String{
var _local1:uint = ((compatibilityVersion >> 24) & 0xFF);
var _local2:uint = ((compatibilityVersion >> 16) & 0xFF);
var _local3:uint = (compatibilityVersion & 0xFFFF);
return (((((_local1.toString() + ".") + _local2.toString()) + ".") + _local3.toString()));
}
}
}//package mx.core
Section 188
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 189
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(_arg1:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 190
//IChildList (mx.core.IChildList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public interface IChildList {
function get numChildren():int;
function removeChild(_arg1:DisplayObject):DisplayObject;
function getChildByName(_arg1:String):DisplayObject;
function removeChildAt(_arg1:int):DisplayObject;
function getChildIndex(_arg1:DisplayObject):int;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function getObjectsUnderPoint(_arg1:Point):Array;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function getChildAt(_arg1:int):DisplayObject;
function addChild(_arg1:DisplayObject):DisplayObject;
function contains(_arg1:DisplayObject):Boolean;
}
}//package mx.core
Section 191
//IContainer (mx.core.IContainer)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import flash.media.*;
import flash.text.*;
public interface IContainer extends IUIComponent {
function set hitArea(_arg1:Sprite):void;
function swapChildrenAt(_arg1:int, _arg2:int):void;
function getChildByName(_arg1:String):DisplayObject;
function get doubleClickEnabled():Boolean;
function get graphics():Graphics;
function get useHandCursor():Boolean;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function set mouseChildren(_arg1:Boolean):void;
function set creatingContentPane(_arg1:Boolean):void;
function get textSnapshot():TextSnapshot;
function getChildIndex(_arg1:DisplayObject):int;
function set doubleClickEnabled(_arg1:Boolean):void;
function getObjectsUnderPoint(_arg1:Point):Array;
function get creatingContentPane():Boolean;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function get soundTransform():SoundTransform;
function set useHandCursor(_arg1:Boolean):void;
function get numChildren():int;
function contains(_arg1:DisplayObject):Boolean;
function get verticalScrollPosition():Number;
function set defaultButton(_arg1:IFlexDisplayObject):void;
function swapChildren(_arg1:DisplayObject, _arg2:DisplayObject):void;
function set horizontalScrollPosition(_arg1:Number):void;
function get focusManager():IFocusManager;
function startDrag(_arg1:Boolean=false, _arg2:Rectangle=null):void;
function set mouseEnabled(_arg1:Boolean):void;
function getChildAt(_arg1:int):DisplayObject;
function set soundTransform(_arg1:SoundTransform):void;
function get tabChildren():Boolean;
function get tabIndex():int;
function set focusRect(_arg1:Object):void;
function get hitArea():Sprite;
function get mouseChildren():Boolean;
function removeChildAt(_arg1:int):DisplayObject;
function get defaultButton():IFlexDisplayObject;
function stopDrag():void;
function set tabEnabled(_arg1:Boolean):void;
function get horizontalScrollPosition():Number;
function get focusRect():Object;
function get viewMetrics():EdgeMetrics;
function set verticalScrollPosition(_arg1:Number):void;
function get dropTarget():DisplayObject;
function get mouseEnabled():Boolean;
function set tabChildren(_arg1:Boolean):void;
function set buttonMode(_arg1:Boolean):void;
function get tabEnabled():Boolean;
function get buttonMode():Boolean;
function removeChild(_arg1:DisplayObject):DisplayObject;
function set tabIndex(_arg1:int):void;
function addChild(_arg1:DisplayObject):DisplayObject;
function areInaccessibleObjectsUnderPoint(_arg1:Point):Boolean;
}
}//package mx.core
Section 192
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 193
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 194
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
public interface IFlexModuleFactory {
function create(... _args):Object;
function info():Object;
}
}//package mx.core
Section 195
//IInvalidating (mx.core.IInvalidating)
package mx.core {
public interface IInvalidating {
function validateNow():void;
function invalidateSize():void;
function invalidateDisplayList():void;
function invalidateProperties():void;
}
}//package mx.core
Section 196
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 197
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 198
//IRectangularBorder (mx.core.IRectangularBorder)
package mx.core {
import flash.geom.*;
public interface IRectangularBorder extends IBorder {
function get backgroundImageBounds():Rectangle;
function get hasBackgroundImage():Boolean;
function set backgroundImageBounds(_arg1:Rectangle):void;
function layoutBackgroundImage():void;
}
}//package mx.core
Section 199
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 200
//ISWFBridgeGroup (mx.core.ISWFBridgeGroup)
package mx.core {
import flash.events.*;
public interface ISWFBridgeGroup {
function getChildBridgeProvider(_arg1:IEventDispatcher):ISWFBridgeProvider;
function removeChildBridge(_arg1:IEventDispatcher):void;
function get parentBridge():IEventDispatcher;
function addChildBridge(_arg1:IEventDispatcher, _arg2:ISWFBridgeProvider):void;
function set parentBridge(_arg1:IEventDispatcher):void;
function containsBridge(_arg1:IEventDispatcher):Boolean;
function getChildBridges():Array;
}
}//package mx.core
Section 201
//ISWFBridgeProvider (mx.core.ISWFBridgeProvider)
package mx.core {
import flash.events.*;
public interface ISWFBridgeProvider {
function get childAllowsParent():Boolean;
function get swfBridge():IEventDispatcher;
function get parentAllowsChild():Boolean;
}
}//package mx.core
Section 202
//IUIComponent (mx.core.IUIComponent)
package mx.core {
import flash.display.*;
import mx.managers.*;
public interface IUIComponent extends IFlexDisplayObject {
function set focusPane(_arg1:Sprite):void;
function get enabled():Boolean;
function set enabled(_arg1:Boolean):void;
function set isPopUp(_arg1:Boolean):void;
function get explicitMinHeight():Number;
function get percentWidth():Number;
function get isPopUp():Boolean;
function get owner():DisplayObjectContainer;
function get percentHeight():Number;
function get baselinePosition():Number;
function owns(_arg1:DisplayObject):Boolean;
function initialize():void;
function get maxWidth():Number;
function get minWidth():Number;
function getExplicitOrMeasuredWidth():Number;
function get explicitMaxWidth():Number;
function get explicitMaxHeight():Number;
function set percentHeight(_arg1:Number):void;
function get minHeight():Number;
function set percentWidth(_arg1:Number):void;
function get document():Object;
function get focusPane():Sprite;
function getExplicitOrMeasuredHeight():Number;
function set tweeningProperties(_arg1:Array):void;
function set explicitWidth(_arg1:Number):void;
function set measuredMinHeight(_arg1:Number):void;
function get explicitMinWidth():Number;
function get tweeningProperties():Array;
function get maxHeight():Number;
function set owner(_arg1:DisplayObjectContainer):void;
function set includeInLayout(_arg1:Boolean):void;
function setVisible(_arg1:Boolean, _arg2:Boolean=false):void;
function parentChanged(_arg1:DisplayObjectContainer):void;
function get explicitWidth():Number;
function get measuredMinHeight():Number;
function set measuredMinWidth(_arg1:Number):void;
function set explicitHeight(_arg1:Number):void;
function get includeInLayout():Boolean;
function get measuredMinWidth():Number;
function get explicitHeight():Number;
function set systemManager(_arg1:ISystemManager):void;
function set document(_arg1:Object):void;
function get systemManager():ISystemManager;
}
}//package mx.core
Section 203
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 204
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var classMap:Object = {};
public static function registerClass(_arg1:String, _arg2:Class):void{
var _local3:Class = classMap[_arg1];
if (!_local3){
classMap[_arg1] = _arg2;
};
}
public static function getClass(_arg1:String):Class{
return (classMap[_arg1]);
}
public static function getInstance(_arg1:String):Object{
var _local2:Class = classMap[_arg1];
if (!_local2){
throw (new Error((("No class registered for interface '" + _arg1) + "'.")));
};
return (_local2["getInstance"]());
}
}
}//package mx.core
Section 205
//UIComponentGlobals (mx.core.UIComponentGlobals)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
public class UIComponentGlobals {
mx_internal static var callLaterSuspendCount:int = 0;
mx_internal static var layoutManager:ILayoutManager;
mx_internal static var nextFocusObject:InteractiveObject;
mx_internal static var designTime:Boolean = false;
mx_internal static var tempMatrix:Matrix = new Matrix();
mx_internal static var callLaterDispatcherCount:int = 0;
private static var _catchCallLaterExceptions:Boolean = false;
public static function set catchCallLaterExceptions(_arg1:Boolean):void{
_catchCallLaterExceptions = _arg1;
}
public static function get designMode():Boolean{
return (designTime);
}
public static function set designMode(_arg1:Boolean):void{
designTime = _arg1;
}
public static function get catchCallLaterExceptions():Boolean{
return (_catchCallLaterExceptions);
}
}
}//package mx.core
Section 206
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import flash.events.*;
import mx.modules.*;
public class ModuleEvent extends ProgressEvent {
public var errorText:String;
private var _module:IModuleInfo;
public static const READY:String = "ready";
public static const ERROR:String = "error";
public static const PROGRESS:String = "progress";
mx_internal static const VERSION:String = "3.2.0.3958";
public static const SETUP:String = "setup";
public static const UNLOAD:String = "unload";
public function ModuleEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null, _arg7:IModuleInfo=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
this._module = _arg7;
}
public function get module():IModuleInfo{
if (_module){
return (_module);
};
return ((target as IModuleInfo));
}
override public function clone():Event{
return (new ModuleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText, module));
}
}
}//package mx.events
Section 207
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import flash.events.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function ResourceEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
}
override public function clone():Event{
return (new ResourceEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 208
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import flash.events.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.2.0.3958";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function StyleEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
}
override public function clone():Event{
return (new StyleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 209
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import mx.utils.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.2.0.3958";
public function get blRadius():Number{
return (_blRadius);
}
public function set brRadius(_arg1:Number):void{
if (_brRadius != _arg1){
_brRadius = _arg1;
changed = true;
};
}
public function set color(_arg1:int):void{
if (_color != _arg1){
_color = _arg1;
changed = true;
};
}
public function drawShadow(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
if (changed){
createShadowBitmaps();
changed = false;
};
_arg4 = Math.ceil(_arg4);
_arg5 = Math.ceil(_arg5);
var _local6:int = (leftShadow) ? leftShadow.width : 0;
var _local7:int = (rightShadow) ? rightShadow.width : 0;
var _local8:int = (topShadow) ? topShadow.height : 0;
var _local9:int = (bottomShadow) ? bottomShadow.height : 0;
var _local10:int = (_local6 + _local7);
var _local11:int = (_local8 + _local9);
var _local12:Number = ((_arg5 + _local11) / 2);
var _local13:Number = ((_arg4 + _local10) / 2);
var _local14:Matrix = new Matrix();
if (((leftShadow) || (topShadow))){
_local15 = Math.min((tlRadius + _local10), _local13);
_local16 = Math.min((tlRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (_arg3 - _local8), _local15, _local16);
_arg1.endFill();
};
if (((rightShadow) || (topShadow))){
_local17 = Math.min((trRadius + _local10), _local13);
_local18 = Math.min((trRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local17), (_arg3 - _local8), _local17, _local18);
_arg1.endFill();
};
if (((leftShadow) || (bottomShadow))){
_local19 = Math.min((blRadius + _local10), _local13);
_local20 = Math.min((blRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (((_arg3 + _arg5) + _local9) - _local20), _local19, _local20);
_arg1.endFill();
};
if (((rightShadow) || (bottomShadow))){
_local21 = Math.min((brRadius + _local10), _local13);
_local22 = Math.min((brRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local21), (((_arg3 + _arg5) + _local9) - _local22), _local21, _local22);
_arg1.endFill();
};
if (leftShadow){
_local14.tx = (_arg2 - _local6);
_local14.ty = 0;
_arg1.beginBitmapFill(leftShadow, _local14);
_arg1.drawRect((_arg2 - _local6), ((_arg3 - _local8) + _local16), _local6, ((((_arg5 + _local8) + _local9) - _local16) - _local20));
_arg1.endFill();
};
if (rightShadow){
_local14.tx = (_arg2 + _arg4);
_local14.ty = 0;
_arg1.beginBitmapFill(rightShadow, _local14);
_arg1.drawRect((_arg2 + _arg4), ((_arg3 - _local8) + _local18), _local7, ((((_arg5 + _local8) + _local9) - _local18) - _local22));
_arg1.endFill();
};
if (topShadow){
_local14.tx = 0;
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(topShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local15), (_arg3 - _local8), ((((_arg4 + _local6) + _local7) - _local15) - _local17), _local8);
_arg1.endFill();
};
if (bottomShadow){
_local14.tx = 0;
_local14.ty = (_arg3 + _arg5);
_arg1.beginBitmapFill(bottomShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local19), (_arg3 + _arg5), ((((_arg4 + _local6) + _local7) - _local19) - _local21), _local9);
_arg1.endFill();
};
}
public function get brRadius():Number{
return (_brRadius);
}
public function get angle():Number{
return (_angle);
}
private function createShadowBitmaps():void{
var _local1:Number = ((Math.max(tlRadius, blRadius) + (2 * distance)) + Math.max(trRadius, brRadius));
var _local2:Number = ((Math.max(tlRadius, trRadius) + (2 * distance)) + Math.max(blRadius, brRadius));
if ((((_local1 < 0)) || ((_local2 < 0)))){
return;
};
var _local3:Shape = new FlexShape();
var _local4:Graphics = _local3.graphics;
_local4.beginFill(0xFFFFFF);
GraphicsUtil.drawRoundRectComplex(_local4, 0, 0, _local1, _local2, tlRadius, trRadius, blRadius, brRadius);
_local4.endFill();
var _local5:BitmapData = new BitmapData(_local1, _local2, true, 0);
_local5.draw(_local3, new Matrix());
var _local6:DropShadowFilter = new DropShadowFilter(distance, angle, color, alpha);
_local6.knockout = true;
var _local7:Rectangle = new Rectangle(0, 0, _local1, _local2);
var _local8:Rectangle = _local5.generateFilterRect(_local7, _local6);
var _local9:Number = (_local7.left - _local8.left);
var _local10:Number = (_local8.right - _local7.right);
var _local11:Number = (_local7.top - _local8.top);
var _local12:Number = (_local8.bottom - _local7.bottom);
shadow = new BitmapData(_local8.width, _local8.height);
shadow.applyFilter(_local5, _local7, new Point(_local9, _local11), _local6);
var _local13:Point = new Point(0, 0);
var _local14:Rectangle = new Rectangle();
if (_local9 > 0){
_local14.x = 0;
_local14.y = ((tlRadius + _local11) + _local12);
_local14.width = _local9;
_local14.height = 1;
leftShadow = new BitmapData(_local9, 1);
leftShadow.copyPixels(shadow, _local14, _local13);
} else {
leftShadow = null;
};
if (_local10 > 0){
_local14.x = (shadow.width - _local10);
_local14.y = ((trRadius + _local11) + _local12);
_local14.width = _local10;
_local14.height = 1;
rightShadow = new BitmapData(_local10, 1);
rightShadow.copyPixels(shadow, _local14, _local13);
} else {
rightShadow = null;
};
if (_local11 > 0){
_local14.x = ((tlRadius + _local9) + _local10);
_local14.y = 0;
_local14.width = 1;
_local14.height = _local11;
topShadow = new BitmapData(1, _local11);
topShadow.copyPixels(shadow, _local14, _local13);
} else {
topShadow = null;
};
if (_local12 > 0){
_local14.x = ((blRadius + _local9) + _local10);
_local14.y = (shadow.height - _local12);
_local14.width = 1;
_local14.height = _local12;
bottomShadow = new BitmapData(1, _local12);
bottomShadow.copyPixels(shadow, _local14, _local13);
} else {
bottomShadow = null;
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():int{
return (_color);
}
public function set angle(_arg1:Number):void{
if (_angle != _arg1){
_angle = _arg1;
changed = true;
};
}
public function set trRadius(_arg1:Number):void{
if (_trRadius != _arg1){
_trRadius = _arg1;
changed = true;
};
}
public function set tlRadius(_arg1:Number):void{
if (_tlRadius != _arg1){
_tlRadius = _arg1;
changed = true;
};
}
public function get trRadius():Number{
return (_trRadius);
}
public function set distance(_arg1:Number):void{
if (_distance != _arg1){
_distance = _arg1;
changed = true;
};
}
public function get distance():Number{
return (_distance);
}
public function get tlRadius():Number{
return (_tlRadius);
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
changed = true;
};
}
public function set blRadius(_arg1:Number):void{
if (_blRadius != _arg1){
_blRadius = _arg1;
changed = true;
};
}
}
}//package mx.graphics
Section 210
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(_arg1:IButton):void;
function set focusPane(_arg1:Sprite):void;
function set showFocusIndicator(_arg1:Boolean):void;
function moveFocus(_arg1:String, _arg2:DisplayObject=null):void;
function addSWFBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function removeSWFBridge(_arg1:IEventDispatcher):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(_arg1:InteractiveObject):IFocusManagerComponent;
function get nextTabIndex():int;
function get defaultButton():IButton;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(_arg1:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 211
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.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 mx.managers
Section 212
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.events.*;
import flash.display.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(_arg1:IFocusManager):void;
function get focusManager():IFocusManager;
function get systemManager():ISystemManager;
function contains(_arg1:DisplayObject):Boolean;
}
}//package mx.managers
Section 213
//ILayoutManager (mx.managers.ILayoutManager)
package mx.managers {
import flash.events.*;
public interface ILayoutManager extends IEventDispatcher {
function validateNow():void;
function validateClient(_arg1:ILayoutManagerClient, _arg2:Boolean=false):void;
function isInvalid():Boolean;
function invalidateDisplayList(_arg1:ILayoutManagerClient):void;
function set usePhasedInstantiation(_arg1:Boolean):void;
function invalidateSize(_arg1:ILayoutManagerClient):void;
function get usePhasedInstantiation():Boolean;
function invalidateProperties(_arg1:ILayoutManagerClient):void;
}
}//package mx.managers
Section 214
//ILayoutManagerClient (mx.managers.ILayoutManagerClient)
package mx.managers {
import flash.events.*;
public interface ILayoutManagerClient extends IEventDispatcher {
function get updateCompletePendingFlag():Boolean;
function set updateCompletePendingFlag(_arg1:Boolean):void;
function set initialized(_arg1:Boolean):void;
function validateProperties():void;
function validateDisplayList():void;
function get nestLevel():int;
function get initialized():Boolean;
function get processedDescriptors():Boolean;
function validateSize(_arg1:Boolean=false):void;
function set nestLevel(_arg1:int):void;
function set processedDescriptors(_arg1:Boolean):void;
}
}//package mx.managers
Section 215
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory {
function set focusPane(_arg1:Sprite):void;
function get toolTipChildren():IChildList;
function useSWFBridge():Boolean;
function isFontFaceEmbedded(_arg1:TextFormat):Boolean;
function deployMouseShields(_arg1:Boolean):void;
function get rawChildren():IChildList;
function get topLevelSystemManager():ISystemManager;
function dispatchEventFromSWFBridges(_arg1:Event, _arg2:IEventDispatcher=null, _arg3:Boolean=false, _arg4:Boolean=false):void;
function getSandboxRoot():DisplayObject;
function get swfBridgeGroup():ISWFBridgeGroup;
function removeFocusManager(_arg1:IFocusManagerContainer):void;
function addChildToSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function get document():Object;
function get focusPane():Sprite;
function get loaderInfo():LoaderInfo;
function addChildBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function getTopLevelRoot():DisplayObject;
function removeChildBridge(_arg1:IEventDispatcher):void;
function isDisplayObjectInABridgedApplication(_arg1:DisplayObject):Boolean;
function get popUpChildren():IChildList;
function get screen():Rectangle;
function removeChildFromSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function getDefinitionByName(_arg1:String):Object;
function activate(_arg1:IFocusManagerContainer):void;
function deactivate(_arg1:IFocusManagerContainer):void;
function get cursorChildren():IChildList;
function set document(_arg1:Object):void;
function get embeddedFontList():Object;
function set numModalWindows(_arg1:int):void;
function isTopLevel():Boolean;
function isTopLevelRoot():Boolean;
function get numModalWindows():int;
function addFocusManager(_arg1:IFocusManagerContainer):void;
function get stage():Stage;
function getVisibleApplicationRect(_arg1:Rectangle=null):Rectangle;
}
}//package mx.managers
Section 216
//SystemManagerGlobals (mx.managers.SystemManagerGlobals)
package mx.managers {
public class SystemManagerGlobals {
public static var topLevelSystemManagers:Array = [];
public static var changingListenersInOtherSystemManagers:Boolean;
public static var bootstrapLoaderInfoURL:String;
public static var showMouseCursor:Boolean;
}
}//package mx.managers
Section 217
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import flash.events.*;
import mx.core.*;
import flash.system.*;
import flash.utils.*;
public interface IModuleInfo extends IEventDispatcher {
function get ready():Boolean;
function get loaded():Boolean;
function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null, _arg3:ByteArray=null):void;
function release():void;
function get error():Boolean;
function get data():Object;
function publish(_arg1:IFlexModuleFactory):void;
function get factory():IFlexModuleFactory;
function set data(_arg1:Object):void;
function get url():String;
function get setup():Boolean;
function unload():void;
}
}//package mx.modules
Section 218
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.2.0.3958";
public static function getModule(_arg1:String):IModuleInfo{
return (getSingleton().getModule(_arg1));
}
private static function getSingleton():Object{
if (!ModuleManagerGlobals.managerSingleton){
ModuleManagerGlobals.managerSingleton = new ModuleManagerImpl();
};
return (ModuleManagerGlobals.managerSingleton);
}
public static function getAssociatedFactory(_arg1:Object):IFlexModuleFactory{
return (getSingleton().getAssociatedFactory(_arg1));
}
}
}//package mx.modules
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.system.*;
import mx.events.*;
import flash.utils.*;
import flash.net.*;
class ModuleInfoProxy extends EventDispatcher implements IModuleInfo {
private var _data:Object;
private var info:ModuleInfo;
private var referenced:Boolean;// = false
private function ModuleInfoProxy(_arg1:ModuleInfo){
this.info = _arg1;
_arg1.addEventListener(ModuleEvent.SETUP, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.ERROR, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.UNLOAD, moduleEventHandler, false, 0, true);
}
public function get loaded():Boolean{
return (info.loaded);
}
public function release():void{
if (referenced){
info.removeReference();
referenced = false;
};
}
public function get error():Boolean{
return (info.error);
}
public function get factory():IFlexModuleFactory{
return (info.factory);
}
public function publish(_arg1:IFlexModuleFactory):void{
info.publish(_arg1);
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get ready():Boolean{
return (info.ready);
}
public function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null, _arg3:ByteArray=null):void{
var _local4:ModuleEvent;
info.resurrect();
if (!referenced){
info.addReference();
referenced = true;
};
if (info.error){
dispatchEvent(new ModuleEvent(ModuleEvent.ERROR));
} else {
if (info.loaded){
if (info.setup){
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
if (info.ready){
_local4 = new ModuleEvent(ModuleEvent.PROGRESS);
_local4.bytesLoaded = info.size;
_local4.bytesTotal = info.size;
dispatchEvent(_local4);
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
};
};
} else {
info.load(_arg1, _arg2, _arg3);
};
};
}
private function moduleEventHandler(_arg1:ModuleEvent):void{
dispatchEvent(_arg1);
}
public function get url():String{
return (info.url);
}
public function get data():Object{
return (_data);
}
public function get setup():Boolean{
return (info.setup);
}
public function unload():void{
info.unload();
info.removeEventListener(ModuleEvent.SETUP, moduleEventHandler);
info.removeEventListener(ModuleEvent.PROGRESS, moduleEventHandler);
info.removeEventListener(ModuleEvent.READY, moduleEventHandler);
info.removeEventListener(ModuleEvent.ERROR, moduleEventHandler);
info.removeEventListener(ModuleEvent.UNLOAD, moduleEventHandler);
}
}
class ModuleManagerImpl extends EventDispatcher {
private var moduleList:Object;
private function ModuleManagerImpl(){
moduleList = {};
super();
}
public function getModule(_arg1:String):IModuleInfo{
var _local2:ModuleInfo = (moduleList[_arg1] as ModuleInfo);
if (!_local2){
_local2 = new ModuleInfo(_arg1);
moduleList[_arg1] = _local2;
};
return (new ModuleInfoProxy(_local2));
}
public function getAssociatedFactory(_arg1:Object):IFlexModuleFactory{
var m:Object;
var info:ModuleInfo;
var domain:ApplicationDomain;
var cls:Class;
var object = _arg1;
var className:String = getQualifiedClassName(object);
for each (m in moduleList) {
info = (m as ModuleInfo);
if (!info.ready){
} else {
domain = info.applicationDomain;
try {
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return (info.factory);
};
} catch(error:Error) {
};
};
};
return (null);
}
}
class ModuleInfo extends EventDispatcher {
private var _error:Boolean;// = false
private var loader:Loader;
private var factoryInfo:FactoryInfo;
private var limbo:Dictionary;
private var _loaded:Boolean;// = false
private var _ready:Boolean;// = false
private var numReferences:int;// = 0
private var _url:String;
private var _setup:Boolean;// = false
private function ModuleInfo(_arg1:String){
_url = _arg1;
}
private function clearLoader():void{
if (loader){
if (loader.contentLoaderInfo){
loader.contentLoaderInfo.removeEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
};
try {
if (loader.content){
loader.content.removeEventListener("ready", readyHandler);
loader.content.removeEventListener("error", moduleErrorHandler);
};
} catch(error:Error) {
};
if (_loaded){
try {
loader.close();
} catch(error:Error) {
};
};
try {
loader.unload();
} catch(error:Error) {
};
loader = null;
};
}
public function get size():int{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.bytesTotal : 0);
}
public function get loaded():Boolean{
return ((limbo) ? false : _loaded);
}
public function release():void{
if (((_ready) && (!(limbo)))){
limbo = new Dictionary(true);
limbo[factoryInfo] = 1;
factoryInfo = null;
} else {
unload();
};
}
public function get error():Boolean{
return ((limbo) ? false : _error);
}
public function get factory():IFlexModuleFactory{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.factory : null);
}
public function completeHandler(_arg1:Event):void{
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
_local2.bytesTotal = loader.contentLoaderInfo.bytesTotal;
dispatchEvent(_local2);
}
public function publish(_arg1:IFlexModuleFactory):void{
if (factoryInfo){
return;
};
if (_url.indexOf("published://") != 0){
return;
};
factoryInfo = new FactoryInfo();
factoryInfo.factory = _arg1;
_loaded = true;
_setup = true;
_ready = true;
_error = false;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
dispatchEvent(new ModuleEvent(ModuleEvent.PROGRESS));
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function initHandler(_arg1:Event):void{
var moduleEvent:ModuleEvent;
var event = _arg1;
factoryInfo = new FactoryInfo();
try {
factoryInfo.factory = (loader.content as IFlexModuleFactory);
} catch(error:Error) {
};
if (!factoryInfo.factory){
moduleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = "SWF is not a loadable module";
dispatchEvent(moduleEvent);
return;
};
loader.content.addEventListener("ready", readyHandler);
loader.content.addEventListener("error", moduleErrorHandler);
try {
factoryInfo.applicationDomain = loader.contentLoaderInfo.applicationDomain;
} catch(error:Error) {
};
_setup = true;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
}
public function resurrect():void{
var _local1:Object;
if (((!(factoryInfo)) && (limbo))){
for (_local1 in limbo) {
factoryInfo = (_local1 as FactoryInfo);
break;
};
limbo = null;
};
if (!factoryInfo){
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
loader = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
};
}
public function errorHandler(_arg1:ErrorEvent):void{
_error = true;
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = 0;
_local2.bytesTotal = 0;
_local2.errorText = _arg1.text;
dispatchEvent(_local2);
}
public function get ready():Boolean{
return ((limbo) ? false : _ready);
}
private function loadBytes(_arg1:ApplicationDomain, _arg2:ByteArray):void{
var _local3:LoaderContext = new LoaderContext();
_local3.applicationDomain = (_arg1) ? _arg1 : new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local3)){
_local3["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.loadBytes(_arg2, _local3);
}
public function removeReference():void{
numReferences--;
if (numReferences == 0){
release();
};
}
public function addReference():void{
numReferences++;
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
public function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null, _arg3:ByteArray=null):void{
if (_loaded){
return;
};
_loaded = true;
limbo = null;
if (_arg3){
loadBytes(_arg1, _arg3);
return;
};
if (_url.indexOf("published://") == 0){
return;
};
var _local4:URLRequest = new URLRequest(_url);
var _local5:LoaderContext = new LoaderContext();
_local5.applicationDomain = (_arg1) ? _arg1 : new ApplicationDomain(ApplicationDomain.currentDomain);
_local5.securityDomain = _arg2;
if ((((_arg2 == null)) && ((Security.sandboxType == Security.REMOTE)))){
_local5.securityDomain = SecurityDomain.currentDomain;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.load(_local4, _local5);
}
public function get url():String{
return (_url);
}
public function get applicationDomain():ApplicationDomain{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.applicationDomain : null);
}
public function moduleErrorHandler(_arg1:Event):void{
var _local2:ModuleEvent;
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
if ((_arg1 is ModuleEvent)){
_local2 = ModuleEvent(_arg1);
} else {
_local2 = new ModuleEvent(ModuleEvent.ERROR);
};
dispatchEvent(_local2);
}
public function readyHandler(_arg1:Event):void{
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function get setup():Boolean{
return ((limbo) ? false : _setup);
}
public function unload():void{
clearLoader();
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
limbo = null;
factoryInfo = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
}
}
class FactoryInfo {
public var bytesTotal:int;// = 0
public var factory:IFlexModuleFactory;
public var applicationDomain:ApplicationDomain;
private function FactoryInfo(){
}
}
Section 219
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
}
}//package mx.modules
Section 220
//IResourceBundle (mx.resources.IResourceBundle)
package mx.resources {
public interface IResourceBundle {
function get content():Object;
function get locale():String;
function get bundleName():String;
}
}//package mx.resources
Section 221
//IResourceManager (mx.resources.IResourceManager)
package mx.resources {
import flash.events.*;
import flash.system.*;
public interface IResourceManager extends IEventDispatcher {
function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean;
function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class;
function getLocales():Array;
function removeResourceBundlesForLocale(_arg1:String):void;
function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle;
function get localeChain():Array;
function getInt(_arg1:String, _arg2:String, _arg3:String=null):int;
function update():void;
function set localeChain(_arg1:Array):void;
function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint;
function addResourceBundle(_arg1:IResourceBundle):void;
function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array;
function getBundleNamesForLocale(_arg1:String):Array;
function removeResourceBundle(_arg1:String, _arg2:String):void;
function getObject(_arg1:String, _arg2:String, _arg3:String=null);
function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String;
function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void;
function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void;
function getPreferredLocaleChain():Array;
function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle;
function initializeLocaleChain(_arg1:Array):void;
function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number;
}
}//package mx.resources
Section 222
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 223
//LocaleSorter (mx.resources.LocaleSorter)
package mx.resources {
public class LocaleSorter {
mx_internal static const VERSION:String = "3.2.0.3958";
private static function normalizeLocale(_arg1:String):String{
return (_arg1.toLowerCase().replace(/-/g, "_"));
}
public static function sortLocalesByPreference(_arg1:Array, _arg2:Array, _arg3:String=null, _arg4:Boolean=false):Array{
var result:Array;
var hasLocale:Object;
var i:int;
var j:int;
var k:int;
var l:int;
var locale:String;
var plocale:LocaleID;
var appLocales = _arg1;
var systemPreferences = _arg2;
var ultimateFallbackLocale = _arg3;
var addAll = _arg4;
var promote:Function = function (_arg1:String):void{
if (typeof(hasLocale[_arg1]) != "undefined"){
result.push(appLocales[hasLocale[_arg1]]);
delete hasLocale[_arg1];
};
};
result = [];
hasLocale = {};
var locales:Array = trimAndNormalize(appLocales);
var preferenceLocales:Array = trimAndNormalize(systemPreferences);
addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale);
j = 0;
while (j < locales.length) {
hasLocale[locales[j]] = j;
j = (j + 1);
};
i = 0;
l = preferenceLocales.length;
while (i < l) {
plocale = LocaleID.fromString(preferenceLocales[i]);
promote(preferenceLocales[i]);
promote(plocale.toString());
while (plocale.transformToParent()) {
promote(plocale.toString());
};
plocale = LocaleID.fromString(preferenceLocales[i]);
j = 0;
while (j < l) {
locale = preferenceLocales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
j = 0;
k = locales.length;
while (j < k) {
locale = locales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
i = (i + 1);
};
if (addAll){
j = 0;
k = locales.length;
while (j < k) {
promote(locales[j]);
j = (j + 1);
};
};
return (result);
}
private static function addUltimateFallbackLocale(_arg1:Array, _arg2:String):void{
var _local3:String;
if (((!((_arg2 == null))) && (!((_arg2 == ""))))){
_local3 = normalizeLocale(_arg2);
if (_arg1.indexOf(_local3) == -1){
_arg1.push(_local3);
};
};
}
private static function trimAndNormalize(_arg1:Array):Array{
var _local2:Array = [];
var _local3:int;
while (_local3 < _arg1.length) {
_local2.push(normalizeLocale(_arg1[_local3]));
_local3++;
};
return (_local2);
}
}
}//package mx.resources
class LocaleID {
private var privateLangs:Boolean;// = false
private var script:String;// = ""
private var variants:Array;
private var privates:Array;
private var extensions:Object;
private var lang:String;// = ""
private var region:String;// = ""
private var extended_langs:Array;
public static const STATE_PRIMARY_LANGUAGE:int = 0;
public static const STATE_REGION:int = 3;
public static const STATE_EXTENDED_LANGUAGES:int = 1;
public static const STATE_EXTENSIONS:int = 5;
public static const STATE_SCRIPT:int = 2;
public static const STATE_VARIANTS:int = 4;
public static const STATE_PRIVATES:int = 6;
private function LocaleID(){
extended_langs = [];
variants = [];
extensions = {};
privates = [];
super();
}
public function equals(_arg1:LocaleID):Boolean{
return ((toString() == _arg1.toString()));
}
public function canonicalize():void{
var _local1:String;
for (_local1 in extensions) {
if (extensions.hasOwnProperty(_local1)){
if (extensions[_local1].length == 0){
delete extensions[_local1];
} else {
extensions[_local1] = extensions[_local1].sort();
};
};
};
extended_langs = extended_langs.sort();
variants = variants.sort();
privates = privates.sort();
if (script == ""){
script = LocaleRegistry.getScriptByLang(lang);
};
if ((((script == "")) && (!((region == ""))))){
script = LocaleRegistry.getScriptByLangAndRegion(lang, region);
};
if ((((region == "")) && (!((script == ""))))){
region = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
};
}
public function toString():String{
var _local2:String;
var _local1:Array = [lang];
Array.prototype.push.apply(_local1, extended_langs);
if (script != ""){
_local1.push(script);
};
if (region != ""){
_local1.push(region);
};
Array.prototype.push.apply(_local1, variants);
for (_local2 in extensions) {
if (extensions.hasOwnProperty(_local2)){
_local1.push(_local2);
Array.prototype.push.apply(_local1, extensions[_local2]);
};
};
if (privates.length > 0){
_local1.push("x");
Array.prototype.push.apply(_local1, privates);
};
return (_local1.join("_"));
}
public function isSiblingOf(_arg1:LocaleID):Boolean{
return ((((lang == _arg1.lang)) && ((script == _arg1.script))));
}
public function transformToParent():Boolean{
var _local2:String;
var _local3:Array;
var _local4:String;
if (privates.length > 0){
privates.splice((privates.length - 1), 1);
return (true);
};
var _local1:String;
for (_local2 in extensions) {
if (extensions.hasOwnProperty(_local2)){
_local1 = _local2;
};
};
if (_local1){
_local3 = extensions[_local1];
if (_local3.length == 1){
delete extensions[_local1];
return (true);
};
_local3.splice((_local3.length - 1), 1);
return (true);
};
if (variants.length > 0){
variants.splice((variants.length - 1), 1);
return (true);
};
if (script != ""){
if (LocaleRegistry.getScriptByLang(lang) != ""){
script = "";
return (true);
};
if (region == ""){
_local4 = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
if (_local4 != ""){
region = _local4;
script = "";
return (true);
};
};
};
if (region != ""){
if (!(((script == "")) && ((LocaleRegistry.getScriptByLang(lang) == "")))){
region = "";
return (true);
};
};
if (extended_langs.length > 0){
extended_langs.splice((extended_langs.length - 1), 1);
return (true);
};
return (false);
}
public static function fromString(_arg1:String):LocaleID{
var _local5:Array;
var _local8:String;
var _local9:int;
var _local10:String;
var _local2:LocaleID = new (LocaleID);
var _local3:int = STATE_PRIMARY_LANGUAGE;
var _local4:Array = _arg1.replace(/-/g, "_").split("_");
var _local6:int;
var _local7:int = _local4.length;
while (_local6 < _local7) {
_local8 = _local4[_local6].toLowerCase();
if (_local3 == STATE_PRIMARY_LANGUAGE){
if (_local8 == "x"){
_local2.privateLangs = true;
} else {
if (_local8 == "i"){
_local2.lang = (_local2.lang + "i-");
} else {
_local2.lang = (_local2.lang + _local8);
_local3 = STATE_EXTENDED_LANGUAGES;
};
};
} else {
_local9 = _local8.length;
if (_local9 == 0){
} else {
_local10 = _local8.charAt(0).toLowerCase();
if ((((_local3 <= STATE_EXTENDED_LANGUAGES)) && ((_local9 == 3)))){
_local2.extended_langs.push(_local8);
if (_local2.extended_langs.length == 3){
_local3 = STATE_SCRIPT;
};
} else {
if ((((_local3 <= STATE_SCRIPT)) && ((_local9 == 4)))){
_local2.script = _local8;
_local3 = STATE_REGION;
} else {
if ((((_local3 <= STATE_REGION)) && ((((_local9 == 2)) || ((_local9 == 3)))))){
_local2.region = _local8;
_local3 = STATE_VARIANTS;
} else {
if ((((_local3 <= STATE_VARIANTS)) && ((((((((_local10 >= "a")) && ((_local10 <= "z")))) && ((_local9 >= 5)))) || ((((((_local10 >= "0")) && ((_local10 <= "9")))) && ((_local9 >= 4)))))))){
_local2.variants.push(_local8);
_local3 = STATE_VARIANTS;
} else {
if ((((_local3 < STATE_PRIVATES)) && ((_local9 == 1)))){
if (_local8 == "x"){
_local3 = STATE_PRIVATES;
_local5 = _local2.privates;
} else {
_local3 = STATE_EXTENSIONS;
_local5 = ((_local2.extensions[_local8]) || ([]));
_local2.extensions[_local8] = _local5;
};
} else {
if (_local3 >= STATE_EXTENSIONS){
_local5.push(_local8);
};
};
};
};
};
};
};
};
_local6++;
};
_local2.canonicalize();
return (_local2);
}
}
class LocaleRegistry {
private static const SCRIPT_ID_BY_LANG:Object = {ab:5, af:1, am:2, ar:3, as:4, ay:1, be:5, bg:5, bn:4, bs:1, ca:1, ch:1, cs:1, cy:1, da:1, de:1, dv:6, dz:7, el:8, en:1, eo:1, es:1, et:1, eu:1, fa:3, fi:1, fj:1, fo:1, fr:1, frr:1, fy:1, ga:1, gl:1, gn:1, gu:9, gv:1, he:10, hi:11, hr:1, ht:1, hu:1, hy:12, id:1, in:1, is:1, it:1, iw:10, ja:13, ka:14, kk:5, kl:1, km:15, kn:16, ko:17, la:1, lb:1, ln:1, lo:18, lt:1, lv:1, mg:1, mh:1, mk:5, ml:19, mo:1, mr:11, ms:1, mt:1, my:20, na:1, nb:1, nd:1, ne:11, nl:1, nn:1, no:1, nr:1, ny:1, om:1, or:21, pa:22, pl:1, ps:3, pt:1, qu:1, rn:1, ro:1, ru:5, rw:1, sg:1, si:23, sk:1, sl:1, sm:1, so:1, sq:1, ss:1, st:1, sv:1, sw:1, ta:24, te:25, th:26, ti:2, tl:1, tn:1, to:1, tr:1, ts:1, uk:5, ur:3, ve:1, vi:1, wo:1, xh:1, yi:10, zu:1, cpe:1, dsb:1, frs:1, gsw:1, hsb:1, kok:11, mai:11, men:1, nds:1, niu:1, nqo:27, nso:1, son:1, tem:1, tkl:1, tmh:1, tpi:1, tvl:1, zbl:28};
private static const SCRIPTS:Array = ["", "latn", "ethi", "arab", "beng", "cyrl", "thaa", "tibt", "grek", "gujr", "hebr", "deva", "armn", "jpan", "geor", "khmr", "knda", "kore", "laoo", "mlym", "mymr", "orya", "guru", "sinh", "taml", "telu", "thai", "nkoo", "blis", "hans", "hant", "mong", "syrc"];
private static const DEFAULT_REGION_BY_LANG_AND_SCRIPT:Object = {bg:{5:"bg"}, ca:{1:"es"}, zh:{30:"tw", 29:"cn"}, cs:{1:"cz"}, da:{1:"dk"}, de:{1:"de"}, el:{8:"gr"}, en:{1:"us"}, es:{1:"es"}, fi:{1:"fi"}, fr:{1:"fr"}, he:{10:"il"}, hu:{1:"hu"}, is:{1:"is"}, it:{1:"it"}, ja:{13:"jp"}, ko:{17:"kr"}, nl:{1:"nl"}, nb:{1:"no"}, pl:{1:"pl"}, pt:{1:"br"}, ro:{1:"ro"}, ru:{5:"ru"}, hr:{1:"hr"}, sk:{1:"sk"}, sq:{1:"al"}, sv:{1:"se"}, th:{26:"th"}, tr:{1:"tr"}, ur:{3:"pk"}, id:{1:"id"}, uk:{5:"ua"}, be:{5:"by"}, sl:{1:"si"}, et:{1:"ee"}, lv:{1:"lv"}, lt:{1:"lt"}, fa:{3:"ir"}, vi:{1:"vn"}, hy:{12:"am"}, az:{1:"az", 5:"az"}, eu:{1:"es"}, mk:{5:"mk"}, af:{1:"za"}, ka:{14:"ge"}, fo:{1:"fo"}, hi:{11:"in"}, ms:{1:"my"}, kk:{5:"kz"}, ky:{5:"kg"}, sw:{1:"ke"}, uz:{1:"uz", 5:"uz"}, tt:{5:"ru"}, pa:{22:"in"}, gu:{9:"in"}, ta:{24:"in"}, te:{25:"in"}, kn:{16:"in"}, mr:{11:"in"}, sa:{11:"in"}, mn:{5:"mn"}, gl:{1:"es"}, kok:{11:"in"}, syr:{32:"sy"}, dv:{6:"mv"}, nn:{1:"no"}, sr:{1:"cs", 5:"cs"}, cy:{1:"gb"}, mi:{1:"nz"}, mt:{1:"mt"}, quz:{1:"bo"}, tn:{1:"za"}, xh:{1:"za"}, zu:{1:"za"}, nso:{1:"za"}, se:{1:"no"}, smj:{1:"no"}, sma:{1:"no"}, sms:{1:"fi"}, smn:{1:"fi"}, bs:{1:"ba"}};
private static const SCRIPT_BY_ID:Object = {latn:1, ethi:2, arab:3, beng:4, cyrl:5, thaa:6, tibt:7, grek:8, gujr:9, hebr:10, deva:11, armn:12, jpan:13, geor:14, khmr:15, knda:16, kore:17, laoo:18, mlym:19, mymr:20, orya:21, guru:22, sinh:23, taml:24, telu:25, thai:26, nkoo:27, blis:28, hans:29, hant:30, mong:31, syrc:32};
private static const SCRIPT_ID_BY_LANG_AND_REGION:Object = {zh:{cn:29, sg:29, tw:30, hk:30, mo:30}, mn:{cn:31, sg:5}, pa:{pk:3, in:22}, ha:{gh:1, ne:1}};
private function LocaleRegistry(){
}
public static function getScriptByLangAndRegion(_arg1:String, _arg2:String):String{
var _local3:Object = SCRIPT_ID_BY_LANG_AND_REGION[_arg1];
if (_local3 == null){
return ("");
};
var _local4:Object = _local3[_arg2];
if (_local4 == null){
return ("");
};
return (SCRIPTS[int(_local4)].toLowerCase());
}
public static function getScriptByLang(_arg1:String):String{
var _local2:Object = SCRIPT_ID_BY_LANG[_arg1];
if (_local2 == null){
return ("");
};
return (SCRIPTS[int(_local2)].toLowerCase());
}
public static function getDefaultRegionForLangAndScript(_arg1:String, _arg2:String):String{
var _local3:Object = DEFAULT_REGION_BY_LANG_AND_SCRIPT[_arg1];
var _local4:Object = SCRIPT_BY_ID[_arg2];
if ((((_local3 == null)) || ((_local4 == null)))){
return ("");
};
return (((_local3[int(_local4)]) || ("")));
}
}
Section 224
//ResourceBundle (mx.resources.ResourceBundle)
package mx.resources {
import mx.core.*;
import flash.system.*;
import mx.utils.*;
public class ResourceBundle implements IResourceBundle {
mx_internal var _locale:String;
private var _content:Object;
mx_internal var _bundleName:String;
mx_internal static const VERSION:String = "3.2.0.3958";
mx_internal static var backupApplicationDomain:ApplicationDomain;
mx_internal static var locale:String;
public function ResourceBundle(_arg1:String=null, _arg2:String=null){
_content = {};
super();
mx_internal::_locale = _arg1;
mx_internal::_bundleName = _arg2;
_content = getContent();
}
protected function getContent():Object{
return ({});
}
public function getString(_arg1:String):String{
return (String(_getObject(_arg1)));
}
public function get content():Object{
return (_content);
}
public function getBoolean(_arg1:String, _arg2:Boolean=true):Boolean{
var _local3:String = _getObject(_arg1).toLowerCase();
if (_local3 == "false"){
return (false);
};
if (_local3 == "true"){
return (true);
};
return (_arg2);
}
public function getStringArray(_arg1:String):Array{
var _local2:Array = _getObject(_arg1).split(",");
var _local3:int = _local2.length;
var _local4:int;
while (_local4 < _local3) {
_local2[_local4] = StringUtil.trim(_local2[_local4]);
_local4++;
};
return (_local2);
}
public function getObject(_arg1:String):Object{
return (_getObject(_arg1));
}
private function _getObject(_arg1:String):Object{
var _local2:Object = content[_arg1];
if (!_local2){
throw (new Error(((("Key " + _arg1) + " was not found in resource bundle ") + bundleName)));
};
return (_local2);
}
public function get locale():String{
return (mx_internal::_locale);
}
public function get bundleName():String{
return (mx_internal::_bundleName);
}
public function getNumber(_arg1:String):Number{
return (Number(_getObject(_arg1)));
}
private static function getClassByName(_arg1:String, _arg2:ApplicationDomain):Class{
var _local3:Class;
if (_arg2.hasDefinition(_arg1)){
_local3 = (_arg2.getDefinition(_arg1) as Class);
};
return (_local3);
}
public static function getResourceBundle(_arg1:String, _arg2:ApplicationDomain=null):ResourceBundle{
var _local3:String;
var _local4:Class;
var _local5:Object;
var _local6:ResourceBundle;
if (!_arg2){
_arg2 = ApplicationDomain.currentDomain;
};
_local3 = (((mx_internal::locale + "$") + _arg1) + "_properties");
_local4 = getClassByName(_local3, _arg2);
if (!_local4){
_local3 = (_arg1 + "_properties");
_local4 = getClassByName(_local3, _arg2);
};
if (!_local4){
_local3 = _arg1;
_local4 = getClassByName(_local3, _arg2);
};
if (((!(_local4)) && (mx_internal::backupApplicationDomain))){
_local3 = (_arg1 + "_properties");
_local4 = getClassByName(_local3, mx_internal::backupApplicationDomain);
if (!_local4){
_local3 = _arg1;
_local4 = getClassByName(_local3, mx_internal::backupApplicationDomain);
};
};
if (_local4){
_local5 = new (_local4);
if ((_local5 is ResourceBundle)){
_local6 = ResourceBundle(_local5);
return (_local6);
};
};
throw (new Error(("Could not find resource bundle " + _arg1)));
}
}
}//package mx.resources
Section 225
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import mx.core.*;
public class ResourceManager {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var implClassDependency:ResourceManagerImpl;
private static var instance:IResourceManager;
public static function getInstance():IResourceManager{
if (!instance){
try {
instance = IResourceManager(Singleton.getInstance("mx.resources::IResourceManager"));
} catch(e:Error) {
instance = new ResourceManagerImpl();
};
};
return (instance);
}
}
}//package mx.resources
Section 226
//ResourceManagerImpl (mx.resources.ResourceManagerImpl)
package mx.resources {
import flash.events.*;
import mx.core.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import flash.utils.*;
import mx.utils.*;
public class ResourceManagerImpl extends EventDispatcher implements IResourceManager {
private var resourceModules:Object;
private var initializedForNonFrameworkApp:Boolean;// = false
private var localeMap:Object;
private var _localeChain:Array;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var instance:IResourceManager;
public function ResourceManagerImpl(){
localeMap = {};
resourceModules = {};
super();
}
public function get localeChain():Array{
return (_localeChain);
}
public function set localeChain(_arg1:Array):void{
_localeChain = _arg1;
update();
}
public function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (null);
};
var _local5:* = _local4.content[_arg2];
var _local6:Array = String(_local5).split(",");
var _local7:int = _local6.length;
var _local8:int;
while (_local8 < _local7) {
_local6[_local8] = StringUtil.trim(_local6[_local8]);
_local8++;
};
return (_local6);
}
mx_internal function installCompiledResourceBundle(_arg1:ApplicationDomain, _arg2:String, _arg3:String):void{
var _local4:String;
var _local5:String = _arg3;
var _local6:int = _arg3.indexOf(":");
if (_local6 != -1){
_local4 = _arg3.substring(0, _local6);
_local5 = _arg3.substring((_local6 + 1));
};
if (getResourceBundle(_arg2, _arg3)){
return;
};
var _local7 = (((_arg2 + "$") + _local5) + "_properties");
if (_local4 != null){
_local7 = ((_local4 + ".") + _local7);
};
var _local8:Class;
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
if (!_local8){
_local7 = _arg3;
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
};
if (!_local8){
_local7 = (_arg3 + "_properties");
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
};
if (!_local8){
throw (new Error((((("Could not find compiled resource bundle '" + _arg3) + "' for locale '") + _arg2) + "'.")));
};
var _local9:ResourceBundle = ResourceBundle(new (_local8));
_local9.mx_internal::_locale = _arg2;
_local9.mx_internal::_bundleName = _arg3;
addResourceBundle(_local9);
}
public function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String{
var _local5:IResourceBundle = findBundle(_arg1, _arg2, _arg4);
if (!_local5){
return (null);
};
var _local6:String = String(_local5.content[_arg2]);
if (_arg3){
_local6 = StringUtil.substitute(_local6, _arg3);
};
return (_local6);
}
public function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher{
var moduleInfo:IModuleInfo;
var resourceEventDispatcher:ResourceEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = _arg1;
var updateFlag = _arg2;
var applicationDomain = _arg3;
var securityDomain = _arg4;
moduleInfo = ModuleManager.getModule(url);
resourceEventDispatcher = new ResourceEventDispatcher(moduleInfo);
var readyHandler:Function = function (_arg1:ModuleEvent):void{
var _local2:* = _arg1.module.factory.create();
resourceModules[_arg1.module.url].resourceModule = _local2;
if (updateFlag){
update();
};
};
moduleInfo.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
var errorHandler:Function = function (_arg1:ModuleEvent):void{
var _local3:ResourceEvent;
var _local2:String = ("Unable to load resource module from " + url);
if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR)){
_local3 = new ResourceEvent(ResourceEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local3.bytesLoaded = 0;
_local3.bytesTotal = 0;
_local3.errorText = _local2;
resourceEventDispatcher.dispatchEvent(_local3);
} else {
throw (new Error(_local2));
};
};
moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
resourceModules[url] = new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (_arg1:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
moduleInfo.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (resourceEventDispatcher);
}
public function getLocales():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in localeMap) {
_local1.push(_local2);
};
return (_local1);
}
public function removeResourceBundlesForLocale(_arg1:String):void{
delete localeMap[_arg1];
}
public function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle{
var _local3:Object = localeMap[_arg1];
if (!_local3){
return (null);
};
return (_local3[_arg2]);
}
private function dumpResourceModule(_arg1):void{
var _local2:ResourceBundle;
var _local3:String;
for each (_local2 in _arg1.resourceBundles) {
trace(_local2.locale, _local2.bundleName);
for (_local3 in _local2.content) {
};
};
}
public function addResourceBundle(_arg1:IResourceBundle):void{
var _local2:String = _arg1.locale;
var _local3:String = _arg1.bundleName;
if (!localeMap[_local2]){
localeMap[_local2] = {};
};
localeMap[_local2][_local3] = _arg1;
}
public function getObject(_arg1:String, _arg2:String, _arg3:String=null){
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (undefined);
};
return (_local4.content[_arg2]);
}
public function getInt(_arg1:String, _arg2:String, _arg3:String=null):int{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (0);
};
var _local5:* = _local4.content[_arg2];
return (int(_local5));
}
private function findBundle(_arg1:String, _arg2:String, _arg3:String):IResourceBundle{
supportNonFrameworkApps();
return (((_arg3)!=null) ? getResourceBundle(_arg3, _arg1) : findResourceBundleWithResource(_arg1, _arg2));
}
private function supportNonFrameworkApps():void{
if (initializedForNonFrameworkApp){
return;
};
initializedForNonFrameworkApp = true;
if (getLocales().length > 0){
return;
};
var _local1:ApplicationDomain = ApplicationDomain.currentDomain;
if (!_local1.hasDefinition("_CompiledResourceBundleInfo")){
return;
};
var _local2:Class = Class(_local1.getDefinition("_CompiledResourceBundleInfo"));
var _local3:Array = _local2.compiledLocales;
var _local4:Array = _local2.compiledResourceBundleNames;
installCompiledResourceBundles(_local1, _local3, _local4);
localeChain = _local3;
}
public function getBundleNamesForLocale(_arg1:String):Array{
var _local3:String;
var _local2:Array = [];
for (_local3 in localeMap[_arg1]) {
_local2.push(_local3);
};
return (_local2);
}
public function getPreferredLocaleChain():Array{
return (LocaleSorter.sortLocalesByPreference(getLocales(), getSystemPreferredLocales(), null, true));
}
public function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (NaN);
};
var _local5:* = _local4.content[_arg2];
return (Number(_local5));
}
public function update():void{
dispatchEvent(new Event(Event.CHANGE));
}
public function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (null);
};
var _local5:* = _local4.content[_arg2];
return ((_local5 as Class));
}
public function removeResourceBundle(_arg1:String, _arg2:String):void{
delete localeMap[_arg1][_arg2];
if (getBundleNamesForLocale(_arg1).length == 0){
delete localeMap[_arg1];
};
}
public function initializeLocaleChain(_arg1:Array):void{
localeChain = LocaleSorter.sortLocalesByPreference(_arg1, getSystemPreferredLocales(), null, true);
}
public function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle{
var _local5:String;
var _local6:Object;
var _local7:ResourceBundle;
if (!_localeChain){
return (null);
};
var _local3:int = _localeChain.length;
var _local4:int;
while (_local4 < _local3) {
_local5 = localeChain[_local4];
_local6 = localeMap[_local5];
if (!_local6){
} else {
_local7 = _local6[_arg1];
if (!_local7){
} else {
if ((_arg2 in _local7.content)){
return (_local7);
};
};
};
_local4++;
};
return (null);
}
public function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (0);
};
var _local5:* = _local4.content[_arg2];
return (uint(_local5));
}
private function getSystemPreferredLocales():Array{
var _local1:Array;
if (Capabilities["languages"]){
_local1 = Capabilities["languages"];
} else {
_local1 = [Capabilities.language];
};
return (_local1);
}
public function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void{
var _local7:String;
var _local8:int;
var _local9:String;
var _local4:int = (_arg2) ? _arg2.length : 0;
var _local5:int = (_arg3) ? _arg3.length : 0;
var _local6:int;
while (_local6 < _local4) {
_local7 = _arg2[_local6];
_local8 = 0;
while (_local8 < _local5) {
_local9 = _arg3[_local8];
mx_internal::installCompiledResourceBundle(_arg1, _local7, _local9);
_local8++;
};
_local6++;
};
}
public function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (false);
};
var _local5:* = _local4.content[_arg2];
return ((String(_local5).toLowerCase() == "true"));
}
public function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void{
throw (new Error("unloadResourceModule() is not yet implemented."));
}
public static function getInstance():IResourceManager{
if (!instance){
instance = new (ResourceManagerImpl);
};
return (instance);
}
}
}//package mx.resources
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class ResourceModuleInfo {
public var resourceModule:IResourceModule;
public var errorHandler:Function;
public var readyHandler:Function;
public var moduleInfo:IModuleInfo;
private function ResourceModuleInfo(_arg1:IModuleInfo, _arg2:Function, _arg3:Function){
this.moduleInfo = _arg1;
this.readyHandler = _arg2;
this.errorHandler = _arg3;
}
}
class ResourceEventDispatcher extends EventDispatcher {
private function ResourceEventDispatcher(_arg1:IModuleInfo){
_arg1.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
private function moduleInfo_readyHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.COMPLETE);
dispatchEvent(_local2);
}
private function moduleInfo_errorHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
_local2.errorText = _arg1.errorText;
dispatchEvent(_local2);
}
}
Section 227
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.graphics.*;
import mx.utils.*;
public class HaloBorder extends RectangularBorder {
mx_internal var radiusObj:Object;
mx_internal var backgroundHole:Object;
mx_internal var radius:Number;
mx_internal var bRoundedCorners:Boolean;
mx_internal var backgroundColor:Object;
private var dropShadow:RectangularDropShadow;
protected var _borderMetrics:EdgeMetrics;
mx_internal var backgroundAlphaName:String;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var BORDER_WIDTHS:Object = {none:0, solid:1, inset:2, outset:2, alert:3, dropdown:2, menuBorder:1, comboNonEdit:2};
public function HaloBorder(){
BORDER_WIDTHS["default"] = 3;
}
override public function styleChanged(_arg1:String):void{
if ((((((((((_arg1 == null)) || ((_arg1 == "styleName")))) || ((_arg1 == "borderStyle")))) || ((_arg1 == "borderThickness")))) || ((_arg1 == "borderSides")))){
_borderMetrics = null;
};
invalidateDisplayList();
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
return;
};
super.updateDisplayList(_arg1, _arg2);
backgroundColor = getBackgroundColor();
bRoundedCorners = false;
backgroundAlphaName = "backgroundAlpha";
backgroundHole = null;
radius = 0;
radiusObj = null;
drawBorder(_arg1, _arg2);
drawBackground(_arg1, _arg2);
}
mx_internal function drawBorder(_arg1:Number, _arg2:Number):void{
var _local5:Number;
var _local6:uint;
var _local7:uint;
var _local8:String;
var _local9:Number;
var _local10:uint;
var _local11:Boolean;
var _local12:uint;
var _local13:Array;
var _local14:Array;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:uint;
var _local19:Boolean;
var _local20:Object;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Object;
var _local27:Number;
var _local28:Number;
var _local29:IContainer;
var _local30:EdgeMetrics;
var _local31:Boolean;
var _local32:Number;
var _local33:Array;
var _local34:uint;
var _local35:Boolean;
var _local36:Number;
var _local3:String = getStyle("borderStyle");
var _local4:Array = getStyle("highlightAlphas");
var _local21:Boolean;
var _local26:Graphics = graphics;
_local26.clear();
if (_local3){
switch (_local3){
case "none":
break;
case "inset":
_local7 = getStyle("borderColor");
_local22 = ColorUtil.adjustBrightness2(_local7, -40);
_local23 = ColorUtil.adjustBrightness2(_local7, 25);
_local24 = ColorUtil.adjustBrightness2(_local7, 40);
_local25 = backgroundColor;
if ((((_local25 === null)) || ((_local25 === "")))){
_local25 = _local7;
};
draw3dBorder(_local23, _local22, _local24, Number(_local25), Number(_local25), Number(_local25));
break;
case "outset":
_local7 = getStyle("borderColor");
_local22 = ColorUtil.adjustBrightness2(_local7, -40);
_local23 = ColorUtil.adjustBrightness2(_local7, -25);
_local24 = ColorUtil.adjustBrightness2(_local7, 40);
_local25 = backgroundColor;
if ((((_local25 === null)) || ((_local25 === "")))){
_local25 = _local7;
};
draw3dBorder(_local23, _local24, _local22, Number(_local25), Number(_local25), Number(_local25));
break;
case "alert":
case "default":
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_local27 = getStyle("backgroundAlpha");
_local5 = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
_local28 = (bRoundedCorners) ? radius : 0;
drawDropShadow(0, 0, _arg1, _arg2, radius, radius, _local28, _local28);
if (!bRoundedCorners){
radiusObj = {};
};
_local29 = (parent as IContainer);
if (_local29){
_local30 = _local29.viewMetrics;
backgroundHole = {x:_local30.left, y:_local30.top, w:Math.max(0, ((_arg1 - _local30.left) - _local30.right)), h:Math.max(0, ((_arg2 - _local30.top) - _local30.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (_local27 != _local5){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
_local26.beginFill(Number(backgroundColor), _local27);
_local26.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
_local26.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
break;
case "dropdown":
_local12 = getStyle("dropdownBorderColor");
drawDropShadow(0, 0, _arg1, _arg2, 4, 0, 0, 4);
drawRoundRect(0, 0, _arg1, _arg2, {tl:4, tr:0, br:0, bl:4}, 5068126, 1);
drawRoundRect(0, 0, _arg1, _arg2, {tl:4, tr:0, br:0, bl:4}, [0xFFFFFF, 0xFFFFFF], [0.7, 0], verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(1, 1, (_arg1 - 1), (_arg2 - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (_arg1 - 1), (_arg2 - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (_arg1 - 1), (_arg2 - 3)));
if (!isNaN(_local12)){
drawRoundRect(0, 0, (_arg1 + 1), _arg2, {tl:4, tr:0, br:0, bl:4}, _local12, 0.5);
drawRoundRect(1, 1, (_arg1 - 1), (_arg2 - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (_arg1 - 1), (_arg2 - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (_arg1 - 1), (_arg2 - 3)));
};
backgroundColor = null;
break;
case "menuBorder":
_local7 = getStyle("borderColor");
drawRoundRect(0, 0, _arg1, _arg2, 0, _local7, 1);
drawDropShadow(1, 1, (_arg1 - 2), (_arg2 - 2), 0, 0, 0, 0);
break;
case "comboNonEdit":
break;
case "controlBar":
if ((((_arg1 == 0)) || ((_arg2 == 0)))){
backgroundColor = null;
break;
};
_local14 = getStyle("footerColors");
_local31 = !((_local14 == null));
_local32 = getStyle("borderAlpha");
if (_local31){
_local26.lineStyle(0, ((_local14.length > 0)) ? _local14[1] : _local14[0], _local32);
_local26.moveTo(0, 0);
_local26.lineTo(_arg1, 0);
_local26.lineStyle(0, 0, 0);
if (((((parent) && (parent.parent))) && ((parent.parent is IStyleClient)))){
radius = IStyleClient(parent.parent).getStyle("cornerRadius");
_local32 = IStyleClient(parent.parent).getStyle("borderAlpha");
};
if (isNaN(radius)){
radius = 0;
};
if (IStyleClient(parent.parent).getStyle("roundedBottomCorners").toString().toLowerCase() != "true"){
radius = 0;
};
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:0, tr:0, bl:radius, br:radius}, _local14, _local32, verticalGradientMatrix(0, 0, _arg1, _arg2));
if ((((_local14.length > 1)) && (!((_local14[0] == _local14[1]))))){
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:0, tr:0, bl:radius, br:radius}, [0xFFFFFF, 0xFFFFFF], _local4, verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(1, 2, (_arg1 - 2), (_arg2 - 3), {tl:0, tr:0, bl:(radius - 1), br:(radius - 1)}, _local14, _local32, verticalGradientMatrix(0, 0, _arg1, _arg2));
};
};
backgroundColor = null;
break;
case "applicationControlBar":
_local13 = getStyle("fillColors");
_local5 = getStyle("backgroundAlpha");
_local4 = getStyle("highlightAlphas");
_local33 = getStyle("fillAlphas");
_local11 = getStyle("docked");
_local34 = uint(backgroundColor);
radius = getStyle("cornerRadius");
if (!radius){
radius = 0;
};
drawDropShadow(0, 1, _arg1, (_arg2 - 1), radius, radius, radius, radius);
if (((!((backgroundColor === null))) && (StyleManager.isValidStyleValue(backgroundColor)))){
drawRoundRect(0, 1, _arg1, (_arg2 - 1), radius, _local34, _local5, verticalGradientMatrix(0, 0, _arg1, _arg2));
};
drawRoundRect(0, 1, _arg1, (_arg2 - 1), radius, _local13, _local33, verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(0, 1, _arg1, ((_arg2 / 2) - 1), {tl:radius, tr:radius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], _local4, verticalGradientMatrix(0, 0, _arg1, ((_arg2 / 2) - 1)));
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, 0.3, null, GradientType.LINEAR, null, {x:0, y:2, w:_arg1, h:(_arg2 - 2), r:{tl:radius, tr:radius, bl:0, br:0}});
backgroundColor = null;
break;
default:
_local7 = getStyle("borderColor");
_local9 = getStyle("borderThickness");
_local8 = getStyle("borderSides");
_local35 = true;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
_local36 = Math.max((radius - _local9), 0);
_local20 = {x:_local9, y:_local9, w:(_arg1 - (_local9 * 2)), h:(_arg2 - (_local9 * 2)), r:_local36};
if (!bRoundedCorners){
radiusObj = {tl:radius, tr:radius, bl:0, br:0};
_local20.r = {tl:_local36, tr:_local36, bl:0, br:0};
};
if (_local8 != "left top right bottom"){
_local20.r = {tl:_local36, tr:_local36, bl:(bRoundedCorners) ? _local36 : 0, br:(bRoundedCorners) ? _local36 : 0};
radiusObj = {tl:radius, tr:radius, bl:(bRoundedCorners) ? radius : 0, br:(bRoundedCorners) ? radius : 0};
_local8 = _local8.toLowerCase();
if (_local8.indexOf("left") == -1){
_local20.x = 0;
_local20.w = (_local20.w + _local9);
_local20.r.tl = 0;
_local20.r.bl = 0;
radiusObj.tl = 0;
radiusObj.bl = 0;
_local35 = false;
};
if (_local8.indexOf("top") == -1){
_local20.y = 0;
_local20.h = (_local20.h + _local9);
_local20.r.tl = 0;
_local20.r.tr = 0;
radiusObj.tl = 0;
radiusObj.tr = 0;
_local35 = false;
};
if (_local8.indexOf("right") == -1){
_local20.w = (_local20.w + _local9);
_local20.r.tr = 0;
_local20.r.br = 0;
radiusObj.tr = 0;
radiusObj.br = 0;
_local35 = false;
};
if (_local8.indexOf("bottom") == -1){
_local20.h = (_local20.h + _local9);
_local20.r.bl = 0;
_local20.r.br = 0;
radiusObj.bl = 0;
radiusObj.br = 0;
_local35 = false;
};
};
if ((((radius == 0)) && (_local35))){
drawDropShadow(0, 0, _arg1, _arg2, 0, 0, 0, 0);
_local26.beginFill(_local7);
_local26.drawRect(0, 0, _arg1, _arg2);
_local26.drawRect(_local9, _local9, (_arg1 - (2 * _local9)), (_arg2 - (2 * _local9)));
_local26.endFill();
} else {
if (radiusObj){
drawDropShadow(0, 0, _arg1, _arg2, radiusObj.tl, radiusObj.tr, radiusObj.br, radiusObj.bl);
drawRoundRect(0, 0, _arg1, _arg2, radiusObj, _local7, 1, null, null, null, _local20);
radiusObj.tl = Math.max((radius - _local9), 0);
radiusObj.tr = Math.max((radius - _local9), 0);
radiusObj.bl = (bRoundedCorners) ? Math.max((radius - _local9), 0) : 0;
radiusObj.br = (bRoundedCorners) ? Math.max((radius - _local9), 0) : 0;
} else {
drawDropShadow(0, 0, _arg1, _arg2, radius, radius, radius, radius);
drawRoundRect(0, 0, _arg1, _arg2, radius, _local7, 1, null, null, null, _local20);
radius = Math.max((getStyle("cornerRadius") - _local9), 0);
};
};
};
};
}
mx_internal function drawBackground(_arg1:Number, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:EdgeMetrics;
var _local7:Graphics;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Number;
if (((((((!((backgroundColor === null))) && (!((backgroundColor === ""))))) || (getStyle("mouseShield")))) || (getStyle("mouseShieldChildren")))){
_local4 = Number(backgroundColor);
_local5 = 1;
_local6 = getBackgroundColorMetrics();
_local7 = graphics;
if (((((isNaN(_local4)) || ((backgroundColor === "")))) || ((backgroundColor === null)))){
_local5 = 0;
_local4 = 0xFFFFFF;
} else {
_local5 = getStyle(backgroundAlphaName);
};
if (((!((radius == 0))) || (backgroundHole))){
_local8 = _local6.bottom;
if (radiusObj){
_local9 = (bRoundedCorners) ? radius : 0;
radiusObj = {tl:radius, tr:radius, bl:_local9, br:_local9};
drawRoundRect(_local6.left, _local6.top, (width - (_local6.left + _local6.right)), (height - (_local6.top + _local8)), radiusObj, _local4, _local5, null, GradientType.LINEAR, null, backgroundHole);
} else {
drawRoundRect(_local6.left, _local6.top, (width - (_local6.left + _local6.right)), (height - (_local6.top + _local8)), radius, _local4, _local5, null, GradientType.LINEAR, null, backgroundHole);
};
} else {
_local7.beginFill(_local4, _local5);
_local7.drawRect(_local6.left, _local6.top, ((_arg1 - _local6.right) - _local6.left), ((_arg2 - _local6.bottom) - _local6.top));
_local7.endFill();
};
};
var _local3:String = getStyle("borderStyle");
if ((((((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) && ((((_local3 == "alert")) || ((_local3 == "default")))))) && ((getStyle("headerColors") == null)))){
_local10 = getStyle("highlightAlphas");
_local11 = (_local10) ? _local10[0] : 0.3;
drawRoundRect(0, 0, _arg1, _arg2, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, _local11, null, GradientType.LINEAR, null, {x:0, y:1, w:_arg1, h:(_arg2 - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
mx_internal function drawDropShadow(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local11:Number;
var _local12:Boolean;
if ((((((((getStyle("dropShadowEnabled") == false)) || ((getStyle("dropShadowEnabled") == "false")))) || ((_arg3 == 0)))) || ((_arg4 == 0)))){
return;
};
var _local9:Number = getStyle("shadowDistance");
var _local10:String = getStyle("shadowDirection");
if (getStyle("borderStyle") == "applicationControlBar"){
_local12 = getStyle("docked");
_local11 = (_local12) ? 90 : getDropShadowAngle(_local9, _local10);
_local9 = Math.abs(_local9);
} else {
_local11 = getDropShadowAngle(_local9, _local10);
_local9 = (Math.abs(_local9) + 2);
};
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = _local9;
dropShadow.angle = _local11;
dropShadow.color = getStyle("dropShadowColor");
dropShadow.alpha = 0.4;
dropShadow.tlRadius = _arg5;
dropShadow.trRadius = _arg6;
dropShadow.blRadius = _arg8;
dropShadow.brRadius = _arg7;
dropShadow.drawShadow(graphics, _arg1, _arg2, _arg3, _arg4);
}
mx_internal function getBackgroundColor():Object{
var _local2:Object;
var _local1:IUIComponent = (parent as IUIComponent);
if (((_local1) && (!(_local1.enabled)))){
_local2 = getStyle("backgroundDisabledColor");
if (((!((_local2 === null))) && (StyleManager.isValidStyleValue(_local2)))){
return (_local2);
};
};
return (getStyle("backgroundColor"));
}
mx_internal function draw3dBorder(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Number = width;
var _local8:Number = height;
drawDropShadow(0, 0, width, height, 0, 0, 0, 0);
var _local9:Graphics = graphics;
_local9.beginFill(_arg1);
_local9.drawRect(0, 0, _local7, _local8);
_local9.drawRect(1, 0, (_local7 - 2), _local8);
_local9.endFill();
_local9.beginFill(_arg2);
_local9.drawRect(1, 0, (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg3);
_local9.drawRect(1, (_local8 - 1), (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg4);
_local9.drawRect(1, 1, (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg5);
_local9.drawRect(1, (_local8 - 2), (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg6);
_local9.drawRect(1, 2, (_local7 - 2), (_local8 - 4));
_local9.drawRect(2, 2, (_local7 - 4), (_local8 - 4));
_local9.endFill();
}
mx_internal function getBackgroundColorMetrics():EdgeMetrics{
return (borderMetrics);
}
mx_internal function getDropShadowAngle(_arg1:Number, _arg2:String):Number{
if (_arg2 == "left"){
return (((_arg1 >= 0)) ? 135 : 225);
//unresolved jump
};
if (_arg2 == "right"){
return (((_arg1 >= 0)) ? 45 : 315);
//unresolved jump
};
return (((_arg1 >= 0)) ? 90 : 270);
}
override public function get borderMetrics():EdgeMetrics{
var _local1:Number;
var _local3:String;
if (_borderMetrics){
return (_borderMetrics);
};
var _local2:String = getStyle("borderStyle");
if ((((_local2 == "default")) || ((_local2 == "alert")))){
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_borderMetrics = new EdgeMetrics(0, 0, 0, 0);
} else {
return (EdgeMetrics.EMPTY);
};
} else {
if ((((_local2 == "controlBar")) || ((_local2 == "applicationControlBar")))){
_borderMetrics = new EdgeMetrics(1, 1, 1, 1);
} else {
if (_local2 == "solid"){
_local1 = getStyle("borderThickness");
if (isNaN(_local1)){
_local1 = 0;
};
_borderMetrics = new EdgeMetrics(_local1, _local1, _local1, _local1);
_local3 = getStyle("borderSides");
if (_local3 != "left top right bottom"){
if (_local3.indexOf("left") == -1){
_borderMetrics.left = 0;
};
if (_local3.indexOf("top") == -1){
_borderMetrics.top = 0;
};
if (_local3.indexOf("right") == -1){
_borderMetrics.right = 0;
};
if (_local3.indexOf("bottom") == -1){
_borderMetrics.bottom = 0;
};
};
} else {
_local1 = BORDER_WIDTHS[_local2];
if (isNaN(_local1)){
_local1 = 0;
};
_borderMetrics = new EdgeMetrics(_local1, _local1, _local1, _local1);
};
};
};
return (_borderMetrics);
}
}
}//package mx.skins.halo
Section 228
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
public function get inheritingStyles():Object{
return (styleName.inheritingStyles);
}
public function set inheritingStyles(_arg1:Object):void{
}
public function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void{
}
public function registerEffects(_arg1:Array):void{
}
public function regenerateStyleCache(_arg1:Boolean):void{
}
public function get styleDeclaration():CSSStyleDeclaration{
return (CSSStyleDeclaration(styleName));
}
public function getClassStyleDeclarations():Array{
return ([]);
}
public function get className():String{
return ("HaloFocusRect");
}
public function clearStyle(_arg1:String):void{
if (_arg1 == "focusColor"){
_focusColor = NaN;
};
}
public function setStyle(_arg1:String, _arg2):void{
if (_arg1 == "focusColor"){
_focusColor = _arg2;
};
}
public function set nonInheritingStyles(_arg1:Object):void{
}
public function get nonInheritingStyles():Object{
return (styleName.nonInheritingStyles);
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
super.updateDisplayList(_arg1, _arg2);
var _local3:String = getStyle("focusBlendMode");
var _local4:Number = getStyle("focusAlpha");
var _local5:Number = getStyle("focusColor");
var _local6:Number = getStyle("cornerRadius");
var _local7:Number = getStyle("focusThickness");
var _local8:String = getStyle("focusRoundedCorners");
var _local9:Number = getStyle("themeColor");
var _local10:Number = _local5;
if (isNaN(_local10)){
_local10 = _local9;
};
var _local11:Graphics = graphics;
_local11.clear();
blendMode = _local3;
if (((!((_local8 == "tl tr bl br"))) && ((_local6 > 0)))){
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local15 = 0;
_local16 = (_local6 + _local7);
if (_local8.indexOf("tl") >= 0){
_local12 = _local16;
};
if (_local8.indexOf("tr") >= 0){
_local14 = _local16;
};
if (_local8.indexOf("bl") >= 0){
_local13 = _local16;
};
if (_local8.indexOf("br") >= 0){
_local15 = _local16;
};
_local11.beginFill(_local10, _local4);
GraphicsUtil.drawRoundRectComplex(_local11, 0, 0, _arg1, _arg2, _local12, _local14, _local13, _local15);
_local12 = (_local12) ? _local6 : 0;
_local14 = (_local14) ? _local6 : 0;
_local13 = (_local13) ? _local6 : 0;
_local15 = (_local15) ? _local6 : 0;
GraphicsUtil.drawRoundRectComplex(_local11, _local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local12, _local14, _local13, _local15);
_local11.endFill();
_local16 = (_local6 + (_local7 / 2));
_local12 = (_local12) ? _local16 : 0;
_local14 = (_local14) ? _local16 : 0;
_local13 = (_local13) ? _local16 : 0;
_local15 = (_local15) ? _local16 : 0;
_local11.beginFill(_local10, _local4);
GraphicsUtil.drawRoundRectComplex(_local11, (_local7 / 2), (_local7 / 2), (_arg1 - _local7), (_arg2 - _local7), _local12, _local14, _local13, _local15);
_local12 = (_local12) ? _local6 : 0;
_local14 = (_local14) ? _local6 : 0;
_local13 = (_local13) ? _local6 : 0;
_local15 = (_local15) ? _local6 : 0;
GraphicsUtil.drawRoundRectComplex(_local11, _local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local12, _local14, _local13, _local15);
_local11.endFill();
} else {
_local11.beginFill(_local10, _local4);
_local17 = (((_local6 > 0)) ? (_local6 + _local7) : 0 * 2);
_local11.drawRoundRect(0, 0, _arg1, _arg2, _local17, _local17);
_local17 = (_local6 * 2);
_local11.drawRoundRect(_local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local17, _local17);
_local11.endFill();
_local11.beginFill(_local10, _local4);
_local17 = (((_local6 > 0)) ? (_local6 + (_local7 / 2)) : 0 * 2);
_local11.drawRoundRect((_local7 / 2), (_local7 / 2), (_arg1 - _local7), (_arg2 - _local7), _local17, _local17);
_local17 = (_local6 * 2);
_local11.drawRoundRect(_local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local17, _local17);
_local11.endFill();
};
}
override public function getStyle(_arg1:String){
return (((_arg1 == "focusColor")) ? _focusColor : super.getStyle(_arg1));
}
public function set styleDeclaration(_arg1:CSSStyleDeclaration):void{
}
}
}//package mx.skins.halo
Section 229
//PanelSkin (mx.skins.halo.PanelSkin)
package mx.skins.halo {
import mx.core.*;
import flash.display.*;
import flash.utils.*;
public class PanelSkin extends HaloBorder {
private var oldControlBarHeight:Number;
protected var _panelBorderMetrics:EdgeMetrics;
private var oldHeaderHeight:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var panels:Object = {};
override public function styleChanged(_arg1:String):void{
super.styleChanged(_arg1);
if ((((((((((((((((((_arg1 == null)) || ((_arg1 == "styleName")))) || ((_arg1 == "borderStyle")))) || ((_arg1 == "borderThickness")))) || ((_arg1 == "borderThicknessTop")))) || ((_arg1 == "borderThicknessBottom")))) || ((_arg1 == "borderThicknessLeft")))) || ((_arg1 == "borderThicknessRight")))) || ((_arg1 == "borderSides")))){
_panelBorderMetrics = null;
};
invalidateDisplayList();
}
override mx_internal function drawBorder(_arg1:Number, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Graphics;
var _local8:IContainer;
var _local9:EdgeMetrics;
super.drawBorder(_arg1, _arg2);
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return;
};
var _local3:String = getStyle("borderStyle");
if (_local3 == "default"){
_local4 = getStyle("backgroundAlpha");
_local5 = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radiusObj = null;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
_local6 = (bRoundedCorners) ? radius : 0;
_local7 = graphics;
drawDropShadow(0, 0, _arg1, _arg2, radius, radius, _local6, _local6);
if (!bRoundedCorners){
radiusObj = {};
};
_local8 = (parent as IContainer);
if (_local8){
_local9 = _local8.viewMetrics;
backgroundHole = {x:_local9.left, y:_local9.top, w:Math.max(0, ((_arg1 - _local9.left) - _local9.right)), h:Math.max(0, ((_arg2 - _local9.top) - _local9.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (_local4 != _local5){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
_local7.beginFill(Number(backgroundColor), _local4);
_local7.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
_local7.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
}
override public function get borderMetrics():EdgeMetrics{
var _local4:Number;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return (super.borderMetrics);
};
var _local1:Boolean = isPanel(parent);
var _local2:IUIComponent = (_local1) ? Object(parent)._controlBar : null;
var _local3:Number = (_local1) ? Object(parent).getHeaderHeightProxy() : NaN;
if (((_local2) && (_local2.includeInLayout))){
_local4 = _local2.getExplicitOrMeasuredHeight();
};
if (((!((_local4 == oldControlBarHeight))) && (!(((isNaN(oldControlBarHeight)) && (isNaN(_local4))))))){
_panelBorderMetrics = null;
};
if (((!((_local3 == oldHeaderHeight))) && (!(((isNaN(_local3)) && (isNaN(oldHeaderHeight))))))){
_panelBorderMetrics = null;
};
if (_panelBorderMetrics){
return (_panelBorderMetrics);
};
var _local5:EdgeMetrics = super.borderMetrics;
var _local6:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
var _local7:Number = getStyle("borderThickness");
var _local8:Number = getStyle("borderThicknessLeft");
var _local9:Number = getStyle("borderThicknessTop");
var _local10:Number = getStyle("borderThicknessRight");
var _local11:Number = getStyle("borderThicknessBottom");
_local6.left = (_local5.left + (isNaN(_local8)) ? _local7 : _local8);
_local6.top = (_local5.top + (isNaN(_local9)) ? _local7 : _local9);
_local6.right = (_local5.bottom + (isNaN(_local10)) ? _local7 : _local10);
_local6.bottom = (_local5.bottom + (isNaN(_local11)) ? (((_local2) && (!(isNaN(_local9))))) ? _local9 : (isNaN(_local8)) ? _local7 : _local8 : _local11);
oldHeaderHeight = _local3;
if (!isNaN(_local3)){
_local6.top = (_local6.top + _local3);
};
oldControlBarHeight = _local4;
if (!isNaN(_local4)){
_local6.bottom = (_local6.bottom + _local4);
};
_panelBorderMetrics = _local6;
return (_panelBorderMetrics);
}
override mx_internal function drawBackground(_arg1:Number, _arg2:Number):void{
var _local3:Array;
var _local4:Number;
super.drawBackground(_arg1, _arg2);
if ((((getStyle("headerColors") == null)) && ((getStyle("borderStyle") == "default")))){
_local3 = getStyle("highlightAlphas");
_local4 = (_local3) ? _local3[0] : 0.3;
drawRoundRect(0, 0, _arg1, _arg2, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, _local4, null, GradientType.LINEAR, null, {x:0, y:1, w:_arg1, h:(_arg2 - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
override mx_internal function getBackgroundColorMetrics():EdgeMetrics{
if (getStyle("borderStyle") == "default"){
return (EdgeMetrics.EMPTY);
};
return (super.borderMetrics);
}
private static function isPanel(_arg1:Object):Boolean{
var s:String;
var x:XML;
var parent = _arg1;
s = getQualifiedClassName(parent);
if (panels[s] == 1){
return (true);
};
if (panels[s] == 0){
return (false);
};
if (s == "mx.containers::Panel"){
(panels[s] == 1);
return (true);
};
x = describeType(parent);
var xmllist:XMLList = x.extendsClass.(@type == "mx.containers::Panel");
if (xmllist.length() == 0){
panels[s] = 0;
return (false);
};
panels[s] = 1;
return (true);
}
}
}//package mx.skins.halo
Section 230
//TitleBackground (mx.skins.halo.TitleBackground)
package mx.skins.halo {
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class TitleBackground extends ProgrammaticSkin {
mx_internal static const VERSION:String = "3.2.0.3958";
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
super.updateDisplayList(_arg1, _arg2);
var _local3:Number = getStyle("borderAlpha");
var _local4:Number = getStyle("cornerRadius");
var _local5:Array = getStyle("highlightAlphas");
var _local6:Array = getStyle("headerColors");
var _local7 = !((_local6 == null));
StyleManager.getColorNames(_local6);
var _local8:Number = ColorUtil.adjustBrightness2((_local6) ? _local6[1] : 0xFFFFFF, -20);
var _local9:Graphics = graphics;
_local9.clear();
if (_arg2 < 3){
return;
};
if (_local7){
_local9.lineStyle(0, _local8, _local3);
_local9.moveTo(0, _arg2);
_local9.lineTo(_arg1, _arg2);
_local9.lineStyle(0, 0, 0);
drawRoundRect(0, 0, _arg1, _arg2, {tl:_local4, tr:_local4, bl:0, br:0}, _local6, _local3, verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(0, 0, _arg1, (_arg2 / 2), {tl:_local4, tr:_local4, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], _local5, verticalGradientMatrix(0, 0, _arg1, (_arg2 / 2)));
drawRoundRect(0, 0, _arg1, _arg2, {tl:_local4, tr:_local4, bl:0, br:0}, 0xFFFFFF, _local5[0], null, GradientType.LINEAR, null, {x:0, y:1, w:_arg1, h:(_arg2 - 1), r:{tl:_local4, tr:_local4, bl:0, br:0}});
};
}
}
}//package mx.skins.halo
Section 231
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.2.0.3958";
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 232
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import flash.geom.*;
import mx.managers.*;
import mx.utils.*;
public class ProgrammaticSkin extends FlexShape implements IFlexDisplayObject, IInvalidating, ILayoutManagerClient, ISimpleStyleClient, IProgrammaticSkin {
private var _initialized:Boolean;// = false
private var _height:Number;
private var invalidateDisplayListFlag:Boolean;// = false
private var _styleName:IStyleClient;
private var _nestLevel:int;// = 0
private var _processedDescriptors:Boolean;// = false
private var _updateCompletePendingFlag:Boolean;// = true
private var _width:Number;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var tempMatrix:Matrix = new Matrix();
public function ProgrammaticSkin(){
_width = measuredWidth;
_height = measuredHeight;
}
public function getStyle(_arg1:String){
return ((_styleName) ? _styleName.getStyle(_arg1) : null);
}
protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
}
public function get nestLevel():int{
return (_nestLevel);
}
public function set nestLevel(_arg1:int):void{
_nestLevel = _arg1;
invalidateDisplayList();
}
override public function get height():Number{
return (_height);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function verticalGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix{
return (rotatedGradientMatrix(_arg1, _arg2, _arg3, _arg4, 90));
}
public function validateSize(_arg1:Boolean=false):void{
}
public function invalidateDisplayList():void{
if (((!(invalidateDisplayListFlag)) && ((nestLevel > 0)))){
invalidateDisplayListFlag = true;
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
}
public function set updateCompletePendingFlag(_arg1:Boolean):void{
_updateCompletePendingFlag = _arg1;
}
protected function horizontalGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix{
return (rotatedGradientMatrix(_arg1, _arg2, _arg3, _arg4, 0));
}
override public function set height(_arg1:Number):void{
_height = _arg1;
invalidateDisplayList();
}
public function set processedDescriptors(_arg1:Boolean):void{
_processedDescriptors = _arg1;
}
public function validateDisplayList():void{
invalidateDisplayListFlag = false;
updateDisplayList(width, height);
}
public function get measuredWidth():Number{
return (0);
}
override public function set width(_arg1:Number):void{
_width = _arg1;
invalidateDisplayList();
}
public function get measuredHeight():Number{
return (0);
}
public function set initialized(_arg1:Boolean):void{
_initialized = _arg1;
}
protected function drawRoundRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null, _arg6:Object=null, _arg7:Object=null, _arg8:Matrix=null, _arg9:String="linear", _arg10:Array=null, _arg11:Object=null):void{
var _local13:Number;
var _local14:Array;
var _local15:Object;
var _local12:Graphics = graphics;
if ((((_arg3 == 0)) || ((_arg4 == 0)))){
return;
};
if (_arg6 !== null){
if ((_arg6 is uint)){
_local12.beginFill(uint(_arg6), Number(_arg7));
} else {
if ((_arg6 is Array)){
_local14 = ((_arg7 is Array)) ? (_arg7 as Array) : [_arg7, _arg7];
if (!_arg10){
_arg10 = [0, 0xFF];
};
_local12.beginGradientFill(_arg9, (_arg6 as Array), _local14, _arg10, _arg8);
};
};
};
if (!_arg5){
_local12.drawRect(_arg1, _arg2, _arg3, _arg4);
} else {
if ((_arg5 is Number)){
_local13 = (Number(_arg5) * 2);
_local12.drawRoundRect(_arg1, _arg2, _arg3, _arg4, _local13, _local13);
} else {
GraphicsUtil.drawRoundRectComplex(_local12, _arg1, _arg2, _arg3, _arg4, _arg5.tl, _arg5.tr, _arg5.bl, _arg5.br);
};
};
if (_arg11){
_local15 = _arg11.r;
if ((_local15 is Number)){
_local13 = (Number(_local15) * 2);
_local12.drawRoundRect(_arg11.x, _arg11.y, _arg11.w, _arg11.h, _local13, _local13);
} else {
GraphicsUtil.drawRoundRectComplex(_local12, _arg11.x, _arg11.y, _arg11.w, _arg11.h, _local15.tl, _local15.tr, _local15.bl, _local15.br);
};
};
if (_arg6 !== null){
_local12.endFill();
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function set styleName(_arg1:Object):void{
if (_styleName != _arg1){
_styleName = (_arg1 as IStyleClient);
invalidateDisplayList();
};
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
var _local3:Boolean;
if (_width != _arg1){
_width = _arg1;
_local3 = true;
};
if (_height != _arg2){
_height = _arg2;
_local3 = true;
};
if (_local3){
invalidateDisplayList();
};
}
public function styleChanged(_arg1:String):void{
invalidateDisplayList();
}
override public function get width():Number{
return (_width);
}
public function invalidateProperties():void{
}
public function get initialized():Boolean{
return (_initialized);
}
protected function rotatedGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Matrix{
tempMatrix.createGradientBox(_arg3, _arg4, ((_arg5 * Math.PI) / 180), _arg1, _arg2);
return (tempMatrix);
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get styleName():Object{
return (_styleName);
}
public function validateNow():void{
if (invalidateDisplayListFlag){
validateDisplayList();
};
}
public function invalidateSize():void{
}
public function validateProperties():void{
}
}
}//package mx.skins
Section 233
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import flash.system.*;
import flash.geom.*;
import mx.resources.*;
import flash.utils.*;
import flash.net.*;
public class RectangularBorder extends Border implements IRectangularBorder {
private var backgroundImage:DisplayObject;
private var backgroundImageHeight:Number;
private var _backgroundImageBounds:Rectangle;
private var backgroundImageStyle:Object;
private var backgroundImageWidth:Number;
private var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.2.0.3958";
public function RectangularBorder(){
resourceManager = ResourceManager.getInstance();
super();
addEventListener(Event.REMOVED, removedHandler);
}
public function layoutBackgroundImage():void{
var _local4:Number;
var _local5:Number;
var _local7:Number;
var _local8:Number;
var _local14:Number;
var _local15:Graphics;
var _local1:DisplayObject = parent;
var _local2:EdgeMetrics = ((_local1 is IContainer)) ? IContainer(_local1).viewMetrics : borderMetrics;
var _local3 = !((getStyle("backgroundAttachment") == "fixed"));
if (_backgroundImageBounds){
_local4 = _backgroundImageBounds.width;
_local5 = _backgroundImageBounds.height;
} else {
_local4 = ((width - _local2.left) - _local2.right);
_local5 = ((height - _local2.top) - _local2.bottom);
};
var _local6:Number = getBackgroundSize();
if (isNaN(_local6)){
_local7 = 1;
_local8 = 1;
} else {
_local14 = (_local6 * 0.01);
_local7 = ((_local14 * _local4) / backgroundImageWidth);
_local8 = ((_local14 * _local5) / backgroundImageHeight);
};
backgroundImage.scaleX = _local7;
backgroundImage.scaleY = _local8;
var _local9:Number = Math.round((0.5 * (_local4 - (backgroundImageWidth * _local7))));
var _local10:Number = Math.round((0.5 * (_local5 - (backgroundImageHeight * _local8))));
backgroundImage.x = _local2.left;
backgroundImage.y = _local2.top;
var _local11:Shape = Shape(backgroundImage.mask);
_local11.x = _local2.left;
_local11.y = _local2.top;
if (((_local3) && ((_local1 is IContainer)))){
_local9 = (_local9 - IContainer(_local1).horizontalScrollPosition);
_local10 = (_local10 - IContainer(_local1).verticalScrollPosition);
};
backgroundImage.alpha = getStyle("backgroundAlpha");
backgroundImage.x = (backgroundImage.x + _local9);
backgroundImage.y = (backgroundImage.y + _local10);
var _local12:Number = ((width - _local2.left) - _local2.right);
var _local13:Number = ((height - _local2.top) - _local2.bottom);
if (((!((_local11.width == _local12))) || (!((_local11.height == _local13))))){
_local15 = _local11.graphics;
_local15.clear();
_local15.beginFill(0xFFFFFF);
_local15.drawRect(0, 0, _local12, _local13);
_local15.endFill();
};
}
public function set backgroundImageBounds(_arg1:Rectangle):void{
_backgroundImageBounds = _arg1;
invalidateDisplayList();
}
private function getBackgroundSize():Number{
var _local3:int;
var _local1:Number = NaN;
var _local2:Object = getStyle("backgroundSize");
if (((_local2) && ((_local2 is String)))){
_local3 = _local2.indexOf("%");
if (_local3 != -1){
_local1 = Number(_local2.substr(0, _local3));
};
};
return (_local1);
}
private function removedHandler(_arg1:Event):void{
var _local2:IChildList;
if (backgroundImage){
_local2 = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
_local2.removeChild(backgroundImage.mask);
_local2.removeChild(backgroundImage);
backgroundImage = null;
};
}
private function initBackgroundImage(_arg1:DisplayObject):void{
backgroundImage = _arg1;
if ((_arg1 is Loader)){
backgroundImageWidth = Loader(_arg1).contentLoaderInfo.width;
backgroundImageHeight = Loader(_arg1).contentLoaderInfo.height;
} else {
backgroundImageWidth = backgroundImage.width;
backgroundImageHeight = backgroundImage.height;
if ((_arg1 is ISimpleStyleClient)){
ISimpleStyleClient(_arg1).styleName = styleName;
};
};
var _local2:IChildList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
var _local3:Shape = new FlexShape();
_local3.name = "backgroundMask";
_local3.x = 0;
_local3.y = 0;
_local2.addChild(_local3);
var _local4:int = _local2.getChildIndex(this);
_local2.addChildAt(backgroundImage, (_local4 + 1));
backgroundImage.mask = _local3;
}
public function get backgroundImageBounds():Rectangle{
return (_backgroundImageBounds);
}
public function get hasBackgroundImage():Boolean{
return (!((backgroundImage == null)));
}
private function completeEventHandler(_arg1:Event):void{
if (!parent){
return;
};
var _local2:DisplayObject = DisplayObject(LoaderInfo(_arg1.target).loader);
initBackgroundImage(_local2);
layoutBackgroundImage();
dispatchEvent(_arg1.clone());
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var message:String;
var unscaledWidth = _arg1;
var unscaledHeight = _arg2;
if (!parent){
return;
};
var newStyle:Object = getStyle("backgroundImage");
if (newStyle != backgroundImageStyle){
removedHandler(null);
backgroundImageStyle = newStyle;
if (((newStyle) && ((newStyle as Class)))){
cls = Class(newStyle);
initBackgroundImage(new (cls));
} else {
if (((newStyle) && ((newStyle is String)))){
try {
cls = Class(getDefinitionByName(String(newStyle)));
} catch(e:Error) {
};
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new FlexLoader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeEventHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorEventHandler);
loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, errorEventHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(newStyle)), loaderContext);
};
} else {
if (newStyle){
message = resourceManager.getString("skins", "notLoaded", [newStyle]);
throw (new Error(message));
};
};
};
};
if (backgroundImage){
layoutBackgroundImage();
};
}
private function errorEventHandler(_arg1:Event):void{
}
}
}//package mx.skins
Section 234
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import mx.managers.*;
import flash.utils.*;
public class CSSStyleDeclaration extends EventDispatcher {
mx_internal var effects:Array;
protected var overrides:Object;
public var defaultFactory:Function;
public var factory:Function;
mx_internal var selectorRefCount:int;// = 0
private var styleManager:IStyleManager2;
private var clones:Dictionary;
mx_internal static const VERSION:String = "3.2.0.3958";
private static const NOT_A_COLOR:uint = 4294967295;
private static const FILTERMAP_PROP:String = "__reserved__filterMap";
public function CSSStyleDeclaration(_arg1:String=null){
clones = new Dictionary(true);
super();
if (_arg1){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
styleManager.setStyleDeclaration(_arg1, this, false);
};
}
mx_internal function addStyleToProtoChain(_arg1:Object, _arg2:DisplayObject, _arg3:Object=null):Object{
var p:String;
var emptyObjectFactory:Function;
var filteredChain:Object;
var filterObjectFactory:Function;
var i:String;
var chain = _arg1;
var target = _arg2;
var filterMap = _arg3;
var nodeAddedToChain:Boolean;
var originalChain:Object = chain;
if (filterMap){
chain = {};
};
if (defaultFactory != null){
defaultFactory.prototype = chain;
chain = new defaultFactory();
nodeAddedToChain = true;
};
if (factory != null){
factory.prototype = chain;
chain = new factory();
nodeAddedToChain = true;
};
if (overrides){
if ((((defaultFactory == null)) && ((factory == null)))){
emptyObjectFactory = function ():void{
};
emptyObjectFactory.prototype = chain;
chain = new (emptyObjectFactory);
nodeAddedToChain = true;
};
for (p in overrides) {
if (overrides[p] === undefined){
delete chain[p];
} else {
chain[p] = overrides[p];
};
};
};
if (filterMap){
if (nodeAddedToChain){
filteredChain = {};
filterObjectFactory = function ():void{
};
filterObjectFactory.prototype = originalChain;
filteredChain = new (filterObjectFactory);
for (i in chain) {
if (filterMap[i] != null){
filteredChain[filterMap[i]] = chain[i];
};
};
chain = filteredChain;
chain[FILTERMAP_PROP] = filterMap;
} else {
chain = originalChain;
};
};
if (nodeAddedToChain){
clones[chain] = 1;
};
return (chain);
}
public function getStyle(_arg1:String){
var _local2:*;
var _local3:*;
if (overrides){
if ((((_arg1 in overrides)) && ((overrides[_arg1] === undefined)))){
return (undefined);
};
_local3 = overrides[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
if (factory != null){
factory.prototype = {};
_local2 = new factory();
_local3 = _local2[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
if (defaultFactory != null){
defaultFactory.prototype = {};
_local2 = new defaultFactory();
_local3 = _local2[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
return (undefined);
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, undefined);
}
public function setStyle(_arg1:String, _arg2):void{
var _local7:int;
var _local8:Object;
var _local3:Object = getStyle(_arg1);
var _local4:Boolean;
if ((((((((((selectorRefCount > 0)) && ((factory == null)))) && ((defaultFactory == null)))) && (!(overrides)))) && (!((_local3 === _arg2))))){
_local4 = true;
};
if (_arg2 !== undefined){
setStyle(_arg1, _arg2);
} else {
if (_arg2 == _local3){
return;
};
setStyle(_arg1, _arg2);
};
var _local5:Array = SystemManagerGlobals.topLevelSystemManagers;
var _local6:int = _local5.length;
if (_local4){
_local7 = 0;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local8.regenerateStyleCache(true);
_local7++;
};
};
_local7 = 0;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local8.notifyStyleChangeInChildren(_arg1, true);
_local7++;
};
}
private function clearStyleAttr(_arg1:String):void{
var _local2:*;
if (!overrides){
overrides = {};
};
overrides[_arg1] = undefined;
for (_local2 in clones) {
delete _local2[_arg1];
};
}
mx_internal function createProtoChainRoot():Object{
var _local1:Object = {};
if (defaultFactory != null){
defaultFactory.prototype = _local1;
_local1 = new defaultFactory();
};
if (factory != null){
factory.prototype = _local1;
_local1 = new factory();
};
clones[_local1] = 1;
return (_local1);
}
mx_internal function clearOverride(_arg1:String):void{
if (((overrides) && (overrides[_arg1]))){
delete overrides[_arg1];
};
}
mx_internal function setStyle(_arg1:String, _arg2):void{
var _local3:Object;
var _local4:*;
var _local5:Number;
var _local6:Object;
if (_arg2 === undefined){
clearStyleAttr(_arg1);
return;
};
if ((_arg2 is String)){
if (!styleManager){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
};
_local5 = styleManager.getColorName(_arg2);
if (_local5 != NOT_A_COLOR){
_arg2 = _local5;
};
};
if (defaultFactory != null){
_local3 = new defaultFactory();
if (_local3[_arg1] !== _arg2){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
} else {
if (overrides){
delete overrides[_arg1];
};
};
};
if (factory != null){
_local3 = new factory();
if (_local3[_arg1] !== _arg2){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
} else {
if (overrides){
delete overrides[_arg1];
};
};
};
if ((((defaultFactory == null)) && ((factory == null)))){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
};
for (_local4 in clones) {
_local6 = _local4[FILTERMAP_PROP];
if (_local6){
if (_local6[_arg1] != null){
_local4[_local6[_arg1]] = _arg2;
};
} else {
_local4[_arg1] = _arg2;
};
};
}
}
}//package mx.styles
Section 235
//ISimpleStyleClient (mx.styles.ISimpleStyleClient)
package mx.styles {
public interface ISimpleStyleClient {
function set styleName(_arg1:Object):void;
function styleChanged(_arg1:String):void;
function get styleName():Object;
}
}//package mx.styles
Section 236
//IStyleClient (mx.styles.IStyleClient)
package mx.styles {
public interface IStyleClient extends ISimpleStyleClient {
function regenerateStyleCache(_arg1:Boolean):void;
function get className():String;
function clearStyle(_arg1:String):void;
function getClassStyleDeclarations():Array;
function get inheritingStyles():Object;
function set nonInheritingStyles(_arg1:Object):void;
function setStyle(_arg1:String, _arg2):void;
function get styleDeclaration():CSSStyleDeclaration;
function set styleDeclaration(_arg1:CSSStyleDeclaration):void;
function get nonInheritingStyles():Object;
function set inheritingStyles(_arg1:Object):void;
function getStyle(_arg1:String);
function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void;
function registerEffects(_arg1:Array):void;
}
}//package mx.styles
Section 237
//IStyleManager (mx.styles.IStyleManager)
package mx.styles {
import flash.events.*;
public interface IStyleManager {
function isColorName(_arg1:String):Boolean;
function registerParentDisplayListInvalidatingStyle(_arg1:String):void;
function registerInheritingStyle(_arg1:String):void;
function set stylesRoot(_arg1:Object):void;
function get typeSelectorCache():Object;
function styleDeclarationsChanged():void;
function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void;
function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean;
function isSizeInvalidatingStyle(_arg1:String):Boolean;
function get inheritingStyles():Object;
function isValidStyleValue(_arg1):Boolean;
function isParentSizeInvalidatingStyle(_arg1:String):Boolean;
function getColorName(_arg1:Object):uint;
function set typeSelectorCache(_arg1:Object):void;
function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void;
function getColorNames(_arg1:Array):void;
function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher;
function isInheritingStyle(_arg1:String):Boolean;
function set inheritingStyles(_arg1:Object):void;
function get stylesRoot():Object;
function initProtoChainRoots():void;
function registerColorName(_arg1:String, _arg2:uint):void;
function registerParentSizeInvalidatingStyle(_arg1:String):void;
function registerSizeInvalidatingStyle(_arg1:String):void;
function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void;
function isInheritingTextFormatStyle(_arg1:String):Boolean;
function getStyleDeclaration(_arg1:String):CSSStyleDeclaration;
}
}//package mx.styles
Section 238
//IStyleManager2 (mx.styles.IStyleManager2)
package mx.styles {
import flash.events.*;
import flash.system.*;
public interface IStyleManager2 extends IStyleManager {
function get selectors():Array;
function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
}
}//package mx.styles
Section 239
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 240
//StyleManager (mx.styles.StyleManager)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.system.*;
public class StyleManager {
mx_internal static const VERSION:String = "3.2.0.3958";
public static const NOT_A_COLOR:uint = 4294967295;
private static var _impl:IStyleManager2;
private static var implClassDependency:StyleManagerImpl;
public static function isParentSizeInvalidatingStyle(_arg1:String):Boolean{
return (impl.isParentSizeInvalidatingStyle(_arg1));
}
public static function registerInheritingStyle(_arg1:String):void{
impl.registerInheritingStyle(_arg1);
}
mx_internal static function set stylesRoot(_arg1:Object):void{
impl.stylesRoot = _arg1;
}
mx_internal static function get inheritingStyles():Object{
return (impl.inheritingStyles);
}
mx_internal static function styleDeclarationsChanged():void{
impl.styleDeclarationsChanged();
}
public static function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void{
impl.setStyleDeclaration(_arg1, _arg2, _arg3);
}
public static function registerParentDisplayListInvalidatingStyle(_arg1:String):void{
impl.registerParentDisplayListInvalidatingStyle(_arg1);
}
mx_internal static function get typeSelectorCache():Object{
return (impl.typeSelectorCache);
}
mx_internal static function set inheritingStyles(_arg1:Object):void{
impl.inheritingStyles = _arg1;
}
public static function isColorName(_arg1:String):Boolean{
return (impl.isColorName(_arg1));
}
public static function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean{
return (impl.isParentDisplayListInvalidatingStyle(_arg1));
}
public static function isSizeInvalidatingStyle(_arg1:String):Boolean{
return (impl.isSizeInvalidatingStyle(_arg1));
}
public static function getColorName(_arg1:Object):uint{
return (impl.getColorName(_arg1));
}
mx_internal static function set typeSelectorCache(_arg1:Object):void{
impl.typeSelectorCache = _arg1;
}
public static function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void{
impl.unloadStyleDeclarations(_arg1, _arg2);
}
public static function getColorNames(_arg1:Array):void{
impl.getColorNames(_arg1);
}
public static function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false, _arg4:ApplicationDomain=null, _arg5:SecurityDomain=null):IEventDispatcher{
return (impl.loadStyleDeclarations2(_arg1, _arg2, _arg4, _arg5));
}
private static function get impl():IStyleManager2{
if (!_impl){
_impl = IStyleManager2(Singleton.getInstance("mx.styles::IStyleManager2"));
};
return (_impl);
}
public static function isValidStyleValue(_arg1):Boolean{
return (impl.isValidStyleValue(_arg1));
}
mx_internal static function get stylesRoot():Object{
return (impl.stylesRoot);
}
public static function isInheritingStyle(_arg1:String):Boolean{
return (impl.isInheritingStyle(_arg1));
}
mx_internal static function initProtoChainRoots():void{
impl.initProtoChainRoots();
}
public static function registerParentSizeInvalidatingStyle(_arg1:String):void{
impl.registerParentSizeInvalidatingStyle(_arg1);
}
public static function get selectors():Array{
return (impl.selectors);
}
public static function registerSizeInvalidatingStyle(_arg1:String):void{
impl.registerSizeInvalidatingStyle(_arg1);
}
public static function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void{
impl.clearStyleDeclaration(_arg1, _arg2);
}
public static function registerColorName(_arg1:String, _arg2:uint):void{
impl.registerColorName(_arg1, _arg2);
}
public static function isInheritingTextFormatStyle(_arg1:String):Boolean{
return (impl.isInheritingTextFormatStyle(_arg1));
}
public static function getStyleDeclaration(_arg1:String):CSSStyleDeclaration{
return (impl.getStyleDeclaration(_arg1));
}
}
}//package mx.styles
Section 241
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.*;
import flash.utils.*;
public class StyleManagerImpl implements IStyleManager2 {
private var _stylesRoot:Object;
private var _selectors:Object;
private var styleModules:Object;
private var _inheritingStyles:Object;
private var resourceManager:IResourceManager;
private var _typeSelectorCache:Object;
mx_internal static const VERSION:String = "3.2.0.3958";
private static var parentSizeInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var colorNames:Object = {transparent:"transparent", black:0, blue:0xFF, green:0x8000, gray:0x808080, silver:0xC0C0C0, lime:0xFF00, olive:0x808000, white:0xFFFFFF, yellow:0xFFFF00, maroon:0x800000, navy:128, red:0xFF0000, purple:0x800080, teal:0x8080, fuchsia:0xFF00FF, aqua:0xFFFF, magenta:0xFF00FF, cyan:0xFFFF, halogreen:8453965, haloblue:40447, haloorange:0xFFB600, halosilver:11455193};
private static var inheritingTextFormatStyles:Object = {align:true, bold:true, color:true, font:true, indent:true, italic:true, size:true};
private static var instance:IStyleManager2;
private static var parentDisplayListInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var sizeInvalidatingStyles:Object = {borderStyle:true, borderThickness:true, fontAntiAliasType:true, fontFamily:true, fontGridFitType:true, fontSharpness:true, fontSize:true, fontStyle:true, fontThickness:true, fontWeight:true, headerHeight:true, horizontalAlign:true, horizontalGap:true, kerning:true, leading:true, letterSpacing:true, paddingBottom:true, paddingLeft:true, paddingRight:true, paddingTop:true, strokeWidth:true, tabHeight:true, tabWidth:true, verticalAlign:true, verticalGap:true};
public function StyleManagerImpl(){
_selectors = {};
styleModules = {};
resourceManager = ResourceManager.getInstance();
_inheritingStyles = {};
_typeSelectorCache = {};
super();
}
public function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void{
_arg2.selectorRefCount++;
_selectors[_arg1] = _arg2;
typeSelectorCache = {};
if (_arg3){
styleDeclarationsChanged();
};
}
public function registerParentDisplayListInvalidatingStyle(_arg1:String):void{
parentDisplayListInvalidatingStyles[_arg1] = true;
}
public function getStyleDeclaration(_arg1:String):CSSStyleDeclaration{
var _local2:int;
if (_arg1.charAt(0) != "."){
_local2 = _arg1.lastIndexOf(".");
if (_local2 != -1){
_arg1 = _arg1.substr((_local2 + 1));
};
};
return (_selectors[_arg1]);
}
public function set typeSelectorCache(_arg1:Object):void{
_typeSelectorCache = _arg1;
}
public function isColorName(_arg1:String):Boolean{
return (!((colorNames[_arg1.toLowerCase()] === undefined)));
}
public function set inheritingStyles(_arg1:Object):void{
_inheritingStyles = _arg1;
}
public function getColorNames(_arg1:Array):void{
var _local4:uint;
if (!_arg1){
return;
};
var _local2:int = _arg1.length;
var _local3:int;
while (_local3 < _local2) {
if (((!((_arg1[_local3] == null))) && (isNaN(_arg1[_local3])))){
_local4 = getColorName(_arg1[_local3]);
if (_local4 != StyleManager.NOT_A_COLOR){
_arg1[_local3] = _local4;
};
};
_local3++;
};
}
public function isInheritingTextFormatStyle(_arg1:String):Boolean{
return ((inheritingTextFormatStyles[_arg1] == true));
}
public function registerParentSizeInvalidatingStyle(_arg1:String):void{
parentSizeInvalidatingStyles[_arg1] = true;
}
public function registerColorName(_arg1:String, _arg2:uint):void{
colorNames[_arg1.toLowerCase()] = _arg2;
}
public function isParentSizeInvalidatingStyle(_arg1:String):Boolean{
return ((parentSizeInvalidatingStyles[_arg1] == true));
}
public function registerInheritingStyle(_arg1:String):void{
inheritingStyles[_arg1] = true;
}
public function set stylesRoot(_arg1:Object):void{
_stylesRoot = _arg1;
}
public function get typeSelectorCache():Object{
return (_typeSelectorCache);
}
public function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean{
return ((parentDisplayListInvalidatingStyles[_arg1] == true));
}
public function isSizeInvalidatingStyle(_arg1:String):Boolean{
return ((sizeInvalidatingStyles[_arg1] == true));
}
public function styleDeclarationsChanged():void{
var _local4:Object;
var _local1:Array = SystemManagerGlobals.topLevelSystemManagers;
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3];
_local4.regenerateStyleCache(true);
_local4.notifyStyleChangeInChildren(null, true);
_local3++;
};
}
public function isValidStyleValue(_arg1):Boolean{
return (!((_arg1 === undefined)));
}
public function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher{
return (loadStyleDeclarations2(_arg1, _arg2));
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void{
var _local4:IModuleInfo;
var _local3:StyleModuleInfo = styleModules[_arg1];
if (_local3){
_local3.styleModule.unload();
_local4 = _local3.module;
_local4.unload();
_local4.removeEventListener(ModuleEvent.READY, _local3.readyHandler);
_local4.removeEventListener(ModuleEvent.ERROR, _local3.errorHandler);
styleModules[_arg1] = null;
};
if (_arg2){
styleDeclarationsChanged();
};
}
public function getColorName(_arg1:Object):uint{
var _local2:Number;
var _local3:*;
if ((_arg1 is String)){
if (_arg1.charAt(0) == "#"){
_local2 = Number(("0x" + _arg1.slice(1)));
return ((isNaN(_local2)) ? StyleManager.NOT_A_COLOR : uint(_local2));
};
if ((((_arg1.charAt(1) == "x")) && ((_arg1.charAt(0) == "0")))){
_local2 = Number(_arg1);
return ((isNaN(_local2)) ? StyleManager.NOT_A_COLOR : uint(_local2));
};
_local3 = colorNames[_arg1.toLowerCase()];
if (_local3 === undefined){
return (StyleManager.NOT_A_COLOR);
};
return (uint(_local3));
};
return (uint(_arg1));
}
public function isInheritingStyle(_arg1:String):Boolean{
return ((inheritingStyles[_arg1] == true));
}
public function get stylesRoot():Object{
return (_stylesRoot);
}
public function initProtoChainRoots():void{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
delete _inheritingStyles["textDecoration"];
delete _inheritingStyles["leading"];
};
if (!stylesRoot){
stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
};
}
public function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher{
var module:IModuleInfo;
var styleEventDispatcher:StyleEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = _arg1;
var update = _arg2;
var applicationDomain = _arg3;
var securityDomain = _arg4;
module = ModuleManager.getModule(url);
var readyHandler:Function = function (_arg1:ModuleEvent):void{
var _local2:IStyleModule = IStyleModule(_arg1.module.factory.create());
styleModules[_arg1.module.url].styleModule = _local2;
if (update){
styleDeclarationsChanged();
};
};
module.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
styleEventDispatcher = new StyleEventDispatcher(module);
var errorHandler:Function = function (_arg1:ModuleEvent):void{
var _local3:StyleEvent;
var _local2:String = resourceManager.getString("styles", "unableToLoad", [_arg1.errorText, url]);
if (styleEventDispatcher.willTrigger(StyleEvent.ERROR)){
_local3 = new StyleEvent(StyleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local3.bytesLoaded = 0;
_local3.bytesTotal = 0;
_local3.errorText = _local2;
styleEventDispatcher.dispatchEvent(_local3);
} else {
throw (new Error(_local2));
};
};
module.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
styleModules[url] = new StyleModuleInfo(module, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (_arg1:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
module.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (styleEventDispatcher);
}
public function registerSizeInvalidatingStyle(_arg1:String):void{
sizeInvalidatingStyles[_arg1] = true;
}
public function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void{
var _local3:CSSStyleDeclaration = getStyleDeclaration(_arg1);
if (((_local3) && ((_local3.selectorRefCount > 0)))){
_local3.selectorRefCount--;
};
delete _selectors[_arg1];
if (_arg2){
styleDeclarationsChanged();
};
}
public function get selectors():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in _selectors) {
_local1.push(_local2);
};
return (_local1);
}
public static function getInstance():IStyleManager2{
if (!instance){
instance = new (StyleManagerImpl);
};
return (instance);
}
}
}//package mx.styles
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class StyleEventDispatcher extends EventDispatcher {
private function StyleEventDispatcher(_arg1:IModuleInfo){
_arg1.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
private function moduleInfo_readyHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
dispatchEvent(_local2);
}
private function moduleInfo_errorHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
_local2.errorText = _arg1.errorText;
dispatchEvent(_local2);
}
}
class StyleModuleInfo {
public var errorHandler:Function;
public var readyHandler:Function;
public var module:IModuleInfo;
public var styleModule:IStyleModule;
private function StyleModuleInfo(_arg1:IModuleInfo, _arg2:Function, _arg3:Function){
this.module = _arg1;
this.readyHandler = _arg2;
this.errorHandler = _arg3;
}
}
Section 242
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
public class ColorUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public static function adjustBrightness2(_arg1:uint, _arg2:Number):uint{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (_arg2 == 0){
return (_arg1);
};
if (_arg2 < 0){
_arg2 = ((100 + _arg2) / 100);
_local3 = (((_arg1 >> 16) & 0xFF) * _arg2);
_local4 = (((_arg1 >> 8) & 0xFF) * _arg2);
_local5 = ((_arg1 & 0xFF) * _arg2);
} else {
_arg2 = (_arg2 / 100);
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
_local3 = (_local3 + ((0xFF - _local3) * _arg2));
_local4 = (_local4 + ((0xFF - _local4) * _arg2));
_local5 = (_local5 + ((0xFF - _local5) * _arg2));
_local3 = Math.min(_local3, 0xFF);
_local4 = Math.min(_local4, 0xFF);
_local5 = Math.min(_local5, 0xFF);
};
return ((((_local3 << 16) | (_local4 << 8)) | _local5));
}
public static function rgbMultiply(_arg1:uint, _arg2:uint):uint{
var _local3:Number = ((_arg1 >> 16) & 0xFF);
var _local4:Number = ((_arg1 >> 8) & 0xFF);
var _local5:Number = (_arg1 & 0xFF);
var _local6:Number = ((_arg2 >> 16) & 0xFF);
var _local7:Number = ((_arg2 >> 8) & 0xFF);
var _local8:Number = (_arg2 & 0xFF);
return ((((((_local3 * _local6) / 0xFF) << 16) | (((_local4 * _local7) / 0xFF) << 8)) | ((_local5 * _local8) / 0xFF)));
}
public static function adjustBrightness(_arg1:uint, _arg2:Number):uint{
var _local3:Number = Math.max(Math.min((((_arg1 >> 16) & 0xFF) + _arg2), 0xFF), 0);
var _local4:Number = Math.max(Math.min((((_arg1 >> 8) & 0xFF) + _arg2), 0xFF), 0);
var _local5:Number = Math.max(Math.min(((_arg1 & 0xFF) + _arg2), 0xFF), 0);
return ((((_local3 << 16) | (_local4 << 8)) | _local5));
}
}
}//package mx.utils
Section 243
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import flash.display.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public static function drawRoundRectComplex(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):void{
var _local10:Number = (_arg2 + _arg4);
var _local11:Number = (_arg3 + _arg5);
var _local12:Number = ((_arg4 < _arg5)) ? (_arg4 * 2) : (_arg5 * 2);
_arg6 = ((_arg6 < _local12)) ? _arg6 : _local12;
_arg7 = ((_arg7 < _local12)) ? _arg7 : _local12;
_arg8 = ((_arg8 < _local12)) ? _arg8 : _local12;
_arg9 = ((_arg9 < _local12)) ? _arg9 : _local12;
var _local13:Number = (_arg9 * 0.292893218813453);
var _local14:Number = (_arg9 * 0.585786437626905);
_arg1.moveTo(_local10, (_local11 - _arg9));
_arg1.curveTo(_local10, (_local11 - _local14), (_local10 - _local13), (_local11 - _local13));
_arg1.curveTo((_local10 - _local14), _local11, (_local10 - _arg9), _local11);
_local13 = (_arg8 * 0.292893218813453);
_local14 = (_arg8 * 0.585786437626905);
_arg1.lineTo((_arg2 + _arg8), _local11);
_arg1.curveTo((_arg2 + _local14), _local11, (_arg2 + _local13), (_local11 - _local13));
_arg1.curveTo(_arg2, (_local11 - _local14), _arg2, (_local11 - _arg8));
_local13 = (_arg6 * 0.292893218813453);
_local14 = (_arg6 * 0.585786437626905);
_arg1.lineTo(_arg2, (_arg3 + _arg6));
_arg1.curveTo(_arg2, (_arg3 + _local14), (_arg2 + _local13), (_arg3 + _local13));
_arg1.curveTo((_arg2 + _local14), _arg3, (_arg2 + _arg6), _arg3);
_local13 = (_arg7 * 0.292893218813453);
_local14 = (_arg7 * 0.585786437626905);
_arg1.lineTo((_local10 - _arg7), _arg3);
_arg1.curveTo((_local10 - _local14), _arg3, (_local10 - _local13), (_arg3 + _local13));
_arg1.curveTo(_local10, (_arg3 + _local14), _local10, (_arg3 + _arg7));
_arg1.lineTo(_local10, (_local11 - _arg9));
}
}
}//package mx.utils
Section 244
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 245
//StringUtil (mx.utils.StringUtil)
package mx.utils {
public class StringUtil {
mx_internal static const VERSION:String = "3.2.0.3958";
public static function trim(_arg1:String):String{
if (_arg1 == null){
return ("");
};
var _local2:int;
while (isWhitespace(_arg1.charAt(_local2))) {
_local2++;
};
var _local3:int = (_arg1.length - 1);
while (isWhitespace(_arg1.charAt(_local3))) {
_local3--;
};
if (_local3 >= _local2){
return (_arg1.slice(_local2, (_local3 + 1)));
};
return ("");
}
public static function isWhitespace(_arg1:String):Boolean{
switch (_arg1){
case " ":
case "\t":
case "\r":
case "\n":
case "\f":
return (true);
default:
return (false);
};
}
public static function substitute(_arg1:String, ... _args):String{
var _local4:Array;
if (_arg1 == null){
return ("");
};
var _local3:uint = _args.length;
if ((((_local3 == 1)) && ((_args[0] is Array)))){
_local4 = (_args[0] as Array);
_local3 = _local4.length;
} else {
_local4 = _args;
};
var _local5:int;
while (_local5 < _local3) {
_arg1 = _arg1.replace(new RegExp((("\\{" + _local5) + "\\}"), "g"), _local4[_local5]);
_local5++;
};
return (_arg1);
}
public static function trimArrayElements(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:int;
var _local5:int;
if (((!((_arg1 == ""))) && (!((_arg1 == null))))){
_local3 = _arg1.split(_arg2);
_local4 = _local3.length;
_local5 = 0;
while (_local5 < _local4) {
_local3[_local5] = StringUtil.trim(_local3[_local5]);
_local5++;
};
if (_local4 > 0){
_arg1 = _local3.join(_arg2);
};
};
return (_arg1);
}
}
}//package mx.utils
Section 246
//Action (org.flintparticles.common.actions.Action)
package org.flintparticles.common.actions {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public interface Action {
function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void;
function addedToEmitter(_arg1:Emitter):void;
function removedFromEmitter(_arg1:Emitter):void;
function getDefaultPriority():Number;
}
}//package org.flintparticles.common.actions
Section 247
//ActionBase (org.flintparticles.common.actions.ActionBase)
package org.flintparticles.common.actions {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public class ActionBase implements Action {
public function addedToEmitter(_arg1:Emitter):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function getDefaultPriority():Number{
return (0);
}
public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
}
}
}//package org.flintparticles.common.actions
Section 248
//Age (org.flintparticles.common.actions.Age)
package org.flintparticles.common.actions {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.energyEasing.*;
public class Age extends ActionBase {
private var _easing:Function;
public function Age(_arg1:Function=null){
if (_arg1 == null){
_easing = Linear.easeNone;
} else {
_easing = _arg1;
};
}
public function set easing(_arg1:Function):void{
_easing = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
_arg2.age = (_arg2.age + _arg3);
if (_arg2.age >= _arg2.lifetime){
_arg2.energy = 0;
_arg2.isDead = true;
} else {
_arg2.energy = _easing(_arg2.age, _arg2.lifetime);
};
}
public function get easing():Function{
return (_easing);
}
}
}//package org.flintparticles.common.actions
Section 249
//Fade (org.flintparticles.common.actions.Fade)
package org.flintparticles.common.actions {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public class Fade extends ActionBase {
private var _endAlpha:Number;
private var _diffAlpha:Number;
public function Fade(_arg1:Number=1, _arg2:Number=0){
_diffAlpha = (_arg1 - _arg2);
_endAlpha = _arg2;
}
public function get endAlpha():Number{
return (_endAlpha);
}
public function set endAlpha(_arg1:Number):void{
_diffAlpha = ((_endAlpha + _diffAlpha) - _arg1);
_endAlpha = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Number = (_endAlpha + (_diffAlpha * _arg2.energy));
_arg2.color = ((_arg2.color & 0xFFFFFF) | (Math.round((_local4 * 0xFF)) << 24));
}
override public function getDefaultPriority():Number{
return (-5);
}
public function set startAlpha(_arg1:Number):void{
_diffAlpha = (_arg1 - _endAlpha);
}
public function get startAlpha():Number{
return ((_endAlpha + _diffAlpha));
}
}
}//package org.flintparticles.common.actions
Section 250
//Activity (org.flintparticles.common.activities.Activity)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public interface Activity {
function initialize(_arg1:Emitter):void;
function removedFromEmitter(_arg1:Emitter):void;
function update(_arg1:Emitter, _arg2:Number):void;
function addedToEmitter(_arg1:Emitter):void;
function getDefaultPriority():Number;
}
}//package org.flintparticles.common.activities
Section 251
//Blast (org.flintparticles.common.counters.Blast)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Blast implements Counter {
private var _startCount:uint;
public function Blast(_arg1:uint){
_startCount = _arg1;
}
public function stop():void{
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
return (_startCount);
}
public function resume():void{
}
public function set startCount(_arg1:Number):void{
_startCount = _arg1;
}
public function get startCount():Number{
return (_startCount);
}
}
}//package org.flintparticles.common.counters
Section 252
//Counter (org.flintparticles.common.counters.Counter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public interface Counter {
function stop():void;
function startEmitter(_arg1:Emitter):uint;
function updateEmitter(_arg1:Emitter, _arg2:Number):uint;
function resume():void;
}
}//package org.flintparticles.common.counters
Section 253
//ZeroCounter (org.flintparticles.common.counters.ZeroCounter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class ZeroCounter implements Counter {
public function stop():void{
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
return (0);
}
public function resume():void{
}
}
}//package org.flintparticles.common.counters
Section 254
//Dot (org.flintparticles.common.displayObjects.Dot)
package org.flintparticles.common.displayObjects {
import flash.display.*;
public class Dot extends Shape {
public function Dot(_arg1:Number, _arg2:uint=0xFFFFFF, _arg3:String="normal"){
graphics.beginFill(_arg2);
graphics.drawCircle(0, 0, _arg1);
graphics.endFill();
blendMode = _arg3;
}
}
}//package org.flintparticles.common.displayObjects
Section 255
//Star (org.flintparticles.common.displayObjects.Star)
package org.flintparticles.common.displayObjects {
import flash.display.*;
import flash.geom.*;
public class Star extends Shape {
public function Star(_arg1:Number, _arg2:uint=0xFFFFFF, _arg3:String="normal"){
var _local4:Point;
super();
var _local5:Number = (Math.PI / 5);
var _local6:Number = (_arg1 * Math.cos((_local5 * 2)));
var _local7:Number = (Math.PI * 0.5);
graphics.beginFill(_arg2);
graphics.moveTo(0, -(_arg1));
_local4 = Point.polar(_local6, (_local5 - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_arg1, ((2 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_local6, ((3 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_arg1, ((4 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_local6, ((5 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_arg1, ((6 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_local6, ((7 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_arg1, ((8 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
_local4 = Point.polar(_local6, ((9 * _local5) - _local7));
graphics.lineTo(_local4.x, _local4.y);
graphics.lineTo(0, -(_arg1));
graphics.endFill();
blendMode = _arg3;
}
}
}//package org.flintparticles.common.displayObjects
Section 256
//Emitter (org.flintparticles.common.emitters.Emitter)
package org.flintparticles.common.emitters {
import flash.events.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class Emitter extends EventDispatcher {
protected var _running:Boolean;// = false
protected var _activities:PriorityArray;
protected var _particles:Array;
protected var _initializers:PriorityArray;
protected var _counter:Counter;
protected var _started:Boolean;// = false
protected var _actions:PriorityArray;
protected var _useInternalTick:Boolean;// = true
protected var _particleFactory:ParticleFactory;
protected var _fixedFrameTime:Number;// = 0
protected var _maximumFrameTime:Number;// = 0.1
public function Emitter(){
_particles = new Array();
_actions = new PriorityArray();
_initializers = new PriorityArray();
_activities = new PriorityArray();
_counter = new ZeroCounter();
}
public function addInitializer(_arg1:Initializer, _arg2:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1.getDefaultPriority();
};
_initializers.add(_arg1, _arg2);
_arg1.addedToEmitter(this);
}
public function stop():void{
if (_useInternalTick){
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
_started = false;
killAllParticles();
}
public function killAllParticles():void{
var _local1:int = _particles.length;
var _local2:int;
while (_local2 < _local1) {
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _particles[_local2]));
_particleFactory.disposeParticle(_particles[_local2]);
_local2++;
};
_particles.length = 0;
}
public function set fixedFrameTime(_arg1:Number):void{
_fixedFrameTime = _arg1;
}
public function get maximumFrameTime():Number{
return (_maximumFrameTime);
}
public function get useInternalTick():Boolean{
return (_useInternalTick);
}
protected function createParticle():Particle{
var _local1:Particle = _particleFactory.createParticle();
var _local2:int = _initializers.length;
initParticle(_local1);
var _local3:int;
while (_local3 < _local2) {
_initializers[_local3].initialize(this, _local1);
_local3++;
};
_particles.push(_local1);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_CREATED, _local1));
return (_local1);
}
public function get particleFactory():ParticleFactory{
return (_particleFactory);
}
private function updateEventListener(_arg1:UpdateEvent):void{
if (_fixedFrameTime){
update(_fixedFrameTime);
} else {
update(_arg1.time);
};
}
public function get particles():Array{
return (_particles);
}
protected function sortParticles():void{
}
public function removeActivity(_arg1:Activity):void{
if (_activities.remove(_arg1)){
_arg1.removedFromEmitter(this);
};
}
public function set maximumFrameTime(_arg1:Number):void{
_maximumFrameTime = _arg1;
}
protected function initParticle(_arg1:Particle):void{
}
public function addAction(_arg1:Action, _arg2:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1.getDefaultPriority();
};
_actions.add(_arg1, _arg2);
_arg1.addedToEmitter(this);
}
public function hasInitializerOfType(_arg1:Class):Boolean{
var _local2:uint = _initializers.length;
var _local3:uint;
while (_local3 < _local2) {
if ((_initializers[_local3] is _arg1)){
return (true);
};
_local3++;
};
return (false);
}
public function resume():void{
_running = true;
}
public function removeInitializer(_arg1:Initializer):void{
if (_initializers.remove(_arg1)){
_arg1.removedFromEmitter(this);
};
}
public function get running():Boolean{
return (_running);
}
public function hasActionOfType(_arg1:Class):Boolean{
var _local2:uint = _actions.length;
var _local3:uint;
while (_local3 < _local2) {
if ((_actions[_local3] is _arg1)){
return (true);
};
_local3++;
};
return (false);
}
public function get fixedFrameTime():Number{
return (_fixedFrameTime);
}
public function set particleFactory(_arg1:ParticleFactory):void{
_particleFactory = _arg1;
}
public function hasActivity(_arg1:Activity):Boolean{
return (_activities.contains(_arg1));
}
public function addActivity(_arg1:Activity, _arg2:Number=NaN):void{
if (isNaN(_arg2)){
_arg2 = _arg1.getDefaultPriority();
};
_activities.add(_arg1, _arg2);
_arg1.addedToEmitter(this);
}
public function update(_arg1:Number):void{
var _local2:int;
var _local3:Particle;
var _local5:Action;
var _local6:int;
var _local7:int;
if (!_running){
return;
};
if (_arg1 > _maximumFrameTime){
_arg1 = _maximumFrameTime;
};
var _local4:int = _counter.updateEmitter(this, _arg1);
_local2 = 0;
while (_local2 < _local4) {
createParticle();
_local2++;
};
sortParticles();
_local4 = _activities.length;
_local2 = 0;
while (_local2 < _local4) {
_activities[_local2].update(this, _arg1);
_local2++;
};
if (_particles.length > 0){
_local4 = _actions.length;
_local6 = _particles.length;
_local7 = 0;
while (_local7 < _local4) {
_local5 = _actions[_local7];
_local2 = 0;
while (_local2 < _local6) {
_local3 = _particles[_local2];
_local5.update(this, _local3, _arg1);
_local2++;
};
_local7++;
};
_local2 = _local6;
while (_local2--) {
_local3 = _particles[_local2];
if (_local3.isDead){
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _local3));
_particleFactory.disposeParticle(_local3);
_particles.splice(_local2, 1);
};
};
} else {
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_EMPTY));
};
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_UPDATED));
}
public function addExistingParticles(_arg1:Array, _arg2:Boolean=false):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local3:int = _arg1.length;
if (_arg2){
_local5 = _initializers.length;
_local6 = 0;
while (_local6 < _local5) {
_local4 = 0;
while (_local4 < _local3) {
_initializers[_local6].initialize(this, _arg1[_local4]);
_local4++;
};
_local6++;
};
};
_local4 = 0;
while (_local4 < _local3) {
_particles.push(_arg1[_local4]);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_ADDED, _arg1[_local4]));
_local4++;
};
}
public function removeAction(_arg1:Action):void{
if (_actions.remove(_arg1)){
_arg1.removedFromEmitter(this);
};
}
public function hasActivityOfType(_arg1:Class):Boolean{
var _local2:uint = _activities.length;
var _local3:uint;
while (_local3 < _local2) {
if ((_activities[_local3] is _arg1)){
return (true);
};
_local3++;
};
return (false);
}
public function set useInternalTick(_arg1:Boolean):void{
if (_useInternalTick != _arg1){
_useInternalTick = _arg1;
if (_started){
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
} else {
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
};
};
}
public function hasInitializer(_arg1:Initializer):Boolean{
return (_initializers.contains(_arg1));
}
public function start():void{
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
};
_started = true;
_running = true;
var _local1:int = _activities.length;
var _local2:int;
while (_local2 < _local1) {
_activities[_local2].initialize(this);
_local2++;
};
_local1 = _counter.startEmitter(this);
_local2 = 0;
while (_local2 < _local1) {
createParticle();
_local2++;
};
}
public function hasAction(_arg1:Action):Boolean{
return (_actions.contains(_arg1));
}
public function pause():void{
_running = false;
}
public function set counter(_arg1:Counter):void{
_counter = _arg1;
if (running){
_counter.startEmitter(this);
};
}
public function get counter():Counter{
return (_counter);
}
public function runAhead(_arg1:Number, _arg2:Number=10):void{
var _local3:Number = _maximumFrameTime;
var _local4:Number = (1 / _arg2);
_maximumFrameTime = _local4;
while (_arg1 > 0) {
_arg1 = (_arg1 - _local4);
update(_local4);
};
_maximumFrameTime = _local3;
}
}
}//package org.flintparticles.common.emitters
Section 257
//Linear (org.flintparticles.common.energyEasing.Linear)
package org.flintparticles.common.energyEasing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeIn(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeInOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeNone(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
}
}//package org.flintparticles.common.energyEasing
Section 258
//Quadratic (org.flintparticles.common.energyEasing.Quadratic)
package org.flintparticles.common.energyEasing {
public class Quadratic {
public static function easeOut(_arg1:Number, _arg2:Number):Number{
_arg1 = (1 - (_arg1 / _arg2));
return ((_arg1 * _arg1));
}
public static function easeIn(_arg1:Number, _arg2:Number):Number{
_arg1 = (_arg1 / _arg2);
return ((1 - (_arg1 * _arg1)));
}
public static function easeInOut(_arg1:Number, _arg2:Number):Number{
_arg1 = (_arg1 / (_arg2 * 0.5));
if (_arg1 < 1){
return ((1 - ((_arg1 * _arg1) * 0.5)));
};
_arg1 = (_arg1 - 2);
return (((_arg1 * _arg1) * 0.5));
}
}
}//package org.flintparticles.common.energyEasing
Section 259
//EmitterEvent (org.flintparticles.common.events.EmitterEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class EmitterEvent extends Event {
public static var EMITTER_UPDATED:String = "emitterUpdated";
public static var EMITTER_EMPTY:String = "emitterEmpty";
public function EmitterEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package org.flintparticles.common.events
Section 260
//ParticleEvent (org.flintparticles.common.events.ParticleEvent)
package org.flintparticles.common.events {
import flash.events.*;
import org.flintparticles.common.particles.*;
public class ParticleEvent extends Event {
public var particle:Particle;
public var otherObject;
public static var PARTICLES_COLLISION:String = "particlesCollision";
public static var PARTICLE_ADDED:String = "particleAdded";
public static var PARTICLE_DEAD:String = "particleDead";
public static var PARTICLE_CREATED:String = "particleCreated";
public function ParticleEvent(_arg1:String, _arg2:Particle=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.particle = _arg2;
}
}
}//package org.flintparticles.common.events
Section 261
//UpdateEvent (org.flintparticles.common.events.UpdateEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class UpdateEvent extends Event {
public var time:Number;
public static var UPDATE:String = "update";
public function UpdateEvent(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.time = _arg2;
}
}
}//package org.flintparticles.common.events
Section 262
//ColorInit (org.flintparticles.common.initializers.ColorInit)
package org.flintparticles.common.initializers {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.utils.*;
public class ColorInit extends InitializerBase {
private var _max:uint;
private var _min:uint;
public function ColorInit(_arg1:uint, _arg2:uint){
_min = _arg1;
_max = _arg2;
}
public function set minColor(_arg1:uint):void{
_min = _arg1;
}
public function get color():uint{
return (((_min == _max)) ? _min : interpolateColors(_max, _min, 0.5));
}
public function set color(_arg1:uint):void{
_max = (_min = _arg1);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (_max == _min){
_arg2.color = _min;
} else {
_arg2.color = interpolateColors(_min, _max, Math.random());
};
}
public function get minColor():uint{
return (_min);
}
public function set maxColor(_arg1:uint):void{
_max = _arg1;
}
public function get maxColor():uint{
return (_max);
}
}
}//package org.flintparticles.common.initializers
Section 263
//ImageClass (org.flintparticles.common.initializers.ImageClass)
package org.flintparticles.common.initializers {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.utils.*;
public class ImageClass extends InitializerBase {
private var _parameters:Array;
private var _imageClass:Class;
public function ImageClass(_arg1:Class, ... _args){
_imageClass = _arg1;
_parameters = _args;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
_arg2.image = construct(_imageClass, _parameters);
}
public function get parameters():Array{
return (_parameters);
}
public function set parameters(_arg1:Array):void{
_parameters = _arg1;
}
public function set imageClass(_arg1:Class):void{
_imageClass = _arg1;
}
public function get imageClass():Class{
return (_imageClass);
}
}
}//package org.flintparticles.common.initializers
Section 264
//Initializer (org.flintparticles.common.initializers.Initializer)
package org.flintparticles.common.initializers {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public interface Initializer {
function initialize(_arg1:Emitter, _arg2:Particle):void;
function addedToEmitter(_arg1:Emitter):void;
function removedFromEmitter(_arg1:Emitter):void;
function getDefaultPriority():Number;
}
}//package org.flintparticles.common.initializers
Section 265
//InitializerBase (org.flintparticles.common.initializers.InitializerBase)
package org.flintparticles.common.initializers {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public class InitializerBase implements Initializer {
public function initialize(_arg1:Emitter, _arg2:Particle):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function getDefaultPriority():Number{
return (0);
}
}
}//package org.flintparticles.common.initializers
Section 266
//Lifetime (org.flintparticles.common.initializers.Lifetime)
package org.flintparticles.common.initializers {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public class Lifetime extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function Lifetime(_arg1:Number, _arg2:Number=NaN){
_max = _arg2;
_min = _arg1;
}
public function get lifetime():Number{
return (((_min == _max)) ? _min : ((_max + _min) * 0.5));
}
public function get maxLifetime():Number{
return (_max);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (isNaN(_max)){
_arg2.lifetime = _min;
} else {
_arg2.lifetime = (_min + (Math.random() * (_max - _min)));
};
}
public function set lifetime(_arg1:Number):void{
_max = (_min = _arg1);
}
public function set minLifetime(_arg1:Number):void{
_min = _arg1;
}
public function set maxLifetime(_arg1:Number):void{
_max = _arg1;
}
public function get minLifetime():Number{
return (_min);
}
}
}//package org.flintparticles.common.initializers
Section 267
//SharedImage (org.flintparticles.common.initializers.SharedImage)
package org.flintparticles.common.initializers {
import flash.display.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public class SharedImage extends InitializerBase {
private var _image:DisplayObject;
public function SharedImage(_arg1:DisplayObject){
_image = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
_arg2.image = _image;
}
public function set image(_arg1:DisplayObject):void{
_image = _arg1;
}
public function get image():DisplayObject{
return (_image);
}
}
}//package org.flintparticles.common.initializers
Section 268
//Particle (org.flintparticles.common.particles.Particle)
package org.flintparticles.common.particles {
import flash.geom.*;
import flash.utils.*;
public class Particle {
public var energy:Number;// = 1
public var lifetime:Number;// = 0
public var scale:Number;// = 1
public var image;// = null
public var color:uint;// = 4294967295
public var collisionRadius:Number;// = 1
private var _colorTransform:ColorTransform;// = null
private var _previousColor:uint;
public var isDead:Boolean;// = false
public var mass:Number;// = 1
private var _dictionary:Dictionary;// = null
public var age:Number;// = 0
public function get dictionary():Dictionary{
if (_dictionary == null){
_dictionary = new Dictionary(true);
};
return (_dictionary);
}
public function get colorTransform():ColorTransform{
if (((!(_colorTransform)) || (!((_previousColor == color))))){
_colorTransform = new ColorTransform((((color >>> 16) & 0xFF) / 0xFF), (((color >>> 8) & 0xFF) / 0xFF), ((color & 0xFF) / 0xFF), (((color >>> 24) & 0xFF) / 0xFF), 0, 0, 0, 0);
_previousColor = color;
};
return (_colorTransform);
}
protected function cloneInto(_arg1:Particle):Particle{
var _local2:Object;
_arg1.color = color;
_arg1.scale = scale;
_arg1.mass = mass;
_arg1.collisionRadius = collisionRadius;
_arg1.lifetime = lifetime;
_arg1.age = age;
_arg1.energy = energy;
_arg1.isDead = isDead;
_arg1.image = image;
if (_dictionary){
_arg1._dictionary = new Dictionary(true);
for (_local2 in _dictionary) {
_arg1._dictionary[_local2] = _dictionary[_local2];
};
};
return (_arg1);
}
public function get alpha():Number{
return ((((color & 4278190080) >>> 24) / 0xFF));
}
public function initialize():void{
color = 4294967295;
scale = 1;
mass = 1;
collisionRadius = 1;
lifetime = 0;
age = 0;
energy = 1;
isDead = false;
image = null;
_dictionary = null;
_colorTransform = null;
}
public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle;
if (_arg1){
_local2 = _arg1.createParticle();
} else {
_local2 = new Particle();
};
return (cloneInto(_local2));
}
}
}//package org.flintparticles.common.particles
Section 269
//ParticleFactory (org.flintparticles.common.particles.ParticleFactory)
package org.flintparticles.common.particles {
public interface ParticleFactory {
function createParticle():Particle;
function disposeParticle(_arg1:Particle):void;
}
}//package org.flintparticles.common.particles
Section 270
//Renderer (org.flintparticles.common.renderers.Renderer)
package org.flintparticles.common.renderers {
import org.flintparticles.common.emitters.*;
public interface Renderer {
function removeEmitter(_arg1:Emitter):void;
function addEmitter(_arg1:Emitter):void;
}
}//package org.flintparticles.common.renderers
Section 271
//SpriteRendererBase (org.flintparticles.common.renderers.SpriteRendererBase)
package org.flintparticles.common.renderers {
import flash.events.*;
import flash.display.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
public class SpriteRendererBase extends Sprite implements Renderer {
protected var _emitters:Array;
public function SpriteRendererBase(){
_emitters = new Array();
mouseEnabled = false;
mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
}
private function particleAdded(_arg1:ParticleEvent):void{
addParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
private function addedToStage(_arg1:Event):void{
if (stage){
stage.invalidate();
};
}
public function get emitters():Array{
return (_emitters);
}
protected function addParticle(_arg1:Particle):void{
}
private function updateParticles(_arg1:Event):void{
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _emitters.length) {
_local2 = _local2.concat(_emitters[_local3].particles);
_local3++;
};
renderParticles(_local2);
}
private function emitterUpdated(_arg1:EmitterEvent):void{
if (stage){
stage.invalidate();
};
}
public function removeEmitter(_arg1:Emitter):void{
var _local3:Particle;
var _local2:int;
while (_local2 < _emitters.length) {
if (_emitters[_local2] == _arg1){
_emitters.splice(_local2, 1);
_arg1.removeEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated);
_arg1.removeEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved);
for each (_local3 in _arg1.particles) {
removeParticle(_local3);
};
if (_emitters.length == 0){
removeEventListener(Event.RENDER, updateParticles);
renderParticles([]);
} else {
stage.invalidate();
};
return;
};
_local2++;
};
}
protected function renderParticles(_arg1:Array):void{
}
protected function removeParticle(_arg1:Particle):void{
}
private function particleRemoved(_arg1:ParticleEvent):void{
removeParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
public function addEmitter(_arg1:Emitter):void{
var _local2:Particle;
_emitters.push(_arg1);
if (stage){
stage.invalidate();
};
_arg1.addEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved, false, 0, true);
for each (_local2 in _arg1.particles) {
addParticle(_local2);
};
if (_emitters.length == 1){
addEventListener(Event.RENDER, updateParticles, false, 0, true);
};
}
}
}//package org.flintparticles.common.renderers
Section 272
//construct (org.flintparticles.common.utils.construct)
package org.flintparticles.common.utils {
public function construct(_arg1:Class, _arg2:Array){
switch (_arg2.length){
case 0:
return (new (_arg1));
case 1:
return (new _arg1(_arg2[0]));
case 2:
return (new _arg1(_arg2[0], _arg2[1]));
case 3:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2]));
case 4:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3]));
case 5:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4]));
case 6:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5]));
case 7:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6]));
case 8:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7]));
case 9:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8]));
case 10:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8], _arg2[9]));
default:
return (null);
};
}
}//package org.flintparticles.common.utils
Section 273
//FrameUpdater (org.flintparticles.common.utils.FrameUpdater)
package org.flintparticles.common.utils {
import flash.events.*;
import flash.display.*;
import org.flintparticles.common.events.*;
import flash.utils.*;
public class FrameUpdater extends EventDispatcher {
private var _shape:Shape;
private var _time:Number;
private static var _instance:FrameUpdater;
public function FrameUpdater(){
_shape = new Shape();
_shape.addEventListener(Event.ENTER_FRAME, frameUpdate, false, 0, true);
_time = getTimer();
}
private function frameUpdate(_arg1:Event):void{
var _local2:int = _time;
_time = getTimer();
var _local3:Number = ((_time - _local2) * 0.001);
dispatchEvent(new UpdateEvent(UpdateEvent.UPDATE, _local3));
}
public static function get instance():FrameUpdater{
if (_instance == null){
_instance = new (FrameUpdater);
};
return (_instance);
}
}
}//package org.flintparticles.common.utils
Section 274
//interpolateColors (org.flintparticles.common.utils.interpolateColors)
package org.flintparticles.common.utils {
public function interpolateColors(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = Math.round(((((_arg1 >>> 16) & 0xFF) * _arg3) + (((_arg2 >>> 16) & 0xFF) * _local4)));
var _local6:uint = Math.round(((((_arg1 >>> 8) & 0xFF) * _arg3) + (((_arg2 >>> 8) & 0xFF) * _local4)));
var _local7:uint = Math.round((((_arg1 & 0xFF) * _arg3) + ((_arg2 & 0xFF) * _local4)));
var _local8:uint = Math.round(((((_arg1 >>> 24) & 0xFF) * _arg3) + (((_arg2 >>> 24) & 0xFF) * _local4)));
return (((((_local8 << 24) | (_local5 << 16)) | (_local6 << 8)) | _local7));
}
}//package org.flintparticles.common.utils
Section 275
//Maths (org.flintparticles.common.utils.Maths)
package org.flintparticles.common.utils {
public class Maths {
private static const DEGTORAD:Number = 0.0174532925199433;
private static const RADTODEG:Number = 57.2957795130823;
public static function asRadians(_arg1:Number):Number{
return ((_arg1 * DEGTORAD));
}
public static function asDegrees(_arg1:Number):Number{
return ((_arg1 * RADTODEG));
}
}
}//package org.flintparticles.common.utils
Section 276
//PriorityArray (org.flintparticles.common.utils.PriorityArray)
package org.flintparticles.common.utils {
import flash.utils.*;
public class PriorityArray extends Proxy {
private var _values:Array;
public function PriorityArray(){
_values = new Array();
}
public function remove(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (_values[_local2].value == _arg1){
_values.splice(_local2, 1);
return (true);
};
};
return (false);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return ((_arg1 - 1).toString());
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:uint = uint(_arg1);
if ((((_local3 == _arg1)) && ((_local3 < _values.length)))){
_values[_local3].value = _arg2;
};
}
public function add(_arg1, _arg2:Number):uint{
var _local3:uint = _values.length;
var _local4:uint;
while (_local4 < _local3) {
if (_values[_local4].priority < _arg2){
break;
};
_local4++;
};
_values.splice(_local4, 0, new Pair(_arg2, _arg1));
return (_values.length);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
var _local2:int = int(_arg1);
if ((((((_local2 == _arg1)) && ((_local2 < _values.length)))) && (_values[_local2]))){
return (_values[_local2].value);
};
return (undefined);
}
public function clear():void{
_values.length = 0;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
if (_arg1 < _values.length){
return ((_arg1 + 1));
};
return (0);
}
public function get length():uint{
return (_values.length);
}
public function removeAt(_arg1:uint){
var _local2:* = _values[_arg1].value;
_values.splice(_arg1, 1);
return (_local2);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextValue(_arg1:int){
return (_values[(_arg1 - 1)].value);
}
public function contains(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (_values[_local2].value == _arg1){
return (true);
};
};
return (false);
}
}
}//package org.flintparticles.common.utils
class Pair {
private var value;
private var priority:Number;
private function Pair(_arg1:Number, _arg2){
this.priority = _arg1;
this.value = _arg2;
}
}
Section 277
//Accelerate (org.flintparticles.threeD.actions.Accelerate)
package org.flintparticles.threeD.actions {
import org.flintparticles.common.actions.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.particles.*;
import org.flintparticles.common.emitters.*;
public class Accelerate extends ActionBase {
private var _acc:Vector3D;
private var _temp:Vector3D;
public function Accelerate(_arg1:Vector3D){
_temp = new Vector3D();
this.acceleration = _arg1;
}
public function get acceleration():Vector3D{
return (_acc);
}
public function set acceleration(_arg1:Vector3D):void{
_acc = _arg1.clone();
_acc.w = 0;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
Particle3D(_arg2).velocity.incrementBy(_acc.multiply(_arg3, _temp));
}
}
}//package org.flintparticles.threeD.actions
Section 278
//Move (org.flintparticles.threeD.actions.Move)
package org.flintparticles.threeD.actions {
import org.flintparticles.common.actions.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.particles.*;
import org.flintparticles.common.emitters.*;
public class Move extends ActionBase {
private var _temp:Vector3D;
public function Move(){
_temp = new Vector3D();
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle3D = Particle3D(_arg2);
_local4.position.incrementBy(_local4.velocity.multiply(_arg3, _temp));
}
override public function getDefaultPriority():Number{
return (-10);
}
}
}//package org.flintparticles.threeD.actions
Section 279
//Rotate (org.flintparticles.threeD.actions.Rotate)
package org.flintparticles.threeD.actions {
import org.flintparticles.common.actions.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.particles.*;
import org.flintparticles.common.emitters.*;
public class Rotate extends ActionBase {
private var q:Quaternion;
public function Rotate(){
q = new Quaternion();
}
override public function getDefaultPriority():Number{
return (-10);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle3D = Particle3D(_arg2);
q.w = 0;
q.x = (_local4.angVelocity.x * 0.5);
q.y = (_local4.angVelocity.y * 0.5);
q.z = (_local4.angVelocity.z * 0.5);
q.postMultiplyBy(_local4.rotation);
_local4.rotation.incrementBy(q.scaleBy(_arg3)).normalize();
}
}
}//package org.flintparticles.threeD.actions
Section 280
//Emitter3D (org.flintparticles.threeD.emitters.Emitter3D)
package org.flintparticles.threeD.emitters {
import org.flintparticles.common.particles.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.particles.*;
import org.flintparticles.common.emitters.*;
public class Emitter3D extends Emitter {
public var spaceSort:Boolean;// = false
protected var _position:Vector3D;
private var _rotTransformRotation:Quaternion;
public var spaceSortedX:Array;
protected var _rotationTransform:Matrix3D;
protected var _rotation:Quaternion;
protected static var _creator:ParticleCreator3D = new ParticleCreator3D();
public function Emitter3D(){
_particleFactory = _creator;
_position = new Vector3D(0, 0, 0, 1);
_rotation = Quaternion.IDENTITY.clone();
_rotationTransform = Matrix3D.IDENTITY.clone();
_rotTransformRotation = Quaternion.IDENTITY.clone();
}
public function get rotation():Quaternion{
return (_rotation);
}
override protected function sortParticles():void{
var _local1:int;
var _local2:int;
if (spaceSort){
spaceSortedX = _particles.sort(sortOnX, Array.RETURNINDEXEDARRAY);
_local1 = _particles.length;
_local2 = 0;
while (_local2 < _local1) {
_particles[spaceSortedX[_local2]].sortID = _local2;
_local2++;
};
};
}
public function get position():Vector3D{
return (_position);
}
public function get rotationTransform():Matrix3D{
if (!_rotTransformRotation.equals(_rotation)){
_rotationTransform = _rotation.toMatrixTransformation();
_rotTransformRotation = _rotation.clone();
};
return (_rotationTransform);
}
override protected function initParticle(_arg1:Particle):void{
var _local2:Particle3D = Particle3D(_arg1);
_local2.position = _position.clone();
_local2.rotation = _rotation.clone();
}
public function set position(_arg1:Vector3D):void{
_position = _arg1;
_position.w = 1;
}
private function sortOnX(_arg1:Particle3D, _arg2:Particle3D):int{
if (_arg1.position.x < _arg2.position.x){
return (-1);
};
if (_arg1.position.x > _arg2.position.x){
return (1);
};
return (0);
}
public function set rotation(_arg1:Quaternion):void{
_rotation = _arg1;
}
public static function get defaultParticleFactory():ParticleFactory{
return (_creator);
}
}
}//package org.flintparticles.threeD.emitters
Section 281
//Matrix3D (org.flintparticles.threeD.geom.Matrix3D)
package org.flintparticles.threeD.geom {
public class Matrix3D {
public var n11:Number;
public var n12:Number;
public var n13:Number;
public var n14:Number;
public var n21:Number;
public var n22:Number;
public var n23:Number;
public var n24:Number;
public var n31:Number;
public var n32:Number;
public var n33:Number;
public var n34:Number;
public var n41:Number;
public var n42:Number;
public var n43:Number;
public var n44:Number;
public static const ZERO:Matrix3D = new Matrix3D([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
;
public static const IDENTITY:Matrix3D = new Matrix3D([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
;
public function Matrix3D(_arg1:Array=null){
if (_arg1 == null){
_arg1 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
};
if (_arg1.length < 12){
throw (new Error("The array initializer in the Matrix3 class must cointain 12 values"));
};
n11 = _arg1[0];
n12 = _arg1[1];
n13 = _arg1[2];
n14 = _arg1[3];
n21 = _arg1[4];
n22 = _arg1[5];
n23 = _arg1[6];
n24 = _arg1[7];
n31 = _arg1[8];
n32 = _arg1[9];
n33 = _arg1[10];
n34 = _arg1[11];
if (_arg1.length < 16){
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
} else {
n41 = _arg1[12];
n42 = _arg1[13];
n43 = _arg1[14];
n44 = _arg1[15];
};
}
public function transformVectorOther(_arg1:Vector3D, _arg2:Vector3D):Vector3D{
_arg2.x = ((((n11 * _arg1.x) + (n12 * _arg1.y)) + (n13 * _arg1.z)) + (n14 * _arg1.w));
_arg2.y = ((((n21 * _arg1.x) + (n22 * _arg1.y)) + (n23 * _arg1.z)) + (n24 * _arg1.w));
_arg2.z = ((((n31 * _arg1.x) + (n32 * _arg1.y)) + (n33 * _arg1.z)) + (n34 * _arg1.w));
_arg2.w = ((((n41 * _arg1.x) + (n42 * _arg1.y)) + (n43 * _arg1.z)) + (n44 * _arg1.w));
return (_arg2);
}
public function transformArrayVectors(_arg1:Array):Array{
var _local3:Vector3D;
var _local2:Array = new Array();
for each (_local3 in _arg1) {
_local2.push(transformVector(_local3));
};
return (_local2);
}
public function nearEquals(_arg1:Matrix3D, _arg2:Number):Boolean{
return ((((((((((((((((((((((((((((((((Math.abs((_arg1.n11 - n11)) <= _arg2)) && ((Math.abs((_arg1.n12 - n12)) <= _arg2)))) && ((Math.abs((_arg1.n13 - n13)) <= _arg2)))) && ((Math.abs((_arg1.n14 - n14)) <= _arg2)))) && ((Math.abs((_arg1.n21 - n21)) <= _arg2)))) && ((Math.abs((_arg1.n22 - n22)) <= _arg2)))) && ((Math.abs((_arg1.n23 - n23)) <= _arg2)))) && ((Math.abs((_arg1.n24 - n24)) <= _arg2)))) && ((Math.abs((_arg1.n31 - n31)) <= _arg2)))) && ((Math.abs((_arg1.n32 - n32)) <= _arg2)))) && ((Math.abs((_arg1.n33 - n33)) <= _arg2)))) && ((Math.abs((_arg1.n34 - n34)) <= _arg2)))) && ((Math.abs((_arg1.n41 - n41)) <= _arg2)))) && ((Math.abs((_arg1.n42 - n42)) <= _arg2)))) && ((Math.abs((_arg1.n43 - n43)) <= _arg2)))) && ((Math.abs((_arg1.n44 - n44)) <= _arg2))));
}
public function appendBasisTransform(_arg1:Vector3D, _arg2:Vector3D, _arg3:Vector3D):Matrix3D{
return (append(newBasisTransform(_arg1, _arg2, _arg3)));
}
public function prependRotate(_arg1:Number, _arg2:Vector3D, _arg3:Vector3D=null):Matrix3D{
if (_arg1 == 0){
return (this);
};
return (prepend(newRotate(_arg1, _arg2, _arg3)));
}
public function appendRotate(_arg1:Number, _arg2:Vector3D, _arg3:Vector3D=null):Matrix3D{
if (_arg1 == 0){
return (this);
};
return (append(newRotate(_arg1, _arg2, _arg3)));
}
public function prepend(_arg1:Matrix3D):Matrix3D{
var _local2:Number = n11;
var _local3:Number = n12;
var _local4:Number = n13;
var _local5:Number = n14;
var _local6:Number = n21;
var _local7:Number = n22;
var _local8:Number = n23;
var _local9:Number = n24;
var _local10:Number = n31;
var _local11:Number = n32;
var _local12:Number = n33;
var _local13:Number = n34;
var _local14:Number = n41;
var _local15:Number = n42;
var _local16:Number = n43;
var _local17:Number = n44;
n11 = ((((_local2 * _arg1.n11) + (_local3 * _arg1.n21)) + (_local4 * _arg1.n31)) + (_local5 * _arg1.n41));
n12 = ((((_local2 * _arg1.n12) + (_local3 * _arg1.n22)) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n42));
n13 = ((((_local2 * _arg1.n13) + (_local3 * _arg1.n23)) + (_local4 * _arg1.n33)) + (_local5 * _arg1.n43));
n14 = ((((_local2 * _arg1.n14) + (_local3 * _arg1.n24)) + (_local4 * _arg1.n34)) + (_local5 * _arg1.n44));
n21 = ((((_local6 * _arg1.n11) + (_local7 * _arg1.n21)) + (_local8 * _arg1.n31)) + (_local9 * _arg1.n41));
n22 = ((((_local6 * _arg1.n12) + (_local7 * _arg1.n22)) + (_local8 * _arg1.n32)) + (_local9 * _arg1.n42));
n23 = ((((_local6 * _arg1.n13) + (_local7 * _arg1.n23)) + (_local8 * _arg1.n33)) + (_local9 * _arg1.n43));
n24 = ((((_local6 * _arg1.n14) + (_local7 * _arg1.n24)) + (_local8 * _arg1.n34)) + (_local9 * _arg1.n44));
n31 = ((((_local10 * _arg1.n11) + (_local11 * _arg1.n21)) + (_local12 * _arg1.n31)) + (_local13 * _arg1.n41));
n32 = ((((_local10 * _arg1.n12) + (_local11 * _arg1.n22)) + (_local12 * _arg1.n32)) + (_local13 * _arg1.n42));
n33 = ((((_local10 * _arg1.n13) + (_local11 * _arg1.n23)) + (_local12 * _arg1.n33)) + (_local13 * _arg1.n43));
n34 = ((((_local10 * _arg1.n14) + (_local11 * _arg1.n24)) + (_local12 * _arg1.n34)) + (_local13 * _arg1.n44));
n41 = ((((_local14 * _arg1.n11) + (_local15 * _arg1.n21)) + (_local16 * _arg1.n31)) + (_local17 * _arg1.n41));
n42 = ((((_local14 * _arg1.n12) + (_local15 * _arg1.n22)) + (_local16 * _arg1.n32)) + (_local17 * _arg1.n42));
n43 = ((((_local14 * _arg1.n13) + (_local15 * _arg1.n23)) + (_local16 * _arg1.n33)) + (_local17 * _arg1.n43));
n44 = ((((_local14 * _arg1.n14) + (_local15 * _arg1.n24)) + (_local16 * _arg1.n34)) + (_local17 * _arg1.n44));
return (this);
}
public function append(_arg1:Matrix3D):Matrix3D{
var _local2:Number = n11;
var _local3:Number = n12;
var _local4:Number = n13;
var _local5:Number = n14;
var _local6:Number = n21;
var _local7:Number = n22;
var _local8:Number = n23;
var _local9:Number = n24;
var _local10:Number = n31;
var _local11:Number = n32;
var _local12:Number = n33;
var _local13:Number = n34;
var _local14:Number = n41;
var _local15:Number = n42;
var _local16:Number = n43;
var _local17:Number = n44;
n11 = ((((_arg1.n11 * _local2) + (_arg1.n12 * _local6)) + (_arg1.n13 * _local10)) + (_arg1.n14 * _local14));
n12 = ((((_arg1.n11 * _local3) + (_arg1.n12 * _local7)) + (_arg1.n13 * _local11)) + (_arg1.n14 * _local15));
n13 = ((((_arg1.n11 * _local4) + (_arg1.n12 * _local8)) + (_arg1.n13 * _local12)) + (_arg1.n14 * _local16));
n14 = ((((_arg1.n11 * _local5) + (_arg1.n12 * _local9)) + (_arg1.n13 * _local13)) + (_arg1.n14 * _local17));
n21 = ((((_arg1.n21 * _local2) + (_arg1.n22 * _local6)) + (_arg1.n23 * _local10)) + (_arg1.n24 * _local14));
n22 = ((((_arg1.n21 * _local3) + (_arg1.n22 * _local7)) + (_arg1.n23 * _local11)) + (_arg1.n24 * _local15));
n23 = ((((_arg1.n21 * _local4) + (_arg1.n22 * _local8)) + (_arg1.n23 * _local12)) + (_arg1.n24 * _local16));
n24 = ((((_arg1.n21 * _local5) + (_arg1.n22 * _local9)) + (_arg1.n23 * _local13)) + (_arg1.n24 * _local17));
n31 = ((((_arg1.n31 * _local2) + (_arg1.n32 * _local6)) + (_arg1.n33 * _local10)) + (_arg1.n34 * _local14));
n32 = ((((_arg1.n31 * _local3) + (_arg1.n32 * _local7)) + (_arg1.n33 * _local11)) + (_arg1.n34 * _local15));
n33 = ((((_arg1.n31 * _local4) + (_arg1.n32 * _local8)) + (_arg1.n33 * _local12)) + (_arg1.n34 * _local16));
n34 = ((((_arg1.n31 * _local5) + (_arg1.n32 * _local9)) + (_arg1.n33 * _local13)) + (_arg1.n34 * _local17));
n41 = ((((_arg1.n41 * _local2) + (_arg1.n42 * _local6)) + (_arg1.n43 * _local10)) + (_arg1.n44 * _local14));
n42 = ((((_arg1.n41 * _local3) + (_arg1.n42 * _local7)) + (_arg1.n43 * _local11)) + (_arg1.n44 * _local15));
n43 = ((((_arg1.n41 * _local4) + (_arg1.n42 * _local8)) + (_arg1.n43 * _local12)) + (_arg1.n44 * _local16));
n44 = ((((_arg1.n41 * _local5) + (_arg1.n42 * _local9)) + (_arg1.n43 * _local13)) + (_arg1.n44 * _local17));
return (this);
}
public function get position():Vector3D{
return (new Vector3D(n14, n24, n34, n44));
}
public function get inverse():Matrix3D{
return (clone().invert());
}
public function transformVectorSelf(_arg1:Vector3D):Vector3D{
return (_arg1.reset(((((n11 * _arg1.x) + (n12 * _arg1.y)) + (n13 * _arg1.z)) + (n14 * _arg1.w)), ((((n21 * _arg1.x) + (n22 * _arg1.y)) + (n23 * _arg1.z)) + (n24 * _arg1.w)), ((((n31 * _arg1.x) + (n32 * _arg1.y)) + (n33 * _arg1.z)) + (n34 * _arg1.w)), ((((n41 * _arg1.x) + (n42 * _arg1.y)) + (n43 * _arg1.z)) + (n44 * _arg1.w))));
}
public function appendTranslation(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (append(newTranslation(_arg1, _arg2, _arg3)));
}
public function equals(_arg1:Matrix3D):Boolean{
return ((((((((((((((((((((((((((((((((_arg1.n11 == n11)) && ((_arg1.n12 == n12)))) && ((_arg1.n13 == n13)))) && ((_arg1.n14 == n14)))) && ((_arg1.n21 == n21)))) && ((_arg1.n22 == n22)))) && ((_arg1.n23 == n23)))) && ((_arg1.n24 == n24)))) && ((_arg1.n31 == n31)))) && ((_arg1.n32 == n32)))) && ((_arg1.n33 == n33)))) && ((_arg1.n34 == n34)))) && ((_arg1.n41 == n41)))) && ((_arg1.n42 == n42)))) && ((_arg1.n43 == n43)))) && ((_arg1.n44 == n44))));
}
public function prependTranslation(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (prepend(newTranslation(_arg1, _arg2, _arg3)));
}
public function appendScale(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (append(newScale(_arg1, _arg2, _arg3)));
}
public function set position(_arg1:Vector3D):void{
n14 = _arg1.x;
n24 = _arg1.y;
n34 = _arg1.z;
if (_arg1.w != 0){
n44 = _arg1.w;
};
}
public function get determinant():Number{
return (((((((((n11 * n22) - (n12 * n21)) * ((n33 * n44) - (n34 * n43))) + (((n13 * n21) - (n11 * n23)) * ((n32 * n44) - (n34 * n42)))) + (((n11 * n24) - (n14 * n21)) * ((n32 * n43) - (n33 * n42)))) + (((n12 * n23) - (n13 * n22)) * ((n31 * n44) - (n34 * n41)))) + (((n14 * n22) - (n12 * n24)) * ((n31 * n43) - (n33 * n41)))) + (((n13 * n24) - (n14 * n23)) * ((n31 * n42) - (n32 * n41)))));
}
public function prependScale(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (prepend(newScale(_arg1, _arg2, _arg3)));
}
public function clone():Matrix3D{
return (new Matrix3D(rawData));
}
public function set rawData(_arg1:Array):void{
if (_arg1.length < 12){
throw (new Error("The raw data for the Matrix3D class must contain 12 or 16 values"));
};
n11 = _arg1[0];
n12 = _arg1[1];
n13 = _arg1[2];
n14 = _arg1[3];
n21 = _arg1[4];
n22 = _arg1[5];
n23 = _arg1[6];
n24 = _arg1[7];
n31 = _arg1[8];
n32 = _arg1[9];
n33 = _arg1[10];
n34 = _arg1[11];
if (_arg1.length < 16){
n41 = 0;
n42 = 0;
n43 = 0;
n44 = 1;
} else {
n41 = _arg1[12];
n42 = _arg1[13];
n43 = _arg1[14];
n44 = _arg1[15];
};
}
public function invert():Matrix3D{
var _local1:Number = determinant;
if (Math.abs(_local1) < 0.0001){
n11 = (n12 = (n13 = (n14 = (n21 = (n22 = (n23 = (n24 = (n31 = (n32 = (n33 = (n34 = (n41 = (n42 = (n43 = (n44 = NaN)))))))))))))));
return (null);
};
var _local2:Number = (1 / _local1);
var _local3:Number = n11;
var _local4:Number = n12;
var _local5:Number = n13;
var _local6:Number = n14;
var _local7:Number = n21;
var _local8:Number = n22;
var _local9:Number = n23;
var _local10:Number = n24;
var _local11:Number = n31;
var _local12:Number = n32;
var _local13:Number = n33;
var _local14:Number = n34;
var _local15:Number = n41;
var _local16:Number = n42;
var _local17:Number = n43;
var _local18:Number = n44;
n11 = (_local2 * (((_local8 * ((_local13 * _local18) - (_local17 * _local14))) - (_local12 * ((_local9 * _local18) - (_local17 * _local10)))) + (_local16 * ((_local9 * _local14) - (_local13 * _local10)))));
n12 = (-(_local2) * (((_local4 * ((_local13 * _local18) - (_local17 * _local14))) - (_local12 * ((_local5 * _local18) - (_local17 * _local6)))) + (_local16 * ((_local5 * _local14) - (_local13 * _local6)))));
n13 = (_local2 * (((_local4 * ((_local9 * _local18) - (_local17 * _local10))) - (_local8 * ((_local5 * _local18) - (_local17 * _local6)))) + (_local16 * ((_local5 * _local10) - (_local9 * _local6)))));
n14 = (-(_local2) * (((_local4 * ((_local9 * _local14) - (_local13 * _local10))) - (_local8 * ((_local5 * _local14) - (_local13 * _local6)))) + (_local12 * ((_local5 * _local10) - (_local9 * _local6)))));
n21 = (-(_local2) * (((_local7 * ((_local13 * _local18) - (_local17 * _local14))) - (_local11 * ((_local9 * _local18) - (_local17 * _local10)))) + (_local15 * ((_local9 * _local14) - (_local13 * _local10)))));
n22 = (_local2 * (((_local3 * ((_local13 * _local18) - (_local17 * _local14))) - (_local11 * ((_local5 * _local18) - (_local17 * _local6)))) + (_local15 * ((_local5 * _local14) - (_local13 * _local6)))));
n23 = (-(_local2) * (((_local3 * ((_local9 * _local18) - (_local17 * _local10))) - (_local7 * ((_local5 * _local18) - (_local17 * _local6)))) + (_local15 * ((_local5 * _local10) - (_local9 * _local6)))));
n24 = (_local2 * (((_local3 * ((_local9 * _local14) - (_local13 * _local10))) - (_local7 * ((_local5 * _local14) - (_local13 * _local6)))) + (_local11 * ((_local5 * _local10) - (_local9 * _local6)))));
n31 = (_local2 * (((_local7 * ((_local12 * _local18) - (_local16 * _local14))) - (_local11 * ((_local8 * _local18) - (_local16 * _local10)))) + (_local15 * ((_local8 * _local14) - (_local12 * _local10)))));
n32 = (-(_local2) * (((_local3 * ((_local12 * _local18) - (_local16 * _local14))) - (_local11 * ((_local4 * _local18) - (_local16 * _local6)))) + (_local15 * ((_local4 * _local14) - (_local12 * _local6)))));
n33 = (_local2 * (((_local3 * ((_local8 * _local18) - (_local16 * _local10))) - (_local7 * ((_local4 * _local18) - (_local16 * _local6)))) + (_local15 * ((_local4 * _local10) - (_local8 * _local6)))));
n34 = (-(_local2) * (((_local3 * ((_local8 * _local14) - (_local12 * _local10))) - (_local7 * ((_local4 * _local14) - (_local12 * _local6)))) + (_local11 * ((_local4 * _local10) - (_local8 * _local6)))));
n41 = (-(_local2) * (((_local7 * ((_local12 * _local17) - (_local16 * _local13))) - (_local11 * ((_local8 * _local17) - (_local16 * _local9)))) + (_local15 * ((_local8 * _local13) - (_local12 * _local9)))));
n42 = (_local2 * (((_local3 * ((_local12 * _local17) - (_local16 * _local13))) - (_local11 * ((_local4 * _local17) - (_local16 * _local5)))) + (_local15 * ((_local4 * _local13) - (_local12 * _local5)))));
n43 = (-(_local2) * (((_local3 * ((_local8 * _local17) - (_local16 * _local9))) - (_local7 * ((_local4 * _local17) - (_local16 * _local5)))) + (_local15 * ((_local4 * _local9) - (_local8 * _local5)))));
n44 = (_local2 * (((_local3 * ((_local8 * _local13) - (_local12 * _local9))) - (_local7 * ((_local4 * _local13) - (_local12 * _local5)))) + (_local11 * ((_local4 * _local9) - (_local8 * _local5)))));
return (this);
}
public function transformVector(_arg1:Vector3D):Vector3D{
return (new Vector3D(((((n11 * _arg1.x) + (n12 * _arg1.y)) + (n13 * _arg1.z)) + (n14 * _arg1.w)), ((((n21 * _arg1.x) + (n22 * _arg1.y)) + (n23 * _arg1.z)) + (n24 * _arg1.w)), ((((n31 * _arg1.x) + (n32 * _arg1.y)) + (n33 * _arg1.z)) + (n34 * _arg1.w)), ((((n41 * _arg1.x) + (n42 * _arg1.y)) + (n43 * _arg1.z)) + (n44 * _arg1.w))));
}
public function transformArrayVectorsSelf(_arg1:Array):Array{
var _local2:Vector3D;
for each (_local2 in _arg1) {
transformVectorSelf(_local2);
};
return (_arg1);
}
public function get rawData():Array{
return ([n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44]);
}
public function toString():String{
return (rawData.toString());
}
public function copy(_arg1:Matrix3D):Matrix3D{
n11 = _arg1.n11;
n12 = _arg1.n12;
n13 = _arg1.n13;
n14 = _arg1.n14;
n21 = _arg1.n21;
n22 = _arg1.n22;
n23 = _arg1.n23;
n24 = _arg1.n24;
n31 = _arg1.n31;
n32 = _arg1.n32;
n33 = _arg1.n33;
n34 = _arg1.n34;
n41 = _arg1.n41;
n42 = _arg1.n42;
n43 = _arg1.n43;
n44 = _arg1.n44;
return (this);
}
public function prependBasisTransform(_arg1:Vector3D, _arg2:Vector3D, _arg3:Vector3D):Matrix3D{
return (prepend(newBasisTransform(_arg1, _arg2, _arg3)));
}
public static function newTranslation(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D([1, 0, 0, _arg1, 0, 1, 0, _arg2, 0, 0, 1, _arg3, 0, 0, 0, 1]));
}
public static function newBasisTransform(_arg1:Vector3D, _arg2:Vector3D, _arg3:Vector3D):Matrix3D{
var _local4:Matrix3D = new Matrix3D([_arg1.x, _arg2.x, _arg3.x, 0, _arg1.y, _arg2.y, _arg3.y, 0, _arg1.z, _arg2.z, _arg3.z, 0, 0, 0, 0, 1]);
_local4.invert();
return (_local4);
}
public static function newScale(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D([_arg1, 0, 0, 0, 0, _arg2, 0, 0, 0, 0, _arg3, 0, 0, 0, 0, 1]));
}
public static function newRotate(_arg1:Number, _arg2:Vector3D, _arg3:Vector3D=null):Matrix3D{
var _local5:Number;
if (_arg1 == 0){
return (IDENTITY.clone());
};
var _local4:Number = Math.sin(_arg1);
_local5 = Math.cos(_arg1);
var _local6:Number = (1 - _local5);
var _local7:Matrix3D = new Matrix3D([(_local5 + ((_arg2.x * _arg2.x) * _local6)), (((_arg2.x * _arg2.y) * _local6) - (_arg2.z * _local4)), (((_arg2.x * _arg2.z) * _local6) + (_arg2.y * _local4)), 0, (((_arg2.x * _arg2.y) * _local6) + (_arg2.z * _local4)), (_local5 + ((_arg2.y * _arg2.y) * _local6)), (((_arg2.y * _arg2.z) * _local6) - (_arg2.x * _local4)), 0, (((_arg2.x * _arg2.z) * _local6) - (_arg2.y * _local4)), (((_arg2.y * _arg2.z) * _local6) + (_arg2.x * _local4)), (_local5 + ((_arg2.z * _arg2.z) * _local6)), 0, 0, 0, 0, 1]);
if (_arg3){
_local7.prependTranslation(-(_arg3.x), -(_arg3.y), -(_arg3.z));
_local7.appendTranslation(_arg3.x, _arg3.y, _arg3.z);
};
return (_local7);
}
}
}//package org.flintparticles.threeD.geom
Section 282
//Quaternion (org.flintparticles.threeD.geom.Quaternion)
package org.flintparticles.threeD.geom {
public class Quaternion {
public var w:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public static var ZERO:Quaternion = new Quaternion(0, 0, 0, 0);
;
public static var IDENTITY:Quaternion = new Quaternion(1, 0, 0, 0);
;
public function Quaternion(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.w = _arg1;
this.x = _arg2;
this.y = _arg3;
this.z = _arg4;
}
public function scaleBy(_arg1:Number):Quaternion{
w = (w * _arg1);
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
return (this);
}
public function unit():Quaternion{
return (clone().normalize());
}
public function toMatrixTransformation():Matrix3D{
var _local1:Number = (x * x);
var _local2:Number = (y * y);
var _local3:Number = (z * z);
var _local4:Number = (w * x);
var _local5:Number = (w * y);
var _local6:Number = (w * z);
var _local7:Number = (x * y);
var _local8:Number = (x * z);
var _local9:Number = (y * z);
return (new Matrix3D([(1 - (2 * (_local2 + _local3))), (2 * (_local7 - _local6)), (2 * (_local8 + _local5)), 0, (2 * (_local7 + _local6)), (1 - (2 * (_local1 - _local3))), (2 * (_local9 - _local4)), 0, (2 * (_local8 - _local5)), (2 * (_local9 + _local4)), (1 - (2 * (_local1 - _local2))), 0, 0, 0, 0, 1]));
}
public function nearEquals(_arg1:Quaternion, _arg2:Number):Boolean{
return ((this.subtract(_arg1).magnitudeSquared < (_arg2 * _arg2)));
}
public function scalarMultiply(_arg1:Number):Quaternion{
return (new Quaternion((w * _arg1), (x * _arg1), (y * _arg1), (z * _arg1)));
}
public function decrementBy(_arg1:Quaternion):Quaternion{
w = (w - _arg1.w);
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
return (this);
}
public function setFromAxisRotation(_arg1:Vector3D, _arg2:Number=NaN):Quaternion{
if (isNaN(_arg2)){
_arg2 = (_arg1.w * 0.5);
} else {
_arg2 = (_arg2 * 0.5);
};
if (_arg1.lengthSquared != 1){
_arg1 = _arg1.unit();
};
var _local3:Number = Math.sin(_arg2);
w = Math.cos(_arg2);
x = (-(_local3) * _arg1.x);
y = (-(_local3) * _arg1.y);
z = (-(_local3) * _arg1.z);
return (this);
}
public function normalize():Quaternion{
var _local1:Number = magnitude;
if (_local1 != 0){
_local1 = (1 / _local1);
w = (w * _local1);
x = (x * _local1);
y = (y * _local1);
z = (z * _local1);
} else {
throw (new Error("Cannot make a unit quaternion from the zero quaternion."));
};
return (this);
}
public function reset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):Quaternion{
this.w = _arg1;
this.x = _arg2;
this.y = _arg3;
this.z = _arg4;
return (this);
}
public function get magnitude():Number{
return (Math.sqrt(magnitudeSquared));
}
public function makeConjugate():Quaternion{
x = -(x);
y = -(y);
z = -(z);
return (this);
}
public function get inverse():Quaternion{
return (conjugate.scaleBy((1 / magnitudeSquared)));
}
public function subtract(_arg1:Quaternion):Quaternion{
return (new Quaternion((w - _arg1.w), (x - _arg1.x), (y - _arg1.y), (z - _arg1.z)));
}
public function invert():Quaternion{
makeConjugate();
scaleBy((1 / magnitudeSquared));
return (this);
}
public function get conjugate():Quaternion{
return (new Quaternion(w, -(x), -(y), -(z)));
}
public function toAxisRotation():Vector3D{
var _local1:Number = (2 * Math.acos(w));
var _local2:Vector3D = new Vector3D(x, y, z);
_local2.normalize();
_local2.w = _local1;
return (_local2);
}
public function postMultiplyBy(_arg1:Quaternion):Quaternion{
var _local2:Number = w;
var _local3:Number = x;
var _local4:Number = y;
var _local5:Number = z;
w = ((((_local2 * _arg1.w) - (_local3 * _arg1.x)) - (_local4 * _arg1.y)) - (_local5 * _arg1.z));
x = ((((_local2 * _arg1.x) + (_local3 * _arg1.w)) + (_local4 * _arg1.z)) - (_local5 * _arg1.y));
y = ((((_local2 * _arg1.y) - (_local3 * _arg1.z)) + (_local4 * _arg1.w)) + (_local5 * _arg1.x));
z = ((((_local2 * _arg1.z) + (_local3 * _arg1.y)) - (_local4 * _arg1.x)) + (_local5 * _arg1.w));
return (this);
}
public function clone():Quaternion{
return (new Quaternion(w, x, y, z));
}
public function preMultiplyBy(_arg1:Quaternion):Quaternion{
var _local2:Number = w;
var _local3:Number = x;
var _local4:Number = y;
var _local5:Number = z;
w = ((((_arg1.w * _local2) - (_arg1.x * _local3)) - (_arg1.y * _local4)) - (_arg1.z * _local5));
x = ((((_arg1.w * _local3) + (_arg1.x * _local2)) + (_arg1.y * _local5)) - (_arg1.z * _local4));
y = ((((_arg1.w * _local4) - (_arg1.x * _local5)) + (_arg1.y * _local2)) + (_arg1.z * _local3));
z = ((((_arg1.w * _local5) + (_arg1.x * _local4)) - (_arg1.y * _local3)) + (_arg1.z * _local2));
return (this);
}
public function add(_arg1:Quaternion):Quaternion{
return (new Quaternion((w + _arg1.w), (x + _arg1.x), (y + _arg1.y), (z + _arg1.z)));
}
public function postMultiply(_arg1:Quaternion):Quaternion{
return (new Quaternion(((((w * _arg1.w) - (x * _arg1.x)) - (y * _arg1.y)) - (z * _arg1.z)), ((((w * _arg1.x) + (x * _arg1.w)) + (y * _arg1.z)) - (z * _arg1.y)), ((((w * _arg1.y) - (x * _arg1.z)) + (y * _arg1.w)) + (z * _arg1.x)), ((((w * _arg1.z) + (x * _arg1.y)) - (y * _arg1.x)) + (z * _arg1.w))));
}
public function incrementBy(_arg1:Quaternion):Quaternion{
w = (w + _arg1.w);
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
return (this);
}
public function preMultiply(_arg1:Quaternion):Quaternion{
return (new Quaternion(((((_arg1.w * w) - (_arg1.x * x)) - (_arg1.y * y)) - (_arg1.z * z)), ((((_arg1.w * x) + (_arg1.x * w)) + (_arg1.y * z)) - (_arg1.z * y)), ((((_arg1.w * y) - (_arg1.x * z)) + (_arg1.y * w)) + (_arg1.z * x)), ((((_arg1.w * z) + (_arg1.x * y)) - (_arg1.y * x)) + (_arg1.z * w))));
}
public function toString():String{
return ((((((((("(w=" + w) + ", x=") + x) + ", y=") + y) + ", z=") + z) + ")"));
}
public function dotProduct(_arg1:Quaternion):Number{
return (((((w * _arg1.w) + (x * _arg1.x)) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function assign(_arg1:Quaternion):Quaternion{
w = _arg1.w;
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
return (this);
}
public function get magnitudeSquared():Number{
return (((((w * w) + (x * x)) + (y * y)) + (z * z)));
}
public function equals(_arg1:Quaternion):Boolean{
return ((((((((x == _arg1.x)) && ((y == _arg1.y)))) && ((z == _arg1.z)))) && ((w == _arg1.w))));
}
public static function createFromAxisRotation(_arg1:Vector3D, _arg2:Number=NaN):Quaternion{
var _local3:Quaternion = new (Quaternion);
_local3.setFromAxisRotation(_arg1, _arg2);
return (_local3);
}
}
}//package org.flintparticles.threeD.geom
Section 283
//Vector3D (org.flintparticles.threeD.geom.Vector3D)
package org.flintparticles.threeD.geom {
public class Vector3D {
public var w:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public static const ZERO:Vector3D = new Vector3D(0, 0, 0, 0);
;
public static const AXISW:Vector3D = new Vector3D(0, 0, 0, 1);
;
public static const AXISX:Vector3D = new Vector3D(1, 0, 0, 0);
;
public static const AXISY:Vector3D = new Vector3D(0, 1, 0, 0);
;
public static const AXISZ:Vector3D = new Vector3D(0, 0, 1, 0);
;
public function Vector3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.w = _arg4;
}
public function scaleBy(_arg1:Number):Vector3D{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
return (this);
}
public function negate():Vector3D{
x = -(x);
y = -(y);
z = -(z);
return (this);
}
public function unit(_arg1:Vector3D=null):Vector3D{
if (_arg1 == null){
_arg1 = new Vector3D();
};
return (_arg1.reset(x, y, z, w).normalize());
}
public function nearEquals(_arg1:Vector3D, _arg2:Number):Boolean{
return ((_slot1.distanceSquared(this, _arg1) <= (_arg2 * _arg2)));
}
public function decrementBy(_arg1:Vector3D):Vector3D{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
w = (w - _arg1.w);
return (this);
}
public function normalize():Vector3D{
var _local1:Number = this.length;
if (_local1 != 0){
_local1 = (1 / _local1);
x = (x * _local1);
y = (y * _local1);
z = (z * _local1);
} else {
throw (new Error("Cannot make a unit vector from the zero vector."));
};
return (this);
}
public function reset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):Vector3D{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.w = _arg4;
return (this);
}
public function subtract(_arg1:Vector3D, _arg2:Vector3D=null):Vector3D{
if (_arg2 == null){
_arg2 = new Vector3D();
};
return (_arg2.reset((x - _arg1.x), (y - _arg1.y), (z - _arg1.z), (w - _arg1.w)));
}
public function crossProduct(_arg1:Vector3D, _arg2:Vector3D=null):Vector3D{
if (_arg2 == null){
_arg2 = new Vector3D();
};
return (_arg2.reset(((y * _arg1.z) - (z * _arg1.y)), ((z * _arg1.x) - (x * _arg1.z)), ((x * _arg1.y) - (y * _arg1.x))));
}
public function project():Vector3D{
if (w != 0){
return (scaleBy((1 / w)));
};
throw (new Error("Cannot project a vector with a w coordinate of zero."));
}
public function clone(_arg1:Vector3D=null):Vector3D{
if (_arg1 == null){
_arg1 = new Vector3D();
};
return (_arg1.reset(x, y, z, w));
}
public function add(_arg1:Vector3D, _arg2:Vector3D=null):Vector3D{
if (_arg2 == null){
_arg2 = new Vector3D();
};
return (_arg2.reset((x + _arg1.x), (y + _arg1.y), (z + _arg1.z), (w + _arg1.w)));
}
public function multiply(_arg1:Number, _arg2:Vector3D=null):Vector3D{
if (_arg2 == null){
_arg2 = new Vector3D();
};
return (_arg2.reset((x * _arg1), (y * _arg1), (z * _arg1), w));
}
public function incrementBy(_arg1:Vector3D):Vector3D{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
w = (w + _arg1.w);
return (this);
}
public function get lengthSquared():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function toString():String{
return ((((((((("(x=" + x) + ", y=") + y) + ", z=") + z) + ", w=") + w) + ")"));
}
public function dotProduct(_arg1:Vector3D):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function assign(_arg1:Vector3D):Vector3D{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
w = _arg1.w;
return (this);
}
public function get length():Number{
return (Math.sqrt(lengthSquared));
}
public function negative(_arg1:Vector3D=null):Vector3D{
if (_arg1 == null){
_arg1 = new Vector3D();
};
return (_arg1.reset(-(x), -(y), -(z), w));
}
public function equals(_arg1:Vector3D):Boolean{
return ((((((((x == _arg1.x)) && ((y == _arg1.y)))) && ((z == _arg1.z)))) && ((w == _arg1.w))));
}
public static function distanceSquared(_arg1:Vector3D, _arg2:Vector3D):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
var _local5:Number = (_arg1.z - _arg2.z);
return ((((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5)));
}
public static function distance(_arg1:Vector3D, _arg2:Vector3D):Number{
return (Math.sqrt(_slot1.distanceSquared(_arg1, _arg2)));
}
}
}//package org.flintparticles.threeD.geom
Section 284
//Vector3DUtils (org.flintparticles.threeD.geom.Vector3DUtils)
package org.flintparticles.threeD.geom {
public class Vector3DUtils {
public static function getPerpendicular(_arg1:Vector3D):Vector3D{
if (_arg1.x == 0){
return (new Vector3D(1, 0, 0));
};
return (new Vector3D(_arg1.y, -(_arg1.x), 0).normalize());
}
public static function getPerpendiculars(_arg1:Vector3D):Array{
var _local2:Vector3D = getPerpendicular(_arg1);
var _local3:Vector3D = _arg1.crossProduct(_local2).normalize();
return ([_local2, _local3]);
}
}
}//package org.flintparticles.threeD.geom
Section 285
//RotateVelocity (org.flintparticles.threeD.initializers.RotateVelocity)
package org.flintparticles.threeD.initializers {
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.particles.*;
import org.flintparticles.common.emitters.*;
public class RotateVelocity extends InitializerBase {
private var _axis:Vector3D;
private var _max:Number;
private var _min:Number;
public function RotateVelocity(_arg1:Vector3D, _arg2:Number, _arg3:Number=NaN){
_axis = _arg1.unit();
_min = _arg2;
_max = _arg3;
}
public function get axis():Vector3D{
return (_axis);
}
public function set axis(_arg1:Vector3D):void{
_axis = _arg1;
}
public function get maxAngVelocity():Number{
return (_max);
}
public function get minAngVelocity():Number{
return (_min);
}
public function set maxAngVelocity(_arg1:Number):void{
_max = _arg1;
}
public function set angVelocity(_arg1:Number):void{
_max = (_min = _arg1);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local4:Number;
var _local3:Particle3D = Particle3D(_arg2);
if (isNaN(_max)){
_local4 = _min;
} else {
_local4 = (_min + (Math.random() * (_max - _min)));
};
_local3.angVelocity.assign(axis).scaleBy(_local4);
}
public function set minAngVelocity(_arg1:Number):void{
_min = _arg1;
}
public function get angVelocity():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
}
}//package org.flintparticles.threeD.initializers
Section 286
//Velocity (org.flintparticles.threeD.initializers.Velocity)
package org.flintparticles.threeD.initializers {
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.threeD.zones.*;
import org.flintparticles.threeD.emitters.*;
public class Velocity extends InitializerBase {
private var _zone:Zone3D;
public function Velocity(_arg1:Zone3D){
_zone = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle3D = Particle3D(_arg2);
var _local4:Emitter3D = Emitter3D(_arg1);
var _local5:Vector3D = zone.getLocation();
_local5.w = 0;
if (!_local4.rotation.equals(Quaternion.IDENTITY)){
_local4.rotationTransform.transformVectorSelf(_local5);
};
_local3.velocity = _local5;
}
public function set zone(_arg1:Zone3D):void{
_zone = _arg1;
}
public function get zone():Zone3D{
return (_zone);
}
}
}//package org.flintparticles.threeD.initializers
Section 287
//Particle3D (org.flintparticles.threeD.particles.Particle3D)
package org.flintparticles.threeD.particles {
import org.flintparticles.common.particles.*;
import org.flintparticles.threeD.geom.*;
public class Particle3D extends Particle {
public var projectedPosition:Vector3D;
private var _previousRadius:Number;
public var velocity:Vector3D;
public var angVelocity:Vector3D;
public var faceAxis:Vector3D;
public var position:Vector3D;
private var _previousMass:Number;
public var zDepth:Number;// = 0
public var sortID:int;// = -1
private var _inertia:Number;
public var rotation:Quaternion;
public function Particle3D(){
position = new Vector3D(0, 0, 0, 1);
projectedPosition = new Vector3D(0, 0, 0, 1);
faceAxis = new Vector3D(1, 0, 0, 0);
velocity = new Vector3D(0, 0, 0, 0);
rotation = new Quaternion(1, 0, 0, 0);
angVelocity = new Vector3D(0, 0, 0, 0);
}
override public function initialize():void{
super.initialize();
position.reset(0, 0, 0, 1);
projectedPosition.reset(0, 0, 0, 1);
faceAxis.reset(1, 0, 0, 0);
velocity.reset(0, 0, 0, 0);
rotation.reset(1, 0, 0, 0);
angVelocity.reset(0, 0, 0, 0);
sortID = -1;
zDepth = 0;
}
override public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle3D;
if (_arg1){
_local2 = (_arg1.createParticle() as Particle3D);
} else {
_local2 = new Particle3D();
};
cloneInto(_local2);
_local2.position = position.clone();
_local2.projectedPosition = projectedPosition.clone();
_local2.faceAxis = faceAxis.clone();
_local2.velocity = velocity.clone();
_local2.rotation = rotation.clone();
_local2.angVelocity = angVelocity.clone();
_local2.zDepth = zDepth;
return (_local2);
}
public function get inertia():Number{
if (((!((mass == _previousMass))) || (!((collisionRadius == _previousRadius))))){
_inertia = (((mass * collisionRadius) * collisionRadius) * 0.4);
_previousMass = mass;
_previousRadius = collisionRadius;
};
return (_inertia);
}
}
}//package org.flintparticles.threeD.particles
Section 288
//ParticleCreator3D (org.flintparticles.threeD.particles.ParticleCreator3D)
package org.flintparticles.threeD.particles {
import org.flintparticles.common.particles.*;
public class ParticleCreator3D implements ParticleFactory {
private var _particles:Array;
public function ParticleCreator3D(){
_particles = new Array();
}
public function clearAllParticles():void{
_particles = new Array();
}
public function disposeParticle(_arg1:Particle):void{
_arg1.initialize();
_particles.push(_arg1);
}
public function createParticle():Particle{
if (_particles.length){
return (_particles.pop());
};
return (new Particle3D());
}
}
}//package org.flintparticles.threeD.particles
Section 289
//OrbitCamera (org.flintparticles.threeD.renderers.controllers.OrbitCamera)
package org.flintparticles.threeD.renderers.controllers {
import flash.events.*;
import flash.display.*;
import org.flintparticles.common.events.*;
import org.flintparticles.threeD.renderers.*;
import org.flintparticles.common.utils.*;
import flash.ui.*;
public class OrbitCamera {
private var _running:Boolean;// = false
private var _camera:Camera;
private var leftDown:Boolean;// = false
private var _trackRate:Number;
private var _maximumFrameTime:Number;// = 0.5
private var _rotationRate:Number;
private var rightDown:Boolean;// = false
private var _useInternalTick:Boolean;
private var aDown:Boolean;// = false
private var upDown:Boolean;// = false
private var dDown:Boolean;// = false
private var downDown:Boolean;// = false
private var sDown:Boolean;// = false
private var wDown:Boolean;// = false
private var _stage:DisplayObject;
public function OrbitCamera(_arg1:DisplayObject, _arg2:Camera, _arg3:Number=1, _arg4:Number=100, _arg5:Boolean=true){
_camera = _arg2;
this.stage = _arg1;
_rotationRate = _arg3;
_trackRate = _arg4;
_useInternalTick = _arg5;
}
public function set useInternalTick(_arg1:Boolean):void{
if (_useInternalTick != _arg1){
_useInternalTick = _arg1;
if (_running){
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
} else {
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
};
};
}
public function set rotationRate(_arg1:Number):void{
_rotationRate = _arg1;
}
public function get rotationRate():Number{
return (_rotationRate);
}
public function set camera(_arg1:Camera):void{
_camera = _arg1;
}
public function get stage():DisplayObject{
return (_stage);
}
public function update(_arg1:Number):void{
if (((!(_running)) || ((_arg1 > _maximumFrameTime)))){
return;
};
if (((upDown) || (wDown))){
camera.dolly((_trackRate * _arg1));
};
if (((downDown) || (sDown))){
camera.dolly((-(_trackRate) * _arg1));
};
if (((leftDown) || (aDown))){
camera.orbit((-(_rotationRate) * _arg1));
};
if (((rightDown) || (dDown))){
camera.orbit((_rotationRate * _arg1));
};
}
public function set stage(_arg1:DisplayObject):void{
if (_stage){
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDown);
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp);
};
_stage = _arg1;
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown, false, 0, true);
_stage.addEventListener(KeyboardEvent.KEY_UP, keyUp, false, 0, true);
}
public function set trackRate(_arg1:Number):void{
_trackRate = _arg1;
}
public function get trackRate():Number{
return (_trackRate);
}
public function get maximumFrameTime():Number{
return (_maximumFrameTime);
}
public function get camera():Camera{
return (_camera);
}
public function get useInternalTick():Boolean{
return (_useInternalTick);
}
private function keyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
upDown = false;
break;
case Keyboard.DOWN:
downDown = false;
break;
case Keyboard.LEFT:
leftDown = false;
break;
case Keyboard.RIGHT:
rightDown = false;
break;
case 87:
wDown = false;
break;
case 65:
aDown = false;
break;
case 83:
sDown = false;
break;
case 68:
dDown = false;
break;
};
}
private function updateEventListener(_arg1:UpdateEvent):void{
update(_arg1.time);
}
public function stop():void{
if (_useInternalTick){
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
_running = false;
}
private function keyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
upDown = true;
break;
case Keyboard.DOWN:
downDown = true;
break;
case Keyboard.LEFT:
leftDown = true;
break;
case Keyboard.RIGHT:
rightDown = true;
break;
case 87:
wDown = true;
break;
case 65:
aDown = true;
break;
case 83:
sDown = true;
break;
case 68:
dDown = true;
break;
};
}
public function start():void{
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
};
_running = true;
}
public function set maximumFrameTime(_arg1:Number):void{
_maximumFrameTime = _arg1;
}
}
}//package org.flintparticles.threeD.renderers.controllers
Section 290
//BitmapRenderer (org.flintparticles.threeD.renderers.BitmapRenderer)
package org.flintparticles.threeD.renderers {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.particles.*;
import org.flintparticles.common.renderers.*;
public class BitmapRenderer extends SpriteRendererBase {
protected var _paletteMap:Array;
protected var _camera:Camera;
protected var _bitmap:Bitmap;
protected var toDegrees:Number;// = 57.2957795130823
protected var _smoothing:Boolean;
protected var _preFilters:Array;
protected var _zSort:Boolean;
protected var _postFilters:Array;
protected var _canvas:Rectangle;
protected static var ZERO_POINT:Point = new Point(0, 0);
public function BitmapRenderer(_arg1:Rectangle, _arg2:Boolean=true, _arg3:Boolean=false){
_zSort = _arg2;
_camera = new Camera();
mouseEnabled = false;
mouseChildren = false;
_zSort = _arg2;
_smoothing = _arg3;
_preFilters = new Array();
_postFilters = new Array();
_canvas = _arg1;
createBitmap();
}
override protected function renderParticles(_arg1:Array):void{
var _local3:int;
var _local4:int;
var _local5:Particle3D;
if (!_bitmap){
return;
};
var _local2:Matrix3D = _camera.transform;
_bitmap.bitmapData.lock();
_local4 = _preFilters.length;
_local3 = 0;
while (_local3 < _local4) {
_bitmap.bitmapData.applyFilter(_bitmap.bitmapData, _bitmap.bitmapData.rect, BitmapRenderer.ZERO_POINT, _preFilters[_local3]);
_local3++;
};
if ((((_local4 == 0)) && ((_postFilters.length == 0)))){
_bitmap.bitmapData.fillRect(_bitmap.bitmapData.rect, 0);
};
_local4 = _arg1.length;
_local3 = 0;
while (_local3 < _local4) {
_local5 = _arg1[_local3];
_local5.projectedPosition = _local2.transformVector(_local5.position);
_local5.zDepth = _local5.projectedPosition.z;
_local3++;
};
if (_zSort){
_arg1.sort(sortOnZ);
};
_local3 = 0;
while (_local3 < _local4) {
drawParticle(_arg1[_local3]);
_local3++;
};
_local4 = _postFilters.length;
_local3 = 0;
while (_local3 < _local4) {
_bitmap.bitmapData.applyFilter(_bitmap.bitmapData, _bitmap.bitmapData.rect, BitmapRenderer.ZERO_POINT, _postFilters[_local3]);
_local3++;
};
if (_paletteMap){
_bitmap.bitmapData.paletteMap(_bitmap.bitmapData, _bitmap.bitmapData.rect, ZERO_POINT, _paletteMap[1], _paletteMap[2], _paletteMap[3], _paletteMap[0]);
};
_bitmap.bitmapData.unlock();
}
public function set camera(_arg1:Camera):void{
_camera = _arg1;
}
protected function createBitmap():void{
if (!_canvas){
return;
};
if (((_bitmap) && (_bitmap.bitmapData))){
_bitmap.bitmapData.dispose();
};
if (_bitmap){
removeChild(_bitmap);
};
_bitmap = new Bitmap(null, "auto", _smoothing);
_bitmap.bitmapData = new BitmapData(_canvas.width, _canvas.height, true, 0);
addChild(_bitmap);
_bitmap.x = _canvas.x;
_bitmap.y = _canvas.y;
}
public function addFilter(_arg1:BitmapFilter, _arg2:Boolean=false):void{
if (_arg2){
_postFilters.push(_arg1);
} else {
_preFilters.push(_arg1);
};
}
public function set canvas(_arg1:Rectangle):void{
_canvas = _arg1;
createBitmap();
}
public function clearPaletteMap():void{
_paletteMap = null;
}
public function removeFilter(_arg1:BitmapFilter):void{
var _local2:int;
while (_local2 < _preFilters.length) {
if (_preFilters[_local2] == _arg1){
_preFilters.splice(_local2, 1);
return;
};
_local2++;
};
_local2 = 0;
while (_local2 < _postFilters.length) {
if (_postFilters[_local2] == _arg1){
_postFilters.splice(_local2, 1);
return;
};
_local2++;
};
}
protected function sortOnZ(_arg1:Particle3D, _arg2:Particle3D):int{
return ((_arg2.zDepth - _arg1.zDepth));
}
public function get canvas():Rectangle{
return (_canvas);
}
public function get camera():Camera{
return (_camera);
}
public function set zSort(_arg1:Boolean):void{
_zSort = _arg1;
}
protected function drawParticle(_arg1:Particle3D):void{
var _local6:Vector3D;
var _local7:Matrix;
var _local8:Matrix3D;
var _local9:Number;
var _local10:Number;
var _local2:Vector3D = _arg1.projectedPosition;
if ((((_local2.z < _camera.nearPlaneDistance)) || ((_local2.z > _camera.farPlaneDistance)))){
return;
};
var _local3:Number = ((_arg1.scale * _camera.projectionDistance) / _local2.z);
_local2.project();
var _local4:Number = 0;
var _local5:Matrix3D = _camera.transform;
if (_arg1.rotation.equals(Quaternion.IDENTITY)){
_local6 = _arg1.faceAxis.clone();
} else {
_local8 = _arg1.rotation.toMatrixTransformation();
_local6 = _local8.transformVector(_arg1.faceAxis);
};
_local5.transformVectorSelf(_local6);
if (((!((_local6.x == 0))) || (!((_local6.y == 0))))){
_local4 = Math.atan2(-(_local6.y), _local6.x);
};
if (_local4){
_local9 = (_local3 * Math.cos(_local4));
_local10 = (_local3 * Math.sin(_local4));
_local7 = new Matrix(_local9, _local10, -(_local10), _local9, (_local2.x - _canvas.x), (-(_local2.y) - _canvas.y));
} else {
_local7 = new Matrix(_local3, 0, 0, _local3, (_local2.x - _canvas.x), (-(_local2.y) - _canvas.y));
};
_bitmap.bitmapData.draw(_arg1.image, _local7, _arg1.colorTransform, DisplayObject(_arg1.image).blendMode, null, _smoothing);
}
public function get zSort():Boolean{
return (_zSort);
}
public function setPaletteMap(_arg1:Array=null, _arg2:Array=null, _arg3:Array=null, _arg4:Array=null):void{
_paletteMap = new Array(4);
_paletteMap[0] = _arg4;
_paletteMap[1] = _arg1;
_paletteMap[2] = _arg2;
_paletteMap[3] = _arg3;
}
}
}//package org.flintparticles.threeD.renderers
Section 291
//Camera (org.flintparticles.threeD.renderers.Camera)
package org.flintparticles.threeD.renderers {
import org.flintparticles.threeD.geom.*;
public class Camera {
private var _projectionDistance:Number;// = 400
private var _position:Vector3D;
private var _pDirection:Vector3D;
private var _pTrack:Vector3D;
private var _nearDistance:Number;// = 10
private var _spaceTransform:Matrix3D;
private var _transform:Matrix3D;
private var _target:Vector3D;
private var _up:Vector3D;
private var _farDistance:Number;// = 2000
private var _pFront:Vector3D;
public function Camera(){
_position = Vector3D.ZERO.clone();
_position.w = 1;
_up = Vector3D.AXISY.clone();
_pDirection = Vector3D.AXISZ.clone();
}
private function get _direction():Vector3D{
if ((((_pDirection == null)) && (_target))){
_pDirection = _target.subtract(_position).normalize();
_pDirection.w = 0;
};
return (_pDirection);
}
public function get position():Vector3D{
return (_position.clone());
}
public function track(_arg1:Number):void{
_position.incrementBy(_track.multiply(_arg1));
_spaceTransform = null;
}
public function lift(_arg1:Number):void{
_position.incrementBy(_up.multiply(_arg1));
_spaceTransform = null;
}
public function roll(_arg1:Number):void{
var _local2:Matrix3D = Matrix3D.newRotate(_arg1, _front);
_local2.transformVectorSelf(_up);
_pTrack = null;
_spaceTransform = null;
}
public function get spaceTransform():Matrix3D{
var _local1:Vector3D;
if (!_spaceTransform){
_local1 = _direction.crossProduct(_track);
_spaceTransform = Matrix3D.newBasisTransform(_track.unit(), _local1.unit(), _direction.unit());
_spaceTransform.prependTranslation(-(_position.x), -(_position.y), -(_position.z));
};
return (_spaceTransform);
}
public function set projectionDistance(_arg1:Number):void{
_projectionDistance = _arg1;
_transform = null;
}
public function get target():Vector3D{
return (_target.clone());
}
public function set position(_arg1:Vector3D):void{
_position = _arg1.clone();
_position.w = 1;
_spaceTransform = null;
if (_target){
_pDirection = null;
_pTrack = null;
};
}
private function get _track():Vector3D{
if (_pTrack == null){
_pTrack = _up.crossProduct(_direction);
};
(_pFront == null);
return (_pTrack);
}
public function dolly(_arg1:Number):void{
_position.incrementBy(_direction.multiply(_arg1));
_spaceTransform = null;
}
public function get nearPlaneDistance():Number{
return (_nearDistance);
}
public function get direction():Vector3D{
return (_direction.clone());
}
public function orbit(_arg1:Number):void{
if (!_target){
throw (new Error("Attempting to orbit camera when no target is set"));
};
var _local2:Matrix3D = Matrix3D.newRotate(-(_arg1), up);
_local2.transformVectorSelf(_position);
_pDirection = null;
_pTrack = null;
_spaceTransform = null;
}
public function get up():Vector3D{
return (_up.clone());
}
public function pan(_arg1:Number):void{
var _local2:Matrix3D = Matrix3D.newRotate(_arg1, _up);
_local2.transformVectorSelf(_direction);
_pTrack = null;
_spaceTransform = null;
_target = null;
}
public function set target(_arg1:Vector3D):void{
_target = _arg1.clone();
_target.w = 1;
_pDirection = null;
_pTrack = null;
_spaceTransform = null;
}
public function get projectionDistance():Number{
return (_projectionDistance);
}
public function set farPlaneDistance(_arg1:Number):void{
_farDistance = _arg1;
}
public function set nearPlaneDistance(_arg1:Number):void{
_nearDistance = _arg1;
}
public function get transform():Matrix3D{
var _local1:Matrix3D;
if (((!(_spaceTransform)) || (!(_transform)))){
_transform = spaceTransform.clone();
_local1 = new Matrix3D([_projectionDistance, 0, 0, 0, 0, _projectionDistance, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0]);
_transform.append(_local1);
};
return (_transform);
}
private function get _front():Vector3D{
if (_pFront == null){
_pFront = _track.crossProduct(_up);
};
return (_pFront);
}
public function get farPlaneDistance():Number{
return (_farDistance);
}
public function set up(_arg1:Vector3D):void{
_up = _arg1.unit();
_up.w = 0;
_spaceTransform = null;
_pTrack = null;
}
public function tilt(_arg1:Number):void{
var _local2:Matrix3D = Matrix3D.newRotate(_arg1, _track);
_local2.transformVectorSelf(_direction);
_spaceTransform = null;
_target = null;
}
public function set direction(_arg1:Vector3D):void{
_pDirection = _arg1.unit();
_pDirection.w = 0;
_target = null;
_spaceTransform = null;
_pTrack = null;
}
}
}//package org.flintparticles.threeD.renderers
Section 292
//DiscZone (org.flintparticles.threeD.zones.DiscZone)
package org.flintparticles.threeD.zones {
import org.flintparticles.threeD.geom.*;
public class DiscZone implements Zone3D {
private var _normal:Vector3D;
private var _innerRadiusSq:Number;
private var _innerRadius:Number;
private var _dirty:Boolean;
private var _planeAxis2:Vector3D;
private var _planeAxis1:Vector3D;
private var _distToOrigin:Number;
private var _outerRadiusSq:Number;
private var _outerRadius:Number;
private var _center:Vector3D;
private static const TWOPI:Number = 6.28318530717959;
public function DiscZone(_arg1:Vector3D, _arg2:Vector3D, _arg3:Number, _arg4:Number=0){
_center = _arg1.clone();
_center.w = 1;
_normal = _arg2.unit();
_normal.w = 0;
_innerRadius = _arg4;
_innerRadiusSq = (_innerRadius * _innerRadius);
_outerRadius = _arg3;
_outerRadiusSq = (_outerRadius * _outerRadius);
_dirty = true;
}
public function get innerRadius():Number{
return (_innerRadius);
}
private function init():void{
_distToOrigin = _normal.dotProduct(center);
var _local1:Array = Vector3DUtils.getPerpendiculars(normal);
_planeAxis1 = _local1[0];
_planeAxis2 = _local1[1];
_dirty = false;
}
public function get center():Vector3D{
return (_center.clone());
}
public function set innerRadius(_arg1:Number):void{
_innerRadius = _arg1;
_innerRadiusSq = (_innerRadius * _innerRadius);
}
public function set normal(_arg1:Vector3D):void{
_normal = _arg1.unit();
_normal.w = 0;
_dirty = true;
}
public function contains(_arg1:Vector3D):Boolean{
if (_dirty){
init();
};
var _local2:Number = _normal.dotProduct(_arg1);
if (Math.abs((_local2 - _distToOrigin)) > 0.1){
return (false);
};
var _local3:Number = Vector3D.distanceSquared(center, _arg1);
if ((((_local3 <= _outerRadiusSq)) && ((_local3 >= _innerRadiusSq)))){
return (true);
};
return (false);
}
public function set outerRadius(_arg1:Number):void{
_outerRadius = _arg1;
_outerRadiusSq = (_outerRadius * _outerRadius);
}
public function get normal():Vector3D{
return (_normal.clone());
}
public function set center(_arg1:Vector3D):void{
_center = _arg1.clone();
_center.w = 1;
_dirty = true;
}
public function getLocation():Vector3D{
if (_dirty){
init();
};
var _local1:Number = Math.random();
var _local2:Number = (_innerRadius + ((1 - (_local1 * _local1)) * (_outerRadius - _innerRadius)));
var _local3:Number = (Math.random() * TWOPI);
return (_center.add(_planeAxis1.multiply((_local2 * Math.cos(_local3))).incrementBy(_planeAxis2.multiply((_local2 * Math.sin(_local3))))));
}
public function get outerRadius():Number{
return (_outerRadius);
}
public function getVolume():Number{
return ((((_outerRadius * _outerRadius) - (_innerRadius * _innerRadius)) * Math.PI));
}
}
}//package org.flintparticles.threeD.zones
Section 293
//Zone3D (org.flintparticles.threeD.zones.Zone3D)
package org.flintparticles.threeD.zones {
import org.flintparticles.threeD.geom.*;
public interface Zone3D {
function getVolume():Number;
function getLocation():Vector3D;
function contains(_arg1:Vector3D):Boolean;
}
}//package org.flintparticles.threeD.zones
Section 294
//Accelerate (org.flintparticles.twoD.actions.Accelerate)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.actions.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.twoD.particles.*;
public class Accelerate extends ActionBase {
private var _x:Number;
private var _y:Number;
public function Accelerate(_arg1:Number, _arg2:Number){
_x = _arg1;
_y = _arg2;
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function get y():Number{
return (_y);
}
public function get x():Number{
return (_x);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D = Particle2D(_arg2);
Particle2D(_arg2).velX = (_local4.velX + (_x * _arg3));
_local4.velY = (_local4.velY + (_y * _arg3));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
}
}//package org.flintparticles.twoD.actions
Section 295
//LinearDrag (org.flintparticles.twoD.actions.LinearDrag)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.actions.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.twoD.particles.*;
public class LinearDrag extends ActionBase {
private var _drag:Number;
public function LinearDrag(_arg1:Number){
_drag = _arg1;
}
public function get drag():Number{
return (_drag);
}
public function set drag(_arg1:Number):void{
_drag = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D;
_local4 = Particle2D(_arg2);
var _local5:Number = (1 - ((_drag * _arg3) / _local4.mass));
if (_local5 < 0){
_local4.velX = 0;
_local4.velY = 0;
} else {
_local4.velX = (_local4.velX * _local5);
_local4.velY = (_local4.velY * _local5);
};
}
}
}//package org.flintparticles.twoD.actions
Section 296
//Move (org.flintparticles.twoD.actions.Move)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.actions.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.twoD.particles.*;
public class Move extends ActionBase {
private var p:Particle2D;
override public function getDefaultPriority():Number{
return (-10);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
p = Particle2D(_arg2);
p.x = (p.x + (p.velX * _arg3));
p.y = (p.y + (p.velY * _arg3));
}
}
}//package org.flintparticles.twoD.actions
Section 297
//Emitter2D (org.flintparticles.twoD.emitters.Emitter2D)
package org.flintparticles.twoD.emitters {
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.utils.*;
public class Emitter2D extends Emitter {
protected var _y:Number;// = 0
public var spaceSort:Boolean;// = false
public var spaceSortedX:Array;
protected var _x:Number;// = 0
protected var _rotation:Number;// = 0
protected static var _creator:ParticleCreator2D = new ParticleCreator2D();
public function Emitter2D(){
_particleFactory = _creator;
}
public function get y():Number{
return (_y);
}
override protected function initParticle(_arg1:Particle):void{
var _local2:Particle2D;
_local2 = Particle2D(_arg1);
_local2.x = _x;
_local2.y = _y;
_local2.rotation = _rotation;
}
override protected function sortParticles():void{
var _local1:int;
var _local2:int;
if (spaceSort){
spaceSortedX = _particles.sortOn("x", (Array.NUMERIC | Array.RETURNINDEXEDARRAY));
_local1 = _particles.length;
_local2 = 0;
while (_local2 < _local1) {
_particles[spaceSortedX[_local2]].sortID = _local2;
_local2++;
};
};
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function set rotRadians(_arg1:Number):void{
_rotation = _arg1;
}
public function get x():Number{
return (_x);
}
public function get rotRadians():Number{
return (_rotation);
}
public function set rotation(_arg1:Number):void{
_rotation = Maths.asRadians(_arg1);
}
public function get rotation():Number{
return (Maths.asDegrees(_rotation));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public static function get defaultParticleFactory():ParticleFactory{
return (_creator);
}
}
}//package org.flintparticles.twoD.emitters
Section 298
//Velocity (org.flintparticles.twoD.initializers.Velocity)
package org.flintparticles.twoD.initializers {
import flash.geom.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.twoD.zones.*;
public class Velocity extends InitializerBase {
private var _zone:Zone2D;
public function Velocity(_arg1:Zone2D){
_zone = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle2D;
var _local5:Number;
var _local6:Number;
_local3 = Particle2D(_arg2);
var _local4:Point = _zone.getLocation();
if (_local3.rotation == 0){
_local3.velX = _local4.x;
_local3.velY = _local4.y;
} else {
_local5 = Math.sin(_local3.rotation);
_local6 = Math.cos(_local3.rotation);
_local3.velX = ((_local6 * _local4.x) - (_local5 * _local4.y));
_local3.velY = ((_local6 * _local4.y) + (_local5 * _local4.x));
};
}
public function set zone(_arg1:Zone2D):void{
_zone = _arg1;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 299
//Particle2D (org.flintparticles.twoD.particles.Particle2D)
package org.flintparticles.twoD.particles {
import flash.geom.*;
import org.flintparticles.common.particles.*;
public class Particle2D extends Particle {
public var sortID:int;// = -1
private var _inertia:Number;
public var velY:Number;// = 0
private var _previousRadius:Number;
private var _previousMass:Number;
public var angVelocity:Number;// = 0
public var x:Number;// = 0
public var y:Number;// = 0
public var velX:Number;// = 0
public var rotation:Number;// = 0
override public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle2D;
if (_arg1){
_local2 = (_arg1.createParticle() as Particle2D);
} else {
_local2 = new Particle2D();
};
cloneInto(_local2);
_local2.x = x;
_local2.y = y;
_local2.velX = velX;
_local2.velY = velY;
_local2.rotation = rotation;
_local2.angVelocity = angVelocity;
return (_local2);
}
override public function initialize():void{
super.initialize();
x = 0;
y = 0;
velX = 0;
velY = 0;
rotation = 0;
angVelocity = 0;
sortID = -1;
}
public function get matrixTransform():Matrix{
var _local1:Number = (scale * Math.cos(rotation));
var _local2:Number = (scale * Math.sin(rotation));
return (new Matrix(_local1, _local2, -(_local2), _local1, x, y));
}
public function get inertia():Number{
if (((!((mass == _previousMass))) || (!((collisionRadius == _previousRadius))))){
_inertia = (((mass * collisionRadius) * collisionRadius) * 0.5);
_previousMass = mass;
_previousRadius = collisionRadius;
};
return (_inertia);
}
}
}//package org.flintparticles.twoD.particles
Section 300
//ParticleCreator2D (org.flintparticles.twoD.particles.ParticleCreator2D)
package org.flintparticles.twoD.particles {
import org.flintparticles.common.particles.*;
public class ParticleCreator2D implements ParticleFactory {
private var _particles:Array;
public function ParticleCreator2D(){
_particles = new Array();
}
public function clearAllParticles():void{
_particles = new Array();
}
public function disposeParticle(_arg1:Particle):void{
if ((_arg1 is Particle2D)){
_arg1.initialize();
_particles.push(_arg1);
};
}
public function createParticle():Particle{
if (_particles.length){
return (_particles.pop());
};
return (new Particle2D());
}
}
}//package org.flintparticles.twoD.particles
Section 301
//BitmapRenderer (org.flintparticles.twoD.renderers.BitmapRenderer)
package org.flintparticles.twoD.renderers {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.renderers.*;
public class BitmapRenderer extends SpriteRendererBase {
protected var _preFilters:Array;
protected var _bitmap:Bitmap;
protected var _bitmapData:BitmapData;
protected var _colorMap:Array;
protected var _smoothing:Boolean;
protected var _canvas:Rectangle;
protected var _postFilters:Array;
protected static var ZERO_POINT:Point = new Point(0, 0);
public function BitmapRenderer(_arg1:Rectangle, _arg2:Boolean=false){
mouseEnabled = false;
mouseChildren = false;
_smoothing = _arg2;
_preFilters = new Array();
_postFilters = new Array();
_canvas = _arg1;
createBitmap();
}
public function addFilter(_arg1:BitmapFilter, _arg2:Boolean=false):void{
if (_arg2){
_postFilters.push(_arg1);
} else {
_preFilters.push(_arg1);
};
}
protected function createBitmap():void{
if (!_canvas){
return;
};
if (((_bitmap) && (_bitmapData))){
_bitmapData.dispose();
_bitmapData = null;
};
if (_bitmap){
removeChild(_bitmap);
};
_bitmap = new Bitmap(null, "auto", _smoothing);
_bitmapData = new BitmapData(_canvas.width, _canvas.height, true, 0);
_bitmap.bitmapData = _bitmapData;
addChild(_bitmap);
_bitmap.x = _canvas.x;
_bitmap.y = _canvas.y;
}
public function clearPaletteMap():void{
_colorMap = null;
}
public function get canvas():Rectangle{
return (_canvas);
}
public function removeFilter(_arg1:BitmapFilter):void{
var _local2:int;
while (_local2 < _preFilters.length) {
if (_preFilters[_local2] == _arg1){
_preFilters.splice(_local2, 1);
return;
};
_local2++;
};
_local2 = 0;
while (_local2 < _postFilters.length) {
if (_postFilters[_local2] == _arg1){
_postFilters.splice(_local2, 1);
return;
};
_local2++;
};
}
public function set canvas(_arg1:Rectangle):void{
_canvas = _arg1;
createBitmap();
}
protected function drawParticle(_arg1:Particle2D):void{
var _local2:Matrix;
_local2 = _arg1.matrixTransform;
_local2.translate(-(_canvas.x), -(_canvas.y));
_bitmapData.draw(_arg1.image, _local2, _arg1.colorTransform, DisplayObject(_arg1.image).blendMode, null, _smoothing);
}
public function setPaletteMap(_arg1:Array=null, _arg2:Array=null, _arg3:Array=null, _arg4:Array=null):void{
_colorMap = new Array(4);
_colorMap[0] = _arg4;
_colorMap[1] = _arg1;
_colorMap[2] = _arg2;
_colorMap[3] = _arg3;
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
override protected function renderParticles(_arg1:Array):void{
var _local2:int;
var _local3:int;
if (!_bitmap){
return;
};
_bitmapData.lock();
_local3 = _preFilters.length;
_local2 = 0;
while (_local2 < _local3) {
_bitmapData.applyFilter(_bitmapData, _bitmapData.rect, BitmapRenderer.ZERO_POINT, _preFilters[_local2]);
_local2++;
};
if ((((_local3 == 0)) && ((_postFilters.length == 0)))){
_bitmapData.fillRect(_bitmap.bitmapData.rect, 0);
};
_local3 = _arg1.length;
if (_local3){
_local2 = _local3;
while (_local2--) {
drawParticle(_arg1[_local2]);
};
};
_local3 = _postFilters.length;
_local2 = 0;
while (_local2 < _local3) {
_bitmapData.applyFilter(_bitmapData, _bitmapData.rect, BitmapRenderer.ZERO_POINT, _postFilters[_local2]);
_local2++;
};
if (_colorMap){
_bitmapData.paletteMap(_bitmapData, _bitmapData.rect, ZERO_POINT, _colorMap[1], _colorMap[2], _colorMap[3], _colorMap[0]);
};
_bitmapData.unlock();
}
}
}//package org.flintparticles.twoD.renderers
Section 302
//DiscZone (org.flintparticles.twoD.zones.DiscZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class DiscZone implements Zone2D {
private var _innerRadius:Number;
private var _outerRadius:Number;
private var _center:Point;
private var _innerSq:Number;
private var _outerSq:Number;
private static const TWOPI:Number = 6.28318530717959;
public function DiscZone(_arg1:Point, _arg2:Number, _arg3:Number=0){
if (_arg2 < _arg3){
throw (new Error((((("The outerRadius (" + _arg2) + ") can't be smaller than the innerRadius (") + _arg3) + ") in your DiscZone. N.B. the outerRadius is the second argument in the constructor and the innerRadius is the third argument.")));
};
_center = _arg1;
_innerRadius = _arg3;
_outerRadius = _arg2;
_innerSq = (_innerRadius * _innerRadius);
_outerSq = (_outerRadius * _outerRadius);
}
public function set outerRadius(_arg1:Number):void{
_outerRadius = _arg1;
_outerSq = (_outerRadius * _outerRadius);
}
public function get center():Point{
return (_center);
}
public function getArea():Number{
return ((Math.PI * (_outerSq - _innerSq)));
}
public function getLocation():Point{
var _local1:Number = Math.random();
var _local2:Point = Point.polar((_innerRadius + ((1 - (_local1 * _local1)) * (_outerRadius - _innerRadius))), (Math.random() * TWOPI));
_local2.x = (_local2.x + _center.x);
_local2.y = (_local2.y + _center.y);
return (_local2);
}
public function get outerRadius():Number{
return (_outerRadius);
}
public function get innerRadius():Number{
return (_innerRadius);
}
public function set innerRadius(_arg1:Number):void{
_innerRadius = _arg1;
_innerSq = (_innerRadius * _innerRadius);
}
public function set center(_arg1:Point):void{
_center = _arg1;
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
_arg1 = (_arg1 - _center.x);
_arg2 = (_arg2 - _center.y);
var _local3:Number = ((_arg1 * _arg1) + (_arg2 * _arg2));
return ((((_local3 <= _outerSq)) && ((_local3 >= _innerSq))));
}
}
}//package org.flintparticles.twoD.zones
Section 303
//Zone2D (org.flintparticles.twoD.zones.Zone2D)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public interface Zone2D {
function getArea():Number;
function getLocation():Point;
function contains(_arg1:Number, _arg2:Number):Boolean;
}
}//package org.flintparticles.twoD.zones
Section 304
//Firework (ru.zedarus.games.redstarfall.effects.Firework)
package ru.zedarus.games.redstarfall.effects {
import flash.geom.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.common.displayObjects.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.common.energyEasing.*;
public class Firework extends Emitter2D {
public function Firework(_arg1:uint, _arg2:uint, _arg3:int){
counter = new Blast(20);
addInitializer(new SharedImage(new Dot(2)));
addInitializer(new ColorInit(_arg2, _arg2));
addInitializer(new Velocity(new DiscZone(new Point(0, 0), _arg3, 120)));
addInitializer(new Lifetime(2));
addAction(new Age(Quadratic.easeIn));
addAction(new Move());
addAction(new Fade());
addAction(new Accelerate(0, 100));
addAction(new LinearDrag(0.5));
}
}
}//package ru.zedarus.games.redstarfall.effects
Section 305
//FireworkSprite (ru.zedarus.games.redstarfall.effects.FireworkSprite)
package ru.zedarus.games.redstarfall.effects {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.emitters.*;
public class FireworkSprite extends Sprite {
public function FireworkSprite(_arg1:Number, _arg2:Number){
var _local3:Emitter2D;
var _local4:Emitter2D;
var _local5:Emitter2D;
super();
this.mouseEnabled = false;
_local3 = new Firework(4294954508, 4294954508, 150);
_local4 = new Firework(4291559424, 4294901760, 200);
_local5 = new Firework(4294967295, 4294967295, 300);
var _local6:BitmapRenderer = new BitmapRenderer(new Rectangle(0, 0, 640, 480));
_local6.addFilter(new BlurFilter(1, 1, 1));
_local6.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.55, 0]));
_local6.addEmitter(_local3);
_local6.addEmitter(_local4);
_local6.addEmitter(_local5);
this.addChild(_local6);
_local3.x = _arg1;
_local3.y = _arg2;
_local3.start();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.start();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.start();
}
}
}//package ru.zedarus.games.redstarfall.effects
Section 306
//Fountain (ru.zedarus.games.redstarfall.effects.Fountain)
package ru.zedarus.games.redstarfall.effects {
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.zones.*;
import org.flintparticles.threeD.emitters.*;
import org.flintparticles.threeD.initializers.*;
import org.flintparticles.threeD.actions.*;
import org.flintparticles.common.displayObjects.*;
public class Fountain extends Emitter3D {
public function Fountain(){
counter = new Blast(50);
addInitializer(new ImageClass(Star, 8));
addInitializer(new ColorInit(4291559424, 4294967295));
addInitializer(new Velocity(new DiscZone(new Vector3D(0, 405, 0), new Vector3D(0, 1, 0), 80)));
addInitializer(new Lifetime(4));
addInitializer(new RotateVelocity(new Vector3D(0, 0, 1), -4, 4));
addAction(new Move());
addAction(new Rotate());
addAction(new Accelerate(new Vector3D(0, -250, 0)));
addAction(new Age());
}
}
}//package ru.zedarus.games.redstarfall.effects
Section 307
//RedstarfallEffectClick (ru.zedarus.games.redstarfall.effects.RedstarfallEffectClick)
package ru.zedarus.games.redstarfall.effects {
import flash.display.*;
public class RedstarfallEffectClick extends MovieClip {
public function RedstarfallEffectClick(){
this.rotation = (90 * Math.random());
}
}
}//package ru.zedarus.games.redstarfall.effects
Section 308
//Hint1 (ru.zedarus.games.redstarfall.hints.Hint1)
package ru.zedarus.games.redstarfall.hints {
import ru.zedarus.games.zedengine.game.worlds.world.*;
public class Hint1 extends WorldHint {
public function Hint1(_arg1:Number, _arg2:Number=1, _arg3:Number=0):void{
super(_arg1, _arg2, _arg3);
}
}
}//package ru.zedarus.games.redstarfall.hints
Section 309
//Hint2 (ru.zedarus.games.redstarfall.hints.Hint2)
package ru.zedarus.games.redstarfall.hints {
import ru.zedarus.games.zedengine.game.worlds.world.*;
public class Hint2 extends WorldHint {
public function Hint2(_arg1:Number, _arg2:Number=1, _arg3:Number=0):void{
super(_arg1, _arg2, _arg3);
}
}
}//package ru.zedarus.games.redstarfall.hints
Section 310
//Hint3 (ru.zedarus.games.redstarfall.hints.Hint3)
package ru.zedarus.games.redstarfall.hints {
import ru.zedarus.games.zedengine.game.worlds.world.*;
public class Hint3 extends WorldHint {
public function Hint3(_arg1:Number, _arg2:Number=1, _arg3:Number=0):void{
super(_arg1, _arg2, _arg3);
}
}
}//package ru.zedarus.games.redstarfall.hints
Section 311
//Hint4 (ru.zedarus.games.redstarfall.hints.Hint4)
package ru.zedarus.games.redstarfall.hints {
import ru.zedarus.games.zedengine.game.worlds.world.*;
public class Hint4 extends WorldHint {
public function Hint4(_arg1:Number, _arg2:Number=1, _arg3:Number=0):void{
super(_arg1, _arg2, _arg3);
}
}
}//package ru.zedarus.games.redstarfall.hints
Section 312
//Hint5 (ru.zedarus.games.redstarfall.hints.Hint5)
package ru.zedarus.games.redstarfall.hints {
import ru.zedarus.games.zedengine.game.worlds.world.*;
public class Hint5 extends WorldHint {
public function Hint5(_arg1:Number, _arg2:Number=1, _arg3:Number=0):void{
super(_arg1, _arg2, _arg3);
}
}
}//package ru.zedarus.games.redstarfall.hints
Section 313
//RedstarfallHUDCooldown (ru.zedarus.games.redstarfall.hud.RedstarfallHUDCooldown)
package ru.zedarus.games.redstarfall.hud {
import flash.display.*;
import flash.filters.*;
import ru.zedarus.games.zedengine.input.*;
import ru.zedarus.games.zedengine.game.hud.elements.*;
public class RedstarfallHUDCooldown extends HUDElement {
private var maskSprite:Sprite;
private var circleSprite:Sprite;
public function RedstarfallHUDCooldown(){
this.unhiddable = true;
this.drawBasicGrapchis();
}
protected function updatePosition():void{
this.x = (Input.mouseX + 20);
this.y = (Input.mouseY + 25);
}
override public function update(_arg1:Object):void{
var _local2:Number = Number(_arg1);
this.updatePosition();
this.redrawGraphics(_local2);
if ((((_local2 > 0)) && ((_local2 < 1)))){
if (((!(this.isInTransation())) && (!(this.isVisible())))){
this.show();
};
} else {
if (((!(this.isInTransation())) && (this.isVisible()))){
this.hide();
};
};
}
protected function drawBasicGrapchis():void{
var _local1:Sprite = new Sprite();
var _local2:Graphics = _local1.graphics;
_local2.clear();
_local2.lineStyle(0, 0, 0);
_local2.beginFill(0, 1);
_local2.drawCircle(0, 0, 10);
_local2.endFill();
this.addChild(_local1);
this.circleSprite = new Sprite();
_local2 = this.circleSprite.graphics;
_local2.clear();
_local2.lineStyle(0, 0, 0);
_local2.beginFill(0xCC0000, 1);
_local2.drawCircle(0, 0, 10);
_local2.endFill();
this.maskSprite = new Sprite();
this.circleSprite.mask = this.maskSprite;
this.filters = [new DropShadowFilter(2, 45, 0, 0.6, 5, 5)];
this.addChild(this.maskSprite);
this.addChild(this.circleSprite);
}
protected function redrawGraphics(_arg1:Number):void{
var _local2 = 20;
var _local3 = 5;
var _local4:Graphics = this.maskSprite.graphics;
_local4.clear();
var _local5:Number = (-(Math.PI) / 2);
var _local6:Number = Math.floor((_arg1 / 0.25));
var _local7:Number = 0;
var _local8:Number = 0;
var _local9:Number = 100;
var _local10:int;
while (_local10 < _local6) {
_local7 = ((Math.PI / 2) * _local10);
_local8 = ((Math.PI / 2) * (_local10 + 1));
_local4.beginFill(0xFF0000, 1);
_local4.moveTo(0, 0);
_local4.lineTo((Math.cos((_local7 + _local5)) * _local9), (Math.sin((_local7 + _local5)) * _local9));
_local4.lineTo((Math.cos((_local8 + _local5)) * _local9), (Math.sin((_local8 + _local5)) * _local9));
_local4.lineTo(0, 0);
_local4.endFill();
_local10++;
};
if ((_arg1 - (_local6 * 0.25)) > 0){
_local7 = ((Math.PI / 2) * _local6);
_local8 = (((Math.PI / 2) * _local6) + ((Math.PI / 2) * ((_arg1 - (_local6 * 0.25)) / 0.25)));
_local4.beginFill(0xFF0000, 1);
_local4.moveTo(0, 0);
_local4.lineTo((Math.cos((_local7 + _local5)) * _local9), (Math.sin((_local7 + _local5)) * _local9));
_local4.lineTo((Math.cos((_local8 + _local5)) * _local9), (Math.sin((_local8 + _local5)) * _local9));
_local4.lineTo(0, 0);
_local4.endFill();
};
}
}
}//package ru.zedarus.games.redstarfall.hud
Section 314
//RedstarfallHUDTooHardBanner (ru.zedarus.games.redstarfall.hud.RedstarfallHUDTooHardBanner)
package ru.zedarus.games.redstarfall.hud {
import flash.events.*;
import fl.transitions.*;
import ru.zedarus.games.zedengine.game.hud.elements.*;
import fl.transitions.easing.*;
import flash.net.*;
public class RedstarfallHUDTooHardBanner extends HUDButton {
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
navigateToURL(new URLRequest(Settings.ORIGINAL_GAME_LINK), "_blank");
}
override public function rollover(_arg1:MouseEvent):void{
super.rollover(_arg1);
var _local2:Tween = new Tween(this, "rotation", Elastic.easeOut, -15, 0, 2, true);
}
}
}//package ru.zedarus.games.redstarfall.hud
Section 315
//Level1 (ru.zedarus.games.redstarfall.levels.Level1)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level1 extends LevelBase {
public function Level1(_arg1:Number):void{
super(_arg1);
}
override protected function actionsPlay():void{
super.actionsPlay();
}
override protected function actionsStart():void{
super.actionsStart();
var _local1:WorldHint = new Hint1(1, 3, 1);
_local1.x = 207;
_local1.y = 178.2;
this.worldHints.showHint(_local1);
_local1 = new Hint2(2, 3, 5);
_local1.x = 208.6;
_local1.y = 227.2;
this.worldHints.showHint(_local1);
_local1 = new Hint3(3, 3, 9);
_local1.x = 378.8;
_local1.y = 270.2;
this.worldHints.showHint(_local1);
_local1 = new Hint4(3, 3, 13);
_local1.x = 489.8;
_local1.y = 254.2;
this.worldHints.showHint(_local1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 316
//Level10 (ru.zedarus.games.redstarfall.levels.Level10)
package ru.zedarus.games.redstarfall.levels {
import flash.display.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.sound.*;
import org.flintparticles.threeD.renderers.controllers.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
public class Level10 extends LevelBase {
public function Level10(_arg1:Number):void{
super(_arg1);
}
override protected function updateWorld():void{
var _local1:RedstarfallExplosive;
var _local2:RedstarfallFigurePlatform;
var _local4:b2Body;
var _local5:b2ContactEdge;
var _local6:RedstarfallFigure;
this.box2d_world.Step(this.box2d_timeStep, this.box2d_iterations);
var _local3:b2Body = this.box2d_world.m_bodyList;
while (_local3) {
if ((((_local3.m_userData is Sprite)) && (!(_local3.IsStatic())))){
_local3.m_userData.x = (_local3.GetPosition().x * this.box2d_physScale);
_local3.m_userData.y = (_local3.GetPosition().y * this.box2d_physScale);
_local3.m_userData.rotation = (_local3.GetAngle() * (180 / Math.PI));
};
if ((_local3.m_userData is RedstarfallFigureRedStar)){
_local5 = _local3.m_contactList;
while (_local5) {
if (_local3.IsSleeping()){
if ((_local5.other.m_userData is RedstarfallFigurePlatform)){
_local2 = (_local5.other.m_userData as RedstarfallFigurePlatform);
if (_local2.works){
SoundManager.playSoundById("win");
this.makeAllFigureUnclickable();
this.changeStateTo(WorldState.WIN);
break;
};
};
};
_local5 = _local5.next;
};
};
if ((_local3.m_userData is RedstarfallExplosive)){
_local1 = (_local3.m_userData as RedstarfallExplosive);
if (_local1.detonate){
this.explodeSingle(_local1);
};
};
if (((((_local3.GetPosition().y * this.box2d_physScale) > (480 + 100))) && ((_local3.m_userData is Sprite)))){
if ((_local3.m_userData is RedstarfallFigureRedStar)){
_local3.SetXForm(new b2Vec2((319 / this.box2d_physScale), (-130 / this.box2d_physScale)), 0);
_local3.SetLinearVelocity(new b2Vec2(0, 0));
_local3.SetAngularVelocity(0);
} else {
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
};
};
_local3 = _local3.m_next;
};
for each (_local4 in this.bodiesToDestroy) {
if (this.contains((_local4.m_userData as Sprite))){
this.removeChild((_local4.m_userData as Sprite));
};
_local6 = (_local4.m_userData as RedstarfallFigure);
if ((_local6 is RedstarfallExplosive)){
} else {
this.figures_flying_space.addChild((_local6 as Sprite));
this.figures_flying_away.push((_local6 as Sprite));
};
this.box2d_world.DestroyBody(_local4);
};
this.bodiesToDestroy = new Array();
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 317
//Level11 (ru.zedarus.games.redstarfall.levels.Level11)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.redstarfall.objects.figures.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import ru.zedarus.games.redstarfall.*;
public class Level11 extends LevelBase {
public function Level11(_arg1:Number):void{
super(_arg1);
}
override protected function createFigureCirlceFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = new b2BodyDef();
_local4 = GameplaySettings.FIGURE_ORDINARY_FRICTION;
_local5 = GameplaySettings.FIGURE_ORDINARY_DENSITY;
if ((_arg1 is RedstarfallFigureCircle3)){
_local5 = (_local5 * 3);
};
_local6 = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local7:b2CircleDef = new b2CircleDef();
_local7.radius = ((_arg1.clickzone.width / this.box2d_physScale) / 2);
_local7.density = _local5;
_local7.friction = _local4;
_local7.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local7);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 318
//Level12 (ru.zedarus.games.redstarfall.levels.Level12)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.redstarfall.*;
import org.flintparticles.threeD.renderers.controllers.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level12 extends LevelBase {
private var lastCircleCreationTime:Number;// = 0
private var ballsCounter:Number;// = 0
public function Level12(_arg1:Number):void{
super(_arg1);
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
override protected function actionsStart():void{
super.actionsStart();
}
override public function getScores():Number{
var _local1:Number = (((600 * 0.8) + (10 * 5)) - Math.ceil((this.scores + (this.playing_time * 0.01))));
if (_local1 < 0){
_local1 = 0;
};
return (_local1);
}
override protected function createFigureCirlceFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = new b2BodyDef();
_local4 = GameplaySettings.FIGURE_ORDINARY_FRICTION;
_local5 = GameplaySettings.FIGURE_ORDINARY_DENSITY;
_local6 = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local7:b2CircleDef = new b2CircleDef();
_local7.radius = ((_arg1.clickzone.width / this.box2d_physScale) / 2);
_local7.density = _local5;
_local7.friction = _local4;
_local7.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local7);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
override protected function createFigureBoxFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef;
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:Array;
_local3 = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
_local5 = GameplaySettings.FIGURE_ORDINARY_DENSITY;
_local6 = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
_local7 = _arg1.getPointsX();
_local8 = _arg1.getPointsY();
_local7 = _local7.map(this.convertToPhysWorldCoord);
_local8 = _local8.map(this.convertToPhysWorldCoord);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 4;
_local9.vertices[0].Set(_local7[1], _local8[1]);
_local9.vertices[1].Set(_local7[2], _local8[2]);
_local9.vertices[2].Set(_local7[3], _local8[3]);
_local9.vertices[3].Set(_local7[4], _local8[4]);
_local9.density = _local5;
_local9.friction = _local4;
_local9.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 319
//Level13 (ru.zedarus.games.redstarfall.levels.Level13)
package ru.zedarus.games.redstarfall.levels {
public class Level13 extends LevelBase {
public function Level13(_arg1:Number):void{
super(_arg1);
}
override public function getScores():Number{
var _local1:Number = (((600 * 1) + (10 * 5)) - Math.ceil((this.scores + (this.playing_time * 0.01))));
if (_local1 < 0){
_local1 = 0;
};
return (_local1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 320
//Level14 (ru.zedarus.games.redstarfall.levels.Level14)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import ru.zedarus.games.zedengine.sound.*;
import ru.zedarus.games.redstarfall.*;
import ru.zedarus.games.redstarfall.effects.*;
public class Level14 extends LevelBase {
private var lastBlockCreationTime:Number;// = 0
private var lastCircleCreationTime:Number;// = 0
private var _blocksCounter:Number;// = 1
private var _circlesCounter:Number;// = 1
public function Level14(_arg1:Number):void{
super(_arg1);
}
override protected function actionsStart():void{
super.actionsStart();
}
private function spawnBoxRow():void{
var _local1:RedstarfallFigureBalk;
var _local2:RedstarfallExplosiveBalk;
if ((this.playing_time - lastBlockCreationTime) > (2 * 1000)){
if ((_blocksCounter % 2)){
_local1 = new RedstarfallFigureBalk();
_local1.x = 90;
_local1.y = -50;
this.addChild(_local1);
this.createFigureBoxFrom(_local1);
} else {
_local2 = new RedstarfallExplosiveBalk();
_local2.x = 90;
_local2.y = -50;
this.addChild(_local2);
this.createFigureBoxFrom(_local2);
};
lastBlockCreationTime = this.playing_time;
_blocksCounter++;
};
}
private function spawnCircleRow():void{
var _local1:RedstarfallFigureCircle;
var _local2:RedstarfallExplosiveCircle;
if ((this.playing_time - lastCircleCreationTime) > (2 * 1000)){
if ((_circlesCounter % 2)){
_local1 = new RedstarfallFigureCircle();
_local1.x = 537;
_local1.y = -50;
this.addChild(_local1);
this.createFigureCirlceFrom(_local1);
} else {
_local2 = new RedstarfallExplosiveCircle();
_local2.x = 537;
_local2.y = -50;
this.addChild(_local2);
this.createFigureCirlceFrom(_local2);
};
lastCircleCreationTime = this.playing_time;
_circlesCounter++;
};
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.spawnBoxRow();
this.spawnCircleRow();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
override protected function createExplosionForBody(_arg1:b2Body):void{
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Vec2;
var _local11:Number;
var _local2:b2Vec2 = new b2Vec2(_arg1.GetPosition().x, _arg1.GetPosition().y);
var _local3:FireworkSprite = new FireworkSprite((_local2.x * this.box2d_physScale), (_local2.y * this.box2d_physScale));
SoundManager.playSoundById("figures_explosion");
var _local4:Array = this.GetBodiesAtZone(_local2.x, _local2.y);
_local10 = new b2Vec2();
_local11 = ((GameplaySettings.EXPLOSION_POWER + 2) * _arg1.GetMass());
for each (_local5 in _local4) {
_local6 = (-(_local2.x) + _local5.GetPosition().x);
_local7 = (-(_local2.y) + _local5.GetPosition().y);
_local8 = Math.atan2(_local7, _local6);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local10.x = ((_local11 * _local5.GetMass()) * Math.cos(_local8));
_local10.y = ((_local11 * _local5.GetMass()) * Math.sin(_local8));
_local5.ApplyImpulse(_local10, _local5.GetWorldCenter());
};
this.addChild(_local3);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 321
//Level15 (ru.zedarus.games.redstarfall.levels.Level15)
package ru.zedarus.games.redstarfall.levels {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import ru.zedarus.games.zedengine.sound.*;
import ru.zedarus.games.redstarfall.*;
import ru.zedarus.games.redstarfall.effects.*;
public class Level15 extends LevelBase {
public function Level15(_arg1:Number):void{
super(_arg1);
}
override protected function createExplosionForBody(_arg1:b2Body):void{
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Vec2;
var _local11:Number;
var _local2:b2Vec2 = new b2Vec2(_arg1.GetPosition().x, _arg1.GetPosition().y);
var _local3:FireworkSprite = new FireworkSprite((_local2.x * this.box2d_physScale), (_local2.y * this.box2d_physScale));
SoundManager.playSoundById("figures_explosion");
var _local4:Array = this.GetBodiesAtZone(_local2.x, _local2.y);
_local10 = new b2Vec2();
_local11 = ((GameplaySettings.EXPLOSION_POWER + 1.3) * _arg1.GetMass());
for each (_local5 in _local4) {
_local6 = (-(_local2.x) + _local5.GetPosition().x);
_local7 = (-(_local2.y) + _local5.GetPosition().y);
_local8 = Math.atan2(_local7, _local6);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local10.x = ((_local11 * _local5.GetMass()) * Math.cos(_local8));
_local10.y = ((_local11 * _local5.GetMass()) * Math.sin(_local8));
_local5.ApplyImpulse(_local10, _local5.GetWorldCenter());
};
this.addChild(_local3);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 322
//Level16 (ru.zedarus.games.redstarfall.levels.Level16)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.sound.*;
import ru.zedarus.games.redstarfall.*;
import org.flintparticles.threeD.renderers.controllers.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
import ru.zedarus.games.redstarfall.effects.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level16 extends LevelBase {
private var lastBlockCreationTime:Number;// = 0
private var lastCircleCreationTime:Number;// = 0
private var _blocksCounter:Number;// = 1
private var _circlesCounter:Number;// = 1
private var jumpLevels:Array;
public function Level16(_arg1:Number):void{
jumpLevels = [];
super(_arg1);
jumpLevels.push(10.5);
jumpLevels.push(11.6);
jumpLevels.push(13.3);
jumpLevels.push(14.6);
}
private function spawnCircleRow():void{
var _local1:RedstarfallExplosiveBalk;
var _local2:RedstarfallExplosiveBalk;
var _local3:Number = 0;
if ((this.playing_time - lastCircleCreationTime) > (1.3 * 1000)){
_local2 = new RedstarfallExplosiveBalk();
switch ((_circlesCounter % 4)){
case 0:
_local2.x = 8;
break;
case 1:
_local2.x = 208;
break;
case 2:
_local2.x = 428;
break;
case 3:
_local2.x = 638;
break;
};
_local2.y = (480 + 20);
this.addChild(_local2);
this.createFigureBoxFrom(_local2);
lastCircleCreationTime = this.playing_time;
_circlesCounter++;
};
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.spawnCircleRow();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
override public function GetBodiesAtZone(_arg1:Number, _arg2:Number):Array{
var _local3:b2AABB = new b2AABB();
var _local4:Number = 4;
_local3.lowerBound.Set((_arg1 - _local4), (_arg2 - _local4));
_local3.upperBound.Set((_arg1 + _local4), (_arg2 + _local4));
var _local5:Number = 60;
var _local6:Array = new Array();
var _local7:Array = new Array();
var _local8:Number = box2d_world.Query(_local3, _local6, _local5);
var _local9:Number = 0;
while (_local9 < _local8) {
if ((((_local6[_local9].GetBody().IsStatic() == false)) && ((_local7.indexOf(_local6[_local9].GetBody()) == -1)))){
_local7.push(_local6[_local9].GetBody());
};
_local9++;
};
return (_local7);
}
override protected function createExplosionForBody(_arg1:b2Body):void{
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Vec2;
var _local2:b2Vec2 = new b2Vec2(_arg1.GetPosition().x, _arg1.GetPosition().y);
var _local3:FireworkSprite = new FireworkSprite((_local2.x * this.box2d_physScale), (_local2.y * this.box2d_physScale));
SoundManager.playSoundById("figures_explosion");
var _local4:Array = this.GetBodiesAtZone(_local2.x, _local2.y);
_local10 = new b2Vec2();
var _local11:Number = ((GameplaySettings.EXPLOSION_POWER + 0.26) * _arg1.GetMass());
for each (_local5 in _local4) {
if (_local5 != _arg1){
_local6 = (-(_local2.x) + _local5.GetPosition().x);
_local7 = (-(_local2.y) + _local5.GetPosition().y);
_local8 = Math.atan2(_local7, _local6);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local10.x = ((_local11 * _local5.GetMass()) * Math.cos(_local8));
_local10.y = ((_local11 * _local5.GetMass()) * Math.sin(_local8));
_local5.ApplyImpulse(_local10, _local5.GetWorldCenter());
};
};
this.addChild(_local3);
}
override protected function createFigureBoxFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local5:Number;
var _local6:Number;
var _local10:int;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
_local5 = GameplaySettings.FIGURE_ORDINARY_DENSITY;
_local6 = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
var _local7:Array = _arg1.getPointsX();
var _local8:Array = _arg1.getPointsY();
_local7 = _local7.map(this.convertToPhysWorldCoord);
_local8 = _local8.map(this.convertToPhysWorldCoord);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 4;
_local9.vertices[0].Set(_local7[1], _local8[1]);
_local9.vertices[1].Set(_local7[2], _local8[2]);
_local9.vertices[2].Set(_local7[3], _local8[3]);
_local9.vertices[3].Set(_local7[4], _local8[4]);
_local9.density = _local5;
_local9.friction = _local4;
_local9.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
if ((_arg1 is RedstarfallExplosiveBalk)){
_local10 = (Math.random() * jumpLevels.length);
_local2.SetLinearVelocity(new b2Vec2(0, -(jumpLevels[_local10])));
_local2.SetAngularVelocity((1 + (3 * Math.random())));
};
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
override public function getScores():Number{
var _local1:Number = (((600 * 1.2) + (10 * 4)) - Math.ceil((this.scores + (this.playing_time * 0.01))));
if (_local1 < 0){
_local1 = 0;
};
return (_local1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 323
//Level17 (ru.zedarus.games.redstarfall.levels.Level17)
package ru.zedarus.games.redstarfall.levels {
public class Level17 extends LevelBase {
public function Level17(_arg1:Number):void{
super(_arg1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 324
//Level18 (ru.zedarus.games.redstarfall.levels.Level18)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.redstarfall.objects.figures.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import ru.zedarus.games.redstarfall.*;
public class Level18 extends LevelBase {
private var lastCircleCreationTime2:Number;// = -9999
private var lastBoxCreationTime:Number;// = -9999
private var lastCircleCreationTime:Number;// = -9999
private var _circlesCounter:Number;// = 1
private var _blocksCounter:Number;// = 1
public function Level18(_arg1:Number):void{
super(_arg1);
}
override protected function createFigureCirlceFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef;
var _local5:Number;
var _local6:Number;
_local3 = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
_local5 = GameplaySettings.FIGURE_ORDINARY_DENSITY;
_local6 = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
if ((_arg1 is RedstarfallFigureCircle)){
_local5 = (_local5 * 2);
_local6 = 1;
};
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local7:b2CircleDef = new b2CircleDef();
_local7.radius = ((_arg1.clickzone.width / this.box2d_physScale) / 2);
_local7.density = _local5;
_local7.friction = _local4;
_local7.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local7);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.spawnBall();
this.spawnBalk();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
override public function getScores():Number{
var _local1:Number = (((600 * 0.9) + (10 * 8.5)) - Math.ceil((this.scores + (this.playing_time * 0.01))));
if (_local1 < 0){
_local1 = 0;
};
return (_local1);
}
private function spawnBalk():void{
var _local1:RedstarfallFigureBalk;
var _local2:Number = 0;
if ((this.playing_time - lastBoxCreationTime) > (4 * 1000)){
_local1 = new RedstarfallFigureBalk();
_local1.x = 433;
_local1.y = -24;
this.addChild(_local1);
this.createFigureBoxFrom(_local1);
lastBoxCreationTime = this.playing_time;
_blocksCounter++;
};
}
private function spawnBall():void{
var _local1:RedstarfallFigureCircle;
var _local2:Number = 0;
if ((this.playing_time - lastCircleCreationTime) > (4 * 1000)){
_local1 = new RedstarfallFigureCircle();
_local1.x = 110;
_local1.y = -24;
this.addChild(_local1);
this.createFigureCirlceFrom(_local1);
lastCircleCreationTime = this.playing_time;
_circlesCounter++;
};
}
private function spawnBall2():void{
var _local1:RedstarfallFigureCircle;
var _local2:Number = 0;
if ((this.playing_time - lastCircleCreationTime2) > (5 * 1000)){
_local1 = new RedstarfallFigureCircle();
_local1.x = 433;
_local1.y = -24;
this.addChild(_local1);
this.createFigureCirlceFrom(_local1);
lastCircleCreationTime2 = this.playing_time;
_circlesCounter++;
};
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 325
//Level19 (ru.zedarus.games.redstarfall.levels.Level19)
package ru.zedarus.games.redstarfall.levels {
import flash.display.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.sound.*;
import org.flintparticles.threeD.renderers.controllers.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level19 extends LevelBase {
private var lastStarCreationTime:Number;// = -9999
public function Level19(_arg1:Number):void{
super(_arg1);
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.spawnRedStar();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
override protected function updateWorld():void{
var _local1:RedstarfallExplosive;
var _local2:RedstarfallFigurePlatform;
var _local4:b2Body;
var _local5:b2ContactEdge;
var _local6:RedstarfallFigure;
this.box2d_world.Step(this.box2d_timeStep, this.box2d_iterations);
var _local3:b2Body = this.box2d_world.m_bodyList;
while (_local3) {
if ((((_local3.m_userData is Sprite)) && (!(_local3.IsStatic())))){
_local3.m_userData.x = (_local3.GetPosition().x * this.box2d_physScale);
_local3.m_userData.y = (_local3.GetPosition().y * this.box2d_physScale);
_local3.m_userData.rotation = (_local3.GetAngle() * (180 / Math.PI));
};
if ((_local3.m_userData is RedstarfallFigureRedStar)){
_local5 = _local3.m_contactList;
while (_local5) {
if (_local3.IsSleeping()){
if ((_local5.other.m_userData is RedstarfallFigurePlatform)){
_local2 = (_local5.other.m_userData as RedstarfallFigurePlatform);
if (_local2.works){
SoundManager.playSoundById("win");
this.makeAllFigureUnclickable();
this.changeStateTo(WorldState.WIN);
break;
};
};
};
_local5 = _local5.next;
};
};
if ((_local3.m_userData is RedstarfallExplosive)){
_local1 = (_local3.m_userData as RedstarfallExplosive);
if (_local1.detonate){
this.explodeSingle(_local1);
};
};
if (((((_local3.GetPosition().y * this.box2d_physScale) > (480 + 100))) && ((_local3.m_userData is Sprite)))){
if ((_local3.m_userData is RedstarfallFigureRedStar)){
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
} else {
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
};
};
_local3 = _local3.m_next;
};
for each (_local4 in this.bodiesToDestroy) {
if (this.contains((_local4.m_userData as Sprite))){
this.removeChild((_local4.m_userData as Sprite));
};
_local6 = (_local4.m_userData as RedstarfallFigure);
if ((_local6 is RedstarfallExplosive)){
} else {
this.figures_flying_space.addChild((_local6 as Sprite));
this.figures_flying_away.push((_local6 as Sprite));
};
this.box2d_world.DestroyBody(_local4);
};
this.bodiesToDestroy = new Array();
}
private function spawnRedStar():void{
var _local1:RedstarfallFigureRedStar;
var _local3:b2Body;
var _local2:Number = 0;
if ((this.playing_time - lastStarCreationTime) > (4 * 1000)){
_local1 = new RedstarfallFigureRedStar();
_local1.x = 0;
_local1.y = 480;
this.addChild(_local1);
_local3 = this.createFigureStarFrom(_local1, true);
_local3.SetLinearVelocity(new b2Vec2(5.3, -14));
_local3.SetAngularVelocity(4);
lastStarCreationTime = this.playing_time;
};
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 326
//Level2 (ru.zedarus.games.redstarfall.levels.Level2)
package ru.zedarus.games.redstarfall.levels {
public class Level2 extends LevelBase {
public function Level2(_arg1:Number):void{
super(_arg1);
}
override protected function actionsPlay():void{
super.actionsPlay();
}
override protected function actionsStart():void{
super.actionsStart();
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 327
//Level20 (ru.zedarus.games.redstarfall.levels.Level20)
package ru.zedarus.games.redstarfall.levels {
import flash.display.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.sound.*;
import org.flintparticles.threeD.renderers.controllers.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level20 extends LevelBase {
private var _starsCounter:int;// = 0
private var lastStarCreationTime:Number;// = -9999
public function Level20(_arg1:Number):void{
super(_arg1);
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.spawnRedStar();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
override protected function updateWorld():void{
var _local1:RedstarfallExplosive;
var _local2:RedstarfallFigurePlatform;
var _local4:b2Body;
var _local5:b2ContactEdge;
var _local6:RedstarfallFigure;
this.box2d_world.Step(this.box2d_timeStep, this.box2d_iterations);
var _local3:b2Body = this.box2d_world.m_bodyList;
while (_local3) {
if ((((_local3.m_userData is Sprite)) && (!(_local3.IsStatic())))){
_local3.m_userData.x = (_local3.GetPosition().x * this.box2d_physScale);
_local3.m_userData.y = (_local3.GetPosition().y * this.box2d_physScale);
_local3.m_userData.rotation = (_local3.GetAngle() * (180 / Math.PI));
};
if ((_local3.m_userData is RedstarfallFigureRedStar)){
_local5 = _local3.m_contactList;
while (_local5) {
if (_local3.IsSleeping()){
if ((_local5.other.m_userData is RedstarfallFigurePlatform)){
_local2 = (_local5.other.m_userData as RedstarfallFigurePlatform);
if (_local2.works){
SoundManager.playSoundById("win");
this.makeAllFigureUnclickable();
this.changeStateTo(WorldState.WIN);
break;
};
};
};
_local5 = _local5.next;
};
};
if ((_local3.m_userData is RedstarfallExplosive)){
_local1 = (_local3.m_userData as RedstarfallExplosive);
if (_local1.detonate){
this.explodeSingle(_local1);
};
};
if (((((_local3.GetPosition().y * this.box2d_physScale) > (480 + 100))) && ((_local3.m_userData is Sprite)))){
if ((_local3.m_userData is RedstarfallFigureRedStar)){
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
} else {
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
};
};
_local3 = _local3.m_next;
};
for each (_local4 in this.bodiesToDestroy) {
if (this.contains((_local4.m_userData as Sprite))){
this.removeChild((_local4.m_userData as Sprite));
};
_local6 = (_local4.m_userData as RedstarfallFigure);
if ((_local6 is RedstarfallExplosive)){
} else {
this.figures_flying_space.addChild((_local6 as Sprite));
this.figures_flying_away.push((_local6 as Sprite));
};
this.box2d_world.DestroyBody(_local4);
};
this.bodiesToDestroy = new Array();
}
private function spawnRedStar():void{
var _local1:RedstarfallFigureStar;
var _local2:b2Body;
var _local3:Number = 0;
if ((this.playing_time - lastStarCreationTime) > (0.75 * 1000)){
if ((_starsCounter % 4)){
_local1 = new RedstarfallFigureStar();
} else {
_local1 = new RedstarfallFigureRedStar();
};
_local1.x = -60;
_local1.y = 240;
this.addChild(_local1);
if ((_starsCounter % 4)){
_local2 = this.createFigureStarFrom(_local1, false);
} else {
_local2 = this.createFigureStarFrom(_local1, true);
};
_local2.SetLinearVelocity(new b2Vec2(11.7, -8));
_local2.SetAngularVelocity(4);
lastStarCreationTime = this.playing_time;
_starsCounter++;
};
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 328
//Level21 (ru.zedarus.games.redstarfall.levels.Level21)
package ru.zedarus.games.redstarfall.levels {
import flash.display.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.sound.*;
import ru.zedarus.games.redstarfall.*;
import org.flintparticles.threeD.renderers.controllers.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
import ru.zedarus.games.redstarfall.effects.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level21 extends LevelBase {
private var starSpawnDelay:Number;// = 5
private var _starsCounter2:int;// = 1
private var _starsCounter:int;// = 0
private var lastStarCreationTime:Number;
private var lastStarCreationTime2:Number;
public function Level21(_arg1:Number):void{
lastStarCreationTime = (-(starSpawnDelay) * 1000);
lastStarCreationTime2 = (-((starSpawnDelay * 1000)) / 2);
super(_arg1);
}
override protected function updateWorld():void{
var _local1:RedstarfallExplosive;
var _local2:RedstarfallFigurePlatform;
var _local4:b2Body;
var _local5:b2ContactEdge;
var _local6:RedstarfallFigure;
this.box2d_world.Step(this.box2d_timeStep, this.box2d_iterations);
var _local3:b2Body = this.box2d_world.m_bodyList;
while (_local3) {
if ((((_local3.m_userData is Sprite)) && (!(_local3.IsStatic())))){
_local3.m_userData.x = (_local3.GetPosition().x * this.box2d_physScale);
_local3.m_userData.y = (_local3.GetPosition().y * this.box2d_physScale);
_local3.m_userData.rotation = (_local3.GetAngle() * (180 / Math.PI));
};
if ((_local3.m_userData is RedstarfallFigureRedStar)){
_local5 = _local3.m_contactList;
while (_local5) {
if (_local3.IsSleeping()){
if ((_local5.other.m_userData is RedstarfallFigurePlatform)){
_local2 = (_local5.other.m_userData as RedstarfallFigurePlatform);
if (_local2.works){
SoundManager.playSoundById("win");
this.makeAllFigureUnclickable();
this.changeStateTo(WorldState.WIN);
break;
};
};
};
_local5 = _local5.next;
};
};
if ((_local3.m_userData is RedstarfallExplosive)){
_local1 = (_local3.m_userData as RedstarfallExplosive);
if (_local1.detonate){
this.explodeSingle(_local1);
};
};
if (((((_local3.GetPosition().y * this.box2d_physScale) > (480 + 100))) && ((_local3.m_userData is Sprite)))){
if ((_local3.m_userData is RedstarfallFigureRedStar)){
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
} else {
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
};
};
_local3 = _local3.m_next;
};
for each (_local4 in this.bodiesToDestroy) {
if (this.contains((_local4.m_userData as Sprite))){
this.removeChild((_local4.m_userData as Sprite));
};
_local6 = (_local4.m_userData as RedstarfallFigure);
if ((_local6 is RedstarfallExplosive)){
} else {
this.figures_flying_space.addChild((_local6 as Sprite));
this.figures_flying_away.push((_local6 as Sprite));
};
this.box2d_world.DestroyBody(_local4);
};
this.bodiesToDestroy = new Array();
}
private function spawnRedStar2():void{
var _local1:RedstarfallFigureStar;
var _local2:b2Body;
var _local3:Number = 0;
if ((this.playing_time - lastStarCreationTime2) > (starSpawnDelay * 1000)){
if ((_starsCounter2 % 2)){
_local1 = new RedstarfallFigureStar();
} else {
_local1 = new RedstarfallFigureRedStar();
};
_local1.x = (640 - 110);
_local1.y = 522;
this.addChild(_local1);
if ((_starsCounter2 % 2)){
_local2 = this.createFigureStarFrom(_local1, false);
} else {
_local2 = this.createFigureStarFrom(_local1, true);
};
_local2.SetLinearVelocity(new b2Vec2(0, -15));
_local2.SetAngularVelocity(-1);
lastStarCreationTime2 = this.playing_time;
_starsCounter2++;
};
}
private function spawnRedStar():void{
var _local1:RedstarfallFigureStar;
var _local2:b2Body;
var _local3:Number = 0;
if ((this.playing_time - lastStarCreationTime) > (starSpawnDelay * 1000)){
if ((_starsCounter % 2)){
_local1 = new RedstarfallFigureStar();
} else {
_local1 = new RedstarfallFigureRedStar();
};
_local1.x = 110;
_local1.y = 522;
this.addChild(_local1);
if ((_starsCounter % 2)){
_local2 = this.createFigureStarFrom(_local1, false);
} else {
_local2 = this.createFigureStarFrom(_local1, true);
};
_local2.SetLinearVelocity(new b2Vec2(0, -15));
_local2.SetAngularVelocity(1);
lastStarCreationTime = this.playing_time;
_starsCounter++;
};
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.spawnRedStar();
this.spawnRedStar2();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
override protected function createExplosionForBody(_arg1:b2Body):void{
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Vec2;
var _local2:b2Vec2 = new b2Vec2(_arg1.GetPosition().x, _arg1.GetPosition().y);
var _local3:FireworkSprite = new FireworkSprite((_local2.x * this.box2d_physScale), (_local2.y * this.box2d_physScale));
SoundManager.playSoundById("figures_explosion");
var _local4:Array = this.GetBodiesAtZone(_local2.x, _local2.y);
_local10 = new b2Vec2();
var _local11:Number = ((GameplaySettings.EXPLOSION_POWER / 1.4) * _arg1.GetMass());
for each (_local5 in _local4) {
_local6 = (-(_local2.x) + _local5.GetPosition().x);
_local7 = (-(_local2.y) + _local5.GetPosition().y);
_local8 = Math.atan2(_local7, _local6);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local10.x = ((_local11 * _local5.GetMass()) * Math.cos(_local8));
_local10.y = ((_local11 * _local5.GetMass()) * Math.sin(_local8));
_local5.ApplyImpulse(_local10, _local5.GetWorldCenter());
};
this.addChild(_local3);
}
override protected function createFigureBoxFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef;
_local3 = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local5:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local6:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
if ((_arg1 is RedstarfallFigureBox)){
_local5 = (_local5 * 1.5);
};
var _local7:Array = _arg1.getPointsX();
var _local8:Array = _arg1.getPointsY();
_local7 = _local7.map(this.convertToPhysWorldCoord);
_local8 = _local8.map(this.convertToPhysWorldCoord);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 4;
_local9.vertices[0].Set(_local7[1], _local8[1]);
_local9.vertices[1].Set(_local7[2], _local8[2]);
_local9.vertices[2].Set(_local7[3], _local8[3]);
_local9.vertices[3].Set(_local7[4], _local8[4]);
_local9.density = _local5;
_local9.friction = _local4;
_local9.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
override public function getScores():Number{
var _local1:Number = (((600 * 1) + (10 * 4)) - Math.ceil((this.scores + (this.playing_time * 0.01))));
if (_local1 < 0){
_local1 = 0;
};
return (_local1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 329
//Level3 (ru.zedarus.games.redstarfall.levels.Level3)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level3 extends LevelBase {
public function Level3(_arg1:Number):void{
super(_arg1);
}
override protected function actionsStart():void{
super.actionsStart();
var _local1:WorldHint = new Hint5(1, 3, 1);
_local1.x = 253.8;
_local1.y = 142.2;
this.worldHints.showHint(_local1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 330
//Level4 (ru.zedarus.games.redstarfall.levels.Level4)
package ru.zedarus.games.redstarfall.levels {
public class Level4 extends LevelBase {
public function Level4(_arg1:Number):void{
super(_arg1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 331
//Level5 (ru.zedarus.games.redstarfall.levels.Level5)
package ru.zedarus.games.redstarfall.levels {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import ru.zedarus.games.zedengine.sound.*;
import ru.zedarus.games.redstarfall.*;
import ru.zedarus.games.redstarfall.effects.*;
public class Level5 extends LevelBase {
public function Level5(_arg1:Number):void{
super(_arg1);
}
override protected function createExplosionForBody(_arg1:b2Body):void{
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Vec2;
var _local11:Number;
var _local2:b2Vec2 = new b2Vec2(_arg1.GetPosition().x, _arg1.GetPosition().y);
var _local3:FireworkSprite = new FireworkSprite((_local2.x * this.box2d_physScale), (_local2.y * this.box2d_physScale));
SoundManager.playSoundById("figures_explosion");
var _local4:Array = this.GetBodiesAtZone(_local2.x, _local2.y);
_local10 = new b2Vec2();
_local11 = ((GameplaySettings.EXPLOSION_POWER + 30) * _arg1.GetMass());
for each (_local5 in _local4) {
_local6 = (-(_local2.x) + _local5.GetPosition().x);
_local7 = (-(_local2.y) + _local5.GetPosition().y);
_local8 = Math.atan2(_local7, _local6);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local10.x = ((_local11 * _local5.GetMass()) * Math.cos(_local8));
_local10.y = ((_local11 * _local5.GetMass()) * Math.sin(_local8));
_local5.ApplyImpulse(_local10, _local5.GetWorldCenter());
};
this.addChild(_local3);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 332
//Level6 (ru.zedarus.games.redstarfall.levels.Level6)
package ru.zedarus.games.redstarfall.levels {
import flash.display.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.sound.*;
import org.flintparticles.threeD.renderers.controllers.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
import ru.zedarus.games.redstarfall.hints.*;
public class Level6 extends LevelBase {
private var lastStarCreationTime:Number;// = -9999
private var _balksCounter:int;// = 0
private var _starsCounter:int;// = 0
private var lastBalkSpawnTime:Number;// = -9999
public function Level6(_arg1:Number):void{
super(_arg1);
}
private function spawnRedStar():void{
var _local1:RedstarfallFigureStar;
var _local2:b2Body;
var _local3:Number = 0;
if ((this.playing_time - lastStarCreationTime) > (1.95 * 1000)){
_local1 = new RedstarfallFigureRedStar();
_local1.x = -50;
_local1.y = ((480 / 2) - 10);
this.addChild(_local1);
_local2 = this.createFigureStarFrom(_local1, true);
_local2.SetLinearVelocity(new b2Vec2(20, -4.5));
_local2.SetAngularVelocity(3);
lastStarCreationTime = this.playing_time;
_starsCounter++;
};
}
override protected function updateWorld():void{
var _local1:RedstarfallExplosive;
var _local2:RedstarfallFigurePlatform;
var _local4:b2Body;
var _local5:b2ContactEdge;
var _local6:RedstarfallFigure;
this.box2d_world.Step(this.box2d_timeStep, this.box2d_iterations);
var _local3:b2Body = this.box2d_world.m_bodyList;
while (_local3) {
if ((((_local3.m_userData is Sprite)) && (!(_local3.IsStatic())))){
_local3.m_userData.x = (_local3.GetPosition().x * this.box2d_physScale);
_local3.m_userData.y = (_local3.GetPosition().y * this.box2d_physScale);
_local3.m_userData.rotation = (_local3.GetAngle() * (180 / Math.PI));
};
if ((_local3.m_userData is RedstarfallFigureRedStar)){
_local5 = _local3.m_contactList;
while (_local5) {
if (_local3.IsSleeping()){
if ((_local5.other.m_userData is RedstarfallFigurePlatform)){
_local2 = (_local5.other.m_userData as RedstarfallFigurePlatform);
if (_local2.works){
SoundManager.playSoundById("win");
this.makeAllFigureUnclickable();
this.changeStateTo(WorldState.WIN);
break;
};
};
};
_local5 = _local5.next;
};
};
if ((_local3.m_userData is RedstarfallExplosive)){
_local1 = (_local3.m_userData as RedstarfallExplosive);
if (_local1.detonate){
this.explodeSingle(_local1);
};
};
if (((((_local3.GetPosition().y * this.box2d_physScale) > (480 + 100))) && ((_local3.m_userData is Sprite)))){
if ((_local3.m_userData is RedstarfallFigureRedStar)){
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
_starsCounter--;
} else {
if ((_local3.m_userData is RedstarfallFigureBalk12)){
_balksCounter--;
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
} else {
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
};
};
};
_local3 = _local3.m_next;
};
for each (_local4 in this.bodiesToDestroy) {
if (this.contains((_local4.m_userData as Sprite))){
this.removeChild((_local4.m_userData as Sprite));
};
_local6 = (_local4.m_userData as RedstarfallFigure);
if ((_local6 is RedstarfallExplosive)){
} else {
this.figures_flying_space.addChild((_local6 as Sprite));
this.figures_flying_away.push((_local6 as Sprite));
};
this.box2d_world.DestroyBody(_local4);
};
this.bodiesToDestroy = new Array();
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.spawnRedStar();
this.spawnBalk();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
private function spawnBalk():void{
var _local1:RedstarfallFigureBalk12;
var _local2:b2Body;
if ((this.playing_time - lastBalkSpawnTime) > (1.95 * 1000)){
_local1 = new RedstarfallFigureBalk12();
_local1.x = 370;
_local1.y = -(_local1.width);
_local1.rotation = -90;
this.addChild(_local1);
_local2 = this.createFigureBoxFrom(_local1);
_balksCounter++;
lastBalkSpawnTime = this.playing_time;
};
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 333
//Level7 (ru.zedarus.games.redstarfall.levels.Level7)
package ru.zedarus.games.redstarfall.levels {
public class Level7 extends LevelBase {
public function Level7(_arg1:Number):void{
super(_arg1);
}
override protected function actionsStart():void{
super.actionsStart();
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 334
//Level8 (ru.zedarus.games.redstarfall.levels.Level8)
package ru.zedarus.games.redstarfall.levels {
import ru.zedarus.games.redstarfall.objects.figures.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import ru.zedarus.games.redstarfall.*;
public class Level8 extends LevelBase {
public function Level8(_arg1:Number):void{
super(_arg1);
}
override protected function createFigureCirlceFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = new b2BodyDef();
_local4 = GameplaySettings.FIGURE_ORDINARY_FRICTION;
_local5 = GameplaySettings.FIGURE_ORDINARY_DENSITY;
if ((_arg1 is RedstarfallFigureCircle3)){
_local5 = (_local5 * 3);
};
_local6 = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local7:b2CircleDef = new b2CircleDef();
_local7.radius = ((_arg1.clickzone.width / this.box2d_physScale) / 2);
_local7.density = _local5;
_local7.friction = _local4;
_local7.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local7);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 335
//Level9 (ru.zedarus.games.redstarfall.levels.Level9)
package ru.zedarus.games.redstarfall.levels {
public class Level9 extends LevelBase {
public function Level9(_arg1:Number):void{
super(_arg1);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 336
//LevelBase (ru.zedarus.games.redstarfall.levels.LevelBase)
package ru.zedarus.games.redstarfall.levels {
import com.kongregate.as3.client.*;
import flash.display.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import flash.geom.*;
import flash.filters.*;
import org.flintparticles.common.events.*;
import ru.zedarus.games.redstarfall.objects.figures.*;
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import org.flintparticles.threeD.geom.*;
import org.flintparticles.threeD.renderers.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.input.*;
import ru.zedarus.games.zedengine.sound.*;
import ru.zedarus.games.redstarfall.*;
import org.flintparticles.threeD.renderers.controllers.*;
import org.flintparticles.threeD.emitters.*;
import ru.zedarus.games.redstarfall.objects.figures.blank.*;
import ru.zedarus.games.redstarfall.effects.*;
public class LevelBase extends World {
protected var mouseX_phys:Number;
protected var figures_flying_space:Sprite;
protected var figures:Array;
protected var clickDelayProgressMonitor:Sprite;
protected var click_delay:Number;
protected var box2d_physScale:Number;
private var orbitter:OrbitCamera;
protected var mouseY_phys:Number;
protected var bodiesToDestroy:Array;
protected var box2d_debug_draw:Sprite;
protected var box2d_iterations:int;
protected var box2d_timeStep:Number;
protected var star_fountain:Sprite;
private var renderer:BitmapRenderer;
protected var box2d_world:b2World;
protected var figures_flying_away:Array;
private var emitter:Emitter3D;
protected var lastClickTime:Number;// = 0
public function LevelBase(_arg1:Number):void{
figures = [];
click_delay = (GameplaySettings.CLICK_DELAY * 1000);
super(_arg1);
this.bodiesToDestroy = new Array();
this.figures_flying_away = new Array();
this.star_fountain = new Sprite();
this.addChild(this.star_fountain);
this.setChildIndex(this.star_fountain, 0);
var _local2:b2AABB = new b2AABB();
_local2.lowerBound.Set(-1000, -1000);
_local2.upperBound.Set(1000, 1000);
var _local3:b2Vec2 = new b2Vec2(0, 7);
var _local4:Boolean;
this.box2d_iterations = 10;
this.box2d_timeStep = (1 / 30);
this.box2d_physScale = 30;
this.box2d_world = new b2World(_local2, _local3, _local4);
this.box2d_world.SetContactListener(new CustomContactsListener());
var _local5:b2DebugDraw = new b2DebugDraw();
this.box2d_debug_draw = new Sprite();
this.box2d_debug_draw.mouseEnabled = false;
_local5.m_sprite = this.box2d_debug_draw;
_local5.m_drawScale = 30;
_local5.m_fillAlpha = 0;
_local5.m_lineThickness = 1;
_local5.m_drawFlags = 4294967295;
this.figures_flying_space = new Sprite();
this.addChild(this.figures_flying_space);
this.setChildIndex(this.figures_flying_space, 0);
}
protected function flyAway(_arg1:RedstarfallFigureEvent):void{
var _local4:Number;
var _local2:RedstarfallFigure = (_arg1.target as RedstarfallFigure);
_local2.makeUnclickable();
var _local3:Number = (8 * _arg1.localX);
if (_arg1.localY < 0){
_local4 = (3 + (5 * (_arg1.localY + 1)));
} else {
_local4 = (15 * _arg1.localY);
};
var _local5:RedstarfallEffectClick = new RedstarfallEffectClick();
_local5.x = this.mouseX;
_local5.y = this.mouseY;
this.addChild(_local5);
var _local6:Number = (-20 + (Math.random() * 40));
var _local7:Number = (_local2.width / _local2.height);
if (_local7 <= 1){
_local6 = (_local6 * _local7);
} else {
_local6 = (_local6 * (1 / _local7));
};
_local2.fly_rotation = _local6;
_local2.fly_vector = new RedstarfallFigureFlyawayVector(-(_local3), -(_local4), (10 + (10 * Math.random())));
var _local8:b2Body = _local2.box2d_body_reference;
this.bodiesToDestroy.push(_local8);
}
protected function createFigureTetrisFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local5:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local6:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
var _local7:Array = _arg1.getPointsX();
var _local8:Array = _arg1.getPointsY();
_local7 = _local7.map(this.convertToPhysWorldCoord);
_local8 = _local8.map(this.convertToPhysWorldCoord);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 4;
_local9.vertices[0].Set(_local7[1], _local8[1]);
_local9.vertices[1].Set(_local7[2], _local8[2]);
_local9.vertices[2].Set(_local7[3], _local8[3]);
_local9.vertices[3].Set(_local7[8], _local8[8]);
var _local10:b2PolygonDef = new b2PolygonDef();
_local10.vertexCount = 4;
_local10.vertices[0].Set(_local7[7], _local8[7]);
_local10.vertices[1].Set(_local7[4], _local8[4]);
_local10.vertices[2].Set(_local7[5], _local8[5]);
_local10.vertices[3].Set(_local7[6], _local8[6]);
_local9.density = _local5;
_local9.friction = _local4;
_local9.restitution = _local6;
_local10.density = _local5;
_local10.friction = _local4;
_local10.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.CreateShape(_local10);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
override protected function switchToWinState():void{
var _local1:KongregateAPI;
if (Settings.USE_KONGREGATE_API){
_local1 = KongregateAPI.getInstance();
_local1.stats.submit("Level_complete", this.id);
_local1.stats.submit((("Level_" + this.id) + "_score"), this.getScores());
};
}
protected function removeFigure(_arg1:RedstarfallFigureEvent):void{
var _local2:RedstarfallFigure;
if (((((this.playing_time - this.lastClickTime) > this.click_delay)) || ((this.lastClickTime == 0)))){
_local2 = (_arg1.target as RedstarfallFigure);
if ((_local2 is RedstarfallExplosive)){
this.explode(_arg1);
} else {
this.flyAway(_arg1);
};
this.clicks_counter++;
this.scores = (this.scores + 10);
this.lastClickTime = this.playing_time;
SoundManager.playSoundById("figure_click");
};
}
protected function explodeSingle(_arg1:RedstarfallExplosive):void{
_arg1.makeUnclickable();
var _local2:b2Body = _arg1.box2d_body_reference;
this.createExplosionForBody(_local2);
this.bodiesToDestroy.push(_local2);
}
protected function emitterEnd(_arg1:EmitterEvent):void{
}
protected function createFigureBoxFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local5:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local6:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
var _local7:Array = _arg1.getPointsX();
var _local8:Array = _arg1.getPointsY();
_local7 = _local7.map(this.convertToPhysWorldCoord);
_local8 = _local8.map(this.convertToPhysWorldCoord);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 4;
_local9.vertices[0].Set(_local7[1], _local8[1]);
_local9.vertices[1].Set(_local7[2], _local8[2]);
_local9.vertices[2].Set(_local7[3], _local8[3]);
_local9.vertices[3].Set(_local7[4], _local8[4]);
_local9.density = _local5;
_local9.friction = _local4;
_local9.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
protected function updateMouseWorld():void{
this.mouseX_phys = (Input.mouseX / this.box2d_physScale);
this.mouseY_phys = (Input.mouseY / this.box2d_physScale);
}
override protected function actionsWin():void{
if (!emitter){
emitter = new Fountain();
renderer = new BitmapRenderer(new Rectangle(-320, -480, 640, 480), false);
renderer.camera.dolly(-300);
renderer.camera.lift(100);
renderer.camera.target = new Vector3D(0, 100, 0);
renderer.addFilter(new BlurFilter(1.5, 1.5, 1));
renderer.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.5, 0]));
renderer.addEmitter(emitter);
renderer.x = 320;
renderer.y = 480;
this.star_fountain.addChild(renderer);
emitter.position = new Vector3D(0, 0, 0, 1);
emitter.addEventListener(EmitterEvent.EMITTER_EMPTY, this.emitterEnd, false, 0, true);
orbitter = new OrbitCamera(stage, renderer.camera);
orbitter.start();
} else {
if (!emitter.running){
emitter.start();
};
};
this.updateFlyingFigures();
}
protected function updateFigures():void{
var _local1:Number;
var _local2:RedstarfallFigure;
if (this.lastClickTime){
_local1 = ((this.playing_time - this.lastClickTime) / this.click_delay);
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
if (_local1 == 1){
for each (_local2 in this.figures) {
_local2.wakeUp();
};
} else {
for each (_local2 in this.figures) {
_local2.sleep();
};
};
};
}
protected function parseChildObjects():void{
var _local1:Number;
var _local2:Sprite;
_local1 = 0;
while (_local1 < this.numChildren) {
if ((this.getChildAt(_local1) is RedstarfallFigurePlatform)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigurePlatformTiny)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigurePlatformSmall)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigurePlatformBig)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankPlatform)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankPlatformSmall)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankPlatformTiny)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankPlatformBig)){
this.createFigurePlatformFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBox)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBox2)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBox3)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureRedStar)){
this.createFigureStarFrom((this.getChildAt(_local1) as RedstarfallFigureStar), true);
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureStar)){
this.createFigureStarFrom((this.getChildAt(_local1) as RedstarfallFigureStar));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk2)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk3)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk4)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk5)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk6)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk7)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk8)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk9)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk10)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk11)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk12)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk13)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk14)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk15)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk16)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk17)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk18)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk19)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBalk20)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBigT)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureSmallT)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBigCross)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureSmallCross)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBigG)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureSmallG)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureBigCorner)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureTriangle)){
this.createFigureTriangleFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureTrigrine)){
this.createFigureTrigrineFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureCircle)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureCircle2)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureCircle3)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureCircle4)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureHalfcircle)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureHalfcircle2)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureHalfcircle3)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallFigureHalfcircle4)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBox)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBox2)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBox3)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk2)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk3)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk4)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk5)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk6)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk7)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk8)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk9)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk10)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk11)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk12)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk13)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk14)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk15)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk16)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk17)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk18)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk19)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBalk20)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBigT)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankSmallT)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBigCross)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankSmallCross)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBigG)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankSmallG)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankBigCorner)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankTriangle)){
this.createFigureTriangleFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankTrigrine)){
this.createFigureTrigrineFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankCircle)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankCircle2)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankCircle3)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankCircle4)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankHalfcircle)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankHalfcircle2)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankHalfcircle3)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankHalfcircle4)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallBlank));
} else {
if ((this.getChildAt(_local1) is RedstarfallBlankStar)){
this.createFigureStarFrom((this.getChildAt(_local1) as RedstarfallBlankStar));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBox)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBox2)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBox3)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk2)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk3)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk4)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk5)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk6)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk7)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk8)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk9)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk10)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk11)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk12)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk13)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk14)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk15)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk16)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk17)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk18)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk19)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBalk20)){
this.createFigureBoxFrom((this.getChildAt(_local1) as RedstarfallFigure));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBigT)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveSmallT)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBigCross)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveSmallCross)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBigG)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveSmallG)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveBigCorner)){
this.createFigureTetrisFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveTriangle)){
this.createFigureTriangleFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveTrigrine)){
this.createFigureTrigrineFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveCircle)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveCircle2)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveCircle3)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveCircle4)){
this.createFigureCirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveHalfcircle)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveHalfcircle2)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveHalfcircle3)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveHalfcircle4)){
this.createFigureHalfcirlceFrom((this.getChildAt(_local1) as RedstarfallExplosive));
} else {
if ((this.getChildAt(_local1) is RedstarfallExplosiveStar)){
this.createFigureStarFrom((this.getChildAt(_local1) as RedstarfallExplosiveStar));
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local1++;
};
}
override public function getScores():Number{
var _local1:Number = (((600 * 0.8) + (10 * 4)) - Math.ceil((this.scores + (this.playing_time * 0.01))));
if (_local1 < 0){
_local1 = 0;
};
return (_local1);
}
override protected function actionsPermanent():void{
}
protected function createFigureTrigrineFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local5:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local6:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
var _local7:Array = _arg1.getPointsX();
var _local8:Array = _arg1.getPointsY();
_local7 = _local7.map(this.convertToPhysWorldCoord);
_local8 = _local8.map(this.convertToPhysWorldCoord);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 4;
_local9.vertices[0].Set(_local7[1], _local8[1]);
_local9.vertices[1].Set(_local7[2], _local8[2]);
_local9.vertices[2].Set(_local7[3], _local8[3]);
_local9.vertices[3].Set(_local7[9], _local8[9]);
var _local10:b2PolygonDef = new b2PolygonDef();
_local10.vertexCount = 4;
_local10.vertices[0].Set(_local7[3], _local8[3]);
_local10.vertices[1].Set(_local7[4], _local8[4]);
_local10.vertices[2].Set(_local7[5], _local8[5]);
_local10.vertices[3].Set(_local7[6], _local8[6]);
var _local11:b2PolygonDef = new b2PolygonDef();
_local11.vertexCount = 4;
_local11.vertices[0].Set(_local7[9], _local8[9]);
_local11.vertices[1].Set(_local7[6], _local8[6]);
_local11.vertices[2].Set(_local7[7], _local8[7]);
_local11.vertices[3].Set(_local7[8], _local8[8]);
var _local12:b2PolygonDef = new b2PolygonDef();
_local12.vertexCount = 3;
_local12.vertices[0].Set(_local7[9], _local8[9]);
_local12.vertices[1].Set(_local7[3], _local8[3]);
_local12.vertices[2].Set(_local7[6], _local8[6]);
_local9.density = _local5;
_local9.friction = _local4;
_local9.restitution = _local6;
_local10.density = _local5;
_local10.friction = _local4;
_local10.restitution = _local6;
_local11.density = _local5;
_local11.friction = _local4;
_local11.restitution = _local6;
_local12.density = _local5;
_local12.friction = _local4;
_local12.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.CreateShape(_local10);
_local2.CreateShape(_local11);
_local2.CreateShape(_local12);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
public function GetBodiesAtZone(_arg1:Number, _arg2:Number):Array{
var _local3:b2AABB = new b2AABB();
var _local4:Number = 2;
_local3.lowerBound.Set((_arg1 - _local4), (_arg2 - _local4));
_local3.upperBound.Set((_arg1 + _local4), (_arg2 + _local4));
var _local5:Number = 60;
var _local6:Array = new Array();
var _local7:Array = new Array();
var _local8:Number = box2d_world.Query(_local3, _local6, _local5);
var _local9:Number = 0;
while (_local9 < _local8) {
if ((((_local6[_local9].GetBody().IsStatic() == false)) && ((_local7.indexOf(_local6[_local9].GetBody()) == -1)))){
_local7.push(_local6[_local9].GetBody());
};
_local9++;
};
return (_local7);
}
protected function updateFlyingFigures():void{
var _local1:RedstarfallFigure;
var _local5:Number;
var _local7:BlurFilter;
var _local2:Number = (this.stage.stageWidth / 2);
var _local3:Number = ((this.stage.stageHeight / 2) + 50);
var _local4:Number = 250;
var _local6:Number = 0.5;
var _local8:Array = new Array();
for each (_local1 in this.figures_flying_away) {
if (!_local1.fly_vector){
_local1.fly_vector = new RedstarfallFigureFlyawayVector((-5 + (10 * Math.random())), (-5 + (-10 * Math.random())), (10 + (20 * Math.random())));
};
if (!_local1.fly_position){
_local1.fly_position = new RedstarfallFigureFlyawayVector((-(_local2) + _local1.x), (-(_local3) + _local1.y), 0);
};
if (_local1.isClickable()){
_local1.makeUnclickable();
};
_local1.fly_position.x = (_local1.fly_position.x + _local1.fly_vector.x);
_local1.fly_position.y = (_local1.fly_position.y + _local1.fly_vector.y);
_local1.fly_position.z = (_local1.fly_position.z + _local1.fly_vector.z);
_local1.rotation = (_local1.rotation + _local1.fly_rotation);
_local1.fly_vector.y = (_local1.fly_vector.y + _local6);
_local5 = (_local4 / (_local4 + _local1.fly_position.z));
_local1.scaleX = (_local1.scaleY = _local5);
_local1.x = (_local2 + (_local1.fly_position.x * _local5));
_local1.y = (_local3 + (_local1.fly_position.y * _local5));
_local7 = new BlurFilter((3 * (1 - _local5)), (3 * (1 - _local5)), BitmapFilterQuality.HIGH);
_local1.filters = new Array(_local7);
if (_local1.y > (this.stage.stageHeight + (_local1.height * 2))){
this.figures_flying_space.removeChild(_local1);
} else {
_local8.push(_local1);
};
};
this.figures_flying_away = _local8;
}
protected function createFigureStarFrom(_arg1:RedstarfallFigure, _arg2:Boolean=false):b2Body{
var _local3:b2Body;
var _local4:b2BodyDef = new b2BodyDef();
var _local5:Array = _arg1.getPointsX();
var _local6:Array = _arg1.getPointsY();
_local5 = _local5.map(this.convertToPhysWorldCoord);
_local6 = _local6.map(this.convertToPhysWorldCoord);
var _local7:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local8:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local9:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
var _local10:b2PolygonDef = new b2PolygonDef();
_local10.vertexCount = 3;
_local10.vertices[0].Set(_local5[1], _local6[1]);
_local10.vertices[1].Set(_local5[2], _local6[2]);
_local10.vertices[2].Set(_local5[10], _local6[10]);
var _local11:b2PolygonDef = new b2PolygonDef();
_local11.vertexCount = 3;
_local11.vertices[0].Set(_local5[2], _local6[2]);
_local11.vertices[1].Set(_local5[3], _local6[3]);
_local11.vertices[2].Set(_local5[4], _local6[4]);
var _local12:b2PolygonDef = new b2PolygonDef();
_local12.vertexCount = 3;
_local12.vertices[0].Set(_local5[4], _local6[4]);
_local12.vertices[1].Set(_local5[5], _local6[5]);
_local12.vertices[2].Set(_local5[6], _local6[6]);
var _local13:b2PolygonDef = new b2PolygonDef();
_local13.vertexCount = 3;
_local13.vertices[0].Set(_local5[8], _local6[8]);
_local13.vertices[1].Set(_local5[6], _local6[6]);
_local13.vertices[2].Set(_local5[7], _local6[7]);
var _local14:b2PolygonDef = new b2PolygonDef();
_local14.vertexCount = 3;
_local14.vertices[0].Set(_local5[9], _local6[9]);
_local14.vertices[1].Set(_local5[10], _local6[10]);
_local14.vertices[2].Set(_local5[8], _local6[8]);
var _local15:b2PolygonDef = new b2PolygonDef();
_local15.vertexCount = 5;
_local15.vertices[0].Set(_local5[2], _local6[2]);
_local15.vertices[1].Set(_local5[4], _local6[4]);
_local15.vertices[2].Set(_local5[6], _local6[6]);
_local15.vertices[3].Set(_local5[8], _local6[8]);
_local15.vertices[4].Set(_local5[10], _local6[10]);
_local4.position.x = (_arg1.x / this.box2d_physScale);
_local4.position.y = (_arg1.y / this.box2d_physScale);
_local4.angle = ((_arg1.rotation * Math.PI) / 180);
_local10.density = _local8;
_local10.friction = _local7;
_local10.restitution = _local9;
_local11.density = _local8;
_local11.friction = _local7;
_local11.restitution = _local9;
_local12.density = _local8;
_local12.friction = _local7;
_local12.restitution = _local9;
_local13.density = _local8;
_local13.friction = _local7;
_local13.restitution = _local9;
_local14.density = _local8;
_local14.friction = _local7;
_local14.restitution = _local9;
_local15.density = _local8;
_local15.friction = _local7;
_local15.restitution = _local9;
_local4.userData = _arg1;
_local3 = this.box2d_world.CreateBody(_local4);
_local3.CreateShape(_local10);
_local3.CreateShape(_local11);
_local3.CreateShape(_local12);
_local3.CreateShape(_local13);
_local3.CreateShape(_local14);
_local3.CreateShape(_local15);
_local3.SetMassFromShapes();
_local3.SetBullet(true);
_arg1.box2d_body_reference = _local3;
this.figures.push(_arg1);
if (!_arg2){
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
} else {
_arg1.makeUnclickable();
};
return (_local3);
}
protected function updateWorld():void{
var _local1:RedstarfallExplosive;
var _local2:RedstarfallFigurePlatform;
var _local4:b2Body;
var _local5:b2ContactEdge;
var _local6:RedstarfallFigure;
this.box2d_world.Step(this.box2d_timeStep, this.box2d_iterations);
var _local3:b2Body = this.box2d_world.m_bodyList;
while (_local3) {
if ((((_local3.m_userData is Sprite)) && (!(_local3.IsStatic())))){
_local3.m_userData.x = (_local3.GetPosition().x * this.box2d_physScale);
_local3.m_userData.y = (_local3.GetPosition().y * this.box2d_physScale);
_local3.m_userData.rotation = (_local3.GetAngle() * (180 / Math.PI));
};
if ((_local3.m_userData is RedstarfallFigureRedStar)){
_local5 = _local3.m_contactList;
while (_local5) {
if (_local3.IsSleeping()){
if ((_local5.other.m_userData is RedstarfallFigurePlatform)){
_local2 = (_local5.other.m_userData as RedstarfallFigurePlatform);
if (_local2.works){
SoundManager.playSoundById("win");
this.makeAllFigureUnclickable();
this.changeStateTo(WorldState.WIN);
break;
};
};
};
_local5 = _local5.next;
};
};
if ((_local3.m_userData is RedstarfallExplosive)){
_local1 = (_local3.m_userData as RedstarfallExplosive);
if (_local1.detonate){
this.explodeSingle(_local1);
};
};
if (((((_local3.GetPosition().y * this.box2d_physScale) > (480 + 100))) && ((_local3.m_userData is Sprite)))){
if ((_local3.m_userData is RedstarfallFigureRedStar)){
SoundManager.playSoundById("lost");
this.changeStateTo(WorldState.LOSE);
this.dispatchEvent(new WorldEvent(WorldEvent.WORLD_LOST, this.id));
};
this.removeChild((_local3.m_userData as Sprite));
this.box2d_world.DestroyBody(_local3);
};
_local3 = _local3.m_next;
};
for each (_local4 in this.bodiesToDestroy) {
if (this.contains((_local4.m_userData as Sprite))){
this.removeChild((_local4.m_userData as Sprite));
};
_local6 = (_local4.m_userData as RedstarfallFigure);
if ((_local6 is RedstarfallExplosive)){
} else {
this.figures_flying_space.addChild((_local6 as Sprite));
this.figures_flying_away.push((_local6 as Sprite));
};
this.box2d_world.DestroyBody(_local4);
};
this.bodiesToDestroy = new Array();
}
override protected function actionsPlay():void{
this.updateMouseWorld();
this.updateFigures();
this.updateFlyingFigures();
this.updateWorld();
if (this.contains(this.box2d_debug_draw)){
this.setElementOnTop(this.box2d_debug_draw);
};
}
protected function makeAllFigureUnclickable():void{
var _local1:RedstarfallFigure;
for each (_local1 in this.figures) {
_local1.makeUnclickable();
};
}
override public function getParam(_arg1:String):Object{
var _local2:Number;
switch (_arg1){
case "click_cooldown":
if (((!((this.lastClickTime == 0))) && ((this.state == WorldState.PLAY)))){
_local2 = ((this.playing_time - this.lastClickTime) / this.click_delay);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > 1){
_local2 = 1;
};
} else {
_local2 = 1;
};
return (_local2);
default:
return (null);
};
}
protected function createExplosionForBody(_arg1:b2Body):void{
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local2:b2Vec2 = new b2Vec2(_arg1.GetPosition().x, _arg1.GetPosition().y);
var _local3:FireworkSprite = new FireworkSprite((_local2.x * this.box2d_physScale), (_local2.y * this.box2d_physScale));
SoundManager.playSoundById("figures_explosion");
var _local4:Array = this.GetBodiesAtZone(_local2.x, _local2.y);
var _local10:b2Vec2 = new b2Vec2();
var _local11:Number = (GameplaySettings.EXPLOSION_POWER * _arg1.GetMass());
for each (_local5 in _local4) {
if (_local5 != _arg1){
_local6 = (-(_local2.x) + _local5.GetPosition().x);
_local7 = (-(_local2.y) + _local5.GetPosition().y);
_local8 = Math.atan2(_local7, _local6);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local10.x = ((_local11 * _local5.GetMass()) * Math.cos(_local8));
_local10.y = ((_local11 * _local5.GetMass()) * Math.sin(_local8));
_local5.ApplyImpulse(_local10, _local5.GetWorldCenter());
};
};
this.addChild(_local3);
}
protected function createFigurePlatformFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:b2PolygonDef = new b2PolygonDef();
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
var _local5:Number = _arg1.rotation;
_arg1.rotation = 0;
_local4.SetAsOrientedBox((((_arg1.width - 2) / this.box2d_physScale) / 2), ((30 / this.box2d_physScale) / 2), new b2Vec2(0, (-(((_arg1.height / 2) - 15)) / this.box2d_physScale)));
_arg1.rotation = _local5;
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local4);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
return (_local2);
}
protected function spawnBox(_arg1:int, _arg2:int):b2Body{
var _local3:b2Body;
var _local4:b2BodyDef = new b2BodyDef();
var _local5:b2PolygonDef = new b2PolygonDef();
var _local6:Sprite = new Sprite();
_local6.graphics.beginFill(0xFF0000, 1);
_local6.graphics.drawRect(-10, -10, 20, 20);
_local6.graphics.endFill();
_local4.position.x = (_arg1 / this.box2d_physScale);
_local4.position.y = (_arg2 / this.box2d_physScale);
_local5.SetAsBox((((_local6.width - 2) / this.box2d_physScale) / 2), (((_local6.height - 2) / this.box2d_physScale) / 2));
_local5.density = 1;
_local5.friction = 0.2;
_local5.restitution = 0.2;
_local4.userData = _local6;
_local3 = this.box2d_world.CreateBody(_local4);
_local3.CreateShape(_local5);
_local3.SetMassFromShapes();
_local3.SetBullet(true);
this.addChild(_local6);
return (_local3);
}
protected function explode(_arg1:RedstarfallFigureEvent):void{
var _local2:RedstarfallExplosive = (_arg1.target as RedstarfallExplosive);
_local2.makeUnclickable();
var _local3:b2Body = _local2.box2d_body_reference;
this.createExplosionForBody(_local3);
this.bodiesToDestroy.push(_local3);
}
override protected function actionsStart():void{
this.parseChildObjects();
this.clickDelayProgressMonitor = new Sprite();
this.addChild(this.clickDelayProgressMonitor);
super.actionsStart();
}
protected function createFigureHalfcirlceFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:Array = _arg1.getPointsX();
var _local5:Array = _arg1.getPointsY();
_local4 = _local4.map(this.convertToPhysWorldCoord);
_local5 = _local5.map(this.convertToPhysWorldCoord);
var _local6:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local7:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local8:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 3;
_local9.vertices[0].Set(_local4[1], _local5[1]);
_local9.vertices[1].Set(_local4[2], _local5[2]);
_local9.vertices[2].Set(_local4[10], _local5[10]);
var _local10:b2PolygonDef = new b2PolygonDef();
_local10.vertexCount = 3;
_local10.vertices[0].Set(_local4[2], _local5[2]);
_local10.vertices[1].Set(_local4[3], _local5[3]);
_local10.vertices[2].Set(_local4[10], _local5[10]);
var _local11:b2PolygonDef = new b2PolygonDef();
_local11.vertexCount = 3;
_local11.vertices[0].Set(_local4[3], _local5[3]);
_local11.vertices[1].Set(_local4[4], _local5[4]);
_local11.vertices[2].Set(_local4[10], _local5[10]);
var _local12:b2PolygonDef = new b2PolygonDef();
_local12.vertexCount = 3;
_local12.vertices[0].Set(_local4[4], _local5[4]);
_local12.vertices[1].Set(_local4[5], _local5[5]);
_local12.vertices[2].Set(_local4[10], _local5[10]);
var _local13:b2PolygonDef = new b2PolygonDef();
_local13.vertexCount = 3;
_local13.vertices[0].Set(_local4[5], _local5[5]);
_local13.vertices[1].Set(_local4[6], _local5[6]);
_local13.vertices[2].Set(_local4[10], _local5[10]);
var _local14:b2PolygonDef = new b2PolygonDef();
_local14.vertexCount = 3;
_local14.vertices[0].Set(_local4[6], _local5[6]);
_local14.vertices[1].Set(_local4[7], _local5[7]);
_local14.vertices[2].Set(_local4[10], _local5[10]);
var _local15:b2PolygonDef = new b2PolygonDef();
_local15.vertexCount = 3;
_local15.vertices[0].Set(_local4[7], _local5[7]);
_local15.vertices[1].Set(_local4[8], _local5[8]);
_local15.vertices[2].Set(_local4[10], _local5[10]);
var _local16:b2PolygonDef = new b2PolygonDef();
_local16.vertexCount = 3;
_local16.vertices[0].Set(_local4[8], _local5[8]);
_local16.vertices[1].Set(_local4[9], _local5[9]);
_local16.vertices[2].Set(_local4[10], _local5[10]);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
_local9.density = _local7;
_local9.friction = _local6;
_local9.restitution = _local8;
_local10.density = _local7;
_local10.friction = _local6;
_local10.restitution = _local8;
_local11.density = _local7;
_local11.friction = _local6;
_local11.restitution = _local8;
_local12.density = _local7;
_local12.friction = _local6;
_local12.restitution = _local8;
_local13.density = _local7;
_local13.friction = _local6;
_local13.restitution = _local8;
_local14.density = _local7;
_local14.friction = _local6;
_local14.restitution = _local8;
_local15.density = _local7;
_local15.friction = _local6;
_local15.restitution = _local8;
_local16.density = _local7;
_local16.friction = _local6;
_local16.restitution = _local8;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.CreateShape(_local10);
_local2.CreateShape(_local11);
_local2.CreateShape(_local12);
_local2.CreateShape(_local13);
_local2.CreateShape(_local14);
_local2.CreateShape(_local15);
_local2.CreateShape(_local16);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
protected function convertToPhysWorldCoord(_arg1, _arg2:int, _arg3:Array):Number{
return ((_arg1 / this.box2d_physScale));
}
protected function createFigureCirlceFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local5:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local6:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local7:b2CircleDef = new b2CircleDef();
_local7.radius = ((_arg1.clickzone.width / this.box2d_physScale) / 2);
_local7.density = _local5;
_local7.friction = _local4;
_local7.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local7);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
protected function createFigureTriangleFrom(_arg1:RedstarfallFigure):b2Body{
var _local2:b2Body;
var _local3:b2BodyDef = new b2BodyDef();
var _local4:Number = GameplaySettings.FIGURE_ORDINARY_FRICTION;
var _local5:Number = GameplaySettings.FIGURE_ORDINARY_DENSITY;
var _local6:Number = GameplaySettings.FIGURE_ORDINARY_RESTITUTION;
var _local7:Array = _arg1.getPointsX();
var _local8:Array = _arg1.getPointsY();
_local7 = _local7.map(this.convertToPhysWorldCoord);
_local8 = _local8.map(this.convertToPhysWorldCoord);
_local3.position.x = (_arg1.x / this.box2d_physScale);
_local3.position.y = (_arg1.y / this.box2d_physScale);
_local3.angle = ((_arg1.rotation * Math.PI) / 180);
var _local9:b2PolygonDef = new b2PolygonDef();
_local9.vertexCount = 3;
_local9.vertices[0].Set(_local7[1], _local8[1]);
_local9.vertices[1].Set(_local7[2], _local8[2]);
_local9.vertices[2].Set(_local7[3], _local8[3]);
_local9.density = _local5;
_local9.friction = _local4;
_local9.restitution = _local6;
_local3.userData = _arg1;
_local2 = this.box2d_world.CreateBody(_local3);
_local2.CreateShape(_local9);
_local2.SetMassFromShapes();
_local2.SetBullet(true);
_arg1.box2d_body_reference = _local2;
this.figures.push(_arg1);
_arg1.makeClickable();
_arg1.addEventListener(RedstarfallFigureEvent.CLICKED, this.removeFigure);
return (_local2);
}
}
}//package ru.zedarus.games.redstarfall.levels
Section 337
//RedstarfallBlank (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlank)
package ru.zedarus.games.redstarfall.objects.figures.blank {
import ru.zedarus.games.redstarfall.objects.figures.*;
public class RedstarfallBlank extends RedstarfallFigure {
public function RedstarfallBlank():void{
this.mouseEnabled = false;
if (this.clickzone){
this.clickzone.alpha = 0;
this.makeUnclickable();
};
}
override public function makeClickable():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 338
//RedstarfallBlankBalk (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk extends RedstarfallBlank {
public function RedstarfallBlankBalk():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 339
//RedstarfallBlankBalk10 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk10)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk10 extends RedstarfallBlank {
public function RedstarfallBlankBalk10():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 340
//RedstarfallBlankBalk11 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk11)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk11 extends RedstarfallBlank {
public function RedstarfallBlankBalk11():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 341
//RedstarfallBlankBalk12 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk12)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk12 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk12():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 342
//RedstarfallBlankBalk13 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk13)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk13 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk13():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 343
//RedstarfallBlankBalk14 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk14)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk14 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk14():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 344
//RedstarfallBlankBalk15 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk15)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk15 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk15():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 345
//RedstarfallBlankBalk16 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk16)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk16 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk16():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 346
//RedstarfallBlankBalk17 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk17)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk17 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk17():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 347
//RedstarfallBlankBalk18 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk18)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk18 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk18():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 348
//RedstarfallBlankBalk19 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk19)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk19 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk19():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 349
//RedstarfallBlankBalk2 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk2)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk2 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 350
//RedstarfallBlankBalk20 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk20)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk20 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk20():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 351
//RedstarfallBlankBalk3 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk3)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk3 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 352
//RedstarfallBlankBalk4 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk4)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk4 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 353
//RedstarfallBlankBalk5 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk5)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk5 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk5():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 354
//RedstarfallBlankBalk6 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk6)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk6 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk6():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 355
//RedstarfallBlankBalk7 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk7)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk7 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk7():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 356
//RedstarfallBlankBalk8 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk8)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk8 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk8():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 357
//RedstarfallBlankBalk9 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBalk9)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBalk9 extends RedstarfallBlankBalk {
public function RedstarfallBlankBalk9():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 358
//RedstarfallBlankBigCorner (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBigCorner)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBigCorner extends RedstarfallBlank {
public function RedstarfallBlankBigCorner():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 359
//RedstarfallBlankBigCross (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBigCross)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBigCross extends RedstarfallBlank {
public function RedstarfallBlankBigCross():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 360
//RedstarfallBlankBigG (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBigG)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBigG extends RedstarfallBlank {
public function RedstarfallBlankBigG():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 361
//RedstarfallBlankBigT (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBigT)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBigT extends RedstarfallBlank {
public function RedstarfallBlankBigT():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 362
//RedstarfallBlankBox (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBox)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBox extends RedstarfallBlank {
public function RedstarfallBlankBox():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 363
//RedstarfallBlankBox2 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBox2)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBox2 extends RedstarfallBlank {
public function RedstarfallBlankBox2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 364
//RedstarfallBlankBox3 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankBox3)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankBox3 extends RedstarfallBlank {
public function RedstarfallBlankBox3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 365
//RedstarfallBlankCircle (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankCircle)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankCircle extends RedstarfallBlank {
public function RedstarfallBlankCircle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 366
//RedstarfallBlankCircle2 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankCircle2)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankCircle2 extends RedstarfallBlank {
public function RedstarfallBlankCircle2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 367
//RedstarfallBlankCircle3 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankCircle3)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankCircle3 extends RedstarfallBlank {
public function RedstarfallBlankCircle3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 368
//RedstarfallBlankCircle4 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankCircle4)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankCircle4 extends RedstarfallBlank {
public function RedstarfallBlankCircle4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 369
//RedstarfallBlankHalfcircle (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankHalfcircle)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankHalfcircle extends RedstarfallBlank {
public function RedstarfallBlankHalfcircle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 370
//RedstarfallBlankHalfcircle2 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankHalfcircle2)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankHalfcircle2 extends RedstarfallBlank {
public function RedstarfallBlankHalfcircle2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 371
//RedstarfallBlankHalfcircle3 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankHalfcircle3)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankHalfcircle3 extends RedstarfallBlank {
public function RedstarfallBlankHalfcircle3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 372
//RedstarfallBlankHalfcircle4 (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankHalfcircle4)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankHalfcircle4 extends RedstarfallBlank {
public function RedstarfallBlankHalfcircle4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 373
//RedstarfallBlankPlatform (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankPlatform)
package ru.zedarus.games.redstarfall.objects.figures.blank {
import ru.zedarus.games.redstarfall.objects.figures.*;
public class RedstarfallBlankPlatform extends RedstarfallFigurePlatform {
public function RedstarfallBlankPlatform():void{
this.works = false;
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 374
//RedstarfallBlankPlatformBig (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankPlatformBig)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankPlatformBig extends RedstarfallBlankPlatform {
public function RedstarfallBlankPlatformBig():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 375
//RedstarfallBlankPlatformSmall (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankPlatformSmall)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankPlatformSmall extends RedstarfallBlankPlatform {
public function RedstarfallBlankPlatformSmall():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 376
//RedstarfallBlankPlatformTiny (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankPlatformTiny)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankPlatformTiny extends RedstarfallBlankPlatform {
public function RedstarfallBlankPlatformTiny():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 377
//RedstarfallBlankSmallCross (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankSmallCross)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankSmallCross extends RedstarfallBlank {
public function RedstarfallBlankSmallCross():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 378
//RedstarfallBlankSmallG (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankSmallG)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankSmallG extends RedstarfallBlank {
public function RedstarfallBlankSmallG():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 379
//RedstarfallBlankSmallT (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankSmallT)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankSmallT extends RedstarfallBlank {
public function RedstarfallBlankSmallT():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 380
//RedstarfallBlankStar (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankStar)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankStar extends RedstarfallBlank {
public function RedstarfallBlankStar():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 381
//RedstarfallBlankTriangle (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankTriangle)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankTriangle extends RedstarfallBlank {
public function RedstarfallBlankTriangle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 382
//RedstarfallBlankTrigrine (ru.zedarus.games.redstarfall.objects.figures.blank.RedstarfallBlankTrigrine)
package ru.zedarus.games.redstarfall.objects.figures.blank {
public class RedstarfallBlankTrigrine extends RedstarfallBlank {
public function RedstarfallBlankTrigrine():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.blank
Section 383
//RedstarfallExplosive (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosive)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
import ru.zedarus.games.redstarfall.objects.figures.*;
public class RedstarfallExplosive extends RedstarfallFigure {
public var detonate:Boolean;// = false
public function RedstarfallExplosive():void{
}
public function explode():void{
this.detonate = true;
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 384
//RedstarfallExplosiveBalk (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk extends RedstarfallExplosive {
public function RedstarfallExplosiveBalk():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 385
//RedstarfallExplosiveBalk10 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk10)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk10 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk10():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 386
//RedstarfallExplosiveBalk11 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk11)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk11 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk11():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 387
//RedstarfallExplosiveBalk12 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk12)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk12 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk12():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 388
//RedstarfallExplosiveBalk13 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk13)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk13 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk13():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 389
//RedstarfallExplosiveBalk14 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk14)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk14 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk14():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 390
//RedstarfallExplosiveBalk15 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk15)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk15 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk15():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 391
//RedstarfallExplosiveBalk16 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk16)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk16 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk16():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 392
//RedstarfallExplosiveBalk17 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk17)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk17 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk17():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 393
//RedstarfallExplosiveBalk18 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk18)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk18 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk18():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 394
//RedstarfallExplosiveBalk19 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk19)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk19 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk19():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 395
//RedstarfallExplosiveBalk2 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk2)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk2 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 396
//RedstarfallExplosiveBalk20 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk20)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk20 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk20():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 397
//RedstarfallExplosiveBalk3 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk3)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk3 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 398
//RedstarfallExplosiveBalk4 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk4)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk4 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 399
//RedstarfallExplosiveBalk5 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk5)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk5 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk5():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 400
//RedstarfallExplosiveBalk6 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk6)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk6 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk6():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 401
//RedstarfallExplosiveBalk7 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk7)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk7 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk7():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 402
//RedstarfallExplosiveBalk8 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk8)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk8 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk8():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 403
//RedstarfallExplosiveBalk9 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBalk9)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBalk9 extends RedstarfallExplosiveBalk {
public function RedstarfallExplosiveBalk9():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 404
//RedstarfallExplosiveBigCorner (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBigCorner)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBigCorner extends RedstarfallExplosive {
public function RedstarfallExplosiveBigCorner():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 405
//RedstarfallExplosiveBigCross (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBigCross)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBigCross extends RedstarfallExplosive {
public function RedstarfallExplosiveBigCross():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 406
//RedstarfallExplosiveBigG (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBigG)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBigG extends RedstarfallExplosive {
public function RedstarfallExplosiveBigG():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 407
//RedstarfallExplosiveBigT (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBigT)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBigT extends RedstarfallExplosive {
public function RedstarfallExplosiveBigT():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 408
//RedstarfallExplosiveBox (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBox)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBox extends RedstarfallExplosive {
public function RedstarfallExplosiveBox():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 409
//RedstarfallExplosiveBox2 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBox2)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBox2 extends RedstarfallExplosive {
public function RedstarfallExplosiveBox2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 410
//RedstarfallExplosiveBox3 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveBox3)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveBox3 extends RedstarfallExplosive {
public function RedstarfallExplosiveBox3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 411
//RedstarfallExplosiveCircle (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveCircle)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveCircle extends RedstarfallExplosive {
public function RedstarfallExplosiveCircle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 412
//RedstarfallExplosiveCircle2 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveCircle2)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveCircle2 extends RedstarfallExplosive {
public function RedstarfallExplosiveCircle2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 413
//RedstarfallExplosiveCircle3 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveCircle3)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveCircle3 extends RedstarfallExplosive {
public function RedstarfallExplosiveCircle3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 414
//RedstarfallExplosiveCircle4 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveCircle4)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveCircle4 extends RedstarfallExplosive {
public function RedstarfallExplosiveCircle4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 415
//RedstarfallExplosiveHalfcircle (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveHalfcircle)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveHalfcircle extends RedstarfallExplosive {
public function RedstarfallExplosiveHalfcircle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 416
//RedstarfallExplosiveHalfcircle2 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveHalfcircle2)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveHalfcircle2 extends RedstarfallExplosive {
public function RedstarfallExplosiveHalfcircle2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 417
//RedstarfallExplosiveHalfcircle3 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveHalfcircle3)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveHalfcircle3 extends RedstarfallExplosive {
public function RedstarfallExplosiveHalfcircle3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 418
//RedstarfallExplosiveHalfcircle4 (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveHalfcircle4)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveHalfcircle4 extends RedstarfallExplosive {
public function RedstarfallExplosiveHalfcircle4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 419
//RedstarfallExplosiveSmallCross (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveSmallCross)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveSmallCross extends RedstarfallExplosive {
public function RedstarfallExplosiveSmallCross():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 420
//RedstarfallExplosiveSmallG (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveSmallG)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveSmallG extends RedstarfallExplosive {
public function RedstarfallExplosiveSmallG():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 421
//RedstarfallExplosiveSmallT (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveSmallT)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveSmallT extends RedstarfallExplosive {
public function RedstarfallExplosiveSmallT():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 422
//RedstarfallExplosiveStar (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveStar)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveStar extends RedstarfallExplosive {
public function RedstarfallExplosiveStar():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 423
//RedstarfallExplosiveTriangle (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveTriangle)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveTriangle extends RedstarfallExplosive {
public function RedstarfallExplosiveTriangle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 424
//RedstarfallExplosiveTrigrine (ru.zedarus.games.redstarfall.objects.figures.explosive.RedstarfallExplosiveTrigrine)
package ru.zedarus.games.redstarfall.objects.figures.explosive {
public class RedstarfallExplosiveTrigrine extends RedstarfallExplosive {
public function RedstarfallExplosiveTrigrine():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures.explosive
Section 425
//RedstarfallFigure (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigure)
package ru.zedarus.games.redstarfall.objects.figures {
import flash.events.*;
import flash.display.*;
import Box2D.Dynamics.*;
public class RedstarfallFigure extends MovieClip {
public var p1:MovieClip;
public var p3:MovieClip;
public var p5:MovieClip;
public var p7:MovieClip;
public var p4:MovieClip;
public var p6:MovieClip;
public var fly_vector:RedstarfallFigureFlyawayVector;
public var fly_rotation:Number;
public var p10:MovieClip;
public var p8:MovieClip;
public var p9:MovieClip;
public var p2:MovieClip;
public var shape:Sprite;
public var bitmap:Sprite;
public var box2d_body_reference:b2Body;
public var clickzone:Sprite;
public var fly_position:RedstarfallFigureFlyawayVector;
public function RedstarfallFigure():void{
var _local1:Number;
super();
this.mouseEnabled = false;
if (this.clickzone){
this.clickzone.alpha = 0;
this.makeUnclickable();
};
if (this.bitmap){
this.bitmap.alpha = 1;
};
if (this.shape){
this.shape.visible = false;
};
_local1 = 1;
while (_local1 <= 10) {
if (this[("p" + _local1)]){
this[("p" + _local1)].visible = false;
};
_local1++;
};
}
public function makeClickable():void{
if (this.clickzone){
this.clickzone.addEventListener(MouseEvent.CLICK, this.click);
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
};
}
public function click(_arg1:MouseEvent):void{
if (_arg1){
_arg1.localX = (_arg1.localX / (this.clickzone.width / 2));
_arg1.localY = (_arg1.localY / (this.clickzone.height / 2));
};
this.dispatchEvent(new RedstarfallFigureEvent(RedstarfallFigureEvent.CLICKED, _arg1));
}
public function getPointsX():Array{
var _local2:Number;
var _local1:Array = new Array();
_local1.push(0);
_local2 = 1;
while (_local2 <= 10) {
if (this[("p" + _local2)]){
_local1.push(this[("p" + _local2)].x);
};
_local2++;
};
return (_local1);
}
public function makeUnclickable():void{
if (this.clickzone){
this.clickzone.removeEventListener(MouseEvent.CLICK, this.click);
this.clickzone.buttonMode = false;
this.clickzone.useHandCursor = false;
};
}
public function sleep():void{
if (this.clickzone){
if (this.clickzone.buttonMode){
this.clickzone.useHandCursor = false;
};
};
}
public function getPointsY():Array{
var _local2:Number;
var _local1:Array = new Array();
_local1.push(0);
_local2 = 1;
while (_local2 <= 10) {
if (this[("p" + _local2)]){
_local1.push(this[("p" + _local2)].y);
};
_local2++;
};
return (_local1);
}
public function wakeUp():void{
if (this.clickzone){
if (this.clickzone.buttonMode){
this.clickzone.useHandCursor = true;
};
};
}
public function isClickable():Boolean{
if (this.clickzone){
return (this.clickzone.buttonMode);
};
return (false);
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 426
//RedstarfallFigureBalk (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk extends RedstarfallFigure {
public function RedstarfallFigureBalk():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 427
//RedstarfallFigureBalk10 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk10)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk10 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk10():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 428
//RedstarfallFigureBalk11 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk11)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk11 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk11():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 429
//RedstarfallFigureBalk12 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk12)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk12 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk12():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 430
//RedstarfallFigureBalk13 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk13)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk13 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk13():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 431
//RedstarfallFigureBalk14 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk14)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk14 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk14():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 432
//RedstarfallFigureBalk15 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk15)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk15 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk15():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 433
//RedstarfallFigureBalk16 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk16)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk16 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk16():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 434
//RedstarfallFigureBalk17 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk17)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk17 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk17():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 435
//RedstarfallFigureBalk18 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk18)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk18 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk18():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 436
//RedstarfallFigureBalk19 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk19)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk19 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk19():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 437
//RedstarfallFigureBalk2 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk2)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk2 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 438
//RedstarfallFigureBalk20 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk20)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk20 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk20():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 439
//RedstarfallFigureBalk3 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk3)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk3 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 440
//RedstarfallFigureBalk4 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk4)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk4 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 441
//RedstarfallFigureBalk5 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk5)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk5 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk5():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 442
//RedstarfallFigureBalk6 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk6)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk6 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk6():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 443
//RedstarfallFigureBalk7 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk7)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk7 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk7():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 444
//RedstarfallFigureBalk8 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk8)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk8 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk8():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 445
//RedstarfallFigureBalk9 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBalk9)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBalk9 extends RedstarfallFigureBalk {
public function RedstarfallFigureBalk9():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 446
//RedstarfallFigureBigCorner (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBigCorner)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBigCorner extends RedstarfallFigure {
public function RedstarfallFigureBigCorner():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 447
//RedstarfallFigureBigCross (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBigCross)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBigCross extends RedstarfallFigure {
public function RedstarfallFigureBigCross():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 448
//RedstarfallFigureBigG (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBigG)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBigG extends RedstarfallFigure {
public function RedstarfallFigureBigG():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 449
//RedstarfallFigureBigT (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBigT)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBigT extends RedstarfallFigure {
public function RedstarfallFigureBigT():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 450
//RedstarfallFigureBox (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBox)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBox extends RedstarfallFigure {
public function RedstarfallFigureBox():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 451
//RedstarfallFigureBox2 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBox2)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBox2 extends RedstarfallFigure {
public function RedstarfallFigureBox2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 452
//RedstarfallFigureBox3 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureBox3)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureBox3 extends RedstarfallFigure {
public function RedstarfallFigureBox3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 453
//RedstarfallFigureCircle (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureCircle)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureCircle extends RedstarfallFigure {
public function RedstarfallFigureCircle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 454
//RedstarfallFigureCircle2 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureCircle2)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureCircle2 extends RedstarfallFigure {
public function RedstarfallFigureCircle2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 455
//RedstarfallFigureCircle3 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureCircle3)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureCircle3 extends RedstarfallFigure {
public function RedstarfallFigureCircle3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 456
//RedstarfallFigureCircle4 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureCircle4)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureCircle4 extends RedstarfallFigure {
public function RedstarfallFigureCircle4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 457
//RedstarfallFigureEvent (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureEvent)
package ru.zedarus.games.redstarfall.objects.figures {
import flash.events.*;
public class RedstarfallFigureEvent extends MouseEvent {
public static const CLICKED:String = "CLICKED";
public function RedstarfallFigureEvent(_arg1:String, _arg2:MouseEvent):void{
super(_arg1, _arg2.bubbles, _arg2.cancelable, _arg2.localX, _arg2.localY, _arg2.relatedObject, _arg2.ctrlKey, _arg2.altKey, _arg2.shiftKey, _arg2.buttonDown, _arg2.delta);
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 458
//RedstarfallFigureFlyawayVector (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureFlyawayVector)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureFlyawayVector {
public var x:Number;
public var y:Number;
public var z:Number;
public function RedstarfallFigureFlyawayVector(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 459
//RedstarfallFigureHalfcircle (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureHalfcircle)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureHalfcircle extends RedstarfallFigure {
public function RedstarfallFigureHalfcircle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 460
//RedstarfallFigureHalfcircle2 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureHalfcircle2)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureHalfcircle2 extends RedstarfallFigure {
public function RedstarfallFigureHalfcircle2():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 461
//RedstarfallFigureHalfcircle3 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureHalfcircle3)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureHalfcircle3 extends RedstarfallFigure {
public function RedstarfallFigureHalfcircle3():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 462
//RedstarfallFigureHalfcircle4 (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureHalfcircle4)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureHalfcircle4 extends RedstarfallFigure {
public function RedstarfallFigureHalfcircle4():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 463
//RedstarfallFigurePlatform (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigurePlatform)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigurePlatform extends RedstarfallFigure {
public var works:Boolean;// = true
public function RedstarfallFigurePlatform():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 464
//RedstarfallFigurePlatformBig (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigurePlatformBig)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigurePlatformBig extends RedstarfallFigurePlatform {
public function RedstarfallFigurePlatformBig():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 465
//RedstarfallFigurePlatformSmall (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigurePlatformSmall)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigurePlatformSmall extends RedstarfallFigurePlatform {
public function RedstarfallFigurePlatformSmall():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 466
//RedstarfallFigurePlatformTiny (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigurePlatformTiny)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigurePlatformTiny extends RedstarfallFigurePlatform {
public function RedstarfallFigurePlatformTiny():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 467
//RedstarfallFigureRedStar (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureRedStar)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureRedStar extends RedstarfallFigureStar {
public function RedstarfallFigureRedStar():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 468
//RedstarfallFigureSmallCross (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureSmallCross)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureSmallCross extends RedstarfallFigure {
public function RedstarfallFigureSmallCross():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 469
//RedstarfallFigureSmallG (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureSmallG)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureSmallG extends RedstarfallFigure {
public function RedstarfallFigureSmallG():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 470
//RedstarfallFigureSmallT (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureSmallT)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureSmallT extends RedstarfallFigure {
public function RedstarfallFigureSmallT():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 471
//RedstarfallFigureStar (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureStar)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureStar extends RedstarfallFigure {
public function RedstarfallFigureStar():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 472
//RedstarfallFigureTriangle (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureTriangle)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureTriangle extends RedstarfallFigure {
public function RedstarfallFigureTriangle():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 473
//RedstarfallFigureTrigrine (ru.zedarus.games.redstarfall.objects.figures.RedstarfallFigureTrigrine)
package ru.zedarus.games.redstarfall.objects.figures {
public class RedstarfallFigureTrigrine extends RedstarfallFigure {
public function RedstarfallFigureTrigrine():void{
}
}
}//package ru.zedarus.games.redstarfall.objects.figures
Section 474
//Cloud (ru.zedarus.games.redstarfall.objects.Cloud)
package ru.zedarus.games.redstarfall.objects {
import flash.display.*;
public class Cloud extends MovieClip {
public var depth:int;
public function Cloud():void{
}
}
}//package ru.zedarus.games.redstarfall.objects
Section 475
//CustomContactsListener (ru.zedarus.games.redstarfall.CustomContactsListener)
package ru.zedarus.games.redstarfall {
import ru.zedarus.games.redstarfall.objects.figures.explosive.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import ru.zedarus.games.zedengine.sound.*;
public class CustomContactsListener extends b2ContactListener {
override public function Add(_arg1:b2ContactPoint):void{
}
override public function Remove(_arg1:b2ContactPoint):void{
}
override public function Persist(_arg1:b2ContactPoint):void{
}
override public function Result(_arg1:b2ContactResult):void{
var _local4:RedstarfallExplosive;
if (_arg1.normalImpulse > GameplaySettings.COLLISION_IMPULSE){
SoundManager.playSoundById("figures_collision");
};
var _local2:b2Body = _arg1.shape1.GetBody();
var _local3:Number = GameplaySettings.EXPLOSION_IMPULSE;
if (GameplaySettings.EXPLOSION_IMPULSE_DEPENDS_ON_MASS){
_local3 = (_local3 * _local2.GetMass());
};
if ((_local2.GetUserData() is RedstarfallExplosive)){
if (_arg1.normalImpulse > _local3){
_local4 = (_local2.GetUserData() as RedstarfallExplosive);
_local4.explode();
};
};
_local2 = _arg1.shape2.GetBody();
if (GameplaySettings.EXPLOSION_IMPULSE_DEPENDS_ON_MASS){
_local3 = (_local3 * _local2.GetMass());
};
if ((_local2.GetUserData() is RedstarfallExplosive)){
if (_arg1.normalImpulse > _local3){
_local4 = (_local2.GetUserData() as RedstarfallExplosive);
_local4.explode();
};
};
}
}
}//package ru.zedarus.games.redstarfall
Section 476
//GameplaySettings (ru.zedarus.games.redstarfall.GameplaySettings)
package ru.zedarus.games.redstarfall {
public class GameplaySettings {
public static var EXPLOSION_IMPULSE_DEPENDS_ON_MASS:Boolean;
public static var CLICK_DELAY:Number;
public static var FIGURE_ORDINARY_DENSITY:Number;
public static var FIGURE_ORDINARY_RESTITUTION:Number;
public static var EXPLOSION_IMPULSE:Number;
public static var AUTO_NEXT_LEVEL_DELAY:Number;
public static var COLLISION_IMPULSE:Number;
public static var EXPLOSION_POWER:Number;
public static var FIGURE_ORDINARY_FRICTION:Number;
public function GameplaySettings(){
CLICK_DELAY = 1.5;
AUTO_NEXT_LEVEL_DELAY = 6;
FIGURE_ORDINARY_DENSITY = 2;
FIGURE_ORDINARY_FRICTION = 0.2;
FIGURE_ORDINARY_RESTITUTION = 0;
COLLISION_IMPULSE = (3.5 * FIGURE_ORDINARY_DENSITY);
EXPLOSION_IMPULSE = 15;
EXPLOSION_IMPULSE_DEPENDS_ON_MASS = false;
EXPLOSION_POWER = 3;
}
}
}//package ru.zedarus.games.redstarfall
Section 477
//RedstarfallBackground (ru.zedarus.games.redstarfall.RedstarfallBackground)
package ru.zedarus.games.redstarfall {
import flash.display.*;
import flash.filters.*;
import ru.zedarus.games.zedengine.screens.*;
import ru.zedarus.games.redstarfall.objects.*;
public class RedstarfallBackground extends Background {
private var depths:Array;
public var clouds_space:Sprite;
private var clouds:Array;
public function RedstarfallBackground():void{
var _local1:Number;
var _local2:Cloud;
var _local3:BlurFilter;
clouds = new Array();
depths = [];
super();
this.clouds_space = new Sprite();
this.addChild(this.clouds_space);
_local1 = 0;
while (_local1 < 5) {
_local2 = new Cloud();
_local2.scaleX = (_local2.scaleY = (1 - (0.6 * Math.random())));
_local2.x = Math.floor((640 * Math.random()));
_local2.y = Math.floor(((_local2.height / 2) + ((380 - (_local2.height / 2)) * Math.random())));
_local2.gotoAndStop(Math.ceil((_local2.totalFrames * Math.random())));
_local3 = new BlurFilter((8 - (8 * _local2.scaleX)), (8 - (8 * _local2.scaleX)), BitmapFilterQuality.HIGH);
_local2.filters = new Array(_local3);
this.clouds.push(_local2);
this.clouds_space.addChild(_local2);
_local1++;
};
this.arrangeClouds();
}
private function arrangeClouds():void{
var _local1:Cloud;
this.clouds.sortOn(scaleX, (Array.DESCENDING | Array.NUMERIC));
for each (_local1 in this.clouds) {
this.clouds_space.setChildIndex(_local1, this.clouds.indexOf(_local1));
};
}
private function setDepth():Number{
var _local2:Cloud;
var _local1:Number = (1 - (0.6 * Math.random()));
for each (_local2 in this.clouds) {
if (_local2.scaleX == _local1){
_local1 = setDepth();
};
};
return (_local1);
}
override public function update():void{
var _local1:Cloud;
var _local3:BlurFilter;
var _local2 = 2;
var _local4:Number = 0;
for each (_local1 in this.clouds) {
if (_local1.x > ((640 + (_local1.width / 2)) + 50)){
_local1.gotoAndStop(Math.ceil((_local1.totalFrames * Math.random())));
_local1.scaleX = (_local1.scaleY = setDepth());
_local1.x = Math.floor(((-10 - (_local1.width / 2)) - 50));
_local1.y = Math.floor(((_local1.height / 2) + ((380 - (_local1.height / 2)) * Math.random())));
_local3 = new BlurFilter((8 - (4 * _local1.scaleX)), (8 - (4 * _local1.scaleX)), BitmapFilterQuality.LOW);
_local1.filters = new Array(_local3);
this.arrangeClouds();
};
_local4 = (_local2 * _local1.scaleX);
_local1.x = (_local1.x + _local4);
};
}
}
}//package ru.zedarus.games.redstarfall
Section 478
//RedstarfallEngine (ru.zedarus.games.redstarfall.RedstarfallEngine)
package ru.zedarus.games.redstarfall {
import com.kongregate.as3.client.*;
import ru.zedarus.games.zedengine.*;
public class RedstarfallEngine extends Engine {
public function RedstarfallEngine():void{
var _local1:KongregateAPI;
super();
if (Settings.USE_KONGREGATE_API){
_local1 = new KongregateAPI();
this.addChild(_local1);
};
}
override protected function showStateElements(_arg1:Number):void{
var _local2:RedstarfallBackground;
super.showStateElements(_arg1);
if (this.background){
_local2 = (this.background as RedstarfallBackground);
};
switch (_arg1){
case EngineState.AD:
break;
case EngineState.INTRO:
break;
case EngineState.SPONSOR_INTRO:
break;
case EngineState.MENU:
break;
case EngineState.GAME:
break;
case EngineState.BLOCKED:
break;
};
}
override protected function hideStateElements(_arg1:Number):void{
super.hideStateElements(_arg1);
}
}
}//package ru.zedarus.games.redstarfall
Section 479
//RedstarfallGame (ru.zedarus.games.redstarfall.RedstarfallGame)
package ru.zedarus.games.redstarfall {
import com.kongregate.as3.client.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.zedengine.game.*;
import ru.zedarus.games.redstarfall.levels.*;
public class RedstarfallGame extends Game {
public function RedstarfallGame():void{
var _local1:GameplaySettings = new GameplaySettings();
this.worlds_manager.addWorld(Level1);
this.worlds_manager.addWorld(Level3);
this.worlds_manager.addWorld(Level4);
this.worlds_manager.addWorld(Level2);
this.worlds_manager.addWorld(Level5);
this.worlds_manager.addWorld(Level11);
this.worlds_manager.addWorld(Level19);
this.worlds_manager.addWorld(Level7);
this.worlds_manager.addWorld(Level10);
this.worlds_manager.addWorld(Level8);
this.worlds_manager.addWorld(Level15);
this.worlds_manager.addWorld(Level17);
this.worlds_manager.addWorld(Level9);
this.worlds_manager.addWorld(Level14);
this.worlds_manager.addWorld(Level20);
this.worlds_manager.addWorld(Level13);
this.worlds_manager.addWorld(Level16);
this.worlds_manager.addWorld(Level12);
this.worlds_manager.addWorld(Level6);
this.worlds_manager.addWorld(Level18);
this.worlds_manager.addWorld(Level21);
}
override protected function actionsPlayerDead(_arg1:Number):void{
trace("player is dead");
}
override protected function updateHUD():void{
this.hud.updateValue("time_indicator", this.worlds_manager.getCurrentWorldPlayTime());
this.hud.updateValue("clicks_indicator", this.worlds_manager.getCurrentWorldClicks());
this.hud.updateValue("world_info", this.worlds_manager.getCurrentWorldId());
this.hud.updateValue("click_cooldown", this.worlds_manager.getCurrentWorldParam("click_cooldown"));
this.hud.updateValue("game_finished_window", {time:this.play_time, score:this.totalScores});
this.hud.updateValue("world_finished_window", {time:this.play_time, score:this.worlds_manager.getCurrentWorldScores(), world:this.worlds_manager.getCurrentWorldId()});
}
override protected function actionsWorldCompleted(_arg1:Number):void{
trace("level completed");
trace(("World scores: " + this.worlds_manager.getCurrentWorldScores()));
this.addToGameScore(_arg1, this.worlds_manager.getCurrentWorldScores());
this.worlds_manager.nextWorld();
}
override protected function actionsWorldOthers(_arg1:WorldEvent):void{
trace("other");
}
override protected function actionsWorldLost(_arg1:Number):void{
trace("level failed");
this.worlds_manager.startWorld(_arg1);
}
override protected function actionsAllWorldsComplete():void{
var _local1:KongregateAPI;
super.actionsAllWorldsComplete();
if (Settings.USE_KONGREGATE_API){
_local1 = KongregateAPI.getInstance();
_local1.scores.submit(this.totalScores);
_local1.stats.submit("Game_complete", this.totalScores);
if (this.totalScores > 7800){
_local1.stats.submit("Great_score", this.totalScores);
};
};
}
}
}//package ru.zedarus.games.redstarfall
Section 480
//RedstarfallHUD (ru.zedarus.games.redstarfall.RedstarfallHUD)
package ru.zedarus.games.redstarfall {
import ru.zedarus.games.zedengine.game.hud.*;
import ru.zedarus.games.redstarfall.hud.*;
public class RedstarfallHUD extends HUD {
public var click_cooldown:RedstarfallHUDCooldown;
public function RedstarfallHUD():void{
this.click_cooldown = new RedstarfallHUDCooldown();
this.addChild(this.click_cooldown);
}
}
}//package ru.zedarus.games.redstarfall
Section 481
//FpsCounter (ru.zedarus.games.zedengine.debug.FpsCounter)
package ru.zedarus.games.zedengine.debug {
import flash.display.*;
import flash.system.*;
import flash.text.*;
import flash.utils.*;
public class FpsCounter extends Sprite {
private var avgCount2:int;// = 30
private var oldT:uint;
private var mfpsCount:int;// = 0
public var textBox2:TextField;
public var textBox3:TextField;
private var avgCount:int;// = 30
public var textBox:TextField;
private var mfpsCount2:int;// = 0
public function FpsCounter(){
textBox.text = "...";
textBox.mouseEnabled = false;
textBox2.text = "...";
textBox2.mouseEnabled = false;
textBox2.visible = false;
textBox3.text = "...";
textBox3.mouseEnabled = false;
oldT = getTimer();
this.mouseEnabled = false;
}
public function update():void{
var _local1:uint = getTimer();
var _local2:uint = (_local1 - oldT);
mfpsCount = (mfpsCount + _local2);
if (avgCount < 1){
textBox.text = String((Math.round((1000 / (mfpsCount / 30))) + " fps"));
avgCount = 30;
mfpsCount = 0;
};
avgCount--;
oldT = getTimer();
textBox3.text = (Math.round((System.totalMemory / (0x0400 * 0x0400))) + " MB");
}
public function updateEnd():void{
}
public function updatePhys(_arg1:uint):void{
var _local2:uint = getTimer();
var _local3:uint = (_local2 - _arg1);
mfpsCount2 = (mfpsCount2 + _local3);
if (avgCount2 < 1){
textBox2.text = String((((("Physics step: " + Math.round((mfpsCount2 / 30))) + " ms (") + Math.round((1000 / (mfpsCount2 / 30)))) + " fps)"));
avgCount2 = 30;
mfpsCount2 = 0;
};
avgCount2--;
}
}
}//package ru.zedarus.games.zedengine.debug
Section 482
//HUDButton (ru.zedarus.games.zedengine.game.hud.elements.HUDButton)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class HUDButton extends HUDElement {
public var body:MovieClip;
public var icon:MovieClip;
public var tf:TextField;
public function HUDButton():void{
if (this.clickzone){
this.clickzone.addEventListener(MouseEvent.CLICK, this.click);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
this.clickzone.alpha = 0;
this.clickzone.useHandCursor = true;
this.clickzone.buttonMode = true;
};
}
override public function localize():void{
this.clickzone.width = 1;
super.localize();
this.clickzone.width = this.width;
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 483
//HUDClicksIndicator (ru.zedarus.games.zedengine.game.hud.elements.HUDClicksIndicator)
package ru.zedarus.games.zedengine.game.hud.elements {
public class HUDClicksIndicator extends HUDTextIndicator {
public function HUDClicksIndicator():void{
}
override protected function processValue(_arg1:Object):Object{
return (_arg1);
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 484
//HUDElement (ru.zedarus.games.zedengine.game.hud.elements.HUDElement)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class HUDElement extends VisualElement {
protected var content_text_field_ignore:Array;
protected var content_text_fields:Array;
protected var content_text_ids:Array;
public var clickzone:MovieClip;
public var unhiddable:Boolean;// = false
public function HUDElement():void{
content_text_fields = new Array();
content_text_ids = new Array();
content_text_field_ignore = new Array();
super();
this.parseTextFields();
}
protected function processValue(_arg1:Object):Object{
return (_arg1);
}
public function update(_arg1:Object):void{
}
public function localize():void{
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
}
public function blockMouseEvents():void{
if (this.clickzone){
this.clickzone.mouseEnabled = false;
};
}
public function unblockMouseEvents():void{
if (this.clickzone){
this.clickzone.mouseEnabled = true;
};
}
protected function parseTextFields():void{
var _local1:TextField;
this.content_text_fields = new Array();
this.content_text_ids = new Array();
var _local2:Number = 0;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is TextField)){
_local1 = (this.getChildAt(_local2) as TextField);
if (this.content_text_field_ignore.indexOf(_local1) == -1){
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
};
_local2++;
};
}
protected function ignoreTextField(_arg1:TextField):void{
this.content_text_field_ignore.push(_arg1);
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 485
//HUDGameFinishedWindow (ru.zedarus.games.zedengine.game.hud.elements.HUDGameFinishedWindow)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.display.*;
import ru.zedarus.games.zedengine.game.hud.*;
import flash.text.*;
import mochi.*;
import ru.zedarus.games.zedengine.screens.*;
import ru.zedarus.games.zedengine.services.*;
import ru.zedarus.games.zedengine.userinterface.windows.highscores.*;
import flash.net.*;
import com.gamezhero.api.as3.*;
public class HUDGameFinishedWindow extends HUDElement {
private var world_id:Number;
public var sponsor_logo:SponsorLogo;
private var timer_delay:Number;// = 7000
public var view_scors_button:HUDViewScoresButton;
private var time:Number;
private var show_time:Number;
public var player_fieldtext:TextField;
public var timer_textField:TextField;
private var count_timer:Boolean;// = true
public var scores_tf:TextField;
public var title:MovieClip;
private var scores:Number;
public var mochi_board:Sprite;
public var restart_game_button:HUDRestartGameButton;
public var post_scors_button:HUDPostScoresButton;
public var scores_points_tf:TextField;
private var score_board:Sprite;
private var gamezhero_scores:MovieClip;
public function HUDGameFinishedWindow(){
var _local1:HUDElement;
var _local3:TextField;
super();
if (this.timer_textField){
this.ignoreTextField(this.timer_textField);
};
if (this.player_fieldtext){
this.ignoreTextField(this.player_fieldtext);
};
this.parseTextFields();
if (this.player_fieldtext){
this.player_fieldtext.autoSize = "none";
};
if (this.title){
_local3 = this.title.tf;
_local3.wordWrap = _local3.multiline;
_local3.autoSize = _local3.getTextFormat().align;
this.content_text_ids.push(_local3.text);
this.content_text_fields.push(_local3);
};
if (this.restart_game_button){
this.restart_game_button.show();
this.restart_game_button.addEventListener(HUDEvent.RESTART_GAME_BUTTON_CLICKED, this.clickedRestartButton);
};
if (this.post_scors_button){
this.post_scors_button.show();
this.post_scors_button.addEventListener(HUDEvent.POST_SCORES_BUTTON_CLICKED, this.clickedPostButton);
};
if (this.view_scors_button){
this.view_scors_button.hide();
this.view_scors_button.addEventListener(HUDEvent.VIEW_SCORES_BUTTON_CLICKED, this.clickedViewButton);
};
var _local2:Number = 0;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is HUDElement)){
_local1 = (this.getChildAt(_local2) as HUDElement);
_local1.setStateToActive();
};
_local2++;
};
this.unhiddable = true;
}
private function showMochiBoard(_arg1:Number):void{
var _local2:Boolean;
if (this.mochi_board){
this.mochi_board.visible = true;
MochiScores.showLeaderboard({preloaderDisplay:_local2, boardID:Settings.LEADERBOARDS_IDS[0], score:this.scores, onClose:this.mochiClose, onDisplay:this.mochiShowed, onError:this.mochiError});
this.score_board = Services.mochiservice;
if (!this.mochi_board.contains(this.score_board)){
this.mochi_board.addChild(this.score_board);
};
};
}
private function clickedViewButton(_arg1:HUDEvent):void{
if (Settings.USE_ARMORSCORES){
navigateToURL(new URLRequest(Settings.ARMORSCORES_URL), "_blank");
} else {
if (Settings.BRANDING == Settings.GAMEZHERO){
GamezheroApi.linkTopScore();
};
};
}
private function mainMenuAction():void{
this.restart_game_button.click(null);
trace("YORE CODE AFTER MAIN MENU ACTION");
}
private function clickedPostButton(_arg1:HUDEvent):void{
var _local2:Object;
if (this.post_scors_button){
this.post_scors_button.blockMouseEvents();
this.post_scors_button.setStateToInactive();
this.post_scors_button.hide();
};
this.count_timer = false;
if (Settings.USE_ARMORSCORES){
Highscores.postArmorBotScores(this.player_fieldtext.text, this.scores);
} else {
if (Settings.BRANDING == Settings.GAMEZHERO){
_local2 = {border:{width:4, color:0xFFFFFF, alpha:100}, background:{topColor:0x999999, bottomColor:0x666666, topAlpha:100, bottomAlpha:100, cornerRadius:10}, language:"ENG"};
if (!this.gamezhero_scores){
this.gamezhero_scores = new MovieClip();
this.addChild(this.gamezhero_scores);
};
GamezheroApi.score(this, Settings.GAMEZHERO_CODE, this.scores, -150, -100, submitAction, mainMenuAction, errorAction, _local2);
};
};
if (this.view_scors_button){
this.view_scors_button.show();
};
}
private function mochiClose(... _args):void{
this.mochi_board.visible = false;
}
private function mochiShowed():void{
}
override public function localize():void{
super.localize();
if (this.restart_game_button){
this.restart_game_button.localize();
};
if (this.post_scors_button){
this.post_scors_button.localize();
};
if (this.view_scors_button){
this.view_scors_button.localize();
};
}
private function errorAction():void{
trace("YORE CODE AFTER ERROR ACTION");
}
private function submitAction():void{
trace("YORE CODE AFTER SUBMIT ACTION");
}
private function mochiError():void{
}
override public function update(_arg1:Object):void{
this.time = Number(_arg1.time);
this.scores = Number(_arg1.score);
this.scores_tf.htmlText = (("<b>" + String(this.scores)) + "</b>");
this.scores_points_tf.x = ((this.scores_tf.width / 2) + 3);
}
private function clickedRestartButton(_arg1:HUDEvent):void{
if (this.restart_game_button){
this.restart_game_button.blockMouseEvents();
};
if (this.post_scors_button){
this.post_scors_button.blockMouseEvents();
};
this.hide();
}
override public function show():void{
super.show();
if (this.mochi_board){
this.mochi_board.visible = false;
};
this.count_timer = true;
this.show_time = this.time;
if (this.restart_game_button){
this.restart_game_button.unblockMouseEvents();
};
if (this.post_scors_button){
this.post_scors_button.unblockMouseEvents();
this.post_scors_button.setStateToActive();
};
if (this.post_scors_button){
this.post_scors_button.show();
};
if (this.view_scors_button){
this.view_scors_button.hide();
};
if (Number(this.world_id) == 1){
if (this.post_scors_button){
this.post_scors_button.hide();
};
} else {
if (this.post_scors_button){
this.post_scors_button.show();
};
};
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 486
//HUDMenuButton (ru.zedarus.games.zedengine.game.hud.elements.HUDMenuButton)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.events.*;
import ru.zedarus.games.zedengine.game.hud.*;
public class HUDMenuButton extends HUDButton {
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
this.dispatchEvent(new HUDEvent(HUDEvent.MENU_BUTTON_CLICKED));
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 487
//HUDNextLevelButton (ru.zedarus.games.zedengine.game.hud.elements.HUDNextLevelButton)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.events.*;
import ru.zedarus.games.zedengine.game.hud.*;
public class HUDNextLevelButton extends HUDButton {
public function HUDNextLevelButton():void{
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
this.dispatchEvent(new HUDEvent(HUDEvent.NEXT_LEVEL_BUTTON_CLICKED));
}
override public function localize():void{
this.clickzone.width = 1;
if (this.body){
this.body.visible = false;
};
super.localize();
if (this.body){
this.body.roll.width = this.tf.width;
if (this.body.roll.width < 138){
this.body.roll.width = 138;
};
this.body.corner.x = (this.body.roll.x + this.body.roll.width);
this.body.x = ((-(this.body.width) / 2) + 1);
this.body.visible = true;
};
this.clickzone.width = this.body.width;
this.clickzone.x = (-(this.clickzone.width) / 2);
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 488
//HUDPostScoresButton (ru.zedarus.games.zedengine.game.hud.elements.HUDPostScoresButton)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.events.*;
import ru.zedarus.games.zedengine.game.hud.*;
public class HUDPostScoresButton extends HUDButton {
public function HUDPostScoresButton():void{
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
this.dispatchEvent(new HUDEvent(HUDEvent.POST_SCORES_BUTTON_CLICKED));
}
override public function localize():void{
this.clickzone.width = 1;
if (this.body){
this.body.visible = false;
};
super.localize();
if (this.body){
this.body.roll.width = this.tf.width;
if (this.body.roll.width < 138){
this.body.roll.width = 138;
};
this.body.corner.x = (this.body.roll.x + this.body.roll.width);
this.body.x = ((-(this.body.width) / 2) + 1);
this.body.visible = true;
};
this.clickzone.width = this.body.width;
this.clickzone.x = (-(this.clickzone.width) / 2);
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 489
//HUDRepeatButton (ru.zedarus.games.zedengine.game.hud.elements.HUDRepeatButton)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.events.*;
import ru.zedarus.games.zedengine.game.hud.*;
public class HUDRepeatButton extends HUDButton {
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
this.dispatchEvent(new HUDEvent(HUDEvent.RESTART_BUTTON_CLICKED));
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 490
//HUDRestartGameButton (ru.zedarus.games.zedengine.game.hud.elements.HUDRestartGameButton)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.events.*;
import ru.zedarus.games.zedengine.game.hud.*;
public class HUDRestartGameButton extends HUDButton {
public function HUDRestartGameButton():void{
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
this.dispatchEvent(new HUDEvent(HUDEvent.RESTART_GAME_BUTTON_CLICKED));
}
override public function localize():void{
this.clickzone.width = 1;
if (this.body){
this.body.visible = false;
};
super.localize();
if (this.body){
this.body.roll.width = this.tf.width;
if (this.body.roll.width < 138){
this.body.roll.width = 138;
};
this.body.corner.x = (this.body.roll.x + this.body.roll.width);
this.body.x = ((-(this.body.width) / 2) + 1);
this.body.visible = true;
};
this.clickzone.width = this.body.width;
this.clickzone.x = (-(this.clickzone.width) / 2);
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 491
//HUDTextIndicator (ru.zedarus.games.zedengine.game.hud.elements.HUDTextIndicator)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.text.*;
public class HUDTextIndicator extends HUDElement {
public var valueTF:TextField;
public function HUDTextIndicator():void{
if (this.valueTF){
this.ignoreTextField(this.valueTF);
};
this.parseTextFields();
}
override public function update(_arg1:Object):void{
if (this.valueTF){
this.valueTF.text = String(this.processValue(_arg1));
};
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 492
//HUDTimeIndicator (ru.zedarus.games.zedengine.game.hud.elements.HUDTimeIndicator)
package ru.zedarus.games.zedengine.game.hud.elements {
public class HUDTimeIndicator extends HUDTextIndicator {
public function HUDTimeIndicator():void{
}
override protected function processValue(_arg1:Object):Object{
var _local4:String;
var _local5:String;
var _local2:Number = Number(_arg1);
var _local3:Date = new Date(_local2);
if (_local3.getMinutes() < 10){
_local4 = ("0" + _local3.getMinutes());
} else {
_local4 = String(_local3.getMinutes());
};
if (_local3.getSeconds() < 10){
_local5 = ("0" + _local3.getSeconds());
} else {
_local5 = String(_local3.getSeconds());
};
var _local6:String = ((_local4 + ":") + _local5);
return (_local6);
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 493
//HUDViewScoresButton (ru.zedarus.games.zedengine.game.hud.elements.HUDViewScoresButton)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.events.*;
import ru.zedarus.games.zedengine.game.hud.*;
public class HUDViewScoresButton extends HUDButton {
public function HUDViewScoresButton():void{
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
this.dispatchEvent(new HUDEvent(HUDEvent.VIEW_SCORES_BUTTON_CLICKED));
}
override public function localize():void{
this.clickzone.width = 1;
if (this.body){
this.body.visible = false;
};
super.localize();
if (this.body){
this.body.roll.width = this.tf.width;
if (this.body.roll.width < 138){
this.body.roll.width = 138;
};
this.body.corner.x = (this.body.roll.x + this.body.roll.width);
this.body.x = ((-(this.body.width) / 2) + 1);
this.body.visible = true;
};
this.clickzone.width = this.body.width;
this.clickzone.x = (-(this.clickzone.width) / 2);
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 494
//HUDWorldFinishedWindow (ru.zedarus.games.zedengine.game.hud.elements.HUDWorldFinishedWindow)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.display.*;
import ru.zedarus.games.zedengine.game.hud.*;
import flash.text.*;
import ru.zedarus.games.zedengine.screens.*;
public class HUDWorldFinishedWindow extends HUDElement {
public var sponsor_logo:SponsorLogo;
private var timer_delay:Number;// = 7000
private var time:Number;
private var show_time:Number;
public var scores_tf:TextField;
public var timer_textField:TextField;
private var count_timer:Boolean;// = true
public var title:MovieClip;
public var next_level_button:HUDNextLevelButton;
private var scores:Number;
private var world_id:Number;
public var mochi_board:Sprite;
public var post_scors_button:HUDPostScoresButton;
public var scores_points_tf:TextField;
private var score_board:Sprite;
public function HUDWorldFinishedWindow(){
var _local1:HUDElement;
var _local3:TextField;
super();
if (this.timer_textField){
this.ignoreTextField(this.timer_textField);
};
this.parseTextFields();
if (this.title){
_local3 = this.title.tf;
_local3.wordWrap = _local3.multiline;
_local3.autoSize = _local3.getTextFormat().align;
this.content_text_ids.push(_local3.text);
this.content_text_fields.push(_local3);
};
if (this.next_level_button){
this.next_level_button.show();
this.next_level_button.addEventListener(HUDEvent.NEXT_LEVEL_BUTTON_CLICKED, this.clickedNextButton);
};
if (this.post_scors_button){
this.post_scors_button.show();
this.post_scors_button.addEventListener(HUDEvent.POST_SCORES_BUTTON_CLICKED, this.clickedPostButton);
};
var _local2:Number = 0;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is HUDElement)){
_local1 = (this.getChildAt(_local2) as HUDElement);
_local1.setStateToActive();
};
_local2++;
};
this.unhiddable = true;
}
private function clickedPostButton(_arg1:HUDEvent):void{
if (this.post_scors_button){
this.post_scors_button.blockMouseEvents();
this.post_scors_button.setStateToInactive();
};
this.count_timer = false;
this.showMochiBoard(this.world_id);
}
private function showMochiBoard(_arg1:Number):void{
}
private function clickedNextButton(_arg1:HUDEvent):void{
if (this.next_level_button){
this.next_level_button.blockMouseEvents();
};
if (this.post_scors_button){
this.post_scors_button.blockMouseEvents();
};
this.hide();
}
private function mochiClose(... _args):void{
this.mochi_board.visible = false;
}
override public function update(_arg1:Object):void{
this.time = Number(_arg1.time);
this.scores = Number(_arg1.score);
this.world_id = Number(_arg1.world);
this.scores_tf.htmlText = (("<b>" + String(this.scores)) + "</b>");
this.scores_points_tf.x = ((this.scores_tf.width / 2) + 3);
}
private function mochiError():void{
}
override public function localize():void{
super.localize();
if (this.next_level_button){
this.next_level_button.localize();
};
if (this.post_scors_button){
this.post_scors_button.localize();
};
}
override public function show():void{
super.show();
this.count_timer = true;
this.show_time = this.time;
if (this.next_level_button){
this.next_level_button.unblockMouseEvents();
};
if (this.post_scors_button){
this.post_scors_button.unblockMouseEvents();
this.post_scors_button.setStateToActive();
};
if (Number(this.world_id) == 1){
if (this.post_scors_button){
this.post_scors_button.hide();
};
} else {
if (this.post_scors_button){
this.post_scors_button.show();
};
};
}
private function mochiShowed():void{
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 495
//HUDWorldInfo (ru.zedarus.games.zedengine.game.hud.elements.HUDWorldInfo)
package ru.zedarus.games.zedengine.game.hud.elements {
import flash.text.*;
import ru.zedarus.games.zedengine.localization.*;
public class HUDWorldInfo extends HUDElement {
public var current_level_code_title:TextField;
private var world_id:Number;
public var current_level_name:TextField;
public var current_level_code:TextField;
private var code_space:Number;
public function HUDWorldInfo(){
this.code_space = 2;
if (this.current_level_name){
this.ignoreTextField(this.current_level_name);
};
if (this.current_level_code){
this.ignoreTextField(this.current_level_code);
};
this.parseTextFields();
}
override public function localize():void{
super.localize();
if (this.current_level_name){
this.current_level_name.htmlText = Localization.getWord(("levelselect_leveltitle_" + this.world_id));
};
if (this.current_level_code){
if (Settings.LEVELCODE[this.world_id]){
this.current_level_code.htmlText = (("\"" + Settings.LEVELCODE[this.world_id]) + "\"");
} else {
this.current_level_code.htmlText = Localization.getWord("hud_no_level_code");
};
};
this.current_level_code.x = ((this.current_level_code_title.x + this.current_level_code_title.width) + this.code_space);
}
override public function update(_arg1:Object):void{
this.world_id = Number(_arg1);
this.localize();
}
}
}//package ru.zedarus.games.zedengine.game.hud.elements
Section 496
//HUD (ru.zedarus.games.zedengine.game.hud.HUD)
package ru.zedarus.games.zedengine.game.hud {
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.screens.*;
import ru.zedarus.games.zedengine.game.hud.elements.*;
public class HUD extends VisualElement {
public var world_info:HUDWorldInfo;
public var walkt:Walkthrough;
public var game_finished_window:HUDGameFinishedWindow;
public var menu_button:HUDMenuButton;
public var time_indicator:HUDTimeIndicator;
public var repeat_button:HUDRepeatButton;
public var world_finished_window:HUDWorldFinishedWindow;
public var sponsor_logo:SponsorLogoSmall;
public var clicks_indicator:HUDClicksIndicator;
public function HUD():void{
var _local1:HUDElement;
super();
if (this.world_finished_window){
this.world_finished_window.hide();
};
if (this.game_finished_window){
this.game_finished_window.hide();
};
var _local2:Number = 0;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is HUDElement)){
_local1 = (this.getChildAt(_local2) as HUDElement);
_local1.setStateToActive();
};
_local2++;
};
}
protected function translateEvent(_arg1:HUDEvent):void{
this.dispatchEvent(new HUDEvent(_arg1.type));
}
public function localize():void{
var _local1:HUDElement;
var _local2:Number = 0;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is HUDElement)){
_local1 = (this.getChildAt(_local2) as HUDElement);
_local1.localize();
};
_local2++;
};
}
override public function show():void{
var _local1:HUDElement;
super.show();
var _local2:Number = 0;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is HUDElement)){
_local1 = (this.getChildAt(_local2) as HUDElement);
if (!_local1.unhiddable){
_local1.show();
_local1.unblockMouseEvents();
};
};
_local2++;
};
}
override public function hide():void{
var _local1:HUDElement;
var _local2:Number = 0;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is HUDElement)){
_local1 = (this.getChildAt(_local2) as HUDElement);
if (!_local1.unhiddable){
_local1.hide();
_local1.blockMouseEvents();
};
};
_local2++;
};
super.hide();
}
public function showGameFinishWindow():void{
if (this.game_finished_window){
this.game_finished_window.show();
};
}
public function hideGameFinishWindow():void{
if (this.game_finished_window){
this.game_finished_window.hide();
};
}
public function showWorldFinishWindow():void{
if (this.world_finished_window){
this.world_finished_window.show();
};
}
private function hello(_arg1:HUDEvent):void{
}
public function updateValue(_arg1:String, _arg2:Object):void{
if (this[_arg1]){
this[_arg1].update(_arg2);
};
}
public function hideWorldFinishWindow():void{
if (this.world_finished_window){
this.world_finished_window.hide();
};
}
}
}//package ru.zedarus.games.zedengine.game.hud
Section 497
//HUDEvent (ru.zedarus.games.zedengine.game.hud.HUDEvent)
package ru.zedarus.games.zedengine.game.hud {
import flash.events.*;
public class HUDEvent extends Event {
public static const NEXT_LEVEL_BUTTON_CLICKED:String = "NEXT_LEVEL_BUTTON_CLICKED";
public static const VIEW_SCORES_BUTTON_CLICKED:String = "VIEW_SCORES_BUTTON_CLICKED";
public static const RESTART_BUTTON_CLICKED:String = "RESTART_BUTTON_CLICKED";
public static const SHOW_LEVEL_SELECTION:String = "SHOW_LEVEL_SELECTION";
public static const RESTART_GAME_BUTTON_CLICKED:String = "RESTART_GAME_BUTTON_CLICKED";
public static const POST_SCORES_BUTTON_CLICKED:String = "POST_SCORES_BUTTON_CLICKED";
public static const MENU_BUTTON_CLICKED:String = "MENU_BUTTON_CLICKED";
public function HUDEvent(_arg1:String):void{
super(_arg1, true);
}
}
}//package ru.zedarus.games.zedengine.game.hud
Section 498
//SaveGameData (ru.zedarus.games.zedengine.game.savegame.SaveGameData)
package ru.zedarus.games.zedengine.game.savegame {
public class SaveGameData {
public var id:Number;
public var date:String;
public function SaveGameData():void{
}
}
}//package ru.zedarus.games.zedengine.game.savegame
Section 499
//WorldsManager (ru.zedarus.games.zedengine.game.worlds.manager.WorldsManager)
package ru.zedarus.games.zedengine.game.worlds.manager {
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.game.*;
public class WorldsManager extends VisualElement {
protected var worlds_classes:Array;
protected var current_world:World;
protected var state:int;
protected var worlds:Array;
protected var worlds_completed:Array;
protected var current_world_id:Number;
protected var play_time:Number;
public function WorldsManager(_arg1:Array=null):void{
worlds_classes = new Array();
worlds_completed = new Array();
worlds = new Array();
super();
if (_arg1){
this.worlds_classes = _arg1;
} else {
this.worlds_classes = new Array();
};
}
public function restartWorld():void{
this.startWorld(this.current_world_id);
}
public function updateTime(_arg1:Number):void{
this.play_time = _arg1;
}
public function getCurrentWorldScores():Number{
return (this.current_world.getScores());
}
public function getCurrentWorldId():Number{
return (this.current_world_id);
}
protected function showWorld():void{
var _local1:Class = (this.worlds_classes[(this.current_world_id - 1)] as Class);
this.current_world = this.createWorld(_local1, this.current_world_id);
this.current_world.start(this.play_time);
this.current_world.show();
this.dispatchEvent(new WorldEvent(WorldEvent.WORLD_SHOW, this.current_world_id));
this.dispatchEvent(new WorldEvent(WorldEvent.UNBLOCK_LEVEL, this.current_world_id));
}
public function startWorld(_arg1:Number):void{
if (this.current_world){
this.hideCurrentWorldAndShowWorld(_arg1);
} else {
this.current_world_id = _arg1;
this.showWorld();
};
}
protected function hideCurrentWorldAndShowWorld(_arg1:Number):void{
this.dispatchEvent(new WorldEvent(WorldEvent.WORLD_HIDE, this.current_world_id));
this.current_world.addEventListener(VisualElementEvent.HIDDEN, this.worldHidden);
this.current_world_id = _arg1;
this.current_world.hide();
if (Settings.CHANGE_WORLDS_INSTANTLY){
this.worldHidden(null);
};
}
protected function worldHidden(_arg1:VisualElementEvent):void{
var _local2:World;
if (_arg1){
if (_arg1.target){
_local2 = (_arg1.target as World);
if (this.contains(_local2)){
this.removeChild(_local2);
};
if (this.worlds.indexOf(_arg1.target) != -1){
this.worlds.splice(this.worlds.indexOf(_arg1.target), 1);
};
};
if (!Settings.CHANGE_WORLDS_INSTANTLY){
this.showWorld();
};
} else {
if (Settings.CHANGE_WORLDS_INSTANTLY){
this.showWorld();
};
};
}
public function nextWorld():void{
if (!this.checkCompletedWorlds()){
if (this.current_world_id >= worlds_classes.length){
this.startWorld(this.getFirstUncompletedWorldId());
} else {
this.startWorld(++this.current_world_id);
};
} else {
this.dispatchEvent(new WorldsManagerEvent(WorldsManagerEvent.ALL_WORLDS_COMPLETE));
};
}
protected function checkCompletedWorlds():Boolean{
var _local1:Number;
var _local2:Array = new Array();
for each (_local1 in this.worlds_completed) {
if (_local2.indexOf(_local1) == -1){
_local2.push(_local1);
};
};
if ((((_local2.length == (worlds_classes.length - 1))) && ((this.worlds_completed.indexOf(1) == -1)))){
return (true);
};
if (_local2.length == worlds_classes.length){
return (true);
};
return (false);
}
public function cycle():void{
if (this.current_world){
this.current_world.cycle(this.play_time);
};
}
public function getCurrentWorldPlayTime():Number{
return (this.current_world.getPlayingTimer());
}
public function getCurrentWorldClicks():Number{
return (this.current_world.getClicksCounter());
}
protected function translateEvent(_arg1:WorldEvent):void{
switch (_arg1.type){
case WorldEvent.WORLD_COMPLETED:
this.worlds_completed.push(_arg1.world_id);
GameSessionData.COMPLETED_LEVELS.push(_arg1.world_id);
this.dispatchEvent(new WorldEvent(_arg1.type, _arg1.world_id));
break;
default:
this.dispatchEvent(new WorldEvent(_arg1.type, _arg1.world_id));
break;
};
}
public function addWorld(_arg1:Class):Boolean{
var _local2:Class;
for each (_local2 in this.worlds_classes) {
if (_local2 == _arg1){
return (false);
};
};
this.worlds_classes.push(_arg1);
return (true);
}
public function completeCurrentWorld():void{
this.current_world.complete();
}
private function getFirstUncompletedWorldId():Number{
var _local2:Number;
var _local1:Number = 9999;
var _local3:Array = new Array();
var _local4:int = worlds_classes.length;
while (_local4 > 1) {
if (GameSessionData.COMPLETED_LEVELS.indexOf(_local4) == -1){
_local3.push(_local4);
};
_local4--;
};
for each (_local2 in _local3) {
if (_local2 < _local1){
_local1 = _local2;
};
};
return (_local1);
}
public function copyWorlds():Array{
return (this.worlds_classes);
}
public function createWorld(_arg1:Class, _arg2:Number):World{
var _local4:World;
var _local3:World = new _arg1(_arg2);
for each (_local4 in this.worlds) {
if (_local4 == _local3){
return (null);
};
};
_local3.addEventListener(WorldEvent.PLAYER_DEAD, this.translateEvent);
_local3.addEventListener(WorldEvent.WORLD_LOST, this.translateEvent);
_local3.addEventListener(WorldEvent.WORLD_COMPLETED, this.translateEvent);
_local3.addEventListener(WorldEvent.WORLD_CLICK, this.translateEvent);
_local3.addEventListener(WorldEvent.SHOW_FINISH_WINDOW, this.translateEvent);
this.addChild(_local3);
this.worlds.push(_local3);
return (_local3);
}
public function getCurrentWorldParam(_arg1:String):Object{
return (this.current_world.getParam(_arg1));
}
}
}//package ru.zedarus.games.zedengine.game.worlds.manager
Section 500
//WorldsManagerEvent (ru.zedarus.games.zedengine.game.worlds.manager.WorldsManagerEvent)
package ru.zedarus.games.zedengine.game.worlds.manager {
import flash.events.*;
public class WorldsManagerEvent extends Event {
public static const ALL_WORLDS_COMPLETE:String = "ALL_WORLDS_COMPLETE";
public function WorldsManagerEvent(_arg1:String):void{
super(_arg1);
}
}
}//package ru.zedarus.games.zedengine.game.worlds.manager
Section 501
//World (ru.zedarus.games.zedengine.game.worlds.world.World)
package ru.zedarus.games.zedengine.game.worlds.world {
import ru.zedarus.games.zedengine.visualelements.*;
public class World extends VisualElement {
protected var start_time:Number;
protected var state:int;
protected var worldHints:WorldHintsManager;
protected var id:Number;
protected var global_play_time:Number;
protected var scores:Number;
protected var clicks_counter:Number;
protected var playing_time:Number;
public function World(_arg1:Number):void{
this.id = _arg1;
this.state = WorldState.IDLE;
this.worldHints = new WorldHintsManager();
this.worldHints.show();
this.addChild(this.worldHints);
}
protected function switchToWinState():void{
}
protected function hideStateElements(_arg1:Number):void{
switch (_arg1){
case WorldState.IDLE:
break;
case WorldState.PLAY:
break;
case WorldState.LOSE:
break;
case WorldState.WIN:
break;
default:
break;
};
}
public function getScores():Number{
return (this.scores);
}
protected function actionsPlay():void{
}
public function getParam(_arg1:String):Object{
return (null);
}
protected function actionsWin():void{
}
protected function changeStateTo(_arg1:int):Boolean{
if (this.state != _arg1){
this.hideStateElements(this.state);
this.state = _arg1;
this.showStateElements(_arg1);
return (true);
};
return (false);
}
protected function actionsStart():void{
}
public function cycle(_arg1:Number):void{
switch (this.state){
case WorldState.IDLE:
this.actionsIdle();
break;
case WorldState.PLAY:
this.calculatePlayTime(_arg1);
this.actionsPlay();
break;
case WorldState.LOSE:
this.actionsLose();
break;
case WorldState.WIN:
this.actionsWin();
break;
default:
break;
};
this.worldHints.localize();
this.actionsPermanent();
}
protected function calculatePlayTime(_arg1:Number):void{
this.playing_time = (_arg1 - this.start_time);
this.worldHints.updateTime(this.playing_time);
}
public function start(_arg1:Number):void{
this.start_time = _arg1;
this.actionsStart();
this.changeStateTo(WorldState.PLAY);
}
public function getClicksCounter():Number{
return (this.clicks_counter);
}
protected function showStateElements(_arg1:Number):void{
switch (_arg1){
case WorldState.IDLE:
break;
case WorldState.PLAY:
this.clicks_counter = 0;
this.scores = 0;
break;
case WorldState.LOSE:
break;
case WorldState.WIN:
this.switchToWinState();
this.dispatchEvent(new WorldEvent(WorldEvent.SHOW_FINISH_WINDOW, this.id));
break;
default:
break;
};
}
public function getPlayingTimer():Number{
return (this.playing_time);
}
protected function actionsIdle():void{
}
protected function actionsLose():void{
}
protected function actionsPermanent():void{
}
public function complete():void{
this.dispatchEvent(new WorldEvent(WorldEvent.WORLD_COMPLETED, this.id));
}
}
}//package ru.zedarus.games.zedengine.game.worlds.world
Section 502
//WorldEvent (ru.zedarus.games.zedengine.game.worlds.world.WorldEvent)
package ru.zedarus.games.zedengine.game.worlds.world {
import flash.events.*;
public class WorldEvent extends Event {
public var world_id:Number;
public static const SHOW_FINISH_WINDOW:String = "SHOW_FINISH_WINDOW";
public static const PLAYER_DEAD:String = "PLAYER_DEAD";
public static const WORLD_SHOW:String = "WORLD_SHOW";
public static const WORLD_HIDE:String = "WORLD_HIDE";
public static const WORLD_LOST:String = "WORLD_LOST";
public static const UNBLOCK_LEVEL:String = "UNBLOCK_LEVEL";
public static const WORLD_CLICK:String = "WORLD_CLICK";
public static const WORLD_COMPLETED:String = "WORLD_COMPLETED";
public function WorldEvent(_arg1:String, _arg2:Number):void{
super(_arg1);
this.world_id = _arg2;
}
}
}//package ru.zedarus.games.zedengine.game.worlds.world
Section 503
//WorldHint (ru.zedarus.games.zedengine.game.worlds.world.WorldHint)
package ru.zedarus.games.zedengine.game.worlds.world {
import flash.display.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class WorldHint extends VisualElement {
protected var showTime:Number;
protected var text_id:String;
protected var startTime:Number;
protected var delayTime:Number;
protected var shown:Boolean;// = false
public var title:MovieClip;
protected var destroyed:Boolean;// = false
protected var id:Number;
public function WorldHint(_arg1:Number, _arg2:Number=1, _arg3:Number=0):void{
if (this.title){
if (this.title.tf){
this.text_id = this.title.tf.text;
this.showTime = _arg2;
this.delayTime = _arg3;
this.title.tf.wordWrap = this.title.tf.multiline;
this.title.tf.autoSize = this.title.tf.getTextFormat().align;
};
};
}
private function destroyHint():void{
this.destroyed = true;
this.hide();
}
public function start(_arg1:Number):void{
if (_arg1){
this.startTime = _arg1;
} else {
this.startTime = 0;
};
}
public function localize():void{
if (this.title){
if (this.title.tf){
this.title.tf.htmlText = Localization.getWord(this.text_id);
};
};
}
public function updateTime(_arg1:Number):void{
if (!this.destroyed){
if (((((_arg1 - this.startTime) > (this.delayTime * 1000))) && (!(this.shown)))){
this.show();
this.shown = true;
};
if ((_arg1 - (this.startTime + (this.delayTime * 1000))) > (this.showTime * 1000)){
this.destroyHint();
};
};
}
}
}//package ru.zedarus.games.zedengine.game.worlds.world
Section 504
//WorldHintsManager (ru.zedarus.games.zedengine.game.worlds.world.WorldHintsManager)
package ru.zedarus.games.zedengine.game.worlds.world {
import ru.zedarus.games.zedengine.visualelements.*;
public class WorldHintsManager extends VisualElement {
protected var hints:Array;
protected var time:Number;
public function WorldHintsManager():void{
hints = new Array();
super();
}
public function showHint(_arg1:WorldHint):void{
_arg1.start(this.time);
this.hints.push(_arg1);
this.addChild(_arg1);
}
public function updateTime(_arg1:Number):void{
var _local2:WorldHint;
for each (_local2 in this.hints) {
_local2.updateTime(_arg1);
};
this.time = _arg1;
}
public function localize():void{
var _local1:WorldHint;
for each (_local1 in this.hints) {
_local1.localize();
};
}
}
}//package ru.zedarus.games.zedengine.game.worlds.world
Section 505
//WorldState (ru.zedarus.games.zedengine.game.worlds.world.WorldState)
package ru.zedarus.games.zedengine.game.worlds.world {
public class WorldState {
public static const PLAY:int = 2;
public static const LOSE:int = 3;
public static const IDLE:int = 1;
public static const WIN:int = 4;
}
}//package ru.zedarus.games.zedengine.game.worlds.world
Section 506
//Game (ru.zedarus.games.zedengine.game.Game)
package ru.zedarus.games.zedengine.game {
import flash.events.*;
import flash.display.*;
import ru.zedarus.games.zedengine.game.hud.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.zedengine.game.worlds.manager.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.input.*;
public class Game extends VisualElement {
protected var totalScores:Number;
protected var worlds_manager:WorldsManager;
protected var state:int;
protected var worldsScores:Object;
protected var game_started:Boolean;// = false
protected var hud:HUD;
protected var play_time:Number;
public function Game():void{
this.state = GameState.NOT_STARTED;
this.hud = new Settings.HUD_CLASS();
this.hud.addEventListener(HUDEvent.RESTART_BUTTON_CLICKED, this.restartCurrentWorld);
this.hud.addEventListener(HUDEvent.MENU_BUTTON_CLICKED, this.backToMenu);
this.hud.addEventListener(HUDEvent.NEXT_LEVEL_BUTTON_CLICKED, this.completeCurrentWorld);
this.hud.addEventListener(HUDEvent.RESTART_GAME_BUTTON_CLICKED, this.finishGame);
this.addChild(this.hud);
this.initWorldsManager();
}
private function backToMenu(_arg1:HUDEvent):void{
this.dispatchEvent(new HUDEvent(_arg1.type));
}
protected function actionsPlayerDead(_arg1:Number):void{
}
private function hideStateElements(_arg1:Number):void{
switch (_arg1){
case GameState.NOT_STARTED:
break;
case GameState.PLAY:
break;
case GameState.PAUSE:
break;
case GameState.LOSE:
break;
case GameState.WIN:
break;
default:
break;
};
}
protected function restartCurrentWorld(_arg1:HUDEvent):void{
this.worlds_manager.restartWorld();
this.hud.hideWorldFinishWindow();
}
public function localize():void{
if (this.hud){
this.hud.localize();
};
}
private function unblockLevel(_arg1:WorldEvent):void{
this.dispatchEvent(new WorldEvent(_arg1.type, _arg1.world_id));
}
protected function destroy():void{
this.initWorldsManager();
this.game_started = false;
}
protected function hideHUD(_arg1:Event):void{
if (Settings.CHANGE_WORLDS_INSTANTLY){
if (((this.hud.isInTransation()) && (!(this.isVisible())))){
this.hud.addEventListener(VisualElementEvent.VISIBLE, this.hideHUD);
} else {
this.hud.hide();
};
} else {
this.hud.hide();
};
}
public function startWorld(_arg1:Number):void{
if (this.game_started){
this.worlds_manager.startWorld(_arg1);
this.hud.hideGameFinishWindow();
this.hud.hideWorldFinishWindow();
} else {
this.start(_arg1);
};
}
protected function actionsWorldOthers(_arg1:WorldEvent):void{
}
protected function actionsWorldLost(_arg1:Number):void{
this.worlds_manager.startWorld(_arg1);
}
public function getState():int{
return (this.state);
}
protected function initWorldsManager():void{
var _local1:Array;
if (((this.worlds_manager) && (this.contains(this.worlds_manager)))){
_local1 = this.worlds_manager.copyWorlds();
this.removeChild(this.worlds_manager);
};
this.worlds_manager = new WorldsManager(_local1);
this.worlds_manager.addEventListener(WorldEvent.UNBLOCK_LEVEL, this.unblockLevel);
this.worlds_manager.addEventListener(WorldEvent.WORLD_LOST, this.worldEventParser);
this.worlds_manager.addEventListener(WorldEvent.WORLD_COMPLETED, this.worldEventParser);
this.worlds_manager.addEventListener(WorldEvent.WORLD_CLICK, this.worldEventParser);
this.worlds_manager.addEventListener(WorldEvent.WORLD_SHOW, this.showHUD);
this.worlds_manager.addEventListener(WorldEvent.WORLD_HIDE, this.hideHUD);
this.worlds_manager.addEventListener(WorldEvent.SHOW_FINISH_WINDOW, this.showWorldFinishWindow);
this.worlds_manager.addEventListener(WorldsManagerEvent.ALL_WORLDS_COMPLETE, this.worldManagerEventParser);
this.worlds_manager.show();
this.addChild(this.worlds_manager);
}
protected function showWorldFinishWindow(_arg1:WorldEvent):void{
this.hud.showWorldFinishWindow();
}
protected function changeStateTo(_arg1:int):Boolean{
if (this.state != _arg1){
this.hideStateElements(this.state);
this.state = _arg1;
this.showStateElements(_arg1);
return (true);
};
return (false);
}
protected function addToGameScore(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:String;
if (_arg1 > 1){
this.worldsScores[String(_arg1)] = _arg2;
_local3 = 0;
for (_local4 in this.worldsScores) {
_local3 = (_local3 + this.worldsScores[_local4]);
};
this.totalScores = _local3;
};
}
protected function worldManagerEventParser(_arg1:WorldsManagerEvent):void{
switch (_arg1.type){
case WorldsManagerEvent.ALL_WORLDS_COMPLETE:
this.actionsAllWorldsComplete();
break;
};
}
public function cycle(_arg1:Sprite):void{
switch (this.state){
case GameState.NOT_STARTED:
break;
case GameState.PLAY:
if (Input.isKeyPressed(27)){
this.dispatchEvent(new HUDEvent(HUDEvent.MENU_BUTTON_CLICKED));
};
this.worlds_manager.cycle();
if (stage){
stage.focus = _arg1;
};
break;
case GameState.PAUSE:
if (Input.isKeyPressed(27)){
this.dispatchEvent(new HUDEvent(HUDEvent.MENU_BUTTON_CLICKED));
};
break;
case GameState.LOSE:
if (Input.isKeyPressed(27)){
this.dispatchEvent(new HUDEvent(HUDEvent.MENU_BUTTON_CLICKED));
};
break;
case GameState.WIN:
if (Input.isKeyPressed(27)){
this.finishGame(null);
};
break;
default:
break;
};
if (((Input.isKeyPressed(82)) || (Input.isKeyPressed(32)))){
this.restartCurrentWorld(null);
};
if (this.hud){
if (this.hud.isVisible()){
this.updateHUD();
};
this.setElementOnTop(this.hud);
};
}
protected function worldEventParser(_arg1:WorldEvent):void{
switch (_arg1.type){
case WorldEvent.PLAYER_DEAD:
this.actionsPlayerDead(_arg1.world_id);
break;
case WorldEvent.WORLD_LOST:
this.actionsWorldLost(_arg1.world_id);
break;
case WorldEvent.WORLD_COMPLETED:
this.actionsWorldCompleted(_arg1.world_id);
break;
default:
this.actionsWorldOthers(_arg1);
break;
};
}
private function showStateElements(_arg1:Number):void{
switch (_arg1){
case GameState.NOT_STARTED:
break;
case GameState.PLAY:
break;
case GameState.PAUSE:
break;
case GameState.LOSE:
break;
case GameState.WIN:
break;
default:
break;
};
}
private function finishGame(_arg1:HUDEvent):void{
this.changeStateTo(GameState.NOT_STARTED);
this.destroy();
this.worldsScores = new Object();
GameSessionData.reset();
this.dispatchEvent(new HUDEvent(HUDEvent.MENU_BUTTON_CLICKED));
}
public function resume():void{
if (this.game_started){
this.changeStateTo(GameState.PLAY);
} else {
this.startNewGame();
};
}
public function start(_arg1:Number=1):void{
this.worldsScores = new Object();
if (this.game_started){
this.destroy();
};
this.startNewGame(_arg1);
}
protected function completeCurrentWorld(_arg1:HUDEvent):void{
this.worlds_manager.completeCurrentWorld();
}
protected function updateHUD():void{
}
protected function actionsWorldCompleted(_arg1:Number):void{
trace("actionsWorldCompleted");
this.addToGameScore(_arg1, this.worlds_manager.getCurrentWorldScores());
this.worlds_manager.nextWorld();
}
protected function showHUD(_arg1:Event):void{
if (Settings.CHANGE_WORLDS_INSTANTLY){
if (((this.hud.isInTransation()) && (this.isVisible()))){
this.hud.addEventListener(VisualElementEvent.HIDDEN, this.showHUD);
} else {
this.hud.show();
};
} else {
this.hud.show();
};
}
public function updateTime(_arg1:Number):void{
this.play_time = _arg1;
this.worlds_manager.updateTime(this.play_time);
}
protected function actionsAllWorldsComplete():void{
trace("game completed");
this.hud.showGameFinishWindow();
this.changeStateTo(GameState.WIN);
}
protected function startNewGame(_arg1:Number=1):void{
this.game_started = true;
this.changeStateTo(GameState.PLAY);
this.worlds_manager.startWorld(_arg1);
this.hud.hideGameFinishWindow();
this.hud.hideWorldFinishWindow();
}
}
}//package ru.zedarus.games.zedengine.game
Section 507
//GameSessionData (ru.zedarus.games.zedengine.game.GameSessionData)
package ru.zedarus.games.zedengine.game {
import ru.zedarus.games.zedengine.game.savegame.*;
public class GameSessionData {
public static var COMPLETED_LEVELS:Array;
public static var LEVELCODE:Array;
public static var unblocked_levels:Array;
private static var save_games:Array;
public function GameSessionData():void{
LEVELCODE = Settings.LEVELCODE;
COMPLETED_LEVELS = new Array();
unblocked_levels = Settings.ACTIVATED_LEVELS;
save_games = new Array();
}
public static function reset():void{
COMPLETED_LEVELS = new Array();
}
public static function unblockLevel(_arg1:Number):Boolean{
if (unblocked_levels.indexOf(_arg1) == -1){
unblocked_levels.push(_arg1);
return (true);
};
return (false);
}
public static function isLevelCompleted(_arg1:Number):Boolean{
if (COMPLETED_LEVELS.indexOf(_arg1) != -1){
return (true);
};
return (false);
}
public static function isSaveGameSlotExists(_arg1:Number):Boolean{
var _local2:SaveGameData;
for each (_local2 in save_games) {
if (_local2.id == _arg1){
return (true);
};
};
return (false);
}
public static function ublockLevelByCode(_arg1:String):Boolean{
var _local2:String;
for each (_local2 in GameSessionData.LEVELCODE) {
if ((((_arg1 == _local2)) && (!((_arg1 == ""))))){
unblockLevel(GameSessionData.LEVELCODE.indexOf(_arg1));
return (true);
};
};
return (false);
}
public static function isLevelUnblocked(_arg1:Number):Boolean{
if (unblocked_levels.indexOf(_arg1) != -1){
return (true);
};
return (false);
}
public static function getSaveGameDate(_arg1:Number):String{
var _local2:SaveGameData;
for each (_local2 in save_games) {
if (_local2.id == _arg1){
return (_local2.date);
};
};
return ("no date");
}
public static function saveGame(_arg1:Number, _arg2:SaveGameData=null):Boolean{
var _local10:SaveGameData;
var _local3:Date = new Date();
var _local4:String = _local3.getDate().toString();
if (Number(_local4) < 10){
_local4 = ("0" + _local4);
};
var _local5:String = String((_local3.getMonth() + 1));
if (Number(_local5) < 10){
_local5 = ("0" + _local5);
};
var _local6:String = _local3.getHours().toString();
if (Number(_local6) < 10){
_local6 = ("0" + _local6);
};
var _local7:String = _local3.getMinutes().toString();
if (Number(_local7) < 10){
_local7 = ("0" + _local7);
};
var _local8:String = _local3.getSeconds().toString();
if (Number(_local8) < 10){
_local8 = ("0" + _local8);
};
var _local9:String = ((((((((((_local4 + ".") + _local5) + ".") + _local3.getFullYear()) + ", ") + _local6) + ":") + _local7) + ":") + _local8);
if (isSaveGameSlotExists(_arg1)){
for each (_arg2 in save_games) {
if (_arg2.id == _arg1){
_arg2.date = _local9;
};
};
} else {
_local10 = new SaveGameData();
_local10.id = _arg1;
_local10.date = _local9;
save_games.push(_local10);
};
return (true);
}
}
}//package ru.zedarus.games.zedengine.game
Section 508
//GameState (ru.zedarus.games.zedengine.game.GameState)
package ru.zedarus.games.zedengine.game {
public class GameState {
public static const WIN:int = 4;
public static const PLAY:int = 2;
public static const NOT_STARTED:int = 1;
public static const PAUSE:int = 5;
public static const LOSE:int = 3;
}
}//package ru.zedarus.games.zedengine.game
Section 509
//Input (ru.zedarus.games.zedengine.input.Input)
package ru.zedarus.games.zedengine.input {
import flash.events.*;
import flash.display.*;
public class Input {
public static var mouseOffsetX:Number = 0;
private static var keyArr:Array;
public static var mouseDragX:Number = 0;
public static var mouseOffsetY:Number = 0;
public static var ascii:Array;
public static var mouseX:Number = 0;
public static var mouseY:Number = 0;
public static var mouseDragY:Number = 0;
public static var mouseOver:Boolean = false;
public static var m_stageMc:Sprite;
private static var bufferSize:int;
public static var mouse:Sprite = new Sprite();
public static var mouseDown:Boolean = false;
public static var mouseReleased:Boolean = false;
public static var lastKey:int = 0;
public static var mouseDoubleClicked:Boolean = false;
private static var keyState:Array;
public static var mousePressed:Boolean = false;
private static var keyBuffer:Array;
public function Input(_arg1:Sprite){
m_stageMc = _arg1;
ascii = new Array(222);
fillAscii();
keyState = new Array(222);
keyArr = new Array();
var _local2:int;
while (_local2 < 222) {
keyState[_local2] = new int(0);
if (ascii[_local2] != undefined){
keyArr.push(_local2);
};
_local2++;
};
bufferSize = 5;
keyBuffer = new Array(bufferSize);
var _local3:int;
while (_local3 < bufferSize) {
keyBuffer[_local3] = new Array(0, 0);
_local3++;
};
_arg1.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPress, false, 0, true);
_arg1.stage.addEventListener(KeyboardEvent.KEY_UP, keyRelease, false, 0, true);
_arg1.stage.addEventListener(MouseEvent.MOUSE_DOWN, mousePress, false, 0, true);
_arg1.stage.addEventListener(MouseEvent.CLICK, mouseRelease, false, 0, true);
_arg1.stage.addEventListener(MouseEvent.DOUBLE_CLICK, mouseDoubleRelease, false, 0, true);
_arg1.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove, false, 0, true);
_arg1.stage.addEventListener(Event.MOUSE_LEAVE, mouseLeave, false, 0, true);
mouse.graphics.lineStyle(0.1, 0, 100);
mouse.graphics.moveTo(0, 0);
mouse.graphics.lineTo(0, 0.1);
}
public function mouseDoubleRelease(_arg1:MouseEvent):void{
mouseDown = false;
mouseDoubleClicked = true;
}
public function mouseRelease(_arg1:MouseEvent):void{
mouseDown = false;
mouseReleased = true;
}
public function keyPress(_arg1:KeyboardEvent):void{
keyState[_arg1.keyCode] = Math.max(keyState[_arg1.keyCode], 1);
lastKey = _arg1.keyCode;
}
private function fillAscii():void{
ascii[65] = "A";
ascii[66] = "B";
ascii[67] = "C";
ascii[68] = "D";
ascii[69] = "E";
ascii[70] = "F";
ascii[71] = "G";
ascii[72] = "H";
ascii[73] = "I";
ascii[74] = "J";
ascii[75] = "K";
ascii[76] = "L";
ascii[77] = "M";
ascii[78] = "N";
ascii[79] = "O";
ascii[80] = "P";
ascii[81] = "Q";
ascii[82] = "R";
ascii[83] = "S";
ascii[84] = "T";
ascii[85] = "U";
ascii[86] = "V";
ascii[87] = "W";
ascii[88] = "X";
ascii[89] = "Y";
ascii[90] = "Z";
ascii[48] = "0";
ascii[49] = "1";
ascii[50] = "2";
ascii[51] = "3";
ascii[52] = "4";
ascii[53] = "5";
ascii[54] = "6";
ascii[55] = "7";
ascii[56] = "8";
ascii[57] = "9";
ascii[32] = "Spacebar";
ascii[17] = "Ctrl";
ascii[16] = "Shift";
ascii[192] = "~";
ascii[38] = "up";
ascii[40] = "down";
ascii[37] = "left";
ascii[39] = "right";
ascii[96] = "Numpad 0";
ascii[97] = "Numpad 1";
ascii[98] = "Numpad 2";
ascii[99] = "Numpad 3";
ascii[100] = "Numpad 4";
ascii[101] = "Numpad 5";
ascii[102] = "Numpad 6";
ascii[103] = "Numpad 7";
ascii[104] = "Numpad 8";
ascii[105] = "Numpad 9";
ascii[111] = "Numpad /";
ascii[106] = "Numpad *";
ascii[109] = "Numpad -";
ascii[107] = "Numpad +";
ascii[110] = "Numpad .";
ascii[45] = "Insert";
ascii[46] = "Delete";
ascii[33] = "Page Up";
ascii[34] = "Page Down";
ascii[35] = "End";
ascii[36] = "Home";
ascii[112] = "F1";
ascii[113] = "F2";
ascii[114] = "F3";
ascii[115] = "F4";
ascii[116] = "F5";
ascii[117] = "F6";
ascii[118] = "F7";
ascii[119] = "F8";
ascii[188] = ",";
ascii[190] = ".";
ascii[186] = ";";
ascii[222] = "'";
ascii[219] = "[";
ascii[221] = "]";
ascii[189] = "-";
ascii[187] = "+";
ascii[220] = "\\";
ascii[191] = "/";
ascii[9] = "TAB";
ascii[8] = "Backspace";
ascii[27] = "ESC";
}
public function mouseMove(_arg1:MouseEvent):void{
if (mouseDown != _arg1.buttonDown){
mouseDown = _arg1.buttonDown;
mouseReleased = !(_arg1.buttonDown);
mouseDoubleClicked = !(_arg1.buttonDown);
mousePressed = _arg1.buttonDown;
mouseDragX = 0;
mouseDragY = 0;
};
mouseX = (_arg1.stageX - m_stageMc.x);
mouseY = (_arg1.stageY - m_stageMc.y);
mouseOffsetX = (mouseX - mouse.x);
mouseOffsetY = (mouseY - mouse.y);
if (mouseDown){
mouseDragX = (mouseDragX + mouseOffsetX);
mouseDragY = (mouseDragY + mouseOffsetY);
};
mouse.x = mouseX;
mouse.y = mouseY;
}
public function keyRelease(_arg1:KeyboardEvent):void{
keyState[_arg1.keyCode] = -1;
var _local2:int = (bufferSize - 1);
while (_local2 > 0) {
keyBuffer[_local2] = keyBuffer[(_local2 - 1)];
_local2--;
};
keyBuffer[0] = [_arg1.keyCode, 0];
}
public function mouseLeave(_arg1:Event):void{
mouseReleased = mouseDown;
mouseDown = false;
}
public function mousePress(_arg1:MouseEvent):void{
mousePressed = true;
mouseDown = true;
mouseDragX = 0;
mouseDragY = 0;
}
public static function getKeyHold(_arg1:int):int{
return (Math.max(0, keyState[_arg1]));
}
public static function update():void{
var _local1:int;
while (_local1 < keyArr.length) {
if (keyState[keyArr[_local1]] != 0){
var _local3 = keyState;
var _local4 = keyArr[_local1];
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
};
_local1++;
};
var _local2:int;
while (_local2 < bufferSize) {
_local3 = keyBuffer[_local2];
_local4 = 1;
_local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
_local2++;
};
mouseReleased = false;
mousePressed = false;
mouseDoubleClicked = false;
mouseOver = false;
}
public static function isKeyPressed(_arg1:int):Boolean{
return ((keyState[_arg1] == 1));
}
public static function isKeyDown(_arg1:int):Boolean{
return ((keyState[_arg1] > 0));
}
public static function getKeyString(_arg1:uint):String{
return (ascii[_arg1]);
}
public static function isKeyReleased(_arg1:int):Boolean{
return ((keyState[_arg1] == -1));
}
public static function isKeyInBuffer(_arg1:int, _arg2:int, _arg3:int):Boolean{
return ((((keyBuffer[_arg2][0] == _arg1)) && ((keyBuffer[_arg2][1] <= _arg3))));
}
}
}//package ru.zedarus.games.zedengine.input
Section 510
//BasicPreloader (ru.zedarus.games.zedengine.loaders.BasicPreloader)
package ru.zedarus.games.zedengine.loaders {
import fl.transitions.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import fl.transitions.easing.*;
public class BasicPreloader extends MovieClip {
protected var preloader_tween:Tween;
protected var param:String;// = "alpha"
protected var preloader_tween_time:Number;// = 1
protected var end_value:Number;// = 1
protected var start_value:Number;// = 0
protected var document_class_name:String;
protected var preloader_tween_easing_out:Function;
protected var preloader_tween_easing_in:Function;
public function BasicPreloader():void{
preloader_tween_easing_in = Elastic.easeOut;
preloader_tween_easing_out = Elastic.easeIn;
super();
stop();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
protected function onEnterFrame(_arg1:Event):void{
var _local2:Number;
if (framesLoaded == totalFrames){
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.startGame();
} else {
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
this.update(_local2);
};
}
protected function startGame():void{
this.nextFrame();
this.init();
this.update(1);
}
public function hide():void{
if (this.preloader_tween){
this.preloader_tween.stop();
};
this.preloader_tween = new Tween(this, this.param, this.preloader_tween_easing_out, this[this.param], this.end_value, this.preloader_tween_time, true);
this.preloader_tween.addEventListener(TweenEvent.MOTION_FINISH, hideCompletly);
}
protected function update(_arg1:Number):void{
this.graphics.clear();
this.graphics.beginFill(0xCC0000);
this.graphics.drawRect(20, ((stage.stageHeight / 2) - 10), ((stage.stageWidth - 40) * _arg1), 20);
this.graphics.endFill();
}
private function init():void{
var _local2:Object;
var _local1:Class = Class(getDefinitionByName(this.document_class_name));
if (_local1){
_local2 = new (_local1);
this.addChild((_local2 as DisplayObject));
};
}
public function show():void{
if (this.preloader_tween){
this.preloader_tween.stop();
};
this.preloader_tween = new Tween(this, this.param, this.preloader_tween_easing_in, this[this.param], this.start_value, this.preloader_tween_time, true);
}
private function hideCompletly(_arg1:TweenEvent):void{
this.visible = false;
this.dispatchEvent(new Event(Event.CLOSE));
}
}
}//package ru.zedarus.games.zedengine.loaders
Section 511
//Localization (ru.zedarus.games.zedengine.localization.Localization)
package ru.zedarus.games.zedengine.localization {
public class Localization {
public static var data:XML;
private static var current_lang:String = "en";
protected static var EmbeddedXML:Class = Localization_EmbeddedXML;
public function Localization():void{
data = XML(new EmbeddedXML());
changeLanguage(Settings.DEFAULT_LANGUAGE);
}
public static function getWord(_arg1:String):String{
var _local2:XML;
var _local3 = (((("{" + getCurrentLanguage()) + ":") + _arg1) + "}");
if (((Number(_arg1)) || ((Number(_arg1) == 0)))){
_local3 = _arg1;
} else {
for each (_local2 in data.word) {
if (_local2.attribute("id") == _arg1){
if (getItemInCurrentLanguage(_local2)){
_local3 = getItemInCurrentLanguage(_local2);
};
return (_local3);
};
};
};
return (_local3);
}
private static function getItemInCurrentLanguage(_arg1:Object):String{
switch (current_lang){
case "en":
return (_arg1.en);
case "ru":
return (_arg1.ru);
case "ua":
return (_arg1.ua);
case "de":
return (_arg1.de);
case "fr":
return (_arg1.fr);
case "es":
return (_arg1.es);
case "it":
return (_arg1.it);
case "jp":
return (_arg1.jp);
case "ch":
return (_arg1.ch);
default:
return (_arg1.en);
};
}
public static function changeLanguage(_arg1:String):void{
current_lang = _arg1;
}
public static function getCurrentLanguage():String{
return (current_lang);
}
}
}//package ru.zedarus.games.zedengine.localization
Section 512
//Localization_EmbeddedXML (ru.zedarus.games.zedengine.localization.Localization_EmbeddedXML)
package ru.zedarus.games.zedengine.localization {
import mx.core.*;
public class Localization_EmbeddedXML extends ByteArrayAsset {
}
}//package ru.zedarus.games.zedengine.localization
Section 513
//Background (ru.zedarus.games.zedengine.screens.Background)
package ru.zedarus.games.zedengine.screens {
import ru.zedarus.games.zedengine.visualelements.*;
public class Background extends VisualElement {
public function Background():void{
this.alpha = 0;
}
public function update():void{
}
}
}//package ru.zedarus.games.zedengine.screens
Section 514
//BlockScreen (ru.zedarus.games.zedengine.screens.BlockScreen)
package ru.zedarus.games.zedengine.screens {
import flash.events.*;
public class BlockScreen extends Intro {
public function BlockScreen():void{
this.visible = false;
this.alpha = 0;
}
override public function show():void{
super.show();
this.addEventListener(Event.ENTER_FRAME, this.update);
this.gotoAndPlay(2);
this.played = true;
}
}
}//package ru.zedarus.games.zedengine.screens
Section 515
//GlobalTopScreen (ru.zedarus.games.zedengine.screens.GlobalTopScreen)
package ru.zedarus.games.zedengine.screens {
import ru.zedarus.games.zedengine.userinterface.windows.options.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.userinterface.soundcontrol.*;
import ru.zedarus.games.zedengine.debug.*;
public class GlobalTopScreen extends VisualElement {
public var fps_counter:FpsCounter;
public var sound_control:SoundControl;
public function GlobalTopScreen():void{
if (this.fps_counter){
if (Settings.TESTING_MODE){
this.fps_counter.visible = true;
} else {
this.fps_counter.visible = false;
};
};
if (this.sound_control){
this.sound_control.addEventListener(OptionsEvent.TOGGLE_SOUND, this.toggleSound);
this.sound_control.addEventListener(OptionsEvent.TOGGLE_MUSIC, this.toggleMusic);
this.sound_control.addEventListener(OptionsEvent.CHANGE_SOUND_VOLUME, this.changeSoundVolume);
this.sound_control.addEventListener(OptionsEvent.CHANGE_MUSIC_VOLUME, this.changeMusicVolume);
this.sound_control.show();
};
}
private function changeSoundVolume(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_value));
}
private function toggleMusic(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_state));
}
private function toggleSound(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_state));
}
public function update():void{
if (((this.fps_counter) && (Settings.TESTING_MODE))){
this.fps_counter.update();
};
}
public function updateSoundState():void{
this.sound_control.updateSoundState();
}
private function changeMusicVolume(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_value));
}
}
}//package ru.zedarus.games.zedengine.screens
Section 516
//Intro (ru.zedarus.games.zedengine.screens.Intro)
package ru.zedarus.games.zedengine.screens {
import flash.events.*;
import flash.display.*;
import ru.zedarus.games.zedengine.visualelements.*;
public class Intro extends VisualElement {
public var clickzone:Sprite;
protected var played:Boolean;// = false
public function Intro():void{
this.stop();
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
};
}
public function begin():void{
this.show();
this.addEventListener(Event.ENTER_FRAME, this.update);
this.gotoAndPlay(2);
this.played = true;
}
protected function update(_arg1:Event):void{
if (this.currentFrame == this.totalFrames){
this.stop();
this.removeEventListener(Event.ENTER_FRAME, this.update);
this.dispatchEvent(new Event(Event.COMPLETE));
};
}
public function isPlayed():Boolean{
return (this.played);
}
public function reset():void{
this.hide();
this.gotoAndStop(1);
this.played = false;
}
}
}//package ru.zedarus.games.zedengine.screens
Section 517
//SponsorIntro (ru.zedarus.games.zedengine.screens.SponsorIntro)
package ru.zedarus.games.zedengine.screens {
import flash.events.*;
import flash.net.*;
public class SponsorIntro extends Intro {
public function SponsorIntro():void{
if (this.clickzone){
this.clickzone.addEventListener(MouseEvent.CLICK, clickOnMe);
};
}
private function clickOnMe(_arg1:MouseEvent):void{
if (Settings.SPONSOR_LINK){
navigateToURL(new URLRequest(Settings.SPONSOR_LINK), "_blank");
};
}
}
}//package ru.zedarus.games.zedengine.screens
Section 518
//SponsorLogo (ru.zedarus.games.zedengine.screens.SponsorLogo)
package ru.zedarus.games.zedengine.screens {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import com.gamezhero.api.as3.*;
public class SponsorLogo extends MovieClip {
public var clickzone:Sprite;
public function SponsorLogo():void{
switch (Settings.BRANDING){
case Settings.ARMOR_GAMES:
this.gotoAndStop(1);
break;
case Settings.GAMEZHERO:
this.gotoAndStop(2);
break;
};
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, clickOnMe);
};
}
private function clickOnMe(_arg1:MouseEvent):void{
switch (Settings.BRANDING){
case Settings.ARMOR_GAMES:
if (Settings.SPONSOR_LINK){
navigateToURL(new URLRequest(Settings.SPONSOR_LINK), "_blank");
};
break;
case Settings.GAMEZHERO:
GamezheroApi.linkZorroLogo();
break;
};
}
}
}//package ru.zedarus.games.zedengine.screens
Section 519
//SponsorLogoSmall (ru.zedarus.games.zedengine.screens.SponsorLogoSmall)
package ru.zedarus.games.zedengine.screens {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import com.gamezhero.api.as3.*;
public class SponsorLogoSmall extends MovieClip {
public var clickzone:Sprite;
public function SponsorLogoSmall():void{
switch (Settings.BRANDING){
case Settings.ARMOR_GAMES:
this.gotoAndStop(1);
break;
case Settings.GAMEZHERO:
this.gotoAndStop(2);
break;
};
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, clickOnMe);
};
}
private function clickOnMe(_arg1:MouseEvent):void{
switch (Settings.BRANDING){
case Settings.ARMOR_GAMES:
if (Settings.SPONSOR_LINK){
navigateToURL(new URLRequest(Settings.SPONSOR_LINK), "_blank");
};
break;
case Settings.GAMEZHERO:
GamezheroApi.linkZorroLogo();
break;
};
}
}
}//package ru.zedarus.games.zedengine.screens
Section 520
//Walkthrough (ru.zedarus.games.zedengine.screens.Walkthrough)
package ru.zedarus.games.zedengine.screens {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Walkthrough extends Sprite {
public var clickzone:Sprite;
public function Walkthrough():void{
this.alpha = 0;
this.buttonMode = true;
this.useHandCursor = true;
this.addEventListener(MouseEvent.CLICK, clickOnMe);
}
private function clickOnMe(_arg1:MouseEvent):void{
if (Settings.GUIDE_LINK){
navigateToURL(new URLRequest(Settings.GUIDE_LINK), "_blank");
};
}
}
}//package ru.zedarus.games.zedengine.screens
Section 521
//ServiceEvent (ru.zedarus.games.zedengine.services.ServiceEvent)
package ru.zedarus.games.zedengine.services {
import flash.events.*;
public class ServiceEvent extends Event {
public static const DOMAIN_BLOCK:String = "DOMAIN_BLOCK";
public static const AD_FAILED:String = "AD_FAILED";
public static const AD_FINISHED:String = "AD_FINISHED";
public function ServiceEvent(_arg1:String):void{
super(_arg1);
}
}
}//package ru.zedarus.games.zedengine.services
Section 522
//Services (ru.zedarus.games.zedengine.services.Services)
package ru.zedarus.games.zedengine.services {
import flash.events.*;
import flash.display.*;
import mochi.*;
public class Services extends Sprite {
private var ads_shown:Boolean;// = false
private var inited:Boolean;// = false
private var game_jacket:GameJacketAS3;
public static var mochiservice:MovieClip;
public function Services():void{
}
private function adFailed(_arg1:Event):void{
this.dispatchEvent(new ServiceEvent(ServiceEvent.AD_FAILED));
}
private function initMochiAds():void{
}
private function gameJacketError(_arg1:Event):void{
trace("Game Jacket Error");
}
public function isInided():Boolean{
return (this.inited);
}
public function removeAds():void{
this.ads_shown = false;
}
public function adsAreShown():Boolean{
return (this.ads_shown);
}
private function checkDomain():Boolean{
var _local1:String;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Number;
var _local7:Number;
var _local8:String;
var _local9:String;
var _local10:Boolean;
var _local11:Boolean;
if (Settings.SITE_LOCKED){
_local1 = stage.loaderInfo.url;
_local2 = _local1;
_local3 = (_local1.indexOf("://") + 3);
_local4 = _local1.indexOf("/", _local3);
_local5 = _local1.substring(_local3, _local4);
_local6 = (_local5.lastIndexOf(".") - 1);
_local7 = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
_local10 = true;
for each (_local9 in Settings.blacklist_domains) {
if (_local5 == _local9){
_local10 = false;
};
};
_local11 = false;
for each (_local8 in Settings.allowed_domains) {
if (_local5 == _local8){
_local11 = true;
};
};
if (!_local11){
_local10 = false;
};
if (((!(_local10)) && ((_local2 == Settings.localhost)))){
_local10 = true;
};
return (_local10);
};
return (true);
}
public function init():void{
if (((Settings.USE_MOCHISERVICES) && (Settings.mochiads_id))){
this.initMochiServices();
};
if (((Settings.USE_MOCHIBOT) && (Settings.mochibot_id))){
this.initMochiBot();
};
if (!this.checkDomain()){
this.dispatchEvent(new ServiceEvent(ServiceEvent.DOMAIN_BLOCK));
};
this.inited = true;
}
private function initMochiBot():void{
MochiBot.track(this, Settings.mochibot_id);
}
private function initMochiServices():void{
mochiservice = new MovieClip();
this.addChild(mochiservice);
MochiServices.connect(Settings.mochiads_id, mochiservice, this.onConnectError);
}
public function showAds():void{
if (Settings.USE_GAMEJACKET){
this.initGameJacket();
} else {
if (((Settings.USE_MOCHIADS) && (Settings.mochiads_id))){
this.initMochiAds();
} else {
this.dispatchEvent(new ServiceEvent(ServiceEvent.AD_FINISHED));
};
};
this.ads_shown = true;
}
private function adFinished(_arg1:Event):void{
this.dispatchEvent(new ServiceEvent(ServiceEvent.AD_FINISHED));
}
private function onConnectError(_arg1:String):void{
trace("no connection to mochi scores");
}
private function initGameJacket():void{
this.game_jacket = new GameJacketAS3();
this.game_jacket.setVariables(LoaderInfo(this.root.loaderInfo));
this.game_jacket.addEventListener("GameJacketPass", this.adFinished);
this.game_jacket.addEventListener("GameJacketFail", this.adFailed);
}
}
}//package ru.zedarus.games.zedengine.services
Section 523
//SoundManager (ru.zedarus.games.zedengine.sound.SoundManager)
package ru.zedarus.games.zedengine.sound {
import flash.media.*;
import flash.utils.*;
import sounds.*;
public class SoundManager {
private static var music_toggled:Boolean;
private static var sound_packs:Array = new Array();
private static var last_time_sound_played:Number = 0;
protected static var EmbeddedXML:Class = SoundManager_EmbeddedXML;
private static var sound_volume:Number;
private static var music_volume:Number;
public static var music_transform:SoundTransform;
public static var music_channel:SoundChannel;
private static var sound_toggled:Boolean;
private static var data:XML;
private static var assets_manager:AssetsManager;
public static var current_music_id:String;
public static var sound_transform:SoundTransform;
public function SoundManager(_arg1:AssetsManager):void{
assets_manager = _arg1;
sound_transform = new SoundTransform(Settings.SOUND_VOLUME, 0);
music_transform = new SoundTransform(Settings.MUSIC_VOLUME, 0);
sound_volume = Settings.SOUND_VOLUME;
music_volume = Settings.MUSIC_VOLUME;
sound_toggled = true;
music_toggled = true;
toggleSound(Settings.TOGGLE_SOUND);
toggleMusic(Settings.TOGGLE_MUSIC);
parseXML();
}
public static function playMusicById(_arg1:String):void{
var _local2:Sound;
var _local3:Class;
switch (_arg1){
case "menu":
_local3 = assets_manager.getAssetClass("musicMenu");
break;
};
if (_local3){
_local2 = new (_local3);
current_music_id = _arg1;
music_channel = _local2.play(0, 9999, music_transform);
};
}
public static function setSoundVolume(_arg1:Number, _arg2:Boolean=false):void{
if (sound_toggled){
sound_transform.volume = _arg1;
};
if (!_arg2){
sound_volume = _arg1;
};
}
public static function getMusicVolume():Number{
return (music_volume);
}
public static function getSoundVolume():Number{
return (sound_volume);
}
public static function getSoundToggle():Boolean{
return (sound_toggled);
}
public static function toggleSound(_arg1:Boolean):void{
if (_arg1){
sound_toggled = _arg1;
setSoundVolume(sound_volume, true);
} else {
setSoundVolume(0, true);
sound_toggled = _arg1;
};
}
public static function setMusicVolume(_arg1:Number, _arg2:Boolean=false):void{
if (music_toggled){
music_transform.volume = _arg1;
if (music_channel){
music_channel.soundTransform = music_transform;
};
};
if (!_arg2){
music_volume = _arg1;
};
}
private static function getSuperClassName(_arg1:Object):String{
var _local2:Class;
if ((_arg1 is String)){
_local2 = (getDefinitionByName((_arg1 as String)) as Class);
} else {
_local2 = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class);
};
return (getQualifiedSuperclassName(_local2));
}
public static function getMusicToggle():Boolean{
return (music_toggled);
}
public static function parseXML():void{
var _local1:XML;
var _local2:SoundPack;
data = XML(new EmbeddedXML());
for each (_local1 in data.ui_sounds.sound) {
_local2 = new SoundPack();
_local2.for_class = _local1.attribute("for_class").toString();
_local2.event = _local1.event.toString();
_local2.sound_class = _local1.sound.toString();
sound_packs.push(_local2);
};
for each (_local1 in data.simple_sounds.sound) {
_local2 = new SoundPack();
_local2.for_class = _local1.attribute("id").toString();
_local2.event = "simple";
_local2.sound_class = _local1.sound.toString();
sound_packs.push(_local2);
};
}
public static function playSoundForEvent(_arg1:Object, _arg2:String, _arg3:Boolean=false):void{
var _local7:SoundPack;
var _local4:String = (_arg3) ? getSuperClassName(_arg1) : getClassName(_arg1);
var _local5:String = parseClassName(_local4);
var _local6:Boolean;
for each (_local7 in sound_packs) {
if ((((_local7.for_class == _local5)) && ((_local7.event == _arg2)))){
playSoundByName(_local7.sound_class);
_local6 = true;
};
};
if (!_local6){
if (getSuperClassName(_local4) != "Object"){
playSoundForEvent(_local4, _arg2, true);
};
};
}
private static function getClassName(_arg1:Object):String{
var _local2:Class;
if ((_arg1 is String)){
_local2 = (getDefinitionByName((_arg1 as String)) as Class);
} else {
_local2 = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class);
};
return (getQualifiedClassName(_local2));
}
private static function parseClassName(_arg1:String):String{
return (_arg1.split("::")[1]);
}
public static function toggleMusic(_arg1:Boolean):void{
if (_arg1){
music_toggled = _arg1;
setMusicVolume(music_volume, true);
} else {
setMusicVolume(0, true);
music_toggled = _arg1;
};
}
public static function playSoundById(_arg1:String):void{
var _local2:SoundPack;
for each (_local2 in sound_packs) {
if ((((_local2.for_class == _arg1)) && ((_local2.event == "simple")))){
if (_arg1 == "figures_collision"){
if ((getTimer() - last_time_sound_played) > (0.5 * 1000)){
playSoundByName(_local2.sound_class);
last_time_sound_played = getTimer();
};
} else {
playSoundByName(_local2.sound_class);
};
};
};
}
public static function playSoundByName(_arg1:String):void{
var _local3:Sound;
var _local2:Class = assets_manager.getAssetClass(_arg1);
if (_local2){
_local3 = new (_local2);
_local3.play(0, 0, sound_transform);
};
}
}
}//package ru.zedarus.games.zedengine.sound
Section 524
//SoundManager_EmbeddedXML (ru.zedarus.games.zedengine.sound.SoundManager_EmbeddedXML)
package ru.zedarus.games.zedengine.sound {
import mx.core.*;
public class SoundManager_EmbeddedXML extends ByteArrayAsset {
}
}//package ru.zedarus.games.zedengine.sound
Section 525
//SoundPack (ru.zedarus.games.zedengine.sound.SoundPack)
package ru.zedarus.games.zedengine.sound {
public class SoundPack {
public var for_class:String;
public var sound_class:String;
public var event:String;
public function SoundPack(_arg1:String=""):void{
}
}
}//package ru.zedarus.games.zedengine.sound
Section 526
//CompactFlag (ru.zedarus.games.zedengine.userinterface.flags.CompactFlag)
package ru.zedarus.games.zedengine.userinterface.flags {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.flags.*;
import ru.zedarus.games.zedengine.localization.*;
public class CompactFlag extends VisualElement {
public var flag:MovieClip;
public var titleTF:TextField;
protected var lang_id:String;
public var clickzone:Sprite;
protected var lang_name:String;
public function CompactFlag():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.sendMessage);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
if (this.titleTF){
this.titleTF.mouseEnabled = false;
this.titleTF.autoSize = this.titleTF.getTextFormat().align;
this.titleTF.wordWrap = false;
this.titleTF.alpha = 0;
};
}
private function deactivate():void{
this.setStateToInactive();
}
public function localize():void{
if (((this.titleTF) && (this.lang_name))){
this.titleTF.htmlText = Localization.getWord(this.lang_name);
};
if (Localization.getCurrentLanguage() != this.lang_id){
this.deactivate();
} else {
this.activate();
};
if (this.flag){
this.flag.current_flag.gotoAndStop(this.lang_id);
};
}
private function activate():void{
this.setStateToActive();
}
private function sendMessage(_arg1:MouseEvent):void{
this.dispatchEvent(new OptionsFlagEvent(OptionsFlagEvent.CHANGE_LANG, this.lang_id));
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 527
//CompactFlagCH (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagCH)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagCH extends CompactFlag {
public function CompactFlagCH():void{
this.lang_id = "ch";
this.lang_name = "compact_lang_ch";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 528
//CompactFlagDE (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagDE)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagDE extends CompactFlag {
public function CompactFlagDE():void{
this.lang_id = "de";
this.lang_name = "compact_lang_de";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 529
//CompactFlagEN (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagEN)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagEN extends CompactFlag {
public function CompactFlagEN():void{
this.lang_id = "en";
this.lang_name = "compact_lang_en";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 530
//CompactFlagES (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagES)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagES extends CompactFlag {
public function CompactFlagES():void{
this.lang_id = "es";
this.lang_name = "compact_lang_es";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 531
//CompactFlagFR (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagFR)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagFR extends CompactFlag {
public function CompactFlagFR():void{
this.lang_id = "fr";
this.lang_name = "compact_lang_fr";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 532
//CompactFlagIT (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagIT)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagIT extends CompactFlag {
public function CompactFlagIT():void{
this.lang_id = "it";
this.lang_name = "compact_lang_it";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 533
//CompactFlagJP (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagJP)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagJP extends CompactFlag {
public function CompactFlagJP():void{
this.lang_id = "jp";
this.lang_name = "compact_lang_jp";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 534
//CompactFlagRU (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagRU)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagRU extends CompactFlag {
public function CompactFlagRU():void{
this.lang_id = "ru";
this.lang_name = "compact_lang_ru";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 535
//CompactFlagsManager (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagsManager)
package ru.zedarus.games.zedengine.userinterface.flags {
import ru.zedarus.games.zedengine.userinterface.windows.options.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.flags.*;
public class CompactFlagsManager extends VisualElement {
private var flags:Array;
public function CompactFlagsManager():void{
var _local1:CompactFlag;
flags = new Array();
super();
this.findAndInitFlags();
for each (_local1 in this.flags) {
_local1.show();
_local1.addEventListener(OptionsFlagEvent.CHANGE_LANG, this.translateMessage);
};
}
private function translateMessage(_arg1:OptionsFlagEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.CHANGE_LANG, _arg1.to_lang));
}
private function findAndInitFlags():void{
var _local1:Number = 1;
while (_local1 < this.numChildren) {
if ((this.getChildAt(_local1) is CompactFlagEN)){
this.flags.push((this.getChildAt(_local1) as CompactFlagEN));
};
if ((this.getChildAt(_local1) is CompactFlagUS)){
this.flags.push((this.getChildAt(_local1) as CompactFlagUS));
};
if ((this.getChildAt(_local1) is CompactFlagRU)){
this.flags.push((this.getChildAt(_local1) as CompactFlagRU));
};
if ((this.getChildAt(_local1) is CompactFlagUA)){
this.flags.push((this.getChildAt(_local1) as CompactFlagUA));
};
if ((this.getChildAt(_local1) is CompactFlagIT)){
this.flags.push((this.getChildAt(_local1) as CompactFlagIT));
};
if ((this.getChildAt(_local1) is CompactFlagES)){
this.flags.push((this.getChildAt(_local1) as CompactFlagES));
};
if ((this.getChildAt(_local1) is CompactFlagDE)){
this.flags.push((this.getChildAt(_local1) as CompactFlagDE));
};
if ((this.getChildAt(_local1) is CompactFlagFR)){
this.flags.push((this.getChildAt(_local1) as CompactFlagFR));
};
if ((this.getChildAt(_local1) is CompactFlagCH)){
this.flags.push((this.getChildAt(_local1) as CompactFlagCH));
};
if ((this.getChildAt(_local1) is CompactFlagJP)){
this.flags.push((this.getChildAt(_local1) as CompactFlagJP));
};
_local1++;
};
}
public function localize():void{
var _local1:CompactFlag;
for each (_local1 in this.flags) {
_local1.localize();
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 536
//CompactFlagUA (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagUA)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagUA extends CompactFlag {
public function CompactFlagUA():void{
this.lang_id = "ua";
this.lang_name = "compact_lang_ua";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 537
//CompactFlagUS (ru.zedarus.games.zedengine.userinterface.flags.CompactFlagUS)
package ru.zedarus.games.zedengine.userinterface.flags {
public class CompactFlagUS extends CompactFlag {
public function CompactFlagUS():void{
this.lang_id = "us";
this.lang_name = "compact_lang_us";
}
}
}//package ru.zedarus.games.zedengine.userinterface.flags
Section 538
//SoundControl (ru.zedarus.games.zedengine.userinterface.soundcontrol.SoundControl)
package ru.zedarus.games.zedengine.userinterface.soundcontrol {
import ru.zedarus.games.zedengine.userinterface.windows.options.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.sliders.*;
import ru.zedarus.games.zedengine.sound.*;
public class SoundControl extends VisualElement {
public var sound_volume:SoundControlSlider;
public var sound_toggle:SoundControlElementSound;
public var music_toggle:SoundControlElementMusic;
public function SoundControl():void{
if (this.sound_toggle){
this.sound_toggle.addEventListener(SoundControlEvent.CHANGE, this.toggleSound);
this.sound_toggle.show();
};
if (this.music_toggle){
this.music_toggle.addEventListener(SoundControlEvent.CHANGE, this.toggleMusic);
this.music_toggle.show();
};
if (this.sound_volume){
this.sound_volume.addEventListener(OptionsSliderEvent.CHANGE, this.changeSoundVolume);
this.sound_volume.addEventListener(OptionsSliderEvent.CHANGE, this.changeMusicVolume);
this.sound_volume.show();
};
}
private function toggleMusic(_arg1:SoundControlEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.TOGGLE_MUSIC, _arg1.new_value));
}
public function updateSoundState():void{
if (this.sound_toggle){
this.sound_toggle.value = SoundManager.getSoundToggle();
};
if (this.music_toggle){
this.music_toggle.value = SoundManager.getMusicToggle();
};
if (this.sound_volume){
this.sound_volume.value = SoundManager.getSoundVolume();
};
}
private function changeSoundVolume(_arg1:OptionsSliderEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.CHANGE_SOUND_VOLUME, _arg1.new_value));
}
private function toggleSound(_arg1:SoundControlEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.TOGGLE_SOUND, _arg1.new_value));
}
private function changeMusicVolume(_arg1:OptionsSliderEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.CHANGE_MUSIC_VOLUME, _arg1.new_value));
}
}
}//package ru.zedarus.games.zedengine.userinterface.soundcontrol
Section 539
//SoundControlElement (ru.zedarus.games.zedengine.userinterface.soundcontrol.SoundControlElement)
package ru.zedarus.games.zedengine.userinterface.soundcontrol {
import flash.events.*;
import flash.display.*;
import ru.zedarus.games.zedengine.visualelements.*;
public class SoundControlElement extends VisualElement {
protected var __value:Boolean;// = false
public var clickzone:Sprite;
public function SoundControlElement():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.click);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
}
public function get value():Boolean{
return (this.__value);
}
protected function update():void{
if (this.value){
this.setStateToActive();
this.gotoAndStop(2);
} else {
this.setStateToInactive();
this.gotoAndStop(1);
};
}
public function set value(_arg1:Boolean):void{
this.__value = _arg1;
this.update();
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
if (this.value){
this.value = false;
} else {
this.value = true;
};
this.update();
this.dispatchEvent(new SoundControlEvent(SoundControlEvent.CHANGE, this.value));
}
}
}//package ru.zedarus.games.zedengine.userinterface.soundcontrol
Section 540
//SoundControlElementMusic (ru.zedarus.games.zedengine.userinterface.soundcontrol.SoundControlElementMusic)
package ru.zedarus.games.zedengine.userinterface.soundcontrol {
public class SoundControlElementMusic extends SoundControlElement {
public function SoundControlElementMusic():void{
this.value = Settings.TOGGLE_MUSIC;
this.update();
}
}
}//package ru.zedarus.games.zedengine.userinterface.soundcontrol
Section 541
//SoundControlElementSound (ru.zedarus.games.zedengine.userinterface.soundcontrol.SoundControlElementSound)
package ru.zedarus.games.zedengine.userinterface.soundcontrol {
public class SoundControlElementSound extends SoundControlElement {
public function SoundControlElementSound():void{
this.value = Settings.TOGGLE_SOUND;
this.update();
}
}
}//package ru.zedarus.games.zedengine.userinterface.soundcontrol
Section 542
//SoundControlEvent (ru.zedarus.games.zedengine.userinterface.soundcontrol.SoundControlEvent)
package ru.zedarus.games.zedengine.userinterface.soundcontrol {
import flash.events.*;
public class SoundControlEvent extends Event {
public var new_value:Boolean;
public static const CHANGE:String = "CHANGED";
public function SoundControlEvent(_arg1:String, _arg2:Boolean=false):void{
super(_arg1);
this.new_value = _arg2;
}
}
}//package ru.zedarus.games.zedengine.userinterface.soundcontrol
Section 543
//SoundControlSlider (ru.zedarus.games.zedengine.userinterface.soundcontrol.SoundControlSlider)
package ru.zedarus.games.zedengine.userinterface.soundcontrol {
import ru.zedarus.games.zedengine.userinterface.windows.options.sliders.*;
public class SoundControlSlider extends OptionsSlider {
public function SoundControlSlider():void{
this.value = Settings.SOUND_VOLUME;
this.update();
}
}
}//package ru.zedarus.games.zedengine.userinterface.soundcontrol
Section 544
//Credits (ru.zedarus.games.zedengine.userinterface.windows.credits.Credits)
package ru.zedarus.games.zedengine.userinterface.windows.credits {
import flash.text.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
public class Credits extends Window {
private var content_text_ids:Array;
private var content_text_fields:Array;
public function Credits():void{
var _local1:TextField;
content_text_fields = new Array();
content_text_ids = new Array();
super();
this.alpha = 0;
var _local2:Number = 1;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is TextField)){
if (this.getChildAt(_local2) != this.textLabel_title){
_local1 = (this.getChildAt(_local2) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
};
_local2++;
};
}
override public function localize():void{
super.localize();
if (this.close_window_button){
this.close_window_button.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.credits
Section 545
//Help (ru.zedarus.games.zedengine.userinterface.windows.help.Help)
package ru.zedarus.games.zedengine.userinterface.windows.help {
import flash.text.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
public class Help extends Window {
private var content_text_ids:Array;
private var content_text_fields:Array;
public function Help():void{
var _local1:TextField;
content_text_fields = new Array();
content_text_ids = new Array();
super();
this.alpha = 0;
var _local2:Number = 1;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is TextField)){
if (this.getChildAt(_local2) != this.textLabel_title){
_local1 = (this.getChildAt(_local2) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
};
_local2++;
};
}
override public function localize():void{
super.localize();
if (this.close_window_button){
this.close_window_button.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.help
Section 546
//Highscores (ru.zedarus.games.zedengine.userinterface.windows.highscores.Highscores)
package ru.zedarus.games.zedengine.userinterface.windows.highscores {
import flash.events.*;
import flash.display.*;
import ru.zedarus.games.zedengine.userinterface.windows.levelselect.*;
import flash.text.*;
import mochi.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.services.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
import flash.net.*;
public class Highscores extends Window {
public var level_38:LevelSelectItem;
public var panel:MovieClip;
public var level_35:LevelSelectItem;
public var level_31:LevelSelectItem;
public var level_40:LevelSelectItem;
public var level_41:LevelSelectItem;
public var level_39:LevelSelectItem;
public var level_43:LevelSelectItem;
public var level_44:LevelSelectItem;
public var level_45:LevelSelectItem;
public var level_46:LevelSelectItem;
public var level_47:LevelSelectItem;
public var level_48:LevelSelectItem;
public var level_42:LevelSelectItem;
public var level_49:LevelSelectItem;
private var mochi_board:MovieClip;
public var level_1:LevelSelectItem;
public var level_2:LevelSelectItem;
public var level_3:LevelSelectItem;
public var level_4:LevelSelectItem;
public var level_5:LevelSelectItem;
public var level_6:LevelSelectItem;
public var level_7:LevelSelectItem;
public var level_8:LevelSelectItem;
public var level_9:LevelSelectItem;
private var content_text_fields:Array;
public var mochi_error:HighscoresMochiError;
public var level_50:LevelSelectItem;
private var levels:Array;
private var content_text_ids:Array;
public var level_10:LevelSelectItem;
public var level_11:LevelSelectItem;
public var level_12:LevelSelectItem;
public var level_13:LevelSelectItem;
public var mochi_loading:HighscoresMochiLoading;
public var level_16:LevelSelectItem;
public var level_17:LevelSelectItem;
public var level_18:LevelSelectItem;
public var level_14:LevelSelectItem;
public var level_15:LevelSelectItem;
public var level_19:LevelSelectItem;
public var level_20:LevelSelectItem;
public var level_21:LevelSelectItem;
public var level_22:LevelSelectItem;
public var level_23:LevelSelectItem;
public var level_24:LevelSelectItem;
public var level_26:LevelSelectItem;
public var level_27:LevelSelectItem;
public var level_28:LevelSelectItem;
public var level_29:LevelSelectItem;
public var level_25:LevelSelectItem;
public var level_30:LevelSelectItem;
public var general_scores_button:HighscoresGeneralButton;
public var level_32:LevelSelectItem;
public var level_33:LevelSelectItem;
public var level_34:LevelSelectItem;
public var level_36:LevelSelectItem;
public var level_37:LevelSelectItem;
public function Highscores():void{
var _local1:TextField;
var _local2:LevelSelectItem;
content_text_fields = new Array();
content_text_ids = new Array();
levels = new Array();
super();
this.alpha = 0;
if (this.general_scores_button){
this.general_scores_button.addEventListener(LevelSelectEvent.SHOW_LEVEL, this.showLeaderboard);
};
if (this.mochi_loading){
this.mochi_loading.addEventListener(Event.CLOSE, this.mochiClose);
};
if (this.mochi_error){
this.mochi_error.addEventListener(Event.CLOSE, this.mochiClose);
};
var _local3:Number = 1;
while (_local3 < this.numChildren) {
if ((this.getChildAt(_local3) is TextField)){
if (this.getChildAt(_local3) != this.textLabel_title){
_local1 = (this.getChildAt(_local3) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
} else {
if ((this.getChildAt(_local3) is LevelSelectItem)){
_local2 = (this.getChildAt(_local3) as LevelSelectItem);
_local2.addEventListener(LevelSelectEvent.SHOW_LEVEL, this.showLeaderboard);
this.levels.push(_local2);
};
};
_local3++;
};
if (Settings.MULTI_SCORES){
this.showLevels();
} else {
if (this.panel){
this.panel.visible = false;
};
if (this.close_window_button){
this.close_window_button.hide();
};
if (this.textLabel_title){
this.textLabel_title.visible = false;
};
};
}
override public function localize():void{
var _local2:LevelSelectItem;
super.localize();
if (this.close_window_button){
this.close_window_button.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
for each (_local2 in this.levels) {
_local2.localize();
};
if (this.mochi_loading){
this.mochi_loading.localize();
};
if (this.mochi_error){
this.mochi_error.localize();
};
}
private function showMochiBoard(_arg1:Number):void{
var _local2:Boolean;
if (this.mochi_error){
this.mochi_error.visible = false;
};
if (this.mochi_loading){
this.mochi_loading.show();
};
if (this.mochi_loading){
_local2 = false;
};
this.mochi_board = Services.mochiservice;
if (!this.contains(this.mochi_board)){
this.addChild(this.mochi_board);
};
MochiScores.showLeaderboard({preloaderDisplay:_local2, boardID:Settings.LEADERBOARDS_IDS[_arg1], onClose:this.mochiClose, onDisplay:this.mochiShowed, onError:this.mochiError});
}
private function showLeaderboard(_arg1:LevelSelectEvent):void{
trace(("Show leaderboard for level: " + _arg1.level_id));
this.showMochiBoard(_arg1.level_id);
}
override public function hide():void{
super.hide();
if (Settings.USE_MOCHISCORES){
MochiScores.closeLeaderboard();
};
}
private function mochiClose(... _args):void{
if (Settings.MULTI_SCORES){
if (this.mochi_loading){
this.mochi_loading.hide();
};
} else {
if (this.mochi_loading){
this.mochi_loading.hide();
};
this.close(null);
};
}
private function mochiError():void{
if (this.mochi_error){
this.mochi_error.show();
};
}
private function mochiShowed():void{
}
private function showLevels():void{
var _local1:LevelSelectItem;
for each (_local1 in this.levels) {
_local1.show();
_local1.activate();
_local1.setComplitionStatus(false);
};
if (this.general_scores_button){
this.general_scores_button.show();
};
}
override public function show():void{
super.show();
if (!Settings.MULTI_SCORES){
if (Settings.USE_MOCHISCORES){
this.showMochiBoard(0);
};
};
}
public static function postArmorBotScores(_arg1:String, _arg2:Number):void{
var _local3:URLRequest = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local3.method = URLRequestMethod.POST;
var _local4:URLVariables = new URLVariables();
_local4.flashkey = "dlpaa0haWVU=";
_local4.SU0249 = "MzU4MmolZSVhJW4lcw==";
_local4.bmFtZTE = _arg1;
var _local5:Number = _arg2;
var _local6 = (_local5 + "Z");
_local4.c2NvcmUx = _local6.split("0").join("U");
_local4.c2NvcmUx = _local4.c2NvcmUx.split("").join("A");
_local4.c2NvcmUx = _local4.c2NvcmUx.split("AU").join("Y");
_local4.c2NvcmUx = _local4.c2NvcmUx.split("A1").join("B");
_local4.c2NvcmUx = _local4.c2NvcmUx.split(".").join("N");
_local3.data = _local4;
var _local7:URLLoader = new URLLoader();
_local7.dataFormat = URLLoaderDataFormat.TEXT;
_local7.addEventListener(Event.COMPLETE, dataOnLoad);
_local7.load(_local3);
}
public static function dataOnLoad(_arg1:Event):void{
var _local2:URLLoader = (_arg1.target as URLLoader);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.highscores
Section 547
//HighscoresGeneralButton (ru.zedarus.games.zedengine.userinterface.windows.highscores.HighscoresGeneralButton)
package ru.zedarus.games.zedengine.userinterface.windows.highscores {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.levelselect.*;
import flash.text.*;
import ru.zedarus.games.zedengine.localization.*;
public class HighscoresGeneralButton extends LevelSelectItem {
private var subtitle_id:String;
private var title_id:String;
public var subtitleTF:TextField;
public function HighscoresGeneralButton():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.sendMessage);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
if (this.subtitleTF){
this.subtitle_id = this.subtitleTF.text;
this.subtitleTF.mouseEnabled = false;
this.subtitleTF.autoSize = this.subtitleTF.getTextFormat().align;
this.subtitleTF.wordWrap = this.subtitleTF.multiline;
};
if (this.icon){
this.title_id = this.icon.pack.titleTF.text;
this.icon.pack.titleTF.mouseEnabled = false;
this.icon.pack.titleTF.autoSize = this.icon.pack.titleTF.getTextFormat().align;
this.icon.pack.titleTF.wordWrap = this.icon.pack.titleTF.multiline;
};
this.localize();
this.id = 0;
}
override public function localize():void{
if (this.icon.pack.titleTF){
this.icon.pack.titleTF.htmlText = Localization.getWord(this.title_id);
};
if (this.subtitleTF){
this.subtitleTF.htmlText = Localization.getWord(this.subtitle_id);
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.highscores
Section 548
//HighscoresMochiError (ru.zedarus.games.zedengine.userinterface.windows.highscores.HighscoresMochiError)
package ru.zedarus.games.zedengine.userinterface.windows.highscores {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.services.*;
public class HighscoresMochiError extends VisualElement {
private var content_text_fields:Array;
public var close_window_button:MovieClip;
private var content_text_ids:Array;
public function HighscoresMochiError():void{
var _local1:TextField;
content_text_fields = new Array();
content_text_ids = new Array();
super();
this.alpha = 0;
if (this.close_window_button){
this.close_window_button.buttonMode = true;
this.close_window_button.useHandCursor = true;
this.close_window_button.addEventListener(MouseEvent.CLICK, this.close);
};
var _local2:Number = 1;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is TextField)){
_local1 = (this.getChildAt(_local2) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
_local2++;
};
}
public function localize():void{
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.highscores
Section 549
//HighscoresMochiLoading (ru.zedarus.games.zedengine.userinterface.windows.highscores.HighscoresMochiLoading)
package ru.zedarus.games.zedengine.userinterface.windows.highscores {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.services.*;
public class HighscoresMochiLoading extends VisualElement {
private var content_text_fields:Array;
public var close_window_button:MovieClip;
private var content_text_ids:Array;
public function HighscoresMochiLoading():void{
var _local1:TextField;
content_text_fields = new Array();
content_text_ids = new Array();
super();
this.alpha = 0;
if (this.close_window_button){
this.close_window_button.buttonMode = true;
this.close_window_button.useHandCursor = true;
this.close_window_button.addEventListener(MouseEvent.CLICK, this.close);
};
var _local2:Number = 1;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is TextField)){
_local1 = (this.getChildAt(_local2) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
_local2++;
};
}
public function localize():void{
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.highscores
Section 550
//LevelSelect (ru.zedarus.games.zedengine.userinterface.windows.levelselect.LevelSelect)
package ru.zedarus.games.zedengine.userinterface.windows.levelselect {
import flash.text.*;
import ru.zedarus.games.zedengine.screens.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.game.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
public class LevelSelect extends Window {
public var level_38:LevelSelectItem;
public var level_39:LevelSelectItem;
public var level_35:LevelSelectItem;
public var level_40:LevelSelectItem;
public var level_41:LevelSelectItem;
public var level_42:LevelSelectItem;
public var level_43:LevelSelectItem;
public var level_44:LevelSelectItem;
public var level_45:LevelSelectItem;
public var level_46:LevelSelectItem;
public var level_47:LevelSelectItem;
public var level_48:LevelSelectItem;
public var level_49:LevelSelectItem;
public var activation_block:LevelSelectActivationBlock;
public var level_1:LevelSelectItem;
public var level_2:LevelSelectItem;
public var level_3:LevelSelectItem;
public var level_4:LevelSelectItem;
public var level_5:LevelSelectItem;
public var level_6:LevelSelectItem;
public var level_7:LevelSelectItem;
public var level_8:LevelSelectItem;
public var level_9:LevelSelectItem;
private var content_text_fields:Array;
public var level_50:LevelSelectItem;
private var levels:Array;
private var content_text_ids:Array;
public var level_10:LevelSelectItem;
public var level_11:LevelSelectItem;
public var level_12:LevelSelectItem;
public var level_13:LevelSelectItem;
public var level_14:LevelSelectItem;
public var level_15:LevelSelectItem;
public var level_16:LevelSelectItem;
public var level_17:LevelSelectItem;
public var level_18:LevelSelectItem;
public var level_19:LevelSelectItem;
public var walkt:Walkthrough;
public var level_21:LevelSelectItem;
public var level_22:LevelSelectItem;
public var level_23:LevelSelectItem;
public var level_24:LevelSelectItem;
public var level_26:LevelSelectItem;
public var level_20:LevelSelectItem;
public var level_28:LevelSelectItem;
public var level_29:LevelSelectItem;
public var level_25:LevelSelectItem;
public var level_27:LevelSelectItem;
public var level_30:LevelSelectItem;
public var level_31:LevelSelectItem;
public var level_32:LevelSelectItem;
public var level_33:LevelSelectItem;
public var level_34:LevelSelectItem;
public var level_36:LevelSelectItem;
public var level_37:LevelSelectItem;
public function LevelSelect():void{
var _local1:TextField;
var _local2:LevelSelectItem;
content_text_fields = new Array();
content_text_ids = new Array();
levels = new Array();
super();
this.alpha = 0;
if (this.activation_block){
this.activation_block.addEventListener(LevelSelectEvent.UNBLOCK_LEVEL, this.activateLevelByCode);
};
var _local3:Number = 1;
while (_local3 < this.numChildren) {
if ((this.getChildAt(_local3) is TextField)){
if (this.getChildAt(_local3) != this.textLabel_title){
_local1 = (this.getChildAt(_local3) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
} else {
if ((this.getChildAt(_local3) is LevelSelectItem)){
_local2 = (this.getChildAt(_local3) as LevelSelectItem);
this.levels.push(_local2);
};
};
_local3++;
};
this.updateLevelsState();
}
override public function localize():void{
var _local2:LevelSelectItem;
super.localize();
if (this.close_window_button){
this.close_window_button.localize();
};
if (this.activation_block){
this.activation_block.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
for each (_local2 in this.levels) {
_local2.localize();
};
}
private function activateLevelByCode(_arg1:LevelSelectEvent):void{
this.dispatchEvent(new LevelSelectEvent(_arg1.type, 0, _arg1.level_code));
}
private function showLevels():void{
var _local1:LevelSelectItem;
for each (_local1 in this.levels) {
_local1.setComplitionStatus(GameSessionData.isLevelCompleted(_local1.id));
_local1.show();
};
}
public function updateLevelsState(_arg1:Boolean=false, _arg2:Boolean=false):void{
var _local3:LevelSelectItem;
for each (_local3 in this.levels) {
if (GameSessionData.isLevelUnblocked(_local3.id)){
_local3.activate();
_local3.addEventListener(LevelSelectEvent.SHOW_LEVEL, this.selectLevel);
} else {
_local3.deactivate();
};
};
if (_arg1){
if (!_arg2){
this.activation_block.setResponseText("error");
this.stage.focus = null;
} else {
this.activation_block.setResponseText("success");
this.stage.focus = null;
};
};
}
private function selectLevel(_arg1:LevelSelectEvent):void{
this.dispatchEvent(new LevelSelectEvent(_arg1.type, _arg1.level_id));
}
override public function show():void{
super.show();
if (this.activation_block){
this.activation_block.show();
};
this.showLevels();
this.localize();
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.levelselect
Section 551
//LevelSelectActivateButton (ru.zedarus.games.zedengine.userinterface.windows.levelselect.LevelSelectActivateButton)
package ru.zedarus.games.zedengine.userinterface.windows.levelselect {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class LevelSelectActivateButton extends VisualElement {
public var body:MovieClip;
public var clickzone:Sprite;
public var titleTF:TextField;
public function LevelSelectActivateButton():void{
this.mouseEnabled = false;
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.click);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
if (this.titleTF){
this.titleTF.mouseEnabled = false;
this.titleTF.autoSize = this.titleTF.getTextFormat().align;
this.titleTF.wordWrap = this.titleTF.multiline;
};
}
public function localize():void{
if (this.titleTF){
this.titleTF.htmlText = Localization.getWord("levelselect_activation_button");
};
if (((this.body) && (this.titleTF))){
if (this.titleTF.getTextFormat().align == "left"){
this.body.width = (this.titleTF.width + (this.titleTF.x * 2));
};
if (this.titleTF.getTextFormat().align == "center"){
this.body.x = this.titleTF.x;
this.body.width = this.titleTF.width;
};
};
if (this.clickzone){
this.clickzone.x = this.body.x;
this.clickzone.width = this.body.width;
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.levelselect
Section 552
//LevelSelectActivationBlock (ru.zedarus.games.zedengine.userinterface.windows.levelselect.LevelSelectActivationBlock)
package ru.zedarus.games.zedengine.userinterface.windows.levelselect {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class LevelSelectActivationBlock extends VisualElement {
private var current_code_message:String;// = "levelselect_activation_init"
private var content_text_fields:Array;
public var unblockTF:TextField;
public var codeField:MovieClip;
public var activate_button:LevelSelectActivateButton;
public var codeTF:TextField;
private var space_bwn_field_n_button:Number;
private var space_bwn_code_n_button:Number;
private var content_text_ids:Array;
private var space_bwn_text_n_button:Number;
public function LevelSelectActivationBlock():void{
var _local1:TextField;
var _local2:LevelSelectItem;
content_text_fields = new Array();
content_text_ids = new Array();
super();
if (this.activate_button){
this.activate_button.setStateToActive();
this.activate_button.show();
this.activate_button.addEventListener(MouseEvent.CLICK, this.activateLevelByCode);
};
if (this.codeTF){
this.codeTF.addEventListener(KeyboardEvent.KEY_DOWN, this.codeKeyHit);
this.codeTF.addEventListener(FocusEvent.FOCUS_IN, this.codeFocus);
};
if (((this.activate_button) && (this.codeTF))){
this.space_bwn_code_n_button = (this.codeTF.x - this.activate_button.x);
};
if (((this.activate_button) && (this.codeField))){
this.space_bwn_field_n_button = (this.codeField.x - this.activate_button.x);
};
if (((this.activate_button) && (this.unblockTF))){
this.space_bwn_text_n_button = (this.unblockTF.x - this.activate_button.x);
};
var _local3:Number = 0;
while (_local3 < this.numChildren) {
if ((this.getChildAt(_local3) is TextField)){
if (this.getChildAt(_local3) != this.codeTF){
_local1 = (this.getChildAt(_local3) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
};
_local3++;
};
}
private function codeKeyHit(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 13){
this.activateLevelByCode(null);
};
}
public function localize():void{
if (this.codeTF){
this.codeTF.htmlText = Localization.getWord(this.current_code_message);
};
if (this.activate_button){
this.activate_button.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
if (Settings.VISUAL_LEVEL_ACTIVATION_BLOCK_ALIGN == "right"){
if (this.activate_button){
this.activate_button.x = -(this.activate_button.width);
};
if (this.codeTF){
this.codeTF.x = (this.activate_button.x + this.space_bwn_code_n_button);
};
if (this.codeField){
this.codeField.x = (this.activate_button.x + this.space_bwn_field_n_button);
};
if (this.unblockTF){
this.unblockTF.x = (this.activate_button.x + this.space_bwn_text_n_button);
};
} else {
if (Settings.VISUAL_LEVEL_ACTIVATION_BLOCK_ALIGN == "left"){
if (this.unblockTF){
this.unblockTF.x = 0;
};
if (this.activate_button){
this.activate_button.x = (this.unblockTF.x - this.space_bwn_text_n_button);
};
if (this.codeTF){
this.codeTF.x = (this.activate_button.x + this.space_bwn_code_n_button);
};
if (this.codeField){
this.codeField.x = (this.activate_button.x + this.space_bwn_field_n_button);
};
};
};
}
public function setResponseText(_arg1:String):void{
if (_arg1 == "error"){
_arg1 = "levelselect_activation_error";
};
if (_arg1 == "success"){
_arg1 = "levelselect_activation_success";
};
this.codeTF.htmlText = Localization.getWord(_arg1);
this.current_code_message = _arg1;
}
private function activateLevelByCode(_arg1:MouseEvent):void{
this.dispatchEvent(new LevelSelectEvent(LevelSelectEvent.UNBLOCK_LEVEL, 0, this.codeTF.text));
}
private function codeFocus(_arg1:FocusEvent):void{
this.codeTF.text = "";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.levelselect
Section 553
//LevelSelectEvent (ru.zedarus.games.zedengine.userinterface.windows.levelselect.LevelSelectEvent)
package ru.zedarus.games.zedengine.userinterface.windows.levelselect {
import flash.events.*;
public class LevelSelectEvent extends Event {
public var level_code:String;
public var level_id:Number;
public static const UNBLOCK_LEVEL:String = "UNBLOCK_LEVEL";
public static const SHOW_LEVEL:String = "SHOW_LEVEL";
public function LevelSelectEvent(_arg1:String, _arg2:Number=0, _arg3:String=""):void{
super(_arg1);
this.level_id = _arg2;
this.level_code = _arg3;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.levelselect
Section 554
//LevelSelectItem (ru.zedarus.games.zedengine.userinterface.windows.levelselect.LevelSelectItem)
package ru.zedarus.games.zedengine.userinterface.windows.levelselect {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class LevelSelectItem extends VisualElement {
public var clickzone:Sprite;
public var titleTF:TextField;
public var gap:Sprite;
public var icon:MovieClip;
public var id:Number;
public function LevelSelectItem():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.sendMessage);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
if (this.titleTF){
this.titleTF.mouseEnabled = false;
this.titleTF.autoSize = this.titleTF.getTextFormat().align;
this.titleTF.wordWrap = this.titleTF.multiline;
};
this.id = Number(this.name.split("_")[1]);
if (this.icon){
this.icon.pack.gotoAndStop((this.id + 1));
};
}
public function setComplitionStatus(_arg1:Boolean):void{
if (this.gap){
this.gap.visible = _arg1;
};
}
public function localize():void{
if (((this.titleTF) && (this.id))){
this.titleTF.htmlText = Localization.getWord(("levelselect_leveltitle_" + this.id));
};
}
public function deactivate():void{
this.setStateToInactive();
this.clickzone.visible = false;
}
public function activate():void{
this.setStateToActive();
this.clickzone.visible = true;
}
protected function sendMessage(_arg1:MouseEvent):void{
this.dispatchEvent(new LevelSelectEvent(LevelSelectEvent.SHOW_LEVEL, this.id));
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.levelselect
Section 555
//LoadGame (ru.zedarus.games.zedengine.userinterface.windows.loadgame.LoadGame)
package ru.zedarus.games.zedengine.userinterface.windows.loadgame {
import flash.text.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.game.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
public class LoadGame extends Window {
public var slot_10:LoadGameItem;
public var slot_11:LoadGameItem;
public var slot_13:LoadGameItem;
public var slot_17:LoadGameItem;
public var slot_14:LoadGameItem;
public var slot_16:LoadGameItem;
public var slot_12:LoadGameItem;
public var slot_15:LoadGameItem;
public var slot_18:LoadGameItem;
public var slot_19:LoadGameItem;
public var slot_20:LoadGameItem;
public var slot_21:LoadGameItem;
public var slot_22:LoadGameItem;
public var slot_23:LoadGameItem;
public var slot_24:LoadGameItem;
public var slot_25:LoadGameItem;
public var slot_26:LoadGameItem;
public var slot_27:LoadGameItem;
public var slot_28:LoadGameItem;
public var slot_29:LoadGameItem;
public var slot_1:LoadGameItem;
public var slot_2:LoadGameItem;
public var slot_3:LoadGameItem;
public var slot_4:LoadGameItem;
public var slot_5:LoadGameItem;
private var slots:Array;
public var slot_7:LoadGameItem;
public var slot_8:LoadGameItem;
public var slot_9:LoadGameItem;
public var slot_6:LoadGameItem;
public var slot_33:LoadGameItem;
public var slot_35:LoadGameItem;
private var content_text_fields:Array;
public var slot_32:LoadGameItem;
public var slot_34:LoadGameItem;
public var slot_36:LoadGameItem;
public var slot_30:LoadGameItem;
public var slot_37:LoadGameItem;
public var slot_38:LoadGameItem;
public var slot_39:LoadGameItem;
public var slot_31:LoadGameItem;
public var slot_40:LoadGameItem;
public var slot_41:LoadGameItem;
public var slot_42:LoadGameItem;
public var slot_44:LoadGameItem;
public var slot_46:LoadGameItem;
public var slot_48:LoadGameItem;
public var slot_43:LoadGameItem;
public var slot_45:LoadGameItem;
public var slot_47:LoadGameItem;
public var slot_49:LoadGameItem;
public var slot_50:LoadGameItem;
private var content_text_ids:Array;
public function LoadGame():void{
var _local1:TextField;
var _local2:LoadGameItem;
content_text_fields = new Array();
content_text_ids = new Array();
slots = new Array();
super();
this.alpha = 0;
var _local3:Number = 1;
while (_local3 < this.numChildren) {
if ((this.getChildAt(_local3) is TextField)){
if (this.getChildAt(_local3) != this.textLabel_title){
_local1 = (this.getChildAt(_local3) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
} else {
if ((this.getChildAt(_local3) is LoadGameItem)){
_local2 = (this.getChildAt(_local3) as LoadGameItem);
_local2.addEventListener(LoadGameEvent.LOAD_GAME, this.selectSlot);
this.slots.push(_local2);
};
};
_local3++;
};
this.showSlots();
this.updateSlotsState();
}
public function updateSlotsState():void{
var _local1:LoadGameItem;
for each (_local1 in this.slots) {
if (GameSessionData.isSaveGameSlotExists(_local1.id)){
_local1.activate(GameSessionData.getSaveGameDate(_local1.id));
} else {
_local1.deactivate();
};
};
}
override public function localize():void{
var _local2:LoadGameItem;
super.localize();
if (this.close_window_button){
this.close_window_button.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
for each (_local2 in this.slots) {
_local2.localize();
};
}
private function selectSlot(_arg1:LoadGameEvent):void{
this.dispatchEvent(new LoadGameEvent(_arg1.type, _arg1.slot_id));
}
private function showSlots():void{
var _local1:LoadGameItem;
for each (_local1 in this.slots) {
_local1.show();
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.loadgame
Section 556
//LoadGameEvent (ru.zedarus.games.zedengine.userinterface.windows.loadgame.LoadGameEvent)
package ru.zedarus.games.zedengine.userinterface.windows.loadgame {
import flash.events.*;
public class LoadGameEvent extends Event {
public var slot_id:Number;
public static const LOAD_GAME:String = "LOAD_GAME";
public function LoadGameEvent(_arg1:String, _arg2:Number=0):void{
super(_arg1);
this.slot_id = _arg2;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.loadgame
Section 557
//LoadGameItem (ru.zedarus.games.zedengine.userinterface.windows.loadgame.LoadGameItem)
package ru.zedarus.games.zedengine.userinterface.windows.loadgame {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class LoadGameItem extends VisualElement {
public var dateTF:TextField;
public var clickzone:Sprite;
public var titleTF:TextField;
private var state_word:String;
public var icon:MovieClip;
public var id:Number;
public function LoadGameItem():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.sendMessage);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
if (this.titleTF){
this.titleTF.mouseEnabled = false;
this.titleTF.autoSize = this.titleTF.getTextFormat().align;
this.titleTF.wordWrap = this.titleTF.multiline;
};
if (this.dateTF){
this.dateTF.mouseEnabled = false;
this.dateTF.autoSize = this.dateTF.getTextFormat().align;
this.dateTF.wordWrap = this.dateTF.multiline;
};
this.id = Number(this.name.split("_")[1]);
this.icon.pack.gotoAndStop((this.id + 1));
this.state_word = "loadgame_slot_empty";
}
public function localize():void{
if (((this.titleTF) && (this.id))){
this.titleTF.htmlText = Localization.getWord(this.state_word);
};
if (((this.dateTF) && (!(this.active)))){
this.dateTF.htmlText = Localization.getWord("loadgame_date");
};
}
public function deactivate():void{
this.setStateToInactive();
this.state_word = "loadgame_slot_empty";
this.clickzone.visible = false;
this.localize();
}
public function activate(_arg1:String):void{
this.setStateToActive();
this.state_word = ("loadgame_slot_" + this.id);
if (this.dateTF){
this.dateTF.htmlText = _arg1;
};
this.clickzone.visible = true;
this.localize();
}
private function sendMessage(_arg1:MouseEvent):void{
this.dispatchEvent(new LoadGameEvent(LoadGameEvent.LOAD_GAME, this.id));
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.loadgame
Section 558
//CreditsButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.CreditsButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class CreditsButton extends MainMenuButton {
public function CreditsButton():void{
this.word_id = "menu_credits";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 559
//HelpButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.HelpButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class HelpButton extends MainMenuButton {
public function HelpButton():void{
this.word_id = "menu_help";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 560
//HighscoresButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.HighscoresButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
import flash.net.*;
import com.gamezhero.api.as3.*;
public class HighscoresButton extends MainMenuButton {
public function HighscoresButton():void{
this.word_id = "menu_highscores";
}
override public function click(_arg1:MouseEvent):void{
if (Settings.USE_ARMORSCORES){
navigateToURL(new URLRequest(Settings.ARMORSCORES_URL), "_blank");
} else {
if (Settings.USE_GAMEZHERO_SCORES){
GamezheroApi.linkTopScore();
} else {
super.click(_arg1);
};
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 561
//LoadGameButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.LoadGameButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class LoadGameButton extends MainMenuButton {
public function LoadGameButton():void{
this.word_id = "menu_load_game";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 562
//MoreGamesButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.MoreGamesButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
import flash.net.*;
import com.gamezhero.api.as3.*;
public class MoreGamesButton extends MainMenuButton {
public function MoreGamesButton():void{
this.word_id = "menu_more_games";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
if (Settings.BRANDING == Settings.GAMEZHERO){
GamezheroApi.linkMoreGames();
} else {
if (Settings.MORE_GAMES_LINK){
navigateToURL(new URLRequest(Settings.MORE_GAMES_LINK), "_blank");
};
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 563
//NewGameButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.NewGameButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class NewGameButton extends MainMenuButton {
public function NewGameButton():void{
this.word_id = "menu_new_game";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 564
//OptionsButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.OptionsButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class OptionsButton extends MainMenuButton {
public function OptionsButton():void{
this.word_id = "menu_options";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 565
//ResumeGameButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.ResumeGameButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class ResumeGameButton extends MainMenuButton {
public function ResumeGameButton():void{
this.word_id = "menu_resume_game";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 566
//SaveGameButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.SaveGameButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class SaveGameButton extends MainMenuButton {
public function SaveGameButton():void{
this.word_id = "menu_save_game";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 567
//SelectLevelButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.SelectLevelButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
public class SelectLevelButton extends MainMenuButton {
public function SelectLevelButton():void{
this.word_id = "menu_select_level";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 568
//SendToFriendButton (ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.SendToFriendButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
import flash.net.*;
import com.gamezhero.api.as3.*;
public class SendToFriendButton extends MainMenuButton {
public function SendToFriendButton():void{
this.word_id = "send_to_friend";
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
if (Settings.BRANDING == Settings.GAMEZHERO){
GamezheroApi.linkSendToFrined();
} else {
if (Settings.MORE_GAMES_LINK){
navigateToURL(new URLRequest(Settings.MORE_GAMES_LINK), "_blank");
};
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu.buttons
Section 569
//MainMenu (ru.zedarus.games.zedengine.userinterface.windows.menu.MainMenu)
package ru.zedarus.games.zedengine.userinterface.windows.menu {
import ru.zedarus.games.zedengine.screens.*;
import ru.zedarus.games.zedengine.game.*;
import ru.zedarus.games.redstarfall.hud.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.buttons.*;
public class MainMenu extends Window {
public var new_game_button:NewGameButton;
private var buttons:Array;
public var load_game_button:LoadGameButton;
public var resume_game_button:ResumeGameButton;
private var last_game_state:int;
public var too_hard_banner:RedstarfallHUDTooHardBanner;
public var save_game_button:SaveGameButton;
public var more_games_button:MoreGamesButton;
public var highscores_button:HighscoresButton;
public var select_level_button:SelectLevelButton;
public var options_button:OptionsButton;
public var help_button:HelpButton;
public var send_friend_button:SendToFriendButton;
public var credits_button:CreditsButton;
public var sponsor_logo:SponsorLogo;
public function MainMenu():void{
var _local1:MainMenuButton;
buttons = new Array();
super();
this.alpha = 0;
if (this.too_hard_banner){
this.too_hard_banner.show();
};
if (this.new_game_button){
this.buttons.push(this.new_game_button);
};
if (this.resume_game_button){
this.buttons.push(this.resume_game_button);
};
if (this.select_level_button){
this.buttons.push(this.select_level_button);
};
if (this.load_game_button){
this.buttons.push(this.load_game_button);
};
if (this.save_game_button){
this.buttons.push(this.save_game_button);
};
if (this.help_button){
this.buttons.push(this.help_button);
};
if (this.highscores_button){
this.buttons.push(this.highscores_button);
};
if (this.credits_button){
this.buttons.push(this.credits_button);
};
if (this.more_games_button){
this.buttons.push(this.more_games_button);
};
if (this.options_button){
this.buttons.push(this.options_button);
};
if (this.send_friend_button){
this.buttons.push(this.send_friend_button);
};
for each (_local1 in this.buttons) {
_local1.show();
_local1.addEventListener(MainMenuEvent.BUTTON_CLICKED, this.eventGenerator);
};
}
public function update(_arg1:int):void{
if (_arg1 != this.last_game_state){
if ((((((_arg1 == GameState.NOT_STARTED)) || ((_arg1 == GameState.LOSE)))) || ((_arg1 == GameState.WIN)))){
if (this.resume_game_button){
this.resume_game_button.deactivate();
};
if (this.save_game_button){
this.save_game_button.deactivate();
};
} else {
if (this.resume_game_button){
this.resume_game_button.activate();
};
if (this.save_game_button){
this.save_game_button.activate();
};
};
if (this.new_game_button){
this.new_game_button.activate();
};
if (this.select_level_button){
this.select_level_button.activate();
};
if (this.load_game_button){
this.load_game_button.activate();
};
if (this.help_button){
this.help_button.activate();
};
if (this.highscores_button){
this.highscores_button.activate();
};
if (this.credits_button){
this.credits_button.activate();
};
if (this.more_games_button){
this.more_games_button.activate();
};
if (this.send_friend_button){
this.send_friend_button.activate();
};
if (this.options_button){
this.options_button.activate();
};
this.last_game_state = _arg1;
};
}
override public function localize():void{
var _local1:MainMenuButton;
super.localize();
for each (_local1 in this.buttons) {
_local1.localize();
};
}
private function eventGenerator(_arg1:MainMenuEvent):void{
if ((_arg1.button is NewGameButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.START_NEW_GAME));
};
if ((_arg1.button is ResumeGameButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.RESUME_GAME));
};
if ((_arg1.button is OptionsButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.SHOW_OPTIONS));
};
if ((_arg1.button is HelpButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.SHOW_HELP));
};
if ((_arg1.button is HighscoresButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.SHOW_HIGHSCORES));
};
if ((_arg1.button is CreditsButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.SHOW_CREDITS));
};
if ((_arg1.button is SelectLevelButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.SHOW_LEVELS));
};
if ((_arg1.button is SaveGameButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.SHOW_SAVE_SCREEN));
};
if ((_arg1.button is LoadGameButton)){
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.SHOW_LOAD_SCREEN));
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu
Section 570
//MainMenuButton (ru.zedarus.games.zedengine.userinterface.windows.menu.MainMenuButton)
package ru.zedarus.games.zedengine.userinterface.windows.menu {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
import fl.transitions.easing.*;
public class MainMenuButton extends VisualElement {
public var titleTF:TextField;
public var titleMC:MovieClip;
protected var word_id:String;
public var clickzone:MovieClip;
public function MainMenuButton():void{
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
this.clickzone.addEventListener(MouseEvent.CLICK, this.click);
if (this.titleMC){
this.titleMC.titleTF.mouseEnabled = false;
this.titleMC.titleTF.autoSize = this.titleMC.titleTF.getTextFormat().align;
this.titleMC.titleTF.wordWrap = false;
};
}
private function resizeClickzone():void{
if (this.titleMC.titleTF){
this.clickzone.width = this.titleMC.titleTF.width;
};
}
public function localize():void{
if (this.titleMC.titleTF){
this.titleMC.titleTF.htmlText = Localization.getWord(this.word_id);
};
this.resizeClickzone();
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
this.dispatchEvent(new MainMenuEvent(MainMenuEvent.BUTTON_CLICKED, this));
}
public function activate():void{
this.setStateToActive();
this.clickzone.visible = true;
}
public function deactivate():void{
this.setStateToInactive();
this.clickzone.visible = false;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu
Section 571
//MainMenuEvent (ru.zedarus.games.zedengine.userinterface.windows.menu.MainMenuEvent)
package ru.zedarus.games.zedengine.userinterface.windows.menu {
import flash.events.*;
public class MainMenuEvent extends Event {
public var button:Object;
public static const SHOW_LEVELS:String = "SHOW_LEVELS";
public static const SHOW_LOAD_SCREEN:String = "SHOW_LOAD_SCREEN";
public static const RESUME_GAME:String = "RESUME_GAME";
public static const SHOW_HIGHSCORES:String = "SHOW_HIGHSCORES";
public static const SHOW_CREDITS:String = "SHOW_CREDITS";
public static const SHOW_HELP:String = "SHOW_HELP";
public static const SHOW_SAVE_SCREEN:String = "SHOW_SAVE_SCREEN";
public static const START_NEW_GAME:String = "START_NEW_GAME";
public static const BUTTON_CLICKED:String = "BUTTON_CLICKED";
public static const SHOW_OPTIONS:String = "SHOW_OPTIONS";
public function MainMenuEvent(_arg1:String, _arg2:Object=null):void{
super(_arg1);
this.button = _arg2;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.menu
Section 572
//OptionsCheckbox (ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes.OptionsCheckbox)
package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes {
import flash.events.*;
import flash.display.*;
import ru.zedarus.games.zedengine.visualelements.*;
public class OptionsCheckbox extends VisualElement {
protected var __value:Boolean;// = false
public var clickzone:Sprite;
public function OptionsCheckbox():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.click);
};
this.update();
}
public function get value():Boolean{
return (this.__value);
}
protected function update():void{
if (this.value){
this.setStateToActive();
this.gotoAndStop(2);
} else {
this.setStateToInactive();
this.gotoAndStop(1);
};
}
public function set value(_arg1:Boolean):void{
this.__value = _arg1;
this.update();
}
override public function click(_arg1:MouseEvent):void{
super.click(_arg1);
if (this.value){
this.value = false;
} else {
this.value = true;
};
this.update();
this.dispatchEvent(new OptionsCheckboxEvent(OptionsCheckboxEvent.CHANGE, this.value));
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes
Section 573
//OptionsCheckboxEvent (ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes.OptionsCheckboxEvent)
package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes {
import flash.events.*;
public class OptionsCheckboxEvent extends Event {
public var new_value:Boolean;
public static const CHANGE:String = "CHANGED";
public function OptionsCheckboxEvent(_arg1:String, _arg2:Boolean=false):void{
super(_arg1);
this.new_value = _arg2;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes
Section 574
//OptionsCheckboxMusic (ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes.OptionsCheckboxMusic)
package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes {
public class OptionsCheckboxMusic extends OptionsCheckbox {
public function OptionsCheckboxMusic():void{
this.value = Settings.TOGGLE_MUSIC;
this.update();
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes
Section 575
//OptionsCheckboxSound (ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes.OptionsCheckboxSound)
package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes {
public class OptionsCheckboxSound extends OptionsCheckbox {
public function OptionsCheckboxSound():void{
this.value = Settings.TOGGLE_SOUND;
this.update();
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes
Section 576
//OptionsFlag (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlag)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class OptionsFlag extends VisualElement {
public var flag:MovieClip;
public var titleTF:TextField;
protected var lang_id:String;
public var clickzone:Sprite;
protected var lang_name:String;
public function OptionsFlag():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.sendMessage);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
if (this.titleTF){
this.titleTF.mouseEnabled = false;
this.titleTF.autoSize = this.titleTF.getTextFormat().align;
this.titleTF.wordWrap = false;
};
}
private function deactivate():void{
this.setStateToInactive();
}
public function localize():void{
if (((this.titleTF) && (this.lang_name))){
this.titleTF.htmlText = Localization.getWord(this.lang_name);
};
if (Localization.getCurrentLanguage() != this.lang_id){
this.deactivate();
} else {
this.activate();
};
if (this.flag){
this.flag.current_flag.gotoAndStop(this.lang_id);
};
}
private function activate():void{
this.setStateToActive();
}
private function sendMessage(_arg1:MouseEvent):void{
this.dispatchEvent(new OptionsFlagEvent(OptionsFlagEvent.CHANGE_LANG, this.lang_id));
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 577
//OptionsFlagCH (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagCH)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagCH extends OptionsFlag {
public function OptionsFlagCH():void{
this.lang_id = "ch";
this.lang_name = "options_lang_ch";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 578
//OptionsFlagDE (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagDE)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagDE extends OptionsFlag {
public function OptionsFlagDE():void{
this.lang_id = "de";
this.lang_name = "options_lang_de";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 579
//OptionsFlagEN (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagEN)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagEN extends OptionsFlag {
public function OptionsFlagEN():void{
this.lang_id = "en";
this.lang_name = "options_lang_en";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 580
//OptionsFlagES (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagES)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagES extends OptionsFlag {
public function OptionsFlagES():void{
this.lang_id = "es";
this.lang_name = "options_lang_es";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 581
//OptionsFlagEvent (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagEvent)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
import flash.events.*;
public class OptionsFlagEvent extends Event {
public var to_lang:String;
public static const CHANGE_LANG:String = "CHANGE_LANG";
public function OptionsFlagEvent(_arg1:String, _arg2:String=null):void{
super(_arg1);
this.to_lang = _arg2;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 582
//OptionsFlagFR (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagFR)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagFR extends OptionsFlag {
public function OptionsFlagFR():void{
this.lang_id = "fr";
this.lang_name = "options_lang_fr";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 583
//OptionsFlagIT (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagIT)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagIT extends OptionsFlag {
public function OptionsFlagIT():void{
this.lang_id = "it";
this.lang_name = "options_lang_it";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 584
//OptionsFlagJP (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagJP)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagJP extends OptionsFlag {
public function OptionsFlagJP():void{
this.lang_id = "jp";
this.lang_name = "options_lang_jp";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 585
//OptionsFlagRU (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagRU)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagRU extends OptionsFlag {
public function OptionsFlagRU():void{
this.lang_id = "ru";
this.lang_name = "options_lang_ru";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 586
//OptionsFlagsManager (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagsManager)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
import ru.zedarus.games.zedengine.visualelements.*;
public class OptionsFlagsManager extends VisualElement {
private var flags:Array;
public function OptionsFlagsManager():void{
var _local1:OptionsFlag;
flags = new Array();
super();
this.findAndInitFlags();
for each (_local1 in this.flags) {
_local1.show();
_local1.addEventListener(OptionsFlagEvent.CHANGE_LANG, this.translateMessage);
};
}
private function translateMessage(_arg1:OptionsFlagEvent):void{
this.dispatchEvent(new OptionsFlagEvent(_arg1.type, _arg1.to_lang));
}
private function findAndInitFlags():void{
var _local1:Number = 1;
while (_local1 < this.numChildren) {
if ((this.getChildAt(_local1) is OptionsFlagEN)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagEN));
};
if ((this.getChildAt(_local1) is OptionsFlagUS)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagUS));
};
if ((this.getChildAt(_local1) is OptionsFlagRU)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagRU));
};
if ((this.getChildAt(_local1) is OptionsFlagUA)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagUA));
};
if ((this.getChildAt(_local1) is OptionsFlagIT)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagIT));
};
if ((this.getChildAt(_local1) is OptionsFlagES)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagES));
};
if ((this.getChildAt(_local1) is OptionsFlagDE)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagDE));
};
if ((this.getChildAt(_local1) is OptionsFlagFR)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagFR));
};
if ((this.getChildAt(_local1) is OptionsFlagCH)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagCH));
};
if ((this.getChildAt(_local1) is OptionsFlagJP)){
this.flags.push((this.getChildAt(_local1) as OptionsFlagJP));
};
_local1++;
};
}
public function localize():void{
var _local1:OptionsFlag;
for each (_local1 in this.flags) {
_local1.localize();
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 587
//OptionsFlagUA (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagUA)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagUA extends OptionsFlag {
public function OptionsFlagUA():void{
this.lang_id = "ua";
this.lang_name = "options_lang_ua";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 588
//OptionsFlagUS (ru.zedarus.games.zedengine.userinterface.windows.options.flags.OptionsFlagUS)
package ru.zedarus.games.zedengine.userinterface.windows.options.flags {
public class OptionsFlagUS extends OptionsFlag {
public function OptionsFlagUS():void{
this.lang_id = "us";
this.lang_name = "options_lang_us";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.flags
Section 589
//OptionsMusicSlider (ru.zedarus.games.zedengine.userinterface.windows.options.sliders.OptionsMusicSlider)
package ru.zedarus.games.zedengine.userinterface.windows.options.sliders {
public class OptionsMusicSlider extends OptionsSlider {
public function OptionsMusicSlider():void{
this.value = Settings.MUSIC_VOLUME;
this.update();
this.word1_id = "options_music_low";
this.word2_id = "options_music_high";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.sliders
Section 590
//OptionsQualitySlider (ru.zedarus.games.zedengine.userinterface.windows.options.sliders.OptionsQualitySlider)
package ru.zedarus.games.zedengine.userinterface.windows.options.sliders {
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.localization.*;
public class OptionsQualitySlider extends OptionsSlider {
private var word3_id:String;
public var textLabel_center:TextField;
public function OptionsQualitySlider():void{
switch (Settings.START_QUALITY){
case StageQuality.LOW:
this.value = 0;
break;
case StageQuality.MEDIUM:
this.value = 0.5;
break;
case StageQuality.HIGH:
this.value = 1;
break;
};
this.update();
this.word1_id = "options_quality_low";
this.word3_id = "options_quality_medium";
this.word2_id = "options_quality_high";
if (this.textLabel_center){
this.textLabel_center.mouseEnabled = false;
this.textLabel_center.autoSize = this.textLabel_center.getTextFormat().align;
this.textLabel_center.wordWrap = false;
};
this.step = 0.5;
}
override public function localize():void{
super.localize();
if (this.textLabel_center){
this.textLabel_center.htmlText = Localization.getWord(this.word3_id);
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.sliders
Section 591
//OptionsSlider (ru.zedarus.games.zedengine.userinterface.windows.options.sliders.OptionsSlider)
package ru.zedarus.games.zedengine.userinterface.windows.options.sliders {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import fl.transitions.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.input.*;
import fl.transitions.easing.*;
public class OptionsSlider extends VisualElement {
public var panel_back:MovieClip;
public var step:Number;// = 0
private var tween_to:Number;
protected var __value:Number;// = 1
protected var word2_id:String;// = "1"
private var change_pointer_tween:Tween;
private var change_tween:Tween;
public var panel_active:MovieClip;
public var textLabel_right:TextField;
private var pointer_clicked:Boolean;// = false
private var clicked:Boolean;// = false
protected var word1_id:String;// = "0"
public var clickzone:MovieClip;
public var pointer:MovieClip;
public var textLabel_left:TextField;
public function OptionsSlider():void{
this.show();
if (this.pointer){
this.pointer.buttonMode = true;
this.pointer.useHandCursor = true;
this.pointer.clickzone.alpha = 0;
this.pointer.clickzone.addEventListener(MouseEvent.MOUSE_DOWN, this.pointerDown);
};
if (this.clickzone){
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.alpha = 0;
this.clickzone.addEventListener(MouseEvent.MOUSE_DOWN, this.mouseDown);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
this.clickzone.addEventListener(Event.ENTER_FRAME, this.mouseMove);
};
if (this.panel_active){
this.__value = (this.panel_active.width / this.panel_back.width);
};
if (this.textLabel_left){
this.textLabel_left.mouseEnabled = false;
this.textLabel_left.autoSize = this.textLabel_left.getTextFormat().align;
this.textLabel_left.wordWrap = false;
};
if (this.textLabel_right){
this.textLabel_right.mouseEnabled = false;
this.textLabel_right.autoSize = this.textLabel_right.getTextFormat().align;
this.textLabel_right.wordWrap = false;
};
}
private function pointerDown(_arg1:MouseEvent):void{
this.clicked = true;
}
protected function update():void{
var _local1:Number;
var _local2:Number;
_local2 = (this.__value * this.panel_back.width);
if (this.pointer){
if (_local2 < (this.pointer.clickzone.width / 2)){
_local1 = (this.pointer.clickzone.width / 2);
} else {
if (_local2 > (this.panel_back.width - (this.pointer.clickzone.width / 2))){
_local1 = (this.panel_back.width - (this.pointer.clickzone.width / 2));
} else {
_local1 = _local2;
};
};
};
if (this.step){
if (this.pointer){
if (this.change_pointer_tween){
this.change_pointer_tween.stop();
};
this.change_pointer_tween = new Tween(this.pointer, "x", Regular.easeOut, this.pointer.x, _local1, 0.5, true);
};
if (this.change_tween){
this.change_tween.stop();
};
this.change_tween = new Tween(this.panel_active, "width", Regular.easeOut, this.panel_active.width, _local2, 0.5, true);
} else {
if (this.pointer){
this.pointer.x = _local1;
};
this.panel_active.width = _local2;
};
}
private function mouseMove(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
if (Input.mouseReleased){
this.clicked = false;
};
if (this.clicked){
_local2 = this.mouseX;
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > this.clickzone.width){
_local2 = this.clickzone.width;
};
if (this.step){
_local3 = (_local2 / (this.panel_back.width * step));
if ((_local3 - Math.floor(_local3)) >= 0.5){
_local3 = Math.ceil(_local3);
};
if ((_local3 - Math.floor(_local3)) < 0.5){
_local3 = Math.floor(_local3);
};
_local2 = (_local3 * (this.panel_back.width * step));
};
if (this.__value != (_local2 / this.panel_back.width)){
this.__value = (_local2 / this.panel_back.width);
this.dispatchEvent(new OptionsSliderEvent(OptionsSliderEvent.CHANGE, this.__value));
this.update();
};
};
}
public function set value(_arg1:Number):void{
this.__value = _arg1;
this.update();
}
private function mouseDown(_arg1:MouseEvent):void{
this.clicked = true;
}
public function get value():Number{
return (this.__value);
}
public function localize():void{
if (this.textLabel_left){
this.textLabel_left.htmlText = Localization.getWord(this.word1_id);
};
if (this.textLabel_right){
this.textLabel_right.htmlText = Localization.getWord(this.word2_id);
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.sliders
Section 592
//OptionsSliderEvent (ru.zedarus.games.zedengine.userinterface.windows.options.sliders.OptionsSliderEvent)
package ru.zedarus.games.zedengine.userinterface.windows.options.sliders {
import flash.events.*;
public class OptionsSliderEvent extends Event {
public var new_value:Number;
public static const CHANGE:String = "CHANGED";
public function OptionsSliderEvent(_arg1:String, _arg2:Number=0):void{
super(_arg1);
this.new_value = _arg2;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.sliders
Section 593
//OptionsSoundSlider (ru.zedarus.games.zedengine.userinterface.windows.options.sliders.OptionsSoundSlider)
package ru.zedarus.games.zedengine.userinterface.windows.options.sliders {
public class OptionsSoundSlider extends OptionsSlider {
public function OptionsSoundSlider():void{
this.value = Settings.SOUND_VOLUME;
this.update();
this.word1_id = "options_volume_low";
this.word2_id = "options_volume_high";
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options.sliders
Section 594
//Options (ru.zedarus.games.zedengine.userinterface.windows.options.Options)
package ru.zedarus.games.zedengine.userinterface.windows.options {
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.sliders.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.flags.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.checkboxes.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.sound.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
public class Options extends Window {
public var textLabel_sound_mute:TextField;
public var textLabel_sound_volume:TextField;
public var textLabel_graphics_quality:TextField;
private var content_text_fields:Array;
public var textLabel_language:TextField;
public var sound_slider:OptionsSoundSlider;
public var flag_manager:OptionsFlagsManager;
public var music_checkbox:OptionsCheckboxMusic;
public var quality_slider:OptionsQualitySlider;
public var textLabel_music_mute:TextField;
public var textLabel_music_volume:TextField;
private var content_text_ids:Array;
public var sound_checkbox:OptionsCheckboxSound;
public var music_slider:OptionsMusicSlider;
public function Options():void{
var _local1:TextField;
content_text_fields = new Array();
content_text_ids = new Array();
super();
this.alpha = 0;
var _local2:Number = 1;
while (_local2 < this.numChildren) {
if ((this.getChildAt(_local2) is TextField)){
if (this.getChildAt(_local2) != this.textLabel_title){
_local1 = (this.getChildAt(_local2) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
};
_local2++;
};
if (this.sound_slider){
this.sound_slider.show();
this.sound_slider.addEventListener(OptionsSliderEvent.CHANGE, this.changeSoundVolume);
};
if (this.music_slider){
this.music_slider.show();
this.music_slider.addEventListener(OptionsSliderEvent.CHANGE, this.changeMusicVolume);
} else {
if (this.sound_slider){
this.sound_slider.addEventListener(OptionsSliderEvent.CHANGE, this.changeMusicVolume);
};
};
if (this.sound_checkbox){
this.sound_checkbox.show();
this.sound_checkbox.addEventListener(OptionsCheckboxEvent.CHANGE, this.toggleSound);
};
if (this.music_checkbox){
this.music_checkbox.show();
this.music_checkbox.addEventListener(OptionsCheckboxEvent.CHANGE, this.toggleMusic);
};
if (this.quality_slider){
this.quality_slider.show();
this.quality_slider.addEventListener(OptionsSliderEvent.CHANGE, this.changeQuality);
};
if (this.flag_manager){
this.flag_manager.show();
this.flag_manager.addEventListener(OptionsFlagEvent.CHANGE_LANG, this.changeLanguage);
};
}
private function changeMusicVolume(_arg1:OptionsSliderEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.CHANGE_MUSIC_VOLUME, _arg1.new_value));
}
private function toggleSound(_arg1:OptionsCheckboxEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.TOGGLE_SOUND, _arg1.new_value));
}
private function changeLanguage(_arg1:OptionsFlagEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.to_lang));
}
private function changeQuality(_arg1:OptionsSliderEvent):void{
var _local2:String;
if (_arg1.new_value == 0){
_local2 = StageQuality.LOW;
};
if (_arg1.new_value == 0.5){
_local2 = StageQuality.MEDIUM;
};
if (_arg1.new_value == 1){
_local2 = StageQuality.HIGH;
};
this.dispatchEvent(new OptionsEvent(OptionsEvent.CHANGE_QUALITY, _local2));
}
private function toggleMusic(_arg1:OptionsCheckboxEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.TOGGLE_MUSIC, _arg1.new_value));
}
public function updateSoundState():void{
if (this.sound_checkbox){
this.sound_checkbox.value = SoundManager.getSoundToggle();
};
if (this.music_checkbox){
this.music_checkbox.value = SoundManager.getMusicToggle();
};
if (this.sound_slider){
this.sound_slider.value = SoundManager.getSoundVolume();
};
if (this.music_slider){
this.music_slider.value = SoundManager.getMusicVolume();
};
}
private function changeSoundVolume(_arg1:OptionsSliderEvent):void{
this.dispatchEvent(new OptionsEvent(OptionsEvent.CHANGE_SOUND_VOLUME, _arg1.new_value));
}
override public function localize():void{
super.localize();
if (this.close_window_button){
this.close_window_button.localize();
};
if (this.sound_slider){
this.sound_slider.localize();
};
if (this.music_slider){
this.music_slider.localize();
};
if (this.quality_slider){
this.quality_slider.localize();
};
if (this.flag_manager){
this.flag_manager.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options
Section 595
//OptionsEvent (ru.zedarus.games.zedengine.userinterface.windows.options.OptionsEvent)
package ru.zedarus.games.zedengine.userinterface.windows.options {
import flash.events.*;
public class OptionsEvent extends Event {
public var new_state:Boolean;
public var to_what:String;
public var new_value:Number;
public static const CHANGE_MUSIC_VOLUME:String = "CHANGE_MUSIC_VOLUME";
public static const TOGGLE_SOUND:String = "TOGGLE_SOUND";
public static const CHANGE_QUALITY:String = "CHANGE_QUALITY";
public static const CHANGE_SOUND_VOLUME:String = "CHANGE_SOUND_VOLUME";
public static const TOGGLE_MUSIC:String = "TOGGLE_MUSIC";
public static const CHANGE_LANG:String = "CHANGE_LANG";
public function OptionsEvent(_arg1:String, _arg2:Object=null):void{
super(_arg1);
switch (_arg1){
case _slot1.CHANGE_LANG:
this.to_what = (_arg2 as String);
break;
case _slot1.TOGGLE_SOUND:
this.new_state = (_arg2 as Boolean);
break;
case _slot1.TOGGLE_MUSIC:
this.new_state = (_arg2 as Boolean);
break;
case _slot1.CHANGE_SOUND_VOLUME:
this.new_value = (_arg2 as Number);
break;
case _slot1.CHANGE_MUSIC_VOLUME:
this.new_value = (_arg2 as Number);
break;
case _slot1.CHANGE_QUALITY:
this.to_what = (_arg2 as String);
break;
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.options
Section 596
//SaveGame (ru.zedarus.games.zedengine.userinterface.windows.savegame.SaveGame)
package ru.zedarus.games.zedengine.userinterface.windows.savegame {
import flash.text.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.game.*;
import ru.zedarus.games.zedengine.userinterface.windows.*;
public class SaveGame extends Window {
public var slot_10:SaveGameItem;
public var slot_11:SaveGameItem;
public var slot_13:SaveGameItem;
public var slot_17:SaveGameItem;
public var slot_14:SaveGameItem;
public var slot_16:SaveGameItem;
public var slot_12:SaveGameItem;
public var slot_15:SaveGameItem;
public var slot_18:SaveGameItem;
public var slot_19:SaveGameItem;
public var slot_20:SaveGameItem;
public var slot_21:SaveGameItem;
public var slot_22:SaveGameItem;
public var slot_23:SaveGameItem;
public var slot_24:SaveGameItem;
public var slot_25:SaveGameItem;
public var slot_26:SaveGameItem;
public var slot_27:SaveGameItem;
public var slot_28:SaveGameItem;
public var slot_29:SaveGameItem;
public var slot_1:SaveGameItem;
public var slot_2:SaveGameItem;
public var slot_3:SaveGameItem;
public var slot_4:SaveGameItem;
public var slot_5:SaveGameItem;
private var slots:Array;
public var slot_7:SaveGameItem;
public var slot_8:SaveGameItem;
public var slot_9:SaveGameItem;
public var slot_6:SaveGameItem;
public var slot_33:SaveGameItem;
public var slot_35:SaveGameItem;
private var content_text_fields:Array;
public var slot_32:SaveGameItem;
public var slot_34:SaveGameItem;
public var slot_36:SaveGameItem;
public var slot_30:SaveGameItem;
public var slot_37:SaveGameItem;
public var slot_38:SaveGameItem;
public var slot_39:SaveGameItem;
public var slot_31:SaveGameItem;
public var slot_40:SaveGameItem;
public var slot_41:SaveGameItem;
public var slot_42:SaveGameItem;
public var slot_44:SaveGameItem;
public var slot_46:SaveGameItem;
public var slot_48:SaveGameItem;
public var slot_43:SaveGameItem;
public var slot_45:SaveGameItem;
public var slot_47:SaveGameItem;
public var slot_49:SaveGameItem;
public var slot_50:SaveGameItem;
private var content_text_ids:Array;
public function SaveGame():void{
var _local1:TextField;
var _local2:SaveGameItem;
content_text_fields = new Array();
content_text_ids = new Array();
slots = new Array();
super();
this.alpha = 0;
var _local3:Number = 1;
while (_local3 < this.numChildren) {
if ((this.getChildAt(_local3) is TextField)){
if (this.getChildAt(_local3) != this.textLabel_title){
_local1 = (this.getChildAt(_local3) as TextField);
_local1.wordWrap = _local1.multiline;
_local1.autoSize = _local1.getTextFormat().align;
this.content_text_ids.push(_local1.text);
this.content_text_fields.push(_local1);
};
} else {
if ((this.getChildAt(_local3) is SaveGameItem)){
_local2 = (this.getChildAt(_local3) as SaveGameItem);
_local2.addEventListener(SaveGameEvent.SAVE_GAME, this.selectSlot);
this.slots.push(_local2);
};
};
_local3++;
};
this.showSlots();
this.updateSlotsState();
}
public function updateSlotsState():void{
var _local1:SaveGameItem;
for each (_local1 in this.slots) {
if (GameSessionData.isSaveGameSlotExists(_local1.id)){
_local1.activate(GameSessionData.getSaveGameDate(_local1.id));
} else {
_local1.deactivate();
};
};
}
override public function localize():void{
var _local2:SaveGameItem;
super.localize();
if (this.close_window_button){
this.close_window_button.localize();
};
var _local1:Number = 0;
while (_local1 < this.content_text_fields.length) {
this.content_text_fields[_local1].htmlText = Localization.getWord(this.content_text_ids[_local1]);
_local1++;
};
for each (_local2 in this.slots) {
_local2.localize();
};
}
private function selectSlot(_arg1:SaveGameEvent):void{
this.dispatchEvent(new SaveGameEvent(_arg1.type, _arg1.slot_id));
}
private function showSlots():void{
var _local1:SaveGameItem;
for each (_local1 in this.slots) {
_local1.show();
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.savegame
Section 597
//SaveGameEvent (ru.zedarus.games.zedengine.userinterface.windows.savegame.SaveGameEvent)
package ru.zedarus.games.zedengine.userinterface.windows.savegame {
import flash.events.*;
public class SaveGameEvent extends Event {
public var slot_id:Number;
public static const SAVE_GAME:String = "SAVE_GAME";
public function SaveGameEvent(_arg1:String, _arg2:Number=0):void{
super(_arg1);
this.slot_id = _arg2;
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.savegame
Section 598
//SaveGameItem (ru.zedarus.games.zedengine.userinterface.windows.savegame.SaveGameItem)
package ru.zedarus.games.zedengine.userinterface.windows.savegame {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class SaveGameItem extends VisualElement {
public var dateTF:TextField;
public var clickzone:Sprite;
public var titleTF:TextField;
private var state_word:String;
public var icon:MovieClip;
public var id:Number;
public function SaveGameItem():void{
if (this.clickzone){
this.clickzone.alpha = 0;
this.clickzone.buttonMode = true;
this.clickzone.useHandCursor = true;
this.clickzone.addEventListener(MouseEvent.CLICK, this.sendMessage);
this.clickzone.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
this.clickzone.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
};
if (this.titleTF){
this.titleTF.mouseEnabled = false;
this.titleTF.autoSize = this.titleTF.getTextFormat().align;
this.titleTF.wordWrap = this.titleTF.multiline;
};
if (this.dateTF){
this.dateTF.mouseEnabled = false;
this.dateTF.autoSize = this.dateTF.getTextFormat().align;
this.dateTF.wordWrap = this.dateTF.multiline;
};
this.id = Number(this.name.split("_")[1]);
this.icon.pack.gotoAndStop((this.id + 1));
this.state_word = "savegame_slot_empty";
}
public function localize():void{
if (((this.titleTF) && (this.id))){
this.titleTF.htmlText = Localization.getWord(this.state_word);
};
if (((this.dateTF) && (!(this.active)))){
this.dateTF.htmlText = Localization.getWord("savegame_date");
};
}
public function deactivate():void{
this.setStateToInactive();
this.state_word = "savegame_slot_empty";
this.localize();
}
public function activate(_arg1:String):void{
this.setStateToActive();
this.state_word = ("savegame_slot_" + this.id);
if (this.dateTF){
this.dateTF.htmlText = _arg1;
};
this.localize();
}
private function sendMessage(_arg1:MouseEvent):void{
this.dispatchEvent(new SaveGameEvent(SaveGameEvent.SAVE_GAME, this.id));
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows.savegame
Section 599
//CloseWindowButton (ru.zedarus.games.zedengine.userinterface.windows.CloseWindowButton)
package ru.zedarus.games.zedengine.userinterface.windows {
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.localization.*;
public class CloseWindowButton extends VisualElement {
public var backTF:TextField;
public function CloseWindowButton():void{
this.buttonMode = true;
this.useHandCursor = true;
if (this.backTF){
this.backTF.wordWrap = false;
this.backTF.autoSize = this.backTF.getTextFormat().align;
};
}
public function localize():void{
if (this.backTF){
this.backTF.htmlText = Localization.getWord("back_button");
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows
Section 600
//Window (ru.zedarus.games.zedengine.userinterface.windows.Window)
package ru.zedarus.games.zedengine.userinterface.windows {
import flash.events.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import fl.transitions.*;
import ru.zedarus.games.zedengine.localization.*;
public class Window extends VisualElement {
public var textLabel_title:TextField;
protected var title_word_id:String;
public var close_window_button:CloseWindowButton;
protected var tween_x:Tween;
public function Window():void{
if (this.close_window_button){
this.close_window_button.show();
this.close_window_button.addEventListener(MouseEvent.CLICK, this.close);
};
if (this.textLabel_title){
this.title_word_id = this.textLabel_title.text;
this.textLabel_title.wordWrap = false;
this.textLabel_title.autoSize = this.textLabel_title.getTextFormat().align;
this.textLabel_title.htmlText = Localization.getWord(this.title_word_id);
};
}
public function localize():void{
if (this.textLabel_title){
this.textLabel_title.htmlText = Localization.getWord(this.title_word_id);
};
}
}
}//package ru.zedarus.games.zedengine.userinterface.windows
Section 601
//UserInterface (ru.zedarus.games.zedengine.userinterface.UserInterface)
package ru.zedarus.games.zedengine.userinterface {
import flash.events.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
import ru.zedarus.games.zedengine.userinterface.windows.levelselect.*;
import ru.zedarus.games.zedengine.userinterface.windows.savegame.*;
import ru.zedarus.games.zedengine.userinterface.windows.loadgame.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.*;
import flash.text.*;
import ru.zedarus.games.zedengine.visualelements.*;
import ru.zedarus.games.zedengine.input.*;
import ru.zedarus.games.zedengine.userinterface.windows.credits.*;
import ru.zedarus.games.zedengine.userinterface.windows.help.*;
import ru.zedarus.games.zedengine.userinterface.windows.highscores.*;
import ru.zedarus.games.zedengine.userinterface.flags.*;
public class UserInterface extends VisualElement {
private var state:int;
private var credits:Credits;
private var options:Options;
private var load_game:LoadGame;
private var help:Help;
private var highscores:Highscores;
public var versionTF:TextField;
private var levels_select:LevelSelect;
private var menu:MainMenu;
public var compact_flags:CompactFlagsManager;
private var save_game:SaveGame;
public function UserInterface():void{
this.state = UserInterfaceState.MENU;
if (this.compact_flags){
this.compact_flags.addEventListener(OptionsEvent.CHANGE_LANG, this.changeLanguage);
};
this.menu = new MainMenu();
this.menu.addEventListener(MainMenuEvent.START_NEW_GAME, this.startNewGame);
this.menu.addEventListener(MainMenuEvent.RESUME_GAME, this.resumeGame);
this.menu.addEventListener(MainMenuEvent.SHOW_OPTIONS, this.showOptionsScreen);
this.menu.addEventListener(MainMenuEvent.SHOW_HELP, this.showHelpScreen);
this.menu.addEventListener(MainMenuEvent.SHOW_HIGHSCORES, this.showHighscoresScreen);
this.menu.addEventListener(MainMenuEvent.SHOW_CREDITS, this.showCreditsScreen);
this.menu.addEventListener(MainMenuEvent.SHOW_LEVELS, this.showLevelSelectScreen);
this.menu.addEventListener(MainMenuEvent.SHOW_LOAD_SCREEN, this.showLoadGameScreen);
this.menu.addEventListener(MainMenuEvent.SHOW_SAVE_SCREEN, this.showSaveGameScreen);
this.options = new Options();
this.options.addEventListener(Event.CLOSE, this.hideOptionsScreen);
this.options.addEventListener(OptionsEvent.CHANGE_LANG, this.changeLanguage);
this.options.addEventListener(OptionsEvent.TOGGLE_SOUND, this.toggleSound);
this.options.addEventListener(OptionsEvent.TOGGLE_MUSIC, this.toggleMusic);
this.options.addEventListener(OptionsEvent.CHANGE_SOUND_VOLUME, this.changeSoundVolume);
this.options.addEventListener(OptionsEvent.CHANGE_MUSIC_VOLUME, this.changeMusicVolume);
this.options.addEventListener(OptionsEvent.CHANGE_QUALITY, this.changeQuality);
this.help = new Help();
this.help.addEventListener(Event.CLOSE, this.hideHelpScreen);
this.highscores = new Highscores();
this.highscores.addEventListener(Event.CLOSE, this.hideHighscoresScreen);
this.credits = new Credits();
this.credits.addEventListener(Event.CLOSE, this.hideCreditsScreen);
this.levels_select = new LevelSelect();
this.levels_select.addEventListener(Event.CLOSE, this.hideLevelSelectScreen);
this.levels_select.addEventListener(LevelSelectEvent.SHOW_LEVEL, this.selectLevel);
this.levels_select.addEventListener(LevelSelectEvent.UNBLOCK_LEVEL, this.unblockLevel);
this.save_game = new SaveGame();
this.save_game.addEventListener(Event.CLOSE, this.hideSaveGameScreen);
this.save_game.addEventListener(SaveGameEvent.SAVE_GAME, this.saveGameToSlot);
this.load_game = new LoadGame();
this.load_game.addEventListener(Event.CLOSE, this.hideLoadGameScreen);
this.load_game.addEventListener(LoadGameEvent.LOAD_GAME, this.loadGameFromSlot);
if (this.versionTF){
this.versionTF.wordWrap = false;
this.versionTF.autoSize = this.versionTF.getTextFormat().align;
};
this.addChild(this.menu);
this.addChild(this.options);
this.addChild(this.help);
this.addChild(this.highscores);
this.addChild(this.credits);
this.addChild(this.levels_select);
this.addChild(this.save_game);
this.addChild(this.load_game);
}
private function hideCreditsScreen(_arg1:Event):void{
this.changeStateTo(UserInterfaceState.MENU);
}
public function updateSlotsState():void{
this.save_game.updateSlotsState();
this.load_game.updateSlotsState();
}
private function hideOptionsScreen(_arg1:Event):void{
this.changeStateTo(UserInterfaceState.MENU);
}
public function localize():void{
if (this.menu){
this.menu.localize();
};
if (this.options){
this.options.localize();
};
if (this.help){
this.help.localize();
};
if (this.highscores){
this.highscores.localize();
};
if (this.credits){
this.credits.localize();
};
if (this.levels_select){
this.levels_select.localize();
};
if (this.save_game){
this.save_game.localize();
};
if (this.load_game){
this.load_game.localize();
};
if (this.compact_flags){
this.compact_flags.localize();
};
if (this.versionTF){
this.versionTF.htmlText = Settings.GAME_VERSION;
};
}
private function hideLevelSelectScreen(_arg1:Event):void{
this.changeStateTo(UserInterfaceState.MENU);
}
private function saveGameToSlot(_arg1:SaveGameEvent):void{
this.dispatchEvent(new SaveGameEvent(_arg1.type, _arg1.slot_id));
}
private function toggleSound(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_state));
}
private function changeStateTo(_arg1:int):Boolean{
if (this.state != _arg1){
switch (this.state){
case UserInterfaceState.MENU:
if (this.menu.isVisible()){
this.menu.hide();
};
break;
case UserInterfaceState.OPTIONS:
if (this.options.isVisible()){
this.options.hide();
};
break;
case UserInterfaceState.HELP:
if (this.help.isVisible()){
this.help.hide();
};
break;
case UserInterfaceState.SCORES:
if (this.highscores.isVisible()){
this.highscores.hide();
};
break;
case UserInterfaceState.CREDITS:
if (this.credits.isVisible()){
this.credits.hide();
};
break;
case UserInterfaceState.LEVELS:
if (this.levels_select.isVisible()){
this.levels_select.hide();
};
break;
case UserInterfaceState.SAVE:
if (this.save_game.isVisible()){
this.save_game.hide();
};
break;
case UserInterfaceState.LOAD:
if (this.load_game.isVisible()){
this.load_game.hide();
};
break;
};
this.state = _arg1;
return (true);
};
return (false);
}
private function changeLanguage(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.to_what));
}
private function showCreditsScreen(_arg1:MainMenuEvent):void{
this.changeStateTo(UserInterfaceState.CREDITS);
}
private function showHighscoresScreen(_arg1:MainMenuEvent):void{
this.changeStateTo(UserInterfaceState.SCORES);
}
private function showOptionsScreen(_arg1:MainMenuEvent):void{
this.changeStateTo(UserInterfaceState.OPTIONS);
}
private function showLevelSelectScreen(_arg1:MainMenuEvent):void{
this.changeStateTo(UserInterfaceState.LEVELS);
}
private function toggleMusic(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_state));
}
private function changeQuality(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.to_what));
}
private function showSaveGameScreen(_arg1:MainMenuEvent):void{
this.changeStateTo(UserInterfaceState.SAVE);
}
private function changeSoundVolume(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_value));
}
private function hideSaveGameScreen(_arg1:Event):void{
this.changeStateTo(UserInterfaceState.MENU);
}
private function resumeGame(_arg1:MainMenuEvent):void{
this.dispatchEvent(new MainMenuEvent(_arg1.type));
}
override public function hide():void{
super.hide();
this.changeStateTo(UserInterfaceState.NOTHING);
}
private function changeMusicVolume(_arg1:OptionsEvent):void{
this.dispatchEvent(new OptionsEvent(_arg1.type, _arg1.new_value));
}
private function unblockLevel(_arg1:LevelSelectEvent):void{
this.dispatchEvent(new LevelSelectEvent(_arg1.type, _arg1.level_id, _arg1.level_code));
}
public function updateLevelsState(_arg1:Boolean):void{
if (this.levels_select){
this.levels_select.updateLevelsState(true, _arg1);
};
}
private function loadGameFromSlot(_arg1:LoadGameEvent):void{
this.dispatchEvent(new LoadGameEvent(_arg1.type, _arg1.slot_id));
}
private function showLoadGameScreen(_arg1:MainMenuEvent):void{
this.changeStateTo(UserInterfaceState.LOAD);
}
public function cycle(_arg1:int):void{
switch (this.state){
case UserInterfaceState.MENU:
if (!this.menu.isVisible()){
this.menu.show();
};
this.menu.update(_arg1);
if (Input.isKeyPressed(27)){
this.dispatchEvent(new UserInterfaceEvent(UserInterfaceEvent.BACK_TO_GAME));
};
break;
case UserInterfaceState.OPTIONS:
if (!this.options.isVisible()){
this.options.show();
};
if (Input.isKeyPressed(27)){
this.changeStateTo(UserInterfaceState.MENU);
};
break;
case UserInterfaceState.HELP:
if (!this.help.isVisible()){
this.help.show();
};
if (Input.isKeyPressed(27)){
this.changeStateTo(UserInterfaceState.MENU);
};
break;
case UserInterfaceState.SCORES:
if (!this.highscores.isVisible()){
this.highscores.show();
};
if (Input.isKeyPressed(27)){
this.changeStateTo(UserInterfaceState.MENU);
};
break;
case UserInterfaceState.CREDITS:
if (!this.credits.isVisible()){
this.credits.show();
};
if (Input.isKeyPressed(27)){
this.changeStateTo(UserInterfaceState.MENU);
};
break;
case UserInterfaceState.LEVELS:
if (!this.levels_select.isVisible()){
this.levels_select.show();
};
if (Input.isKeyPressed(27)){
this.changeStateTo(UserInterfaceState.MENU);
};
break;
case UserInterfaceState.SAVE:
if (!this.save_game.isVisible()){
this.save_game.show();
};
if (Input.isKeyPressed(27)){
this.changeStateTo(UserInterfaceState.MENU);
};
break;
case UserInterfaceState.LOAD:
if (!this.load_game.isVisible()){
this.load_game.show();
};
if (Input.isKeyPressed(27)){
this.changeStateTo(UserInterfaceState.MENU);
};
break;
default:
break;
};
this.setElementOnTop(this.versionTF);
if (this.compact_flags){
this.setElementOnTop(this.compact_flags);
};
}
private function showHelpScreen(_arg1:MainMenuEvent):void{
this.changeStateTo(UserInterfaceState.HELP);
}
private function hideLoadGameScreen(_arg1:Event):void{
this.changeStateTo(UserInterfaceState.MENU);
}
private function hideHelpScreen(_arg1:Event):void{
this.changeStateTo(UserInterfaceState.MENU);
}
private function startNewGame(_arg1:MainMenuEvent):void{
this.dispatchEvent(new MainMenuEvent(_arg1.type));
}
private function hideHighscoresScreen(_arg1:Event):void{
this.changeStateTo(UserInterfaceState.MENU);
}
public function updateSoundState():void{
this.options.updateSoundState();
}
private function selectLevel(_arg1:LevelSelectEvent):void{
this.dispatchEvent(new LevelSelectEvent(_arg1.type, _arg1.level_id));
}
override public function show():void{
super.show();
if (this.compact_flags){
this.compact_flags.show();
};
this.changeStateTo(UserInterfaceState.MENU);
}
}
}//package ru.zedarus.games.zedengine.userinterface
Section 602
//UserInterfaceEvent (ru.zedarus.games.zedengine.userinterface.UserInterfaceEvent)
package ru.zedarus.games.zedengine.userinterface {
import flash.events.*;
public class UserInterfaceEvent extends Event {
public static const SHOW_MENU:String = "SHOW_MENU";
public static const SHOW_SCORES:String = "SHOW_SCORES";
public static const BACK_TO_GAME:String = "BACK_TO_GAME";
public static const CHANGE_LOCALIZATION:String = "CHANGE_LOCALIZATION";
public static const SHOW_OPTIONS:String = "SHOW_OPTIONS";
public static const START_NEW_GAME:String = "START_NEW_GAME";
public static const ELEMENT_SHOWN:String = "ELEMENT_SHOWN";
public static const SHOW_LEVELSELECT:String = "SHOW_LEVELSELECT";
public static const ELEMENT_HIDED:String = "ELEMENT_HIDED";
public function UserInterfaceEvent(_arg1:String):void{
super(_arg1);
}
}
}//package ru.zedarus.games.zedengine.userinterface
Section 603
//UserInterfaceState (ru.zedarus.games.zedengine.userinterface.UserInterfaceState)
package ru.zedarus.games.zedengine.userinterface {
public class UserInterfaceState {
public static const SCORES:int = 3;
public static const OPTIONS:int = 2;
public static const LOAD:int = 6;
public static const CREDITS:int = 7;
public static const HELP:int = 4;
public static const NOTHING:int = 0;
public static const LEVELS:int = 8;
public static const SAVE:int = 5;
public static const MENU:int = 1;
}
}//package ru.zedarus.games.zedengine.userinterface
Section 604
//VisualElement (ru.zedarus.games.zedengine.visualelements.VisualElement)
package ru.zedarus.games.zedengine.visualelements {
import flash.events.*;
import flash.display.*;
import gs.*;
import fl.transitions.*;
import ru.zedarus.games.zedengine.sound.*;
import fl.transitions.easing.*;
public class VisualElement extends MovieClip {
protected var appear_tween:Tween;
protected var hide_tweens:Array;
protected var active:Boolean;
protected var deactivation_tweens:Array;
protected var visible_alpha:Number;// = 1
protected var is_in_transation:Boolean;// = false
protected var rollover_tweens:Array;
protected var is_visible:Boolean;// = false
protected var show_tweens:Array;
protected var activation_tweens:Array;
protected var rollout_tweens:Array;
protected var click_tweens:Array;
public function VisualElement():void{
show_tweens = new Array();
hide_tweens = new Array();
rollover_tweens = new Array();
rollout_tweens = new Array();
click_tweens = new Array();
activation_tweens = new Array();
deactivation_tweens = new Array();
super();
this.visible = false;
this.doubleClickEnabled = false;
this.active = false;
}
private function parseVisualElementTweens(_arg1:Array):Array{
var _local2:Array;
var _local3:VisualElementTween;
var _local4:Tween;
var _local5:Number;
var _local6:Object;
var _local7:Number;
var _local8:Number;
if (_arg1){
_local2 = new Array();
_local6 = this;
_local7 = 0;
while (_local7 < _arg1.length) {
_local3 = _arg1[_local7];
_local6 = this;
if (_local3.obj.split(".").length > 1){
_local8 = 1;
while (_local8 < _local3.obj.split(".").length) {
_local6 = _local6[_local3.obj.split(".")[_local8]];
_local8++;
};
};
if ((((((((((_local3.start_parameter == "current")) && (!((_local3.parameter == "saturation"))))) && (!((_local3.parameter == "tint"))))) && (!((_local3.parameter == "glow"))))) && (!((_local3.parameter == "shadow"))))){
if (((_local6) && (_local6[_local3.parameter]))){
_local5 = Number(_local6[_local3.parameter]);
} else {
_local5 = 0;
};
} else {
_local5 = Number(_local3.start_parameter);
};
if (_local3.parameter == "saturation"){
TweenFilterLite.to(_local6, _local3.time, {colorMatrixFilter:{saturation:_local3.end_parameter}, ease:_local3.tween_type});
_local2.push(null);
} else {
if (_local3.parameter == "colorize"){
TweenFilterLite.to(_local6, _local3.time, {colorMatrixFilter:{colorize:_local3.colorize_to_color, amount:Number(_local3.end_parameter)}, ease:_local3.tween_type});
_local2.push(null);
} else {
if (_local3.parameter == "tint"){
TweenFilterLite.to(_local6, _local3.time, {tint:_local3.tint_to_color, ease:_local3.tween_type});
_local2.push(null);
} else {
if (_local3.parameter == "glow"){
TweenFilterLite.to(_local6, _local3.time, {glowFilter:{color:_local3.glow_color, alpha:_local3.end_parameter, blurX:_local3.glow_blur, blurY:_local3.glow_blur, strength:_local3.glow_strength, quality:_local3.glow_quality}, ease:_local3.tween_type});
_local2.push(null);
} else {
if (_local3.parameter == "shadow"){
TweenFilterLite.to(_local6, _local3.time, {dropShadowFilter:{color:_local3.shadow_color, alpha:_local3.end_parameter, blurX:_local3.shadow_blur, blurY:_local3.shadow_blur, strength:_local3.shadow_strength, angle:_local3.shadow_angle, distance:_local3.shadow_distance}, ease:_local3.tween_type});
_local2.push(null);
} else {
_local4 = new Tween(_local6, _local3.parameter, _local3.tween_type, Number(_local5), Number(_local3.end_parameter), _local3.time, true);
_local2.push(_local4);
};
};
};
};
};
_local7++;
};
return (_local2);
};
return (null);
}
protected function close(_arg1:MouseEvent):void{
this.dispatchEvent(new Event(Event.CLOSE));
}
public function click(_arg1:MouseEvent):void{
var _local2:Tween;
for each (_local2 in this.rollover_tweens) {
if (_local2){
_local2.stop();
};
};
for each (_local2 in this.rollout_tweens) {
if (_local2){
_local2.stop();
};
};
if (!this.active){
this.click_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "click_inactive"));
SoundManager.playSoundForEvent(this, "click_inactive");
} else {
this.click_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "click"));
SoundManager.playSoundForEvent(this, "click");
};
}
public function hide():void{
var _local1:Tween;
this.is_in_transation = true;
for each (_local1 in this.hide_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, this.hideCompletely);
};
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.show_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, this.showCompletely);
};
if (_local1){
_local1.stop();
};
};
this.hide_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "hide"));
if (this.hide_tweens){
if (this.show_tweens[0]){
_local1 = this.hide_tweens[0];
};
if (_local1){
_local1.addEventListener(TweenEvent.MOTION_FINISH, this.hideCompletely);
};
};
SoundManager.playSoundForEvent(this, "hide");
this.is_visible = false;
}
public function setStateToActive():void{
var _local1:Tween;
this.active = true;
for each (_local1 in this.activation_tweens) {
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.deactivation_tweens) {
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.hide_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, hideCompletely);
};
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.show_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, showCompletely);
};
if (_local1){
_local1.stop();
};
};
this.activation_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "activation"));
SoundManager.playSoundForEvent(this, "activation");
}
public function rollover(_arg1:MouseEvent):void{
var _local2:Tween;
for each (_local2 in this.rollover_tweens) {
if (_local2){
_local2.stop();
};
};
for each (_local2 in this.rollout_tweens) {
if (_local2){
_local2.stop();
};
};
if (!this.active){
this.rollover_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "rollover_inactive"));
SoundManager.playSoundForEvent(this, "rollover_inactive");
} else {
this.rollover_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "rollover"));
SoundManager.playSoundForEvent(this, "rollover");
};
}
public function isInTransation():Boolean{
return (this.is_in_transation);
}
protected function showCompletely(_arg1:Event):void{
this.is_in_transation = false;
this.dispatchEvent(new VisualElementEvent(VisualElementEvent.VISIBLE));
}
public function stopShowTweens():void{
var _local1:Tween;
for each (_local1 in this.show_tweens) {
if (_local1){
_local1.stop();
};
};
}
protected function hideCompletely(_arg1:Event):void{
this.is_in_transation = false;
this.visible = false;
this.dispatchEvent(new VisualElementEvent(VisualElementEvent.HIDDEN));
}
protected function setElementOnTop(_arg1:DisplayObject):void{
if (_arg1){
if (this.contains(_arg1)){
this.setChildIndex(_arg1, (this.numChildren - 1));
};
};
}
public function isVisible():Boolean{
return (this.is_visible);
}
public function setStateToInactive():void{
var _local1:Tween;
this.active = false;
for each (_local1 in this.activation_tweens) {
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.deactivation_tweens) {
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.hide_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, hideCompletely);
};
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.show_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, showCompletely);
};
if (_local1){
_local1.stop();
};
};
this.deactivation_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "deactivation"));
SoundManager.playSoundForEvent(this, "deactivation");
}
public function rollout(_arg1:MouseEvent):void{
var _local2:Tween;
for each (_local2 in this.rollover_tweens) {
if (_local2){
_local2.stop();
};
};
for each (_local2 in this.rollout_tweens) {
if (_local2){
_local2.stop();
};
};
if (!this.active){
this.rollout_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "rollout_inactive"));
SoundManager.playSoundForEvent(this, "rollout_inactive");
} else {
this.rollout_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "rollout"));
SoundManager.playSoundForEvent(this, "rollout");
};
}
public function show():void{
var _local1:Tween;
this.is_in_transation = true;
for each (_local1 in this.hide_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, this.hideCompletely);
};
if (_local1){
_local1.stop();
};
};
for each (_local1 in this.show_tweens) {
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_FINISH, this.showCompletely);
};
if (_local1){
_local1.stop();
};
};
this.show_tweens = this.parseVisualElementTweens(VisualElementAnimations.getAnimationFor(this, "show"));
if (this.show_tweens){
if (this.show_tweens[0]){
_local1 = this.show_tweens[0];
};
if (_local1){
_local1.addEventListener(TweenEvent.MOTION_FINISH, this.showCompletely);
};
};
SoundManager.playSoundForEvent(this, "show");
this.is_visible = true;
this.visible = true;
}
}
}//package ru.zedarus.games.zedengine.visualelements
Section 605
//VisualElementAnimations (ru.zedarus.games.zedengine.visualelements.VisualElementAnimations)
package ru.zedarus.games.zedengine.visualelements {
import flash.display.*;
import flash.utils.*;
import fl.transitions.easing.*;
public class VisualElementAnimations extends Sprite {
private static var DEFAULT_DEACTIVATE_EASE:Function;
private static var DEFAULT_ACTIVATE_TIME:Number;
private static var DEFAULT_HIDE_TIME:Number;
protected static var EmbeddedXML:Class = VisualElementAnimations_EmbeddedXML;
private static var DEFAULT_ROLLOVER_INACTIVE_TIME:Number;
private static var DEFAULT_SHOW_EASE:Function;
private static var DEFAULT_ROLLOUT_INACTIVE_TIME:Number;
private static var DEFAULT_ROLLOUT_TIME:Number;
private static var DEFAULT_ACTIVATE_EASE:Function;
private static var DEFAULT_ROLLOVER_TIME:Number;
private static var all_animation:Array = new Array();
private static var data:XML;
private static var DEFAULT_HIDE_EASE:Function;
private static var DEFAULT_SHOW_TIME:Number;
private static var DEFAULT_DEACTIVATE_TIME:Number;
private static var DEFAULT_ROLLOVER_ACTIVE_EASE:Function;
private static var DEFAULT_ROLLOUT_EASE:Function;
private static var DEFAULT_ROLLOUT_ACTIVE_EASE:Function;
private static var DEFAULT_ROLLOVER_EASE:Function;
public function VisualElementAnimations():void{
var _local1:VisualElementTweenPack;
var _local2:VisualElementTween;
super();
var _local3:Number = 0.6;
var _local4:Number = 0.4;
parseXML();
}
private static function parseXMLtime(_arg1:String):Number{
switch (_arg1){
case "default_show_time":
return (DEFAULT_SHOW_TIME);
case "default_hide_time":
return (DEFAULT_HIDE_TIME);
case "default_activate_time":
return (DEFAULT_ACTIVATE_TIME);
case "default_deactivate_time":
return (DEFAULT_DEACTIVATE_TIME);
case "default_rollover_time":
return (DEFAULT_ROLLOVER_TIME);
case "default_rollover_inactive_time":
return (DEFAULT_ROLLOVER_INACTIVE_TIME);
case "default_rollout_time":
return (DEFAULT_ROLLOUT_TIME);
case "default_rollout_inactive_time":
return (DEFAULT_ROLLOUT_INACTIVE_TIME);
default:
return (Number(_arg1));
};
}
private static function getClassName(_arg1:Object):String{
var _local2:Class;
if ((_arg1 is String)){
_local2 = (getDefinitionByName((_arg1 as String)) as Class);
} else {
_local2 = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class);
};
return (getQualifiedClassName(_local2));
}
private static function parseXMLeasing(_arg1:String):Function{
switch (_arg1){
case "default_show_easing":
return (DEFAULT_SHOW_EASE);
case "default_hide_easing":
return (DEFAULT_HIDE_EASE);
case "default_activate_easing":
return (DEFAULT_ACTIVATE_EASE);
case "default_deactivate_easing":
return (DEFAULT_DEACTIVATE_EASE);
case "default_rollover_easing":
return (DEFAULT_ROLLOVER_EASE);
case "default_rollover_active_easing":
return (DEFAULT_ROLLOVER_ACTIVE_EASE);
case "default_rollout_easing":
return (DEFAULT_ROLLOUT_ACTIVE_EASE);
case "default_rollout_active_easing":
return (DEFAULT_ROLLOUT_EASE);
case "Regular.easeOut":
return (Regular.easeOut);
case "Regular.easeIn":
return (Regular.easeIn);
case "Regular.easeInOut":
return (Regular.easeInOut);
case "Bounce.easeOut":
return (Bounce.easeOut);
case "Bounce.easeIn":
return (Bounce.easeIn);
case "Bounce.easeInOut":
return (Bounce.easeInOut);
case "Elastic.easeOut":
return (Elastic.easeOut);
case "Elastic.easeIn":
return (Elastic.easeIn);
case "Elastic.easeInOut":
return (Elastic.easeInOut);
case "Strong.easeOut":
return (Strong.easeOut);
case "Strong.easeIn":
return (Strong.easeIn);
case "Strong.easeInOut":
return (Strong.easeInOut);
case "Back.easeOut":
return (Back.easeOut);
case "Back.easeIn":
return (Back.easeIn);
case "Back.easeInOut":
return (Back.easeInOut);
default:
return (Regular.easeOut);
};
}
public static function getAnimationFor(_arg1:Object, _arg2:String, _arg3:Boolean=false, _arg4:Boolean=false):Array{
var _local6:String;
var _local8:VisualElementTweenPack;
var _local5:String = (_arg3) ? (_arg4) ? "default" : getSuperClassName(_arg1) : getClassName(_arg1);
if (_arg4){
_local6 = _local5;
} else {
_local6 = parseClassName(_local5);
};
var _local7:Boolean;
for each (_local8 in all_animation) {
if (_local8.for_class == _local6){
_local7 = true;
switch (_arg2){
case "show":
if (_local8.show.length > 0){
return (_local8.show);
};
return (null);
case "hide":
if (_local8.hide.length > 0){
return (_local8.hide);
};
return (null);
case "activation":
if (_local8.activation.length > 0){
return (_local8.activation);
};
return (null);
case "deactivation":
if (_local8.deactivation.length > 0){
return (_local8.deactivation);
};
return (null);
case "rollover":
if (_local8.rollover.length > 0){
return (_local8.rollover);
};
return (null);
case "rollout":
if (_local8.rollout.length > 0){
return (_local8.rollout);
};
return (null);
case "click":
if (_local8.click.length > 0){
return (_local8.click);
};
return (null);
case "rollover_inactive":
if (_local8.rollover_inactive.length > 0){
return (_local8.rollover_inactive);
};
return (null);
case "rollout_inactive":
if (_local8.rollout_inactive.length > 0){
return (_local8.rollout_inactive);
};
return (null);
case "click_inactive":
if (_local8.click_inactive.length > 0){
return (_local8.click_inactive);
};
return (null);
};
};
};
if (!_local7){
if (getSuperClassName(_local5) == "Object"){
return (getAnimationFor(_arg1, _arg2, true, true));
};
return (getAnimationFor(_local5, _arg2, true));
};
return (null);
}
private static function getSuperClassName(_arg1:Object):String{
var _local2:Class;
if ((_arg1 is String)){
_local2 = (getDefinitionByName((_arg1 as String)) as Class);
} else {
_local2 = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class);
};
return (getQualifiedSuperclassName(_local2));
}
public static function parseXML():void{
var _local1:VisualElementTweenPack;
var _local2:VisualElementTween;
var _local3:XML;
var _local4:XML;
var _local5:XML;
data = XML(new EmbeddedXML());
DEFAULT_SHOW_TIME = Number(data.default_params.time.show);
DEFAULT_HIDE_TIME = Number(data.default_params.time.hide);
DEFAULT_ACTIVATE_TIME = Number(data.default_params.time.activate);
DEFAULT_DEACTIVATE_TIME = Number(data.default_params.time.deactivate);
DEFAULT_ROLLOVER_TIME = Number(data.default_params.time.rollover);
DEFAULT_ROLLOVER_INACTIVE_TIME = Number(data.default_params.time.rollover_inactive);
DEFAULT_ROLLOUT_TIME = Number(data.default_params.time.rollout);
DEFAULT_ROLLOUT_INACTIVE_TIME = Number(data.default_params.time.rollout_inactive);
DEFAULT_SHOW_EASE = parseXMLeasing(data.default_params.easing.show);
DEFAULT_HIDE_EASE = parseXMLeasing(data.default_params.easing.hide);
DEFAULT_ACTIVATE_EASE = parseXMLeasing(data.default_params.easing.activate);
DEFAULT_DEACTIVATE_EASE = parseXMLeasing(data.default_params.easing.deactivate);
DEFAULT_ROLLOVER_EASE = parseXMLeasing(data.default_params.easing.rollover);
DEFAULT_ROLLOVER_ACTIVE_EASE = parseXMLeasing(data.default_params.easing.rollover_active);
DEFAULT_ROLLOUT_ACTIVE_EASE = parseXMLeasing(data.default_params.easing.rollout);
DEFAULT_ROLLOUT_EASE = parseXMLeasing(data.default_params.easing.rollout_active);
for each (_local3 in data.elements.element) {
_local1 = new VisualElementTweenPack();
_local1.for_class = _local3.attribute("id").toString();
for each (_local4 in _local3.pack) {
for each (_local5 in _local4.tween) {
_local2 = new VisualElementTween(_local5.object.toString(), _local5.attribute("type").toString(), parseXMLeasing(_local5.easing), _local5.start_value.toString(), Number(_local5.end_value.toString()), parseXMLtime(_local5.time));
if (_local5.attribute("type").toString() == "glow"){
_local2.glow_color = Number(_local5.subparams.color);
_local2.glow_blur = Number(_local5.subparams.blur);
_local2.glow_strength = Number(_local5.subparams.strength);
_local2.glow_quality = Number(_local5.subparams.quality);
};
if (_local5.attribute("type").toString() == "shadow"){
_local2.shadow_color = Number(_local5.subparams.color);
_local2.shadow_blur = Number(_local5.subparams.blur);
_local2.shadow_strength = Number(_local5.subparams.strength);
_local2.shadow_angle = Number(_local5.subparams.angle);
_local2.shadow_distance = Number(_local5.subparams.distance);
_local2.shadow_quality = Number(_local5.subparams.quality);
};
if (_local5.attribute("type").toString() == "tint"){
_local2.tint_to_color = Number(_local5.subparams.color);
};
if (_local5.attribute("type").toString() == "colorize"){
_local2.colorize_to_color = Number(_local5.subparams.color);
};
switch (_local4.attribute("name").toString()){
case "show":
_local1.show.push(_local2);
break;
case "hide":
_local1.hide.push(_local2);
break;
case "activation":
_local1.activation.push(_local2);
break;
case "deactivation":
_local1.deactivation.push(_local2);
break;
case "rollover":
_local1.rollover.push(_local2);
break;
case "rollout":
_local1.rollout.push(_local2);
break;
case "click":
_local1.click.push(_local2);
break;
case "rollover_inactive":
_local1.rollover_inactive.push(_local2);
break;
case "rollout_inactive":
_local1.rollout_inactive.push(_local2);
break;
case "click_inactive":
_local1.rollout_inactive.push(_local2);
break;
};
};
};
all_animation.push(_local1);
};
}
private static function parseClassName(_arg1:String):String{
return (_arg1.split("::")[1]);
}
}
}//package ru.zedarus.games.zedengine.visualelements
Section 606
//VisualElementAnimations_EmbeddedXML (ru.zedarus.games.zedengine.visualelements.VisualElementAnimations_EmbeddedXML)
package ru.zedarus.games.zedengine.visualelements {
import mx.core.*;
public class VisualElementAnimations_EmbeddedXML extends ByteArrayAsset {
}
}//package ru.zedarus.games.zedengine.visualelements
Section 607
//VisualElementEvent (ru.zedarus.games.zedengine.visualelements.VisualElementEvent)
package ru.zedarus.games.zedengine.visualelements {
import flash.events.*;
public class VisualElementEvent extends Event {
public static const HIDDEN:String = "HIDDEN";
public static const VISIBLE:String = "VISIBLE";
public function VisualElementEvent(_arg1:String):void{
super(_arg1);
}
}
}//package ru.zedarus.games.zedengine.visualelements
Section 608
//VisualElementTween (ru.zedarus.games.zedengine.visualelements.VisualElementTween)
package ru.zedarus.games.zedengine.visualelements {
public class VisualElementTween {
public var shadow_strength:Number;
public var shadow_color:Number;
public var end_parameter:Object;
public var start_parameter:Object;
public var time:Number;
public var tween_type:Function;
public var glow_quality:Number;
public var glow_blur:Number;
public var colorize_to_color:Number;
public var shadow_quality:Number;
public var tint_to_color:Number;
public var parameter:String;
public var shadow_blur:Number;
public var glow_color:Number;
public var glow_strength:Number;
public var shadow_angle:Number;
public var obj:String;
public var shadow_distance:Number;
public function VisualElementTween(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object, _arg5:Object, _arg6:Number):void{
this.obj = _arg1;
this.parameter = _arg2;
this.tween_type = _arg3;
if (_arg4 == "current"){
this.start_parameter = _arg4;
} else {
this.start_parameter = Number(_arg4);
};
this.end_parameter = _arg5;
this.time = _arg6;
}
}
}//package ru.zedarus.games.zedengine.visualelements
Section 609
//VisualElementTweenPack (ru.zedarus.games.zedengine.visualelements.VisualElementTweenPack)
package ru.zedarus.games.zedengine.visualelements {
public class VisualElementTweenPack {
public var rollout_inactive:Array;
public var for_class:String;
public var click_inactive:Array;
public var click:Array;
public var hide:Array;
public var rollover:Array;
public var activation:Array;
public var deactivation:Array;
public var rollout:Array;
public var rollover_inactive:Array;
public var show:Array;
public function VisualElementTweenPack(_arg1:String=""):void{
show = new Array();
hide = new Array();
activation = new Array();
deactivation = new Array();
rollover = new Array();
rollout = new Array();
click = new Array();
rollover_inactive = new Array();
rollout_inactive = new Array();
click_inactive = new Array();
super();
}
}
}//package ru.zedarus.games.zedengine.visualelements
Section 610
//Engine (ru.zedarus.games.zedengine.Engine)
package ru.zedarus.games.zedengine {
import flash.events.*;
import flash.display.*;
import ru.zedarus.games.zedengine.userinterface.*;
import ru.zedarus.games.zedengine.game.hud.*;
import ru.zedarus.games.zedengine.userinterface.windows.menu.*;
import ru.zedarus.games.zedengine.userinterface.windows.levelselect.*;
import ru.zedarus.games.zedengine.game.worlds.world.*;
import ru.zedarus.games.zedengine.userinterface.windows.savegame.*;
import ru.zedarus.games.zedengine.userinterface.windows.loadgame.*;
import ru.zedarus.games.zedengine.userinterface.windows.options.*;
import ru.zedarus.games.zedengine.visualelements.*;
import flash.utils.*;
import ru.zedarus.games.zedengine.screens.*;
import ru.zedarus.games.zedengine.localization.*;
import ru.zedarus.games.zedengine.game.*;
import ru.zedarus.games.zedengine.input.*;
import ru.zedarus.games.zedengine.services.*;
import ru.zedarus.games.zedengine.sound.*;
public class Engine extends VisualElement {
protected var sponsor_intro:SponsorIntro;
private var play_time:Number;// = 0
protected var state:int;
protected var localization:Localization;
protected var ui:UserInterface;
protected var background:Background;
protected var global_top_screen:GlobalTopScreen;
protected var game_session:GameSessionData;
protected var input:Input;
protected var block_screen:BlockScreen;
private var idle_time:Number;// = 0
protected var services:Services;
protected var intro:Intro;
protected var game:Game;
protected var main_stage:Stage;
protected var animation_manager:VisualElementAnimations;
protected var sound_manager:SoundManager;
public function Engine():void{
this.visible = true;
}
protected function hideStateElements(_arg1:Number):void{
switch (_arg1){
case EngineState.AD:
if (this.services){
this.services.removeAds();
};
break;
case EngineState.INTRO:
if (this.intro){
this.intro.reset();
};
break;
case EngineState.SPONSOR_INTRO:
if (this.sponsor_intro){
this.sponsor_intro.reset();
};
break;
case EngineState.MENU:
if (this.ui.isVisible()){
this.ui.hide();
};
break;
case EngineState.GAME:
if (this.game.isVisible()){
this.game.hide();
};
break;
case EngineState.BLOCKED:
if (this.block_screen){
this.block_screen.reset();
};
break;
};
}
private function saveGameToSlot(_arg1:SaveGameEvent):void{
trace(("Save game to slot #" + _arg1.slot_id));
GameSessionData.saveGame(_arg1.slot_id);
this.ui.updateSlotsState();
}
private function localize():void{
if (this.ui){
this.ui.localize();
};
if (this.game){
this.game.localize();
};
}
private function trackPlayTime():void{
this.play_time = (getTimer() - this.idle_time);
}
private function playIntro(... _args):void{
if (Settings.SHOW_SPONSOR_INTRO){
this.changeStateTo(EngineState.SPONSOR_INTRO);
} else {
if (Settings.SHOW_INTRO){
this.changeStateTo(EngineState.INTRO);
} else {
this.changeStateTo(EngineState.MENU);
};
};
}
private function changeStateTo(_arg1:int):Boolean{
if (this.state != _arg1){
this.hideStateElements(this.state);
this.state = _arg1;
this.showStateElements(_arg1);
return (true);
};
return (false);
}
private function blockGame(... _args):void{
this.changeStateTo(EngineState.BLOCKED);
}
private function toggleSound(_arg1:OptionsEvent):void{
SoundManager.toggleSound(_arg1.new_state);
this.ui.updateSoundState();
this.global_top_screen.updateSoundState();
}
protected function showStateElements(_arg1:Number):void{
switch (_arg1){
case EngineState.AD:
if (!this.services.adsAreShown()){
this.services.showAds();
};
break;
case EngineState.INTRO:
if (!this.intro.isPlayed()){
this.intro.begin();
};
break;
case EngineState.SPONSOR_INTRO:
if (!this.sponsor_intro.isPlayed()){
this.sponsor_intro.begin();
};
break;
case EngineState.MENU:
if (SoundManager.current_music_id != "menu"){
SoundManager.playMusicById("menu");
};
if (this.ui){
if (!this.ui.isVisible()){
this.ui.show();
};
};
if (this.background){
this.background.show();
};
if (this.global_top_screen){
this.global_top_screen.show();
};
break;
case EngineState.GAME:
if (!this.game.isVisible()){
this.game.show();
};
if (this.background){
this.background.show();
};
if (this.global_top_screen){
this.global_top_screen.show();
};
break;
case EngineState.BLOCKED:
if (!this.block_screen.visible){
this.block_screen.show();
};
break;
};
}
private function trackIdleTime():void{
this.idle_time = (getTimer() - this.play_time);
}
private function changeLanguage(_arg1:OptionsEvent):void{
Localization.changeLanguage(_arg1.to_what);
this.localize();
}
private function toggleMusic(_arg1:OptionsEvent):void{
SoundManager.toggleMusic(_arg1.new_state);
this.ui.updateSoundState();
this.global_top_screen.updateSoundState();
}
private function changeQuality(_arg1:OptionsEvent):void{
this.main_stage.quality = _arg1.to_what;
}
private function resumeGame(_arg1:MainMenuEvent):void{
this.game.resume();
this.changeStateTo(EngineState.GAME);
}
private function changeSoundVolume(_arg1:OptionsEvent):void{
SoundManager.setSoundVolume(_arg1.new_value);
this.ui.updateSoundState();
this.global_top_screen.updateSoundState();
}
private function backToMenu(_arg1:HUDEvent):void{
this.changeStateTo(EngineState.MENU);
}
private function unblockLevelById(_arg1:WorldEvent):void{
var _local2:Boolean = GameSessionData.unblockLevel(_arg1.world_id);
this.ui.updateLevelsState(_local2);
}
public function setStage(_arg1:Stage):void{
this.main_stage = _arg1;
this.main_stage.doubleClickEnabled = true;
}
private function changeMusicVolume(_arg1:OptionsEvent):void{
SoundManager.setMusicVolume(_arg1.new_value);
this.ui.updateSoundState();
this.global_top_screen.updateSoundState();
}
private function unblockLevel(_arg1:LevelSelectEvent):void{
var _local2:Boolean = GameSessionData.ublockLevelByCode(_arg1.level_code);
this.ui.updateLevelsState(_local2);
}
private function endIntro(... _args):void{
if (this.state == EngineState.INTRO){
if (this.getChildIndex(this.intro)){
this.removeChild(this.intro);
};
this.changeStateTo(EngineState.MENU);
} else {
if (this.state == EngineState.SPONSOR_INTRO){
if (this.getChildIndex(this.sponsor_intro)){
this.removeChild(this.sponsor_intro);
};
if (Settings.SHOW_INTRO){
this.changeStateTo(EngineState.INTRO);
} else {
this.changeStateTo(EngineState.MENU);
};
};
};
}
private function backToGame(_arg1:UserInterfaceEvent):void{
if (((!((this.game.getState() == GameState.NOT_STARTED))) && (!((this.game.getState() == GameState.WIN))))){
this.changeStateTo(EngineState.GAME);
};
}
private function loadGameFromSlot(_arg1:LoadGameEvent):void{
trace(("Load game from slot #" + _arg1.slot_id));
}
public function start(_arg1:AssetsManager):void{
this.main_stage.addChild(this);
this.state = EngineState.IDLE;
this.animation_manager = new VisualElementAnimations();
this.input = new Input(this);
this.sound_manager = new SoundManager(_arg1);
this.game_session = new GameSessionData();
this.main_stage.quality = Settings.START_QUALITY;
this.main_stage.focus = this;
this.services = new Services();
this.services.addEventListener(ServiceEvent.AD_FINISHED, this.playIntro);
this.services.addEventListener(ServiceEvent.AD_FAILED, this.blockGame);
this.services.addEventListener(ServiceEvent.DOMAIN_BLOCK, this.blockGame);
this.background = new Settings.BACKGROUND_CLASS();
this.sponsor_intro = new SponsorIntro();
this.sponsor_intro.addEventListener(Event.COMPLETE, this.endIntro);
this.intro = new Intro();
this.intro.addEventListener(Event.COMPLETE, this.endIntro);
this.block_screen = new BlockScreen();
this.localization = new Localization();
this.global_top_screen = new GlobalTopScreen();
this.global_top_screen.addEventListener(OptionsEvent.TOGGLE_SOUND, this.toggleSound);
this.global_top_screen.addEventListener(OptionsEvent.TOGGLE_MUSIC, this.toggleMusic);
this.global_top_screen.addEventListener(OptionsEvent.CHANGE_SOUND_VOLUME, this.changeSoundVolume);
this.global_top_screen.addEventListener(OptionsEvent.CHANGE_MUSIC_VOLUME, this.changeMusicVolume);
this.ui = new UserInterface();
this.ui.addEventListener(MainMenuEvent.START_NEW_GAME, this.startNewGame);
this.ui.addEventListener(MainMenuEvent.RESUME_GAME, this.resumeGame);
this.ui.addEventListener(LevelSelectEvent.SHOW_LEVEL, this.selectLevel);
this.ui.addEventListener(LevelSelectEvent.UNBLOCK_LEVEL, this.unblockLevel);
this.ui.addEventListener(SaveGameEvent.SAVE_GAME, this.saveGameToSlot);
this.ui.addEventListener(LoadGameEvent.LOAD_GAME, this.loadGameFromSlot);
this.ui.addEventListener(OptionsEvent.CHANGE_LANG, this.changeLanguage);
this.ui.addEventListener(OptionsEvent.TOGGLE_SOUND, this.toggleSound);
this.ui.addEventListener(OptionsEvent.TOGGLE_MUSIC, this.toggleMusic);
this.ui.addEventListener(OptionsEvent.CHANGE_SOUND_VOLUME, this.changeSoundVolume);
this.ui.addEventListener(OptionsEvent.CHANGE_MUSIC_VOLUME, this.changeMusicVolume);
this.ui.addEventListener(OptionsEvent.CHANGE_QUALITY, this.changeQuality);
this.ui.addEventListener(UserInterfaceEvent.BACK_TO_GAME, this.backToGame);
this.game = new Settings.GAME_CLASS();
this.game.addEventListener(WorldEvent.UNBLOCK_LEVEL, this.unblockLevelById);
this.game.addEventListener(HUDEvent.MENU_BUTTON_CLICKED, this.backToMenu);
this.addChild(this.services);
this.addChild(this.background);
this.addChild(this.intro);
this.addChild(this.sponsor_intro);
this.addChild(this.game);
this.addChild(this.ui);
this.addChild(this.block_screen);
this.addChild(this.global_top_screen);
this.localize();
this.changeStateTo(EngineState.AD);
this.services.init();
this.addEventListener(Event.ENTER_FRAME, this.cycle);
}
private function cycle(_arg1:Event):void{
if (this.game){
this.game.updateTime(this.play_time);
};
switch (this.state){
case EngineState.AD:
this.trackIdleTime();
break;
case EngineState.SPONSOR_INTRO:
this.trackIdleTime();
break;
case EngineState.INTRO:
this.trackIdleTime();
break;
case EngineState.MENU:
this.trackIdleTime();
this.ui.cycle(this.game.getState());
break;
case EngineState.GAME:
this.trackPlayTime();
this.game.cycle(this);
break;
case EngineState.BLOCKED:
this.trackIdleTime();
break;
default:
this.trackIdleTime();
break;
};
Input.update();
if (this.background){
this.background.update();
};
if (this.global_top_screen){
this.global_top_screen.update();
this.setElementOnTop(this.global_top_screen);
};
if (this.block_screen){
this.setElementOnTop(this.block_screen);
};
}
private function selectLevel(_arg1:LevelSelectEvent):void{
this.game.startWorld((_arg1.level_id as Number));
this.changeStateTo(EngineState.GAME);
}
private function startNewGame(_arg1:MainMenuEvent):void{
this.game.start();
this.changeStateTo(EngineState.GAME);
}
}
}//package ru.zedarus.games.zedengine
Section 611
//EngineState (ru.zedarus.games.zedengine.EngineState)
package ru.zedarus.games.zedengine {
public class EngineState {
public static const AD:int = 1;
public static const SPONSOR_INTRO:int = 2;
public static const INTRO:int = 3;
public static const GAME:int = 5;
public static const BLOCKED:int = 6;
public static const IDLE:int = 0;
public static const MENU:int = 4;
}
}//package ru.zedarus.games.zedengine
Section 612
//Main (ru.zedarus.games.zedengine.Main)
package ru.zedarus.games.zedengine {
import flash.events.*;
import flash.display.*;
public class Main extends MovieClip {
protected var assets_manager:AssetsManager;
protected var settings:Settings;
protected var engine:Engine;
public function Main():void{
this.settings = new Settings();
this.initAssets();
}
public function initAssets():void{
this.assets_manager = AssetsManager.getInstance();
this.assets_manager.addEventListener(Event.INIT, this.appLoaded);
this.assets_manager.init();
}
private function appLoaded(_arg1:Event):void{
this.engine = new Settings.ENGINE_CLASS();
this.engine.setStage(this.stage);
this.engine.start(this.assets_manager);
}
}
}//package ru.zedarus.games.zedengine
Section 613
//_activeButtonStyleStyle (_activeButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 614
//_activeTabStyleStyle (_activeTabStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeTabStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeTabStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeTabStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 615
//_advancedDataGridStylesStyle (_advancedDataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _advancedDataGridStylesStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".advancedDataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".advancedDataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 616
//_alertButtonStyleStyle (_alertButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _alertButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".alertButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".alertButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 734012;
};
};
}
}
}//package
Section 617
//_AlertStyle (_AlertStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _AlertStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Alert");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Alert", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.borderColor = 8821927;
this.paddingLeft = 10;
this.color = 0xFFFFFF;
this.roundedBottomCorners = true;
this.paddingRight = 10;
this.backgroundAlpha = 0.9;
this.paddingBottom = 2;
this.borderAlpha = 0.9;
this.buttonStyleName = "alertButtonStyle";
this.backgroundColor = 8821927;
};
};
}
}
}//package
Section 618
//_comboDropdownStyle (_comboDropdownStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _comboDropdownStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".comboDropdown");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".comboDropdown", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingLeft = 5;
this.fontWeight = "normal";
this.cornerRadius = 0;
this.paddingRight = 5;
this.dropShadowEnabled = true;
this.shadowDirection = "center";
this.leading = 0;
this.borderThickness = 0;
this.shadowDistance = 1;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 619
//_dataGridStylesStyle (_dataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dataGridStylesStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 620
//_dateFieldPopupStyle (_dateFieldPopupStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dateFieldPopupStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dateFieldPopup");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dateFieldPopup", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.dropShadowEnabled = true;
this.borderThickness = 0;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 621
//_errorTipStyle (_errorTipStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _errorTipStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".errorTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".errorTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 4;
this.borderColor = 13510953;
this.paddingLeft = 4;
this.color = 0xFFFFFF;
this.fontWeight = "bold";
this.paddingRight = 4;
this.shadowColor = 0;
this.fontSize = 9;
this.paddingBottom = 4;
this.borderStyle = "errorTipRight";
};
};
}
}
}//package
Section 622
//_globalStyle (_globalStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _globalStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("global", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "normal";
this.modalTransparencyBlur = 3;
this.verticalGridLineColor = 14015965;
this.borderStyle = "inset";
this.buttonColor = 7305079;
this.borderCapColor = 9542041;
this.textAlign = "left";
this.disabledIconColor = 0x999999;
this.stroked = false;
this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE];
this.fontStyle = "normal";
this.borderSides = "left top right bottom";
this.borderThickness = 1;
this.modalTransparencyDuration = 100;
this.useRollOver = true;
this.strokeWidth = 1;
this.filled = true;
this.borderColor = 12040892;
this.horizontalGridLines = false;
this.horizontalGridLineColor = 0xF7F7F7;
this.shadowCapColor = 14015965;
this.fontGridFitType = "pixel";
this.horizontalAlign = "left";
this.modalTransparencyColor = 0xDDDDDD;
this.disabledColor = 11187123;
this.borderSkin = HaloBorder;
this.dropShadowColor = 0;
this.paddingBottom = 0;
this.indentation = 17;
this.version = "3.0.0";
this.fontThickness = 0;
this.verticalGridLines = true;
this.embedFonts = false;
this.fontSharpness = 0;
this.shadowDirection = "center";
this.textDecoration = "none";
this.selectionDuration = 250;
this.bevel = true;
this.fillColor = 0xFFFFFF;
this.focusBlendMode = "normal";
this.dropShadowEnabled = false;
this.textRollOverColor = 2831164;
this.textIndent = 0;
this.fontSize = 10;
this.openDuration = 250;
this.closeDuration = 250;
this.kerning = false;
this.paddingTop = 0;
this.highlightAlphas = [0.3, 0];
this.cornerRadius = 0;
this.horizontalGap = 8;
this.textSelectedColor = 2831164;
this.paddingLeft = 0;
this.modalTransparency = 0.5;
this.roundedBottomCorners = true;
this.repeatDelay = 500;
this.selectionDisabledColor = 0xDDDDDD;
this.fontAntiAliasType = "advanced";
this.focusSkin = HaloFocusRect;
this.verticalGap = 6;
this.leading = 2;
this.shadowColor = 0xEEEEEE;
this.backgroundAlpha = 1;
this.iconColor = 0x111111;
this.focusAlpha = 0.4;
this.borderAlpha = 1;
this.focusThickness = 2;
this.themeColor = 40447;
this.backgroundSize = "auto";
this.indicatorGap = 14;
this.letterSpacing = 0;
this.fontFamily = "Verdana";
this.fillAlphas = [0.6, 0.4, 0.75, 0.65];
this.color = 734012;
this.paddingRight = 0;
this.errorColor = 0xFF0000;
this.verticalAlign = "top";
this.focusRoundedCorners = "tl tr bl br";
this.shadowDistance = 2;
this.repeatInterval = 35;
};
};
}
}
}//package
Section 623
//_headerDateTextStyle (_headerDateTextStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDateTextStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDateText");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDateText", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "center";
this.fontWeight = "bold";
};
};
}
}
}//package
Section 624
//_headerDragProxyStyleStyle (_headerDragProxyStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDragProxyStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDragProxyStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDragProxyStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 625
//_linkButtonStyleStyle (_linkButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _linkButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".linkButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".linkButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.paddingLeft = 2;
this.paddingRight = 2;
this.paddingBottom = 2;
};
};
}
}
}//package
Section 626
//_opaquePanelStyle (_opaquePanelStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _opaquePanelStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".opaquePanel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".opaquePanel", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.footerColors = [0xE7E7E7, 0xC7C7C7];
this.borderColor = 0xFFFFFF;
this.headerColors = [0xE7E7E7, 0xD9D9D9];
this.borderAlpha = 1;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 627
//_PanelStyle (_PanelStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _PanelStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var effects:Array;
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Panel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Panel", style, false);
effects = style.mx_internal::effects;
if (!effects){
effects = (style.mx_internal::effects = new Array());
};
effects.push("resizeEndEffect");
effects.push("resizeStartEffect");
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderColor = 0xE2E2E2;
this.paddingLeft = 0;
this.roundedBottomCorners = false;
this.dropShadowEnabled = true;
this.resizeStartEffect = "Dissolve";
this.borderSkin = PanelSkin;
this.statusStyleName = "windowStatus";
this.borderAlpha = 0.4;
this.borderStyle = "default";
this.paddingBottom = 0;
this.resizeEndEffect = "Dissolve";
this.paddingTop = 0;
this.borderThicknessRight = 10;
this.titleStyleName = "windowStyles";
this.cornerRadius = 4;
this.paddingRight = 0;
this.borderThicknessLeft = 10;
this.titleBackgroundSkin = TitleBackground;
this.borderThickness = 0;
this.borderThicknessTop = 2;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 628
//_plainStyle (_plainStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _plainStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".plain");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".plain", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 0;
this.paddingLeft = 0;
this.horizontalAlign = "left";
this.paddingRight = 0;
this.backgroundImage = "";
this.paddingBottom = 0;
this.backgroundColor = 0xFFFFFF;
};
};
}
}
}//package
Section 629
//_popUpMenuStyle (_popUpMenuStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _popUpMenuStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".popUpMenu");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".popUpMenu", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "left";
this.fontWeight = "normal";
};
};
}
}
}//package
Section 630
//_richTextEditorTextAreaStyleStyle (_richTextEditorTextAreaStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _richTextEditorTextAreaStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".richTextEditorTextAreaStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".richTextEditorTextAreaStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 631
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _swatchPanelTextFieldStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".swatchPanelTextField");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".swatchPanelTextField", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.highlightColor = 12897484;
this.borderColor = 14015965;
this.paddingLeft = 5;
this.shadowCapColor = 14015965;
this.paddingRight = 5;
this.shadowColor = 14015965;
this.borderStyle = "inset";
this.buttonColor = 7305079;
this.backgroundColor = 0xFFFFFF;
this.borderCapColor = 9542041;
};
};
}
}
}//package
Section 632
//_textAreaHScrollBarStyleStyle (_textAreaHScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaHScrollBarStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaHScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaHScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 633
//_textAreaVScrollBarStyleStyle (_textAreaVScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaVScrollBarStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaVScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaVScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 634
//_todayStyleStyle (_todayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _todayStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".todayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".todayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "center";
this.color = 0xFFFFFF;
};
};
}
}
}//package
Section 635
//_weekDayStyleStyle (_weekDayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _weekDayStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".weekDayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".weekDayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.textAlign = "center";
this.fontWeight = "bold";
};
};
}
}
}//package
Section 636
//_windowStatusStyle (_windowStatusStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStatusStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStatus");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStatus", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0x666666;
};
};
}
}
}//package
Section 637
//_windowStylesStyle (_windowStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStylesStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 638
//AssetsManager (AssetsManager)
package {
import flash.events.*;
import flash.display.*;
import flash.system.*;
public class AssetsManager extends EventDispatcher {
private var Assets:Class;
private var appDomain:ApplicationDomain;
private static var instance:AssetsManager;
public function AssetsManager():void{
Assets = AssetsManager_Assets;
super();
}
public function init():void{
var _local1:Loader = new Loader();
_local1.contentLoaderInfo.addEventListener(Event.INIT, assetsInitHandler);
_local1.loadBytes(new Assets());
}
private function assetsInitHandler(_arg1:Event):void{
trace("AssetsManager::assetsInitHandler()");
this.appDomain = _arg1.target.content.loaderInfo.applicationDomain;
dispatchEvent(new Event(Event.INIT));
}
private function assetsInitHandler2(_arg1:Event):void{
trace("AssetsManager::assetsInitHandler2()");
this.appDomain = _arg1.target.content.loaderInfo.applicationDomain;
dispatchEvent(new Event(Event.INIT));
}
public function getAssetClass(_arg1:String):Class{
if (!appDomain.hasDefinition(_arg1)){
trace((("AssetsManager::getAssetClass(): **Error** There is no definition of class '" + _arg1) + "'"));
return (null);
};
return ((appDomain.getDefinition(_arg1) as Class));
}
public static function getInstance():AssetsManager{
if (!instance){
instance = new (AssetsManager);
};
return (instance);
}
}
}//package
Section 639
//AssetsManager_Assets (AssetsManager_Assets)
package {
import mx.core.*;
public class AssetsManager_Assets extends ByteArrayAsset {
}
}//package
Section 640
//en_US$core_properties (en_US$core_properties)
package {
import mx.resources.*;
public class en_US$core_properties extends ResourceBundle {
public function en_US$core_properties(){
super("en_US", "core");
}
override protected function getContent():Object{
var _local1:Object = {multipleChildSets_ClassAndInstance:"Multiple sets of visual children have been specified for this component (component definition and component instance).", truncationIndicator:"...", notExecuting:"Repeater is not executing.", versionAlreadyRead:"Compatibility version has already been read.", multipleChildSets_ClassAndSubclass:"Multiple sets of visual children have been specified for this component (base component definition and derived component definition).", viewSource:"View Source", badFile:"File does not exist.", stateUndefined:"Undefined state '{0}'.", versionAlreadySet:"Compatibility version has already been set."};
return (_local1);
}
}
}//package
Section 641
//en_US$skins_properties (en_US$skins_properties)
package {
import mx.resources.*;
public class en_US$skins_properties extends ResourceBundle {
public function en_US$skins_properties(){
super("en_US", "skins");
}
override protected function getContent():Object{
var _local1:Object = {notLoaded:"Unable to load '{0}'."};
return (_local1);
}
}
}//package
Section 642
//en_US$styles_properties (en_US$styles_properties)
package {
import mx.resources.*;
public class en_US$styles_properties extends ResourceBundle {
public function en_US$styles_properties(){
super("en_US", "styles");
}
override protected function getContent():Object{
var _local1:Object = {unableToLoad:"Unable to load style({0}): {1}."};
return (_local1);
}
}
}//package
Section 643
//GameJacketAS3 (GameJacketAS3)
package {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.net.*;
public class GameJacketAS3 extends Sprite {
private var _adOptions:Object;// = null
private var _IDataLoader:Loader;
private var _gameVar:String;
private var _gameHost:String;// = ""
private var _GJID:String;// = ""
private var _IDataHolder:Object;
private var _s:String;// = ""
private var _AS3Version:String;// = "0.6b"
private var _nNumberSecurity:Number;// = 0
public function GameJacketAS3(){
_IDataLoader = new Loader();
_IDataHolder = new Object();
super();
Security.allowDomain("app.gamejacket.net", "app1.gamejacket.net", "app2.gamejacket.net", "app3.gamejacket.net", "app4.gamejacket.net", "app5.gamejacket.net", "app6.gamejacket.net", "app7.gamejacket.net", "app8.gamejacket.net", "app9.gamejacket.net");
}
public function checkMe():Number{
return (1);
}
private function checkIOError(_arg1:IOErrorEvent):void{
dispatchSecurityEvent();
}
private function ioErrorIDataSWF(_arg1:IOErrorEvent):void{
advertError();
}
private function initiateAdvert(_arg1:Event=null):void{
if (_arg1 != null){
_IDataHolder = _arg1.target;
};
if (_adOptions.bgAlpha == undefined){
_adOptions.bgAlpha = 1;
};
_IDataHolder.loader.content.loadDetails(_GJID, _adOptions.bgColour, _adOptions.bgAlpha, _s, this.root.stage);
_IDataHolder.loader.content.addEventListener("GameJacketAdError", advertError);
_IDataHolder.loader.content.addEventListener("GameJacketAdEnd", advertEnd);
_adOptions.adDisplayObject.addChild(_IDataLoader);
}
private function advertError(_arg1:Event=null):void{
_adOptions.adDisplayObject.removeChild(_IDataLoader);
if ((_adOptions.errorFunction is Function)){
if ((_adOptions.errorParameters is Object)){
_adOptions.errorFunction(_adOptions.errorParameters);
} else {
_adOptions.errorFunction();
};
} else {
advertEnd(new Event(""));
};
}
public function showAd(_arg1:Object=null):void{
var _local2:URLRequest;
_adOptions = _arg1;
if (_IDataLoader.contentLoaderInfo.contentType == null){
_IDataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeIDataSWF);
_IDataLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorIDataSWF);
_local2 = new URLRequest((_s + "GJIDataAS3.swf"));
_IDataLoader.load(_local2);
} else {
initiateAdvert();
};
}
private function dispatchSecurityEvent():void{
if (_nNumberSecurity == 1){
dispatchEvent(new Event("GameJacketPass"));
} else {
dispatchEvent(new Event("GameJacketFail"));
};
}
public function GJHost():String{
return (_gameHost);
}
private function checkLoaded(_arg1:Event):void{
var _local2:XML = new XML(_arg1.currentTarget.data);
_nNumberSecurity = Number(_local2.game.r);
dispatchSecurityEvent();
}
private function advertEnd(_arg1:Event):void{
_adOptions.adDisplayObject.removeChild(_IDataLoader);
if ((_adOptions.endFunction is Function)){
if ((_adOptions.endParameters is Object)){
_adOptions.endFunction(_adOptions.endParameters);
} else {
_adOptions.endFunction();
};
};
}
private function completeIDataSWF(_arg1:Event):void{
initiateAdvert(_arg1);
}
private function checkNumber():void{
var _local1:URLLoader = new URLLoader();
_local1.addEventListener(Event.COMPLETE, checkLoaded);
_local1.addEventListener(IOErrorEvent.IO_ERROR, checkIOError);
var _local2:URLRequest = new URLRequest(((((_s + "gameCheck.asp?gameVar=") + _gameVar) + "&random=") + Math.random()));
_local1.load(_local2);
}
public function setVariables(_arg1:LoaderInfo):void{
var _local3:String;
var _local4:String;
var _local2:Object = _arg1.parameters;
for (_local3 in _local2) {
_local4 = String(_local2[_local3]);
if (_local3 == "gameVar"){
_gameVar = _local4;
} else {
if (_local3 == "s"){
_s = _local4;
} else {
if (_local3 == "GJID"){
_GJID = _local4;
} else {
if (_local3 == "gameHost"){
_gameHost = _local4;
};
};
};
};
};
checkNumber();
}
public function GJVersion():String{
return (_AS3Version);
}
}
}//package
Section 644
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import ru.zedarus.games.zedengine.loaders.*;
import com.gamezhero.api.as3.*;
public class Preloader extends BasicPreloader {
private const ARMOR_GAMES:int = 1;
private const GAMEZHERO:int = 2;
private var sponsorLogo:Class;
private var logo:Class;
private var USE_BRANDING:int;
private var _bar:Sprite;
public function Preloader(){
var _local1:MovieClip;
logo = Preloader_logo;
sponsorLogo = Preloader_sponsorLogo;
super();
this.document_class_name = "RedstarFallPro";
this.USE_BRANDING = ARMOR_GAMES;
switch (USE_BRANDING){
case ARMOR_GAMES:
createBasicPreloader();
break;
case GAMEZHERO:
_local1 = new MovieClip();
this.addChild(_local1);
GamezheroApi.ini("redstarfall");
GamezheroApi.preloader(_local1, startGame);
break;
};
this.addEventListener(Event.ADDED_TO_STAGE, init);
}
private function clicked(_arg1:MouseEvent):void{
if (this.USE_BRANDING == ARMOR_GAMES){
navigateToURL(new URLRequest("http://www.armorgames.com/?gamereferral=RedStarFall"), "_blank");
} else {
if (this.USE_BRANDING == GAMEZHERO){
navigateToURL(new URLRequest("http://www.armorgames.com/?gamereferral=RedStarFall"), "_blank");
};
};
}
private function init(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, init);
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.EXACT_FIT;
}
override protected function update(_arg1:Number):void{
if (this.USE_BRANDING == ARMOR_GAMES){
_bar.graphics.clear();
_bar.graphics.beginFill(0xDDDDDD);
_bar.graphics.drawRect(20, (480 - 25), ((640 - 40) * 1), 10);
_bar.graphics.endFill();
_bar.graphics.beginFill(0xCC0000);
_bar.graphics.drawRect(20, (480 - 25), ((640 - 40) * _arg1), 10);
_bar.graphics.endFill();
};
}
override protected function onEnterFrame(_arg1:Event):void{
var _local2:Number;
if (framesLoaded == totalFrames){
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
if (USE_BRANDING != GAMEZHERO){
this.startGame();
};
} else {
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
this.update(_local2);
};
}
private function createBasicPreloader():void{
var _local1:Bitmap = new logo();
_local1.x = ((640 / 2) - (_local1.width / 2));
_local1.y = ((480 / 2) - (_local1.height / 2));
this.addChild(_local1);
var _local2:Bitmap = new sponsorLogo();
_local2.x = ((640 / 2) - (_local2.width / 2));
_local2.y = (((480 / 2) - (_local2.height / 2)) + 160);
var _local3:Sprite = new Sprite();
_local3.buttonMode = true;
_local3.useHandCursor = true;
_local3.addEventListener(MouseEvent.CLICK, clicked);
_local3.addChild(_local2);
this.addChild(_local3);
_bar = new Sprite();
this.addChild(_bar);
}
}
}//package
Section 645
//Preloader_logo (Preloader_logo)
package {
import mx.core.*;
public class Preloader_logo extends BitmapAsset {
}
}//package
Section 646
//Preloader_sponsorLogo (Preloader_sponsorLogo)
package {
import mx.core.*;
public class Preloader_sponsorLogo extends BitmapAsset {
}
}//package
Section 647
//RedstarFallPro (RedstarFallPro)
package {
import flash.events.*;
import flash.display.*;
import ru.zedarus.games.zedengine.*;
public class RedstarFallPro extends Main {
public function RedstarFallPro():void{
this.addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, init);
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.EXACT_FIT;
}
}
}//package
Section 648
//Settings (Settings)
package {
import flash.display.*;
import ru.zedarus.games.redstarfall.*;
public class Settings {
public static const ARMOR_GAMES:int = 1;
public static const GAMEZHERO:int = 2;
public static var SITE_LOCKED:Boolean;
public static var SHOW_SPONSOR_INTRO:Boolean;
public static var MULTI_SCORES:Boolean;
public static var MORE_GAMES_LINK:String;
public static var VISUALELEMENT_DISAPPEAR_TIME:Number;
public static var blacklist_domains:Array;
public static var VISUALELEMENT_APPEAR_TIME:Number;
public static var BACKGROUND_CLASS:Class;
public static var xml_testing_path:String;
public static var levels_xml_path:String;
public static var USE_GAMEJACKET:Boolean;
public static var USE_ARMORSCORES:Boolean;
public static var ENGINE_CLASS:Class;
public static var SPONSOR_LINK:String;
public static var localization_xml_path:String;
public static var ORIGINAL_GAME_LINK:String;
public static var DELAY_BETWEEN_LEVELS:Number;
public static var USE_GAMEZHERO_SCORES:Boolean;
public static var USE_MOCHISERVICES:Boolean;
public static var TOGGLE_SOUND:Boolean;
public static var mochiads_id:String;
public static var LEVELCODE:Array;
public static var CHANGE_WORLDS_INSTANTLY:Boolean;
public static var TOGGLE_MUSIC:Boolean;
public static var mochileaderboard_id:String;
public static var SOUND_VOLUME:Number;
public static var GAME_VERSION:String;
public static var USE_KONGREGATE_API:Boolean;
public static var LEADERBOARDS_IDS:Array;
public static var GAMEZHERO_CODE:String;
public static var USE_MOCHISCORES:Boolean;
public static var GUIDE_LINK:String;
public static var xml_release_path:String;
public static var USE_MOCHIADS:Boolean;
public static var SHOW_INTRO:Boolean;
public static var ARMORSCORES_URL:String;
public static var TESTING_MODE:Boolean;
public static var localhost:String;
public static var MUSIC_VOLUME:Number;
public static var ui_xml_path:String;
public static var USE_MOCHIBOT:Boolean;
public static var allowed_domains:Array;
public static var DEFAULT_LANGUAGE:String;
public static var ACTIVATED_LEVELS:Array;
public static var VISUAL_LEVEL_ACTIVATION_BLOCK_ALIGN:String;
public static var mochibot_id:String;
public static var GAMEZHERO_ID:String;
public static var START_QUALITY:String;
public static var GAME_CLASS:Class;
public static var settings_xml_path:String;
public static var stats_xml_path:String;
public static var HUD_CLASS:Class;
public static var BRANDING:int;
public function Settings():void{
blacklist_domains = new Array();
allowed_domains = new Array();
GAME_VERSION = "v1.02";
START_QUALITY = StageQuality.HIGH;
TESTING_MODE = false;
SHOW_INTRO = false;
SHOW_SPONSOR_INTRO = true;
TOGGLE_SOUND = true;
TOGGLE_MUSIC = true;
SOUND_VOLUME = 0.75;
MUSIC_VOLUME = 0.45;
DEFAULT_LANGUAGE = "en";
ENGINE_CLASS = RedstarfallEngine;
GAME_CLASS = RedstarfallGame;
HUD_CLASS = RedstarfallHUD;
BACKGROUND_CLASS = RedstarfallBackground;
SITE_LOCKED = false;
localhost = "file:///Users/zedarus/Documents/Gamedev/Flash/RedstarFallPro/trunk/release/RedstarFallPro.swf";
allowed_domains.push("zedarus.ru");
VISUALELEMENT_APPEAR_TIME = 0.6;
VISUALELEMENT_DISAPPEAR_TIME = 0.4;
BRANDING = ARMOR_GAMES;
USE_GAMEJACKET = false;
USE_MOCHIADS = false;
USE_MOCHIBOT = false;
USE_MOCHISERVICES = false;
USE_MOCHISCORES = false;
USE_ARMORSCORES = true;
ARMORSCORES_URL = "http://rankz.armorbot.com/redstarfall_pro/";
USE_GAMEZHERO_SCORES = false;
GAMEZHERO_ID = "redstarfall";
GAMEZHERO_CODE = "157197206153222201199214213129149145152173170214198150163167149162157195210158153148210155178153139164162080151";
USE_KONGREGATE_API = false;
mochibot_id = "8afd847b";
mochiads_id = "34a5dadd5aa5090b";
mochileaderboard_id = "acd5c88d825f53d5";
MULTI_SCORES = true;
LEADERBOARDS_IDS = new Array("acd5c88d825f53d5", "", "436a9edd8dd4f0ab", "bf3628905a0f318f", "37e3d3a3710d38e8", "eb3640e71b449311", "59e694b6f1cbe3dc", "3e9bbcf18c0457fb", "6655955fd6ae905f", "f4471c76e99c35ef", "9f1f585576a1a8bd", "b8b27c885ef1bdac", "3c7010763e6633a9", "8a2825ec6a56ee94", "fcab4533ceec18d0", "c5aedb05166967b8", "fde16be1f7f14f30", "8c987cbb8dbe9b3c", "62010f7a9dd6b475", "223f3fda8851d365", "de8ea7744c6e24e0", "b3cd0932db68b92e");
MORE_GAMES_LINK = "http://www.armorgames.com/?gamereferral=RedStarFallPro";
SPONSOR_LINK = "http://www.armorgames.com/?gamereferral=RedStarFallPro";
GUIDE_LINK = "http://armorgames.com/guide/Redstar-Fall-Guide/?gamereferral=RedStarFallPro";
ORIGINAL_GAME_LINK = "http://www.armorgames.com/play/3420/redstar-fall/?gamereferral=RedStarFallPro";
xml_testing_path = "xml/testing/";
xml_release_path = "Release/xml/testing/";
levels_xml_path = "levels.xml";
settings_xml_path = "settings.xml";
stats_xml_path = "stats.xml";
ui_xml_path = "user_interface.xml";
localization_xml_path = "localization.xml";
VISUAL_LEVEL_ACTIVATION_BLOCK_ALIGN = "right";
CHANGE_WORLDS_INSTANTLY = true;
DELAY_BETWEEN_LEVELS = 5;
ACTIVATED_LEVELS = new Array();
var _local1 = 5;
ACTIVATED_LEVELS = new Array(1, 2);
LEVELCODE = new Array("", "", "shoot", "fall", "yahoo", "shootagain", "jumpnroll", "volkerball", "balance", "tricky", "starjump", "fly", "slide", "omg", "slidenroll", "rainbow", "domino", "luck", "tryme", "fast", "jumper", "pandora");
}
}
}//package