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.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_localPosition:b2Vec2;
public var m_radius:Number;
public function b2CircleShape(_arg1:b2ShapeDef){
m_localPosition = new b2Vec2();
super(_arg1);
var _local2:b2CircleDef = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local10:Number;
var _local6:b2Mat22 = _arg1.R;
var _local7:Number = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
var _local8:Number = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
var _local9:Number = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
var _local11:Number = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
return (false);
};
var _local12:Number = (_arg4.p2.x - _arg4.p1.x);
var _local13:Number = (_arg4.p2.y - _arg4.p1.y);
var _local14:Number = ((_local9 * _local12) + (_local10 * _local13));
var _local15:Number = ((_local12 * _local12) + (_local13 * _local13));
var _local16:Number = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (false);
};
var _local17:Number = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (true);
};
return (false);
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
public function GetRadius():Number{
return (m_radius);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
_local4 = _arg2.R;
var _local5:Number = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local6:Number = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
var _local7:Number = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
var _local8:Number = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number = (m_localPosition.x - _arg1.x);
var _local3:Number = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22 = _arg2.R;
var _local4:Number = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22 = _arg1.R;
var _local4:Number = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
var _local5:Number = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function Copy():b2FilterData{
var _local1:b2FilterData = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
center = new b2Vec2(0, 0);
super();
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertices:Array;
public var vertexCount:int;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
var _local1:int;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 6
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_coreVertices:Array;
public var m_vertices:Array;
private var s_supportVec:b2Vec2;
public var m_centroid:b2Vec2;
public var m_normals:Array;
public var m_obb:b2OBB;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local3:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
var _local2:b2PolygonDef = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
var _local4:int = _local3;
var _local5:int = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB = s_sweptAABB1;
var _local5:b2AABB = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local20:Number;
var _local21:Number;
var _local6:Number = 0;
var _local7:Number = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
var _local12:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local13:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
var _local14:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
var _local15:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
var _local16:Number = (_local14 - _local12);
var _local17:Number = (_local15 - _local13);
var _local18 = -1;
var _local19:int;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (false);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (true);
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
var _local7:Number = 0;
var _local8:Number = (1 / 3);
var _local9:int;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function GetNormals():Array{
return (m_normals);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local11:Number;
_local5 = _arg1.R;
var _local6:Number = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
var _local7:Number = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
var _local8:int;
_local4 = m_coreVertices[0];
var _local9:Number = ((_local4.x * _local6) + (_local4.y * _local7));
var _local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
var _local6:b2Mat22 = _local5;
_local4 = m_obb.extents;
var _local7:Number = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
var _local8:Number = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
var _local9:Number = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
var _local10:Number = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
var _local3:int;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local10:Number;
var _local4:b2Mat22 = _arg1.R;
var _local5:Number = (_arg2.x - _arg1.position.x);
var _local6:Number = (_arg2.y - _arg1.position.y);
var _local7:Number = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
var _local8:Number = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
var _local9:int;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local7:Number;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
_local7 = (1 / 3);
var _local8:int;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
var _local5:Array = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
var _local6:Number = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
public class b2Shape {
public var m_next:b2Shape;
public var m_type:int;
public var m_sweepRadius:Number;
public var m_density:Number;
public var m_filter:b2FilterData;
public var m_friction:Number;
public var m_isSensor:Boolean;
public var m_restitution:Number;
public var m_userData;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
return (false);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
var _local3:b2AABB = s_resetAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
var _local4:b2AABB = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB = s_proxyAABB;
ComputeAABB(_local3, _arg2);
var _local4:Boolean = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var friction:Number;// = 0.2
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var type:int;// = -1
public function b2ShapeDef(){
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number = (upperBound.x - lowerBound.x);
var _local2:Number = (upperBound.y - lowerBound.y);
var _local3:Boolean = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var value:uint;
public var proxyId:uint;
public var stabbingCount:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint = value;
var _local3:uint = proxyId;
var _local4:uint = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues)
package Box2D.Collision {
public class b2BoundValues {
public var lowerValues:Array;
public var upperValues:Array;
public function b2BoundValues(){
lowerValues = [0, 0];
upperValues = [0, 0];
super();
}
}
}//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_bounds:Array;
public var m_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = 0xFFFF;
public static const b2_invalid:uint = 0xFFFF;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
var _local4:Number = (_arg1.upperBound.x - _arg1.lowerBound.x);
_local5 = (_arg1.upperBound.y - _arg1.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local6:uint;
var _local7:uint;
var _local12:b2Proxy;
var _local4:Array = new Array();
var _local5:Array = new Array();
ComputeBounds(_local4, _local5, _arg1);
var _local8:Array = [_local6];
var _local9:Array = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
var _local10:int;
var _local11:int;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local10:b2Bound;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
var _local8:uint = BinarySearch(_arg5, _arg6, _arg3);
var _local9:uint = BinarySearch(_arg5, _arg6, _arg4);
var _local11:uint = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
var _local3:int;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number = _arg3.lowerBound.x;
var _local5:Number = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
var _local6:Number = _arg3.upperBound.x;
var _local7:Number = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
var _local5:uint = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
var _local6:uint = (2 * m_proxyCount);
var _local7:Array = new Array();
var _local8:Array = new Array();
ComputeBounds(_local7, _local8, _arg1);
var _local9:int;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
var _local10:int;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
var _local4:b2Proxy = m_proxyPool[_arg1];
var _local5:int = (2 * m_proxyCount);
var _local6:int;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
var _local7:int;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local4:Array;
var _local5:b2Bound;
var _local3:int;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local5:int;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
var _local12:uint = (2 * m_proxyCount);
var _local13:b2Proxy = m_proxyPool[_arg1];
var _local14:b2BoundValues = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
var _local15:b2BoundValues = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local6:int;
var _local7:b2Bound;
var _local4:int;
var _local5:int = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.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 {
public class b2Pair {
public var proxyId1:uint;
public var userData;// = null
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = 0xFFFF;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = 0xFFFF;
public static var b2_tableCapacity:int = 4096;
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_hashTable:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
var _local3:int;
var _local4:Array = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
var _local4:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local5:uint = m_hashTable[_local4];
var _local6:b2Pair;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
var _local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
var _local5:uint = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var userData;// = null
public var lowerBounds:Array;
public var upperBounds:Array;
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Segment {
public var p1:b2Vec2;
public var p2:b2Vec2;
public function b2Segment(){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
}
public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local5:b2Vec2 = _arg3.p1;
var _local6:Number = (_arg3.p2.x - _local5.x);
var _local7:Number = (_arg3.p2.y - _local5.y);
var _local8:Number = (p2.x - p1.x);
var _local9:Number = (p2.y - p1.y);
var _local10:Number = _local9;
var _local11:Number = -(_local8);
var _local12:Number = (100 * Number.MIN_VALUE);
var _local13:Number = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_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.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local8:b2ManifoldPoint;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
var _local7:b2ContactPoint = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function GetManifolds():Array{
return (null);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int = m_manifoldCount;
Evaluate(_arg1);
var _local3:int = m_manifoldCount;
var _local4:b2Body = m_shape1.m_body;
var _local5:b2Body = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
var _local1:int;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
var _local3:int = _arg1.m_shape1.m_type;
var _local4:int = _arg1.m_shape2.m_type;
var _local5:b2ContactRegister = s_registers[_local3][_local4];
var _local6:Function = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
var _local4:int = _arg1.m_type;
var _local5:int = _arg2.m_type;
var _local6:b2ContactRegister = s_registers[_local4][_local5];
var _local7:Function = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 39
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var normal:b2Vec2;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
var _local1:int;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var tangentMass:Number;
public var equalizedMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var other:b2Body;
public var prev:b2ContactEdge;
public var contact:b2Contact;
public var next:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
public class b2ContactResult {
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var normal:b2Vec2;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
var _local9:int;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
var _local5:int;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local2:Number = 0;
var _local5:int;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
var _local19:int;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
var _local1:int;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function Evaluate(_arg1:b2ContactListener):void{
}
override public function GetManifolds():Array{
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
public var m_manifold:b2Manifold;
private var m0:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
var _local3:b2ManifoldPoint = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local6:b2Body = m_shape1.m_body;
var _local7:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
var _local8:Array = [false, false];
var _local9:b2ContactPoint = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local7:b2ContactPoint;
var _local8:int;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
var _local5:b2Body = m_shape1.m_body;
var _local6:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
var _local9:Array = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 48
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.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.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
public var m_xf:b2XForm;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_type:int;
public var m_linearDamping:Number;
public var m_shapeCount:int;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
m_xf.R.Set(m_sweep.a);
var _local1:b2Mat22 = m_xf.R;
var _local2:b2Vec2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:b2MassData = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
var _local5:b2Mat22 = m_xf.R;
var _local6:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
var _local7:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
var _local4:b2Mat22 = m_xf.R;
var _local5:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
var _local6:Boolean;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local4:b2Shape;
var _local1:b2XForm = s_xf1;
_local1.R.Set(m_sweep.a0);
var _local2:b2Mat22 = _local1.R;
var _local3:b2Vec2 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
var _local5:Boolean;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
var _local3:b2Mat22 = m_xf.R;
var _local4:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
var _local5:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
var _local2:b2Shape = m_shapeList;
var _local3:b2Shape;
var _local4:Boolean;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_shapeList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22 = m_xf.R;
var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.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.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
if (_arg3 == null){
return;
};
var _local4:b2Contact = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local2:b2Shape = _arg1.m_shape1;
var _local3:b2Shape = _arg1.m_shape2;
var _local4:int = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_shape2;
_local10.friction = _arg1.m_friction;
_local10.restitution = _arg1.m_restitution;
_local11 = 0;
while (_local11 < _local4) {
_local12 = _local9[_local11];
_local10.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local10.position = _local7.GetWorldPoint(_local14.localPoint1);
_local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1);
_local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2);
_local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y));
_local10.separation = _local14.separation;
_local10.id.key = _local14.id._key;
m_world.m_contactListener.Remove(_local10);
_local13++;
};
_local11++;
};
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
var _local5:b2Body = _local2.m_body;
var _local6:b2Body = _local3.m_body;
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local5.m_contactList){
_local5.m_contactList = _arg1.m_node1.next;
};
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local6.m_contactList){
_local6.m_contactList = _arg1.m_node2.next;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape = (_arg1 as b2Shape);
var _local4:b2Shape = (_arg2 as b2Shape);
var _local5:b2Body = _local3.m_body;
var _local6:b2Body = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
var _local7:b2Contact = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
public function Collide():void{
var _local2:b2Body;
var _local3:b2Body;
var _local1:b2Contact = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 70
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import flash.display.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_drawFlags:uint;
public var m_lineThickness:Number;// = 1
public var m_drawScale:Number;// = 1
public var m_sprite:Sprite;
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawFlags = 0;
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
var _local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 71
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_joints:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
var _local4:int;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
var _local8:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local5:b2Body;
var _local6:Boolean;
var _local3:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
var _local4:Number = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_allowSleep:Boolean;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_debugDraw:b2DebugDraw;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
var _local4:b2BodyDef = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local2:b2Body = _arg1.m_body1;
var _local3:b2Body = _arg1.m_body2;
var _local4:b2XForm = _local2.m_xf;
var _local5:b2XForm = _local3.m_xf;
var _local6:b2Vec2 = _local4.position;
var _local7:b2Vec2 = _local5.position;
var _local8:b2Vec2 = _arg1.GetAnchor1();
var _local9:b2Vec2 = _arg1.GetAnchor2();
var _local10:b2Color = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local11:b2XForm;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
var _local1:uint = m_debugDraw.GetFlags();
var _local7:b2Vec2 = new b2Vec2();
var _local8:b2Vec2 = new b2Vec2();
var _local9:b2Vec2 = new b2Vec2();
var _local10:b2Color = new b2Color(0, 0, 0);
var _local12:b2AABB = new b2AABB();
var _local13:b2AABB = new b2AABB();
var _local14:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15);
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local5 = m_jointList;
while (_local5) {
DrawJoint(_local5);
_local5 = _local5.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local6 = m_broadPhase;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.9, 0.3);
_local2 = 0;
while (_local2 < b2Pair.b2_tableCapacity) {
_local16 = _local6.m_pairManager.m_hashTable[_local2];
while (_local16 != b2Pair.b2_nullPair) {
_local17 = _local6.m_pairManager.m_pairs[_local16];
_local18 = _local6.m_proxyPool[_local17.proxyId1];
_local19 = _local6.m_proxyPool[_local17.proxyId2];
_local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value));
_local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value));
_local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value));
_local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value));
_local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value));
_local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value));
_local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value));
_local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value));
_local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x));
_local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y));
_local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x));
_local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y));
m_debugDraw.DrawSegment(_local8, _local9, _local10);
_local16 = _local17.next;
};
_local2++;
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local6 = m_broadPhase;
_local20 = _local6.m_worldAABB.lowerBound;
_local21 = _local6.m_worldAABB.upperBound;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.3, 0.9);
_local2 = 0;
while (_local2 < b2Settings.b2_maxProxies) {
_local22 = _local6.m_proxyPool[_local2];
if (_local22.IsValid() == false){
} else {
_local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value));
_local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value));
_local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value));
_local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value));
_local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y);
_local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y);
_local14[2].Set(_local12.upperBound.x, _local12.upperBound.y);
_local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local2++;
};
_local14[0].Set(_local20.x, _local20.y);
_local14[1].Set(_local21.x, _local20.y);
_local14[2].Set(_local21.x, _local21.y);
_local14[3].Set(_local20.x, _local21.y);
m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((_local1 & b2DebugDraw.e_obbBit)){
_local10.Set(0.5, 0.3, 0.5);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local4.m_type != b2Shape.e_polygonShape){
} else {
_local23 = (_local4 as b2PolygonShape);
_local24 = _local23.GetOBB();
_local25 = _local24.extents;
_local14[0].Set(-(_local25.x), -(_local25.y));
_local14[1].Set(_local25.x, -(_local25.y));
_local14[2].Set(_local25.x, _local25.y);
_local14[3].Set(-(_local25.x), _local25.y);
_local2 = 0;
while (_local2 < 4) {
_local26 = _local24.R;
_local27 = _local14[_local2];
_local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local26 = _local11.R;
_local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local2++;
};
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawXForm(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
var _local2:b2JointEdge = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
var _local3:b2Shape = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
var _local5:b2Color = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetContactCount():int{
return (m_contactCount);
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
var _local3:b2Island = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
var _local4:b2Contact = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
var _local5:b2Joint = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
var _local6:int = m_bodyCount;
var _local7:Array = new Array(_local6);
var _local8:b2Body = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array = new Array(_arg3);
var _local5:int = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
var _local6:int;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
var _local8:b2Island = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
var _local9:int = m_bodyCount;
var _local10:Array = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function Validate():void{
m_broadPhase.Validate();
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local3:b2Body;
var _local4:b2Shape;
var _local2:b2Joint = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local5:b2Body;
var _local6:b2Shape;
var _local2:Boolean = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
var _local3:b2Body = _arg1.m_body1;
var _local4:b2Body = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
if (m_lock == true){
return (null);
};
var _local2:b2Body = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
m_lock = true;
var _local3:b2TimeStep = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 75
//BinaryItem (br.com.stimuli.loading.loadingtypes.BinaryItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
import br.com.stimuli.loading.*;
public class BinaryItem extends LoadingItem {
public var loader:URLLoader;
public function BinaryItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false);
};
}
override public function load():void{
super.load();
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false, 0, true);
try {
loader.load(url);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
_content = _arg1.target.data;
super.onCompleteHandler(_arg1);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 76
//ImageItem (br.com.stimuli.loading.loadingtypes.ImageItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
import br.com.stimuli.loading.*;
public class ImageItem extends LoadingItem {
public var loader:Loader;
public function ImageItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CONTEXT];
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function load():void{
super.load();
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.INIT, onInitHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 100, true);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityErrorHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
try {
loader.load(url, _context);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
override public function _parseOptions(_arg1:Object):Array{
_context = ((_arg1[BulkLoader.CONTEXT]) || (null));
return (super._parseOptions(_arg1));
}
public function getDefinitionByName(_arg1:String):Object{
if (loader.contentLoaderInfo.applicationDomain.hasDefinition(_arg1)){
return (loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1));
};
return (null);
}
override public function isImage():Boolean{
return ((type == BulkLoader.TYPE_IMAGE));
}
override public function onCompleteHandler(_arg1:Event):void{
var evt = _arg1;
try {
_content = loader.content;
super.onCompleteHandler(evt);
} catch(e:SecurityError) {
_content = loader;
super.onCompleteHandler(evt);
};
}
override public function cleanListeners():void{
var _local1:Object;
if (loader){
_local1 = loader.contentLoaderInfo;
_local1.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
_local1.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
_local1.removeEventListener(Event.INIT, onInitHandler, false);
_local1.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
_local1.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
_local1.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
};
}
override public function isSWF():Boolean{
return ((type == BulkLoader.TYPE_MOVIECLIP));
}
public function _onHttpStatusHandler(_arg1:HTTPStatusEvent):void{
_httpStatus = _arg1.status;
dispatchEvent(_arg1);
}
public function onInitHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 77
//LoadingItem (br.com.stimuli.loading.loadingtypes.LoadingItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
import br.com.stimuli.loading.*;
import br.com.stimuli.loading.utils.*;
public class LoadingItem extends EventDispatcher {
public var _priority:int;// = 0
public var _type:String;
public var _parsedURL:SmartURL;
public var _isLoaded:Boolean;
public var _isLoading:Boolean;
public var _additionIndex:int;
public var _bytesTotal:int;// = -1
public var _httpStatus:int;// = -1
public var _content;
public var status:String;
public var _speed:Number;
public var _weightPercentLoaded:Number;
public var propertyParsingErrors:Array;
public var url:URLRequest;
public var errorEvent:ErrorEvent;
public var weight:int;// = 1
public var _addedTime:int;
public var _context;// = null
public var preventCache:Boolean;
public var _responseTime:Number;
public var _uid:String;
public var maxTries:int;// = 3
public var _bytesLoaded:int;// = 0
public var _percentLoaded:Number;
public var _totalTime:int;
public var numTries:int;// = 0
public var _id:String;
public var _latency:Number;
public var _startTime:int;
public var _bytesRemaining:int;// = 10000000
public var _timeToDownload:Number;
public var specificAvailableProps:Array;
public static const STATUS_STOPPED:String = "stopped";
public static const STATUS_STARTED:String = "started";
public static const STATUS_ERROR:String = "error";
public static const STATUS_FINISHED:String = "finished";
public function LoadingItem(_arg1:URLRequest, _arg2:String, _arg3:String){
this._type = _arg2;
this.url = _arg1;
_parsedURL = new SmartURL(_arg1.url);
if (!specificAvailableProps){
specificAvailableProps = [];
};
this._uid = _arg3;
}
public function onSecurityErrorHandler(_arg1:ErrorEvent):void{
status = STATUS_ERROR;
errorEvent = (_arg1 as ErrorEvent);
_arg1.stopPropagation();
_dispatchErrorEvent(errorEvent);
}
public function stop():void{
if (_isLoaded){
return;
};
status = STATUS_STOPPED;
_isLoading = false;
}
public function isSound():Boolean{
return (false);
}
public function onCompleteHandler(_arg1:Event):void{
_totalTime = getTimer();
_timeToDownload = ((_totalTime - _responseTime) / 1000);
if (_timeToDownload == 0){
_timeToDownload = 0.1;
};
_speed = BulkLoader.truncateNumber(((bytesTotal / 0x0400) / _timeToDownload));
status = STATUS_FINISHED;
_isLoaded = true;
dispatchEvent(_arg1);
_arg1.stopPropagation();
}
public function get weightPercentLoaded():Number{
return (_weightPercentLoaded);
}
public function get id():String{
return (_id);
}
public function _dispatchErrorEvent(_arg1:ErrorEvent):void{
status = STATUS_ERROR;
dispatchEvent(new ErrorEvent(BulkLoader.ERROR, true, false, _arg1.text));
}
public function onHttpStatusHandler(_arg1:HTTPStatusEvent):void{
_httpStatus = _arg1.status;
dispatchEvent(_arg1);
}
public function get totalTime():int{
return (_totalTime);
}
public function get type():String{
return (_type);
}
public function get speed():Number{
return (_speed);
}
public function _parseOptions(_arg1:Object):Array{
var _local3:String;
preventCache = _arg1[BulkLoader.PREVENT_CACHING];
_id = _arg1[BulkLoader.ID];
_priority = ((int(_arg1[BulkLoader.PRIORITY])) || (0));
maxTries = ((_arg1[BulkLoader.MAX_TRIES]) || (3));
weight = ((int(_arg1[BulkLoader.WEIGHT])) || (1));
var _local2:Array = BulkLoader.GENERAL_AVAILABLE_PROPS.concat(specificAvailableProps);
propertyParsingErrors = [];
for (_local3 in _arg1) {
if (_local2.indexOf(_local3) == -1){
propertyParsingErrors.push(((((this + ": got a wrong property name: ") + _local3) + ", with value:") + _arg1[_local3]));
};
};
return (propertyParsingErrors);
}
public function get startTime():int{
return (_startTime);
}
public function get bytesLoaded():int{
return (_bytesLoaded);
}
public function isImage():Boolean{
return (false);
}
public function onStartedHandler(_arg1:Event):void{
_responseTime = getTimer();
_latency = BulkLoader.truncateNumber(((_responseTime - _startTime) / 1000));
status = STATUS_STARTED;
dispatchEvent(_arg1);
}
public function get hostName():String{
return (_parsedURL.host);
}
override public function toString():String{
return (((((("LoadingItem url: " + url.url) + ", type:") + _type) + ", status: ") + status));
}
public function isVideo():Boolean{
return (false);
}
public function isText():Boolean{
return (false);
}
public function get content(){
return (_content);
}
public function onProgressHandler(_arg1):void{
_bytesLoaded = _arg1.bytesLoaded;
_bytesTotal = _arg1.bytesTotal;
_bytesRemaining = (_bytesTotal - bytesLoaded);
_percentLoaded = (_bytesLoaded / _bytesTotal);
_weightPercentLoaded = (_percentLoaded * weight);
dispatchEvent(_arg1);
}
public function isXML():Boolean{
return (false);
}
public function get bytesTotal():int{
return (_bytesTotal);
}
public function get httpStatus():int{
return (_httpStatus);
}
public function onErrorHandler(_arg1:ErrorEvent):void{
numTries++;
_arg1.stopPropagation();
if (numTries < maxTries){
status = null;
load();
} else {
status = STATUS_ERROR;
errorEvent = _arg1;
_dispatchErrorEvent(errorEvent);
};
}
public function get humanFiriendlySize():String{
var _local1:Number = (_bytesTotal / 0x0400);
if (_local1 < 0x0400){
return ((int(_local1) + " kb"));
};
return (((_local1 / 0x0400).toPrecision(3) + " mb"));
}
public function isStreamable():Boolean{
return (false);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function get responseTime():Number{
return (_responseTime);
}
public function get priority():int{
return (_priority);
}
public function get bytesRemaining():int{
return (_bytesRemaining);
}
public function get isLoaded():Boolean{
return (_isLoaded);
}
public function get timeToDownload():int{
return (_timeToDownload);
}
public function isLoader():Boolean{
return (false);
}
public function load():void{
var _local1:String;
if (preventCache){
_local1 = ((("BulkLoaderNoCache=" + _uid) + "_") + int(((Math.random() * 100) * getTimer())));
if (url.url.indexOf("?") == -1){
url.url = (url.url + ("?" + _local1));
} else {
url.url = (url.url + ("&" + _local1));
};
};
_isLoading = true;
_startTime = getTimer();
}
public function getStats():String{
return (((((((((((("Item url: " + url.url) + "(s), total time: ") + (_totalTime / 1000).toPrecision(3)) + "(s), download time: ") + _timeToDownload.toPrecision(3)) + "(s), latency:") + _latency) + "(s), speed: ") + _speed) + " kb/s, size: ") + humanFiriendlySize));
}
public function get addedTime():int{
return (_addedTime);
}
public function _createErrorEvent(_arg1:Error):ErrorEvent{
return (new ErrorEvent(BulkLoader.ERROR, false, false, _arg1.message));
}
public function cleanListeners():void{
}
public function isSWF():Boolean{
return (false);
}
public function destroy():void{
_content = null;
}
public function get latency():Number{
return (_latency);
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 78
//SoundItem (br.com.stimuli.loading.loadingtypes.SoundItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import br.com.stimuli.loading.*;
public class SoundItem extends LoadingItem {
public var loader:Sound;
public function SoundItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CONTEXT];
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function isStreamable():Boolean{
return (true);
}
override public function isSound():Boolean{
return (true);
}
override public function load():void{
super.load();
loader = new Sound();
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false, 0, true);
try {
loader.load(url, _context);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function onStartedHandler(_arg1:Event):void{
_content = loader;
super.onStartedHandler(_arg1);
}
override public function destroy():void{
cleanListeners();
stop();
_content = null;
loader = null;
}
override public function _parseOptions(_arg1:Object):Array{
_context = ((_arg1[BulkLoader.CONTEXT]) || (null));
return (super._parseOptions(_arg1));
}
override public function onCompleteHandler(_arg1:Event):void{
_content = loader;
super.onCompleteHandler(_arg1);
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false);
};
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 79
//URLItem (br.com.stimuli.loading.loadingtypes.URLItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import flash.net.*;
import br.com.stimuli.loading.*;
public class URLItem extends LoadingItem {
public var loader:URLLoader;
public function URLItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
};
}
override public function load():void{
super.load();
loader = new URLLoader();
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, super.onErrorHandler, false, 0, true);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
try {
loader.load(url);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function isText():Boolean{
return (true);
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
_content = loader.data;
super.onCompleteHandler(_arg1);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 80
//VideoItem (br.com.stimuli.loading.loadingtypes.VideoItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
import br.com.stimuli.loading.*;
public class VideoItem extends LoadingItem {
public var stream:NetStream;
public var dummyEventTrigger:Sprite;
public var pausedAtStart:Boolean;// = false
public var _metaData:Object;
public var _canBeginStreaming:Boolean;// = false
private var nc:NetConnection;
public var _checkPolicyFile:Boolean;
public function VideoItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CHECK_POLICY_FILE, BulkLoader.PAUSED_AT_START];
super(_arg1, _arg2, _arg3);
_bytesTotal = (_bytesLoaded = 0);
}
public function get checkPolicyFile():Object{
return (_checkPolicyFile);
}
override public function onStartedHandler(_arg1:Event):void{
_content = stream;
if (((pausedAtStart) && (stream))){
stream.pause();
};
super.onStartedHandler(_arg1);
}
override public function stop():void{
try {
if (stream){
stream.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function _parseOptions(_arg1:Object):Array{
pausedAtStart = ((_arg1[BulkLoader.PAUSED_AT_START]) || (false));
_checkPolicyFile = ((_arg1[BulkLoader.CHECK_POLICY_FILE]) || (false));
return (super._parseOptions(_arg1));
}
private function fireCanBeginStreamingEvent():void{
if (_canBeginStreaming){
return;
};
_canBeginStreaming = true;
var _local1:Event = new Event(BulkLoader.CAN_BEGIN_PLAYING);
dispatchEvent(_local1);
}
public function get metaData():Object{
return (_metaData);
}
function onNetStatus(_arg1:NetStatusEvent):void{
var _local2:Event;
if (!stream){
return;
};
stream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false);
if (_arg1.info.code == "NetStream.Play.Start"){
_content = stream;
_local2 = new Event(Event.OPEN);
onStartedHandler(_local2);
} else {
if (_arg1.info.code == "NetStream.Play.StreamNotFound"){
onErrorHandler(_createErrorEvent(new Error(("[VideoItem] NetStream not found at " + this.url.url))));
};
};
}
override public function isStreamable():Boolean{
return (true);
}
override public function load():void{
super.load();
nc = new NetConnection();
nc.connect(null);
stream = new NetStream(nc);
stream.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
stream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
dummyEventTrigger = new Sprite();
dummyEventTrigger.addEventListener(Event.ENTER_FRAME, createNetStreamEvent, false, 0, true);
var customClient:Object = new Object();
customClient.onCuePoint = function (... _args):void{
};
customClient.onMetaData = onVideoMetadata;
customClient.onPlayStatus = function (... _args):void{
};
stream.client = customClient;
try {
stream.play(url.url, _checkPolicyFile);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
stream.seek(0);
}
public function get canBeginStreaming():Boolean{
return (_canBeginStreaming);
}
function onVideoMetadata(_arg1):void{
_metaData = _arg1;
}
override public function onCompleteHandler(_arg1:Event):void{
_content = stream;
super.onCompleteHandler(_arg1);
}
override public function cleanListeners():void{
if (stream){
stream.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
stream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false);
};
if (dummyEventTrigger){
dummyEventTrigger.removeEventListener(Event.ENTER_FRAME, createNetStreamEvent, false);
dummyEventTrigger = null;
};
}
override public function isVideo():Boolean{
return (true);
}
public function createNetStreamEvent(_arg1:Event):void{
var _local2:Event;
var _local3:Event;
var _local4:ProgressEvent;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if ((((_bytesTotal == _bytesLoaded)) && ((_bytesTotal > 8)))){
if (dummyEventTrigger){
dummyEventTrigger.removeEventListener(Event.ENTER_FRAME, createNetStreamEvent, false);
};
fireCanBeginStreamingEvent();
_local2 = new Event(Event.COMPLETE);
onCompleteHandler(_local2);
} else {
if ((((((_bytesTotal == 0)) && (stream))) && ((stream.bytesTotal > 4)))){
_local3 = new Event(Event.OPEN);
onStartedHandler(_local3);
_bytesLoaded = stream.bytesLoaded;
_bytesTotal = stream.bytesTotal;
} else {
if (stream){
_local4 = new ProgressEvent(ProgressEvent.PROGRESS, false, false, stream.bytesLoaded, stream.bytesTotal);
if (((((isVideo()) && (metaData))) && (!(_canBeginStreaming)))){
_local5 = (getTimer() - responseTime);
if (_local5 > 100){
_local6 = (bytesLoaded / (_local5 / 1000));
_bytesRemaining = (_bytesTotal - bytesLoaded);
_local7 = (_bytesRemaining / (_local6 * 0.8));
_local8 = (metaData.duration - stream.bufferLength);
if (_local8 > _local7){
fireCanBeginStreamingEvent();
};
};
};
super.onProgressHandler(_local4);
};
};
};
}
override public function destroy():void{
if (stream){
};
stop();
cleanListeners();
stream = null;
super.destroy();
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 81
//XMLItem (br.com.stimuli.loading.loadingtypes.XMLItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import flash.net.*;
import br.com.stimuli.loading.*;
public class XMLItem extends LoadingItem {
public var loader:URLLoader;
public function XMLItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false);
};
}
override public function load():void{
super.load();
loader = new URLLoader();
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
try {
loader.load(url);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function isText():Boolean{
return (true);
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
var evt = _arg1;
try {
_content = new XML(loader.data);
} catch(e:Error) {
_content = null;
status = STATUS_ERROR;
dispatchEvent(_createErrorEvent(e));
};
super.onCompleteHandler(evt);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 82
//SmartURL (br.com.stimuli.loading.utils.SmartURL)
package br.com.stimuli.loading.utils {
public class SmartURL {
public var rawString:String;
public var port:int;
public var path:String;
public var queryObject:Object;
public var queryString:String;
public var host:String;
public var queryLength:int;// = 0
public var protocol:String;
public function SmartURL(_arg1:String){
var _local4:String;
var _local5:String;
var _local6:String;
super();
this.rawString = _arg1;
var _local2:RegExp = /((?P<protocol>[a-zA-Z]+: \/\/) (?P<host>[^:\/]*) (:(?P<port>\d+))?)? (?P<path>[^?]*)? ((?P<query>.*))? /x;
var _local3:* = _local2.exec(_arg1);
if (_local3){
protocol = (Boolean(_local3.protocol)) ? _local3.protocol : "http://";
protocol = protocol.substr(0, protocol.indexOf("://"));
host = ((_local3.host) || (null));
port = (_local3.port) ? int(_local3.port) : 80;
path = _local3.path;
queryString = _local3.query;
if (queryString){
queryObject = {};
queryString = queryString.substr(1);
for each (_local6 in queryString.split("&")) {
_local5 = _local6.split("=")[0];
_local4 = _local6.split("=")[1];
queryObject[_local5] = _local4;
queryLength++;
};
};
} else {
trace("no match");
};
}
public function toString(... _args):String{
if ((((_args.length > 0)) && ((_args[0] == true)))){
return (((((((((((("[URL] rawString :" + rawString) + ", protocol: ") + protocol) + ", port: ") + port) + ", host: ") + host) + ", path: ") + path) + ". queryLength: ") + queryLength));
};
return (rawString);
}
}
}//package br.com.stimuli.loading.utils
Section 83
//BulkLoader (br.com.stimuli.loading.BulkLoader)
package br.com.stimuli.loading {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import br.com.stimuli.loading.loadingtypes.*;
public class BulkLoader extends EventDispatcher {
public var _itemsTotal:int;// = 0
public var speedAvg:Number;
public var _numConnections:int;// = 12
public var _totalWeight:int;// = 0
public var _bytesTotalCurrent:int;// = 0
public var _itemsLoaded:int;// = 0
public var totalTime:Number;
public var _additionIndex:int;// = 0
public var _bytesTotal:int;// = 0
public var _loadedRatio:Number;// = 0
public var _speed:Number;
public var _lastSpeedCheck:int;
public var _isPaused:Boolean;// = true
public var _isFinished:Boolean;
public var _name:String;
public var _allowsAutoIDFromFileName:Boolean;// = false
public var _contents:Dictionary;
public var _logFunction:Function;
public var _bytesLoaded:int;// = 0
public var _connections:Object;
public var logLevel:int;// = 4
public var _percentLoaded:Number;// = 0
public var _weightPercent:Number;
public var _lastBytesCheck:int;
public var _isRunning:Boolean;
public var _id:int;
public var _items:Array;
public var _stringSubstitutions:Object;
public var avgLatency:Number;
public var _startTime:int;
public var maxConnectionsPerHost:int;// = 2
public var _speedTotal:Number;
public var _endTIme:int;
public static const CAN_BEGIN_PLAYING:String = "canBeginPlaying";
public static const TYPE_VIDEO:String = "video";
public static const PREVENT_CACHING:String = "preventCache";
public static const TYPE_TEXT:String = "text";
public static const ID:String = "id";
public static const PAUSED_AT_START:String = "pausedAtStart";
public static const SECURITY_ERROR:String = "securityError";
public static const LOG_WARNINGS:int = 3;
public static const PROGRESS:String = "progress";
public static const COMPLETE:String = "complete";
public static const AVAILABLE_TYPES:Array = [TYPE_VIDEO, TYPE_XML, TYPE_TEXT, TYPE_SOUND, TYPE_MOVIECLIP, TYPE_IMAGE, TYPE_BINARY];
public static const LOG_VERBOSE:int = 0;
public static const OPEN:String = "open";
public static const HEADERS:String = "headers";
public static const TYPE_XML:String = "xml";
public static const HTTP_STATUS:String = "httpStatus";
public static const CONTEXT:String = "context";
public static const WEIGHT:String = "weight";
public static const CHECK_POLICY_FILE:String = "checkPolicyFile";
public static const TYPE_MOVIECLIP:String = "movieclip";
public static const PRIORITY:String = "priority";
public static const TYPE_BINARY:String = "binary";
public static const TYPE_SOUND:String = "sound";
public static const MAX_TRIES:String = "maxTries";
public static const VERSION:String = "$Id$";
public static const GENERAL_AVAILABLE_PROPS:Array = [WEIGHT, MAX_TRIES, HEADERS, ID, PRIORITY, PREVENT_CACHING, "type"];
public static const DEFAULT_NUM_CONNECTIONS:int = 12;
public static const LOG_SILENT:int = 10;
public static const ERROR:String = "error";
public static const LOG_INFO:int = 2;
public static const DEFAULT_LOG_LEVEL:int = 4;
public static const LOG_ERRORS:int = 4;
public static const TYPE_IMAGE:String = "image";
public static var MOVIECLIP_EXTENSIONS:Array = ["swf"];
public static var XML_EXTENSIONS:Array = ["xml"];
public static var SOUND_EXTENSIONS:Array = ["mp3", "f4a", "f4b"];
public static var TEXT_EXTENSIONS:Array = ["txt", "js", "php", "asp", "py"];
public static var AVAILABLE_EXTENSIONS:Array = ["swf", "jpg", "jpeg", "gif", "png", "flv", "mp3", "xml", "txt", "js"];
public static var _allLoaders:Object = {};
public static var VIDEO_EXTENSIONS:Array = ["flv", "f4v", "f4p", "mp4"];
public static var IMAGE_EXTENSIONS:Array = ["jpg", "jpeg", "gif", "png"];
public static var _customTypesExtensions:Object;
public static var _typeClasses:Object = {image:ImageItem, movieclip:ImageItem, xml:XMLItem, video:VideoItem, sound:SoundItem, text:URLItem, binary:BinaryItem};
public static var _instancesCreated:int = 0;
public function BulkLoader(_arg1:String, _arg2:int=12, _arg3:int=4){
var name = _arg1;
var numConnections = _arg2;
var logLevel = _arg3;
_items = [];
_contents = new Dictionary(true);
_logFunction = trace;
super();
if (Boolean(_allLoaders[name])){
__debug_print_loaders();
throw (new Error((("BulkLoader with name'" + name) + "' has already been created.")));
};
if (!name){
throw (new Error("Cannot create a BulkLoader instance without a name"));
};
_allLoaders[name] = this;
if (numConnections > 0){
this._numConnections = numConnections;
};
this.logLevel = logLevel;
_name = name;
_instancesCreated++;
_id = _instancesCreated;
_additionIndex = 0;
addEventListener(BulkLoader.ERROR, function (_arg1:Event):void{
}, false, 1, true);
}
public function get allowsAutoIDFromFileName():Boolean{
return (_allowsAutoIDFromFileName);
}
public function _onItemComplete(_arg1:Event):void{
var _local2:LoadingItem = (_arg1.target as LoadingItem);
_removeFromConnections(_local2);
log("Loaded ", _local2, LOG_INFO);
log("Items to load", getNotLoadedItems(), LOG_VERBOSE);
_local2.cleanListeners();
_contents[_local2.url.url] = _local2.content;
var _local3:Boolean = _loadNext();
var _local4:Boolean = _isAllDoneP();
if (_local4){
_onAllLoaded();
};
_arg1.stopPropagation();
}
public function get loadedRatio():Number{
return (_loadedRatio);
}
public function loadNow(_arg1):Boolean{
var _local3:LoadingItem;
var _local2:LoadingItem = get(_arg1);
if (!_local2){
return (false);
};
if (!_connections){
_connections = {};
};
if ((((_local2.status == LoadingItem.STATUS_FINISHED)) || ((_local2.status == LoadingItem.STATUS_STARTED)))){
return (true);
};
if ((((_getNumConnections() >= numConnections)) || ((_getNumConnectionsForItem(_local2) >= maxConnectionsPerHost)))){
_local3 = _getLeastUrgentOpenedItem();
pause(_local3);
_removeFromConnections(_local3);
_local3.status = null;
};
_local2._priority = highestPriority;
_loadNext(_local2);
return (true);
}
public function set allowsAutoIDFromFileName(_arg1:Boolean):void{
_allowsAutoIDFromFileName = _arg1;
}
public function _getContentAsType(_arg1, _arg2:Class, _arg3:Boolean=false){
var res:*;
var key = _arg1;
var type = _arg2;
var clearMemory = _arg3;
if (!_name){
throw (new Error("[BulkLoader] Cannot use an instance that has been cleared from memory (.clear())"));
};
var item:LoadingItem = get(key);
if (!item){
return (null);
};
try {
if (((item._isLoaded) || (((item.isStreamable()) && ((item.status == LoadingItem.STATUS_STARTED)))))){
res = (item.content as type);
if (res == null){
throw (new Error("bad cast"));
};
if (clearMemory){
remove(key);
if (!_isPaused){
_loadNext();
};
};
return (res);
};
} catch(e:Error) {
log((("Failed to get content with url: '" + key) + "'as type:"), type, LOG_ERRORS);
};
return (null);
}
public function set stringSubstitutions(_arg1:Object):void{
_stringSubstitutions = _arg1;
}
public function get contents():Object{
return (_contents);
}
public function get id():int{
return (_id);
}
public function _getConnectionsForHostName(_arg1:String):Array{
if (_connections[_arg1] == null){
_connections[_arg1] = [];
};
return (_connections[_arg1]);
}
public function getBitmap(_arg1:String, _arg2:Boolean=false):Bitmap{
return (Bitmap(_getContentAsType(_arg1, Bitmap, _arg2)));
}
public function _removeFromConnections(_arg1):Boolean{
if (((!(_connections)) || ((_getNumConnectionsForItem(_arg1) == 0)))){
return (false);
};
var _local2:Array = _getConnectionsForHostName(_arg1.hostName);
var _local3:int = _local2.indexOf(_arg1);
if (_local3 > -1){
_local2.splice(_local3, 1);
return (true);
};
return (false);
}
public function resume(_arg1):Boolean{
var _local2:LoadingItem = ((_arg1 is LoadingItem)) ? _arg1 : get(_arg1);
_isPaused = false;
if (((_local2) && ((_local2.status == LoadingItem.STATUS_STOPPED)))){
_local2.status = null;
_loadNext();
return (true);
};
return (false);
}
public function _onAllLoaded():void{
if (_isFinished){
return;
};
var _local1:BulkProgressEvent = new BulkProgressEvent(COMPLETE);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
var _local2:BulkProgressEvent = new BulkProgressEvent(PROGRESS);
_local2.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
_isRunning = false;
_endTIme = getTimer();
totalTime = BulkLoader.truncateNumber(((_endTIme - _startTime) / 1000));
_updateStats();
_connections = {};
getStats();
_isFinished = true;
log("Finished all", LOG_INFO);
dispatchEvent(_local2);
dispatchEvent(_local1);
}
public function removePausedItems():Boolean{
var stoppedLoads:Array = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_STOPPED));
});
stoppedLoads.forEach(function (_arg1:LoadingItem, ... _args):void{
remove(_arg1);
});
_loadNext();
return ((stoppedLoads.length > 0));
}
public function resumeAll():Boolean{
log("Resuming all items", LOG_VERBOSE);
var affected:Boolean;
_items.forEach(function (_arg1:LoadingItem, ... _args):void{
if (_arg1.status == LoadingItem.STATUS_STOPPED){
resume(_arg1);
affected = true;
};
});
_loadNext();
return (affected);
}
public function get isRunning():Boolean{
return (_isRunning);
}
public function _getNumConnectionsForItem(_arg1:LoadingItem):int{
var _local2:Array = _getConnectionsForHostName(_arg1.hostName);
if (!_local2){
return (0);
};
return (_local2.length);
}
public function getProgressForItems(_arg1:Array):BulkProgressEvent{
var _local11:LoadingItem;
var _local13:*;
_bytesLoaded = (_bytesTotal = (_bytesTotalCurrent = 0));
var _local2:Number = 0;
var _local3:int;
var _local4:int;
var _local5:Number = 0;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local12:Array = [];
for each (_local13 in _arg1) {
_local11 = get(_local13);
if (!_local11){
} else {
_local6++;
_local3 = (_local3 + _local11.weight);
if ((((((_local11.status == LoadingItem.STATUS_STARTED)) || ((_local11.status == LoadingItem.STATUS_FINISHED)))) || ((_local11.status == LoadingItem.STATUS_STOPPED)))){
_local8 = (_local8 + _local11._bytesLoaded);
_local10 = (_local10 + _local11._bytesTotal);
_local5 = (_local5 + ((_local11._bytesLoaded / _local11._bytesTotal) * _local11.weight));
if (_local11.status == LoadingItem.STATUS_FINISHED){
_local7++;
};
_local4++;
};
};
};
if (_local4 != _local6){
_local9 = Number.POSITIVE_INFINITY;
} else {
_local9 = _local10;
};
_local2 = (_local5 / _local3);
if (_local3 == 0){
_local2 = 0;
};
var _local14:BulkProgressEvent = new BulkProgressEvent(PROGRESS);
_local14.setInfo(_local8, _local9, _local9, _local7, _local6, _local2);
return (_local14);
}
public function get logFunction():Function{
return (_logFunction);
}
public function getNetStreamMetaData(_arg1:String, _arg2:Boolean=false):Object{
var _local3:NetStream = getNetStream(_arg1, _arg2);
return ((Boolean(_local3)) ? (get(_arg1) as Object).metaData : null);
}
public function getContent(_arg1:String, _arg2:Boolean=false){
return (_getContentAsType(_arg1, Object, _arg2));
}
public function getSerializedData(_arg1, _arg2:Boolean=false, _arg3:Function=null){
var raw:*;
var parsed:*;
var key = _arg1;
var clearMemory = _arg2;
var encodingFunction = _arg3;
try {
raw = _getContentAsType(key, Object, clearMemory);
parsed = encodingFunction.apply(null, [raw]);
return (parsed);
} catch(e:Error) {
log("Failed to parse key:", key, ("with encodingFunction:" + encodingFunction), LOG_ERRORS);
};
return (null);
}
public function log(... _args):void{
var _local2:int = (isNaN(_args[(_args.length - 1)])) ? 3 : int(_args.pop());
if (_local2 >= logLevel){
_logFunction(("[BulkLoader] " + _args.join(" ")));
};
}
public function clear():void{
removeAll();
delete _allLoaders[name];
_name = null;
}
public function get speed():Number{
var _local1:int = (getTimer() - _lastSpeedCheck);
var _local2:int = ((bytesLoaded - _lastBytesCheck) / 0x0400);
var _local3:int = (_local2 / (_local1 / 1000));
_lastSpeedCheck = _local1;
_lastBytesCheck = bytesLoaded;
return (_local3);
}
public function get bytesLoaded():int{
return (_bytesLoaded);
}
public function getFailedItems():Array{
return (_items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_ERROR));
}));
}
public function _loadNext(_arg1:LoadingItem=null):Boolean{
var _local3:Array;
if (_isFinished){
return (false);
};
if (!_connections){
_connections = {};
};
var _local2:Boolean;
_arg1 = ((_arg1) || (_getNextItemToLoad()));
if (_arg1){
_local2 = true;
_isRunning = true;
if (_canOpenConnectioForItem(_arg1)){
_local3 = _getConnectionsForHostName(_arg1.hostName);
_local3.push(_arg1);
_arg1.load();
log("Will load item:", _arg1, LOG_INFO);
};
if (_getNextItemToLoad()){
_loadNext();
};
};
return (_local2);
}
public function getSound(_arg1, _arg2:Boolean=false):Sound{
return (Sound(_getContentAsType(_arg1, Sound, _arg2)));
}
public function removeFailedItems():int{
var numCleared:int;
var badItems:Array = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_ERROR));
});
numCleared = badItems.length;
badItems.forEach(function (_arg1:LoadingItem, ... _args):void{
remove(_arg1);
});
_loadNext();
return (numCleared);
}
public function get(_arg1):LoadingItem{
var _local2:LoadingItem;
if (!_arg1){
return (null);
};
if ((_arg1 is LoadingItem)){
return (_arg1);
};
for each (_local2 in _items) {
if ((((((((_local2._id == _arg1)) || ((_local2._parsedURL.rawString == _arg1)))) || ((_local2.url == _arg1)))) || ((((_arg1 is URLRequest)) && ((_local2.url.url == _arg1.url)))))){
return (_local2);
};
};
return (null);
}
public function _getNumConnections():int{
var _local2:String;
var _local1:int;
for (_local2 in _connections) {
_local1 = (_local1 + _connections[_local2].length);
};
return (_local1);
}
public function get highestPriority():int{
var _local2:LoadingItem;
var _local1:int = int.MIN_VALUE;
for each (_local2 in _items) {
if (_local2.priority > _local1){
_local1 = _local2.priority;
};
};
return (_local1);
}
public function start(_arg1:int=-1):void{
if (_arg1 > 0){
_numConnections = _arg1;
};
if (_connections){
_loadNext();
return;
};
_startTime = getTimer();
_connections = {};
_loadNext();
_isRunning = true;
_lastBytesCheck = 0;
_lastSpeedCheck = getTimer();
_isPaused = false;
}
public function _getAllConnections():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in _connections) {
_local1 = _local1.concat(_connections[_local2]);
};
return (_local1);
}
public function _getLeastUrgentOpenedItem():LoadingItem{
var _local1:Array = _getAllConnections();
_local1.sortOn(["priority", "bytesRemaining", "_additionIndex"], [Array.NUMERIC, Array.DESCENDING, Array.NUMERIC, Array.NUMERIC]);
var _local2:LoadingItem = LoadingItem(_local1[0]);
return (_local2);
}
public function getBitmapData(_arg1, _arg2:Boolean=false):BitmapData{
var key = _arg1;
var clearMemory = _arg2;
try {
return (getBitmap(key, clearMemory).bitmapData);
} catch(e:Error) {
log("Failed to get bitmapData with url:", key, LOG_ERRORS);
};
return (null);
}
public function set logFunction(_arg1:Function):void{
_logFunction = _arg1;
}
override public function toString():String{
return (((((("[BulkLoader] name:" + name) + ", itemsTotal: ") + itemsTotal) + ", itemsLoaded: ") + _itemsLoaded));
}
public function get itemsTotal():int{
return (items.length);
}
public function sortItemsByPriority():void{
_items.sortOn(["priority", "_additionIndex"], [(Array.NUMERIC | Array.DESCENDING), Array.NUMERIC]);
}
public function get stringSubstitutions():Object{
return (_stringSubstitutions);
}
public function get name():String{
return (_name);
}
public function remove(_arg1, _arg2:Boolean=false):Boolean{
var item:LoadingItem;
var allDone:Boolean;
var key = _arg1;
var internalCall = _arg2;
try {
item = get(key);
if (!item){
return (false);
};
_removeFromItems(item);
_removeFromConnections(item);
item.destroy();
delete _contents[item.url.url];
if (internalCall){
return (true);
};
item = null;
_onProgress();
allDone = _isAllDoneP();
if (allDone){
_onAllLoaded();
};
return (true);
} catch(e:Error) {
log(("Error while removing item from key:" + key), e.getStackTrace(), LOG_ERRORS);
};
return (false);
}
public function removeAll():void{
var _local1:LoadingItem;
for each (_local1 in _items.slice()) {
remove(_local1, true);
};
_items = [];
_connections = {};
_contents = new Dictionary();
_percentLoaded = (_weightPercent = (_loadedRatio = 0));
}
public function _updateStats():void{
var _local4:LoadingItem;
avgLatency = 0;
speedAvg = 0;
var _local1:Number = 0;
var _local2:int;
_speedTotal = 0;
var _local3:Number = 0;
for each (_local4 in _items) {
if (((_local4._isLoaded) && (!((_local4.status == LoadingItem.STATUS_ERROR))))){
_local1 = (_local1 + _local4.latency);
_local2 = (_local2 + _local4.bytesTotal);
_local3++;
};
};
_speedTotal = ((_local2 / 0x0400) / totalTime);
avgLatency = (_local1 / _local3);
speedAvg = (_speedTotal / _local3);
}
public function reload(_arg1):Boolean{
var _local2:LoadingItem = get(_arg1);
if (!_local2){
return (false);
};
_removeFromItems(_local2);
_removeFromConnections(_local2);
_local2.stop();
_local2.cleanListeners();
_local2.status = null;
_isFinished = false;
_local2._addedTime = getTimer();
_local2._additionIndex = _additionIndex++;
_local2.addEventListener(Event.COMPLETE, _onItemComplete, false, int.MIN_VALUE, true);
_local2.addEventListener(Event.COMPLETE, _incrementItemsLoaded, false, int.MAX_VALUE, true);
_local2.addEventListener(ERROR, _onItemError, false, 0, true);
_local2.addEventListener(Event.OPEN, _onItemStarted, false, 0, true);
_local2.addEventListener(ProgressEvent.PROGRESS, _onProgress, false, 0, true);
_items.push(_local2);
_itemsTotal = (_itemsTotal + 1);
_totalWeight = (_totalWeight + _local2.weight);
sortItemsByPriority();
_isFinished = false;
loadNow(_local2);
return (true);
}
public function _onItemStarted(_arg1:Event):void{
var _local2:LoadingItem = (_arg1.target as LoadingItem);
log("Started loading", _local2, LOG_INFO);
dispatchEvent(_arg1);
}
public function add(_arg1, _arg2:Object=null):LoadingItem{
var _local4:String;
var _local6:String;
if (!_name){
throw (new Error("[BulkLoader] Cannot use an instance that has been cleared from memory (.clear())"));
};
if (((!(_arg1)) || (!(String(_arg1))))){
throw (new Error("[BulkLoader] Cannot add an item with a null url"));
};
_arg2 = ((_arg2) || ({}));
if ((_arg1 is String)){
_arg1 = new URLRequest(BulkLoader.substituteURLString(_arg1, _stringSubstitutions));
if (_arg2[HEADERS]){
_arg1.requestHeaders = _arg2[HEADERS];
};
} else {
if ((!(_arg1) is URLRequest)){
throw (new Error(("[BulkLoader] cannot add object with bad type for url:'" + _arg1.url)));
};
};
var _local3:LoadingItem = get(_arg2[ID]);
if (_local3){
log((("Add received an already added id: " + _arg2[ID]) + ", not adding a new item"));
return (_local3);
};
if (_arg2["type"]){
_local4 = _arg2["type"].toLowerCase();
if (AVAILABLE_TYPES.indexOf(_local4) == -1){
log("add received an unknown type:", _local4, "and will cast it to text", LOG_WARNINGS);
};
};
if (!_local4){
_local4 = guessType(_arg1.url);
};
_additionIndex++;
_local3 = new _typeClasses[_local4](_arg1, _local4, ((_instancesCreated + "_") + String(_additionIndex)));
if (((!(_arg2["id"])) && (_allowsAutoIDFromFileName))){
_arg2["id"] = getFileName(_arg1.url);
log("Adding automatic id from file name for item:", _local3, (("( id= " + _arg2["id"]) + " )"));
};
var _local5:Array = _local3._parseOptions(_arg2);
for each (_local6 in _local5) {
log(_local6, LOG_WARNINGS);
};
log("Added", _local3, LOG_VERBOSE);
_local3._addedTime = getTimer();
_local3._additionIndex = _additionIndex;
_local3.addEventListener(Event.COMPLETE, _onItemComplete, false, int.MIN_VALUE, true);
_local3.addEventListener(Event.COMPLETE, _incrementItemsLoaded, false, int.MAX_VALUE, true);
_local3.addEventListener(ERROR, _onItemError, false, 0, true);
_local3.addEventListener(Event.OPEN, _onItemStarted, false, 0, true);
_local3.addEventListener(ProgressEvent.PROGRESS, _onProgress, false, 0, true);
_items.push(_local3);
_itemsTotal = (_itemsTotal + 1);
_totalWeight = (_totalWeight + _local3.weight);
sortItemsByPriority();
_isFinished = false;
if (!_isPaused){
_loadNext();
};
return (_local3);
}
public function getText(_arg1, _arg2:Boolean=false):String{
return (String(_getContentAsType(_arg1, String, _arg2)));
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function get weightPercent():Number{
return (_weightPercent);
}
public function get bytesTotalCurrent():int{
return (_bytesTotalCurrent);
}
public function getAVM1Movie(_arg1:String, _arg2:Boolean=false):AVM1Movie{
return (AVM1Movie(_getContentAsType(_arg1, AVM1Movie, _arg2)));
}
public function get bytesTotal():int{
return (_bytesTotal);
}
public function getSprite(_arg1:String, _arg2:Boolean=false):Sprite{
return (Sprite(_getContentAsType(_arg1, Sprite, _arg2)));
}
public function get isFinished():Boolean{
return (_isFinished);
}
public function _getNextItemToLoad():LoadingItem{
var checkItem:LoadingItem;
_getAllConnections().forEach(function (_arg1:LoadingItem, ... _args):void{
if ((((_arg1.status == LoadingItem.STATUS_ERROR)) && ((_arg1.numTries == _arg1.maxTries)))){
_removeFromConnections(_arg1);
};
});
for each (checkItem in _items) {
if (((((!(checkItem._isLoading)) && (!((checkItem.status == LoadingItem.STATUS_STOPPED))))) && (_canOpenConnectioForItem(checkItem)))){
return (checkItem);
};
};
return (null);
}
public function changeItemPriority(_arg1:String, _arg2:int):Boolean{
var _local3:LoadingItem = get(_arg1);
if (!_local3){
return (false);
};
_local3._priority = _arg2;
sortItemsByPriority();
return (true);
}
public function get items():Array{
return (_items.slice());
}
public function getNetStream(_arg1:String, _arg2:Boolean=false):NetStream{
return (NetStream(_getContentAsType(_arg1, NetStream, _arg2)));
}
public function getHttpStatus(_arg1):int{
var _local2:LoadingItem = get(_arg1);
if (_local2){
return (_local2.httpStatus);
};
return (-1);
}
public function set itemsLoaded(_arg1:int):void{
_itemsLoaded = _arg1;
}
public function _onProgress(_arg1:Event=null):void{
var _local2:BulkProgressEvent = getProgressForItems(_items);
_bytesLoaded = _local2.bytesLoaded;
_bytesTotal = _local2.bytesTotal;
_weightPercent = _local2.weightPercent;
_percentLoaded = _local2.percentLoaded;
_bytesTotalCurrent = _local2.bytesTotalCurrent;
_loadedRatio = _local2.ratioLoaded;
dispatchEvent(_local2);
}
public function hasItem(_arg1, _arg2:Boolean=true):Boolean{
var _local3:*;
var _local4:BulkLoader;
if (_arg2){
_local3 = _allLoaders;
} else {
_local3 = [this];
};
for each (_local4 in _local3) {
if (_hasItemInBulkLoader(_arg1, _local4)){
return (true);
};
};
return (false);
}
public function _removeFromItems(_arg1:LoadingItem):Boolean{
var _local2:int = _items.indexOf(_arg1);
if (_local2 > -1){
_items.splice(_local2, 1);
} else {
return (false);
};
if (_arg1._isLoaded){
_itemsLoaded--;
};
_itemsTotal--;
_totalWeight = (_totalWeight - _arg1.weight);
log(("Removing " + _arg1), LOG_VERBOSE);
_arg1.removeEventListener(Event.COMPLETE, _onItemComplete, false);
_arg1.removeEventListener(Event.COMPLETE, _incrementItemsLoaded, false);
_arg1.removeEventListener(ERROR, _onItemError, false);
_arg1.removeEventListener(Event.OPEN, _onItemStarted, false);
_arg1.removeEventListener(ProgressEvent.PROGRESS, _onProgress, false);
return (true);
}
public function _incrementItemsLoaded(_arg1:Event):void{
_itemsLoaded++;
}
public function _getNumConnectionsForHostname(_arg1:String):int{
var _local2:Array = _getConnectionsForHostName(_arg1);
if (!_local2){
return (0);
};
return (_local2.length);
}
public function _onItemError(_arg1:ErrorEvent):void{
var _local2:LoadingItem = (_arg1.target as LoadingItem);
_removeFromConnections(_local2);
log(((("After " + _local2.numTries) + " I am giving up on ") + _local2.url.url), LOG_ERRORS);
log("Error loading", _local2, _arg1.text, LOG_ERRORS);
_loadNext();
dispatchEvent(_arg1);
}
public function pauseAll():void{
var _local1:LoadingItem;
for each (_local1 in _items) {
pause(_local1);
};
_isRunning = false;
_isPaused = true;
log("Stopping all items", LOG_INFO);
}
public function _isAllDoneP():Boolean{
return (_items.every(function (_arg1:LoadingItem, ... _args):Boolean{
return (_arg1._isLoaded);
}));
}
public function getNotLoadedItems():Array{
return (_items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return (!((_arg1.status == LoadingItem.STATUS_FINISHED)));
}));
}
public function getXML(_arg1, _arg2:Boolean=false):XML{
return (XML(_getContentAsType(_arg1, XML, _arg2)));
}
public function get totalWeight():int{
return (_totalWeight);
}
public function get itemsLoaded():int{
return (_itemsLoaded);
}
public function _canOpenConnectioForItem(_arg1:LoadingItem):Boolean{
if (_getNumConnections() >= numConnections){
return (false);
};
if (_getNumConnectionsForItem(_arg1) >= maxConnectionsPerHost){
return (false);
};
return (true);
}
public function getMovieClip(_arg1:String, _arg2:Boolean=false):MovieClip{
return (MovieClip(_getContentAsType(_arg1, MovieClip, _arg2)));
}
public function getDisplayObjectLoader(_arg1:String, _arg2:Boolean=false):Loader{
return (Loader(_getContentAsType(_arg1, Loader, _arg2)));
}
public function get numConnections():int{
return (_numConnections);
}
public function getStats():String{
var stats:Array = [];
stats.push("\n************************************");
stats.push((("All items loaded(" + itemsTotal) + ")"));
stats.push(("Total time(s): " + totalTime));
stats.push(("Average latency(s): " + truncateNumber(avgLatency)));
stats.push(("Average speed(kb/s): " + truncateNumber(speedAvg)));
stats.push(("Median speed(kb/s): " + truncateNumber(_speedTotal)));
stats.push(("KiloBytes total: " + truncateNumber((bytesTotal / 0x0400))));
var itemsInfo:Array = _items.map(function (_arg1:LoadingItem, ... _args):String{
return (("\t" + _arg1.getStats()));
});
stats.push(itemsInfo.join("\n"));
stats.push("************************************");
var statsString:String = stats.join("\n");
log(statsString, LOG_VERBOSE);
return (statsString);
}
public function pause(_arg1, _arg2:Boolean=false):Boolean{
var _local3:LoadingItem = get(_arg1);
if (!_local3){
return (false);
};
if (_local3.status != LoadingItem.STATUS_FINISHED){
_local3.stop();
};
log("STOPPED ITEM:", _local3, LOG_INFO);
var _local4:Boolean = _removeFromConnections(_local3);
if (_arg2){
_loadNext();
};
return (_local4);
}
public function getBinary(_arg1, _arg2:Boolean=false):ByteArray{
return (ByteArray(_getContentAsType(_arg1, ByteArray, _arg2)));
}
public static function getLoader(_arg1:String):BulkLoader{
return ((BulkLoader._allLoaders[_arg1] as BulkLoader));
}
public static function whichLoaderHasItem(_arg1):BulkLoader{
var _local2:BulkLoader;
for each (_local2 in _allLoaders) {
if (BulkLoader._hasItemInBulkLoader(_arg1, _local2)){
return (_local2);
};
};
return (null);
}
public static function truncateNumber(_arg1:Number, _arg2:int=2):Number{
var _local3:int = Math.pow(10, _arg2);
return ((Math.round((_arg1 * _local3)) / _local3));
}
public static function __debug_printStackTrace():void{
try {
throw (new Error("stack trace"));
} catch(e:Error) {
trace(e.getStackTrace());
};
}
public static function __debug_print_loaders():void{
var instNames:String;
var theNames:Array = [];
for each (instNames in BulkLoader._allLoaders) {
theNames.push(instNames);
};
theNames.sort();
trace("All loaders");
theNames.forEach(function (_arg1, ... _args):void{
trace("\t", _arg1);
});
trace("===========");
}
public static function pauseAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in _allLoaders) {
_local1.pauseAll();
};
}
public static function _hasItemInBulkLoader(_arg1, _arg2:BulkLoader):Boolean{
var _local3:LoadingItem = _arg2.get(_arg1);
if (_local3){
return (true);
};
return (false);
}
public static function createUniqueNamedLoader(_arg1:int=12, _arg2:int=4):BulkLoader{
return (new BulkLoader(BulkLoader.getUniqueName(), _arg1, _arg2));
}
public static function removeAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in _allLoaders) {
_local1.removeAll();
_local1.clear();
_local1 = null;
};
_allLoaders = {};
}
public static function getFileName(_arg1:String):String{
if (_arg1.lastIndexOf("/") == (_arg1.length - 1)){
return (getFileName(_arg1.substring(0, (_arg1.length - 1))));
};
var _local2:int = (_arg1.lastIndexOf("/") + 1);
var _local3:String = _arg1.substring(_local2);
var _local4:int = _local3.indexOf(".");
if (_local4 == -1){
if (_local3.indexOf("?") > -1){
_local4 = _local3.indexOf("?");
} else {
_local4 = _local3.length;
};
};
var _local5:String = _local3.substring(0, _local4);
return (_local5);
}
public static function __debug_print_num_loaders():void{
var _local2:String;
var _local1:int;
for each (_local2 in BulkLoader._allLoaders) {
_local1++;
};
trace("BulkLoader has ", _local1, "instances");
}
public static function guessType(_arg1:String):String{
var _local5:String;
var _local6:String;
var _local7:String;
var _local2:String = ((_arg1.indexOf("?") > -1)) ? _arg1.substring(0, _arg1.indexOf("?")) : _arg1;
var _local3:String = _local2.substring(_local2.lastIndexOf("/"));
var _local4:String = _local3.substring((_local3.lastIndexOf(".") + 1)).toLowerCase();
if (!Boolean(_local4)){
_local4 = BulkLoader.TYPE_TEXT;
};
if ((((_local4 == BulkLoader.TYPE_IMAGE)) || ((BulkLoader.IMAGE_EXTENSIONS.indexOf(_local4) > -1)))){
_local5 = BulkLoader.TYPE_IMAGE;
} else {
if ((((_local4 == BulkLoader.TYPE_SOUND)) || ((BulkLoader.SOUND_EXTENSIONS.indexOf(_local4) > -1)))){
_local5 = BulkLoader.TYPE_SOUND;
} else {
if ((((_local4 == BulkLoader.TYPE_VIDEO)) || ((BulkLoader.VIDEO_EXTENSIONS.indexOf(_local4) > -1)))){
_local5 = BulkLoader.TYPE_VIDEO;
} else {
if ((((_local4 == BulkLoader.TYPE_XML)) || ((BulkLoader.XML_EXTENSIONS.indexOf(_local4) > -1)))){
_local5 = BulkLoader.TYPE_XML;
} else {
if ((((_local4 == BulkLoader.TYPE_MOVIECLIP)) || ((BulkLoader.MOVIECLIP_EXTENSIONS.indexOf(_local4) > -1)))){
_local5 = BulkLoader.TYPE_MOVIECLIP;
} else {
for (_local6 in _customTypesExtensions) {
for each (_local7 in _customTypesExtensions[_local6]) {
if (_local7 == _local4){
_local5 = _local6;
break;
};
if (_local5){
break;
};
};
};
if (!_local5){
_local5 = BulkLoader.TYPE_TEXT;
};
};
};
};
};
};
return (_local5);
}
public static function registerNewType(_arg1:String, _arg2:String, _arg3:Class=null):Boolean{
var _local4:Array;
if (_arg1.charAt(0) == "."){
_arg1 = _arg1.substring(1);
};
if (!_customTypesExtensions){
_customTypesExtensions = {};
};
if (AVAILABLE_TYPES.indexOf(_arg2) == -1){
if (!Boolean(_arg3)){
throw (new Error("[BulkLoader]: When adding a new type and extension, you must determine which class to use"));
};
_typeClasses[_arg2] = _arg3;
if (!_customTypesExtensions[_arg2]){
_customTypesExtensions[_arg2] = [];
AVAILABLE_TYPES.push(_arg2);
};
_customTypesExtensions[_arg2].push(_arg1);
return (true);
} else {
if (_customTypesExtensions[_arg2]){
_customTypesExtensions[_arg2].push(_arg1);
};
};
var _local5:Object = {};
_local5[TYPE_IMAGE] = IMAGE_EXTENSIONS;
_local5[TYPE_MOVIECLIP] = MOVIECLIP_EXTENSIONS;
_local5[TYPE_VIDEO] = VIDEO_EXTENSIONS;
_local5[TYPE_SOUND] = SOUND_EXTENSIONS;
_local5[TYPE_TEXT] = TEXT_EXTENSIONS;
_local5[TYPE_XML] = XML_EXTENSIONS;
_local4 = _local5[_arg2];
if (((_local4) && ((_local4.indexOf(_arg1) == -1)))){
_local4.push(_arg1);
return (true);
};
return (false);
}
public static function substituteURLString(_arg1:String, _arg2:Object):String{
var _local9:Object;
var _local10:Object;
var _local12:String;
if (!_arg2){
return (_arg1);
};
var _local3:RegExp = /(?P<var_name>\{\s*[^\}]*\})/g;
var _local4:Object = _local3.exec(_arg1);
var _local5:String = (_local4) ? _local4.var_name : null;
var _local6:Array = [];
var _local7:int;
while (((Boolean(_local4)) && (Boolean(_local4.var_name)))) {
if (_local4.var_name){
_local5 = _local4.var_name;
_local5 = _local5.replace("{", "");
_local5 = _local5.replace("}", "");
_local5 = _local5.replace(/\s*/g, "");
};
_local6.push({start:_local4.index, end:(_local4.index + _local4.var_name.length), changeTo:_arg2[_local5]});
_local7++;
if (_local7 > 400){
break;
};
_local4 = _local3.exec(_arg1);
_local5 = (_local4) ? _local4.var_name : null;
};
if (_local6.length == 0){
return (_arg1);
};
var _local8:Array = [];
var _local11:String = _arg1.substr(0, _local6[0].start);
for each (_local10 in _local6) {
if (_local9){
_local11 = _arg1.substring(_local9.end, _local10.start);
};
_local8.push(_local11);
_local8.push(_local10.changeTo);
_local9 = _local10;
};
_local8.push(_arg1.substring(_local10.end));
return (_local8.join(""));
}
public static function getUniqueName():String{
return (("BulkLoader-" + _instancesCreated));
}
}
}//package br.com.stimuli.loading
Section 84
//BulkProgressEvent (br.com.stimuli.loading.BulkProgressEvent)
package br.com.stimuli.loading {
import flash.events.*;
public class BulkProgressEvent extends ProgressEvent {
public var bytesTotalCurrent:int;
public var itemsTotal:int;
public var itemsLoaded:int;
public var _percentLoaded:Number;
public var _weightPercent:Number;
public var _ratioLoaded:Number;
public var name:String;
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public function BulkProgressEvent(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
this.name = _arg1;
}
override public function clone():Event{
var _local1:BulkProgressEvent = new BulkProgressEvent(name, bubbles, cancelable);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, itemsLoaded, itemsTotal, weightPercent);
return (_local1);
}
public function get weightPercent():Number{
return (_weightPercent);
}
public function set ratioLoaded(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_ratioLoaded = _arg1;
}
public function setInfo(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Number):void{
this.bytesLoaded = _arg1;
this.bytesTotal = _arg2;
this.bytesTotalCurrent = _arg3;
this.itemsLoaded = _arg4;
this.itemsTotal = _arg5;
this.weightPercent = _arg6;
this.percentLoaded = ((_arg2 > 0)) ? (_arg1 / _arg2) : 0;
ratioLoaded = ((_arg5 == 0)) ? 0 : (_arg4 / _arg5);
}
public function set percentLoaded(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_percentLoaded = _arg1;
}
public function loadingStatus():String{
var _local1:Array = [];
_local1.push(("bytesLoaded: " + bytesLoaded));
_local1.push(("bytesTotal: " + bytesTotal));
_local1.push(("itemsLoaded: " + itemsLoaded));
_local1.push(("itemsTotal: " + itemsTotal));
_local1.push(("bytesTotalCurrent: " + bytesTotalCurrent));
_local1.push(("percentLoaded: " + BulkLoader.truncateNumber(percentLoaded)));
_local1.push(("weightPercent: " + BulkLoader.truncateNumber(weightPercent)));
_local1.push(("ratioLoaded: " + BulkLoader.truncateNumber(ratioLoaded)));
return ((("BulkProgressEvent " + _local1.join(", ")) + ";"));
}
public function get ratioLoaded():Number{
return (_ratioLoaded);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function set weightPercent(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_weightPercent = _arg1;
}
override public function toString():String{
return (super.toString());
}
}
}//package br.com.stimuli.loading
Section 85
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
public static function hashBinary(_arg1:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
}
}//package com.adobe.crypto
Section 86
//BitString (com.adobe.images.BitString)
package com.adobe.images {
public class BitString {
public var val:int;// = 0
public var len:int;// = 0
}
}//package com.adobe.images
Section 87
//JPGEncoder (com.adobe.images.JPGEncoder)
package com.adobe.images {
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class JPGEncoder {
private var fdtbl_UV:Array;
private var std_ac_chrominance_values:Array;
private var std_dc_chrominance_values:Array;
private var ZigZag:Array;
private var YDC_HT:Array;
private var YAC_HT:Array;
private var bytenew:int;// = 0
private var fdtbl_Y:Array;
private var std_ac_chrominance_nrcodes:Array;
private var DU:Array;
private var std_ac_luminance_values:Array;
private var std_dc_chrominance_nrcodes:Array;
private var UVTable:Array;
private var YDU:Array;
private var UDU:Array;
private var byteout:ByteArray;
private var UVAC_HT:Array;
private var UVDC_HT:Array;
private var bytepos:int;// = 7
private var VDU:Array;
private var std_ac_luminance_nrcodes:Array;
private var std_dc_luminance_values:Array;
private var YTable:Array;
private var std_dc_luminance_nrcodes:Array;
private var bitcode:Array;
private var category:Array;
public function JPGEncoder(_arg1:Number=50){
ZigZag = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63];
YTable = new Array(64);
UVTable = new Array(64);
fdtbl_Y = new Array(64);
fdtbl_UV = new Array(64);
std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0];
std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125];
std_ac_luminance_values = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250];
std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0];
std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119];
std_ac_chrominance_values = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
bitcode = new Array(0xFFFF);
category = new Array(0xFFFF);
DU = new Array(64);
YDU = new Array(64);
UDU = new Array(64);
VDU = new Array(64);
super();
if (_arg1 <= 0){
_arg1 = 1;
};
if (_arg1 > 100){
_arg1 = 100;
};
var _local2:int;
if (_arg1 < 50){
_local2 = int((5000 / _arg1));
} else {
_local2 = int((200 - (_arg1 * 2)));
};
initHuffmanTbl();
initCategoryNumber();
initQuantTables(_local2);
}
private function initHuffmanTbl():void{
YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes, std_dc_luminance_values);
UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes, std_dc_chrominance_values);
YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes, std_ac_luminance_values);
UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes, std_ac_chrominance_values);
}
private function RGB2YUV(_arg1:BitmapData, _arg2:int, _arg3:int):void{
var _local6:int;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local4:int;
var _local5:int;
while (_local5 < 8) {
_local6 = 0;
while (_local6 < 8) {
_local7 = _arg1.getPixel32((_arg2 + _local6), (_arg3 + _local5));
_local8 = Number(((_local7 >> 16) & 0xFF));
_local9 = Number(((_local7 >> 8) & 0xFF));
_local10 = Number((_local7 & 0xFF));
YDU[_local4] = ((((0.299 * _local8) + (0.587 * _local9)) + (0.114 * _local10)) - 128);
UDU[_local4] = (((-0.16874 * _local8) + (-0.33126 * _local9)) + (0.5 * _local10));
VDU[_local4] = (((0.5 * _local8) + (-0.41869 * _local9)) + (-0.08131 * _local10));
_local4++;
_local6++;
};
_local5++;
};
}
private function writeBits(_arg1:BitString):void{
var _local2:int = _arg1.val;
var _local3:int = (_arg1.len - 1);
while (_local3 >= 0) {
if ((_local2 & uint((1 << _local3)))){
bytenew = (bytenew | uint((1 << bytepos)));
};
_local3--;
bytepos--;
if (bytepos < 0){
if (bytenew == 0xFF){
writeByte(0xFF);
writeByte(0);
} else {
writeByte(bytenew);
};
bytepos = 7;
bytenew = 0;
};
};
}
private function writeWord(_arg1:int):void{
writeByte(((_arg1 >> 8) & 0xFF));
writeByte((_arg1 & 0xFF));
}
private function writeByte(_arg1:int):void{
byteout.writeByte(_arg1);
}
private function writeDHT():void{
var _local1:int;
writeWord(65476);
writeWord(418);
writeByte(0);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_luminance_values[_local1]);
_local1++;
};
writeByte(16);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_luminance_values[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_chrominance_values[_local1]);
_local1++;
};
writeByte(17);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_chrominance_values[_local1]);
_local1++;
};
}
public function encode(_arg1:BitmapData):ByteArray{
var _local6:int;
var _local7:BitString;
byteout = new ByteArray();
bytenew = 0;
bytepos = 7;
writeWord(65496);
writeAPP0();
writeDQT();
writeSOF0(_arg1.width, _arg1.height);
writeDHT();
writeSOS();
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
bytenew = 0;
bytepos = 7;
var _local5:int;
while (_local5 < _arg1.height) {
_local6 = 0;
while (_local6 < _arg1.width) {
RGB2YUV(_arg1, _local6, _local5);
_local2 = processDU(YDU, fdtbl_Y, _local2, YDC_HT, YAC_HT);
_local3 = processDU(UDU, fdtbl_UV, _local3, UVDC_HT, UVAC_HT);
_local4 = processDU(VDU, fdtbl_UV, _local4, UVDC_HT, UVAC_HT);
_local6 = (_local6 + 8);
};
_local5 = (_local5 + 8);
};
if (bytepos >= 0){
_local7 = new BitString();
_local7.len = (bytepos + 1);
_local7.val = ((1 << (bytepos + 1)) - 1);
writeBits(_local7);
};
writeWord(65497);
return (byteout);
}
private function initCategoryNumber():void{
var _local3:int;
var _local1 = 1;
var _local2 = 2;
var _local4 = 1;
while (_local4 <= 15) {
_local3 = _local1;
while (_local3 < _local2) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = _local3;
_local3++;
};
_local3 = -((_local2 - 1));
while (_local3 <= -(_local1)) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = ((_local2 - 1) + _local3);
_local3++;
};
_local1 = (_local1 << 1);
_local2 = (_local2 << 1);
_local4++;
};
}
private function writeDQT():void{
var _local1:int;
writeWord(65499);
writeWord(132);
writeByte(0);
_local1 = 0;
while (_local1 < 64) {
writeByte(YTable[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 64) {
writeByte(UVTable[_local1]);
_local1++;
};
}
private function writeAPP0():void{
writeWord(65504);
writeWord(16);
writeByte(74);
writeByte(70);
writeByte(73);
writeByte(70);
writeByte(0);
writeByte(1);
writeByte(1);
writeByte(0);
writeWord(1);
writeWord(1);
writeByte(0);
writeByte(0);
}
private function writeSOS():void{
writeWord(65498);
writeWord(12);
writeByte(3);
writeByte(1);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(3);
writeByte(17);
writeByte(0);
writeByte(63);
writeByte(0);
}
private function processDU(_arg1:Array, _arg2:Array, _arg3:Number, _arg4:Array, _arg5:Array):Number{
var _local8:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local6:BitString = _arg5[0];
var _local7:BitString = _arg5[240];
var _local9:Array = fDCTQuant(_arg1, _arg2);
_local8 = 0;
while (_local8 < 64) {
DU[ZigZag[_local8]] = _local9[_local8];
_local8++;
};
var _local10:int = (DU[0] - _arg3);
_arg3 = DU[0];
if (_local10 == 0){
writeBits(_arg4[0]);
} else {
writeBits(_arg4[category[(32767 + _local10)]]);
writeBits(bitcode[(32767 + _local10)]);
};
var _local11 = 63;
while ((((_local11 > 0)) && ((DU[_local11] == 0)))) {
_local11--;
};
if (_local11 == 0){
writeBits(_local6);
return (_arg3);
};
_local8 = 1;
while (_local8 <= _local11) {
_local12 = _local8;
while ((((DU[_local8] == 0)) && ((_local8 <= _local11)))) {
_local8++;
};
_local13 = (_local8 - _local12);
if (_local13 >= 16){
_local14 = 1;
while (_local14 <= (_local13 / 16)) {
writeBits(_local7);
_local14++;
};
_local13 = int((_local13 & 15));
};
writeBits(_arg5[((_local13 * 16) + category[(32767 + DU[_local8])])]);
writeBits(bitcode[(32767 + DU[_local8])]);
_local8++;
};
if (_local11 != 63){
writeBits(_local6);
};
return (_arg3);
}
private function initQuantTables(_arg1:int):void{
var _local2:int;
var _local3:Number;
var _local8:int;
var _local4:Array = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local4[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
YTable[ZigZag[_local2]] = _local3;
_local2++;
};
var _local5:Array = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local5[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
UVTable[ZigZag[_local2]] = _local3;
_local2++;
};
var _local6:Array = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379];
_local2 = 0;
var _local7:int;
while (_local7 < 8) {
_local8 = 0;
while (_local8 < 8) {
fdtbl_Y[_local2] = (1 / (((YTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
fdtbl_UV[_local2] = (1 / (((UVTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
_local2++;
_local8++;
};
_local7++;
};
}
private function writeSOF0(_arg1:int, _arg2:int):void{
writeWord(65472);
writeWord(17);
writeByte(8);
writeWord(_arg2);
writeWord(_arg1);
writeByte(3);
writeByte(1);
writeByte(17);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(1);
writeByte(3);
writeByte(17);
writeByte(1);
}
private function computeHuffmanTbl(_arg1:Array, _arg2:Array):Array{
var _local7:int;
var _local3:int;
var _local4:int;
var _local5:Array = new Array();
var _local6 = 1;
while (_local6 <= 16) {
_local7 = 1;
while (_local7 <= _arg1[_local6]) {
_local5[_arg2[_local4]] = new BitString();
_local5[_arg2[_local4]].val = _local3;
_local5[_arg2[_local4]].len = _local6;
_local4++;
_local3++;
_local7++;
};
_local3 = (_local3 * 2);
_local6++;
};
return (_local5);
}
private function fDCTQuant(_arg1:Array, _arg2:Array):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:int;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 7)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 7)]);
_local4 = (_arg1[(_local23 + 1)] + _arg1[(_local23 + 6)]);
_local9 = (_arg1[(_local23 + 1)] - _arg1[(_local23 + 6)]);
_local5 = (_arg1[(_local23 + 2)] + _arg1[(_local23 + 5)]);
_local8 = (_arg1[(_local23 + 2)] - _arg1[(_local23 + 5)]);
_local6 = (_arg1[(_local23 + 3)] + _arg1[(_local23 + 4)]);
_local7 = (_arg1[(_local23 + 3)] - _arg1[(_local23 + 4)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 4)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 2)] = (_local14 + _local15);
_arg1[(_local23 + 6)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 5)] = (_local21 + _local16);
_arg1[(_local23 + 3)] = (_local21 - _local16);
_arg1[(_local23 + 1)] = (_local20 + _local18);
_arg1[(_local23 + 7)] = (_local20 - _local18);
_local23 = (_local23 + 8);
_local22++;
};
_local23 = 0;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 56)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 56)]);
_local4 = (_arg1[(_local23 + 8)] + _arg1[(_local23 + 48)]);
_local9 = (_arg1[(_local23 + 8)] - _arg1[(_local23 + 48)]);
_local5 = (_arg1[(_local23 + 16)] + _arg1[(_local23 + 40)]);
_local8 = (_arg1[(_local23 + 16)] - _arg1[(_local23 + 40)]);
_local6 = (_arg1[(_local23 + 24)] + _arg1[(_local23 + 32)]);
_local7 = (_arg1[(_local23 + 24)] - _arg1[(_local23 + 32)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 32)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 16)] = (_local14 + _local15);
_arg1[(_local23 + 48)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 40)] = (_local21 + _local16);
_arg1[(_local23 + 24)] = (_local21 - _local16);
_arg1[(_local23 + 8)] = (_local20 + _local18);
_arg1[(_local23 + 56)] = (_local20 - _local18);
_local23++;
_local22++;
};
_local22 = 0;
while (_local22 < 64) {
_arg1[_local22] = Math.round((_arg1[_local22] * _arg2[_local22]));
_local22++;
};
return (_arg1);
}
}
}//package com.adobe.images
Section 88
//PNGEncoder (com.adobe.images.PNGEncoder)
package com.adobe.images {
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class PNGEncoder {
private static var crcTableComputed:Boolean = false;
private static var crcTable:Array;
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
var _local5:uint = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
var _local6:uint = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
public static function encode(_arg1:BitmapData):ByteArray{
var _local6:uint;
var _local7:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local5:int;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
}
}//package com.adobe.images
Section 89
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
}
}//package com.adobe.serialization.json
Section 90
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
tokenizer = new JSONTokenizer(_arg1);
nextToken();
value = parseValue();
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (token.type == JSONTokenType.STRING){
_local2 = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
_local1[_local2] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting } or , but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting : but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting string but found " + token.value));
};
};
return (null);
}
private function parseValue():Object{
if (token == null){
tokenizer.parseError("Unexpected end of input");
};
switch (token.type){
case JSONTokenType.LEFT_BRACE:
return (parseObject());
case JSONTokenType.LEFT_BRACKET:
return (parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (token.value);
default:
tokenizer.parseError(("Unexpected " + token.value));
};
return (null);
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
public function getValue(){
return (value);
}
private function parseArray():Array{
var _local1:Array = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 91
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
jsonString = convertToString(_arg1);
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
public function getString():String{
return (jsonString);
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(key) + ":") + convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(v.@name.toString()) + ":") + convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (objectToString(_arg1));
};
};
};
return ("null");
}
}
}//package com.adobe.serialization.json
Section 92
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
name = "JSONParseError";
_location = _arg2;
_text = _arg3;
}
public function get location():int{
return (_location);
}
public function get text():String{
return (_text);
}
}
}//package com.adobe.serialization.json
Section 93
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _value:Object;
private var _type:int;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
_type = _arg1;
_value = _arg2;
}
public function get value():Object{
return (_value);
}
public function get type():int{
return (_type);
}
public function set type(_arg1:int):void{
_type = _arg1;
}
public function set value(_arg1:Object):void{
_value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 94
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var loc:int;
private var ch:String;
private var obj:Object;
private var jsonString:String;
public function JSONTokenizer(_arg1:String){
jsonString = _arg1;
loc = 0;
nextChar();
}
private function skipComments():void{
if (ch == "/"){
nextChar();
switch (ch){
case "/":
do {
nextChar();
} while (((!((ch == "\n"))) && (!((ch == "")))));
nextChar();
break;
case "*":
nextChar();
while (true) {
if (ch == "*"){
nextChar();
if (ch == "/"){
nextChar();
break;
};
} else {
nextChar();
};
if (ch == ""){
parseError("Multi-line comment not closed");
};
};
break;
default:
parseError((("Unexpected " + ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local3 = (_local3 + ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + ch));
};
} else {
_local2 = (_local2 + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
_local1.value = _local2;
return (_local1);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
skipIgnored();
switch (ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
_local1 = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (_local1);
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, loc, jsonString));
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function skipIgnored():void{
skipWhite();
skipComments();
skipWhite();
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (ch == "-"){
_local2 = (_local2 + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
_local2 = (_local2 + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if (ch == "."){
_local2 = (_local2 + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
_local2 = (_local2 + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
_local2 = (_local2 + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
}
}//package com.adobe.serialization.json
Section 95
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const NUMBER:int = 11;
public static const FALSE:int = 8;
public static const RIGHT_BRACKET:int = 4;
public static const NULL:int = 9;
public static const TRUE:int = 7;
public static const RIGHT_BRACE:int = 2;
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACKET:int = 3;
public static const STRING:int = 10;
public static const LEFT_BRACE:int = 1;
public static const COLON:int = 6;
}
}//package com.adobe.serialization.json
Section 96
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.adobe.utils
Section 97
//b2Controller (com.boristhebrave.Box2D.Controllers.b2Controller)
package com.boristhebrave.Box2D.Controllers {
import Box2D.Dynamics.*;
public class b2Controller {
public var m_prev:b2Controller;
public var m_next:b2Controller;
public function GetPrev():b2Controller{
return (m_prev);
}
public function Step(_arg1:Number):void{
}
public function Draw(_arg1:b2DebugDraw):void{
}
public function GetNext():b2Controller{
return (m_next);
}
}
}//package com.boristhebrave.Box2D.Controllers
Section 98
//b2MultiController (com.boristhebrave.Box2D.Controllers.b2MultiController)
package com.boristhebrave.Box2D.Controllers {
import Box2D.Dynamics.*;
public class b2MultiController extends b2Controller {
public var m_bodies:Array;
public function b2MultiController(){
m_bodies = [];
super();
}
public function AddBodies(_arg1:Array):void{
var _local2:int;
while (_local2 < _arg1.length) {
AddBody(_arg1[_local2]);
_local2++;
};
}
public function AddBody(_arg1:b2Body):void{
m_bodies.push(_arg1);
}
public function WakeBodies():void{
var _local1:int;
while (_local1 < m_bodies.length) {
m_bodies[_local1].WakeUp();
_local1++;
};
}
public function RemoveBody(_arg1:b2Body):void{
var body = _arg1;
m_bodies = m_bodies.filter(function (_arg1){
return (!((_arg1 == body)));
});
}
public function GetBodies():Array{
return (m_bodies);
}
public static function FromBodies(_arg1:Array):b2MultiController{
var _local2:b2MultiController = new (b2MultiController);
var _local3:int;
while (_local3 < _arg1.length) {
_local2.AddBody(_arg1[_local3]);
_local3++;
};
return (_local2);
}
}
}//package com.boristhebrave.Box2D.Controllers
Section 99
//b2TensorDampingController (com.boristhebrave.Box2D.Controllers.b2TensorDampingController)
package com.boristhebrave.Box2D.Controllers {
import com.kerb.modnation.racer.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2TensorDampingController extends b2MultiController {
public var T:b2Mat22;
public var maxTimestep:Number;// = 0
public var Ts:Array;
public function b2TensorDampingController(){
T = new b2Mat22();
Ts = [];
super();
}
public function SetAxisAligned(_arg1:Number, _arg2:Number):void{
T.col1.x = -(_arg1);
T.col1.y = 0;
T.col2.x = 0;
T.col2.y = -(_arg2);
if ((((_arg1 > 0)) || ((_arg2 > 0)))){
maxTimestep = (1 / Math.max(_arg1, _arg2));
} else {
maxTimestep = 0;
};
}
override public function Step(_arg1:Number):void{
var _local3:b2Body;
var _local4:b2Vec2;
if (_arg1 <= Number.MIN_VALUE){
return;
};
if ((((_arg1 > maxTimestep)) && ((maxTimestep > 0)))){
_arg1 = maxTimestep;
};
var _local2:int;
while (_local2 < m_bodies.length) {
_local3 = m_bodies[_local2];
if (_local3.IsSleeping()){
} else {
SetAxisAligned(0, Game.CURR_WHEEL_CONTROLLER_DAMP);
_local4 = _local3.GetWorldVector(b2Math.b2MulMV(T, _local3.GetLocalVector(_local3.GetLinearVelocity())));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local4.x * _arg1));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local4.y * _arg1));
};
_local2++;
};
}
public static function FromBodies(_arg1:Array, _arg2:b2Mat22=null):b2TensorDampingController{
var _local3:b2TensorDampingController = new (b2TensorDampingController);
var _local4:int;
while (_local4 < _arg1.length) {
_local3.AddBody(_arg1[_local4]);
_local4++;
};
if (_arg2 != null){
_local3.T.SetM(_arg2);
};
return (_local3);
}
}
}//package com.boristhebrave.Box2D.Controllers
Section 100
//Gauss (com.degrafa.geometry.splines.math.Gauss)
package com.degrafa.geometry.splines.math {
import flash.events.*;
public class Gauss extends EventDispatcher {
private var _abscissa:Array;
private var _weight:Array;
public static const MAX_POINTS:Number = 8;
public function Gauss(){
_abscissa = new Array();
_weight = new Array();
_abscissa.push(-0.5773502692);
_abscissa.push(0.5773502692);
_weight.push(1);
_weight.push(1);
_abscissa.push(-0.7745966692);
_abscissa.push(0.7745966692);
_abscissa.push(0);
_weight.push(0.5555555556);
_weight.push(0.5555555556);
_weight.push(0.8888888888);
_abscissa.push(-0.8611363116);
_abscissa.push(0.8611363116);
_abscissa.push(-0.3399810436);
_abscissa.push(0.3399810436);
_weight.push(0.3478548451);
_weight.push(0.3478548451);
_weight.push(0.6521451549);
_weight.push(0.6521451549);
_abscissa.push(-0.9061798459);
_abscissa.push(0.9061798459);
_abscissa.push(-0.5384693101);
_abscissa.push(0.5384693101);
_abscissa.push(0);
_weight.push(0.2369268851);
_weight.push(0.2369268851);
_weight.push(0.4786286705);
_weight.push(0.4786286705);
_weight.push(0.5688888888);
_abscissa.push(-0.9324695142);
_abscissa.push(0.9324695142);
_abscissa.push(-0.6612093865);
_abscissa.push(0.6612093865);
_abscissa.push(-0.2386191861);
_abscissa.push(0.2386191861);
_weight.push(0.1713244924);
_weight.push(0.1713244924);
_weight.push(0.360761573);
_weight.push(0.360761573);
_weight.push(0.4679139346);
_weight.push(0.4679139346);
_abscissa.push(-0.9491079123);
_abscissa.push(0.9491079123);
_abscissa.push(-0.7415311856);
_abscissa.push(0.7415311856);
_abscissa.push(-0.4058451514);
_abscissa.push(0.4058451514);
_abscissa.push(0);
_weight.push(0.1294849662);
_weight.push(0.1294849662);
_weight.push(0.2797053915);
_weight.push(0.2797053915);
_weight.push(0.3818300505);
_weight.push(0.3818300505);
_weight.push(0.4179591837);
_abscissa.push(-0.9602898565);
_abscissa.push(0.9602898565);
_abscissa.push(-0.7966664774);
_abscissa.push(0.7966664774);
_abscissa.push(-0.5255324099);
_abscissa.push(0.5255324099);
_abscissa.push(-0.1834346425);
_abscissa.push(0.1834346425);
_weight.push(0.1012285363);
_weight.push(0.1012285363);
_weight.push(0.2223810345);
_weight.push(0.2223810345);
_weight.push(0.3137066459);
_weight.push(0.3137066459);
_weight.push(0.3626837834);
_weight.push(0.3626837834);
}
public function eval(_arg1:Function, _arg2:Number, _arg3:Number, _arg4:uint):Number{
var _local8:uint;
var _local9:Number;
var _local10:Number;
if (((isNaN(_arg2)) || (isNaN(_arg3)))){
return (0);
};
if (_arg2 >= _arg3){
return (0);
};
if (!(_arg1 is Function)){
return (0);
};
if (((isNaN(_arg4)) || ((_arg4 < 2)))){
return (0);
};
var _local5:uint = Math.max(_arg4, 2);
_local5 = Math.min(_local5, MAX_POINTS);
var _local6:uint = ((_local5)==2) ? 0 : (((_local5 * (_local5 - 1)) / 2) - 1);
var _local7:Number = 0;
if ((((_arg2 == -1)) && ((_arg3 == 1)))){
_local8 = 0;
while (_local8 < _local5) {
_local7 = (_local7 + (_arg1(_abscissa[(_local6 + _local8)]) * _weight[(_local6 + _local8)]));
_local8++;
};
return (_local7);
//unresolved jump
};
_local9 = (0.5 * (_arg3 - _arg2));
_local10 = (0.5 * (_arg2 + _arg3));
_local8 = 0;
while (_local8 < _local5) {
_local7 = (_local7 + (_arg1((_local10 + (_local9 * _abscissa[(_local6 + _local8)]))) * _weight[(_local6 + _local8)]));
_local8++;
};
return ((_local9 * _local7));
}
}
}//package com.degrafa.geometry.splines.math
Section 101
//CreateToken (com.facebook.commands.auth.CreateToken)
package com.facebook.commands.auth {
import com.facebook.net.*;
public class CreateToken extends FacebookCall {
public static const SCHEMA:Array = [];
public static const METHOD_NAME:String = "auth.createToken";
public function CreateToken(){
super(METHOD_NAME);
}
}
}//package com.facebook.commands.auth
Section 102
//ExpireSession (com.facebook.commands.auth.ExpireSession)
package com.facebook.commands.auth {
import com.facebook.net.*;
public class ExpireSession extends FacebookCall {
public static const SCHEMA:Array = [];
public static const METHOD_NAME:String = "auth.expireSession";
public function ExpireSession(){
super(METHOD_NAME);
}
}
}//package com.facebook.commands.auth
Section 103
//GetSession (com.facebook.commands.auth.GetSession)
package com.facebook.commands.auth {
import com.facebook.net.*;
import com.facebook.*;
public class GetSession extends FacebookCall {
public var auth_token:String;
public static const SCHEMA:Array = ["auth_token"];
public static const METHOD_NAME:String = "auth.getSession";
public function GetSession(_arg1:String){
super(METHOD_NAME);
this.auth_token = _arg1;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, auth_token);
super.initialize();
}
}
}//package com.facebook.commands.auth
Section 104
//GetCookiesData (com.facebook.commands.data.GetCookiesData)
package com.facebook.commands.data {
import com.facebook.data.*;
public class GetCookiesData extends FacebookData {
public var uid:String;
public var value:String;
public var expires:Number;
public var path:String;
public var name:String;
}
}//package com.facebook.commands.data
Section 105
//GetFriends (com.facebook.commands.friends.GetFriends)
package com.facebook.commands.friends {
import com.facebook.net.*;
import com.facebook.*;
public class GetFriends extends FacebookCall {
public var uid:String;
public var flid:String;
public static const SCHEMA:Array = ["flid", "uid"];
public static const METHOD_NAME:String = "friends.get";
public function GetFriends(_arg1:String=null, _arg2:String=null){
super(METHOD_NAME);
this.flid = _arg1;
this.uid = _arg2;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, flid, uid);
super.initialize();
}
}
}//package com.facebook.commands.friends
Section 106
//UploadPhoto (com.facebook.commands.photos.UploadPhoto)
package com.facebook.commands.photos {
import com.facebook.net.*;
import com.facebook.*;
import com.facebook.data.photos.*;
public class UploadPhoto extends FacebookCall implements IUploadPhoto {
public var aid:String;
protected var _data:Object;
public var uid:String;
public var caption:String;
public var uploadedPhoto:FacebookPhoto;
protected var _uploadType:String;
protected var _uploadQuality:uint;// = 80
public static const SCHEMA:Array = ["data", "aid", "caption", "uid"];
public static const METHOD_NAME:String = "photos.upload";
public function UploadPhoto(_arg1:Object, _arg2:String=null, _arg3:String=null, _arg4:String=null){
_uploadType = UploadPhotoTypes.PNG;
super(METHOD_NAME);
this.data = _arg1;
this.aid = _arg2;
this.caption = _arg3;
this.uid = _arg4;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, data, aid, caption, uid);
super.initialize();
}
public function get uploadType():String{
return (_uploadType);
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get data():Object{
return (_data);
}
public function set uploadType(_arg1:String):void{
_uploadType = _arg1;
}
public function set uploadQuality(_arg1:uint):void{
_uploadQuality = _arg1;
}
public function get uploadQuality():uint{
return (_uploadQuality);
}
}
}//package com.facebook.commands.photos
Section 107
//UploadPhotoTypes (com.facebook.commands.photos.UploadPhotoTypes)
package com.facebook.commands.photos {
public class UploadPhotoTypes {
public static const JPEG:String = "jpeg";
public static const PNG:String = "png";
}
}//package com.facebook.commands.photos
Section 108
//GetInfo (com.facebook.commands.users.GetInfo)
package com.facebook.commands.users {
import com.facebook.net.*;
import com.facebook.*;
import com.facebook.utils.*;
public class GetInfo extends FacebookCall {
public var fields:Array;
public var uids:Array;
public static const SCHEMA:Array = ["uids", "fields"];
public static const METHOD_NAME:String = "users.getInfo";
public function GetInfo(_arg1:Array, _arg2:Array){
super(METHOD_NAME);
this.uids = _arg1;
this.fields = _arg2;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, FacebookDataUtils.toArrayString(uids), FacebookDataUtils.toArrayString(fields));
super.initialize();
}
}
}//package com.facebook.commands.users
Section 109
//GetLoggedInUser (com.facebook.commands.users.GetLoggedInUser)
package com.facebook.commands.users {
import com.facebook.net.*;
public class GetLoggedInUser extends FacebookCall {
public static const SCHEMA:Array = [];
public static const METHOD_NAME:String = "users.getLoggedInUser";
public function GetLoggedInUser(){
super(METHOD_NAME);
}
}
}//package com.facebook.commands.users
Section 110
//HasAppPermission (com.facebook.commands.users.HasAppPermission)
package com.facebook.commands.users {
import com.facebook.net.*;
import com.facebook.*;
public class HasAppPermission extends FacebookCall {
public var uid:String;
public var ext_perm:String;
public static const SCHEMA:Array = ["ext_perm", "uid"];
public static const METHOD_NAME:String = "users.hasAppPermission";
public function HasAppPermission(_arg1:String, _arg2:String=null){
super(METHOD_NAME);
this.ext_perm = _arg1;
this.uid = _arg2;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, ext_perm, uid);
super.initialize();
}
}
}//package com.facebook.commands.users
Section 111
//UploadVideo (com.facebook.commands.video.UploadVideo)
package com.facebook.commands.video {
import com.facebook.net.*;
import com.facebook.*;
public class UploadVideo extends FacebookCall implements IUploadVideo {
protected var _title:String;
protected var _ext:String;
protected var _data:Object;
protected var _description:String;
public static const SCHEMA:Array = ["data", "title", "description"];
public static const METHOD_NAME:String = "video.upload";
public function UploadVideo(_arg1:String, _arg2:Object, _arg3:String=null, _arg4:String=null){
super(METHOD_NAME);
this.ext = _arg1;
this.data = _arg2;
this.title = _arg3;
this.description = _arg4;
}
public function get ext():String{
return (_ext);
}
public function set description(_arg1:String):void{
_description = _arg1;
}
public function get data():Object{
return (_data);
}
public function set title(_arg1:String):void{
_title = _arg1;
}
public function set ext(_arg1:String):void{
_ext = _arg1;
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, data, title, description);
super.initialize();
}
public function get title():String{
return (_title);
}
public function get description():String{
return (_description);
}
}
}//package com.facebook.commands.video
Section 112
//GetAllocationData (com.facebook.data.admin.GetAllocationData)
package com.facebook.data.admin {
import mx.events.*;
import com.facebook.data.*;
public class GetAllocationData extends FacebookData {
private var _376596805allocationLimit:Number;
public function get allocationLimit():Number{
return (this._376596805allocationLimit);
}
public function set allocationLimit(_arg1:Number):void{
var _local2:Object = this._376596805allocationLimit;
if (_local2 !== _arg1){
this._376596805allocationLimit = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "allocationLimit", _local2, _arg1));
};
}
}
}//package com.facebook.data.admin
Section 113
//GetAppPropertiesData (com.facebook.data.admin.GetAppPropertiesData)
package com.facebook.data.admin {
import mx.events.*;
import com.facebook.data.*;
public class GetAppPropertiesData extends FacebookData {
private var _554397236appProperties:Object;
public function set appProperties(_arg1:Object):void{
var _local2:Object = this._554397236appProperties;
if (_local2 !== _arg1){
this._554397236appProperties = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "appProperties", _local2, _arg1));
};
}
public function get appProperties():Object{
return (this._554397236appProperties);
}
}
}//package com.facebook.data.admin
Section 114
//GetMetricsData (com.facebook.data.admin.GetMetricsData)
package com.facebook.data.admin {
import mx.events.*;
import com.facebook.data.*;
public class GetMetricsData extends FacebookData {
private var _1648653249metricsCollection:MetricsDataCollection;
public function get metricsCollection():MetricsDataCollection{
return (this._1648653249metricsCollection);
}
public function set metricsCollection(_arg1:MetricsDataCollection):void{
var _local2:Object = this._1648653249metricsCollection;
if (_local2 !== _arg1){
this._1648653249metricsCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "metricsCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.admin
Section 115
//MetricsData (com.facebook.data.admin.MetricsData)
package com.facebook.data.admin {
import flash.events.*;
import mx.events.*;
public class MetricsData implements IEventDispatcher {
private var _1725551537end_time:Date;
private var _1769771919active_users:Number;
private var _bindingEventDispatcher:EventDispatcher;
private var _652996091canvas_page_views:Number;
public function MetricsData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get canvas_page_views():Number{
return (this._652996091canvas_page_views);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set end_time(_arg1:Date):void{
var _local2:Object = this._1725551537end_time;
if (_local2 !== _arg1){
this._1725551537end_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "end_time", _local2, _arg1));
};
}
public function set canvas_page_views(_arg1:Number):void{
var _local2:Object = this._652996091canvas_page_views;
if (_local2 !== _arg1){
this._652996091canvas_page_views = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "canvas_page_views", _local2, _arg1));
};
}
public function get active_users():Number{
return (this._1769771919active_users);
}
public function get end_time():Date{
return (this._1725551537end_time);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function set active_users(_arg1:Number):void{
var _local2:Object = this._1769771919active_users;
if (_local2 !== _arg1){
this._1769771919active_users = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "active_users", _local2, _arg1));
};
}
}
}//package com.facebook.data.admin
Section 116
//MetricsDataCollection (com.facebook.data.admin.MetricsDataCollection)
package com.facebook.data.admin {
import com.facebook.utils.*;
public class MetricsDataCollection extends FacebookArrayCollection {
public function MetricsDataCollection(){
super(null, MetricsData);
}
}
}//package com.facebook.data.admin
Section 117
//GetPublicInfoData (com.facebook.data.application.GetPublicInfoData)
package com.facebook.data.application {
import mx.events.*;
import com.facebook.data.*;
public class GetPublicInfoData extends FacebookData {
private var _737588055icon_url:String;
private var _1793855977developers:String;
private var _1615086568display_name:String;
private var _1872800494canvas_name:String;
private var _1724546052description:String;
private var _2027875547logo_url:String;
private var _171158145monthly_active_users:Number;
private var _1429880077company_name:String;
private var _650176883weekly_active_users:Number;
private var _800085318api_key:String;
private var _1411074055app_id:String;
private var _1957597173daily_active_users:Number;
public function set app_id(_arg1:String):void{
var _local2:Object = this._1411074055app_id;
if (_local2 !== _arg1){
this._1411074055app_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "app_id", _local2, _arg1));
};
}
public function set monthly_active_users(_arg1:Number):void{
var _local2:Object = this._171158145monthly_active_users;
if (_local2 !== _arg1){
this._171158145monthly_active_users = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "monthly_active_users", _local2, _arg1));
};
}
public function set api_key(_arg1:String):void{
var _local2:Object = this._800085318api_key;
if (_local2 !== _arg1){
this._800085318api_key = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "api_key", _local2, _arg1));
};
}
public function get monthly_active_users():Number{
return (this._171158145monthly_active_users);
}
public function get developers():String{
return (this._1793855977developers);
}
public function set display_name(_arg1:String):void{
var _local2:Object = this._1615086568display_name;
if (_local2 !== _arg1){
this._1615086568display_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "display_name", _local2, _arg1));
};
}
public function set company_name(_arg1:String):void{
var _local2:Object = this._1429880077company_name;
if (_local2 !== _arg1){
this._1429880077company_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "company_name", _local2, _arg1));
};
}
public function get company_name():String{
return (this._1429880077company_name);
}
public function set developers(_arg1:String):void{
var _local2:Object = this._1793855977developers;
if (_local2 !== _arg1){
this._1793855977developers = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "developers", _local2, _arg1));
};
}
public function get logo_url():String{
return (this._2027875547logo_url);
}
public function get weekly_active_users():Number{
return (this._650176883weekly_active_users);
}
public function get description():String{
return (this._1724546052description);
}
public function set weekly_active_users(_arg1:Number):void{
var _local2:Object = this._650176883weekly_active_users;
if (_local2 !== _arg1){
this._650176883weekly_active_users = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "weekly_active_users", _local2, _arg1));
};
}
public function get canvas_name():String{
return (this._1872800494canvas_name);
}
public function set canvas_name(_arg1:String):void{
var _local2:Object = this._1872800494canvas_name;
if (_local2 !== _arg1){
this._1872800494canvas_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "canvas_name", _local2, _arg1));
};
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get icon_url():String{
return (this._737588055icon_url);
}
public function set icon_url(_arg1:String):void{
var _local2:Object = this._737588055icon_url;
if (_local2 !== _arg1){
this._737588055icon_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "icon_url", _local2, _arg1));
};
}
public function get display_name():String{
return (this._1615086568display_name);
}
public function set daily_active_users(_arg1:Number):void{
var _local2:Object = this._1957597173daily_active_users;
if (_local2 !== _arg1){
this._1957597173daily_active_users = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "daily_active_users", _local2, _arg1));
};
}
public function get daily_active_users():Number{
return (this._1957597173daily_active_users);
}
public function get app_id():String{
return (this._1411074055app_id);
}
public function get api_key():String{
return (this._800085318api_key);
}
public function set logo_url(_arg1:String):void{
var _local2:Object = this._2027875547logo_url;
if (_local2 !== _arg1){
this._2027875547logo_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "logo_url", _local2, _arg1));
};
}
}
}//package com.facebook.data.application
Section 118
//GetSessionData (com.facebook.data.auth.GetSessionData)
package com.facebook.data.auth {
import mx.events.*;
import com.facebook.data.*;
public class GetSessionData extends FacebookData {
private var _1309235404expires:Date;
private var _22145738session_key:String;
private var _906277200secret:String;
private var _115792uid:String;
public function set uid(_arg1:String):void{
var _local2:Object = this._115792uid;
if (_local2 !== _arg1){
this._115792uid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid", _local2, _arg1));
};
}
public function set expires(_arg1:Date):void{
var _local2:Object = this._1309235404expires;
if (_local2 !== _arg1){
this._1309235404expires = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "expires", _local2, _arg1));
};
}
public function set secret(_arg1:String):void{
var _local2:Object = this._906277200secret;
if (_local2 !== _arg1){
this._906277200secret = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "secret", _local2, _arg1));
};
}
public function get expires():Date{
return (this._1309235404expires);
}
public function get uid():String{
return (this._115792uid);
}
public function set session_key(_arg1:String):void{
var _local2:Object = this._22145738session_key;
if (_local2 !== _arg1){
this._22145738session_key = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "session_key", _local2, _arg1));
};
}
public function get session_key():String{
return (this._22145738session_key);
}
public function get secret():String{
return (this._906277200secret);
}
}
}//package com.facebook.data.auth
Section 119
//BatchResult (com.facebook.data.batch.BatchResult)
package com.facebook.data.batch {
import mx.events.*;
import com.facebook.data.*;
public class BatchResult extends FacebookData {
private var _1097546742results:Array;
public function set results(_arg1:Array):void{
var _local2:Object = this._1097546742results;
if (_local2 !== _arg1){
this._1097546742results = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "results", _local2, _arg1));
};
}
public function get results():Array{
return (this._1097546742results);
}
}
}//package com.facebook.data.batch
Section 120
//GetObjectTypeData (com.facebook.data.data.GetObjectTypeData)
package com.facebook.data.data {
import mx.events.*;
import com.facebook.data.*;
public class GetObjectTypeData extends FacebookData {
private var _747164295index_type:Number;
private var _3373707name:String;
private var _363359569data_type:Number;
public function get index_type():Number{
return (this._747164295index_type);
}
public function get name():String{
return (this._3373707name);
}
public function get data_type():Number{
return (this._363359569data_type);
}
public function set index_type(_arg1:Number):void{
var _local2:Object = this._747164295index_type;
if (_local2 !== _arg1){
this._747164295index_type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "index_type", _local2, _arg1));
};
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set data_type(_arg1:Number):void{
var _local2:Object = this._363359569data_type;
if (_local2 !== _arg1){
this._363359569data_type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "data_type", _local2, _arg1));
};
}
}
}//package com.facebook.data.data
Section 121
//GetObjectTypesData (com.facebook.data.data.GetObjectTypesData)
package com.facebook.data.data {
import mx.events.*;
import com.facebook.data.*;
public class GetObjectTypesData extends FacebookData {
private var _1481977495objectTypeCollection:ObjectTypesCollection;
public function set objectTypeCollection(_arg1:ObjectTypesCollection):void{
var _local2:Object = this._1481977495objectTypeCollection;
if (_local2 !== _arg1){
this._1481977495objectTypeCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "objectTypeCollection", _local2, _arg1));
};
}
public function get objectTypeCollection():ObjectTypesCollection{
return (this._1481977495objectTypeCollection);
}
}
}//package com.facebook.data.data
Section 122
//GetUserPreferencesData (com.facebook.data.data.GetUserPreferencesData)
package com.facebook.data.data {
import mx.events.*;
import com.facebook.data.*;
public class GetUserPreferencesData extends FacebookData {
private var _1984973153perferenceCollection:PreferenceCollection;
public function set perferenceCollection(_arg1:PreferenceCollection):void{
var _local2:Object = this._1984973153perferenceCollection;
if (_local2 !== _arg1){
this._1984973153perferenceCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "perferenceCollection", _local2, _arg1));
};
}
public function get perferenceCollection():PreferenceCollection{
return (this._1984973153perferenceCollection);
}
}
}//package com.facebook.data.data
Section 123
//ObjectTypesCollection (com.facebook.data.data.ObjectTypesCollection)
package com.facebook.data.data {
import com.facebook.utils.*;
public class ObjectTypesCollection extends FacebookArrayCollection {
public function ObjectTypesCollection(){
super(null, ObjectTypesData);
}
}
}//package com.facebook.data.data
Section 124
//ObjectTypesData (com.facebook.data.data.ObjectTypesData)
package com.facebook.data.data {
import flash.events.*;
import mx.events.*;
public class ObjectTypesData implements IEventDispatcher {
private var _3373707name:String;
private var _953875336object_class:String;
private var _bindingEventDispatcher:EventDispatcher;
public function ObjectTypesData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set object_class(_arg1:String):void{
var _local2:Object = this._953875336object_class;
if (_local2 !== _arg1){
this._953875336object_class = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "object_class", _local2, _arg1));
};
}
public function get object_class():String{
return (this._953875336object_class);
}
}
}//package com.facebook.data.data
Section 125
//PreferenceCollection (com.facebook.data.data.PreferenceCollection)
package com.facebook.data.data {
import com.facebook.utils.*;
public class PreferenceCollection extends FacebookArrayCollection {
public function PreferenceCollection(){
super(null, PreferenceData);
}
}
}//package com.facebook.data.data
Section 126
//PreferenceData (com.facebook.data.data.PreferenceData)
package com.facebook.data.data {
import flash.events.*;
import mx.events.*;
public class PreferenceData implements IEventDispatcher {
private var _111972721value:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _318670665pref_id:Number;
public function PreferenceData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set value(_arg1:String):void{
var _local2:Object = this._111972721value;
if (_local2 !== _arg1){
this._111972721value = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "value", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set pref_id(_arg1:Number):void{
var _local2:Object = this._318670665pref_id;
if (_local2 !== _arg1){
this._318670665pref_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pref_id", _local2, _arg1));
};
}
public function get value():String{
return (this._111972721value);
}
public function get pref_id():Number{
return (this._318670665pref_id);
}
}
}//package com.facebook.data.data
Section 127
//EventCollection (com.facebook.data.events.EventCollection)
package com.facebook.data.events {
import com.facebook.utils.*;
public class EventCollection extends FacebookArrayCollection {
public function EventCollection(){
super(null, EventData);
}
}
}//package com.facebook.data.events
Section 128
//EventData (com.facebook.data.events.EventData)
package com.facebook.data.events {
import flash.events.*;
import mx.events.*;
import com.facebook.data.*;
public class EventData implements IEventDispatcher {
private var _984376767event_type:String;
private var _3373707name:String;
private var _1725551537end_time:Date;
private var _112093807venue:FacebookLocation;
private var _1028554796creator:Number;
private var _1573145462start_time:Date;
private var _109065nid:Number;
private var _1762076142pic_small:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _3208616host:String;
private var _110986pic:String;
private var _578385717pic_big:String;
private var _1901043637location:String;
private var _573446013update_time:Date;
private var _1724546052description:String;
private var _1482814251event_subtype:String;
private var _1548283250tagline:String;
private var _100416eid:String;
public function EventData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function set eid(_arg1:String):void{
var _local2:Object = this._100416eid;
if (_local2 !== _arg1){
this._100416eid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "eid", _local2, _arg1));
};
}
public function get update_time():Date{
return (this._573446013update_time);
}
public function set update_time(_arg1:Date):void{
var _local2:Object = this._573446013update_time;
if (_local2 !== _arg1){
this._573446013update_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "update_time", _local2, _arg1));
};
}
public function get nid():Number{
return (this._109065nid);
}
public function get pic():String{
return (this._110986pic);
}
public function get name():String{
return (this._3373707name);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get tagline():String{
return (this._1548283250tagline);
}
public function get start_time():Date{
return (this._1573145462start_time);
}
public function set nid(_arg1:Number):void{
var _local2:Object = this._109065nid;
if (_local2 !== _arg1){
this._109065nid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "nid", _local2, _arg1));
};
}
public function set pic(_arg1:String):void{
var _local2:Object = this._110986pic;
if (_local2 !== _arg1){
this._110986pic = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic", _local2, _arg1));
};
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function get pic_small():String{
return (this._1762076142pic_small);
}
public function set tagline(_arg1:String):void{
var _local2:Object = this._1548283250tagline;
if (_local2 !== _arg1){
this._1548283250tagline = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "tagline", _local2, _arg1));
};
}
public function set pic_small(_arg1:String):void{
var _local2:Object = this._1762076142pic_small;
if (_local2 !== _arg1){
this._1762076142pic_small = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_small", _local2, _arg1));
};
}
public function set pic_big(_arg1:String):void{
var _local2:Object = this._578385717pic_big;
if (_local2 !== _arg1){
this._578385717pic_big = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_big", _local2, _arg1));
};
}
public function set event_subtype(_arg1:String):void{
var _local2:Object = this._1482814251event_subtype;
if (_local2 !== _arg1){
this._1482814251event_subtype = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "event_subtype", _local2, _arg1));
};
}
public function get creator():Number{
return (this._1028554796creator);
}
public function get host():String{
return (this._3208616host);
}
public function get location():String{
return (this._1901043637location);
}
public function get event_type():String{
return (this._984376767event_type);
}
public function get eid():String{
return (this._100416eid);
}
public function set start_time(_arg1:Date):void{
var _local2:Object = this._1573145462start_time;
if (_local2 !== _arg1){
this._1573145462start_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "start_time", _local2, _arg1));
};
}
public function get end_time():Date{
return (this._1725551537end_time);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get pic_big():String{
return (this._578385717pic_big);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set host(_arg1:String):void{
var _local2:Object = this._3208616host;
if (_local2 !== _arg1){
this._3208616host = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "host", _local2, _arg1));
};
}
public function set creator(_arg1:Number):void{
var _local2:Object = this._1028554796creator;
if (_local2 !== _arg1){
this._1028554796creator = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "creator", _local2, _arg1));
};
}
public function get event_subtype():String{
return (this._1482814251event_subtype);
}
public function set venue(_arg1:FacebookLocation):void{
var _local2:Object = this._112093807venue;
if (_local2 !== _arg1){
this._112093807venue = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "venue", _local2, _arg1));
};
}
public function set end_time(_arg1:Date):void{
var _local2:Object = this._1725551537end_time;
if (_local2 !== _arg1){
this._1725551537end_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "end_time", _local2, _arg1));
};
}
public function get venue():FacebookLocation{
return (this._112093807venue);
}
public function set location(_arg1:String):void{
var _local2:Object = this._1901043637location;
if (_local2 !== _arg1){
this._1901043637location = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "location", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get description():String{
return (this._1724546052description);
}
public function set event_type(_arg1:String):void{
var _local2:Object = this._984376767event_type;
if (_local2 !== _arg1){
this._984376767event_type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "event_type", _local2, _arg1));
};
}
}
}//package com.facebook.data.events
Section 129
//GetEventsData (com.facebook.data.events.GetEventsData)
package com.facebook.data.events {
import mx.events.*;
import com.facebook.data.*;
public class GetEventsData extends FacebookData {
private var _2121991384eventCollection:EventCollection;
public function get eventCollection():EventCollection{
return (this._2121991384eventCollection);
}
public function set eventCollection(_arg1:EventCollection):void{
var _local2:Object = this._2121991384eventCollection;
if (_local2 !== _arg1){
this._2121991384eventCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "eventCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.events
Section 130
//GetMembersData (com.facebook.data.events.GetMembersData)
package com.facebook.data.events {
import mx.events.*;
import com.facebook.data.*;
public class GetMembersData extends FacebookData {
private var _354428152attending:Array;
private var _568196142declined:Array;
private var _840227282unsure:Array;
private var _487874675not_replied:Array;
public function set declined(_arg1:Array):void{
var _local2:Object = this._568196142declined;
if (_local2 !== _arg1){
this._568196142declined = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "declined", _local2, _arg1));
};
}
public function get attending():Array{
return (this._354428152attending);
}
public function set not_replied(_arg1:Array):void{
var _local2:Object = this._487874675not_replied;
if (_local2 !== _arg1){
this._487874675not_replied = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "not_replied", _local2, _arg1));
};
}
public function get not_replied():Array{
return (this._487874675not_replied);
}
public function get unsure():Array{
return (this._840227282unsure);
}
public function set attending(_arg1:Array):void{
var _local2:Object = this._354428152attending;
if (_local2 !== _arg1){
this._354428152attending = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "attending", _local2, _arg1));
};
}
public function set unsure(_arg1:Array):void{
var _local2:Object = this._840227282unsure;
if (_local2 !== _arg1){
this._840227282unsure = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "unsure", _local2, _arg1));
};
}
public function get declined():Array{
return (this._568196142declined);
}
}
}//package com.facebook.data.events
Section 131
//AbstractTagData (com.facebook.data.fbml.AbstractTagData)
package com.facebook.data.fbml {
import flash.events.*;
import mx.events.*;
public class AbstractTagData implements IEventDispatcher {
private var _513384674is_public:String;
private var _1183728077header_fbml:String;
private var _3373707name:String;
private var _3575610type:String;
private var _1098131327footer_fbml:String;
private var _405645655attributes:AttributeCollection;
private var _1724546052description:String;
private var _bindingEventDispatcher:EventDispatcher;
public function AbstractTagData(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String="", _arg6:String="", _arg7:AttributeCollection=null){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
this.name = _arg1;
this.type = _arg4;
this.description = _arg5;
this.is_public = _arg6;
this.header_fbml = _arg2;
this.footer_fbml = _arg3;
this.attributes = _arg7;
}
public function set is_public(_arg1:String):void{
var _local2:Object = this._513384674is_public;
if (_local2 !== _arg1){
this._513384674is_public = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "is_public", _local2, _arg1));
};
}
public function set footer_fbml(_arg1:String):void{
var _local2:Object = this._1098131327footer_fbml;
if (_local2 !== _arg1){
this._1098131327footer_fbml = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "footer_fbml", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get header_fbml():String{
return (this._1183728077header_fbml);
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function get attributes():AttributeCollection{
return (this._405645655attributes);
}
public function set header_fbml(_arg1:String):void{
var _local2:Object = this._1183728077header_fbml;
if (_local2 !== _arg1){
this._1183728077header_fbml = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "header_fbml", _local2, _arg1));
};
}
public function get is_public():String{
return (this._513384674is_public);
}
public function set attributes(_arg1:AttributeCollection):void{
var _local2:Object = this._405645655attributes;
if (_local2 !== _arg1){
this._405645655attributes = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "attributes", _local2, _arg1));
};
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get type():String{
return (this._3575610type);
}
public function get description():String{
return (this._1724546052description);
}
public function get footer_fbml():String{
return (this._1098131327footer_fbml);
}
}
}//package com.facebook.data.fbml
Section 132
//AttributeCollection (com.facebook.data.fbml.AttributeCollection)
package com.facebook.data.fbml {
import com.facebook.utils.*;
public class AttributeCollection extends FacebookArrayCollection {
public function AttributeCollection(){
super(null, AttributeData);
}
}
}//package com.facebook.data.fbml
Section 133
//AttributeData (com.facebook.data.fbml.AttributeData)
package com.facebook.data.fbml {
import flash.events.*;
import mx.events.*;
public class AttributeData implements IEventDispatcher {
private var _1318671859default_value:String;
private var _3373707name:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _1724546052description:String;
public function AttributeData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set default_value(_arg1:String):void{
var _local2:Object = this._1318671859default_value;
if (_local2 !== _arg1){
this._1318671859default_value = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "default_value", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get default_value():String{
return (this._1318671859default_value);
}
public function get description():String{
return (this._1724546052description);
}
}
}//package com.facebook.data.fbml
Section 134
//ContainerTagData (com.facebook.data.fbml.ContainerTagData)
package com.facebook.data.fbml {
import mx.events.*;
public class ContainerTagData extends AbstractTagData {
private var _1772097351close_tag_fbml:String;
private var _1445528373open_tag_fbml:String;
public function ContainerTagData(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String="", _arg8:String="", _arg9:AttributeCollection=null){
this.open_tag_fbml = _arg5;
this.close_tag_fbml = _arg6;
super(_arg1, _arg2, _arg3, _arg4, _arg7, _arg8, _arg9);
}
public function get open_tag_fbml():String{
return (this._1445528373open_tag_fbml);
}
public function get close_tag_fbml():String{
return (this._1772097351close_tag_fbml);
}
public function set open_tag_fbml(_arg1:String):void{
var _local2:Object = this._1445528373open_tag_fbml;
if (_local2 !== _arg1){
this._1445528373open_tag_fbml = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "open_tag_fbml", _local2, _arg1));
};
}
public function set close_tag_fbml(_arg1:String):void{
var _local2:Object = this._1772097351close_tag_fbml;
if (_local2 !== _arg1){
this._1772097351close_tag_fbml = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "close_tag_fbml", _local2, _arg1));
};
}
}
}//package com.facebook.data.fbml
Section 135
//GetCustomTagsData (com.facebook.data.fbml.GetCustomTagsData)
package com.facebook.data.fbml {
import mx.events.*;
import com.facebook.data.*;
public class GetCustomTagsData extends FacebookData {
private var _189132328tagCollection:TagCollection;
public function set tagCollection(_arg1:TagCollection):void{
var _local2:Object = this._189132328tagCollection;
if (_local2 !== _arg1){
this._189132328tagCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "tagCollection", _local2, _arg1));
};
}
public function get tagCollection():TagCollection{
return (this._189132328tagCollection);
}
}
}//package com.facebook.data.fbml
Section 136
//LeafTagData (com.facebook.data.fbml.LeafTagData)
package com.facebook.data.fbml {
import mx.events.*;
public class LeafTagData extends AbstractTagData {
private var _3136347fbml:String;
public function LeafTagData(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String="", _arg7:String="", _arg8:AttributeCollection=null){
super(_arg1, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
this.fbml = _arg2;
}
public function get fbml():String{
return (this._3136347fbml);
}
public function set fbml(_arg1:String):void{
var _local2:Object = this._3136347fbml;
if (_local2 !== _arg1){
this._3136347fbml = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "fbml", _local2, _arg1));
};
}
}
}//package com.facebook.data.fbml
Section 137
//TagCollection (com.facebook.data.fbml.TagCollection)
package com.facebook.data.fbml {
import com.facebook.utils.*;
public class TagCollection extends FacebookArrayCollection {
public function TagCollection(){
super(null, AbstractTagData);
}
}
}//package com.facebook.data.fbml
Section 138
//GetRegisteredTemplateBundleByIDData (com.facebook.data.feed.GetRegisteredTemplateBundleByIDData)
package com.facebook.data.feed {
import mx.events.*;
import com.facebook.data.*;
public class GetRegisteredTemplateBundleByIDData extends FacebookData {
private var _858818232templateCollection:TemplateCollection;
public function get templateCollection():TemplateCollection{
return (this._858818232templateCollection);
}
public function set templateCollection(_arg1:TemplateCollection):void{
var _local2:Object = this._858818232templateCollection;
if (_local2 !== _arg1){
this._858818232templateCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "templateCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.feed
Section 139
//GetRegisteredTemplateBundleData (com.facebook.data.feed.GetRegisteredTemplateBundleData)
package com.facebook.data.feed {
import mx.events.*;
import com.facebook.data.*;
public class GetRegisteredTemplateBundleData extends FacebookData {
private var _1345486656bundleCollection:TemplateCollection;
public function get bundleCollection():TemplateCollection{
return (this._1345486656bundleCollection);
}
public function set bundleCollection(_arg1:TemplateCollection):void{
var _local2:Object = this._1345486656bundleCollection;
if (_local2 !== _arg1){
this._1345486656bundleCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "bundleCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.feed
Section 140
//TemplateBundleCollection (com.facebook.data.feed.TemplateBundleCollection)
package com.facebook.data.feed {
import com.facebook.utils.*;
public class TemplateBundleCollection extends FacebookArrayCollection {
public function TemplateBundleCollection(){
super(null, TemplateData);
}
}
}//package com.facebook.data.feed
Section 141
//TemplateCollection (com.facebook.data.feed.TemplateCollection)
package com.facebook.data.feed {
import mx.events.*;
import com.facebook.utils.*;
public class TemplateCollection extends FacebookArrayCollection {
private var _630236298time_created:Date;
private var _1933135987template_bundle_id:Number;
public function TemplateCollection(){
super(null, TemplateData);
}
public function addTemplateData(_arg1:TemplateData):void{
this.addItem(_arg1);
}
public function set template_bundle_id(_arg1:Number):void{
var _local2:Object = this._1933135987template_bundle_id;
if (_local2 !== _arg1){
this._1933135987template_bundle_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "template_bundle_id", _local2, _arg1));
};
}
public function get template_bundle_id():Number{
return (this._1933135987template_bundle_id);
}
public function set time_created(_arg1:Date):void{
var _local2:Object = this._630236298time_created;
if (_local2 !== _arg1){
this._630236298time_created = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "time_created", _local2, _arg1));
};
}
public function get time_created():Date{
return (this._630236298time_created);
}
}
}//package com.facebook.data.feed
Section 142
//TemplateData (com.facebook.data.feed.TemplateData)
package com.facebook.data.feed {
import flash.events.*;
import mx.events.*;
public class TemplateData implements IEventDispatcher {
private var _1285910957template_title:String;
private var _180559289template_body:String;
private var _3575610type:String;
private var _bindingEventDispatcher:EventDispatcher;
public function TemplateData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function set template_title(_arg1:String):void{
var _local2:Object = this._1285910957template_title;
if (_local2 !== _arg1){
this._1285910957template_title = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "template_title", _local2, _arg1));
};
}
public function get template_body():String{
return (this._180559289template_body);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get template_title():String{
return (this._1285910957template_title);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set template_body(_arg1:String):void{
var _local2:Object = this._180559289template_body;
if (_local2 !== _arg1){
this._180559289template_body = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "template_body", _local2, _arg1));
};
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function get type():String{
return (this._3575610type);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
}
}//package com.facebook.data.feed
Section 143
//AreFriendsData (com.facebook.data.friends.AreFriendsData)
package com.facebook.data.friends {
import mx.events.*;
import com.facebook.data.*;
public class AreFriendsData extends FacebookData {
private var _40395245friendsCollection:FriendsCollection;
public function get friendsCollection():FriendsCollection{
return (this._40395245friendsCollection);
}
public function set friendsCollection(_arg1:FriendsCollection):void{
var _local2:Object = this._40395245friendsCollection;
if (_local2 !== _arg1){
this._40395245friendsCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "friendsCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.friends
Section 144
//FriendsCollection (com.facebook.data.friends.FriendsCollection)
package com.facebook.data.friends {
import com.facebook.utils.*;
public class FriendsCollection extends FacebookArrayCollection {
public function FriendsCollection(){
super(null, FriendsData);
}
}
}//package com.facebook.data.friends
Section 145
//FriendsData (com.facebook.data.friends.FriendsData)
package com.facebook.data.friends {
import flash.events.*;
import mx.events.*;
public class FriendsData implements IEventDispatcher {
private var _3589601uid1:Number;
private var _455530154are_friends:Boolean;
private var _3589602uid2:Number;
private var _bindingEventDispatcher:EventDispatcher;
public function FriendsData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get uid1():Number{
return (this._3589601uid1);
}
public function set uid1(_arg1:Number):void{
var _local2:Object = this._3589601uid1;
if (_local2 !== _arg1){
this._3589601uid1 = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid1", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set uid2(_arg1:Number):void{
var _local2:Object = this._3589602uid2;
if (_local2 !== _arg1){
this._3589602uid2 = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid2", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get uid2():Number{
return (this._3589602uid2);
}
public function get are_friends():Boolean{
return (this._455530154are_friends);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function set are_friends(_arg1:Boolean):void{
var _local2:Object = this._455530154are_friends;
if (_local2 !== _arg1){
this._455530154are_friends = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "are_friends", _local2, _arg1));
};
}
}
}//package com.facebook.data.friends
Section 146
//GetAppUserData (com.facebook.data.friends.GetAppUserData)
package com.facebook.data.friends {
import mx.events.*;
import com.facebook.data.*;
public class GetAppUserData extends FacebookData {
private var _3589667uids:Array;
public function get uids():Array{
return (this._3589667uids);
}
public function set uids(_arg1:Array):void{
var _local2:Object = this._3589667uids;
if (_local2 !== _arg1){
this._3589667uids = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uids", _local2, _arg1));
};
}
}
}//package com.facebook.data.friends
Section 147
//GetFriendsData (com.facebook.data.friends.GetFriendsData)
package com.facebook.data.friends {
import mx.events.*;
import com.facebook.data.*;
import com.facebook.data.users.*;
public class GetFriendsData extends FacebookData {
private var _600094315friends:FacebookUserCollection;
public function set friends(_arg1:FacebookUserCollection):void{
var _local2:Object = this._600094315friends;
if (_local2 !== _arg1){
this._600094315friends = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "friends", _local2, _arg1));
};
}
public function get friends():FacebookUserCollection{
return (this._600094315friends);
}
}
}//package com.facebook.data.friends
Section 148
//GetListsData (com.facebook.data.friends.GetListsData)
package com.facebook.data.friends {
import mx.events.*;
import com.facebook.data.*;
public class GetListsData extends FacebookData {
private var _102982549lists:Array;
public function set lists(_arg1:Array):void{
var _local2:Object = this._102982549lists;
if (_local2 !== _arg1){
this._102982549lists = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "lists", _local2, _arg1));
};
}
public function get lists():Array{
return (this._102982549lists);
}
}
}//package com.facebook.data.friends
Section 149
//ListsData (com.facebook.data.friends.ListsData)
package com.facebook.data.friends {
import flash.events.*;
import mx.events.*;
public class ListsData implements IEventDispatcher {
private var _3373707name:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _3145825flid:Number;
public function ListsData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get flid():Number{
return (this._3145825flid);
}
public function set flid(_arg1:Number):void{
var _local2:Object = this._3145825flid;
if (_local2 !== _arg1){
this._3145825flid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "flid", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
}
}//package com.facebook.data.friends
Section 150
//GetGroupData (com.facebook.data.groups.GetGroupData)
package com.facebook.data.groups {
import mx.events.*;
import com.facebook.data.*;
public class GetGroupData extends FacebookData {
private var _1237460524groups:GroupCollection;
public function set groups(_arg1:GroupCollection):void{
var _local2:Object = this._1237460524groups;
if (_local2 !== _arg1){
this._1237460524groups = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "groups", _local2, _arg1));
};
}
public function get groups():GroupCollection{
return (this._1237460524groups);
}
}
}//package com.facebook.data.groups
Section 151
//GetMemberData (com.facebook.data.groups.GetMemberData)
package com.facebook.data.groups {
import mx.events.*;
import com.facebook.data.*;
public class GetMemberData extends FacebookData {
private var _138904922notReplied:Array;
private var _1422235900admins:Array;
private var _948881689members:Array;
private var _765293059officers:Array;
public function get admins():Array{
return (this._1422235900admins);
}
public function get notReplied():Array{
return (this._138904922notReplied);
}
public function set admins(_arg1:Array):void{
var _local2:Object = this._1422235900admins;
if (_local2 !== _arg1){
this._1422235900admins = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "admins", _local2, _arg1));
};
}
public function set notReplied(_arg1:Array):void{
var _local2:Object = this._138904922notReplied;
if (_local2 !== _arg1){
this._138904922notReplied = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "notReplied", _local2, _arg1));
};
}
public function set members(_arg1:Array):void{
var _local2:Object = this._948881689members;
if (_local2 !== _arg1){
this._948881689members = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "members", _local2, _arg1));
};
}
public function get members():Array{
return (this._948881689members);
}
public function set officers(_arg1:Array):void{
var _local2:Object = this._765293059officers;
if (_local2 !== _arg1){
this._765293059officers = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "officers", _local2, _arg1));
};
}
public function get officers():Array{
return (this._765293059officers);
}
}
}//package com.facebook.data.groups
Section 152
//GroupCollection (com.facebook.data.groups.GroupCollection)
package com.facebook.data.groups {
import com.facebook.utils.*;
public class GroupCollection extends FacebookArrayCollection {
public function GroupCollection(){
super(null, GroupData);
}
public function addGroup(_arg1:GroupData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.groups
Section 153
//GroupData (com.facebook.data.groups.GroupData)
package com.facebook.data.groups {
import flash.events.*;
import mx.events.*;
import com.facebook.data.*;
public class GroupData implements IEventDispatcher {
private var _1282509050group_type:String;
private var _1019789636office:String;
private var _3373707name:String;
private var _314498168privacy:String;
private var _102338gid:String;
private var _2022916553recent_news:String;
private var _112093807venue:FacebookLocation;
private var _1028554796creator:String;
private var _1816339526group_subtype:String;
private var _1762076142pic_small:String;
private var _1224335515website:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _109065nid:Number;
private var _110986pic:String;
private var _578385717pic_big:String;
private var _573446013update_time:Date;
private var _1724546052description:String;
public function GroupData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function set gid(_arg1:String):void{
var _local2:Object = this._102338gid;
if (_local2 !== _arg1){
this._102338gid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "gid", _local2, _arg1));
};
}
public function get nid():Number{
return (this._109065nid);
}
public function get pic():String{
return (this._110986pic);
}
public function get name():String{
return (this._3373707name);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set update_time(_arg1:Date):void{
var _local2:Object = this._573446013update_time;
if (_local2 !== _arg1){
this._573446013update_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "update_time", _local2, _arg1));
};
}
public function get privacy():String{
return (this._314498168privacy);
}
public function set privacy(_arg1:String):void{
var _local2:Object = this._314498168privacy;
if (_local2 !== _arg1){
this._314498168privacy = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "privacy", _local2, _arg1));
};
}
public function set nid(_arg1:Number):void{
var _local2:Object = this._109065nid;
if (_local2 !== _arg1){
this._109065nid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "nid", _local2, _arg1));
};
}
public function set pic(_arg1:String):void{
var _local2:Object = this._110986pic;
if (_local2 !== _arg1){
this._110986pic = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic", _local2, _arg1));
};
}
public function set pic_big(_arg1:String):void{
var _local2:Object = this._578385717pic_big;
if (_local2 !== _arg1){
this._578385717pic_big = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_big", _local2, _arg1));
};
}
public function get pic_small():String{
return (this._1762076142pic_small);
}
public function get update_time():Date{
return (this._573446013update_time);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set pic_small(_arg1:String):void{
var _local2:Object = this._1762076142pic_small;
if (_local2 !== _arg1){
this._1762076142pic_small = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_small", _local2, _arg1));
};
}
public function get creator():String{
return (this._1028554796creator);
}
public function set website(_arg1:String):void{
var _local2:Object = this._1224335515website;
if (_local2 !== _arg1){
this._1224335515website = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "website", _local2, _arg1));
};
}
public function get recent_news():String{
return (this._2022916553recent_news);
}
public function get group_subtype():String{
return (this._1816339526group_subtype);
}
public function get website():String{
return (this._1224335515website);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get gid():String{
return (this._102338gid);
}
public function get pic_big():String{
return (this._578385717pic_big);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get office():String{
return (this._1019789636office);
}
public function set creator(_arg1:String):void{
var _local2:Object = this._1028554796creator;
if (_local2 !== _arg1){
this._1028554796creator = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "creator", _local2, _arg1));
};
}
public function set venue(_arg1:FacebookLocation):void{
var _local2:Object = this._112093807venue;
if (_local2 !== _arg1){
this._112093807venue = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "venue", _local2, _arg1));
};
}
public function set recent_news(_arg1:String):void{
var _local2:Object = this._2022916553recent_news;
if (_local2 !== _arg1){
this._2022916553recent_news = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "recent_news", _local2, _arg1));
};
}
public function get venue():FacebookLocation{
return (this._112093807venue);
}
public function set group_type(_arg1:String):void{
var _local2:Object = this._1282509050group_type;
if (_local2 !== _arg1){
this._1282509050group_type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "group_type", _local2, _arg1));
};
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get group_type():String{
return (this._1282509050group_type);
}
public function set group_subtype(_arg1:String):void{
var _local2:Object = this._1816339526group_subtype;
if (_local2 !== _arg1){
this._1816339526group_subtype = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "group_subtype", _local2, _arg1));
};
}
public function get description():String{
return (this._1724546052description);
}
public function set office(_arg1:String):void{
var _local2:Object = this._1019789636office;
if (_local2 !== _arg1){
this._1019789636office = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "office", _local2, _arg1));
};
}
}
}//package com.facebook.data.groups
Section 154
//GetNotesData (com.facebook.data.notes.GetNotesData)
package com.facebook.data.notes {
import mx.events.*;
import com.facebook.data.*;
public class GetNotesData extends FacebookData {
private var _1716839361notesCollection:NotesCollection;
public function set notesCollection(_arg1:NotesCollection):void{
var _local2:Object = this._1716839361notesCollection;
if (_local2 !== _arg1){
this._1716839361notesCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "notesCollection", _local2, _arg1));
};
}
public function get notesCollection():NotesCollection{
return (this._1716839361notesCollection);
}
}
}//package com.facebook.data.notes
Section 155
//NoteData (com.facebook.data.notes.NoteData)
package com.facebook.data.notes {
import flash.events.*;
import mx.events.*;
public class NoteData implements IEventDispatcher {
private var _2129224840note_id:String;
private var _2003148228created_time:Date;
private var _bindingEventDispatcher:EventDispatcher;
private var _115792uid:String;
private var _951530617content:String;
private var _472881199updated_time:Date;
private var _110371416title:String;
public function NoteData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get created_time():Date{
return (this._2003148228created_time);
}
public function get note_id():String{
return (this._2129224840note_id);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set created_time(_arg1:Date):void{
var _local2:Object = this._2003148228created_time;
if (_local2 !== _arg1){
this._2003148228created_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "created_time", _local2, _arg1));
};
}
public function set note_id(_arg1:String):void{
var _local2:Object = this._2129224840note_id;
if (_local2 !== _arg1){
this._2129224840note_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "note_id", _local2, _arg1));
};
}
public function get updated_time():Date{
return (this._472881199updated_time);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get uid():String{
return (this._115792uid);
}
public function get title():String{
return (this._110371416title);
}
public function set uid(_arg1:String):void{
var _local2:Object = this._115792uid;
if (_local2 !== _arg1){
this._115792uid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid", _local2, _arg1));
};
}
public function set updated_time(_arg1:Date):void{
var _local2:Object = this._472881199updated_time;
if (_local2 !== _arg1){
this._472881199updated_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "updated_time", _local2, _arg1));
};
}
public function set title(_arg1:String):void{
var _local2:Object = this._110371416title;
if (_local2 !== _arg1){
this._110371416title = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "title", _local2, _arg1));
};
}
public function set content(_arg1:String):void{
var _local2:Object = this._951530617content;
if (_local2 !== _arg1){
this._951530617content = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "content", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get content():String{
return (this._951530617content);
}
}
}//package com.facebook.data.notes
Section 156
//NotesCollection (com.facebook.data.notes.NotesCollection)
package com.facebook.data.notes {
import com.facebook.utils.*;
public class NotesCollection extends FacebookArrayCollection {
public function NotesCollection(){
super(null, NoteData);
}
}
}//package com.facebook.data.notes
Section 157
//GetNotificationData (com.facebook.data.notifications.GetNotificationData)
package com.facebook.data.notifications {
import mx.events.*;
import com.facebook.data.*;
public class GetNotificationData extends FacebookData {
private var _2011259082group_invites:Array;
private var _757115001friendsRequests:Array;
private var _823645719notificationCollection:NotificationCollection;
private var _1950182939event_invites:Array;
public function get event_invites():Array{
return (this._1950182939event_invites);
}
public function get notificationCollection():NotificationCollection{
return (this._823645719notificationCollection);
}
public function get group_invites():Array{
return (this._2011259082group_invites);
}
public function set event_invites(_arg1:Array):void{
var _local2:Object = this._1950182939event_invites;
if (_local2 !== _arg1){
this._1950182939event_invites = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "event_invites", _local2, _arg1));
};
}
public function set friendsRequests(_arg1:Array):void{
var _local2:Object = this._757115001friendsRequests;
if (_local2 !== _arg1){
this._757115001friendsRequests = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "friendsRequests", _local2, _arg1));
};
}
public function set group_invites(_arg1:Array):void{
var _local2:Object = this._2011259082group_invites;
if (_local2 !== _arg1){
this._2011259082group_invites = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "group_invites", _local2, _arg1));
};
}
public function get friendsRequests():Array{
return (this._757115001friendsRequests);
}
public function set notificationCollection(_arg1:NotificationCollection):void{
var _local2:Object = this._823645719notificationCollection;
if (_local2 !== _arg1){
this._823645719notificationCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "notificationCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.notifications
Section 158
//NotificationCollection (com.facebook.data.notifications.NotificationCollection)
package com.facebook.data.notifications {
import com.facebook.utils.*;
public class NotificationCollection extends FacebookArrayCollection {
public function NotificationCollection(){
super(null, null);
}
}
}//package com.facebook.data.notifications
Section 159
//NotificationMessageData (com.facebook.data.notifications.NotificationMessageData)
package com.facebook.data.notifications {
import flash.events.*;
import mx.events.*;
public class NotificationMessageData implements IEventDispatcher {
private var _1739890327most_recent:Number;
private var _840272977unread:Number;
private var _bindingEventDispatcher:EventDispatcher;
public function NotificationMessageData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set most_recent(_arg1:Number):void{
var _local2:Object = this._1739890327most_recent;
if (_local2 !== _arg1){
this._1739890327most_recent = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "most_recent", _local2, _arg1));
};
}
public function get unread():Number{
return (this._840272977unread);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get most_recent():Number{
return (this._1739890327most_recent);
}
public function set unread(_arg1:Number):void{
var _local2:Object = this._840272977unread;
if (_local2 !== _arg1){
this._840272977unread = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "unread", _local2, _arg1));
};
}
}
}//package com.facebook.data.notifications
Section 160
//NotificationPokeData (com.facebook.data.notifications.NotificationPokeData)
package com.facebook.data.notifications {
import flash.events.*;
import mx.events.*;
public class NotificationPokeData implements IEventDispatcher {
private var _1739890327most_recent:Number;
private var _840272977unread:Number;
private var _bindingEventDispatcher:EventDispatcher;
public function NotificationPokeData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set most_recent(_arg1:Number):void{
var _local2:Object = this._1739890327most_recent;
if (_local2 !== _arg1){
this._1739890327most_recent = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "most_recent", _local2, _arg1));
};
}
public function get unread():Number{
return (this._840272977unread);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get most_recent():Number{
return (this._1739890327most_recent);
}
public function set unread(_arg1:Number):void{
var _local2:Object = this._840272977unread;
if (_local2 !== _arg1){
this._840272977unread = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "unread", _local2, _arg1));
};
}
}
}//package com.facebook.data.notifications
Section 161
//NotificationShareData (com.facebook.data.notifications.NotificationShareData)
package com.facebook.data.notifications {
import flash.events.*;
import mx.events.*;
public class NotificationShareData implements IEventDispatcher {
private var _1739890327most_recent:Number;
private var _840272977unread:Number;
private var _bindingEventDispatcher:EventDispatcher;
public function NotificationShareData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set most_recent(_arg1:Number):void{
var _local2:Object = this._1739890327most_recent;
if (_local2 !== _arg1){
this._1739890327most_recent = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "most_recent", _local2, _arg1));
};
}
public function get unread():Number{
return (this._840272977unread);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get most_recent():Number{
return (this._1739890327most_recent);
}
public function set unread(_arg1:Number):void{
var _local2:Object = this._840272977unread;
if (_local2 !== _arg1){
this._840272977unread = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "unread", _local2, _arg1));
};
}
}
}//package com.facebook.data.notifications
Section 162
//GetPageInfoData (com.facebook.data.pages.GetPageInfoData)
package com.facebook.data.pages {
import mx.events.*;
import com.facebook.data.*;
public class GetPageInfoData extends FacebookData {
private var _1492481627pageInfoCollection:PageInfoCollection;
public function get pageInfoCollection():PageInfoCollection{
return (this._1492481627pageInfoCollection);
}
public function set pageInfoCollection(_arg1:PageInfoCollection):void{
var _local2:Object = this._1492481627pageInfoCollection;
if (_local2 !== _arg1){
this._1492481627pageInfoCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pageInfoCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.pages
Section 163
//PageInfoCollection (com.facebook.data.pages.PageInfoCollection)
package com.facebook.data.pages {
import com.facebook.utils.*;
public class PageInfoCollection extends FacebookArrayCollection {
public function PageInfoCollection(){
super(null, PageInfoData);
}
public function addPageInfo(_arg1:PageInfoData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.pages
Section 164
//PageInfoData (com.facebook.data.pages.PageInfoData)
package com.facebook.data.pages {
import flash.events.*;
import mx.events.*;
import com.facebook.data.*;
public class PageInfoData extends EventDispatcher {
private var _485238799hometown:String;
private var _3575610type:String;
private var _1405038154awards:String;
private var _99469071hours:String;
private var _1635870290directed_by:String;
private var _1224335515website:String;
private var _1768882106pic_large:String;
private var _2002886397has_added_app:Boolean;
private var _578385717pic_big:String;
private var _1817326876plot_outline:String;
private var _1214494066pic_square:String;
private var _697920873schedule:String;
private var _1965855514release_date:String;
private var _97544bio:String;
private var _1774829598influences:String;
private var _2116416122record_label:String;
private var _1843485230network:String;
private var _3373707name:String;
private var _1762076142pic_small:String;
private var _68251919band_members:String;
private var _1316747138starring:String;
private var _1901043637location:FacebookLocation;
private var _906335517season:String;
private var _674640991founded:String;
private var _803548981page_id:Number;
private var _915840763company_overview:String;
private var _98240899genre:String;
private var _891901482studio:String;
private var _1505017102produced_by:String;
private var _1003761308products:String;
private var _1069449612mission:String;
private var _201317249written_by:String;
public function set starring(_arg1:String):void{
var _local2:Object = this._1316747138starring;
if (_local2 !== _arg1){
this._1316747138starring = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "starring", _local2, _arg1));
};
}
public function get season():String{
return (this._906335517season);
}
public function get bio():String{
return (this._97544bio);
}
public function set record_label(_arg1:String):void{
var _local2:Object = this._2116416122record_label;
if (_local2 !== _arg1){
this._2116416122record_label = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "record_label", _local2, _arg1));
};
}
public function set genre(_arg1:String):void{
var _local2:Object = this._98240899genre;
if (_local2 !== _arg1){
this._98240899genre = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "genre", _local2, _arg1));
};
}
public function get hours():String{
return (this._99469071hours);
}
public function get pic_small():String{
return (this._1762076142pic_small);
}
public function set bio(_arg1:String):void{
var _local2:Object = this._97544bio;
if (_local2 !== _arg1){
this._97544bio = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "bio", _local2, _arg1));
};
}
public function set hours(_arg1:String):void{
var _local2:Object = this._99469071hours;
if (_local2 !== _arg1){
this._99469071hours = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hours", _local2, _arg1));
};
}
public function set mission(_arg1:String):void{
var _local2:Object = this._1069449612mission;
if (_local2 !== _arg1){
this._1069449612mission = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "mission", _local2, _arg1));
};
}
public function set pic_small(_arg1:String):void{
var _local2:Object = this._1762076142pic_small;
if (_local2 !== _arg1){
this._1762076142pic_small = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_small", _local2, _arg1));
};
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function get band_members():String{
return (this._68251919band_members);
}
public function set band_members(_arg1:String):void{
var _local2:Object = this._68251919band_members;
if (_local2 !== _arg1){
this._68251919band_members = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "band_members", _local2, _arg1));
};
}
public function get network():String{
return (this._1843485230network);
}
public function set website(_arg1:String):void{
var _local2:Object = this._1224335515website;
if (_local2 !== _arg1){
this._1224335515website = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "website", _local2, _arg1));
};
}
public function get type():String{
return (this._3575610type);
}
public function set influences(_arg1:String):void{
var _local2:Object = this._1774829598influences;
if (_local2 !== _arg1){
this._1774829598influences = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "influences", _local2, _arg1));
};
}
public function set schedule(_arg1:String):void{
var _local2:Object = this._697920873schedule;
if (_local2 !== _arg1){
this._697920873schedule = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "schedule", _local2, _arg1));
};
}
public function get influences():String{
return (this._1774829598influences);
}
public function set founded(_arg1:String):void{
var _local2:Object = this._674640991founded;
if (_local2 !== _arg1){
this._674640991founded = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "founded", _local2, _arg1));
};
}
public function get pic_large():String{
return (this._1768882106pic_large);
}
public function set directed_by(_arg1:String):void{
var _local2:Object = this._1635870290directed_by;
if (_local2 !== _arg1){
this._1635870290directed_by = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "directed_by", _local2, _arg1));
};
}
public function set network(_arg1:String):void{
var _local2:Object = this._1843485230network;
if (_local2 !== _arg1){
this._1843485230network = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "network", _local2, _arg1));
};
}
public function get products():String{
return (this._1003761308products);
}
public function set location(_arg1:FacebookLocation):void{
var _local2:Object = this._1901043637location;
if (_local2 !== _arg1){
this._1901043637location = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "location", _local2, _arg1));
};
}
public function get pic_square():String{
return (this._1214494066pic_square);
}
public function set awards(_arg1:String):void{
var _local2:Object = this._1405038154awards;
if (_local2 !== _arg1){
this._1405038154awards = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "awards", _local2, _arg1));
};
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function get written_by():String{
return (this._201317249written_by);
}
public function get starring():String{
return (this._1316747138starring);
}
public function get genre():String{
return (this._98240899genre);
}
public function set pic_large(_arg1:String):void{
var _local2:Object = this._1768882106pic_large;
if (_local2 !== _arg1){
this._1768882106pic_large = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_large", _local2, _arg1));
};
}
public function get mission():String{
return (this._1069449612mission);
}
public function set page_id(_arg1:Number):void{
var _local2:Object = this._803548981page_id;
if (_local2 !== _arg1){
this._803548981page_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "page_id", _local2, _arg1));
};
}
public function get schedule():String{
return (this._697920873schedule);
}
public function get name():String{
return (this._3373707name);
}
public function get website():String{
return (this._1224335515website);
}
public function set pic_big(_arg1:String):void{
var _local2:Object = this._578385717pic_big;
if (_local2 !== _arg1){
this._578385717pic_big = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_big", _local2, _arg1));
};
}
public function get record_label():String{
return (this._2116416122record_label);
}
public function get founded():String{
return (this._674640991founded);
}
public function get directed_by():String{
return (this._1635870290directed_by);
}
public function get location():FacebookLocation{
return (this._1901043637location);
}
public function set studio(_arg1:String):void{
var _local2:Object = this._891901482studio;
if (_local2 !== _arg1){
this._891901482studio = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "studio", _local2, _arg1));
};
}
public function get awards():String{
return (this._1405038154awards);
}
public function set season(_arg1:String):void{
var _local2:Object = this._906335517season;
if (_local2 !== _arg1){
this._906335517season = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "season", _local2, _arg1));
};
}
public function get page_id():Number{
return (this._803548981page_id);
}
public function set release_date(_arg1:String):void{
var _local2:Object = this._1965855514release_date;
if (_local2 !== _arg1){
this._1965855514release_date = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "release_date", _local2, _arg1));
};
}
public function set products(_arg1:String):void{
var _local2:Object = this._1003761308products;
if (_local2 !== _arg1){
this._1003761308products = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "products", _local2, _arg1));
};
}
public function set plot_outline(_arg1:String):void{
var _local2:Object = this._1817326876plot_outline;
if (_local2 !== _arg1){
this._1817326876plot_outline = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "plot_outline", _local2, _arg1));
};
}
public function get studio():String{
return (this._891901482studio);
}
public function get pic_big():String{
return (this._578385717pic_big);
}
public function set pic_square(_arg1:String):void{
var _local2:Object = this._1214494066pic_square;
if (_local2 !== _arg1){
this._1214494066pic_square = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_square", _local2, _arg1));
};
}
public function get release_date():String{
return (this._1965855514release_date);
}
public function set hometown(_arg1:String):void{
var _local2:Object = this._485238799hometown;
if (_local2 !== _arg1){
this._485238799hometown = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hometown", _local2, _arg1));
};
}
public function set produced_by(_arg1:String):void{
var _local2:Object = this._1505017102produced_by;
if (_local2 !== _arg1){
this._1505017102produced_by = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "produced_by", _local2, _arg1));
};
}
public function get hometown():String{
return (this._485238799hometown);
}
public function get produced_by():String{
return (this._1505017102produced_by);
}
public function get plot_outline():String{
return (this._1817326876plot_outline);
}
public function set company_overview(_arg1:String):void{
var _local2:Object = this._915840763company_overview;
if (_local2 !== _arg1){
this._915840763company_overview = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "company_overview", _local2, _arg1));
};
}
public function set has_added_app(_arg1:Boolean):void{
var _local2:Object = this._2002886397has_added_app;
if (_local2 !== _arg1){
this._2002886397has_added_app = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "has_added_app", _local2, _arg1));
};
}
public function get company_overview():String{
return (this._915840763company_overview);
}
public function get has_added_app():Boolean{
return (this._2002886397has_added_app);
}
public function set written_by(_arg1:String):void{
var _local2:Object = this._201317249written_by;
if (_local2 !== _arg1){
this._201317249written_by = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "written_by", _local2, _arg1));
};
}
}
}//package com.facebook.data.pages
Section 165
//AlbumCollection (com.facebook.data.photos.AlbumCollection)
package com.facebook.data.photos {
import com.facebook.utils.*;
public class AlbumCollection extends FacebookArrayCollection {
public function AlbumCollection(){
super(null, AlbumData);
}
public function addAlbum(_arg1:AlbumData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.photos
Section 166
//AlbumData (com.facebook.data.photos.AlbumData)
package com.facebook.data.photos {
import flash.events.*;
import mx.events.*;
public class AlbumData implements IEventDispatcher {
private var _1028554472created:Date;
private var _3373707name:String;
private var _3321850link:String;
private var _3575610type:String;
private var _466743410visible:String;
private var _96572aid:String;
private var _106164915owner:String;
private var _483729603modified_major:Date;
private var _3530753size:Number;
private var _bindingEventDispatcher:EventDispatcher;
private var _615513399modified:Date;
private var _1980072195cover_pid:String;
private var _1901043637location:String;
private var _1724546052description:String;
private var _1866256113edit_link:String;
public function AlbumData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function get size():Number{
return (this._3530753size);
}
public function set size(_arg1:Number):void{
var _local2:Object = this._3530753size;
if (_local2 !== _arg1){
this._3530753size = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "size", _local2, _arg1));
};
}
public function get cover_pid():String{
return (this._1980072195cover_pid);
}
public function set cover_pid(_arg1:String):void{
var _local2:Object = this._1980072195cover_pid;
if (_local2 !== _arg1){
this._1980072195cover_pid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "cover_pid", _local2, _arg1));
};
}
public function get name():String{
return (this._3373707name);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set modified_major(_arg1:Date):void{
var _local2:Object = this._483729603modified_major;
if (_local2 !== _arg1){
this._483729603modified_major = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "modified_major", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set modified(_arg1:Date):void{
var _local2:Object = this._615513399modified;
if (_local2 !== _arg1){
this._615513399modified = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "modified", _local2, _arg1));
};
}
public function set edit_link(_arg1:String):void{
var _local2:Object = this._1866256113edit_link;
if (_local2 !== _arg1){
this._1866256113edit_link = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "edit_link", _local2, _arg1));
};
}
public function get edit_link():String{
return (this._1866256113edit_link);
}
public function get location():String{
return (this._1901043637location);
}
public function get owner():String{
return (this._106164915owner);
}
public function get aid():String{
return (this._96572aid);
}
public function get type():String{
return (this._3575610type);
}
public function get modified_major():Date{
return (this._483729603modified_major);
}
public function get modified():Date{
return (this._615513399modified);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set created(_arg1:Date):void{
var _local2:Object = this._1028554472created;
if (_local2 !== _arg1){
this._1028554472created = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "created", _local2, _arg1));
};
}
public function set visible(_arg1:String):void{
var _local2:Object = this._466743410visible;
if (_local2 !== _arg1){
this._466743410visible = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "visible", _local2, _arg1));
};
}
public function set owner(_arg1:String):void{
var _local2:Object = this._106164915owner;
if (_local2 !== _arg1){
this._106164915owner = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "owner", _local2, _arg1));
};
}
public function get created():Date{
return (this._1028554472created);
}
public function set location(_arg1:String):void{
var _local2:Object = this._1901043637location;
if (_local2 !== _arg1){
this._1901043637location = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "location", _local2, _arg1));
};
}
public function get visible():String{
return (this._466743410visible);
}
public function set link(_arg1:String):void{
var _local2:Object = this._3321850link;
if (_local2 !== _arg1){
this._3321850link = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "link", _local2, _arg1));
};
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get link():String{
return (this._3321850link);
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function get description():String{
return (this._1724546052description);
}
public function set aid(_arg1:String):void{
var _local2:Object = this._96572aid;
if (_local2 !== _arg1){
this._96572aid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "aid", _local2, _arg1));
};
}
}
}//package com.facebook.data.photos
Section 167
//FacebookPhoto (com.facebook.data.photos.FacebookPhoto)
package com.facebook.data.photos {
import mx.events.*;
import com.facebook.data.*;
public class FacebookPhoto extends FacebookData {
private var _1028554472created:Date;
private var _552573414caption:String;
private var _89081108src_small:String;
private var _1953179611src_big:String;
private var _3321850link:String;
private var _110987pid:String;
private var _3552281tags:Array;
private var _96572aid:String;
private var _114148src:String;
private var _106164915owner:Number;
public function FacebookPhoto(){
tags = [];
super();
}
public function get link():String{
return (this._3321850link);
}
public function get owner():Number{
return (this._106164915owner);
}
public function get src():String{
return (this._114148src);
}
public function set src_big(_arg1:String):void{
var _local2:Object = this._1953179611src_big;
if (_local2 !== _arg1){
this._1953179611src_big = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "src_big", _local2, _arg1));
};
}
public function get pid():String{
return (this._110987pid);
}
public function set caption(_arg1:String):void{
var _local2:Object = this._552573414caption;
if (_local2 !== _arg1){
this._552573414caption = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "caption", _local2, _arg1));
};
}
public function set pid(_arg1:String):void{
var _local2:Object = this._110987pid;
if (_local2 !== _arg1){
this._110987pid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pid", _local2, _arg1));
};
}
public function set src(_arg1:String):void{
var _local2:Object = this._114148src;
if (_local2 !== _arg1){
this._114148src = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "src", _local2, _arg1));
};
}
public function set src_small(_arg1:String):void{
var _local2:Object = this._89081108src_small;
if (_local2 !== _arg1){
this._89081108src_small = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "src_small", _local2, _arg1));
};
}
public function get tags():Array{
return (this._3552281tags);
}
public function set created(_arg1:Date):void{
var _local2:Object = this._1028554472created;
if (_local2 !== _arg1){
this._1028554472created = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "created", _local2, _arg1));
};
}
public function get src_big():String{
return (this._1953179611src_big);
}
public function get created():Date{
return (this._1028554472created);
}
public function set tags(_arg1:Array):void{
var _local2:Object = this._3552281tags;
if (_local2 !== _arg1){
this._3552281tags = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "tags", _local2, _arg1));
};
}
public function set link(_arg1:String):void{
var _local2:Object = this._3321850link;
if (_local2 !== _arg1){
this._3321850link = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "link", _local2, _arg1));
};
}
public function set owner(_arg1:Number):void{
var _local2:Object = this._106164915owner;
if (_local2 !== _arg1){
this._106164915owner = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "owner", _local2, _arg1));
};
}
public function get src_small():String{
return (this._89081108src_small);
}
public function get aid():String{
return (this._96572aid);
}
public function get caption():String{
return (this._552573414caption);
}
public function set aid(_arg1:String):void{
var _local2:Object = this._96572aid;
if (_local2 !== _arg1){
this._96572aid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "aid", _local2, _arg1));
};
}
}
}//package com.facebook.data.photos
Section 168
//GetAlbumsData (com.facebook.data.photos.GetAlbumsData)
package com.facebook.data.photos {
import mx.events.*;
import com.facebook.data.*;
public class GetAlbumsData extends FacebookData {
private var _1670051219albumCollection:AlbumCollection;
public function set albumCollection(_arg1:AlbumCollection):void{
var _local2:Object = this._1670051219albumCollection;
if (_local2 !== _arg1){
this._1670051219albumCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "albumCollection", _local2, _arg1));
};
}
public function get albumCollection():AlbumCollection{
return (this._1670051219albumCollection);
}
}
}//package com.facebook.data.photos
Section 169
//GetCreateAlbumData (com.facebook.data.photos.GetCreateAlbumData)
package com.facebook.data.photos {
import mx.events.*;
import com.facebook.data.*;
public class GetCreateAlbumData extends FacebookData {
private var _248976057albumData:AlbumData;
public function get albumData():AlbumData{
return (this._248976057albumData);
}
public function set albumData(_arg1:AlbumData):void{
var _local2:Object = this._248976057albumData;
if (_local2 !== _arg1){
this._248976057albumData = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "albumData", _local2, _arg1));
};
}
}
}//package com.facebook.data.photos
Section 170
//GetPhotosData (com.facebook.data.photos.GetPhotosData)
package com.facebook.data.photos {
import mx.events.*;
import com.facebook.data.*;
public class GetPhotosData extends FacebookData {
private var _1751633296photoCollection:PhotoCollection;
public function get photoCollection():PhotoCollection{
return (this._1751633296photoCollection);
}
public function set photoCollection(_arg1:PhotoCollection):void{
var _local2:Object = this._1751633296photoCollection;
if (_local2 !== _arg1){
this._1751633296photoCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "photoCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.photos
Section 171
//GetTagsData (com.facebook.data.photos.GetTagsData)
package com.facebook.data.photos {
import mx.events.*;
import com.facebook.data.*;
public class GetTagsData extends FacebookData {
private var _2107998615photoTagsCollection:PhotoTagCollection;
public function get photoTagsCollection():PhotoTagCollection{
return (this._2107998615photoTagsCollection);
}
public function set photoTagsCollection(_arg1:PhotoTagCollection):void{
var _local2:Object = this._2107998615photoTagsCollection;
if (_local2 !== _arg1){
this._2107998615photoTagsCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "photoTagsCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.photos
Section 172
//PhotoCollection (com.facebook.data.photos.PhotoCollection)
package com.facebook.data.photos {
import com.facebook.utils.*;
public class PhotoCollection extends FacebookArrayCollection {
public function PhotoCollection(){
super(null, PhotoData);
}
public function addPhoto(_arg1:PhotoData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.photos
Section 173
//PhotoData (com.facebook.data.photos.PhotoData)
package com.facebook.data.photos {
import flash.events.*;
import mx.events.*;
public class PhotoData implements IEventDispatcher {
private var _bindingEventDispatcher:EventDispatcher;
private var _1028554472created:Date;
private var _552573414caption:String;
private var _89081108src_small:String;
private var _1953179611src_big:String;
private var _3321850link:String;
private var _110987pid:String;
private var _96572aid:String;
private var _114148src:String;
private var _106164915owner:String;
public function PhotoData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get src():String{
return (this._114148src);
}
public function set src_big(_arg1:String):void{
var _local2:Object = this._1953179611src_big;
if (_local2 !== _arg1){
this._1953179611src_big = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "src_big", _local2, _arg1));
};
}
public function get pid():String{
return (this._110987pid);
}
public function set caption(_arg1:String):void{
var _local2:Object = this._552573414caption;
if (_local2 !== _arg1){
this._552573414caption = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "caption", _local2, _arg1));
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set pid(_arg1:String):void{
var _local2:Object = this._110987pid;
if (_local2 !== _arg1){
this._110987pid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pid", _local2, _arg1));
};
}
public function set src(_arg1:String):void{
var _local2:Object = this._114148src;
if (_local2 !== _arg1){
this._114148src = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "src", _local2, _arg1));
};
}
public function set src_small(_arg1:String):void{
var _local2:Object = this._89081108src_small;
if (_local2 !== _arg1){
this._89081108src_small = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "src_small", _local2, _arg1));
};
}
public function set created(_arg1:Date):void{
var _local2:Object = this._1028554472created;
if (_local2 !== _arg1){
this._1028554472created = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "created", _local2, _arg1));
};
}
public function set owner(_arg1:String):void{
var _local2:Object = this._106164915owner;
if (_local2 !== _arg1){
this._106164915owner = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "owner", _local2, _arg1));
};
}
public function get link():String{
return (this._3321850link);
}
public function get src_big():String{
return (this._1953179611src_big);
}
public function get created():Date{
return (this._1028554472created);
}
public function get owner():String{
return (this._106164915owner);
}
public function set link(_arg1:String):void{
var _local2:Object = this._3321850link;
if (_local2 !== _arg1){
this._3321850link = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "link", _local2, _arg1));
};
}
public function get caption():String{
return (this._552573414caption);
}
public function get src_small():String{
return (this._89081108src_small);
}
public function get aid():String{
return (this._96572aid);
}
public function set aid(_arg1:String):void{
var _local2:Object = this._96572aid;
if (_local2 !== _arg1){
this._96572aid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "aid", _local2, _arg1));
};
}
}
}//package com.facebook.data.photos
Section 174
//PhotoTagCollection (com.facebook.data.photos.PhotoTagCollection)
package com.facebook.data.photos {
import com.facebook.utils.*;
public class PhotoTagCollection extends FacebookArrayCollection {
public function PhotoTagCollection(_arg1:Array=null){
super(_arg1, TagData);
}
public function addPhotoTag(_arg1:TagData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.photos
Section 175
//TagData (com.facebook.data.photos.TagData)
package com.facebook.data.photos {
import flash.events.*;
import mx.events.*;
public class TagData implements IEventDispatcher {
protected var _actualText:String;
private var _1867885268subject:String;
private var _1028554472created:Date;
private var _110987pid:String;
private var _bindingEventDispatcher:EventDispatcher;
protected var _actualX:Number;
protected var _actualY:Number;
private var _1548659157tag_uid:String;
public function TagData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function get pid():String{
return (this._110987pid);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
private function set _120x(_arg1:Number):void{
_actualX = _arg1;
}
public function get ycoord():Number{
return (_actualY);
}
public function set pid(_arg1:String):void{
var _local2:Object = this._110987pid;
if (_local2 !== _arg1){
this._110987pid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pid", _local2, _arg1));
};
}
private function set _735994340ycoord(_arg1:Number):void{
_actualY = _arg1;
}
public function get tag_uid():String{
return (this._1548659157tag_uid);
}
public function get subject():String{
return (this._1867885268subject);
}
public function get text():String{
return (_actualText);
}
public function get tag_text():String{
return (_actualText);
}
public function set ycoord(_arg1:Number):void{
var _local2:Object = this.ycoord;
if (_local2 !== _arg1){
this._735994340ycoord = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "ycoord", _local2, _arg1));
};
}
private function set _3556653text(_arg1:String):void{
_actualText = _arg1;
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
private function set _764623491xcoord(_arg1:Number):void{
_actualX = _arg1;
}
public function set created(_arg1:Date):void{
var _local2:Object = this._1028554472created;
if (_local2 !== _arg1){
this._1028554472created = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "created", _local2, _arg1));
};
}
public function set subject(_arg1:String):void{
var _local2:Object = this._1867885268subject;
if (_local2 !== _arg1){
this._1867885268subject = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "subject", _local2, _arg1));
};
}
public function set text(_arg1:String):void{
var _local2:Object = this.text;
if (_local2 !== _arg1){
this._3556653text = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "text", _local2, _arg1));
};
}
public function set tag_uid(_arg1:String):void{
var _local2:Object = this._1548659157tag_uid;
if (_local2 !== _arg1){
this._1548659157tag_uid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "tag_uid", _local2, _arg1));
};
}
private function set _121y(_arg1:Number):void{
_actualY = _arg1;
}
public function set tag_text(_arg1:String):void{
var _local2:Object = this.tag_text;
if (_local2 !== _arg1){
this._763826510tag_text = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "tag_text", _local2, _arg1));
};
}
public function get created():Date{
return (this._1028554472created);
}
public function set x(_arg1:Number):void{
var _local2:Object = this.x;
if (_local2 !== _arg1){
this._120x = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "x", _local2, _arg1));
};
}
public function set y(_arg1:Number):void{
var _local2:Object = this.y;
if (_local2 !== _arg1){
this._121y = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "y", _local2, _arg1));
};
}
public function get x():Number{
return (_actualX);
}
public function get y():Number{
return (_actualY);
}
public function set xcoord(_arg1:Number):void{
var _local2:Object = this.xcoord;
if (_local2 !== _arg1){
this._764623491xcoord = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "xcoord", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get xcoord():Number{
return (_actualX);
}
private function set _763826510tag_text(_arg1:String):void{
_actualText = _arg1;
}
}
}//package com.facebook.data.photos
Section 176
//GetStatusData (com.facebook.data.status.GetStatusData)
package com.facebook.data.status {
import mx.events.*;
import com.facebook.data.*;
public class GetStatusData extends FacebookData {
private var _892481550status:Array;
public function get status():Array{
return (this._892481550status);
}
public function set status(_arg1:Array):void{
var _local2:Object = this._892481550status;
if (_local2 !== _arg1){
this._892481550status = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "status", _local2, _arg1));
};
}
}
}//package com.facebook.data.status
Section 177
//Status (com.facebook.data.status.Status)
package com.facebook.data.status {
import flash.events.*;
import mx.events.*;
public class Status implements IEventDispatcher {
private var _954925063message:String;
private var _115792uid:String;
private var _2070199160status_id:String;
private var _3560141time:Date;
private var _bindingEventDispatcher:EventDispatcher;
private var _896505829source:String;
public function Status(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function set source(_arg1:String):void{
var _local2:Object = this._896505829source;
if (_local2 !== _arg1){
this._896505829source = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "source", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get message():String{
return (this._954925063message);
}
public function get status_id():String{
return (this._2070199160status_id);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get time():Date{
return (this._3560141time);
}
public function set message(_arg1:String):void{
var _local2:Object = this._954925063message;
if (_local2 !== _arg1){
this._954925063message = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "message", _local2, _arg1));
};
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get uid():String{
return (this._115792uid);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set status_id(_arg1:String):void{
var _local2:Object = this._2070199160status_id;
if (_local2 !== _arg1){
this._2070199160status_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "status_id", _local2, _arg1));
};
}
public function set time(_arg1:Date):void{
var _local2:Object = this._3560141time;
if (_local2 !== _arg1){
this._3560141time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "time", _local2, _arg1));
};
}
public function get source():String{
return (this._896505829source);
}
public function set uid(_arg1:String):void{
var _local2:Object = this._115792uid;
if (_local2 !== _arg1){
this._115792uid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
}
}//package com.facebook.data.status
Section 178
//ActionLinkData (com.facebook.data.stream.ActionLinkData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class ActionLinkData implements IEventDispatcher {
private var _3211051href:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _3556653text:String;
public function ActionLinkData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get href():String{
return (this._3211051href);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function get text():String{
return (this._3556653text);
}
public function set text(_arg1:String):void{
var _local2:Object = this._3556653text;
if (_local2 !== _arg1){
this._3556653text = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "text", _local2, _arg1));
};
}
public function set href(_arg1:String):void{
var _local2:Object = this._3211051href;
if (_local2 !== _arg1){
this._3211051href = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "href", _local2, _arg1));
};
}
}
}//package com.facebook.data.stream
Section 179
//AttachmentData (com.facebook.data.stream.AttachmentData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class AttachmentData implements IEventDispatcher {
private var _3373707name:String;
private var _103772132media:Array;
private var _3211051href:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _102727412label:String;
private var _3029410body:String;
private var _552573414caption:String;
private var _926053069properties:Array;
private var _1724546052description:String;
private var _3556653text:String;
private var _3226745icon:String;
private var _110371416title:String;
public function AttachmentData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get name():String{
return (this._3373707name);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function get body():String{
return (this._3029410body);
}
public function get href():String{
return (this._3211051href);
}
public function get text():String{
return (this._3556653text);
}
public function set title(_arg1:String):void{
var _local2:Object = this._110371416title;
if (_local2 !== _arg1){
this._110371416title = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "title", _local2, _arg1));
};
}
public function get properties():Array{
return (this._926053069properties);
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set body(_arg1:String):void{
var _local2:Object = this._3029410body;
if (_local2 !== _arg1){
this._3029410body = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "body", _local2, _arg1));
};
}
public function set media(_arg1:Array):void{
var _local2:Object = this._103772132media;
if (_local2 !== _arg1){
this._103772132media = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "media", _local2, _arg1));
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function set caption(_arg1:String):void{
var _local2:Object = this._552573414caption;
if (_local2 !== _arg1){
this._552573414caption = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "caption", _local2, _arg1));
};
}
public function get title():String{
return (this._110371416title);
}
public function set text(_arg1:String):void{
var _local2:Object = this._3556653text;
if (_local2 !== _arg1){
this._3556653text = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "text", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set href(_arg1:String):void{
var _local2:Object = this._3211051href;
if (_local2 !== _arg1){
this._3211051href = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "href", _local2, _arg1));
};
}
public function get media():Array{
return (this._103772132media);
}
public function set properties(_arg1:Array):void{
var _local2:Object = this._926053069properties;
if (_local2 !== _arg1){
this._926053069properties = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "properties", _local2, _arg1));
};
}
public function set label(_arg1:String):void{
var _local2:Object = this._102727412label;
if (_local2 !== _arg1){
this._102727412label = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "label", _local2, _arg1));
};
}
public function get caption():String{
return (this._552573414caption);
}
public function set icon(_arg1:String):void{
var _local2:Object = this._3226745icon;
if (_local2 !== _arg1){
this._3226745icon = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "icon", _local2, _arg1));
};
}
public function get label():String{
return (this._102727412label);
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get icon():String{
return (this._3226745icon);
}
public function get description():String{
return (this._1724546052description);
}
}
}//package com.facebook.data.stream
Section 180
//CommentsData (com.facebook.data.stream.CommentsData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class CommentsData implements IEventDispatcher {
private var _126536785can_post:Boolean;
private var _bindingEventDispatcher:EventDispatcher;
private var _1294922797can_remove:Boolean;
private var _94851343count:uint;
private var _106855379posts:Array;
public function CommentsData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get count():uint{
return (this._94851343count);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get posts():Array{
return (this._106855379posts);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function get can_remove():Boolean{
return (this._1294922797can_remove);
}
public function set can_post(_arg1:Boolean):void{
var _local2:Object = this._126536785can_post;
if (_local2 !== _arg1){
this._126536785can_post = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "can_post", _local2, _arg1));
};
}
public function set count(_arg1:uint):void{
var _local2:Object = this._94851343count;
if (_local2 !== _arg1){
this._94851343count = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "count", _local2, _arg1));
};
}
public function set can_remove(_arg1:Boolean):void{
var _local2:Object = this._1294922797can_remove;
if (_local2 !== _arg1){
this._1294922797can_remove = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "can_remove", _local2, _arg1));
};
}
public function set posts(_arg1:Array):void{
var _local2:Object = this._106855379posts;
if (_local2 !== _arg1){
this._106855379posts = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "posts", _local2, _arg1));
};
}
public function get can_post():Boolean{
return (this._126536785can_post);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
}
}//package com.facebook.data.stream
Section 181
//FlashMedia (com.facebook.data.stream.FlashMedia)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class FlashMedia implements IEventDispatcher {
private var _1111107765source_url:String;
private var _1290893620preview_img:String;
private var _bindingEventDispatcher:EventDispatcher;
public function FlashMedia(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get source_url():String{
return (this._1111107765source_url);
}
public function get preview_img():String{
return (this._1290893620preview_img);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set preview_img(_arg1:String):void{
var _local2:Object = this._1290893620preview_img;
if (_local2 !== _arg1){
this._1290893620preview_img = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "preview_img", _local2, _arg1));
};
}
public function set source_url(_arg1:String):void{
var _local2:Object = this._1111107765source_url;
if (_local2 !== _arg1){
this._1111107765source_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "source_url", _local2, _arg1));
};
}
}
}//package com.facebook.data.stream
Section 182
//GetCommentsData (com.facebook.data.stream.GetCommentsData)
package com.facebook.data.stream {
import mx.events.*;
import com.facebook.data.*;
public class GetCommentsData extends FacebookData {
private var _602415628comments:Array;
public function set comments(_arg1:Array):void{
var _local2:Object = this._602415628comments;
if (_local2 !== _arg1){
this._602415628comments = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "comments", _local2, _arg1));
};
}
public function get comments():Array{
return (this._602415628comments);
}
}
}//package com.facebook.data.stream
Section 183
//GetFiltersData (com.facebook.data.stream.GetFiltersData)
package com.facebook.data.stream {
import mx.events.*;
import com.facebook.data.*;
public class GetFiltersData extends FacebookData {
private var _854547461filters:StreamFilterCollection;
public function get filters():StreamFilterCollection{
return (this._854547461filters);
}
public function set filters(_arg1:StreamFilterCollection):void{
var _local2:Object = this._854547461filters;
if (_local2 !== _arg1){
this._854547461filters = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "filters", _local2, _arg1));
};
}
}
}//package com.facebook.data.stream
Section 184
//GetStreamData (com.facebook.data.stream.GetStreamData)
package com.facebook.data.stream {
import mx.events.*;
import com.facebook.data.*;
import com.facebook.data.photos.*;
public class GetStreamData extends FacebookData {
private var _1884266413stories:StreamStoryCollection;
private var _1415163932albums:AlbumCollection;
private var _1002263574profiles:ProfileCollection;
public function get albums():AlbumCollection{
return (this._1415163932albums);
}
public function set stories(_arg1:StreamStoryCollection):void{
var _local2:Object = this._1884266413stories;
if (_local2 !== _arg1){
this._1884266413stories = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "stories", _local2, _arg1));
};
}
public function get profiles():ProfileCollection{
return (this._1002263574profiles);
}
public function set albums(_arg1:AlbumCollection):void{
var _local2:Object = this._1415163932albums;
if (_local2 !== _arg1){
this._1415163932albums = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "albums", _local2, _arg1));
};
}
public function get stories():StreamStoryCollection{
return (this._1884266413stories);
}
public function set profiles(_arg1:ProfileCollection):void{
var _local2:Object = this._1002263574profiles;
if (_local2 !== _arg1){
this._1002263574profiles = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "profiles", _local2, _arg1));
};
}
}
}//package com.facebook.data.stream
Section 185
//LikesData (com.facebook.data.stream.LikesData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class LikesData implements IEventDispatcher {
private var _600094315friends:Array;
private var _3211051href:String;
private var _126661978can_like:Boolean;
private var _909675094sample:Array;
private var _94851343count:uint;
private var _bindingEventDispatcher:EventDispatcher;
private var _1928023624user_likes:Boolean;
public function LikesData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set can_like(_arg1:Boolean):void{
var _local2:Object = this._126661978can_like;
if (_local2 !== _arg1){
this._126661978can_like = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "can_like", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function get count():uint{
return (this._94851343count);
}
public function set user_likes(_arg1:Boolean):void{
var _local2:Object = this._1928023624user_likes;
if (_local2 !== _arg1){
this._1928023624user_likes = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "user_likes", _local2, _arg1));
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function set sample(_arg1:Array):void{
var _local2:Object = this._909675094sample;
if (_local2 !== _arg1){
this._909675094sample = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "sample", _local2, _arg1));
};
}
public function get friends():Array{
return (this._600094315friends);
}
public function set href(_arg1:String):void{
var _local2:Object = this._3211051href;
if (_local2 !== _arg1){
this._3211051href = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "href", _local2, _arg1));
};
}
public function get user_likes():Boolean{
return (this._1928023624user_likes);
}
public function set count(_arg1:uint):void{
var _local2:Object = this._94851343count;
if (_local2 !== _arg1){
this._94851343count = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "count", _local2, _arg1));
};
}
public function get can_like():Boolean{
return (this._126661978can_like);
}
public function get sample():Array{
return (this._909675094sample);
}
public function set friends(_arg1:Array):void{
var _local2:Object = this._600094315friends;
if (_local2 !== _arg1){
this._600094315friends = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "friends", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get href():String{
return (this._3211051href);
}
}
}//package com.facebook.data.stream
Section 186
//MusicMedia (com.facebook.data.stream.MusicMedia)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class MusicMedia implements IEventDispatcher {
private var _bindingEventDispatcher:EventDispatcher;
private var _1111107765source_url:String;
private var _110371416title:String;
private var _1409097913artist:String;
public function MusicMedia(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get artist():String{
return (this._1409097913artist);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get source_url():String{
return (this._1111107765source_url);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set artist(_arg1:String):void{
var _local2:Object = this._1409097913artist;
if (_local2 !== _arg1){
this._1409097913artist = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "artist", _local2, _arg1));
};
}
public function set title(_arg1:String):void{
var _local2:Object = this._110371416title;
if (_local2 !== _arg1){
this._110371416title = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "title", _local2, _arg1));
};
}
public function get title():String{
return (this._110371416title);
}
public function set source_url(_arg1:String):void{
var _local2:Object = this._1111107765source_url;
if (_local2 !== _arg1){
this._1111107765source_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "source_url", _local2, _arg1));
};
}
}
}//package com.facebook.data.stream
Section 187
//PhotoMedia (com.facebook.data.stream.PhotoMedia)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class PhotoMedia implements IEventDispatcher {
private var _bindingEventDispatcher:EventDispatcher;
private var _110987pid:String;
private var _100346066index:uint;
private var _96572aid:String;
private var _106164915owner:String;
public function PhotoMedia(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get pid():String{
return (this._110987pid);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get index():uint{
return (this._100346066index);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set pid(_arg1:String):void{
var _local2:Object = this._110987pid;
if (_local2 !== _arg1){
this._110987pid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pid", _local2, _arg1));
};
}
public function set owner(_arg1:String):void{
var _local2:Object = this._106164915owner;
if (_local2 !== _arg1){
this._106164915owner = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "owner", _local2, _arg1));
};
}
public function set index(_arg1:uint):void{
var _local2:Object = this._100346066index;
if (_local2 !== _arg1){
this._100346066index = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "index", _local2, _arg1));
};
}
public function get owner():String{
return (this._106164915owner);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set aid(_arg1:String):void{
var _local2:Object = this._96572aid;
if (_local2 !== _arg1){
this._96572aid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "aid", _local2, _arg1));
};
}
public function get aid():String{
return (this._96572aid);
}
}
}//package com.facebook.data.stream
Section 188
//PostCommentData (com.facebook.data.stream.PostCommentData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class PostCommentData implements IEventDispatcher {
private var _1266097595fromid:String;
private var _3556653text:String;
private var _3560141time:Date;
private var _3355id:String;
private var _bindingEventDispatcher:EventDispatcher;
public function PostCommentData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function get fromid():String{
return (this._1266097595fromid);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set fromid(_arg1:String):void{
var _local2:Object = this._1266097595fromid;
if (_local2 !== _arg1){
this._1266097595fromid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "fromid", _local2, _arg1));
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get time():Date{
return (this._3560141time);
}
public function set time(_arg1:Date):void{
var _local2:Object = this._3560141time;
if (_local2 !== _arg1){
this._3560141time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "time", _local2, _arg1));
};
}
public function get id():String{
return (this._3355id);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set text(_arg1:String):void{
var _local2:Object = this._3556653text;
if (_local2 !== _arg1){
this._3556653text = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "text", _local2, _arg1));
};
}
public function get text():String{
return (this._3556653text);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set id(_arg1:String):void{
var _local2:Object = this._3355id;
if (_local2 !== _arg1){
this._3355id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "id", _local2, _arg1));
};
}
}
}//package com.facebook.data.stream
Section 189
//ProfileCollection (com.facebook.data.stream.ProfileCollection)
package com.facebook.data.stream {
import com.facebook.utils.*;
public class ProfileCollection extends FacebookArrayCollection {
public function ProfileCollection(){
super(null, ProfileData);
}
}
}//package com.facebook.data.stream
Section 190
//ProfileData (com.facebook.data.stream.ProfileData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class ProfileData implements IEventDispatcher {
private var _bindingEventDispatcher:EventDispatcher;
private var _116079url:String;
private var _3373707name:String;
private var _1214494066pic_square:String;
private var _3355id:String;
public function ProfileData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function get id():String{
return (this._3355id);
}
public function set url(_arg1:String):void{
var _local2:Object = this._116079url;
if (_local2 !== _arg1){
this._116079url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "url", _local2, _arg1));
};
}
public function set pic_square(_arg1:String):void{
var _local2:Object = this._1214494066pic_square;
if (_local2 !== _arg1){
this._1214494066pic_square = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_square", _local2, _arg1));
};
}
public function get url():String{
return (this._116079url);
}
public function get pic_square():String{
return (this._1214494066pic_square);
}
public function set id(_arg1:String):void{
var _local2:Object = this._3355id;
if (_local2 !== _arg1){
this._3355id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "id", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
}
}//package com.facebook.data.stream
Section 191
//StreamFilterCollection (com.facebook.data.stream.StreamFilterCollection)
package com.facebook.data.stream {
import com.facebook.utils.*;
public class StreamFilterCollection extends FacebookArrayCollection {
public function StreamFilterCollection(){
super(null, StreamFilterData);
}
}
}//package com.facebook.data.stream
Section 192
//StreamFilterData (com.facebook.data.stream.StreamFilterData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class StreamFilterData implements IEventDispatcher {
private var _737588055icon_url:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _3373707name:String;
private var _1967053405is_visible:Boolean;
private var _3575610type:String;
private var _115792uid:String;
private var _1552737000filter_key:String;
private var _3492908rank:uint;
private var _111972721value:String;
public function StreamFilterData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function set is_visible(_arg1:Boolean):void{
var _local2:Object = this._1967053405is_visible;
if (_local2 !== _arg1){
this._1967053405is_visible = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "is_visible", _local2, _arg1));
};
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get type():String{
return (this._3575610type);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set icon_url(_arg1:String):void{
var _local2:Object = this._737588055icon_url;
if (_local2 !== _arg1){
this._737588055icon_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "icon_url", _local2, _arg1));
};
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function get filter_key():String{
return (this._1552737000filter_key);
}
public function set rank(_arg1:uint):void{
var _local2:Object = this._3492908rank;
if (_local2 !== _arg1){
this._3492908rank = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "rank", _local2, _arg1));
};
}
public function set uid(_arg1:String):void{
var _local2:Object = this._115792uid;
if (_local2 !== _arg1){
this._115792uid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid", _local2, _arg1));
};
}
public function set value(_arg1:String):void{
var _local2:Object = this._111972721value;
if (_local2 !== _arg1){
this._111972721value = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "value", _local2, _arg1));
};
}
public function get is_visible():Boolean{
return (this._1967053405is_visible);
}
public function get icon_url():String{
return (this._737588055icon_url);
}
public function set filter_key(_arg1:String):void{
var _local2:Object = this._1552737000filter_key;
if (_local2 !== _arg1){
this._1552737000filter_key = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "filter_key", _local2, _arg1));
};
}
public function get value():String{
return (this._111972721value);
}
public function get uid():String{
return (this._115792uid);
}
public function get rank():uint{
return (this._3492908rank);
}
}
}//package com.facebook.data.stream
Section 193
//StreamMediaData (com.facebook.data.stream.StreamMediaData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class StreamMediaData implements IEventDispatcher {
private var _104263205music:MusicMedia;
private var _3575610type:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _96681alt:String;
private var _3211051href:String;
private var _106642994photo:PhotoMedia;
private var _114148src:String;
private var _112202875video:VideoMedia;
private var _97513456flash:FlashMedia;
public function StreamMediaData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get video():VideoMedia{
return (this._112202875video);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function toString():String{
return ([("type: " + type), ("href: " + href), ("src: " + src), ("alt: " + alt), ("photo: " + photo), ("video: " + video), ("flash: " + flash)].join(": "));
}
public function set photo(_arg1:PhotoMedia):void{
var _local2:Object = this._106642994photo;
if (_local2 !== _arg1){
this._106642994photo = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "photo", _local2, _arg1));
};
}
public function set music(_arg1:MusicMedia):void{
var _local2:Object = this._104263205music;
if (_local2 !== _arg1){
this._104263205music = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "music", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set src(_arg1:String):void{
var _local2:Object = this._114148src;
if (_local2 !== _arg1){
this._114148src = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "src", _local2, _arg1));
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function set alt(_arg1:String):void{
var _local2:Object = this._96681alt;
if (_local2 !== _arg1){
this._96681alt = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "alt", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set href(_arg1:String):void{
var _local2:Object = this._3211051href;
if (_local2 !== _arg1){
this._3211051href = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "href", _local2, _arg1));
};
}
public function get music():MusicMedia{
return (this._104263205music);
}
public function set flash(_arg1:FlashMedia):void{
var _local2:Object = this._97513456flash;
if (_local2 !== _arg1){
this._97513456flash = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "flash", _local2, _arg1));
};
}
public function get alt():String{
return (this._96681alt);
}
public function get href():String{
return (this._3211051href);
}
public function get flash():FlashMedia{
return (this._97513456flash);
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function set video(_arg1:VideoMedia):void{
var _local2:Object = this._112202875video;
if (_local2 !== _arg1){
this._112202875video = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "video", _local2, _arg1));
};
}
public function get photo():PhotoMedia{
return (this._106642994photo);
}
public function get type():String{
return (this._3575610type);
}
public function get src():String{
return (this._114148src);
}
}
}//package com.facebook.data.stream
Section 194
//StreamStoryCollection (com.facebook.data.stream.StreamStoryCollection)
package com.facebook.data.stream {
import com.facebook.utils.*;
public class StreamStoryCollection extends FacebookArrayCollection {
public function StreamStoryCollection(){
super(null, StreamStoryData);
}
}
}//package com.facebook.data.stream
Section 195
//StreamStoryData (com.facebook.data.stream.StreamStoryData)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class StreamStoryData implements IEventDispatcher {
private var _1650554971actor_id:String;
private var _954925063message:String;
private var _3575610type:uint;
private var _314498168privacy:String;
private var _753448353is_hidden:Boolean;
private var _1698410561source_id:String;
private var _668433131permalink:String;
private var _bindingEventDispatcher:EventDispatcher;
private var _1963501277attachment:AttachmentData;
private var _815576439target_id:String;
private var _2003148228created_time:Date;
private var _1698418180sourceXML:XML;
private var _1411074055app_id:String;
private var _391211750post_id:String;
private var _602415628comments:CommentsData;
private var _102974396likes:LikesData;
private var _450004177metadata:Object;
private var _309882753attribution:String;
private var _472881199updated_time:Date;
private var _1552737000filter_key:String;
private var _1843998832action_links:Array;
private var _1567543704viewer_id:String;
public function StreamStoryData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function set attribution(_arg1:String):void{
var _local2:Object = this._309882753attribution;
if (_local2 !== _arg1){
this._309882753attribution = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "attribution", _local2, _arg1));
};
}
public function get message():String{
return (this._954925063message);
}
public function set created_time(_arg1:Date):void{
var _local2:Object = this._2003148228created_time;
if (_local2 !== _arg1){
this._2003148228created_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "created_time", _local2, _arg1));
};
}
public function get target_id():String{
return (this._815576439target_id);
}
public function get sourceXML():XML{
return (this._1698418180sourceXML);
}
public function get privacy():String{
return (this._314498168privacy);
}
public function set target_id(_arg1:String):void{
var _local2:Object = this._815576439target_id;
if (_local2 !== _arg1){
this._815576439target_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "target_id", _local2, _arg1));
};
}
public function set message(_arg1:String):void{
var _local2:Object = this._954925063message;
if (_local2 !== _arg1){
this._954925063message = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "message", _local2, _arg1));
};
}
public function get filter_key():String{
return (this._1552737000filter_key);
}
public function get post_id():String{
return (this._391211750post_id);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get comments():CommentsData{
return (this._602415628comments);
}
public function get actor_id():String{
return (this._1650554971actor_id);
}
public function set privacy(_arg1:String):void{
var _local2:Object = this._314498168privacy;
if (_local2 !== _arg1){
this._314498168privacy = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "privacy", _local2, _arg1));
};
}
public function get attachment():AttachmentData{
return (this._1963501277attachment);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get metadata():Object{
return (this._450004177metadata);
}
public function set filter_key(_arg1:String):void{
var _local2:Object = this._1552737000filter_key;
if (_local2 !== _arg1){
this._1552737000filter_key = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "filter_key", _local2, _arg1));
};
}
public function set updated_time(_arg1:Date):void{
var _local2:Object = this._472881199updated_time;
if (_local2 !== _arg1){
this._472881199updated_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "updated_time", _local2, _arg1));
};
}
public function set post_id(_arg1:String):void{
var _local2:Object = this._391211750post_id;
if (_local2 !== _arg1){
this._391211750post_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "post_id", _local2, _arg1));
};
}
public function get type():uint{
return (this._3575610type);
}
public function get likes():LikesData{
return (this._102974396likes);
}
public function get source_id():String{
return (this._1698410561source_id);
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get created_time():Date{
return (this._2003148228created_time);
}
public function set actor_id(_arg1:String):void{
var _local2:Object = this._1650554971actor_id;
if (_local2 !== _arg1){
this._1650554971actor_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "actor_id", _local2, _arg1));
};
}
public function set sourceXML(_arg1:XML):void{
var _local2:Object = this._1698418180sourceXML;
if (_local2 !== _arg1){
this._1698418180sourceXML = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "sourceXML", _local2, _arg1));
};
}
public function set viewer_id(_arg1:String):void{
var _local2:Object = this._1567543704viewer_id;
if (_local2 !== _arg1){
this._1567543704viewer_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "viewer_id", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set permalink(_arg1:String):void{
var _local2:Object = this._668433131permalink;
if (_local2 !== _arg1){
this._668433131permalink = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "permalink", _local2, _arg1));
};
}
public function get updated_time():Date{
return (this._472881199updated_time);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function set attachment(_arg1:AttachmentData):void{
var _local2:Object = this._1963501277attachment;
if (_local2 !== _arg1){
this._1963501277attachment = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "attachment", _local2, _arg1));
};
}
public function set is_hidden(_arg1:Boolean):void{
var _local2:Object = this._753448353is_hidden;
if (_local2 !== _arg1){
this._753448353is_hidden = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "is_hidden", _local2, _arg1));
};
}
public function set metadata(_arg1:Object):void{
var _local2:Object = this._450004177metadata;
if (_local2 !== _arg1){
this._450004177metadata = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "metadata", _local2, _arg1));
};
}
public function get is_hidden():Boolean{
return (this._753448353is_hidden);
}
public function set action_links(_arg1:Array):void{
var _local2:Object = this._1843998832action_links;
if (_local2 !== _arg1){
this._1843998832action_links = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "action_links", _local2, _arg1));
};
}
public function get permalink():String{
return (this._668433131permalink);
}
public function get viewer_id():String{
return (this._1567543704viewer_id);
}
public function get action_links():Array{
return (this._1843998832action_links);
}
public function set app_id(_arg1:String):void{
var _local2:Object = this._1411074055app_id;
if (_local2 !== _arg1){
this._1411074055app_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "app_id", _local2, _arg1));
};
}
public function set comments(_arg1:CommentsData):void{
var _local2:Object = this._602415628comments;
if (_local2 !== _arg1){
this._602415628comments = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "comments", _local2, _arg1));
};
}
public function set likes(_arg1:LikesData):void{
var _local2:Object = this._102974396likes;
if (_local2 !== _arg1){
this._102974396likes = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "likes", _local2, _arg1));
};
}
public function get app_id():String{
return (this._1411074055app_id);
}
public function set type(_arg1:uint):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function set source_id(_arg1:String):void{
var _local2:Object = this._1698410561source_id;
if (_local2 !== _arg1){
this._1698410561source_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "source_id", _local2, _arg1));
};
}
public function get attribution():String{
return (this._309882753attribution);
}
}
}//package com.facebook.data.stream
Section 196
//VideoMedia (com.facebook.data.stream.VideoMedia)
package com.facebook.data.stream {
import flash.events.*;
import mx.events.*;
public class VideoMedia implements IEventDispatcher {
private var _1714674802display_url:String;
private var _1111107765source_url:String;
private var _106164915owner:String;
private var _668433131permalink:String;
private var _1290893620preview_img:String;
private var _bindingEventDispatcher:EventDispatcher;
public function VideoMedia(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get source_url():String{
return (this._1111107765source_url);
}
public function get preview_img():String{
return (this._1290893620preview_img);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set source_url(_arg1:String):void{
var _local2:Object = this._1111107765source_url;
if (_local2 !== _arg1){
this._1111107765source_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "source_url", _local2, _arg1));
};
}
public function set preview_img(_arg1:String):void{
var _local2:Object = this._1290893620preview_img;
if (_local2 !== _arg1){
this._1290893620preview_img = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "preview_img", _local2, _arg1));
};
}
public function set permalink(_arg1:String):void{
var _local2:Object = this._668433131permalink;
if (_local2 !== _arg1){
this._668433131permalink = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "permalink", _local2, _arg1));
};
}
public function set display_url(_arg1:String):void{
var _local2:Object = this._1714674802display_url;
if (_local2 !== _arg1){
this._1714674802display_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "display_url", _local2, _arg1));
};
}
public function get permalink():String{
return (this._668433131permalink);
}
public function get display_url():String{
return (this._1714674802display_url);
}
public function get owner():String{
return (this._106164915owner);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set owner(_arg1:String):void{
var _local2:Object = this._106164915owner;
if (_local2 !== _arg1){
this._106164915owner = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "owner", _local2, _arg1));
};
}
}
}//package com.facebook.data.stream
Section 197
//AffiliationCollection (com.facebook.data.users.AffiliationCollection)
package com.facebook.data.users {
import com.facebook.utils.*;
public class AffiliationCollection extends FacebookArrayCollection {
public function AffiliationCollection(){
super(null, AffiliationData);
}
public function addAffiliation(_arg1:AffiliationData):void{
this.addItem(_arg1);
}
}
}//package com.facebook.data.users
Section 198
//AffiliationData (com.facebook.data.users.AffiliationData)
package com.facebook.data.users {
import flash.events.*;
import mx.events.*;
public class AffiliationData implements IEventDispatcher {
private var _892481550status:String;
private var _3575610type:String;
private var _3373707name:String;
private var _3704893year:String;
private var _109065nid:Number;
private var _bindingEventDispatcher:EventDispatcher;
public function AffiliationData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get type():String{
return (this._3575610type);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get nid():Number{
return (this._109065nid);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set nid(_arg1:Number):void{
var _local2:Object = this._109065nid;
if (_local2 !== _arg1){
this._109065nid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "nid", _local2, _arg1));
};
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set status(_arg1:String):void{
var _local2:Object = this._892481550status;
if (_local2 !== _arg1){
this._892481550status = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "status", _local2, _arg1));
};
}
public function get status():String{
return (this._892481550status);
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function set year(_arg1:String):void{
var _local2:Object = this._3704893year;
if (_local2 !== _arg1){
this._3704893year = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "year", _local2, _arg1));
};
}
public function get year():String{
return (this._3704893year);
}
}
}//package com.facebook.data.users
Section 199
//FacebookUser (com.facebook.data.users.FacebookUser)
package com.facebook.data.users {
import mx.events.*;
import com.facebook.data.*;
public class FacebookUser extends FacebookData {
private var _160985414first_name:String;// = ""
private var _1194426210hs_info:String;
private var _1458126743pic_small_with_logo:String;
private var _113766sex:String;
private var _2076227591timezone:int;
private var _883056542meeting_sex:Array;
private var _213573361pic_with_logo:String;
private var _578385717pic_big:String;
private var _883068731meeting_for:Array;
private var _948399753quotes:String;
private var _2013122196last_name:String;// = ""
private var _1391670531education_history:Array;
private var _178029017profile_url:String;
private var _2082876945notes_count:int;
private var _1807033469affiliations:Array;
private var _1068259517movies:String;
private var _1678075120pic_big_with_logo:String;
private var _547435215religion:String;
private var _1762076142pic_small:String;
private var _1341293220hs1_name:String;
private var _432843422is_app_user:Boolean;
private var _1168278276isLoggedInUser:Boolean;
private var _1126443963current_location:FacebookLocation;
private var _1369922371hs2_name:String;
private var _96619420email:String;
private var _776713425networkAffiliations:Array;
private var _2002886397has_added_app:Boolean;
private var _104263205music:String;
private var _2512963hometown_location:FacebookLocation;
private var _2025166887relationship_status:String;
private var _1214494066pic_square:String;
private var _1209746477hs2_id:int;
private var _1069376125birthday:String;
private var _3714tv:String;
private var _1478774426work_history:Array;
private var _1413913325profile_update_time:Date;
private var _1097462182locale:String;
private var _103846849email_hashes:Array;
private var _892481550status:StatusData;
private var _3373707name:String;// = ""
private var _1182884599pic_square_with_logo:String;
private var _115792uid:String;
private var _1209776268hs1_id:int;
private var _210452739political:String;
private var _110986pic:String;
private var _172288934proxied_email:String;
private var _1524435058grad_year:String;
private var _1332014026significant_other_id:int;
private var _2048605165activities:String;
private var _2059518005birthdayDate:Date;
private var _93921962books:String;
private var _2013968806wall_count:int;
private var _1619363722about_me:String;
private var _502611593interests:String;
public function FacebookUser():void{
}
public function get timezone():int{
return (this._2076227591timezone);
}
public function set education_history(_arg1:Array):void{
var _local2:Object = this._1391670531education_history;
if (_local2 !== _arg1){
this._1391670531education_history = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "education_history", _local2, _arg1));
};
}
public function set has_added_app(_arg1:Boolean):void{
var _local2:Object = this._2002886397has_added_app;
if (_local2 !== _arg1){
this._2002886397has_added_app = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "has_added_app", _local2, _arg1));
};
}
public function get pic_small():String{
return (this._1762076142pic_small);
}
public function get notes_count():int{
return (this._2082876945notes_count);
}
public function set pic_small(_arg1:String):void{
var _local2:Object = this._1762076142pic_small;
if (_local2 !== _arg1){
this._1762076142pic_small = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_small", _local2, _arg1));
};
}
public function get music():String{
return (this._104263205music);
}
public function set pic_big_with_logo(_arg1:String):void{
var _local2:Object = this._1678075120pic_big_with_logo;
if (_local2 !== _arg1){
this._1678075120pic_big_with_logo = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_big_with_logo", _local2, _arg1));
};
}
public function set notes_count(_arg1:int):void{
var _local2:Object = this._2082876945notes_count;
if (_local2 !== _arg1){
this._2082876945notes_count = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "notes_count", _local2, _arg1));
};
}
public function set pic_with_logo(_arg1:String):void{
var _local2:Object = this._213573361pic_with_logo;
if (_local2 !== _arg1){
this._213573361pic_with_logo = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_with_logo", _local2, _arg1));
};
}
public function get significant_other_id():int{
return (this._1332014026significant_other_id);
}
public function get email_hashes():Array{
return (this._103846849email_hashes);
}
public function get hometown_location():FacebookLocation{
return (this._2512963hometown_location);
}
public function set music(_arg1:String):void{
var _local2:Object = this._104263205music;
if (_local2 !== _arg1){
this._104263205music = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "music", _local2, _arg1));
};
}
public function get uid():String{
return (this._115792uid);
}
public function get wall_count():int{
return (this._2013968806wall_count);
}
public function get proxied_email():String{
return (this._172288934proxied_email);
}
public function set religion(_arg1:String):void{
var _local2:Object = this._547435215religion;
if (_local2 !== _arg1){
this._547435215religion = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "religion", _local2, _arg1));
};
}
public function get sex():String{
return (this._113766sex);
}
public function set significant_other_id(_arg1:int):void{
var _local2:Object = this._1332014026significant_other_id;
if (_local2 !== _arg1){
this._1332014026significant_other_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "significant_other_id", _local2, _arg1));
};
}
public function get meeting_sex():Array{
return (this._883056542meeting_sex);
}
public function get locale():String{
return (this._1097462182locale);
}
public function get birthday():String{
return (this._1069376125birthday);
}
public function get tv():String{
return (this._3714tv);
}
public function set email_hashes(_arg1:Array):void{
var _local2:Object = this._103846849email_hashes;
if (_local2 !== _arg1){
this._103846849email_hashes = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "email_hashes", _local2, _arg1));
};
}
public function get interests():String{
return (this._502611593interests);
}
public function get name():String{
return (this._3373707name);
}
public function set movies(_arg1:String):void{
var _local2:Object = this._1068259517movies;
if (_local2 !== _arg1){
this._1068259517movies = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "movies", _local2, _arg1));
};
}
public function get last_name():String{
return (this._2013122196last_name);
}
public function get is_app_user():Boolean{
return (this._432843422is_app_user);
}
public function get hs1_name():String{
return (this._1341293220hs1_name);
}
public function set uid(_arg1:String):void{
var _local2:Object = this._115792uid;
if (_local2 !== _arg1){
this._115792uid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid", _local2, _arg1));
};
}
public function set hometown_location(_arg1:FacebookLocation):void{
var _local2:Object = this._2512963hometown_location;
if (_local2 !== _arg1){
this._2512963hometown_location = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hometown_location", _local2, _arg1));
};
}
public function set hs2_name(_arg1:String):void{
var _local2:Object = this._1369922371hs2_name;
if (_local2 !== _arg1){
this._1369922371hs2_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hs2_name", _local2, _arg1));
};
}
public function set wall_count(_arg1:int):void{
var _local2:Object = this._2013968806wall_count;
if (_local2 !== _arg1){
this._2013968806wall_count = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "wall_count", _local2, _arg1));
};
}
public function get books():String{
return (this._93921962books);
}
public function get first_name():String{
return (this._160985414first_name);
}
public function set proxied_email(_arg1:String):void{
var _local2:Object = this._172288934proxied_email;
if (_local2 !== _arg1){
this._172288934proxied_email = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "proxied_email", _local2, _arg1));
};
}
public function set locale(_arg1:String):void{
var _local2:Object = this._1097462182locale;
if (_local2 !== _arg1){
this._1097462182locale = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "locale", _local2, _arg1));
};
}
public function set meeting_sex(_arg1:Array):void{
var _local2:Object = this._883056542meeting_sex;
if (_local2 !== _arg1){
this._883056542meeting_sex = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "meeting_sex", _local2, _arg1));
};
}
public function get meeting_for():Array{
return (this._883068731meeting_for);
}
public function get pic_big():String{
return (this._578385717pic_big);
}
public function set work_history(_arg1:Array):void{
var _local2:Object = this._1478774426work_history;
if (_local2 !== _arg1){
this._1478774426work_history = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "work_history", _local2, _arg1));
};
}
public function get networkAffiliations():Array{
return (this._776713425networkAffiliations);
}
public function set sex(_arg1:String):void{
var _local2:Object = this._113766sex;
if (_local2 !== _arg1){
this._113766sex = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "sex", _local2, _arg1));
};
}
public function set pic_square(_arg1:String):void{
var _local2:Object = this._1214494066pic_square;
if (_local2 !== _arg1){
this._1214494066pic_square = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_square", _local2, _arg1));
};
}
public function set hs_info(_arg1:String):void{
var _local2:Object = this._1194426210hs_info;
if (_local2 !== _arg1){
this._1194426210hs_info = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hs_info", _local2, _arg1));
};
}
public function set hs1_id(_arg1:int):void{
var _local2:Object = this._1209776268hs1_id;
if (_local2 !== _arg1){
this._1209776268hs1_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hs1_id", _local2, _arg1));
};
}
public function get profile_update_time():Date{
return (this._1413913325profile_update_time);
}
public function set quotes(_arg1:String):void{
var _local2:Object = this._948399753quotes;
if (_local2 !== _arg1){
this._948399753quotes = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "quotes", _local2, _arg1));
};
}
public function get pic_square_with_logo():String{
return (this._1182884599pic_square_with_logo);
}
public function set birthday(_arg1:String):void{
var _local2:Object = this._1069376125birthday;
if (_local2 !== _arg1){
this._1069376125birthday = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "birthday", _local2, _arg1));
};
}
public function get isLoggedInUser():Boolean{
return (this._1168278276isLoggedInUser);
}
public function get political():String{
return (this._210452739political);
}
public function set tv(_arg1:String):void{
var _local2:Object = this._3714tv;
if (_local2 !== _arg1){
this._3714tv = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "tv", _local2, _arg1));
};
}
public function set affiliations(_arg1:Array):void{
var _local2:Object = this._1807033469affiliations;
if (_local2 !== _arg1){
this._1807033469affiliations = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "affiliations", _local2, _arg1));
};
}
public function get pic_with_logo():String{
return (this._213573361pic_with_logo);
}
public function set interests(_arg1:String):void{
var _local2:Object = this._502611593interests;
if (_local2 !== _arg1){
this._502611593interests = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "interests", _local2, _arg1));
};
}
public function get education_history():Array{
return (this._1391670531education_history);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function get pic_big_with_logo():String{
return (this._1678075120pic_big_with_logo);
}
public function set pic(_arg1:String):void{
var _local2:Object = this._110986pic;
if (_local2 !== _arg1){
this._110986pic = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic", _local2, _arg1));
};
}
public function get has_added_app():Boolean{
return (this._2002886397has_added_app);
}
public function set last_name(_arg1:String):void{
var _local2:Object = this._2013122196last_name;
if (_local2 !== _arg1){
this._2013122196last_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "last_name", _local2, _arg1));
};
}
public function set grad_year(_arg1:String):void{
var _local2:Object = this._1524435058grad_year;
if (_local2 !== _arg1){
this._1524435058grad_year = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "grad_year", _local2, _arg1));
};
}
public function set pic_small_with_logo(_arg1:String):void{
var _local2:Object = this._1458126743pic_small_with_logo;
if (_local2 !== _arg1){
this._1458126743pic_small_with_logo = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_small_with_logo", _local2, _arg1));
};
}
public function get religion():String{
return (this._547435215religion);
}
public function set email(_arg1:String):void{
var _local2:Object = this._96619420email;
if (_local2 !== _arg1){
this._96619420email = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "email", _local2, _arg1));
};
}
public function set is_app_user(_arg1:Boolean):void{
var _local2:Object = this._432843422is_app_user;
if (_local2 !== _arg1){
this._432843422is_app_user = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "is_app_user", _local2, _arg1));
};
}
public function set about_me(_arg1:String):void{
var _local2:Object = this._1619363722about_me;
if (_local2 !== _arg1){
this._1619363722about_me = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "about_me", _local2, _arg1));
};
}
public function set hs1_name(_arg1:String):void{
var _local2:Object = this._1341293220hs1_name;
if (_local2 !== _arg1){
this._1341293220hs1_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hs1_name", _local2, _arg1));
};
}
public function get movies():String{
return (this._1068259517movies);
}
public function get hs2_name():String{
return (this._1369922371hs2_name);
}
public function set books(_arg1:String):void{
var _local2:Object = this._93921962books;
if (_local2 !== _arg1){
this._93921962books = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "books", _local2, _arg1));
};
}
public function get work_history():Array{
return (this._1478774426work_history);
}
public function get hs_info():String{
return (this._1194426210hs_info);
}
public function get pic_square():String{
return (this._1214494066pic_square);
}
public function set first_name(_arg1:String):void{
var _local2:Object = this._160985414first_name;
if (_local2 !== _arg1){
this._160985414first_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "first_name", _local2, _arg1));
};
}
public function set current_location(_arg1:FacebookLocation):void{
var _local2:Object = this._1126443963current_location;
if (_local2 !== _arg1){
this._1126443963current_location = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "current_location", _local2, _arg1));
};
}
public function get hs1_id():int{
return (this._1209776268hs1_id);
}
public function get affiliations():Array{
return (this._1807033469affiliations);
}
public function get quotes():String{
return (this._948399753quotes);
}
public function get grad_year():String{
return (this._1524435058grad_year);
}
public function get pic_small_with_logo():String{
return (this._1458126743pic_small_with_logo);
}
public function get pic():String{
return (this._110986pic);
}
public function get email():String{
return (this._96619420email);
}
public function set pic_big(_arg1:String):void{
var _local2:Object = this._578385717pic_big;
if (_local2 !== _arg1){
this._578385717pic_big = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_big", _local2, _arg1));
};
}
public function set networkAffiliations(_arg1:Array):void{
var _local2:Object = this._776713425networkAffiliations;
if (_local2 !== _arg1){
this._776713425networkAffiliations = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "networkAffiliations", _local2, _arg1));
};
}
public function set birthdayDate(_arg1:Date):void{
var _local2:Object = this._2059518005birthdayDate;
if (_local2 !== _arg1){
this._2059518005birthdayDate = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "birthdayDate", _local2, _arg1));
};
}
public function set hs2_id(_arg1:int):void{
var _local2:Object = this._1209746477hs2_id;
if (_local2 !== _arg1){
this._1209746477hs2_id = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "hs2_id", _local2, _arg1));
};
}
public function get about_me():String{
return (this._1619363722about_me);
}
public function set relationship_status(_arg1:String):void{
var _local2:Object = this._2025166887relationship_status;
if (_local2 !== _arg1){
this._2025166887relationship_status = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "relationship_status", _local2, _arg1));
};
}
public function set meeting_for(_arg1:Array):void{
var _local2:Object = this._883068731meeting_for;
if (_local2 !== _arg1){
this._883068731meeting_for = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "meeting_for", _local2, _arg1));
};
}
public function set profile_url(_arg1:String):void{
var _local2:Object = this._178029017profile_url;
if (_local2 !== _arg1){
this._178029017profile_url = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "profile_url", _local2, _arg1));
};
}
public function get current_location():FacebookLocation{
return (this._1126443963current_location);
}
public function get birthdayDate():Date{
return (this._2059518005birthdayDate);
}
public function get hs2_id():int{
return (this._1209746477hs2_id);
}
public function get relationship_status():String{
return (this._2025166887relationship_status);
}
public function set profile_update_time(_arg1:Date):void{
var _local2:Object = this._1413913325profile_update_time;
if (_local2 !== _arg1){
this._1413913325profile_update_time = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "profile_update_time", _local2, _arg1));
};
}
public function get profile_url():String{
return (this._178029017profile_url);
}
public function set activities(_arg1:String):void{
var _local2:Object = this._2048605165activities;
if (_local2 !== _arg1){
this._2048605165activities = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "activities", _local2, _arg1));
};
}
public function set status(_arg1:StatusData):void{
var _local2:Object = this._892481550status;
if (_local2 !== _arg1){
this._892481550status = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "status", _local2, _arg1));
};
}
public function get activities():String{
return (this._2048605165activities);
}
public function set pic_square_with_logo(_arg1:String):void{
var _local2:Object = this._1182884599pic_square_with_logo;
if (_local2 !== _arg1){
this._1182884599pic_square_with_logo = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "pic_square_with_logo", _local2, _arg1));
};
}
public function set timezone(_arg1:int):void{
var _local2:Object = this._2076227591timezone;
if (_local2 !== _arg1){
this._2076227591timezone = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "timezone", _local2, _arg1));
};
}
public function set isLoggedInUser(_arg1:Boolean):void{
var _local2:Object = this._1168278276isLoggedInUser;
if (_local2 !== _arg1){
this._1168278276isLoggedInUser = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "isLoggedInUser", _local2, _arg1));
};
}
public function get status():StatusData{
return (this._892481550status);
}
public function set political(_arg1:String):void{
var _local2:Object = this._210452739political;
if (_local2 !== _arg1){
this._210452739political = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "political", _local2, _arg1));
};
}
}
}//package com.facebook.data.users
Section 200
//FacebookUserCollection (com.facebook.data.users.FacebookUserCollection)
package com.facebook.data.users {
import com.facebook.utils.*;
public class FacebookUserCollection extends FacebookArrayCollection {
public function FacebookUserCollection(){
super(null, FacebookUser);
}
public function getUserById(_arg1:String):FacebookUser{
return ((findItemByProperty("uid", _arg1) as FacebookUser));
}
public function addUser(_arg1:FacebookUser):void{
addItem(_arg1);
}
}
}//package com.facebook.data.users
Section 201
//GetInfoData (com.facebook.data.users.GetInfoData)
package com.facebook.data.users {
import mx.events.*;
import com.facebook.data.*;
public class GetInfoData extends FacebookData {
private var _986811191userCollection:FacebookUserCollection;
public function get userCollection():FacebookUserCollection{
return (this._986811191userCollection);
}
public function set userCollection(_arg1:FacebookUserCollection):void{
var _local2:Object = this._986811191userCollection;
if (_local2 !== _arg1){
this._986811191userCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "userCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.users
Section 202
//GetInfoFieldValues (com.facebook.data.users.GetInfoFieldValues)
package com.facebook.data.users {
import flash.events.*;
public class GetInfoFieldValues implements IEventDispatcher {
private var _bindingEventDispatcher:EventDispatcher;
public static const TIMEZONE:String = "timezone";
public static const TV:String = "tv";
public static const AFFILIATIONS:String = "affiliations";
public static const MEETING_FOR:String = "meeting_for";
public static const BOOKS:String = "books";
public static const PIC_BIG:String = "pic_big";
public static const MUSIC:String = "music";
public static const NAME:String = "name";
public static const PIC_SQUARE_WITH_LOGO:String = "pic_square_with_logo";
public static const LAST_NAME:String = "last_name";
public static const PIC_SQUARE:String = "pic_square";
public static const HAS_ADDED_APP:String = "has_added_app";
public static const ALL_VALUES:Array = [ABOUT_ME, ACTIVITIES, AFFILIATIONS, BIRTHDAY, BOOKS, CURRENT_LOCATION, EDUCATION_HISTORY, EMAIL_HASHES, FIRST_NAME, HAS_ADDED_APP, HOMETOWN_LOCATION, HS_INFO, INTERESTS, IS_APP_USER, LAST_NAME, LOCALE, MEETING_FOR, MEETING_SEX, MOVIES, MUSIC, NAME, NOTES_COUNT, PIC, PIC_WITH_LOGO, PIC_BIG, PIC_BIG_WITH_LOGO, PIC_SMALL, PIC_SMALL_WITH_LOGO, PIC_SQUARE, PIC_SQUARE_WITH_LOGO, POLITICAL, PROFILE_UPDATE_TIME, PROFILE_URL, PROXIED_EMAIL, QUOTES, RELATIONSHIP_STATUS, RELIGION, SEX, SIGNIFICANT_OTHER_ID, STATUS, TIMEZONE, TV, WALL_COUNT, WORK_HISTORY];
public static const ABOUT_ME:String = "about_me";
public static const MEETING_SEX:String = "meeting_sex";
public static const RELIGION:String = "religion";
public static const PROXIED_EMAIL:String = "proxied_email";
public static const EDUCATION_HISTORY:String = "education_history";
public static const IS_APP_USER:String = "is_app_user";
public static const HOMETOWN_LOCATION:String = "hometown_location";
public static const PROFILE_URL:String = "profile_url";
public static const WALL_COUNT:String = "wall_count";
public static const MOVIES:String = "movies";
public static const PROFILE_UPDATE_TIME:String = "profile_update_time";
public static const PIC_BIG_WITH_LOGO:String = "pic_big_with_logo";
public static const NOTES_COUNT:String = "notes_count";
public static const SEX:String = "sex";
public static const PIC_SMALL_WITH_LOGO:String = "pic_small_with_logo";
public static const NO_SESSION_VALUES:Array = [FIRST_NAME, LAST_NAME, NAME, LOCALE, AFFILIATIONS, PIC_SQUARE, PROFILE_URL];
public static const PIC_SMALL:String = "pic_small";
public static const FIRST_NAME:String = "first_name";
public static const CURRENT_LOCATION:String = "current_location";
public static const POLITICAL:String = "political";
public static const EMAIL_HASHES:String = "email_hashes";
public static const RELATIONSHIP_STATUS:String = "relationship_status";
public static const HS_INFO:String = "hs_info";
public static const WORK_HISTORY:String = "work_history";
public static const INTERESTS:String = "interests";
public static const PIC:String = "pic";
public static const ACTIVITIES:String = "activities";
public static const PIC_WITH_LOGO:String = "pic_with_logo";
public static const LOCALE:String = "locale";
public static const SIGNIFICANT_OTHER_ID:String = "significant_other_id";
public static const QUOTES:String = "quotes";
public static const STATUS:String = "status";
public static const BIRTHDAY:String = "birthday";
public function GetInfoFieldValues(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
}
}//package com.facebook.data.users
Section 203
//GetStandardInfoData (com.facebook.data.users.GetStandardInfoData)
package com.facebook.data.users {
import mx.events.*;
import com.facebook.data.*;
public class GetStandardInfoData extends FacebookData {
private var _986811191userCollection:UserCollection;
public function get userCollection():UserCollection{
return (this._986811191userCollection);
}
public function set userCollection(_arg1:UserCollection):void{
var _local2:Object = this._986811191userCollection;
if (_local2 !== _arg1){
this._986811191userCollection = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "userCollection", _local2, _arg1));
};
}
}
}//package com.facebook.data.users
Section 204
//HasAppPermissionValues (com.facebook.data.users.HasAppPermissionValues)
package com.facebook.data.users {
import flash.events.*;
public class HasAppPermissionValues implements IEventDispatcher {
private var _bindingEventDispatcher:EventDispatcher;
public static const CREATE_LISTING:String = "create_listing";
public static const EMAIL:String = "email";
public static const OFFLINE_ACCESS:String = "offline_access";
public static const PHOTO_UPLOAD:String = "photo_upload";
public static const PUBLISH_STREAM:String = "publish_stream";
public static const STATUS_UPDATE:String = "status_update";
public static const CREATE_EVENT:String = "create_event";
public static const SMS:String = "sms";
public static const SHARE_ITEM:String = "share_item";
public static const RSVP_EVENT:String = "rsvp_event";
public function HasAppPermissionValues(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
}
}//package com.facebook.data.users
Section 205
//StatusData (com.facebook.data.users.StatusData)
package com.facebook.data.users {
public class StatusData {
public var time:Date;
public var message:String;
}
}//package com.facebook.data.users
Section 206
//UserCollection (com.facebook.data.users.UserCollection)
package com.facebook.data.users {
import com.facebook.utils.*;
public class UserCollection extends FacebookArrayCollection {
public function UserCollection(_arg1:Array=null){
super(null, UserData);
}
}
}//package com.facebook.data.users
Section 207
//UserData (com.facebook.data.users.UserData)
package com.facebook.data.users {
import flash.events.*;
import mx.events.*;
public class UserData implements IEventDispatcher {
private var _bindingEventDispatcher:EventDispatcher;
private var _160985414first_name:String;
private var _3373707name:String;
private var _2013122196last_name:String;
private var _2076227591timezone:Number;
private var _115792uid:String;
private var _1700293062affiations:AffiliationCollection;
public function UserData(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function set timezone(_arg1:Number):void{
var _local2:Object = this._2076227591timezone;
if (_local2 !== _arg1){
this._2076227591timezone = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "timezone", _local2, _arg1));
};
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get affiations():AffiliationCollection{
return (this._1700293062affiations);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function set affiations(_arg1:AffiliationCollection):void{
var _local2:Object = this._1700293062affiations;
if (_local2 !== _arg1){
this._1700293062affiations = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "affiations", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function get uid():String{
return (this._115792uid);
}
public function get last_name():String{
return (this._2013122196last_name);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set uid(_arg1:String):void{
var _local2:Object = this._115792uid;
if (_local2 !== _arg1){
this._115792uid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "uid", _local2, _arg1));
};
}
public function set last_name(_arg1:String):void{
var _local2:Object = this._2013122196last_name;
if (_local2 !== _arg1){
this._2013122196last_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "last_name", _local2, _arg1));
};
}
public function set first_name(_arg1:String):void{
var _local2:Object = this._160985414first_name;
if (_local2 !== _arg1){
this._160985414first_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "first_name", _local2, _arg1));
};
}
public function get timezone():Number{
return (this._2076227591timezone);
}
public function get first_name():String{
return (this._160985414first_name);
}
public function toString():String{
return ((((((((((((("[ UserData uid: " + uid) + " affiation:") + affiations) + " first_name:") + first_name) + " last_name:") + last_name) + " name:") + name) + " timezone: ") + timezone) + "]"));
}
}
}//package com.facebook.data.users
Section 208
//ArrayResultData (com.facebook.data.ArrayResultData)
package com.facebook.data {
import mx.events.*;
public class ArrayResultData extends FacebookData {
private var _682377174arrayResult:Array;
public function set arrayResult(_arg1:Array):void{
var _local2:Object = this._682377174arrayResult;
if (_local2 !== _arg1){
this._682377174arrayResult = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "arrayResult", _local2, _arg1));
};
}
public function get arrayResult():Array{
return (this._682377174arrayResult);
}
}
}//package com.facebook.data
Section 209
//BooleanResultData (com.facebook.data.BooleanResultData)
package com.facebook.data {
import mx.events.*;
public class BooleanResultData extends FacebookData {
private var _111972721value:Boolean;
public function get value():Boolean{
return (this._111972721value);
}
public function set value(_arg1:Boolean):void{
var _local2:Object = this._111972721value;
if (_local2 !== _arg1){
this._111972721value = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "value", _local2, _arg1));
};
}
}
}//package com.facebook.data
Section 210
//FacebookData (com.facebook.data.FacebookData)
package com.facebook.data {
import flash.events.*;
public class FacebookData extends EventDispatcher {
public var rawResult:String;
}
}//package com.facebook.data
Section 211
//FacebookEducationInfo (com.facebook.data.FacebookEducationInfo)
package com.facebook.data {
import flash.events.*;
import mx.events.*;
public class FacebookEducationInfo implements IEventDispatcher {
private var _3373707name:String;
private var _1335595316degree:String;
private var _3704893year:String;
private var _157624742concentrations:Array;
private var _bindingEventDispatcher:EventDispatcher;
public function FacebookEducationInfo(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
concentrations = [];
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function set concentrations(_arg1:Array):void{
var _local2:Object = this._157624742concentrations;
if (_local2 !== _arg1){
this._157624742concentrations = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "concentrations", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function get degree():String{
return (this._1335595316degree);
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set degree(_arg1:String):void{
var _local2:Object = this._1335595316degree;
if (_local2 !== _arg1){
this._1335595316degree = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "degree", _local2, _arg1));
};
}
public function get concentrations():Array{
return (this._157624742concentrations);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function set year(_arg1:String):void{
var _local2:Object = this._3704893year;
if (_local2 !== _arg1){
this._3704893year = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "year", _local2, _arg1));
};
}
public function get year():String{
return (this._3704893year);
}
}
}//package com.facebook.data
Section 212
//FacebookErrorCodes (com.facebook.data.FacebookErrorCodes)
package com.facebook.data {
public class FacebookErrorCodes {
public static const API_EC_VERSION:Number = 12;
public static const API_EC_PERMISSION_DENIED:Number = 10;
public static const API_EC_HOST_UP:Number = 7;
public static const API_EC_SERVICE:Number = 2;
public static const API_EC_RATE:Number = 9;
public static const API_EC_METHOD:Number = 3;
public static const API_EC_HOST_API:Number = 6;
public static const API_EC_SUCCESS:Number = 0;
public static const SERVER_ERROR:Number = -1;
public static const API_EC_UNKNOWN:Number = 1;
public static const API_EC_DEPRECATED:Number = 11;
public static const API_EC_SECURE:Number = 8;
public static const API_EC_TOO_MANY_CALLS:Number = 4;
public static const API_EC_BAD_IP:Number = 5;
}
}//package com.facebook.data
Section 213
//FacebookLocation (com.facebook.data.FacebookLocation)
package com.facebook.data {
import mx.events.*;
public class FacebookLocation extends FacebookData {
private var _957831062country:String;
private var _3053931city:String;
private var _120609zip:String;
private var _891990013street:String;
private var _109757585state:String;
public function get zip():String{
return (this._120609zip);
}
public function set state(_arg1:String):void{
var _local2:Object = this._109757585state;
if (_local2 !== _arg1){
this._109757585state = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "state", _local2, _arg1));
};
}
public function get street():String{
return (this._891990013street);
}
public function set city(_arg1:String):void{
var _local2:Object = this._3053931city;
if (_local2 !== _arg1){
this._3053931city = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "city", _local2, _arg1));
};
}
public function set street(_arg1:String):void{
var _local2:Object = this._891990013street;
if (_local2 !== _arg1){
this._891990013street = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "street", _local2, _arg1));
};
}
public function set zip(_arg1:String):void{
var _local2:Object = this._120609zip;
if (_local2 !== _arg1){
this._120609zip = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "zip", _local2, _arg1));
};
}
public function get city():String{
return (this._3053931city);
}
public function get country():String{
return (this._957831062country);
}
public function get state():String{
return (this._109757585state);
}
public function set country(_arg1:String):void{
var _local2:Object = this._957831062country;
if (_local2 !== _arg1){
this._957831062country = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "country", _local2, _arg1));
};
}
}
}//package com.facebook.data
Section 214
//FacebookNetwork (com.facebook.data.FacebookNetwork)
package com.facebook.data {
import flash.events.*;
import mx.events.*;
public class FacebookNetwork implements IEventDispatcher {
private var _892481550status:String;
private var _3575610type:String;
private var _3373707name:String;
private var _3704893year:String;
private var _109065nid:int;
private var _bindingEventDispatcher:EventDispatcher;
public function FacebookNetwork(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function get type():String{
return (this._3575610type);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function get nid():int{
return (this._109065nid);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get name():String{
return (this._3373707name);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set nid(_arg1:int):void{
var _local2:Object = this._109065nid;
if (_local2 !== _arg1){
this._109065nid = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "nid", _local2, _arg1));
};
}
public function set name(_arg1:String):void{
var _local2:Object = this._3373707name;
if (_local2 !== _arg1){
this._3373707name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "name", _local2, _arg1));
};
}
public function set status(_arg1:String):void{
var _local2:Object = this._892481550status;
if (_local2 !== _arg1){
this._892481550status = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "status", _local2, _arg1));
};
}
public function get status():String{
return (this._892481550status);
}
public function set type(_arg1:String):void{
var _local2:Object = this._3575610type;
if (_local2 !== _arg1){
this._3575610type = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "type", _local2, _arg1));
};
}
public function set year(_arg1:String):void{
var _local2:Object = this._3704893year;
if (_local2 !== _arg1){
this._3704893year = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "year", _local2, _arg1));
};
}
public function get year():String{
return (this._3704893year);
}
}
}//package com.facebook.data
Section 215
//FacebookWorkInfo (com.facebook.data.FacebookWorkInfo)
package com.facebook.data {
import flash.events.*;
import mx.events.*;
public class FacebookWorkInfo implements IEventDispatcher {
private var _1901043637location:FacebookLocation;
private var _1725067410end_date:Date;
private var _1724546052description:String;
private var _1573629589start_date:Date;
private var _747804969position:String;
private var _1429880077company_name:String;
private var _bindingEventDispatcher:EventDispatcher;
public function FacebookWorkInfo(){
_bindingEventDispatcher = new EventDispatcher(IEventDispatcher(this));
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_bindingEventDispatcher.dispatchEvent(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_bindingEventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function get company_name():String{
return (this._1429880077company_name);
}
public function set end_date(_arg1:Date):void{
var _local2:Object = this._1725067410end_date;
if (_local2 !== _arg1){
this._1725067410end_date = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "end_date", _local2, _arg1));
};
}
public function set position(_arg1:String):void{
var _local2:Object = this._747804969position;
if (_local2 !== _arg1){
this._747804969position = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "position", _local2, _arg1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_bindingEventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function willTrigger(_arg1:String):Boolean{
return (_bindingEventDispatcher.willTrigger(_arg1));
}
public function set start_date(_arg1:Date):void{
var _local2:Object = this._1573629589start_date;
if (_local2 !== _arg1){
this._1573629589start_date = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "start_date", _local2, _arg1));
};
}
public function get end_date():Date{
return (this._1725067410end_date);
}
public function set company_name(_arg1:String):void{
var _local2:Object = this._1429880077company_name;
if (_local2 !== _arg1){
this._1429880077company_name = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "company_name", _local2, _arg1));
};
}
public function get position():String{
return (this._747804969position);
}
public function set location(_arg1:FacebookLocation):void{
var _local2:Object = this._1901043637location;
if (_local2 !== _arg1){
this._1901043637location = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "location", _local2, _arg1));
};
}
public function get start_date():Date{
return (this._1573629589start_date);
}
public function hasEventListener(_arg1:String):Boolean{
return (_bindingEventDispatcher.hasEventListener(_arg1));
}
public function get location():FacebookLocation{
return (this._1901043637location);
}
public function set description(_arg1:String):void{
var _local2:Object = this._1724546052description;
if (_local2 !== _arg1){
this._1724546052description = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "description", _local2, _arg1));
};
}
public function get description():String{
return (this._1724546052description);
}
}
}//package com.facebook.data
Section 216
//FBJSData (com.facebook.data.FBJSData)
package com.facebook.data {
import mx.events.*;
public class FBJSData extends FacebookData {
private var _1097546742results:Array;
public function set results(_arg1:Array):void{
var _local2:Object = this._1097546742results;
if (_local2 !== _arg1){
this._1097546742results = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "results", _local2, _arg1));
};
}
public function get results():Array{
return (this._1097546742results);
}
}
}//package com.facebook.data
Section 217
//JSONResultData (com.facebook.data.JSONResultData)
package com.facebook.data {
import mx.events.*;
public class JSONResultData extends FacebookData {
private var _934426595result:Object;
public function set result(_arg1:Object):void{
var _local2:Object = this._934426595result;
if (_local2 !== _arg1){
this._934426595result = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "result", _local2, _arg1));
};
}
public function get result():Object{
return (this._934426595result);
}
}
}//package com.facebook.data
Section 218
//NumberResultData (com.facebook.data.NumberResultData)
package com.facebook.data {
import mx.events.*;
public class NumberResultData extends FacebookData {
private var _111972721value:Number;
public function get value():Number{
return (this._111972721value);
}
public function set value(_arg1:Number):void{
var _local2:Object = this._111972721value;
if (_local2 !== _arg1){
this._111972721value = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "value", _local2, _arg1));
};
}
}
}//package com.facebook.data
Section 219
//StringResultData (com.facebook.data.StringResultData)
package com.facebook.data {
import mx.events.*;
public class StringResultData extends FacebookData {
private var _111972721value:String;
public function get value():String{
return (this._111972721value);
}
public function set value(_arg1:String):void{
var _local2:Object = this._111972721value;
if (_local2 !== _arg1){
this._111972721value = _arg1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "value", _local2, _arg1));
};
}
}
}//package com.facebook.data
Section 220
//XMLDataParser (com.facebook.data.XMLDataParser)
package com.facebook.data {
import flash.events.*;
import com.facebook.errors.*;
import com.facebook.data.users.*;
import com.facebook.utils.*;
import com.adobe.serialization.json.*;
import com.facebook.data.status.*;
import com.facebook.data.fbml.*;
import com.facebook.data.data.*;
import com.facebook.data.notes.*;
import com.facebook.commands.data.*;
import com.facebook.data.application.*;
import com.facebook.data.feed.*;
import com.facebook.data.admin.*;
import com.facebook.data.events.*;
import com.facebook.data.friends.*;
import com.facebook.data.photos.*;
import com.facebook.data.pages.*;
import com.facebook.data.notifications.*;
import com.facebook.data.groups.*;
import com.facebook.data.auth.*;
import com.facebook.data.batch.*;
public class XMLDataParser implements IFacebookResultParser {
protected var fb_namespace:Namespace;
public function XMLDataParser(){
fb_namespace = new Namespace("http://api.facebook.com/1.0/");
}
protected function parseSendEmail(_arg1:XML):ArrayResultData{
var _local2:ArrayResultData = new ArrayResultData();
_local2.arrayResult = FacebookXMLParserUtils.toArray(_arg1);
return (_local2);
}
protected function parseGetPhotos(_arg1:XML):GetPhotosData{
var _local4:*;
var _local5:PhotoData;
var _local2:GetPhotosData = new GetPhotosData();
var _local3:PhotoCollection = new PhotoCollection();
for each (_local4 in _arg1..fb_namespace::photo) {
_local5 = new PhotoData();
_local5.pid = _local4.fb_namespace::pid;
_local5.aid = _local4.fb_namespace::aid;
_local5.owner = _local4.fb_namespace::owner;
_local5.src = _local4.fb_namespace::src;
_local5.src_big = _local4.fb_namespace::src_big;
_local5.src_small = _local4.fb_namespace::src_small;
_local5.caption = _local4.fb_namespace::caption;
_local5.created = FacebookXMLParserUtils.toDate(_local4.fb_namespace::created);
_local3.addPhoto(_local5);
};
_local2.photoCollection = _local3;
return (_local2);
}
protected function parseGetNotifications(_arg1:XML):GetNotificationData{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:NotificationMessageData;
var _local8:NotificationPokeData;
var _local9:NotificationShareData;
var _local2:GetNotificationData = new GetNotificationData();
var _local3:NotificationCollection = new NotificationCollection();
for each (_local4 in _arg1.fb_namespace::messages) {
_local7 = new NotificationMessageData();
_local7.unread = _local4.fb_namespace::unread;
_local7.most_recent = _local4.fb_namespace::most_recent;
_local3.addItem(_local7);
};
for each (_local5 in _arg1.fb_namespace::pokes) {
_local8 = new NotificationPokeData();
_local8.unread = _local5.fb_namespace::unread;
_local8.most_recent = _local5.fb_namespace::most_recent;
_local3.addItem(_local8);
};
for each (_local6 in _arg1.fb_namespace::shares) {
_local9 = new NotificationShareData();
_local9.unread = _local6.fb_namespace::unread;
_local9.most_recent = _local6.fb_namespace::most_recent;
_local3.addItem(_local9);
};
_local2.friendsRequests = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::friend_requests[0]);
_local2.group_invites = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::group_invites[0]);
_local2.event_invites = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::event_invites[0]);
_local2.notificationCollection = _local3;
return (_local2);
}
public function createFacebookError(_arg1:Object, _arg2:String):FacebookError{
var _local3:FacebookError = new FacebookError();
_local3.rawResult = _arg2;
_local3.errorCode = FacebookErrorCodes.SERVER_ERROR;
if ((_arg1 is Error)){
_local3.error = (_arg1 as Error);
} else {
_local3.errorEvent = (_arg1 as ErrorEvent);
};
return (_local3);
}
protected function getAffiliation(_arg1:XML):AffiliationCollection{
var _local3:*;
var _local4:AffiliationData;
var _local2:AffiliationCollection = new AffiliationCollection();
for each (_local3 in _arg1..fb_namespace::afflication) {
_local4 = new AffiliationData();
_local4.nid = _local3.fb_namespace::nid;
_local4.name = _local3.fb_namespace::name;
_local4.type = _local3.fb_namespace::type;
_local4.status = _local3.fb_namespace::status;
_local4.year = _local3.fb_namespace::year;
_local2.addAffiliation(_local4);
};
return (_local2);
}
protected function parseGetUserPreferences(_arg1:XML):GetUserPreferencesData{
var _local4:*;
var _local5:PreferenceData;
var _local2:GetUserPreferencesData = new GetUserPreferencesData();
var _local3:PreferenceCollection = new PreferenceCollection();
for each (_local4 in _arg1..fb_namespace::preference) {
_local5 = new PreferenceData();
_local5.pref_id = _local4.fb_namespace::pref_id;
_local5.value = _local4.fb_namespace::value;
_local3.addItem(_local5);
};
_local2.perferenceCollection = _local3;
return (_local2);
}
public function parse(_arg1:String, _arg2:String):FacebookData{
var _local3:FacebookData;
var _local4:XML = new XML(_arg1);
switch (_arg2){
case "application.getPublicInfo":
_local3 = parseGetPublicInfo(_local4);
break;
case "data.getCookies":
_local3 = parseGetCookies(_local4);
break;
case "admin.getAllocation":
_local3 = parseGetAllocation(_local4);
break;
case "admin.getAppProperties":
_local3 = parseGetAppProperties(_local4);
break;
case "admin.getMetrics":
_local3 = parseGetMetrics(_local4);
break;
case "auth.getSession":
_local3 = new GetSessionData();
(_local3 as GetSessionData).expires = FacebookXMLParserUtils.toDate(_local4.fb_namespace::expires);
(_local3 as GetSessionData).uid = FacebookXMLParserUtils.toStringValue(_local4.fb_namespace::uid[0]);
(_local3 as GetSessionData).session_key = _local4.fb_namespace::session_key.toString();
(_local3 as GetSessionData).secret = String(_local4.fb_namespace::secret);
break;
case "feed.getRegisteredTemplateBundles":
_local3 = parseGetRegisteredTemplateBundles(_local4);
break;
case "friends.areFriends":
_local3 = parseAreFriends(_local4);
break;
case "notes.get":
_local3 = parseGetNotes(_local4);
break;
case "friends.get":
_local3 = parseGetFriends(_local4);
break;
case "friends.getAppUsers":
_local3 = parseGetAppUsersData(_local4);
break;
case "friends.getLists":
_local3 = parseGetLists(_local4);
break;
case "groups.get":
_local3 = parseGetGroups(_local4);
break;
case "data.getAssociationDefinitions":
_local3 = new FacebookData();
break;
case "data.getAssociationDefinition":
_local3 = new FacebookData();
break;
case "data.getObject":
case "data.getObjects":
_local3 = new FacebookData();
break;
case "groups.getMembers":
_local3 = parseGetGroupMembers(_local4);
break;
case "users.getInfo":
_local3 = parseGetInfo(_local4);
break;
case "data.createObject":
case "data.setHashValue":
case "connect.getUnconnectedFriendsCount":
case "feed.registerTemplateBundle":
_local3 = new NumberResultData();
(_local3 as NumberResultData).value = FacebookXMLParserUtils.toNumber(_local4);
break;
case "notifications.get":
_local3 = parseGetNotifications(_local4);
break;
case "feed.getRegisteredTemplateBundleByID":
_local3 = parseGetRegisteredTemplateBundleByID(_local4);
break;
case "users.getStandardInfo":
_local3 = parseGetStandardInfo(_local4);
break;
case "feed.getRegisteredTemplateBundles":
_local3 = parseGetRegisteredTemplateBundles(_local4);
break;
case "data.getUserPreferences":
_local3 = parseGetUserPreferences(_local4);
break;
case "users.isAppUser":
case "users.hasAppPermission":
case "users.setStatus":
case "pages.isFan":
case "pages.isAppAdded":
case "pages.isAdmin":
case "admin.setAppProperties":
case "auth.expireSession":
case "auth.revokeAuthorization":
case "events.cancel":
case "events.edit":
case "events.rsvp":
case "liveMessage.send":
case "data.undefineAssociation":
case "data.defineAssociation":
case "data.removeHashKeys":
case "data.removeHashKey":
case "data.incHashValue":
case "data.updateObject":
case "data.deleteObject":
case "data.deleteObjects":
case "data.renameAssociation":
case "data.setObjectProperty":
case "profile.setInfo":
case "profile.setInfoOptions":
case "feed.deactivateTemplateBundleByID":
case "feed.publishTemplatizedAction":
case "admin.setRestrictionInfo":
case "data.setCookie":
case "data.createObjectType":
case "notes.delete":
case "notes.edit":
case "data.setUserPreference":
case "data.dropObjectType":
case "data.renameObjectType":
case "fbml.registerCustomTags":
case "fbml.deleteCustomTags":
case "fbml.refreshRefUrl":
case "fbml.refreshImgSrc":
case "fbml.setRefHandle":
case "data.setUserPreferences":
case "data.defineObjectProperty":
case "photos.addTag":
case "stream.addLike":
case "stream.removeLike":
case "stream.removeComment":
case "sms.canSend":
_local3 = new BooleanResultData();
(_local3 as BooleanResultData).value = FacebookXMLParserUtils.toBoolean(_local4);
break;
case "feed.publishUserAction":
_local3 = new BooleanResultData();
(_local3 as BooleanResultData).value = FacebookXMLParserUtils.toBoolean(_local4.children()[0]);
break;
case "notifications.sendEmail":
_local3 = parseSendEmail(_local4);
break;
case "data.getObjectTypes":
_local3 = parseGetObjectTypes(_local4);
break;
case "users.getStandardInfo":
_local3 = parseGetStandardInfo(_local4);
break;
case "data.getObjectType":
_local3 = parseGetObjectType(_local4);
break;
case "events.get":
_local3 = parseGetEvent(_local4);
break;
case "events.getMembers":
_local3 = parseGetMembers(_local4);
break;
case "fql.multiquery":
_local3 = new FacebookData();
break;
case "fql.query":
_local3 = new FacebookData();
break;
case "photos.createAlbum":
_local3 = parseCreateAlbum(_local4);
break;
case "photos.get":
_local3 = parseGetPhotos(_local4);
break;
case "photos.getTags":
_local3 = parseGetTags(_local4);
break;
case "photos.getAlbums":
_local3 = parseGetAlbums(_local4);
break;
case "photos.upload":
_local3 = parseFacebookPhoto(_local4);
break;
case "pages.getInfo":
_local3 = parsePageGetInfo(_local4);
break;
case "batch.run":
_local3 = parseBatchRun(_local4);
break;
case "fbml.getCustomTags":
_local3 = parseGetCustomTags(_local4);
break;
case "connect.unregisterUsers":
case "connect.registerUsers":
_local3 = new ArrayResultData();
(_local3 as ArrayResultData).arrayResult = FacebookXMLParserUtils.toArray(_local4);
break;
case "status.get":
_local3 = parseGetStatus(_local4);
break;
case "stream.get":
_local3 = FacebookStreamXMLParser.createStream(_local4, fb_namespace);
break;
case "stream.getComments":
_local3 = FacebookStreamXMLParser.createGetCommentsData(_local4, fb_namespace);
break;
case "stream.getFilters":
_local3 = FacebookStreamXMLParser.createStreamFilterCollection(_local4, fb_namespace);
break;
case "auth.createToken":
case "events.create":
case "links.post":
case "auth.promoteSession":
case "admin.getRestrictionInfo":
case "data.getObjectProperty":
case "notifications.send":
case "notes.create":
case "data.getUserPreference":
case "profile.setFBML":
case "users.getLoggedInUser":
case "stream.addComment":
default:
_local3 = new StringResultData();
(_local3 as StringResultData).value = FacebookXMLParserUtils.toStringValue(_local4);
break;
};
_local3.rawResult = _arg1;
return (_local3);
}
protected function parseGetStandardInfo(_arg1:XML):GetStandardInfoData{
var _local4:*;
var _local5:UserData;
var _local2:GetStandardInfoData = new GetStandardInfoData();
var _local3:UserCollection = new UserCollection();
for each (_local4 in _arg1..fb_namespace::user) {
_local5 = new UserData();
_local5.uid = _local4.fb_namespace::uid;
_local5.affiations = getAffiliation(XML(_local4.fb_namespace::affiliations.toXMLString()));
_local5.first_name = _local4.fb_namespace::first_name;
_local5.last_name = _local4.fb_namespace::last_name;
_local5.name = _local4.fb_namespace::name;
_local5.timezone = _local4.fb_namespace::timezone;
_local3.addItem(_local5);
};
_local2.userCollection = _local3;
return (_local2);
}
protected function parseGetAppProperties(_arg1:XML):GetAppPropertiesData{
var _local2:GetAppPropertiesData = new GetAppPropertiesData();
_local2.appProperties = JSON.decode(_arg1.toString());
return (_local2);
}
protected function parseGetRegisteredTemplateBundles(_arg1:XML):GetRegisteredTemplateBundleData{
var _local5:*;
var _local2:GetRegisteredTemplateBundleData = new GetRegisteredTemplateBundleData();
var _local3:TemplateBundleCollection = new TemplateBundleCollection();
var _local4:TemplateCollection = new TemplateCollection();
for each (_local5 in _arg1..fb_namespace::template_bundle) {
getTemplate(_local5.fb_namespace::one_line_story_template, _local4);
getTemplate(_local5.fb_namespace::short_story_templates, _local4);
getTemplate(_local5.fb_namespace::full_story_template, _local4);
_local4.template_bundle_id = _local5.fb_namespace::template_bundle_id;
_local4.time_created = FacebookXMLParserUtils.toDate(_local5.fb_namespace::time_created);
};
_local2.bundleCollection = _local4;
return (_local2);
}
protected function parseGetRegisteredTemplateBundleByID(_arg1:XML):GetRegisteredTemplateBundleByIDData{
var _local2:GetRegisteredTemplateBundleByIDData = new GetRegisteredTemplateBundleByIDData();
var _local3:TemplateCollection = new TemplateCollection();
getTemplate(_arg1.fb_namespace::one_line_story_template, _local3);
getTemplate(_arg1.fb_namespace::short_story_templates, _local3);
getTemplate(_arg1.fb_namespace::full_story_template, _local3);
_local3.template_bundle_id = _arg1.fb_namespace::template_bundle_id;
_local3.time_created = FacebookXMLParserUtils.toDate(_arg1.fb_namespace::time_created);
_local2.templateCollection = _local3;
return (_local2);
}
protected function responseNodeNameToMethodName(_arg1:String):String{
var _local2:Array = _arg1.split("_");
_local2.pop();
return (_local2.join("."));
}
protected function parseGetObjectTypes(_arg1:XML):GetObjectTypesData{
var _local4:*;
var _local5:ObjectTypesData;
var _local2:GetObjectTypesData = new GetObjectTypesData();
var _local3:ObjectTypesCollection = new ObjectTypesCollection();
for each (_local4 in _arg1..fb_namespace::object_type_info) {
_local5 = new ObjectTypesData();
_local5.name = _local4.fb_namespace::name;
_local5.object_class = _local4.fb_namespace::object_class;
_local3.addItem(_local5);
};
_local2.objectTypeCollection = _local3;
return (_local2);
}
protected function parseFacebookPhoto(_arg1:XML):FacebookPhoto{
var _local2:FacebookPhoto = new FacebookPhoto();
_local2.pid = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::pid[0]);
_local2.aid = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::aid[0]);
_local2.owner = FacebookXMLParserUtils.toNumber(_arg1.fb_namespace::owner[0]);
_local2.src = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::src[0]);
_local2.src_big = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::src_big[0]);
_local2.src_small = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::src_small[0]);
_local2.link = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::link[0]);
_local2.caption = FacebookXMLParserUtils.toStringValue(_arg1.fb_namespace::caption[0]);
return (_local2);
}
protected function parseGetObjectType(_arg1:XML):GetObjectTypeData{
var _local2:GetObjectTypeData = new GetObjectTypeData();
_local2.name = _arg1.fb_namespace::name;
_local2.data_type = _arg1.fb_namespace::data_type;
_local2.index_type = _arg1.fb_namespace::index_type;
return (_local2);
}
protected function createTagObject(_arg1:XML, _arg2:Array){
var _local5:AbstractTagData;
var _local7:Object;
var _local3:Number = _arg1.children().length();
var _local4:String = _arg1.children()[0].toLowerCase();
if (_local4 == "leaf"){
_local5 = new LeafTagData(null, null, null, null, null);
(_local5 as LeafTagData).fbml = _arg1.children()[9];
} else {
_local5 = new ContainerTagData(null, null, null, null, null, null, null);
(_local5 as ContainerTagData).open_tag_fbml = _arg1.children()[2];
(_local5 as ContainerTagData).close_tag_fbml = _arg1.children()[4];
};
var _local6:Number = 0;
while (_local6 < _local3) {
_local7 = _arg1.children()[_local6];
switch (_arg2[_local6]){
case "name":
case "type":
case "description":
case "is_public":
case "header_fbml":
case "footer_fbml":
_local5[_arg2[_local6]] = _local7.text();
break;
case "attributes":
if ((_local7.children() is XMLList)){
if (_local7.children().length() == 0){
_local5[_arg2[_local6]] = null;
};
};
break;
};
_local6++;
};
return (_local5);
}
protected function parseGetNotes(_arg1:XML):GetNotesData{
var _local4:*;
var _local5:NoteData;
var _local2:GetNotesData = new GetNotesData();
var _local3:NotesCollection = new NotesCollection();
for each (_local4 in _arg1..fb_namespace::note) {
_local5 = new NoteData();
_local5.note_id = _local4.fb_namespace::note_id;
_local5.title = _local4.fb_namespace::title;
_local5.content = _local4.fb_namespace::content;
_local5.created_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::created_time);
_local5.updated_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::updated_time);
_local5.uid = _local4.fb_namespace::uid;
_local3.addItem(_local5);
};
_local2.notesCollection = _local3;
return (_local2);
}
protected function parseGetMetrics(_arg1:XML):GetMetricsData{
var _local4:*;
var _local5:MetricsData;
var _local2:GetMetricsData = new GetMetricsData();
var _local3:MetricsDataCollection = new MetricsDataCollection();
for each (_local4 in _arg1..fb_namespace::metrics) {
_local5 = new MetricsData();
_local5.end_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::end_time);
_local5.active_users = _local4.fb_namespace::active_users;
_local5.canvas_page_views = _local4.fb_namespace::canvas_page_views;
_local3.addItem(_local5);
};
_local2.metricsCollection = _local3;
return (_local2);
}
protected function parsePageGetInfo(_arg1:XML):GetPageInfoData{
var _local5:Object;
var _local6:PageInfoData;
var _local2:GetPageInfoData = new GetPageInfoData();
var _local3:PageInfoCollection = new PageInfoCollection();
var _local4:XMLList = _arg1.fb_namespace::page;
for each (_local5 in _local4) {
_local6 = new PageInfoData();
_local6.page_id = _local5.fb_namespace::page_id;
_local6.name = _local5.fb_namespace::name;
_local6.pic_small = _local5.fb_namespace::pic_small;
_local6.pic_big = _local5.fb_namespace::pic_big;
_local6.pic_square = _local5.fb_namespace::pic_square;
_local6.pic_large = _local5.fb_namespace::pic_large;
_local6.type = _local5.fb_namespace::type;
_local6.website = _local5.fb_namespace::website;
_local6.location = FacebookXMLParserUtils.createLocation(_local5.fb_namespace::location[0], fb_namespace);
_local6.hours = _local5.fb_namespace::hours;
_local6.band_members = _local5.fb_namespace::band_members;
_local6.bio = _local5.fb_namespace::bio;
_local6.hometown = _local5.fb_namespace::hometown;
_local6.genre = FacebookXMLParserUtils.toStringValue(_local5.fb_namespace::genre[0]);
_local6.record_label = _local5.fb_namespace::record_label;
_local6.influences = _local5.fb_namespace::influences;
_local6.has_added_app = FacebookXMLParserUtils.toBoolean(_local5.fb_namespace::has_added_app[0]);
_local6.founded = _local5.fb_namespace::founded;
_local6.company_overview = _local5.fb_namespace::company_overview;
_local6.mission = _local5.fb_namespace::mission;
_local6.products = _local5.fb_namespace::products;
_local6.release_date = _local5.fb_namespace::release_date;
_local6.starring = _local5.fb_namespace::starring;
_local6.written_by = _local5.fb_namespace::written_by;
_local6.directed_by = _local5.fb_namespace::directed_by;
_local6.produced_by = _local5.fb_namespace::produced_by;
_local6.studio = _local5.fb_namespace::studio;
_local6.awards = _local5.fb_namespace::awards;
_local6.plot_outline = _local5.fb_namespace::plot_outline;
_local6.network = _local5.fb_namespace::network;
_local6.season = _local5.fb_namespace::season;
_local6.schedule = _local5.fb_namespace::schedule;
_local3.addPageInfo(_local6);
};
_local2.pageInfoCollection = _local3;
return (_local2);
}
protected function parseGetTags(_arg1:XML):GetTagsData{
var _local4:*;
var _local5:TagData;
var _local2:GetTagsData = new GetTagsData();
var _local3:PhotoTagCollection = new PhotoTagCollection();
for each (_local4 in _arg1..fb_namespace::photo_tag) {
_local5 = new TagData();
_local5.text = _local4.fb_namespace::text;
_local5.pid = _local4.fb_namespace::pid;
_local5.subject = _local4.fb_namespace::subject;
_local5.xcoord = _local4.fb_namespace::xcoord;
_local5.ycoord = _local4.fb_namespace::ycoord;
_local5.created = FacebookXMLParserUtils.toDate(_local4.fb_namespace::created);
_local3.addPhotoTag(_local5);
};
_local2.photoTagsCollection = _local3;
return (_local2);
}
protected function parseGetGroupMembers(_arg1:XML):GetMemberData{
var _local2:GetMemberData = new GetMemberData();
_local2.members = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::members[0]);
_local2.admins = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::admins[0]);
_local2.officers = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::officers[0]);
_local2.notReplied = FacebookXMLParserUtils.toUIDArray(_arg1.fb_namespace::not_replied[0]);
return (_local2);
}
protected function parseGetGroups(_arg1:XML):GetGroupData{
var _local4:*;
var _local5:GroupData;
var _local2:GetGroupData = new GetGroupData();
var _local3:GroupCollection = new GroupCollection();
for each (_local4 in _arg1..fb_namespace::group) {
_local5 = new GroupData();
_local5.gid = _local4.fb_namespace::gid;
_local5.name = _local4.fb_namespace::name;
_local5.nid = _local4.fb_namespace::nid;
_local5.description = _local4.fb_namespace::description;
_local5.group_type = _local4.fb_namespace::group_type;
_local5.group_subtype = _local4.fb_namespace::group_subtype;
_local5.recent_news = _local4.fb_namespace::recent_news;
_local5.pic = _local4.fb_namespace::pic;
_local5.pic_big = _local4.fb_namespace::pic_big;
_local5.pic_small = _local4.fb_namespace::pic_small;
_local5.creator = _local4.fb_namespace::creator;
_local5.update_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::update_time);
_local5.office = _local4.fb_namespace::office;
_local5.website = _local4.fb_namespace::website;
_local5.venue = FacebookXMLParserUtils.createLocation(_local4.fb_namespace::venue[0], fb_namespace);
_local5.privacy = _local4.fb_namespace::privacy;
_local3.addGroup(_local5);
};
_local2.groups = _local3;
return (_local2);
}
protected function parseCreateAlbum(_arg1:XML):GetCreateAlbumData{
var _local2:GetCreateAlbumData = new GetCreateAlbumData();
var _local3:AlbumData = new AlbumData();
_local3.aid = _arg1.fb_namespace::aid;
_local3.cover_pid = _arg1.fb_namespace::cover_pid;
_local3.owner = _arg1.fb_namespace::owner;
_local3.name = _arg1.fb_namespace::name;
_local3.created = FacebookXMLParserUtils.toDate(_arg1.fb_namespace::created);
_local3.modified = FacebookXMLParserUtils.toDate(_arg1.fb_namespace::modified);
_local3.description = _arg1.fb_namespace::description;
_local3.location = _arg1.fb_namespace::location;
_local3.link = _arg1.fb_namespace::link;
_local3.size = _arg1.fb_namespace::size;
_local3.visible = _arg1.fb_namespace::visible;
_local2.albumData = _local3;
return (_local2);
}
protected function parseGetAllocation(_arg1:XML):GetAllocationData{
var _local2:GetAllocationData = new GetAllocationData();
_local2.allocationLimit = Number(_arg1.toString());
return (_local2);
}
protected function parseGetCookies(_arg1:XML):GetCookiesData{
var _local2:GetCookiesData = new GetCookiesData();
_local2.uid = _arg1.fb_namespace::uid;
_local2.name = _arg1.fb_namespace::name;
_local2.value = _arg1.fb_namespace::value;
_local2.expires = _arg1.fb_namespace::expires;
_local2.path = _arg1.fb_namespace::path;
return (_local2);
}
protected function parseGetCustomTags(_arg1:XML):GetCustomTagsData{
var _local5:*;
var _local2:Array = ["type", "name", "open_tag_fbml", "description", "close_tag_fbml", "is_public", "attributes", "header_fbml", "footer_fbml", "fbml"];
var _local3:GetCustomTagsData = new GetCustomTagsData();
var _local4:TagCollection = new TagCollection();
for each (_local5 in _arg1..fb_namespace::custom_tag) {
_local4.addItem(createTagObject(_local5, _local2));
};
_local3.tagCollection = _local4;
return (_local3);
}
protected function parseGetAlbums(_arg1:XML):GetAlbumsData{
var _local2:GetAlbumsData = new GetAlbumsData();
_local2.albumCollection = FacebookXMLParserUtils.createAlbumCollection(_arg1, fb_namespace);
return (_local2);
}
protected function parseGetInfo(_arg1:XML):GetInfoData{
var _local7:FacebookUser;
var _local2:FacebookUserCollection = new FacebookUserCollection();
var _local3:XMLList = _arg1..fb_namespace::user;
var _local4:uint = _local3.length();
var _local5:uint;
while (_local5 < _local4) {
_local7 = FacebookUserXMLParser.createFacebookUser(_local3[_local5], fb_namespace);
_local2.addItem(_local7);
_local5++;
};
var _local6:GetInfoData = new GetInfoData();
_local6.userCollection = _local2;
return (_local6);
}
protected function parseGetLists(_arg1:XML):GetListsData{
var _local4:*;
var _local5:ListsData;
var _local2:GetListsData = new GetListsData();
var _local3:Array = [];
for each (_local4 in _arg1..fb_namespace::friendlist) {
_local5 = new ListsData();
_local5.flid = _local4.fb_namespace::flid;
_local5.name = _local4.fb_namespace::name;
_local3.push(_local5);
};
_local2.lists = _local3;
return (_local2);
}
protected function parseGetAppUsersData(_arg1:XML):GetAppUserData{
var _local2:Array = FacebookXMLParserUtils.toUIDArray(_arg1);
var _local3:GetAppUserData = new GetAppUserData();
_local3.uids = _local2;
return (_local3);
}
protected function parseGetStatus(_arg1:XML):GetStatusData{
var _local7:XML;
var _local8:Status;
var _local2:GetStatusData = new GetStatusData();
var _local3:Array = [];
var _local4:XMLList = _arg1.children();
var _local5:uint = _local4.length();
var _local6:uint;
while (_local6 < _local5) {
_local7 = _local4[_local6];
_local8 = new Status();
_local8.uid = FacebookXMLParserUtils.toStringValue(_local7.fb_namespace::uid[0]);
_local8.status_id = FacebookXMLParserUtils.toStringValue(_local7.fb_namespace::status_id[0]);
_local8.time = FacebookXMLParserUtils.toDate(_local7.fb_namespace::time[0]);
_local8.source = FacebookXMLParserUtils.toStringValue(_local7.fb_namespace::source[0]);
_local8.message = FacebookXMLParserUtils.toStringValue(_local7.fb_namespace::message[0]);
_local3.push(_local8);
_local6++;
};
_local2.status = _local3;
return (_local2);
}
protected function parseGetMembers(_arg1:XML):GetMembersData{
var _local2:GetMembersData = new GetMembersData();
_local2.attending = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::attending[0]);
_local2.unsure = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::unsure[0]);
_local2.declined = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::declined[0]);
_local2.not_replied = FacebookXMLParserUtils.toUIDArray(_arg1..fb_namespace::not_replied[0]);
return (_local2);
}
protected function parseGetEvent(_arg1:XML):GetEventsData{
var _local4:*;
var _local5:EventData;
var _local2:GetEventsData = new GetEventsData();
var _local3:EventCollection = new EventCollection();
for each (_local4 in _arg1..fb_namespace::event) {
_local5 = new EventData();
_local5.eid = _local4.fb_namespace::eid;
_local5.name = _local4.fb_namespace::name;
_local5.tagline = _local4.fb_namespace::tagline;
_local5.nid = _local4.fb_namespace::nid;
_local5.pic = _local4.fb_namespace::pic;
_local5.pic_big = _local4.fb_namespace::pic_big;
_local5.pic_small = _local4.fb_namespace::pic_small;
_local5.host = _local4.fb_namespace::host;
_local5.description = _local4.fb_namespace::description;
_local5.event_type = _local4.fb_namespace::event_type;
_local5.event_subtype = _local4.fb_namespace::event_subtype;
_local5.start_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::start_time);
_local5.end_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::end_time);
_local5.creator = _local4.fb_namespace::end_time;
_local5.update_time = FacebookXMLParserUtils.toDate(_local4.fb_namespace::update_time);
_local5.location = _local4.fb_namespace::location;
_local5.venue = FacebookXMLParserUtils.createLocation(_local4.fb_namespace::venue[0], fb_namespace);
_local3.addItem(_local5);
};
_local2.eventCollection = _local3;
return (_local2);
}
protected function parseGetFriends(_arg1:XML):GetFriendsData{
var _local4:*;
var _local5:FacebookUser;
var _local2:GetFriendsData = new GetFriendsData();
var _local3:FacebookUserCollection = new FacebookUserCollection();
for each (_local4 in _arg1..fb_namespace::uid) {
_local5 = new FacebookUser();
_local5.uid = _local4;
_local3.addItem(_local5);
};
_local2.friends = _local3;
return (_local2);
}
protected function parseGetPublicInfo(_arg1:XML):GetPublicInfoData{
var _local2:GetPublicInfoData = new GetPublicInfoData();
_local2.app_id = _arg1.fb_namespace::app_id;
_local2.api_key = _arg1.fb_namespace::api_key;
_local2.canvas_name = _arg1.fb_namespace::canvas_name;
_local2.display_name = _arg1.fb_namespace::display_name;
_local2.icon_url = _arg1.fb_namespace::icon_url;
_local2.logo_url = _arg1.fb_namespace::logo_url;
_local2.developers = _arg1.fb_namespace::developers;
_local2.company_name = _arg1.fb_namespace::company_name;
_local2.developers = _arg1.fb_namespace::developers;
_local2.daily_active_users = _arg1.fb_namespace::daily_active_users;
_local2.weekly_active_users = _arg1.fb_namespace::weekly_active_users;
_local2.monthly_active_users = _arg1.fb_namespace::monthly_active_users;
_local2.description = _arg1.fb_namespace::description;
return (_local2);
}
protected function parseAreFriends(_arg1:XML):AreFriendsData{
var _local4:*;
var _local5:FriendsData;
var _local2:AreFriendsData = new AreFriendsData();
var _local3:FriendsCollection = new FriendsCollection();
for each (_local4 in _arg1..fb_namespace::friend_info) {
_local5 = new FriendsData();
_local5.uid1 = _local4.fb_namespace::uid1;
_local5.uid2 = _local4.fb_namespace::uid2;
_local5.are_friends = FacebookXMLParserUtils.toBoolean(XML(_local4.fb_namespace::are_friends.toXMLString()));
_local3.addItem(_local5);
};
_local2.friendsCollection = _local3;
return (_local2);
}
public function validateFacebookResponce(_arg1:String):FacebookError{
var xml:XML;
var xmlError:Error;
var result = _arg1;
var error:FacebookError;
var hasXMLError:Boolean;
try {
xml = new XML(result);
} catch(e) {
xmlError = e;
hasXMLError = true;
};
if (hasXMLError == false){
if (xml.localName() == "error_response"){
error = new FacebookError();
error.rawResult = result;
error.errorCode = Number(xml.fb_namespace::error_code);
error.errorMsg = xml.fb_namespace::error_msg;
error.requestArgs = FacebookXMLParserUtils.xmlToUrlVariables(xml..arg);
};
return (error);
};
if (hasXMLError == true){
error = new FacebookError();
error.error = xmlError;
error.errorCode = -1;
};
return (error);
}
protected function parseBatchRun(_arg1:XML):FacebookData{
var _local7:String;
var _local8:XML;
var _local9:FacebookError;
var _local10:String;
var _local11:FacebookData;
var _local2:XMLList = _arg1..fb_namespace::batch_run_response_elt;
var _local3:uint = _local2.length();
var _local4:Array = [];
var _local5:uint;
while (_local5 < _local3) {
_local7 = _local2[_local5].toString();
_local8 = new XML(_local7);
_local9 = validateFacebookResponce(_local7);
if (_local9 === null){
_local10 = responseNodeNameToMethodName(_local8.localName().toString());
_local11 = parse(_local7, _local10);
_local4.push(_local11);
} else {
_local4.push(_local9);
};
_local5++;
};
var _local6:BatchResult = new BatchResult();
_local6.results = _local4;
return (_local6);
}
protected function getTemplate(_arg1:XMLList, _arg2:TemplateCollection):void{
var _local3:*;
var _local4:TemplateData;
for each (_local3 in _arg1) {
_local4 = new TemplateData();
_local4.type = _local3.localName();
_local4.template_body = _local3.fb_namespace::template_body;
_local4.template_title = _local3.fb_namespace::template_title;
_arg2.addTemplateData(_local4);
};
}
}
}//package com.facebook.data
Section 221
//AbstractFileUploadDelegate (com.facebook.delegates.AbstractFileUploadDelegate)
package com.facebook.delegates {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import com.facebook.session.*;
import com.facebook.net.*;
import com.facebook.utils.*;
public class AbstractFileUploadDelegate extends WebDelegate {
protected var ba:ByteArray;
public function AbstractFileUploadDelegate(_arg1:FacebookCall, _arg2:WebSession){
super(_arg1, _arg2);
ba = new ByteArray();
}
protected function uploadByteArray(_arg1:ByteArray):void{
var _local3:String;
var _local4:URLRequest;
var _local2:PostRequest = new PostRequest();
for (_local3 in call.args) {
if (_local3 != "data"){
_local2.writePostData(_local3, call.args[_local3]);
};
};
_local2.writeFileData(((("fn" + call.args["call_id"]) + ".") + getExt()), _arg1, getContentType());
_local2.close();
_local4 = new URLRequest();
_local4.method = URLRequestMethod.POST;
_local4.contentType = ("multipart/form-data; boundary=" + _local2.boundary);
_local4.data = _local2.getPostData();
_local4.url = _session.rest_url;
createURLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.load(_local4);
}
protected function onFileRefComplete(_arg1:Event):void{
fileRef = (call.args.data as FileReference);
uploadByteArray(fileRef["data"]);
}
override protected function onDataComplete(_arg1:Event):void{
var _local3:String;
var _local2:ByteArray = (_arg1.target.data as ByteArray);
if (_local2 == null){
super.onDataComplete(_arg1);
} else {
_local3 = _local2.readUTFBytes(_local2.length);
_local2.length = 0;
_local2 = null;
handleResult(_local3);
};
}
protected function getExt():String{
return (null);
}
protected function getContentType():String{
return (null);
}
}
}//package com.facebook.delegates
Section 222
//DesktopDelegate (com.facebook.delegates.DesktopDelegate)
package com.facebook.delegates {
import com.facebook.session.*;
import com.facebook.net.*;
public class DesktopDelegate extends WebDelegate {
public function DesktopDelegate(_arg1:FacebookCall, _arg2:DesktopSession){
super(_arg1, _arg2);
}
override protected function addOptionalArguments():void{
}
}
}//package com.facebook.delegates
Section 223
//IFacebookCallDelegate (com.facebook.delegates.IFacebookCallDelegate)
package com.facebook.delegates {
import flash.events.*;
import com.facebook.session.*;
import com.facebook.net.*;
public interface IFacebookCallDelegate extends IEventDispatcher {
function get session():IFacebookSession;
function close():void;
function set call(_arg1:FacebookCall):void;
function set session(_arg1:IFacebookSession):void;
function get call():FacebookCall;
}
}//package com.facebook.delegates
Section 224
//JSDelegate (com.facebook.delegates.JSDelegate)
package com.facebook.delegates {
import flash.events.*;
import com.facebook.session.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.net.*;
import com.facebook.*;
import com.facebook.utils.*;
import com.adobe.serialization.json.*;
import flash.external.*;
public class JSDelegate extends EventDispatcher implements IFacebookCallDelegate {
protected var _call:FacebookCall;
protected var _session:JSSession;
protected static var externalInterfaceCalls:Object = {};
protected static var externalInterfaceCallId:Number = 0;
public function JSDelegate(_arg1:FacebookCall, _arg2:JSSession){
this.call = _arg1;
this.session = _arg2;
execute();
}
public function set call(_arg1:FacebookCall):void{
this._call = _arg1;
}
protected function onReceiveError(_arg1:ErrorEvent):void{
var _local2:FacebookError = new FacebookError();
_local2.errorEvent = _arg1;
var _local3 = call;
_local3.facebook_internal::handleError(_local2);
}
public function get call():FacebookCall{
return (_call);
}
protected function postBridgeAsyncReply(_arg1:Object, _arg2:Object, _arg3:uint):void{
var _local5:JSONResultData;
var _local6:FacebookError;
var _local4:FacebookCall = externalInterfaceCalls[_arg3];
if (_arg1){
_local5 = new JSONResultData();
_local5.result = _arg1;
var _local7 = _local4;
_local7.facebook_internal::handleResult(_local5);
} else {
_local6 = new FacebookError();
_local6.rawResult = JSON.encode(_arg2);
_local7 = _local4;
_local7.facebook_internal::handleError(_local6);
};
delete externalInterfaceCalls[_arg3];
}
protected function buildCall():String{
var _local3:String;
var _local4:String;
var _local1:String = ("bridgeFacebookCall_" + externalInterfaceCallId);
RequestHelper.formatRequest(call);
var _local2:Object = {};
for (_local3 in call.args) {
_local2[_local3] = call.args[_local3];
};
_local4 = (((((((((((((((("function " + _local1) + "() { ") + "FB.Facebook.apiClient.callMethod(\"") + call.method) + "\", ") + JavascriptRequestHelper.formatURLVariables(call.args)) + ", ") + "function(result, exception) {") + "document.") + (_session as JSSession).as_swf_name) + ".bridgeFacebookReply(result, exception, ") + externalInterfaceCallId) + ")") + "}") + ");") + "}");
return (_local4);
}
protected function execute():void{
var _local2:Object;
var _local3:String;
var _local1:Array = [];
for each (_local2 in call.args) {
_local1.push(_local2);
};
var _local4 = ++externalInterfaceCallId;
externalInterfaceCalls[_local4] = call;
_local3 = buildCall();
ExternalInterface.addCallback("bridgeFacebookReply", postBridgeAsyncReply);
ExternalInterface.call(_local3);
}
protected function onReceiveStatus(_arg1:StatusEvent):void{
var _local2:FacebookError;
switch ((_arg1.level == "error")){
case "error":
_local2 = new FacebookError();
_local2.rawResult = _arg1.level;
var _local3 = call;
_local3.facebook_internal::handleError(_local2);
break;
case "warning":
case "status":
break;
};
}
public function set session(_arg1:IFacebookSession):void{
this._session = (_arg1 as JSSession);
}
public function get session():IFacebookSession{
return (_session);
}
public function close():void{
}
}
}//package com.facebook.delegates
Section 225
//RequestHelper (com.facebook.delegates.RequestHelper)
package com.facebook.delegates {
import flash.utils.*;
import flash.display.*;
import flash.net.*;
import com.facebook.session.*;
import com.facebook.net.*;
import com.adobe.crypto.*;
public class RequestHelper {
protected static var callID:int = 0;
public static function formatRequest(_arg1:FacebookCall):void{
var _local2:IFacebookSession = _arg1.session;
_arg1.setRequestArgument("v", _local2.api_version);
if (_local2.api_key != null){
_arg1.setRequestArgument("api_key", _local2.api_key);
};
if (((!((_local2.session_key == null))) && (_arg1.useSession))){
_arg1.setRequestArgument("session_key", _local2.session_key);
};
var _local3:String = (new Date().time.toString() + callID++.toString());
_arg1.setRequestArgument("call_id", _local3);
_arg1.setRequestArgument("method", _arg1.method);
_arg1.setRequestArgument("sig", formatSig(_arg1));
}
public static function formatSig(_arg1:FacebookCall):String{
var _local4:String;
var _local5:String;
var _local6:*;
var _local2:IFacebookSession = _arg1.session;
var _local3:Array = [];
for (_local4 in _arg1.args) {
_local6 = _arg1.args[_local4];
if (((((((((!((_local4 === "sig"))) && (!((_local6 is ByteArray))))) && (!((_local6 is FileReference))))) && (!((_local6 is BitmapData))))) && (!((_local6 is Bitmap))))){
_local3.push(((_local4 + "=") + _local6.toString()));
};
};
_local3.sort();
_local5 = _local3.join("");
if (_local2.secret != null){
_local5 = (_local5 + _local2.secret);
};
return (MD5.hash(_local5));
}
}
}//package com.facebook.delegates
Section 226
//WebDelegate (com.facebook.delegates.WebDelegate)
package com.facebook.delegates {
import flash.events.*;
import flash.net.*;
import com.facebook.events.*;
import com.facebook.session.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.net.*;
public class WebDelegate extends EventDispatcher implements IFacebookCallDelegate {
protected var _call:FacebookCall;
protected var loader:URLLoader;
protected var _session:WebSession;
protected var parser:XMLDataParser;
protected var fileRef:FileReference;
public function WebDelegate(_arg1:FacebookCall, _arg2:WebSession){
this.call = _arg1;
this.session = _arg2;
parser = new XMLDataParser();
execute();
}
protected function onDataComplete(_arg1:Event):void{
handleResult((_arg1.target.data as String));
}
public function set call(_arg1:FacebookCall):void{
_call = _arg1;
}
protected function createURLLoader():void{
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onDataComplete);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus);
loader.addEventListener(IOErrorEvent.IO_ERROR, onError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
}
protected function clean():void{
if (loader == null){
return;
};
loader.removeEventListener(Event.COMPLETE, onDataComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onError);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
}
protected function addOptionalArguments():void{
call.setRequestArgument("ss", true);
}
public function get session():IFacebookSession{
return (_session);
}
public function get call():FacebookCall{
return (_call);
}
protected function post():void{
addOptionalArguments();
RequestHelper.formatRequest(call);
sendRequest();
}
protected function sendRequest():void{
createURLLoader();
var _local1:URLRequest = new URLRequest(_session.rest_url);
_local1.contentType = "application/x-www-form-urlencoded";
_local1.method = URLRequestMethod.POST;
_local1.data = call.args;
trace(((_local1.url + "?") + unescape(call.args.toString())));
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.load(_local1);
}
protected function onError(_arg1:ErrorEvent):void{
clean();
var _local2:FacebookError = parser.createFacebookError(_arg1, loader.data);
call.handleError(_local2);
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, false, null, _local2));
}
public function set session(_arg1:IFacebookSession):void{
_session = (_arg1 as WebSession);
}
protected function handleResult(_arg1:String):void{
var _local3:FacebookData;
clean();
var _local2:FacebookError = parser.validateFacebookResponce(_arg1);
if (_local2 == null){
_local3 = parser.parse(_arg1, call.method);
call.handleResult(_local3);
} else {
call.handleError(_local2);
};
}
protected function execute():void{
if (call == null){
throw (new Error("No call defined."));
};
post();
}
public function close():void{
try {
loader.close();
} catch(e) {
};
}
protected function onHTTPStatus(_arg1:HTTPStatusEvent):void{
}
}
}//package com.facebook.delegates
Section 227
//WebImageUploadDelegate (com.facebook.delegates.WebImageUploadDelegate)
package com.facebook.delegates {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
import com.facebook.session.*;
import com.facebook.net.*;
import com.facebook.utils.*;
import com.adobe.images.*;
import com.facebook.commands.photos.*;
public class WebImageUploadDelegate extends AbstractFileUploadDelegate {
public function WebImageUploadDelegate(_arg1:FacebookCall, _arg2:WebSession){
super(_arg1, _arg2);
}
override protected function getExt():String{
return ((((call as IUploadPhoto).uploadType == UploadPhotoTypes.JPEG)) ? "jpeg" : "png");
}
override protected function getContentType():String{
return ("Content-Type: image/jpg");
}
override protected function sendRequest():void{
var _local1:ByteArray;
var _local4:JPGEncoder;
var _local2:URLRequest = new URLRequest(_session.rest_url);
var _local3:Object = call.args.data;
if (_local3 == null){
super.sendRequest();
return;
};
if ((((PlayerUtils.majorVersion == 9)) && ((_local3 is FileReference)))){
throw (new TypeError("Uploading FileReference with Player 9 is unsupported. Use either an BitmapData or ByteArray."));
};
if ((_local3 is Bitmap)){
_local3 = (_local3 as Bitmap).bitmapData;
};
if ((((PlayerUtils.majorVersion == 10)) && ((_local3 is FileReference)))){
_local1 = (_local3 as FileReference)["load"]();
fileRef = (_local3 as FileReference);
fileRef.addEventListener(Event.COMPLETE, onFileRefComplete);
} else {
if ((_local3 is ByteArray)){
uploadByteArray((_local3 as ByteArray));
} else {
if ((_local3 is BitmapData)){
switch ((call as UploadPhoto).uploadType){
case UploadPhotoTypes.JPEG:
_local4 = new JPGEncoder((call as UploadPhoto).uploadQuality);
ba = _local4.encode((_local3 as BitmapData));
break;
case UploadPhotoTypes.PNG:
ba = PNGEncoder.encode((_local3 as BitmapData));
break;
};
uploadByteArray(ba);
} else {
throw (new Error((("Error data type " + call.args.data) + " is not supported. Please use one of the following types: FileReference, ByteArray, BitmapData or Bitmap.")));
};
};
};
}
}
}//package com.facebook.delegates
Section 228
//VideoUploadDelegate (com.facebook.delegates.VideoUploadDelegate)
package com.facebook.delegates {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import com.facebook.session.*;
import com.facebook.net.*;
import com.facebook.utils.*;
import com.facebook.commands.video.*;
public class VideoUploadDelegate extends AbstractFileUploadDelegate {
public function VideoUploadDelegate(_arg1:FacebookCall, _arg2:WebSession){
super(_arg1, _arg2);
}
override protected function getExt():String{
return ((call as UploadVideo).ext);
}
override protected function getContentType():String{
return (("Content-Type: video/" + (call as UploadVideo).ext));
}
override protected function sendRequest():void{
var _local1:ByteArray;
var _local2:URLRequest = new URLRequest(_session.rest_url);
var _local3:Object = call.args.data;
if ((((PlayerUtils.majorVersion == 9)) && ((_local3 is FileReference)))){
throw (new TypeError("Uploading FileReference with Player 9 is unsupported. Use ByteArray."));
};
if ((((PlayerUtils.majorVersion == 10)) && ((_local3 is FileReference)))){
_local1 = (_local3 as FileReference)["load"]();
fileRef = (_local3 as FileReference);
fileRef.addEventListener(Event.COMPLETE, onFileRefComplete);
} else {
if ((_local3 is ByteArray)){
uploadByteArray((_local3 as ByteArray));
} else {
throw (new Error((("Error data type " + call.args.data) + " is not supported. Please use one of the following types: FileReference or ByteArray.")));
};
};
}
}
}//package com.facebook.delegates
Section 229
//FacebookError (com.facebook.errors.FacebookError)
package com.facebook.errors {
import flash.events.*;
import flash.net.*;
import com.facebook.data.*;
public class FacebookError extends FacebookData {
public var errorMsg:String;
public var reason:String;
public var error:Error;
public var requestArgs:URLVariables;
public var errorCode:Number;
public var errorEvent:ErrorEvent;
}
}//package com.facebook.errors
Section 230
//FacebookEvent (com.facebook.events.FacebookEvent)
package com.facebook.events {
import flash.events.*;
import com.facebook.data.*;
import com.facebook.errors.*;
public class FacebookEvent extends Event {
public var success:Boolean;
public var error:FacebookError;
public var hasPermission:Boolean;
public var data:FacebookData;
public var permission:String;
public static const PERMISSIONS_LOADED:String = "permissionsLoaded";
public static const LOGOUT:String = "logout";
public static const CONNECT:String = "connect";
public static const VERIFYING_SESSION:String = "verifyingSession";
public static const WAITING_FOR_LOGIN:String = "waitingForLogin";
public static const PERMISSION_CHANGE:String = "permissionChanged";
public static const PERMISSION_STATUS:String = "permissionStatus";
public static const LOGIN_SUCCESS:String = "loginSuccess";
public static const ERROR:String = "facebookEventError";
public static const PERMISSIONS_WINDOW_SHOW:String = "permissionsWindowShow";
public static const LOGIN_FAILURE:String = "loginFailure";
public static const LOGIN_WINDOW_SHOW:String = "loginWindoShow";
public static const COMPLETE:String = "complete";
public function FacebookEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:FacebookData=null, _arg6:FacebookError=null, _arg7:String="", _arg8:Boolean=false){
this.success = _arg4;
this.data = _arg5;
this.error = _arg6;
this.permission = _arg7;
this.hasPermission = _arg8;
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("FacebookEvent", "type", "success", "data", "error"));
}
override public function clone():Event{
return (new FacebookEvent(type, bubbles, cancelable, success, data, error));
}
}
}//package com.facebook.events
Section 231
//FacebookCall (com.facebook.net.FacebookCall)
package com.facebook.net {
import flash.events.*;
import flash.net.*;
import com.facebook.events.*;
import com.facebook.session.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.*;
import com.facebook.delegates.*;
public class FacebookCall extends EventDispatcher {
public var method:String;
public var success:Boolean;// = false
public var args:URLVariables;
public var delegate:IFacebookCallDelegate;
public var error:FacebookError;
public var useSession:Boolean;// = true
public var session:IFacebookSession;
public var result:FacebookData;
public function FacebookCall(_arg1:String="no_method_required", _arg2:URLVariables=null){
this.method = _arg1;
this.args = ((_arg2)!=null) ? _arg2 : new URLVariables();
}
facebook_internal function handleError(_arg1:FacebookError):void{
this.error = _arg1;
success = false;
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, false, null, _arg1));
}
facebook_internal function handleResult(_arg1:FacebookData):void{
this.result = _arg1;
success = true;
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, true, _arg1));
}
facebook_internal function setRequestArgument(_arg1:String, _arg2:Object):void{
if ((((_arg2 is Number)) && (isNaN((_arg2 as Number))))){
return;
};
if (((((_arg1) && (!((_arg2 == null))))) && ((String(_arg2).length > 0)))){
this.args[_arg1] = _arg2;
};
}
facebook_internal function clearRequestArguments():void{
this.args = new URLVariables();
}
facebook_internal function initialize():void{
}
protected function applySchema(_arg1:Array, ... _args):void{
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
setRequestArgument(_arg1[_local4], _args[_local4]);
_local4++;
};
}
}
}//package com.facebook.net
Section 232
//IUploadPhoto (com.facebook.net.IUploadPhoto)
package com.facebook.net {
public interface IUploadPhoto {
function set data(_arg1:Object):void;
function set uploadType(_arg1:String):void;
function get data():Object;
function get uploadType():String;
function set uploadQuality(_arg1:uint):void;
function get uploadQuality():uint;
}
}//package com.facebook.net
Section 233
//IUploadVideo (com.facebook.net.IUploadVideo)
package com.facebook.net {
public interface IUploadVideo {
function set title(_arg1:String):void;
function get ext():String;
function set ext(_arg1:String):void;
function set description(_arg1:String):void;
function get description():String;
function get title():String;
}
}//package com.facebook.net
Section 234
//DesktopSession (com.facebook.session.DesktopSession)
package com.facebook.session {
import flash.net.*;
import com.facebook.events.*;
import com.facebook.data.*;
import com.facebook.errors.*;
import com.facebook.net.*;
import com.facebook.*;
import com.facebook.delegates.*;
import com.facebook.commands.users.*;
import com.facebook.commands.auth.*;
import com.facebook.data.auth.*;
public class DesktopSession extends WebSession implements IFacebookSession {
protected var _auth_token:String;
protected var loginRequest:IFacebookCallDelegate;
protected var _waiting_for_login:Boolean;// = false
protected var _offline_access:Boolean;// = false
public function DesktopSession(_arg1:String, _arg2:String=null, _arg3:String=null){
super(_arg1, null);
this._is_connected = false;
this._secret = _arg2;
if (_arg3){
this._session_key = _arg3;
};
}
override public function post(_arg1:FacebookCall):IFacebookCallDelegate{
rest_url = REST_URL;
if ((_arg1 is IUploadPhoto)){
return (new WebImageUploadDelegate(_arg1, this));
};
if ((_arg1 is IUploadVideo)){
rest_url = VIDEO_URL;
return (new VideoUploadDelegate(_arg1, this));
};
return (new DesktopDelegate(_arg1, this));
}
override public function get waiting_for_login():Boolean{
return (_waiting_for_login);
}
protected function onLogin(_arg1:FacebookEvent):void{
var _local2:URLRequest;
var _local3:String;
_arg1.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);
if (_arg1.success){
_auth_token = (_arg1.data as StringResultData).value;
_local2 = new URLRequest();
_local3 = "?";
if (_offline_access){
_local3 = (_local3 + "ext_perm=offline_access&");
};
_local2.url = (((((((login_url + _local3) + "api_key=") + api_key) + "&v=") + api_version) + "&auth_token=") + _auth_token);
navigateToURL(_local2, "_blank");
_waiting_for_login = true;
dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
} else {
onConnectionError(_arg1.error);
};
}
protected function onConnectionError(_arg1:FacebookError):void{
_is_connected = false;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false, null, _arg1));
}
protected function tokenCreated():void{
navigateToURL(new URLRequest(login_url));
}
override public function login(_arg1:Boolean):void{
_offline_access = _arg1;
_session_key = null;
var _local2:FacebookCall = new CreateToken();
_local2.session = this;
var _local3 = _local2;
_local3.facebook_internal::initialize();
_local2.addEventListener(FacebookEvent.COMPLETE, onLogin);
post(_local2);
}
protected function onVerifyLogin(_arg1:FacebookEvent):void{
var _local2:FacebookEvent = new FacebookEvent(FacebookEvent.CONNECT);
_local2.success = _arg1.success;
if (_arg1.success){
facebook_internal::_uid = (_arg1.data as StringResultData).value;
_local2.data = _arg1.data;
_is_connected = true;
} else {
_local2.error = _arg1.error;
_is_connected = false;
};
dispatchEvent(_local2);
}
override public function verifySession():void{
var _local1:FacebookCall;
if (_session_key){
_local1 = new GetLoggedInUser();
_local1.session = this;
var _local2 = _local1;
_local2.facebook_internal::initialize();
_local1.addEventListener(FacebookEvent.COMPLETE, onVerifyLogin, false, 0, true);
post(_local1);
dispatchEvent(new FacebookEvent(FacebookEvent.VERIFYING_SESSION));
} else {
_is_connected = false;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT));
};
}
protected function validateSessionReply(_arg1:FacebookEvent):void{
var _local2:GetSessionData;
if (_arg1.success){
_local2 = (_arg1.data as GetSessionData);
facebook_internal::_uid = _local2.uid;
this._session_key = _local2.session_key;
this._expires = _local2.expires;
this._secret = ((((_local2.secret == null)) || ((_local2.secret == "")))) ? this._secret : _local2.secret;
_is_connected = true;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true, _local2));
} else {
onConnectionError(_arg1.error);
};
}
override public function refreshSession():void{
_waiting_for_login = false;
var _local1:GetSession = new GetSession(_auth_token);
_local1.session = this;
var _local2 = _local1;
_local2.facebook_internal::initialize();
_local1.addEventListener(FacebookEvent.COMPLETE, validateSessionReply);
post(_local1);
}
}
}//package com.facebook.session
Section 235
//IFacebookSession (com.facebook.session.IFacebookSession)
package com.facebook.session {
import flash.events.*;
import com.facebook.net.*;
import com.facebook.delegates.*;
public interface IFacebookSession extends IEventDispatcher {
function set secret(_arg1:String):void;
function get waiting_for_login():Boolean;
function refreshSession():void;
function get rest_url():String;
function post(_arg1:FacebookCall):IFacebookCallDelegate;
function set rest_url(_arg1:String):void;
function login(_arg1:Boolean):void;
function set session_key(_arg1:String):void;
function get secret():String;
function get api_version():String;
function get expires():Date;
function get session_key():String;
function get uid():String;
function get api_key():String;
function get is_connected():Boolean;
function verifySession():void;
}
}//package com.facebook.session
Section 236
//JSSession (com.facebook.session.JSSession)
package com.facebook.session {
import flash.events.*;
import com.facebook.events.*;
import com.facebook.net.*;
import com.facebook.*;
import com.facebook.delegates.*;
import com.facebook.commands.users.*;
public class JSSession extends EventDispatcher implements IFacebookSession {
public var _api_key:String;
public var as_swf_name:String;
protected var _session_key:String;
public function JSSession(_arg1:String, _arg2:String){
this._api_key = _arg1;
this.as_swf_name = _arg2;
}
public function get waiting_for_login():Boolean{
return (true);
}
public function get expires():Date{
return (null);
}
public function get rest_url():String{
return (null);
}
public function get session_key():String{
return (_session_key);
}
public function set rest_url(_arg1:String):void{
}
public function refreshSession():void{
}
protected function onVerifyLogin(_arg1:FacebookEvent):void{
if (_arg1.success){
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false));
};
}
public function get uid():String{
return (null);
}
public function get is_sessionless():Boolean{
return (true);
}
public function verifySession():void{
var _local1:FacebookCall = new GetLoggedInUser();
_local1.addEventListener(FacebookEvent.COMPLETE, onVerifyLogin);
_local1.session = this;
var _local2 = _local1;
_local2.facebook_internal::initialize();
post(_local1);
}
public function set secret(_arg1:String):void{
}
public function login(_arg1:Boolean):void{
}
public function set session_key(_arg1:String):void{
_session_key = _arg1;
}
public function post(_arg1:FacebookCall):IFacebookCallDelegate{
return (new JSDelegate(_arg1, this));
}
public function get secret():String{
return (null);
}
public function get api_version():String{
return ("1.0");
}
public function get api_key():String{
return (_api_key);
}
public function get is_connected():Boolean{
return (true);
}
}
}//package com.facebook.session
Section 237
//WebSession (com.facebook.session.WebSession)
package com.facebook.session {
import flash.events.*;
import com.facebook.events.*;
import com.facebook.net.*;
import com.facebook.*;
import com.facebook.delegates.*;
public class WebSession extends EventDispatcher implements IFacebookSession {
facebook_internal var _uid:String;
protected var _is_connected:Boolean;// = false
public var login_url:String;// = "http://www.facebook.com/login.php"
protected var _secret:String;
protected var _rest_url:String;// = "http://api.facebook.com/restserver.php"
protected var _api_version:String;// = "1.0"
protected var _expires:Date;
protected var _session_key:String;
protected var _api_key:String;
public static const VIDEO_URL:String = "http://api-video.facebook.com/restserver.php";
public static const REST_URL:String = "http://api.facebook.com/restserver.php";
public function WebSession(_arg1:String, _arg2:String, _arg3:String=null){
this._api_key = _arg1;
this._session_key = _arg3;
this.secret = _arg2;
}
public function get waiting_for_login():Boolean{
return (false);
}
public function get rest_url():String{
return (_rest_url);
}
public function set rest_url(_arg1:String):void{
_rest_url = _arg1;
}
public function post(_arg1:FacebookCall):IFacebookCallDelegate{
rest_url = REST_URL;
if ((_arg1 is IUploadPhoto)){
return (new WebImageUploadDelegate(_arg1, this));
};
if ((_arg1 is IUploadVideo)){
rest_url = VIDEO_URL;
return (new VideoUploadDelegate(_arg1, this));
};
return (new WebDelegate(_arg1, this));
}
public function get secret():String{
return (_secret);
}
public function get expires():Date{
return (_expires);
}
public function get api_key():String{
return (_api_key);
}
public function refreshSession():void{
}
public function get session_key():String{
return (_session_key);
}
public function get uid():String{
return (facebook_internal::_uid);
}
public function get api_version():String{
return (this._api_version);
}
public function get is_connected():Boolean{
return (_is_connected);
}
public function set secret(_arg1:String):void{
_secret = _arg1;
}
public function verifySession():void{
if (_session_key){
_is_connected = true;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
_is_connected = false;
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false));
};
}
public function set api_version(_arg1:String):void{
this._api_version = _arg1;
}
public function login(_arg1:Boolean):void{
}
public function set session_key(_arg1:String):void{
_session_key = _arg1;
}
}
}//package com.facebook.session
Section 238
//FacebookArrayCollection (com.facebook.utils.FacebookArrayCollection)
package com.facebook.utils {
import flash.events.*;
import flash.utils.*;
public class FacebookArrayCollection extends EventDispatcher {
protected var _source:Array;
protected var hash:Dictionary;
protected var _type:Class;
public function FacebookArrayCollection(_arg1:Array=null, _arg2:Class=null){
reset();
_type = _arg2;
initilizeSource(_arg1);
}
protected function verifyIndex(_arg1:uint):void{
if (_source.length < _arg1){
throw (new RangeError((("Index: " + _arg1) + ", is out of range.")));
};
}
public function addItem(_arg1:Object):void{
addItemAt(_arg1, length);
}
public function get length():int{
return (_source.length);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
if (hash[_arg1] != null){
throw (new Error("Item already exists."));
};
if (((!((_type === null))) && (!((_arg1 is _type))))){
throw (new TypeError((("This collection requires " + _type) + " as the type.")));
};
hash[_arg1] = true;
_source.splice(_arg2, 0, _arg1);
}
public function indexOf(_arg1:Object):int{
return (_source.indexOf(_arg1));
}
public function removeItemAt(_arg1:uint):void{
verifyIndex(_arg1);
var _local2:Object = _source[_arg1];
delete hash[_local2];
_source.splice(_arg1, 1);
}
public function getItemAt(_arg1:uint):Object{
verifyIndex(_arg1);
return (_source[_arg1]);
}
override public function toString():String{
return (_source.join(", "));
}
public function reset():void{
hash = new Dictionary(true);
_source = [];
}
protected function initilizeSource(_arg1:Array):void{
_source = [];
if (_arg1 == null){
return;
};
var _local2:uint = _arg1.length;
var _local3:uint;
while (_local3 < _local2) {
addItem(_arg1[_local3]);
_local3++;
};
}
public function findItemByProperty(_arg1:String, _arg2:Object, _arg3:Boolean=false):Object{
var _local4:Object;
for (_local4 in hash) {
if (((((_arg3) && ((_arg1 in _local4)))) && ((_local4[_arg1] === _arg2)))){
return (_local4);
};
if (((((!(_arg3)) && ((_arg1 in _local4)))) && ((_local4[_arg1] == _arg2)))){
return (_local4);
};
};
return (null);
}
public function get type():Class{
return (_type);
}
public function get source():Array{
return (_source);
}
public function toArray():Array{
var _local1:Array = [];
var _local2:uint = length;
var _local3:uint;
while (_local3 < _local2) {
_local1.push(getItemAt(_local3));
_local3++;
};
return (_local1);
}
public function contains(_arg1:Object):Boolean{
return ((hash[_arg1] === true));
}
}
}//package com.facebook.utils
Section 239
//FacebookDataUtils (com.facebook.utils.FacebookDataUtils)
package com.facebook.utils {
import com.adobe.serialization.json.*;
public class FacebookDataUtils {
public static function toJSONValuesArray(_arg1:Array):String{
if (_arg1 == null){
return (null);
};
var _local2:Array = [];
var _local3:Number = _arg1.length;
var _local4:Number = 0;
while (_local4 < _local3) {
_local2.push(JSON.encode(_arg1[_local4]));
_local4++;
};
return (_local2.join(","));
}
public static function formatDate(_arg1:String):Date{
var _local4:Array;
var _local5:Array;
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (null);
};
var _local2:Date = new Date();
var _local3:Array = _arg1.split(" ");
if (_local3.length == 2){
_local4 = _local3[0].split("-");
_local5 = _local3[1].split(":");
_local2.setFullYear(_local4[0]);
_local2.setMonth((_local4[1] - 1));
_local2.setDate(_local4[2]);
_local2.setHours(_local5[0]);
_local2.setMinutes(_local5[1]);
_local2.setSeconds(_local5[2]);
} else {
_local2.setTime((parseInt(_arg1) * 1000));
};
return (_local2);
}
public static function facebookCollectionToJSONArray(_arg1:FacebookArrayCollection):String{
if (_arg1 == null){
return (null);
};
return (JSON.encode(_arg1.toArray()));
}
public static function toDateString(_arg1:Date):String{
if (_arg1 == null){
return (null);
};
_arg1.setDate((_arg1.date + 1));
return (((_arg1 == null)) ? null : _arg1.getTime().toString().slice(0, 10));
}
public static function supplantString(_arg1:String, _arg2:Object):String{
var _local4:String;
var _local3:String = _arg1;
for (_local4 in _arg2) {
_local3 = _local3.replace(new RegExp((("\\{" + _local4) + "\\}"), "g"), _arg2[_local4]);
};
return (_local3);
}
public static function toArrayString(_arg1:Array):String{
return (((_arg1 == null)) ? null : _arg1.join(","));
}
}
}//package com.facebook.utils
Section 240
//FacebookSessionUtil (com.facebook.utils.FacebookSessionUtil)
package com.facebook.utils {
import flash.events.*;
import flash.system.*;
import flash.display.*;
import flash.net.*;
import com.facebook.events.*;
import com.facebook.session.*;
import com.facebook.*;
public class FacebookSessionUtil extends EventDispatcher {
protected var loaderInfo:LoaderInfo;
public var facebook:Facebook;
protected var secret:String;
protected var _activeSession:IFacebookSession;
protected var session_key:String;
protected var api_key:String;
public function FacebookSessionUtil(_arg1:String, _arg2:String, _arg3:LoaderInfo){
this.secret = ((_arg2 == null)) ? _arg3.parameters.fb_sig_ss : _arg2;
this.api_key = _arg1;
this.loaderInfo = _arg3;
var _local4:SharedObject = getStoredSession();
if (_local4.data.session_key){
session_key = _local4.data.session_key;
};
var _local5:Object = ((_arg3)!=null) ? _arg3.parameters : {};
if (_local5.fb_sig_session_key != null){
session_key = _local5.fb_sig_session_key;
};
if ((((_arg3.url.slice(0, 5) == "file:")) || ((Capabilities.playerType == "Desktop")))){
_activeSession = new DesktopSession(_arg1, this.secret);
} else {
if (((((_local5.fb_sig_ss) && (_local5.fb_sig_api_key))) && (_local5.fb_sig_session_key))){
_activeSession = new WebSession(_local5.fb_sig_api_key, _local5.fb_sig_ss, _local5.fb_sig_session_key);
(_activeSession as WebSession).facebook_internal::_uid = _local5.fb_sig_user;
} else {
if (_local5.as_app_name){
_activeSession = new JSSession(_arg1, _local5.as_app_name);
} else {
_activeSession = new DesktopSession(_arg1, _arg2);
};
};
};
_activeSession.session_key = session_key;
_activeSession.addEventListener(FacebookEvent.VERIFYING_SESSION, onVerifyingSession);
facebook = new Facebook();
facebook.addEventListener(FacebookEvent.WAITING_FOR_LOGIN, handleWaitingForLogin);
facebook.addEventListener(FacebookEvent.CONNECT, onFacebookReady);
facebook.startSession(_activeSession);
}
protected function getStoredSession():SharedObject{
return (SharedObject.getLocal((api_key + "_stored_session")));
}
protected function handleWaitingForLogin(_arg1:FacebookEvent):void{
dispatchEvent(_arg1);
}
public function logout():void{
getStoredSession().clear();
getStoredSession().flush();
facebook.logout();
}
protected function onFacebookReady(_arg1:FacebookEvent):void{
var _local2:SharedObject;
if (facebook.session_key){
_local2 = getStoredSession();
_local2.data.session_key = facebook.session_key;
_local2.data.stored_secret = facebook.secret;
_local2.flush(3000);
};
if (_arg1){
dispatchEvent(_arg1);
};
}
protected function onWaitingForLogin(_arg1:FacebookEvent):void{
dispatchEvent(_arg1);
}
public function validateLogin():void{
facebook.refreshSession();
}
public function get activeSession():IFacebookSession{
return (_activeSession);
}
public function login(_arg1:Boolean=true):void{
facebook.login(_arg1);
}
public function onVerifyingSession(_arg1:FacebookEvent):void{
dispatchEvent(_arg1);
}
public function verifySession():void{
_activeSession.verifySession();
}
protected function onVerifyLogin(_arg1:FacebookEvent):void{
_activeSession.removeEventListener(FacebookEvent.CONNECT, onVerifyLogin);
if (_arg1.success){
onFacebookReady(null);
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false));
};
}
}
}//package com.facebook.utils
Section 241
//FacebookStreamXMLParser (com.facebook.utils.FacebookStreamXMLParser)
package com.facebook.utils {
import com.facebook.data.stream.*;
public class FacebookStreamXMLParser {
public static function createCommentsArray(_arg1:XMLList, _arg2:Namespace):Array{
var _local6:XML;
var _local7:PostCommentData;
var _local3:Array = [];
var _local4:uint = _arg1.length();
var _local5:uint;
while (_local5 < _local4) {
_local6 = _arg1[_local5];
_local7 = new PostCommentData();
_local7.fromid = FacebookXMLParserUtils.toStringValue(_local6._arg2::fromid[0]);
_local7.id = FacebookXMLParserUtils.toStringValue(_local6._arg2::id[0]);
_local7.text = FacebookXMLParserUtils.toStringValue(_local6._arg2::text[0]);
_local7.time = FacebookXMLParserUtils.toDate(_local6._arg2::time[0]);
_local3.push(_local7);
_local5++;
};
return (_local3);
}
protected static function createMediaArray(_arg1:XML, _arg2:Namespace):Array{
var _local7:XML;
var _local8:StreamMediaData;
if (_arg1 == null){
return (null);
};
var _local3:Array = [];
var _local4:XMLList = _arg1.children();
var _local5:uint = _local4.length();
var _local6:uint;
while (_local6 < _local5) {
_local7 = _local4[_local6];
_local8 = new StreamMediaData();
_local8.type = FacebookXMLParserUtils.toStringValue(_local7._arg2::type[0]);
_local8.alt = FacebookXMLParserUtils.toStringValue(_local7._arg2::alt[0]);
_local8.href = FacebookXMLParserUtils.toStringValue(_local7._arg2::href[0]);
_local8.src = FacebookXMLParserUtils.toStringValue(_local7._arg2::src[0]);
_local8.video = createVideoMedia(_local7._arg2::video[0], _arg2);
_local8.photo = createPhotoMedia(_local7._arg2::photo[0], _arg2);
_local8.flash = createFlashMedia(_local7._arg2::swf[0], _arg2);
_local8.music = createMusicMedia(_local7._arg2::music[0], _arg2);
_local3.push(_local8);
_local6++;
};
return (_local3);
}
public static function createStreamFilterCollection(_arg1:XML, _arg2:Namespace):GetFiltersData{
var _local8:XML;
var _local9:StreamFilterData;
var _local3:GetFiltersData = new GetFiltersData();
var _local4:StreamFilterCollection = new StreamFilterCollection();
var _local5:XMLList = _arg1.._arg2::stream_filter;
var _local6:uint = _local5.length();
var _local7:uint;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local9 = new StreamFilterData();
_local9.filter_key = FacebookXMLParserUtils.toStringValue(_local8._arg2::filter_key[0]);
_local9.icon_url = FacebookXMLParserUtils.toStringValue(_local8._arg2::icon_url[0]);
_local9.is_visible = FacebookXMLParserUtils.toBoolean(_local8._arg2::is_visible[0]);
_local9.name = FacebookXMLParserUtils.toStringValue(_local8._arg2::name[0]);
_local9.rank = FacebookXMLParserUtils.toNumber(_local8._arg2::rank[0]);
_local9.type = FacebookXMLParserUtils.toStringValue(_local8._arg2::type[0]);
_local9.uid = FacebookXMLParserUtils.toStringValue(_local8._arg2::uid[0]);
_local9.value = FacebookXMLParserUtils.toStringValue(_local8._arg2::value[0]);
_local4.addItem(_local9);
_local7++;
};
_local3.filters = _local4;
return (_local3);
}
protected static function createVideoMedia(_arg1:XML, _arg2:Namespace):VideoMedia{
if (_arg1 == null){
return (null);
};
var _local3:VideoMedia = new VideoMedia();
_local3.display_url = FacebookXMLParserUtils.toStringValue(_arg1._arg2::display_url[0]);
_local3.owner = FacebookXMLParserUtils.toStringValue(_arg1._arg2::owner[0]);
_local3.permalink = FacebookXMLParserUtils.toStringValue(_arg1._arg2::permalink[0]);
_local3.source_url = FacebookXMLParserUtils.toStringValue(_arg1._arg2::source_url[0]);
_local3.preview_img = FacebookXMLParserUtils.toStringValue(_arg1._arg2::preview_img[0]);
return (_local3);
}
protected static function createFlashMedia(_arg1:XML, _arg2:Namespace):FlashMedia{
if (_arg1 == null){
return (null);
};
var _local3:FlashMedia = new FlashMedia();
_local3.source_url = FacebookXMLParserUtils.toStringValue(_arg1._arg2::source_url[0]);
_local3.preview_img = FacebookXMLParserUtils.toStringValue(_arg1._arg2::preview_img[0]);
return (_local3);
}
public static function createGetCommentsData(_arg1:XML, _arg2:Namespace):GetCommentsData{
var _local3:XMLList = _arg1.._arg2::comment;
var _local4:GetCommentsData = new GetCommentsData();
_local4.comments = createCommentsArray(_local3, _arg2);
return (_local4);
}
protected static function createActionLinksArray(_arg1:XML, _arg2:Namespace):Array{
var _local7:XML;
var _local8:ActionLinkData;
if (_arg1 == null){
return (null);
};
var _local3:Array = [];
var _local4:XMLList = _arg1.children();
var _local5:uint = _local4.length();
var _local6:uint;
while (_local6 < _local5) {
_local7 = _local4[_local6];
_local8 = new ActionLinkData();
_local8.text = FacebookXMLParserUtils.toStringValue(_local7._arg2::text[0]);
_local8.href = FacebookXMLParserUtils.toStringValue(_local7._arg2::href[0]);
_local3.push(_local8);
_local6++;
};
return (_local3);
}
protected static function createMusicMedia(_arg1:XML, _arg2:Namespace):MusicMedia{
if (_arg1 == null){
return (null);
};
var _local3:MusicMedia = new MusicMedia();
_local3.source_url = FacebookXMLParserUtils.toStringValue(_arg1._arg2::source_url[0]);
_local3.artist = FacebookXMLParserUtils.toStringValue(_arg1._arg2::artist[0]);
_local3.title = FacebookXMLParserUtils.toStringValue(_arg1._arg2::title[0]);
return (_local3);
}
public static function createStream(_arg1:XML, _arg2:Namespace):GetStreamData{
var _local6:uint;
var _local7:uint;
var _local10:XML;
var _local11:StreamStoryData;
var _local12:XML;
var _local13:AttachmentData;
var _local14:LikesData;
var _local15:XML;
var _local16:XML;
var _local17:ProfileData;
var _local18:XML;
var _local3:GetStreamData = new GetStreamData();
var _local4:StreamStoryCollection = new StreamStoryCollection();
var _local5:ProfileCollection = new ProfileCollection();
_local3.stories = _local4;
_local3.profiles = _local5;
var _local8:XMLList = _arg1._arg2::posts.children();
_local6 = _local8.length();
_local7 = 0;
while (_local7 < _local6) {
_local10 = _local8[_local7];
_local11 = new StreamStoryData();
_local11.sourceXML = _local10;
_local12 = _local10._arg2::attachment[0];
_local13 = new AttachmentData();
_local13.name = FacebookXMLParserUtils.toStringValue(_local12._arg2::name[0]);
_local13.text = FacebookXMLParserUtils.toStringValue(_local12._arg2::text[0]);
_local13.body = FacebookXMLParserUtils.toStringValue(_local12._arg2::body[0]);
_local13.icon = FacebookXMLParserUtils.toStringValue(_local12._arg2::icon[0]);
_local13.label = FacebookXMLParserUtils.toStringValue(_local12._arg2::label[0]);
_local13.media = createMediaArray(_local12._arg2::media[0], _arg2);
_local13.title = FacebookXMLParserUtils.toStringValue(_local12._arg2::title[0]);
_local13.href = FacebookXMLParserUtils.toStringValue(_local12._arg2::href[0]);
_local13.caption = FacebookXMLParserUtils.toStringValue(_local12._arg2::caption[0]);
_local13.description = FacebookXMLParserUtils.toStringValue(_local12._arg2::description[0]);
_local13.properties = FacebookXMLParserUtils.xmlListToObjectArray(_local12.._arg2::stream_property);
_local11.attachment = _local13;
_local11.actor_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::actor_id[0]);
_local11.comments = createComments(_local10._arg2::comments[0], _arg2);
_local14 = new LikesData();
_local15 = _local10._arg2::likes[0];
_local14.can_like = FacebookXMLParserUtils.toBoolean(_local15._arg2::can_like[0]);
_local14.user_likes = FacebookXMLParserUtils.toBoolean(_local15._arg2::user_likes[0]);
_local14.count = FacebookXMLParserUtils.toNumber(_local15._arg2::count[0]);
_local14.friends = FacebookXMLParserUtils.toUIDArray(_local15._arg2::friends[0]);
_local14.sample = FacebookXMLParserUtils.toUIDArray(_local15._arg2::sample[0]);
_local14.href = FacebookXMLParserUtils.toStringValue(_local15._arg2::href[0]);
_local11.likes = _local14;
_local11.attribution = FacebookXMLParserUtils.toStringValue(_local10._arg2::attribution[0]);
_local11.app_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::app_id[0]);
_local11.metadata = FacebookXMLParserUtils.nodeToObject(_local10._arg2::metadata);
_local11.message = FacebookXMLParserUtils.toStringValue(_local10._arg2::message[0]);
_local11.source_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::source_id[0]);
_local11.target_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::target_id[0]);
_local11.post_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::post_id[0]);
_local11.updated_time = FacebookXMLParserUtils.toDate(_local10._arg2::updated_time[0]);
_local11.created_time = FacebookXMLParserUtils.toDate(_local10._arg2::created_time[0]);
_local11.type = FacebookXMLParserUtils.toNumber(_local10._arg2::type[0]);
_local11.viewer_id = FacebookXMLParserUtils.toStringValue(_local10._arg2::viewer_id[0]);
_local16 = _local10._arg2::privacy[0];
_local11.privacy = FacebookXMLParserUtils.toStringValue(_local16._arg2::value[0]);
_local11.filter_key = FacebookXMLParserUtils.toStringValue(_local10._arg2::filter_key[0]);
_local11.permalink = FacebookXMLParserUtils.toStringValue(_local10._arg2::permalink[0]);
_local11.is_hidden = FacebookXMLParserUtils.toBoolean(_local10._arg2::is_hidden[0]);
_local11.action_links = createActionLinksArray(_local10._arg2::action_links[0], _arg2);
_local4.addItem(_local11);
_local7++;
};
var _local9:XMLList = _arg1._arg2::profiles.children();
_local6 = _local9.length();
_local7 = 0;
while (_local7 < _local6) {
_local17 = new ProfileData();
_local18 = _local9[_local7];
_local17.id = FacebookXMLParserUtils.toStringValue(_local18._arg2::id[0]);
_local17.name = FacebookXMLParserUtils.toStringValue(_local18._arg2::name[0]);
_local17.pic_square = FacebookXMLParserUtils.toStringValue(_local18._arg2::pic_square[0]);
_local17.url = FacebookXMLParserUtils.toStringValue(_local18._arg2::url[0]);
_local5.addItem(_local17);
_local7++;
};
_local3.albums = FacebookXMLParserUtils.createAlbumCollection(_arg1._arg2::albums[0], _arg2);
return (_local3);
}
protected static function createPhotoMedia(_arg1:XML, _arg2:Namespace):PhotoMedia{
if (_arg1 == null){
return (null);
};
var _local3:PhotoMedia = new PhotoMedia();
_local3.aid = FacebookXMLParserUtils.toStringValue(_arg1._arg2::aid[0]);
_local3.index = FacebookXMLParserUtils.toNumber(_arg1._arg2::index[0]);
_local3.owner = FacebookXMLParserUtils.toStringValue(_arg1._arg2::owner[0]);
_local3.pid = FacebookXMLParserUtils.toStringValue(_arg1._arg2::pid[0]);
return (_local3);
}
protected static function createComments(_arg1:XML, _arg2:Namespace):CommentsData{
var _local3:CommentsData = new CommentsData();
_local3.can_remove = FacebookXMLParserUtils.toBoolean(_arg1._arg2::can_remove[0]);
_local3.can_post = FacebookXMLParserUtils.toBoolean(_arg1._arg2::can_post[0]);
_local3.count = FacebookXMLParserUtils.toNumber(_arg1._arg2::count[0]);
var _local4:XMLList = _arg1._arg2::comment_list.children();
_local3.posts = createCommentsArray(_local4, _arg2);
return (_local3);
}
}
}//package com.facebook.utils
Section 242
//FacebookUserXMLParser (com.facebook.utils.FacebookUserXMLParser)
package com.facebook.utils {
import com.facebook.data.*;
import com.facebook.data.users.*;
public class FacebookUserXMLParser {
protected static function parseWorkHistory(_arg1:XML, _arg2:Namespace):Array{
var _local5:Object;
var _local6:FacebookWorkInfo;
var _local3:Array = [];
var _local4:XMLList = _arg1.children();
for each (_local5 in _local4) {
_local6 = new FacebookWorkInfo();
_local6.location = FacebookXMLParserUtils.createLocation(_local5._arg2::location[0], _arg2);
_local6.company_name = String(_local5._arg2::company_name);
_local6.description = String(_local5._arg2::description);
_local6.position = String(_local5._arg2::position);
_local6.start_date = FacebookDataUtils.formatDate(_local5._arg2::start_date);
_local6.end_date = FacebookDataUtils.formatDate(_local5._arg2::end_date);
_local3.push(_local6);
};
return (_local3);
}
protected static function createStatus(_arg1:XML, _arg2:Namespace):StatusData{
var _local3:StatusData = new StatusData();
_local3.message = String(_arg1._arg2::message);
_local3.time = FacebookDataUtils.formatDate(String(_arg1._arg2::time));
return (_local3);
}
protected static function parseEducationHistory(_arg1:XML, _arg2:Namespace):Array{
var _local5:Object;
var _local6:FacebookEducationInfo;
var _local7:XML;
var _local3:Array = [];
var _local4:XMLList = _arg1.children();
for each (_local5 in _local4) {
_local6 = new FacebookEducationInfo();
_local6.name = String(_local5._arg2::name);
_local6.year = String(_local5._arg2::year);
_local6.degree = String(_local5._arg2::degree);
_local6.concentrations = [];
for each (_local7 in _local5.concentration) {
_local6.concentrations.push(_local7);
};
_local3.push(_local6);
};
return (_local3);
}
public static function createFacebookUser(_arg1:XML, _arg2:Namespace):FacebookUser{
var _local6:XML;
var _local7:String;
var _local3:FacebookUser = new FacebookUser();
var _local4:XMLList = _arg1.children();
var _local5:uint = _local4.length();
var _local8:uint;
while (_local8 < _local5) {
_local6 = _local4[_local8];
_local7 = _local6.localName().toString();
switch (_local7){
case "status":
_local3[_local7] = createStatus(_local6, _arg2);
break;
case "affiliations":
_local3[_local7] = createAffiliations(_local6.children(), _arg2);
break;
case "hometown_location":
case "current_location":
_local3[_local7] = FacebookXMLParserUtils.createLocation(_local6, _arg2);
break;
case "profile_update_time":
_local3[_local7] = FacebookDataUtils.formatDate(_local6.toString());
break;
case "hs_info":
_local3.hs1_id = parseInt(_local6._arg2::hs1_id);
_local3.hs1_name = String(_local6._arg2::hs1_name);
_local3.hs2_id = parseInt(_local6._arg2::hs2_id);
_local3.hs2_name = String(_local6._arg2::hs2_name);
_local3.grad_year = String(_local6._arg2::grad_year);
break;
case "education_history":
_local3[_local7] = parseEducationHistory(_local6, _arg2);
break;
case "work_history":
_local3[_local7] = parseWorkHistory(_local6, _arg2);
break;
case "timezone":
case "notes_count":
case "wall_count":
_local3[_local7] = Number(_local6.toString());
break;
case "has_added_app":
case "is_app_user":
_local3[_local7] = FacebookXMLParserUtils.toBoolean(_local6);
break;
case "meeting_sex":
case "meeting_for":
case "email_hashes":
_local3[_local7] = toArray(_local6, _arg2);
break;
default:
if ((_local7 in _local3)){
_local3[_local7] = String(_local6);
};
};
_local8++;
};
return (_local3);
}
protected static function toArray(_arg1:XML, _arg2:Namespace):Array{
var _local3:Array = [];
var _local4:XMLList = _arg1.children();
var _local5:uint = _local4.length();
var _local6:uint;
while (_local6 < _local5) {
_local3.push(_local4[_local6].toString());
_local6++;
};
return (_local3);
}
protected static function createAffiliations(_arg1:XMLList, _arg2:Namespace):Array{
var _local4:*;
var _local5:FacebookNetwork;
var _local3:Array = [];
for each (_local4 in _arg1) {
_local5 = new FacebookNetwork();
_local5.nid = parseInt(_local4._arg2::nid);
_local5.name = String(_local4._arg2::name);
_local5.type = String(_local4._arg2::type);
_local5.status = String(_local4._arg2::status);
_local5.year = String(_local4._arg2::year);
_local3.push(_local5);
};
return (_local3);
}
}
}//package com.facebook.utils
Section 243
//FacebookXMLParserUtils (com.facebook.utils.FacebookXMLParserUtils)
package com.facebook.utils {
import flash.net.*;
import com.facebook.data.*;
import com.facebook.data.photos.*;
public class FacebookXMLParserUtils {
public static function createAlbumCollection(_arg1:XML, _arg2:Namespace):AlbumCollection{
var _local4:*;
var _local5:AlbumData;
var _local3:AlbumCollection = new AlbumCollection();
for each (_local4 in _arg1.._arg2::album) {
_local5 = new AlbumData();
_local5.aid = FacebookXMLParserUtils.toStringValue(_local4._arg2::aid[0]);
_local5.cover_pid = FacebookXMLParserUtils.toStringValue(_local4._arg2::cover_pid[0]);
_local5.owner = _local4._arg2::owner;
_local5.name = _local4._arg2::name;
_local5.created = FacebookXMLParserUtils.toDate(_local4._arg2::created);
_local5.modified = FacebookXMLParserUtils.toDate(_local4._arg2::modified);
_local5.description = _local4._arg2::description;
_local5.location = _local4._arg2::location;
_local5.link = _local4._arg2::link;
_local5.size = _local4._arg2::size;
_local5.visible = _local4._arg2::visible;
_local5.modified_major = FacebookXMLParserUtils.toDate(_local4._arg2::modified_major);
_local5.edit_link = _local4._arg2::edit_link;
_local5.type = _local4._arg2::type;
_local3.addAlbum(_local5);
};
return (_local3);
}
public static function toNumber(_arg1:XML):Number{
if (_arg1 == null){
return (NaN);
};
return (Number(_arg1.toString()));
}
public static function toStringValue(_arg1:XML):String{
if (_arg1 == null){
return (null);
};
return (_arg1.toString());
}
public static function toDate(_arg1:String):Date{
if (_arg1 == null){
return (null);
};
var _local2:String = _arg1;
while (_local2.length < 13) {
_local2 = (_local2 + "0");
};
var _local3:Date = new Date(Number(_local2));
return (_local3);
}
public static function xmlListToObjectArray(_arg1:XMLList):Array{
var _local2:Array = [];
if (_arg1 == null){
return (_local2);
};
var _local3:uint = _arg1.length();
var _local4:uint;
while (_local4 < _local3) {
_local2.push(xmlToObject(_arg1[_local4]));
_local4++;
};
return (_local2);
}
public static function toUIDArray(_arg1:XML):Array{
var _local2:Array = [];
if (_arg1 == null){
return (_local2);
};
var _local3:XMLList = _arg1.children();
var _local4:uint = _local3.length();
var _local5:uint;
while (_local5 < _local4) {
_local2.push(toNumber(_local3[_local5]));
_local5++;
};
return (_local2);
}
public static function toBoolean(_arg1:XML):Boolean{
if (_arg1 == null){
return (false);
};
return ((_arg1.toString() == "1"));
}
public static function createLocation(_arg1:XML, _arg2:Namespace):FacebookLocation{
var _local3:FacebookLocation = new FacebookLocation();
if (_arg1 == null){
return (_local3);
};
_local3.city = String(_arg1._arg2::city);
_local3.state = String(_arg1._arg2::state);
_local3.country = String(_arg1._arg2::country);
_local3.zip = String(_arg1._arg2::zip);
_local3.street = String(_arg1._arg2::street);
return (_local3);
}
public static function xmlToObject(_arg1:XML):Object{
var _local6:XML;
var _local2:Object = {};
var _local3:XMLList = _arg1.children();
var _local4:uint = _local3.length();
var _local5:uint;
while (_local5 < _local4) {
_local6 = _local3[_local5];
_local2[_local6.localName()] = _local6.toString();
_local5++;
};
return (_local2);
}
public static function xmlToUrlVariables(_arg1:XMLList):URLVariables{
var _local3:XML;
var _local2:URLVariables = new URLVariables();
for each (_local3 in _arg1) {
_local2[_local3.key.valueOf()] = _local3.value.valueOf();
};
return (_local2);
}
public static function nodeToObject(_arg1:XMLList):Object{
var _local3:XML;
var _local2:Object = {};
for each (_local3 in _arg1) {
_local2[_local3.key.valueOf()] = _local3.value.valueOf();
};
return (_local2);
}
public static function toArray(_arg1:XML):Array{
if (_arg1 == null){
return (null);
};
return (_arg1.toString().split(","));
}
}
}//package com.facebook.utils
Section 244
//FBJSBridgeUtil (com.facebook.utils.FBJSBridgeUtil)
package com.facebook.utils {
import flash.events.*;
import flash.net.*;
import com.facebook.events.*;
import com.facebook.data.*;
public class FBJSBridgeUtil extends EventDispatcher {
protected var _params:Array;
protected var _methodName:String;
public var fb_fbjs_connection:String;
public var _api_key:String;
public var fb_local_connection:String;
protected static var receiveConnection:LocalConnection;
protected static var connection:LocalConnection;
public function FBJSBridgeUtil(_arg1:String, _arg2:String, _arg3:String){
var api_key = _arg1;
var fb_local_connection = _arg2;
var fb_fbjs_connection = _arg3;
super();
this._api_key = api_key;
this.fb_local_connection = fb_local_connection;
this.fb_fbjs_connection = fb_fbjs_connection;
if (connection == null){
connection = new LocalConnection();
connection.allowInsecureDomain("*");
connection.allowDomain("*");
connection.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onSendError, false, 0, true);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSendError, false, 0, true);
connection.addEventListener(StatusEvent.STATUS, onSendStatus, false, 0, true);
};
if (receiveConnection == null){
receiveConnection = new LocalConnection();
receiveConnection.allowInsecureDomain("apps.facebook.com", "apps.*.facebook.com");
receiveConnection.allowDomain("apps.facebook.com", "apps.*.facebook.com");
receiveConnection.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onReceiveError, false, 0, true);
receiveConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onReceiveError, false, 0, true);
receiveConnection.addEventListener(StatusEvent.STATUS, onReceiveStatus, false, 0, true);
receiveConnection.client = {asFunction:asFunction};
try {
receiveConnection.connect(fb_fbjs_connection);
} catch(e) {
};
};
}
protected function onSendStatus(_arg1:StatusEvent):void{
dispatchEvent(_arg1);
}
protected function onSendError(_arg1:ErrorEvent):void{
dispatchEvent(_arg1);
}
protected function asFunction(... _args):void{
var _local2:FBJSData = new FBJSData();
_local2.results = _args;
dispatchEvent(new FacebookEvent(FacebookEvent.COMPLETE, false, false, true, _local2));
}
protected function onReceiveError(_arg1:ErrorEvent):void{
dispatchEvent(_arg1);
}
protected function execute():void{
connection.send(fb_local_connection, "callFBJS", _methodName, _params);
}
protected function onReceiveStatus(_arg1:StatusEvent):void{
dispatchEvent(_arg1);
}
public function close():void{
try {
connection.close();
} catch(e) {
};
try {
receiveConnection.close();
} catch(e) {
};
}
public function call(_arg1:String, ... _args):void{
_methodName = _arg1;
_params = _args;
execute();
}
}
}//package com.facebook.utils
Section 245
//IFacebookResultParser (com.facebook.utils.IFacebookResultParser)
package com.facebook.utils {
import com.facebook.data.*;
import com.facebook.errors.*;
public interface IFacebookResultParser {
function parse(_arg1:String, _arg2:String):FacebookData;
function validateFacebookResponce(_arg1:String):FacebookError;
}
}//package com.facebook.utils
Section 246
//JavascriptRequestHelper (com.facebook.utils.JavascriptRequestHelper)
package com.facebook.utils {
import flash.utils.*;
import flash.net.*;
public class JavascriptRequestHelper {
public static function objectToString(_arg1:Object):String{
var _local3:String;
var _local2:Array = [];
for (_local3 in _arg1) {
_local2.push((((_local3 + ": ") + quote(_arg1[_local3])) + ""));
};
return ((("{" + _local2.join(", ")) + " }"));
}
public static function quote(_arg1:String):String{
var _local2:RegExp = /[\\"\r\n]/g;
return ((("\"" + _arg1.replace(_local2, _quote)) + "\""));
}
public static function formatParams(_arg1:Array):String{
var _local5:Object;
var _local6:String;
var _local2:Array = [];
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
_local5 = _arg1[_local4];
_local6 = getQualifiedClassName(_local5);
switch (_local6){
case "Array":
_local5 = (("[" + _local5.join(", ")) + "]");
break;
case "Object":
_local5 = objectToString(_local5);
break;
case "String":
default:
_local5 = (("\"" + _local5) + "\"");
break;
};
_local2.push(_local5);
_local4++;
};
return (_local2.join(", "));
}
protected static function _quote(_arg1:String, ... _args):String{
switch (_arg1){
case "\\":
return ("\\\\");
case "\r":
return ("\\r");
case "\n":
return ("\\n");
case "\"":
return ("\\\"");
};
return (null);
}
public static function formatURLVariables(_arg1:URLVariables):String{
var _local5:String;
var _local2:Object = {method:true, sig:true, api_key:true, call_id:true};
var _local3:Boolean;
var _local4:Object = {};
for (_local5 in _arg1) {
if (_local2[_local5]){
} else {
_local3 = true;
_local4[_local5] = _arg1[_local5];
};
};
return ((_local3) ? objectToString(_local4) : "null");
}
}
}//package com.facebook.utils
Section 247
//PlayerUtils (com.facebook.utils.PlayerUtils)
package com.facebook.utils {
import flash.system.*;
public class PlayerUtils {
protected static var versionObj:Object;
public static function get internalBuildNumber():Number{
return (parseVersionString().internalBuildNumber);
}
public static function get platform():String{
return (parseVersionString().platform);
}
public static function get buildNumber():Number{
return (parseVersionString().buildNumber);
}
public static function get minorVersion():Number{
return (parseVersionString().minorVersion);
}
public static function parseVersionString():Object{
if (versionObj != null){
return (versionObj);
};
var _local1:String = Capabilities.version;
versionObj = {};
var _local2:Array = _local1.split(" ");
versionObj.platform = _local2[0];
_local2.shift();
_local2 = _local2[0].split(",");
versionObj.majorVersion = Number(_local2[0]);
versionObj.minorVersion = Number(_local2[1]);
versionObj.buildNumber = Number(_local2[2]);
versionObj.internalBuildNumber = Number(_local2[3]);
return (versionObj);
}
public static function get majorVersion():Number{
return (parseVersionString().majorVersion);
}
}
}//package com.facebook.utils
Section 248
//PostRequest (com.facebook.utils.PostRequest)
package com.facebook.utils {
import flash.utils.*;
public class PostRequest {
protected var _boundary:String;// = "-----"
protected var postData:ByteArray;
public function PostRequest(){
createPostData();
}
public function getPostData():ByteArray{
postData.position = 0;
return (postData);
}
protected function writeBoundary():void{
writeDoubleDash();
var _local1:Number = 0;
while (_local1 < boundary.length) {
postData.writeByte(boundary.charCodeAt(_local1));
_local1++;
};
}
protected function writeDoubleDash():void{
postData.writeShort(0x2D2D);
}
public function writeFileData(_arg1:String, _arg2:ByteArray, _arg3:String):void{
var _local4:String;
writeBoundary();
writeLineBreak();
_local4 = "Content-Disposition: form-data; filename=\"";
var _local5:Number = 0;
while (_local5 < _local4.length) {
postData.writeByte(_local4.charCodeAt(_local5));
_local5++;
};
postData.writeUTFBytes(_arg1);
writeQuotationMark();
writeLineBreak();
_local4 = _arg3;
_local5 = 0;
while (_local5 < _local4.length) {
postData.writeByte(_local4.charCodeAt(_local5));
_local5++;
};
writeLineBreak();
writeLineBreak();
_arg2.position = 0;
postData.writeBytes(_arg2, 0, _arg2.length);
writeLineBreak();
}
public function createPostData():void{
postData = new ByteArray();
postData.endian = Endian.BIG_ENDIAN;
}
public function writePostData(_arg1:String, _arg2:String):void{
var _local3:String;
writeBoundary();
writeLineBreak();
_local3 = (("Content-Disposition: form-data; name=\"" + _arg1) + "\"");
var _local4:uint = _local3.length;
var _local5:Number = 0;
while (_local5 < _local4) {
postData.writeByte(_local3.charCodeAt(_local5));
_local5++;
};
writeLineBreak();
writeLineBreak();
postData.writeUTFBytes(_arg2);
writeLineBreak();
}
public function get boundary():String{
return (_boundary);
}
protected function writeLineBreak():void{
postData.writeShort(3338);
}
public function close():void{
writeBoundary();
writeDoubleDash();
}
protected function writeQuotationMark():void{
postData.writeByte(34);
}
public function set boundary(_arg1:String):void{
_boundary = _arg1;
}
}
}//package com.facebook.utils
Section 249
//Facebook (com.facebook.Facebook)
package com.facebook {
import flash.events.*;
import flash.net.*;
import com.facebook.events.*;
import com.facebook.session.*;
import com.facebook.net.*;
import com.facebook.delegates.*;
import com.facebook.commands.auth.*;
public class Facebook extends EventDispatcher {
public var waiting_for_login:Boolean;
protected var _currentSession:IFacebookSession;
public var connectionErrorMessage:String;
public function Facebook():void{
}
public function post(_arg1:FacebookCall):FacebookCall{
var _local2:IFacebookCallDelegate;
if (_currentSession){
_arg1.session = _currentSession;
_arg1.initialize();
_local2 = _currentSession.post(_arg1);
_arg1.delegate = _local2;
} else {
throw (new Error("Cannot post a call; no session has been set."));
};
return (_arg1);
}
public function startSession(_arg1:IFacebookSession):void{
_currentSession = _arg1;
if (_currentSession.is_connected){
dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
} else {
_currentSession.addEventListener(FacebookEvent.CONNECT, onSessionConnected);
_currentSession.addEventListener(FacebookEvent.WAITING_FOR_LOGIN, onWaitingForLogin);
};
}
public function grantExtendedPermission(_arg1:String):void{
navigateToURL(new URLRequest(((((("http://www.facebook.com/authorize.php?api_key=" + api_key) + "&v=") + api_version) + "&ext_perm=") + _arg1)), "_self");
}
public function refreshSession():void{
_currentSession.refreshSession();
}
public function logout():void{
var _local1:ExpireSession = new ExpireSession();
_local1.addEventListener(FacebookEvent.COMPLETE, onLoggedOut, false, 0, true);
post(_local1);
}
public function get api_version():String{
return ((_currentSession) ? this._currentSession.api_version : null);
}
protected function onLoggedOut(_arg1:FacebookEvent):void{
if (_arg1.success == true){
_currentSession.session_key = null;
};
dispatchEvent(new FacebookEvent(FacebookEvent.LOGOUT, false, false, _arg1.success, _arg1.data, _arg1.error));
}
protected function onWaitingForLogin(_arg1:FacebookEvent):void{
waiting_for_login = true;
dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
}
public function login(_arg1:Boolean):void{
_currentSession.login(_arg1);
}
public function get secret():String{
return ((_currentSession) ? this._currentSession.secret : null);
}
public function grantPermission(_arg1:Boolean):void{
var _local2:String = ((("http://www.facebook.com/login.php?return_session=" + (_arg1) ? 1 : 0) + "&api_key=") + api_key);
navigateToURL(new URLRequest(_local2), "_self");
}
public function get is_connected():Boolean{
return ((_currentSession) ? this._currentSession.is_connected : false);
}
public function get session_key():String{
return ((_currentSession) ? this._currentSession.session_key : null);
}
public function get uid():String{
return ((_currentSession) ? this._currentSession.uid : null);
}
protected function onSessionConnected(_arg1:FacebookEvent):void{
var _local2:IFacebookSession = (_arg1.target as IFacebookSession);
dispatchEvent(_arg1);
}
public function get api_key():String{
return ((_currentSession) ? this._currentSession.api_key : null);
}
public function get expires():Date{
return ((_currentSession) ? this._currentSession.expires : new Date());
}
}
}//package com.facebook
Section 250
//facebook_internal (com.facebook.facebook_internal)
package com.facebook {
public namespace facebook_internal = "http://api.facebook.com/1.0/";
}//package com.facebook
Section 251
//ColorMatrix (com.gskinner.geom.ColorMatrix)
package com.gskinner.geom {
public dynamic class ColorMatrix extends Array {
private static const IDENTITY_MATRIX:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
private static const LENGTH:Number = IDENTITY_MATRIX.length;
private static const DELTA_INDEX:Array = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10];
public function ColorMatrix(_arg1:Array=null){
_arg1 = fixMatrix(_arg1);
copyMatrix(((_arg1.length)==LENGTH) ? _arg1 : IDENTITY_MATRIX);
}
public function adjustBrightness(_arg1:Number):void{
_arg1 = cleanValue(_arg1, 0xFF);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
multiplyMatrix([1, 0, 0, 0, _arg1, 0, 1, 0, 0, _arg1, 0, 0, 1, 0, _arg1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustSaturation(_arg1:Number):void{
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
var _local2:Number = (1 + ((_arg1)>0) ? ((3 * _arg1) / 100) : (_arg1 / 100));
var _local3:Number = 0.3086;
var _local4:Number = 0.6094;
var _local5:Number = 0.082;
multiplyMatrix([((_local3 * (1 - _local2)) + _local2), (_local4 * (1 - _local2)), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), ((_local4 * (1 - _local2)) + _local2), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), (_local4 * (1 - _local2)), ((_local5 * (1 - _local2)) + _local2), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
protected function multiplyMatrix(_arg1:Array):void{
var _local4:uint;
var _local5:Number;
var _local6:Number;
var _local2:Array = [];
var _local3:uint;
while (_local3 < 5) {
_local4 = 0;
while (_local4 < 5) {
_local2[_local4] = this[(_local4 + (_local3 * 5))];
_local4++;
};
_local4 = 0;
while (_local4 < 5) {
_local5 = 0;
_local6 = 0;
while (_local6 < 5) {
_local5 = (_local5 + (_arg1[(_local4 + (_local6 * 5))] * _local2[_local6]));
_local6++;
};
this[(_local4 + (_local3 * 5))] = _local5;
_local4++;
};
_local3++;
};
}
protected function cleanValue(_arg1:Number, _arg2:Number):Number{
return (Math.min(_arg2, Math.max(-(_arg2), _arg1)));
}
public function adjustHue(_arg1:Number):void{
_arg1 = ((cleanValue(_arg1, 180) / 180) * Math.PI);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
var _local2:Number = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
var _local4:Number = 0.213;
var _local5:Number = 0.715;
var _local6:Number = 0.072;
multiplyMatrix([((_local4 + (_local2 * (1 - _local4))) + (_local3 * -(_local4))), ((_local5 + (_local2 * -(_local5))) + (_local3 * -(_local5))), ((_local6 + (_local2 * -(_local6))) + (_local3 * (1 - _local6))), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * 0.143)), ((_local5 + (_local2 * (1 - _local5))) + (_local3 * 0.14)), ((_local6 + (_local2 * -(_local6))) + (_local3 * -0.283)), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * -((1 - _local4)))), ((_local5 + (_local2 * -(_local5))) + (_local3 * _local5)), ((_local6 + (_local2 * (1 - _local6))) + (_local3 * _local6)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function toString():String{
return ((("ColorMatrix [ " + this.join(" , ")) + " ]"));
}
protected function fixMatrix(_arg1:Array=null):Array{
if (_arg1 == null){
return (IDENTITY_MATRIX);
};
if ((_arg1 is ColorMatrix)){
_arg1 = _arg1.slice(0);
};
if (_arg1.length < LENGTH){
_arg1 = _arg1.slice(0, _arg1.length).concat(IDENTITY_MATRIX.slice(_arg1.length, LENGTH));
} else {
if (_arg1.length > LENGTH){
_arg1 = _arg1.slice(0, LENGTH);
};
};
return (_arg1);
}
public function reset():void{
var _local1:uint;
while (_local1 < LENGTH) {
this[_local1] = IDENTITY_MATRIX[_local1];
_local1++;
};
}
public function adjustContrast(_arg1:Number):void{
var _local2:Number;
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
if (_arg1 < 0){
_local2 = (127 + ((_arg1 / 100) * 127));
} else {
_local2 = (_arg1 % 1);
if (_local2 == 0){
_local2 = DELTA_INDEX[_arg1];
} else {
_local2 = ((DELTA_INDEX[(_arg1 << 0)] * (1 - _local2)) + (DELTA_INDEX[((_arg1 << 0) + 1)] * _local2));
};
_local2 = ((_local2 * 127) + 127);
};
multiplyMatrix([(_local2 / 127), 0, 0, 0, (0.5 * (127 - _local2)), 0, (_local2 / 127), 0, 0, (0.5 * (127 - _local2)), 0, 0, (_local2 / 127), 0, (0.5 * (127 - _local2)), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustColor(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
adjustHue(_arg4);
adjustContrast(_arg2);
adjustBrightness(_arg1);
adjustSaturation(_arg3);
}
protected function copyMatrix(_arg1:Array):void{
var _local2:Number = LENGTH;
var _local3:uint;
while (_local3 < _local2) {
this[_local3] = _arg1[_local3];
_local3++;
};
}
public function concat(_arg1:Array):void{
_arg1 = fixMatrix(_arg1);
if (_arg1.length != LENGTH){
return;
};
multiplyMatrix(_arg1);
}
public function clone():ColorMatrix{
return (new ColorMatrix(this));
}
public function toArray():Array{
return (slice(0, 20));
}
}
}//package com.gskinner.geom
Section 252
//Circular (com.gskinner.motion.easing.Circular)
package com.gskinner.motion.easing {
public class Circular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.sqrt((1 - ((_arg1 - 1) * (_arg1 - 1)))));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (-((Math.sqrt((1 - (_arg1 * _arg1))) - 1)));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 * 2);
return (((_arg1)<1) ? (-0.5 * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) : _arg1 = (_arg1 - 2);
(0.5 * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)));
}
}
}//package com.gskinner.motion.easing
Section 253
//Quadratic (com.gskinner.motion.easing.Quadratic)
package com.gskinner.motion.easing {
public class Quadratic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((-(_arg1) * (_arg1 - 2)));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((_arg1 * _arg1));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)<0.5) ? ((2 * _arg1) * _arg1) : (((-2 * _arg1) * (_arg1 - 2)) - 1));
}
}
}//package com.gskinner.motion.easing
Section 254
//BlurPlugin (com.gskinner.motion.plugins.BlurPlugin)
package com.gskinner.motion.plugins {
import com.gskinner.motion.*;
import flash.filters.*;
public class BlurPlugin implements IGTweenPlugin {
public static var enabled:Boolean = true;
protected static var instance:BlurPlugin;
protected static var tweenProperties:Array = ["blurX", "blurY", "blur"];
public function init(_arg1:GTween, _arg2:String, _arg3:Number):Number{
var _local6:BlurFilter;
if (!(((((_arg1.pluginData.BlurEnabled == null)) && (enabled))) || (_arg1.pluginData.BlurEnabled))){
return (_arg3);
};
var _local4:Array = _arg1.target.filters;
var _local5:uint;
while (_local5 < _local4.length) {
if ((_local4[_local5] is BlurFilter)){
_local6 = _local4[_local5];
_arg1.pluginData.BlurData = {index:_local5};
if (_arg2 == "blur"){
return (((_local6.blurX + _local6.blurY) / 2));
};
return (_local6[_arg2]);
};
_local5++;
};
return (0);
}
protected function initTarget(_arg1:GTween):Object{
var _local2:Array = _arg1.target.filters;
_local2.push(new BlurFilter(0, 0, 1));
_arg1.target.filters = _local2;
return ((_arg1.pluginData.BlurData = {index:(_local2.length - 1)}));
}
public function tween(_arg1:GTween, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean):Number{
if (!(((((_arg1.pluginData.BlurEnabled == null)) && (enabled))) || (_arg1.pluginData.BlurEnabled))){
return (_arg3);
};
var _local8:Object = _arg1.pluginData.BlurData;
if (_local8 == null){
_local8 = initTarget(_arg1);
};
var _local9:Array = _arg1.target.filters;
var _local10:BlurFilter = (_local9[_local8.index] as BlurFilter);
if (_local10 == null){
return (_arg3);
};
if (_arg2 == "blur"){
_local10.blurX = (_local10.blurY = _arg3);
} else {
_local10[_arg2] = _arg3;
};
_arg1.target.filters = _local9;
if (_arg7){
delete _arg1.pluginData.BlurData;
};
return (NaN);
}
public static function install():void{
if (instance){
return;
};
instance = new (BlurPlugin);
GTween.installPlugin(instance, tweenProperties);
}
}
}//package com.gskinner.motion.plugins
Section 255
//ColorAdjustPlugin (com.gskinner.motion.plugins.ColorAdjustPlugin)
package com.gskinner.motion.plugins {
import com.gskinner.motion.*;
import com.gskinner.geom.*;
import flash.filters.*;
public class ColorAdjustPlugin implements IGTweenPlugin {
public static var enabled:Boolean = true;
protected static var instance:ColorAdjustPlugin;
protected static var tweenProperties:Array = ["brightness", "contrast", "hue", "saturation"];
public function init(_arg1:GTween, _arg2:String, _arg3:Number):Number{
var _local4:Array;
var _local5:uint;
var _local6:ColorMatrixFilter;
var _local7:Object;
if (!(((((_arg1.pluginData.ColorAdjustEnabled == null)) && (enabled))) || (_arg1.pluginData.ColorAdjustEnabled))){
return (_arg3);
};
if (_arg1.pluginData.ColorAdjustData == null){
_local4 = _arg1.target.filters;
_local5 = 0;
while (_local5 < _local4.length) {
if ((_local4[_local5] is ColorMatrixFilter)){
_local6 = _local4[_local5];
_local7 = {index:_local5, ratio:NaN};
_local7.initMatrix = _local6.matrix;
_local7.matrix = getMatrix(_arg1);
_arg1.pluginData.ColorAdjustData = _local7;
};
_local5++;
};
};
return ((_arg1.getValue(_arg2) - 1));
}
protected function initTarget(_arg1:GTween):Object{
var _local2:Array = _arg1.target.filters;
var _local3:ColorMatrix = new ColorMatrix();
_local2.push(new ColorMatrixFilter(_local3));
_arg1.target.filters = _local2;
var _local4:Object = {index:(_local2.length - 1), ratio:NaN};
_local4.initMatrix = _local3;
_local4.matrix = getMatrix(_arg1);
return ((_arg1.pluginData.ColorAdjustData = _local4));
}
public function tween(_arg1:GTween, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean):Number{
if (!(((((_arg1.pluginData.ColorAdjustEnabled == null)) && (enabled))) || (_arg1.pluginData.ColorAdjustEnabled))){
return (_arg3);
};
var _local8:Object = _arg1.pluginData.ColorAdjustData;
if (_local8 == null){
_local8 = initTarget(_arg1);
};
if (_arg6 == _local8.ratio){
return (_arg3);
};
_local8.ratio = _arg6;
_arg6 = (_arg3 - _arg4);
var _local9:Array = _arg1.target.filters;
var _local10:ColorMatrixFilter = (_local9[_local8.index] as ColorMatrixFilter);
if (_local10 == null){
return (_arg3);
};
var _local11:Array = _local8.initMatrix;
var _local12:Array = _local8.matrix;
if (_arg5 < 0){
_local11 = _local12;
_local12 = _local8.initMatrix;
_arg6 = (_arg6 * -1);
};
var _local13:Array = _local10.matrix;
var _local14:uint = _local13.length;
var _local15:uint;
while (_local15 < _local14) {
_local13[_local15] = (_local11[_local15] + ((_local12[_local15] - _local11[_local15]) * _arg6));
_local15++;
};
_local10.matrix = _local13;
_arg1.target.filters = _local9;
if (_arg7){
delete _arg1.pluginData.ColorAdjustData;
};
return (NaN);
}
protected function getMatrix(_arg1:GTween):ColorMatrix{
var _local2:Number = fixValue(_arg1.getValue("brightness"));
var _local3:Number = fixValue(_arg1.getValue("contrast"));
var _local4:Number = fixValue(_arg1.getValue("saturation"));
var _local5:Number = fixValue(_arg1.getValue("hue"));
var _local6:ColorMatrix = new ColorMatrix();
_local6.adjustColor(_local2, _local3, _local4, _local5);
return (_local6);
}
protected function fixValue(_arg1:Number):Number{
return ((isNaN(_arg1)) ? 0 : _arg1);
}
public static function install():void{
if (instance){
return;
};
instance = new (ColorAdjustPlugin);
GTween.installPlugin(instance, tweenProperties);
}
}
}//package com.gskinner.motion.plugins
Section 256
//ColorTransformPlugin (com.gskinner.motion.plugins.ColorTransformPlugin)
package com.gskinner.motion.plugins {
import flash.geom.*;
import com.gskinner.motion.*;
public class ColorTransformPlugin {
public static var enabled:Boolean = true;
protected static var installed:Boolean = false;
protected static var tweenProperties:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset", "tint"];
public static function init(_arg1:GTween, _arg2:String, _arg3:Number):Number{
var _local4:ColorTransform;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
if (!((((enabled) && ((_arg1.pluginData.ColorTransformEnabled == null)))) || (_arg1.pluginData.ColorTransformEnabled))){
return (_arg3);
};
if (_arg2 == "tint"){
_local4 = _arg1.target.transform.colorTransform;
_local5 = Math.min(1, (1 - _local4.redMultiplier));
_local6 = Math.min(0xFF, (_local4.redOffset * _local5));
_local7 = Math.min(0xFF, (_local4.greenOffset * _local5));
_local8 = Math.min(0xFF, (_local4.blueOffset * _local5));
_local9 = (((((_local5 * 0xFF) << 24) | (_local6 << 16)) | (_local7 << 8)) | _local8);
return (_local9);
};
return (_arg1.target.transform.colorTransform[_arg2]);
}
public static function tween(_arg1:GTween, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean):Number{
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:Number;
if (!(((((_arg1.pluginData.ColorTransformEnabled == null)) && (enabled))) || (_arg1.pluginData.ColorTransformEnabled))){
return (_arg3);
};
var _local8:ColorTransform = _arg1.target.transform.colorTransform;
if (_arg2 == "tint"){
_local9 = ((_arg4 >> 24) & 0xFF);
_local10 = ((_arg4 >> 16) & 0xFF);
_local11 = ((_arg4 >> 8) & 0xFF);
_local12 = (_arg4 & 0xFF);
_local13 = ((_arg4 + _arg5) >> 0);
_local14 = (_local9 + (_arg6 * (((_local13 >> 24) & 0xFF) - _local9)));
_local15 = (_local10 + (_arg6 * (((_local13 >> 16) & 0xFF) - _local10)));
_local16 = (_local11 + (_arg6 * (((_local13 >> 8) & 0xFF) - _local11)));
_local17 = (_local12 + (_arg6 * ((_local13 & 0xFF) - _local12)));
_local18 = (1 - (_local14 / 0xFF));
_arg1.target.transform.colorTransform = new ColorTransform(_local18, _local18, _local18, _local8.alphaMultiplier, _local15, _local16, _local17, _local8.alphaOffset);
} else {
_local8[_arg2] = _arg3;
_arg1.target.transform.colorTransform = _local8;
};
return (NaN);
}
public static function install():void{
if (installed){
return;
};
installed = true;
GTween.installPlugin(ColorTransformPlugin, tweenProperties, true);
}
}
}//package com.gskinner.motion.plugins
Section 257
//IGTweenPlugin (com.gskinner.motion.plugins.IGTweenPlugin)
package com.gskinner.motion.plugins {
import com.gskinner.motion.*;
public interface IGTweenPlugin {
function init(_arg1:GTween, _arg2:String, _arg3:Number):Number;
function tween(_arg1:GTween, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean):Number;
}
}//package com.gskinner.motion.plugins
Section 258
//MotionBlurPlugin (com.gskinner.motion.plugins.MotionBlurPlugin)
package com.gskinner.motion.plugins {
import com.gskinner.motion.*;
import flash.filters.*;
public class MotionBlurPlugin implements IGTweenPlugin {
public static var strength:Number = 0.6;
protected static var instance:MotionBlurPlugin;
public static var enabled:Boolean = false;
public function init(_arg1:GTween, _arg2:String, _arg3:Number):Number{
return (_arg3);
}
protected function initTarget(_arg1:GTween):Object{
var _local2:Array = _arg1.target.filters;
_local2.push(new BlurFilter(0, 0, 1));
_arg1.target.filters = _local2;
return ((_arg1.pluginData.MotionBlurData = {index:(_local2.length - 1)}));
}
public function tween(_arg1:GTween, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean):Number{
var _local11:Number;
if (!((((enabled) && ((_arg1.pluginData.MotionBlurEnabled == null)))) || (_arg1.pluginData.MotionBlurEnabled))){
return (_arg3);
};
var _local8:Object = _arg1.pluginData.MotionBlurData;
if (_local8 == null){
_local8 = initTarget(_arg1);
};
var _local9:Array = _arg1.target.filters;
var _local10:BlurFilter = (_local9[_local8.index] as BlurFilter);
if (_local10 == null){
return (_arg3);
};
if (_arg7){
_local9.splice(_local8.index, 1);
delete _arg1.pluginData.MotionBlurData;
} else {
_local11 = Math.abs((((_arg1.ratioOld - _arg6) * _arg5) * strength));
if (_arg2 == "x"){
_local10.blurX = _local11;
} else {
_local10.blurY = _local11;
};
};
_arg1.target.filters = _local9;
return (_arg3);
}
public static function install():void{
if (instance){
return;
};
instance = new (MotionBlurPlugin);
GTween.installPlugin(instance, ["x", "y"]);
}
}
}//package com.gskinner.motion.plugins
Section 259
//GTween (com.gskinner.motion.GTween)
package com.gskinner.motion {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class GTween extends EventDispatcher {
protected var _rangeValues:Object;
public var autoPlay:Boolean;// = true
protected var _delay:Number;// = 0
public var ratio:Number;
public var pluginData:Object;
public var useFrames:Boolean;
protected var _position:Number;
public var target:Object;
public var duration:Number;
public var onInit:Function;
public var calculatedPosition:Number;
public var calculatedPositionOld:Number;
public var ratioOld:Number;
public var data;
public var suppressEvents:Boolean;
public var dispatchEvents:Boolean;
public var repeatCount:int;// = 1
public var nextTween:GTween;
public var reflect:Boolean;
public var positionOld:Number;
protected var _values:Object;
public var onComplete:Function;
protected var _paused:Boolean;// = true
protected var _inited:Boolean;
public var ease:Function;
protected var _proxy:TargetProxy;
protected var _initValues:Object;
public var onChange:Function;
public var timeScale:Number;// = 1
public static var pauseAll:Boolean = false;
protected static var time:Number;
public static var defaultEase:Function = linearEase;
public static var defaultDispatchEvents:Boolean = false;
public static var version:Number = 2.01;
protected static var tickList:Dictionary = new Dictionary(true);
protected static var plugins:Object = {};
protected static var shape:Shape;
public static var timeScaleAll:Number = 1;
protected static var gcLockList:Dictionary = new Dictionary(false);
protected static var hasStarPlugins:Boolean = false;
public function GTween(_arg1:Object=null, _arg2:Number=1, _arg3:Object=null, _arg4:Object=null, _arg5:Object=null){
var _local6:Boolean;
super();
ease = defaultEase;
dispatchEvents = defaultDispatchEvents;
this.target = _arg1;
this.duration = _arg2;
this.pluginData = copy(_arg5, {});
if (_arg4){
_local6 = _arg4.swapValues;
delete _arg4.swapValues;
};
copy(_arg4, this);
resetValues(_arg3);
if (_local6){
swapValues();
};
if ((((((this.duration == 0)) && ((delay == 0)))) && (autoPlay))){
position = 0;
};
}
public function get delay():Number{
return (_delay);
}
public function getInitValue(_arg1:String):Number{
return (_initValues[_arg1]);
}
public function set delay(_arg1:Number):void{
if (_position <= 0){
_position = -(_arg1);
};
_delay = _arg1;
}
public function init():void{
var _local1:String;
var _local2:Array;
var _local3:uint;
var _local4:Number;
var _local5:uint;
_inited = true;
_initValues = {};
_rangeValues = {};
for (_local1 in _values) {
if (plugins[_local1]){
_local2 = plugins[_local1];
_local3 = _local2.length;
_local4 = ((_local1 in target)) ? target[_local1] : NaN;
_local5 = 0;
while (_local5 < _local3) {
_local4 = _local2[_local5].init(this, _local1, _local4);
_local5++;
};
if (!isNaN(_local4)){
_rangeValues[_local1] = (_values[_local1] - (_initValues[_local1] = _local4));
};
} else {
_rangeValues[_local1] = (_values[_local1] - (_initValues[_local1] = target[_local1]));
};
};
if (hasStarPlugins){
_local2 = plugins["*"];
_local3 = _local2.length;
_local5 = 0;
while (_local5 < _local3) {
_local2[_local5].init(this, "*", NaN);
_local5++;
};
};
if (!suppressEvents){
if (dispatchEvents){
dispatchEvt("init");
};
if (onInit != null){
onInit(this);
};
};
}
public function getValues():Object{
return (copy(_values, {}));
}
public function setValues(_arg1:Object):void{
copy(_arg1, _values, true);
invalidate();
}
public function get position():Number{
return (_position);
}
protected function dispatchEvt(_arg1:String):void{
if (hasEventListener(_arg1)){
dispatchEvent(new Event(_arg1));
};
}
public function swapValues():void{
var _local2:String;
var _local3:Number;
if (!_inited){
init();
};
var _local1:Object = _values;
_values = _initValues;
_initValues = _local1;
for (_local2 in _rangeValues) {
_rangeValues[_local2] = (_rangeValues[_local2] * -1);
};
if (_position < 0){
_local3 = positionOld;
position = 0;
_position = positionOld;
positionOld = _local3;
} else {
position = _position;
};
}
public function setValue(_arg1:String, _arg2:Number):void{
_values[_arg1] = _arg2;
invalidate();
}
public function get paused():Boolean{
return (_paused);
}
public function getValue(_arg1:String):Number{
return (_values[_arg1]);
}
protected function invalidate():void{
_inited = false;
if (_position > 0){
_position = 0;
};
if (autoPlay){
paused = false;
};
}
protected function copy(_arg1:Object, _arg2:Object, _arg3:Boolean=false):Object{
var _local4:String;
for (_local4 in _arg1) {
if (((_arg3) && ((_arg1[_local4] == null)))){
delete _arg2[_local4];
} else {
_arg2[_local4] = _arg1[_local4];
};
};
return (_arg2);
}
public function deleteValue(_arg1:String):Boolean{
delete _rangeValues[_arg1];
delete _initValues[_arg1];
return (delete _values[_arg1]);
}
public function resetValues(_arg1:Object=null):void{
_values = {};
setValues(_arg1);
}
public function set position(_arg1:Number):void{
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:uint;
var _local10:uint;
positionOld = _position;
ratioOld = ratio;
calculatedPositionOld = calculatedPosition;
var _local2:Number = (repeatCount * duration);
var _local3:Boolean = (((_arg1 >= _local2)) && ((repeatCount > 0)));
if (_local3){
if (calculatedPositionOld == _local2){
return;
};
_position = _local2;
calculatedPosition = (((reflect) && (!((repeatCount & 1))))) ? 0 : duration;
} else {
_position = _arg1;
calculatedPosition = ((_position < 0)) ? 0 : (_position % duration);
if (((reflect) && (((_position / duration) & 1)))){
calculatedPosition = (duration - calculatedPosition);
};
};
ratio = ((((duration == 0)) && ((_position >= 0)))) ? 1 : ease((calculatedPosition / duration), 0, 1, 1);
if (((((target) && ((((_position >= 0)) || ((positionOld >= 0)))))) && (!((calculatedPosition == calculatedPositionOld))))){
if (!_inited){
init();
};
for (_local4 in _values) {
_local5 = _initValues[_local4];
_local6 = _rangeValues[_local4];
_local7 = (_local5 + (_local6 * ratio));
_local8 = plugins[_local4];
if (_local8){
_local9 = _local8.length;
_local10 = 0;
while (_local10 < _local9) {
_local7 = _local8[_local10].tween(this, _local4, _local7, _local5, _local6, ratio, _local3);
_local10++;
};
if (!isNaN(_local7)){
target[_local4] = _local7;
};
} else {
target[_local4] = _local7;
};
};
};
if (hasStarPlugins){
_local8 = plugins["*"];
_local9 = _local8.length;
_local10 = 0;
while (_local10 < _local9) {
_local8[_local10].tween(this, "*", NaN, NaN, NaN, ratio, _local3);
_local10++;
};
};
if (!suppressEvents){
if (dispatchEvents){
dispatchEvt("change");
};
if (onChange != null){
onChange(this);
};
};
if (_local3){
paused = true;
if (nextTween){
nextTween.paused = false;
};
if (!suppressEvents){
if (dispatchEvents){
dispatchEvt("complete");
};
if (onComplete != null){
onComplete(this);
};
};
};
}
public function end():void{
position = ((repeatCount)>0) ? (repeatCount * duration) : duration;
}
public function beginning():void{
position = 0;
paused = true;
}
public function set paused(_arg1:Boolean):void{
if (_arg1 == _paused){
return;
};
_paused = _arg1;
if (_paused){
delete tickList[this];
if ((target is IEventDispatcher)){
target.removeEventListener("_", invalidate);
};
delete gcLockList[this];
} else {
if (((isNaN(_position)) || (((!((repeatCount == 0))) && ((_position >= (repeatCount * duration))))))){
_inited = false;
calculatedPosition = (calculatedPositionOld = (ratio = (ratioOld = (positionOld = 0))));
_position = -(delay);
};
tickList[this] = true;
if ((target is IEventDispatcher)){
target.addEventListener("_", invalidate);
} else {
gcLockList[this] = true;
};
};
}
public function get proxy():TargetProxy{
if (_proxy == null){
_proxy = new TargetProxy(this);
};
return (_proxy);
}
protected static function staticTick(_arg1:Event):void{
var _local4:Object;
var _local5:GTween;
var _local2:Number = time;
time = (getTimer() / 1000);
if (pauseAll){
return;
};
var _local3:Number = ((time - _local2) * timeScaleAll);
for (_local4 in tickList) {
_local5 = (_local4 as GTween);
(_local4 as GTween).position = (_local5._position + ((_local5.useFrames) ? timeScaleAll : _local3 * _local5.timeScale));
};
}
protected static function staticInit():void{
(shape = new Shape()).addEventListener(Event.ENTER_FRAME, staticTick);
time = (getTimer() / 1000);
}
public static function installPlugin(_arg1:Object, _arg2:Array, _arg3:Boolean=false):void{
var _local5:String;
var _local4:uint;
while (_local4 < _arg2.length) {
_local5 = _arg2[_local4];
if (_local5 == "*"){
hasStarPlugins = true;
};
if (plugins[_local5] == null){
plugins[_local5] = [_arg1];
} else {
if (_arg3){
plugins[_local5].unshift(_arg1);
} else {
plugins[_local5].push(_arg1);
};
};
_local4++;
};
}
public static function linearEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (_arg1);
}
staticInit();
}
}//package com.gskinner.motion
import flash.utils.*;
dynamic class TargetProxy extends Proxy {
private var tween:GTween;
private function TargetProxy(_arg1:GTween):void{
this.tween = _arg1;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
tween.deleteValue(_arg1);
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if ((((((_arg2 is Boolean)) || ((_arg2 is String)))) || (isNaN(_arg2)))){
tween.target[_arg1] = _arg2;
} else {
tween.setValue(String(_arg1), Number(_arg2));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(_arg1, ... _args){
return (tween.target[_arg1].apply(null, _args));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
var _local2:Number = tween.getValue(_arg1);
return ((isNaN(_local2)) ? tween.target[_arg1] : _local2);
}
}
Section 260
//DynamicParamsEvent (com.kerb.data.DynamicParamsEvent)
package com.kerb.data {
import com.kerb.utils.*;
public dynamic class DynamicParamsEvent extends DynamicEvent {
public function DynamicParamsEvent(_arg1:String, _arg2:Boolean=false, _arg3:Object=null){
var _local4:String;
super(_arg1, _arg2);
if (_arg3 != null){
for (_local4 in _arg3) {
this[_local4] = _arg3[_local4];
};
};
}
}
}//package com.kerb.data
Section 261
//RemoteDataManager (com.kerb.data.RemoteDataManager)
package com.kerb.data {
import flash.events.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import br.com.stimuli.loading.*;
import br.com.stimuli.loading.loadingtypes.*;
import com.adobe.crypto.*;
public class RemoteDataManager extends EventDispatcher {
private var _bulkLoader:BulkLoader;
public static const EVENT_LOADING_ERROR:String = "remoteDataManagerLoadingError";
public static const GET_COMPETITION_DETAILS:String = "getCompetitionDetails";
public static const GET_TRACK_TIMES:String = "getTrackTimes";
public static const RATE_TRACK:String = "rateTrack";
public static const GET_ACHIEVEMENTS:String = "getAchievements";
public static const GET_TRACK_VECTORS:String = "getTrackVectors";
public static const GET_TIME_DETAILS:String = "getTimeDetails";
public static const GET_CHALLENGES:String = "getChallenges";
public static const GET_ENTERED_CHALLENGES_EXPIRED_SINCE:String = "getEnteredChallengesExpiredSince";
public static const GET_UNREAD_ACHIEVEMENTS:String = "getUnreadAchievements";
private static const ENCRYPT_TIMES:Boolean = true;
public static const GET_TRACKS:String = "getTracks";
public static const GET_USER:String = "getUser";
public static const DELETE_USER_DETAILS:String = "deleteUserDetails";
public static const GET_TRACK_TIMES_AROUND:String = "getTrackTimesAround";
public static const GET_TRACK_DETAILS:String = "getTrackDetails";
public static const CREATE_CHALLENGE:String = "createChallenge";
public static const SAVE_TIME:String = "saveTime";
private static const CHECKSUM_SALT:String = "fishAnDchips";
public static const GET_GHOST_VECTORS:String = "getGhostVectors";
public static const GET_TIMES:String = "getTimes";
public static const REPORT_TRACK:String = "reportTrack";
public static const GET_CHALLENGE_DETAILS:String = "getChallengeDetails";
public static const SEARCH_CHALLENGES:String = "searchChallenges";
public static const SAVE_TRACK:String = "saveTrack";
public static const EVENT_FINISHED_LOADING:String = "remoteDataManagerFinishedLoading";
public static const INVITE_TO_CHALLENGE:String = "inviteToChallenge";
public static const EVENT_STARTED_LOADING:String = "remoteDataManagerStartedLoading";
public static const SEARCH_TRACKS:String = "searchTracks";
private static var _allow:Boolean;
private static var _instance:RemoteDataManager;
public function RemoteDataManager(_arg1:IEventDispatcher=null){
super(_arg1);
if (!_allow){
throw (new Error("class is singleton"));
};
_init();
}
public function getTrackTimes(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
_load(new RemoteLoader(GET_TRACK_TIMES, {trackId:_arg1, challengeId:_arg2, page:_arg3, perPage:_arg4}));
}
public function getUser(_arg1:String, _arg2:String, _arg3:String, _arg4:String):void{
var _local5:String = _createChecksum(new Array(_arg1, _arg2, _arg3, _arg4));
_load(new RemoteLoader(GET_USER, {externalId:_arg1, name:_arg2, email:_arg3, locale:_arg4, checksum:_local5}));
}
private function _load(_arg1:RemoteLoader, _arg2:Boolean=true):void{
if (((!(_bulkLoader.isRunning)) && (_arg2))){
dispatchEvent(new Event(EVENT_STARTED_LOADING));
};
var _local3:LoadingItem = _bulkLoader.add(_arg1.urlRequest, {id:_arg1.type});
_local3.addEventListener(Event.COMPLETE, _onComplete, false, 0, true);
_local3.addEventListener(ErrorEvent.ERROR, _onError, false, 0, true);
_bulkLoader.start();
}
public function reportTrack(_arg1:int, _arg2:int, _arg3:String):void{
var _local4:String = _createChecksum(new Array(_arg1.toString(), _arg2.toString(), _arg3));
_load(new RemoteLoader(REPORT_TRACK, {userId:_arg1, trackId:_arg2, reason:_arg3, checksum:_local4}));
}
private function _onGlobalError(_arg1:ErrorEvent):void{
dispatchEvent(new Event(EVENT_LOADING_ERROR));
if (_bulkLoader.isFinished){
dispatchEvent(new Event(EVENT_FINISHED_LOADING));
};
}
private function _onTestComplete(_arg1:Event):void{
var _local2:String;
trace(("test results for " + _arg1.type));
for (_local2 in _arg1) {
trace(((_local2 + " => ") + _arg1[_local2]));
};
}
public function getEnteredChallengesExpiredSince(_arg1:int, _arg2:Date):void{
_load(new RemoteLoader(GET_ENTERED_CHALLENGES_EXPIRED_SINCE, {userId:_arg1, since:_arg2}));
}
public function rateTrack(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:String = _createChecksum(new Array(_arg1.toString(), _arg2.toString(), _arg3.toString()));
_load(new RemoteLoader(RATE_TRACK, {userId:_arg1, trackId:_arg2, rating:_arg3, checksum:_local4}));
}
public function deleteUserDetails(_arg1:int):void{
_load(new RemoteLoader(DELETE_USER_DETAILS, {userId:_arg1}));
}
public function saveTrack(_arg1:int, _arg2:String, _arg3:int, _arg4:String, _arg5:String, _arg6:int, _arg7:int, _arg8:int, _arg9:int, _arg10:String):void{
var _local11:String = (ENCRYPT_TIMES) ? Crypto.encrypt(_arg8) : _arg8.toString();
var _local12:String = _createChecksum(new Array(_arg1.toString(), _local11, _arg9.toString(), _arg10, _arg2, _arg3.toString(), _arg4, _arg5, _arg6.toString(), _arg7.toString()));
_load(new RemoteLoader(SAVE_TRACK, {userId:_arg1, name:_arg2, environment:_arg3, trackVectors:_arg4, thumbnailData:_arg5, trackLength:_arg6, propCount:_arg7, time:_local11, cart:_arg9, ghostVectors:_arg10, checksum:_local12}));
}
public function searchTracks(_arg1:int, _arg2:String, _arg3:int, _arg4:int, _arg5:String, _arg6:String, _arg7:int, _arg8:String, _arg9:String):void{
_load(new RemoteLoader(SEARCH_TRACKS, {userId:_arg1, sortBy:_arg2, page:_arg3, perPage:_arg4, filterNameType:_arg5, filterName:_arg6, filterEnvironment:_arg7, filterCreatorLocale:_arg8, filterExternalIds:_arg9}));
}
public function getTimeDetails(_arg1:int, _arg2:int, _arg3:int):void{
_load(new RemoteLoader(GET_TIME_DETAILS, {userId:_arg1, trackId:_arg2, challengeId:_arg3}));
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
trace(("***********" + _arg1));
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function getChallengeDetails(_arg1:int, _arg2:int):void{
_load(new RemoteLoader(GET_CHALLENGE_DETAILS, {userId:_arg1, challengeId:_arg2}));
}
private function _createChecksum(_arg1:Array):String{
var _local3:String;
var _local2:String = CHECKSUM_SALT;
for each (_local3 in _arg1) {
_local2 = (_local2 + ("__" + _local3));
};
_local2 = _local2.split("\r").join("");
_local2 = _local2.split("\n").join("");
return (MD5.hash(_local2));
}
private function _onComplete(_arg1:Event):void{
var _local2:LoadingItem = (_arg1.currentTarget as LoadingItem);
_local2.removeEventListener(Event.COMPLETE, _onComplete);
_local2.removeEventListener(ErrorEvent.ERROR, _onError);
var _local3:XML = new XML(_local2.content);
_bulkLoader.remove(_local2.id);
trace(("Loading complete for " + _local2.id));
switch (_local2.id){
case GET_USER:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {user:_getEntity(_local3, UserDetails)}));
break;
case GET_ACHIEVEMENTS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {achievements:_getEntities(_local3, AchievementDetails)}));
break;
case GET_UNREAD_ACHIEVEMENTS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {achievements:_getEntities(_local3, AchievementDetails)}));
break;
case DELETE_USER_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:_getSuccess(_local3)}));
break;
case GET_TRACKS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {tracks:_getEntities(_local3, TrackDetails), totalCount:_getTotalCount(_local3), pages:_getPages(_local3)}));
break;
case GET_TRACK_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {track:_getEntity(_local3, TrackDetails)}));
break;
case GET_TRACK_VECTORS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {vectors:_getEntity(_local3, TrackVectors)}));
break;
case GET_GHOST_VECTORS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {ghosts:_getEntities(_local3, GhostVectors), totalCount:_getTotalCount(_local3)}));
break;
case SEARCH_TRACKS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {tracks:_getEntities(_local3, TrackDetails), totalCount:_getTotalCount(_local3), pages:_getPages(_local3)}));
break;
case SAVE_TRACK:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {track:_getEntity(_local3, TrackDetails)}));
break;
case RATE_TRACK:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:_getSuccess(_local3)}));
break;
case REPORT_TRACK:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:_getSuccess(_local3)}));
break;
case GET_TIMES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {times:_getEntities(_local3, TimeDetails), totalCount:_getTotalCount(_local3), pages:_getPages(_local3)}));
break;
case GET_TIME_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {time:_getEntity(_local3, TimeDetails)}));
break;
case SAVE_TIME:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:_getSuccess(_local3)}));
break;
case GET_TRACK_TIMES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {times:_getEntities(_local3, TimeDetails), totalCount:_getTotalCount(_local3), pages:_getPages(_local3)}));
break;
case GET_TRACK_TIMES_AROUND:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {times:_getEntities(_local3, TimeDetails)}));
break;
case GET_CHALLENGES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenges:_getEntities(_local3, ChallengeDetails), totalCount:_getTotalCount(_local3), pages:_getPages(_local3)}));
break;
case SEARCH_CHALLENGES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenges:_getEntities(_local3, ChallengeDetails), totalCount:_getTotalCount(_local3), pages:_getPages(_local3)}));
break;
case GET_CHALLENGE_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenge:_getEntity(_local3, ChallengeDetails)}));
break;
case GET_COMPETITION_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenge:_getEntity(_local3, ChallengeDetails)}));
break;
case CREATE_CHALLENGE:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenge:_getEntity(_local3, ChallengeDetails)}));
break;
case GET_ENTERED_CHALLENGES_EXPIRED_SINCE:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenges:_getEntities(_local3, ChallengeDetails)}));
break;
case INVITE_TO_CHALLENGE:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:_getSuccess(_local3)}));
break;
};
}
public function testFunctionality():void{
this.addEventListener(GET_USER, _onTestComplete);
this.addEventListener(GET_ACHIEVEMENTS, _onTestComplete);
this.addEventListener(GET_UNREAD_ACHIEVEMENTS, _onTestComplete);
this.addEventListener(DELETE_USER_DETAILS, _onTestComplete);
this.addEventListener(GET_TRACKS, _onTestComplete);
this.addEventListener(GET_TRACK_DETAILS, _onTestComplete);
this.addEventListener(GET_TRACK_VECTORS, _onTestComplete);
this.addEventListener(GET_GHOST_VECTORS, _onTestComplete);
this.addEventListener(SEARCH_TRACKS, _onTestComplete);
this.addEventListener(SAVE_TRACK, _onTestComplete);
this.addEventListener(RATE_TRACK, _onTestComplete);
this.addEventListener(REPORT_TRACK, _onTestComplete);
this.addEventListener(GET_TIMES, _onTestComplete);
this.addEventListener(GET_TIME_DETAILS, _onTestComplete);
this.addEventListener(SAVE_TIME, _onTestComplete);
this.addEventListener(GET_TRACK_TIMES, _onTestComplete);
this.addEventListener(GET_TRACK_TIMES_AROUND, _onTestComplete);
this.addEventListener(GET_CHALLENGES, _onTestComplete);
this.addEventListener(SEARCH_CHALLENGES, _onTestComplete);
this.addEventListener(GET_CHALLENGE_DETAILS, _onTestComplete);
this.addEventListener(GET_COMPETITION_DETAILS, _onTestComplete);
this.addEventListener(CREATE_CHALLENGE, _onTestComplete);
this.addEventListener(GET_ENTERED_CHALLENGES_EXPIRED_SINCE, _onTestComplete);
this.addEventListener(INVITE_TO_CHALLENGE, _onTestComplete);
}
private function _getEntity(_arg1:XML, _arg2:Class){
var _local3:* = null;
if (_arg1.entity[0] != undefined){
_local3 = new _arg2(_arg1.entity[0]);
};
return (_local3);
}
public function getTrackTimesAround(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
_load(new RemoteLoader(GET_TRACK_TIMES_AROUND, {userId:_arg1, trackId:_arg2, challengeId:_arg3, count:_arg4}));
}
public function createChallenge(_arg1:int, _arg2:int, _arg3:String, _arg4:int, _arg5:int, _arg6:int, _arg7:String):void{
var _local8:String = (ENCRYPT_TIMES) ? Crypto.encrypt(_arg5) : _arg5.toString();
var _local9:String = _createChecksum(new Array(_arg1.toString(), _arg2.toString(), _local8, _arg6.toString(), _arg7, _arg4.toString(), _arg3));
_load(new RemoteLoader(CREATE_CHALLENGE, {userId:_arg1, trackId:_arg2, name:_arg3, timePeriod:_arg4, time:_local8, cart:_arg6, ghostVectors:_arg7, checksum:_local9}));
}
public function getAchievements(_arg1:int):void{
_load(new RemoteLoader(GET_ACHIEVEMENTS, {userId:_arg1}));
}
private function _getTotalCount(_arg1:XML):int{
return (parseInt(_arg1.totalCount));
}
public function getChallenges(_arg1:int, _arg2:String, _arg3:int, _arg4:int, _arg5:String, _arg6:String, _arg7:int, _arg8:String, _arg9:String, _arg10:String):void{
_load(new RemoteLoader(GET_CHALLENGES, {userId:_arg1, sortBy:_arg2, page:_arg3, perPage:_arg4, filterNameType:_arg5, filterName:_arg6, filterEnvironment:_arg7, filterCreatorLocale:_arg8, filterExternalIds:_arg9, filterChallengeState:_arg10}));
}
public function getTimes(_arg1:int, _arg2:String, _arg3:int, _arg4:int, _arg5:String, _arg6:String, _arg7:int, _arg8:String, _arg9:String):void{
_load(new RemoteLoader(GET_TIMES, {userId:_arg1, sortBy:_arg2, page:_arg3, perPage:_arg4, filterNameType:_arg5, filterName:_arg6, filterEnvironment:_arg7, filterCreatorLocale:_arg8, filterExternalIds:_arg9}));
}
public function getUnreadAchievements(_arg1:int):void{
_load(new RemoteLoader(GET_UNREAD_ACHIEVEMENTS, {userId:_arg1}), false);
}
private function _onError(_arg1:ErrorEvent):void{
var _local2:LoadingItem = (_arg1.currentTarget as LoadingItem);
_local2.removeEventListener(Event.COMPLETE, _onComplete);
_local2.removeEventListener(ErrorEvent.ERROR, _onError);
_bulkLoader.remove(_local2.id);
trace(("Loading error for " + _local2.id));
switch (_local2.id){
case GET_USER:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {user:null}));
break;
case GET_ACHIEVEMENTS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {achievements:new Array()}));
break;
case GET_UNREAD_ACHIEVEMENTS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {achievements:new Array()}));
break;
case DELETE_USER_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:false}));
break;
case GET_TRACKS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {tracks:new Array(), totalCount:0, pages:0}));
break;
case GET_TRACK_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {track:null}));
break;
case GET_TRACK_VECTORS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {vectors:null}));
break;
case GET_GHOST_VECTORS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {ghosts:new Array(), totalCount:0}));
break;
case SEARCH_TRACKS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {tracks:new Array(), totalCount:0, pages:0}));
break;
case SAVE_TRACK:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {track:null}));
break;
case RATE_TRACK:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:false}));
break;
case REPORT_TRACK:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:false}));
break;
case GET_TIMES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {times:new Array(), totalCount:0, pages:0}));
break;
case GET_TIME_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {time:null}));
break;
case SAVE_TIME:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:false}));
break;
case GET_TRACK_TIMES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {times:new Array(), totalCount:0, pages:0}));
break;
case GET_TRACK_TIMES_AROUND:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {times:new Array()}));
break;
case GET_CHALLENGES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenges:new Array(), totalCount:0, pages:0}));
break;
case SEARCH_CHALLENGES:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenges:new Array(), totalCount:0, pages:0}));
break;
case GET_CHALLENGE_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenge:null}));
break;
case GET_COMPETITION_DETAILS:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenge:null}));
break;
case CREATE_CHALLENGE:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenge:null}));
break;
case GET_ENTERED_CHALLENGES_EXPIRED_SINCE:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {challenges:new Array()}));
break;
case INVITE_TO_CHALLENGE:
dispatchEvent(new RemoteDataManagerEvent(_local2.id, {success:false}));
break;
};
}
private function _getSuccess(_arg1:XML):Boolean{
return ((_arg1.result == 1));
}
public function getTrackDetails(_arg1:int, _arg2:int):void{
_load(new RemoteLoader(GET_TRACK_DETAILS, {userId:_arg1, trackId:_arg2}));
}
public function inviteToChallenge(_arg1:int, _arg2:int, _arg3:String, _arg4:String):void{
var _local5:String = _createChecksum(new Array(_arg1.toString(), _arg2.toString(), _arg3, _arg4));
_load(new RemoteLoader(INVITE_TO_CHALLENGE, {userId:_arg1, challengeId:_arg2, externalIds:_arg3, message:_arg4, checksum:_local5}));
}
private function _init():void{
_bulkLoader = new BulkLoader("RemoteDataManager");
_bulkLoader.addEventListener(Event.COMPLETE, _onGlobalComplete, false, 0, true);
_bulkLoader.addEventListener(ErrorEvent.ERROR, _onGlobalError, false, 0, true);
}
public function saveTime(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:String, _arg7:int=1, _arg8:String="", _arg9:String="", _arg10:String="", _arg11:String="", _arg12:String=""):void{
var _local13:String = (ENCRYPT_TIMES) ? Crypto.encrypt(_arg4) : _arg4.toString();
var _local14:String = _createChecksum(new Array(_arg1.toString(), _arg2.toString(), _arg3.toString(), _local13, _arg5.toString(), _arg6, _arg7.toString(), _arg8, _arg9, _arg10, _arg11, _arg12));
_load(new RemoteLoader(SAVE_TIME, {userId:_arg1, trackId:_arg2, challengeId:_arg3, time:_local13, cart:_arg5, ghostVectors:_arg6, updateTimesRaced:_arg7, compName:_arg8, compLastName:_arg9, compEmail:_arg10, compCountryIndex:_arg11, compOptOut:_arg12, checksum:_local14}));
}
private function _onGlobalComplete(_arg1:Event):void{
if (_bulkLoader.isFinished){
dispatchEvent(new Event(EVENT_FINISHED_LOADING));
};
}
private function _getPages(_arg1:XML):int{
return (parseInt(_arg1.pages));
}
public function getGhostVectors(_arg1:int, _arg2:int, _arg3:String, _arg4:int):void{
_load(new RemoteLoader(GET_GHOST_VECTORS, {trackId:_arg1, challengeId:_arg2, externalIds:_arg3, max:_arg4}));
}
private function _getEntities(_arg1:XML, _arg2:Class){
var _local4:XML;
var _local3:Array = new Array();
for each (_local4 in _arg1.entities.entity) {
_local3.push(new _arg2(_local4));
};
return (_local3);
}
public function getCompetitionDetails(_arg1:int, _arg2:String):void{
_load(new RemoteLoader(GET_COMPETITION_DETAILS, {userId:_arg1, locale:_arg2}), false);
}
public function getTrackVectors(_arg1:int):void{
_load(new RemoteLoader(GET_TRACK_VECTORS, {trackId:_arg1}));
}
public function getTracks(_arg1:int, _arg2:String, _arg3:int, _arg4:int, _arg5:String, _arg6:int):void{
_load(new RemoteLoader(GET_TRACKS, {userId:_arg1, sortBy:_arg2, page:_arg3, perPage:_arg4, filterName:_arg5, filterEnvironment:_arg6}));
}
public function searchChallenges(_arg1:int, _arg2:String, _arg3:int, _arg4:int, _arg5:String, _arg6:String, _arg7:int, _arg8:String, _arg9:String):void{
_load(new RemoteLoader(SEARCH_CHALLENGES, {userId:_arg1, sortBy:_arg2, page:_arg3, perPage:_arg4, filterNameType:_arg5, filterName:_arg6, filterEnvironment:_arg7, filterCreatorLocale:_arg8, filterExternalIds:_arg9}));
}
public static function instance():RemoteDataManager{
if (_instance == null){
_allow = true;
_instance = new (RemoteDataManager);
_allow = false;
};
return (_instance);
}
}
}//package com.kerb.data
Section 262
//RemoteDataManagerEvent (com.kerb.data.RemoteDataManagerEvent)
package com.kerb.data {
import com.kerb.utils.*;
public dynamic class RemoteDataManagerEvent extends DynamicEvent {
public function RemoteDataManagerEvent(_arg1:String, _arg2:Object){
var _local3:String;
super(_arg1);
for (_local3 in _arg2) {
this[_local3] = _arg2[_local3];
};
}
}
}//package com.kerb.data
Section 263
//RemoteLoader (com.kerb.data.RemoteLoader)
package com.kerb.data {
import flash.net.*;
public class RemoteLoader extends URLLoader {
public var urlRequest:URLRequest;
public var type:String;
public function RemoteLoader(_arg1:String, _arg2:Object=null){
var _local4:String;
super(null);
type = _arg1;
var _local3:URLVariables = new URLVariables();
for (_local4 in _arg2) {
trace(((_local4 + ":") + _arg2[_local4]));
_local3[_local4] = _arg2[_local4];
};
urlRequest = new URLRequest((Constants.API_BASE_URL + _arg1));
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = _local3;
}
public function beginLoading():void{
trace(urlRequest.url);
if (urlRequest.data != null){
trace(urlRequest.data.toString());
};
load(urlRequest);
}
}
}//package com.kerb.data
Section 264
//TrackLoader (com.kerb.data.TrackLoader)
package com.kerb.data {
import flash.events.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.modnation.*;
public class TrackLoader extends EventDispatcher implements IDisposable {
private var _challengeId:Number;// = 0
private var trackDetails:TrackDetails;
private function _onFindHowManyTracks(_arg1:RemoteDataManagerEvent):void{
Main.rdm.removeEventListener(RemoteDataManager.SEARCH_TRACKS, _onFindHowManyTracks);
var _local2:Number = Number(_arg1.pages);
_local2 = (_local2 * 0.8);
_local2 = (Math.floor((Math.random() * _local2)) + 1);
Main.rdm.addEventListener(RemoteDataManager.SEARCH_TRACKS, _onSelectRandomTrack);
Main.rdm.searchTracks(0, Constants.FILTER_SORT_BY_MOST_RACED, _local2, 1, "", "", 0, "", "");
}
public function loadRandomTrack():void{
var _local1:Number;
Tracking.track(Tracking.QUICK_RACE);
Constants.ROUTE = Constants.ROUTE_COLD;
if (Constants.BASE_URL != "http://dev.kerb.co.uk/ModNation/"){
_local1 = (Constants.TRACKS_POOL.length * 0.8);
_local1 = (Math.floor((Math.random() * _local1)) + 1);
_loadTrack(Constants.TRACKS_POOL[_local1]);
} else {
Main.rdm.addEventListener(RemoteDataManager.SEARCH_TRACKS, _onFindHowManyTracks);
Main.rdm.searchTracks(0, Constants.FILTER_SORT_BY_MOST_RACED, 1, 1, "", "", 0, "", "");
};
}
private function _onGetTrackVectors(_arg1:RemoteDataManagerEvent):void{
var _local3:TrackData;
Main.rdm.removeEventListener(RemoteDataManager.GET_TRACK_VECTORS, _onGetTrackVectors);
var _local2:TrackVectors = _arg1.vectors;
if (_local2 == null){
trace("Error loading track vectors");
} else {
trace("Loaded track vectors");
_local3 = new TrackData();
_local3.deserialize(_local2.trackVectors);
_local3.trackDetails = trackDetails;
UserManager.instance().currentTrack = _local3;
};
Main.rdm.addEventListener(RemoteDataManager.GET_GHOST_VECTORS, _onGetGhostVectors);
Main.rdm.getGhostVectors(trackDetails.id, _challengeId, Main.fbm.friendsIDsAsString("FB_"), 10);
}
public function loadTrack(_arg1:Number):void{
_loadTrack(_arg1);
}
public function dispose():void{
}
private function _loadTrack(_arg1:int):void{
trace(("Loading details for track " + _arg1));
Main.rdm.addEventListener(RemoteDataManager.GET_TRACK_DETAILS, _onGetTrackDetails);
Main.rdm.getTrackDetails(UserManager.instance().currentUserId, _arg1);
}
private function _onLoadChallenge(_arg1:RemoteDataManagerEvent):void{
Main.rdm.removeEventListener(RemoteDataManager.GET_CHALLENGE_DETAILS, _onLoadChallenge);
var _local2:ChallengeDetails = _arg1.challenge;
if (_local2 != null){
Main.um.currentChallengeDetails = _local2;
_loadTrack(_local2.track);
};
}
private function _loadChallenge():void{
trace(("Loading details for challenge " + _challengeId));
Main.rdm.addEventListener(RemoteDataManager.GET_CHALLENGE_DETAILS, _onLoadChallenge);
Main.rdm.getChallengeDetails(Main.um.currentUserId, Constants.challengeId);
}
private function _onGetTrackDetails(_arg1:RemoteDataManagerEvent):void{
var _local2:DynamicEvent;
Main.rdm.removeEventListener(RemoteDataManager.GET_TRACK_DETAILS, _onGetTrackDetails);
trackDetails = _arg1.track;
UserManager.instance().currentTrackDetails = trackDetails;
if (trackDetails == null){
trace("Error loading track");
} else {
dispatchEvent(new Event(Event.CHANGE));
trace((("Loaded details for track " + trackDetails.name) + ", now loading vectors"));
_local2 = new DynamicEvent(Background.EVENT_CHANGE_BG);
_local2.enviroment = trackDetails.environment;
Main.STAGE.dispatchEvent(_local2);
Main.rdm.addEventListener(RemoteDataManager.GET_TRACK_VECTORS, _onGetTrackVectors);
Main.rdm.getTrackVectors(trackDetails.id);
};
}
private function _onSelectRandomTrack(_arg1:RemoteDataManagerEvent):void{
Main.um.currentCart = 1;
Main.rdm.removeEventListener(RemoteDataManager.SEARCH_TRACKS, _onSelectRandomTrack);
var _local2:Array = _arg1.tracks;
var _local3:TrackDetails = _local2[0];
_loadTrack(_local3.id);
}
private function _onGetGhostVectors(_arg1:RemoteDataManagerEvent):void{
var _local3:GhostVectors;
Main.um.ghosts = [];
Main.rdm.removeEventListener(RemoteDataManager.GET_GHOST_VECTORS, _onGetGhostVectors);
var _local2:Array = _arg1.ghosts;
for each (_local3 in _local2) {
Main.um.ghosts.push(new GhostRacer(_local3));
};
dispatchEvent(new Event(Event.COMPLETE));
}
public function loadChallenge(_arg1:Number):void{
_challengeId = _arg1;
_loadChallenge();
}
}
}//package com.kerb.data
Section 265
//FacebookDynamicButton (com.kerb.facebook.FacebookDynamicButton)
package com.kerb.facebook {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.social.*;
import flash.net.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class FacebookDynamicButton extends DynamicToggleButton {
private var _tooltip:MovieClip;
public var uid:String;
private var fbu:ISocialUser;
private var _loader:Loader;
public function FacebookDynamicButton(_arg1:MovieClip, _arg2:String){
super(_arg1);
this.toggleable = true;
this.uid = _arg2;
_loader = new Loader();
_arg1.avatar_mc.addChild(_loader);
_setDetails(_arg2);
_arg1.addEventListener(MouseEvent.ROLL_OVER, _onShowTip, false, 0, true);
_arg1.addEventListener(MouseEvent.ROLL_OUT, _onHideTip, false, 0, true);
}
public function showLoggedUsersDetails():void{
_setDetails(Main.fbm.uid);
}
private function _onShowTip(_arg1:MouseEvent):void{
_tooltip = Main.afm.createMovieClip("gui", "tool_tip_selectFriends");
var _local2:Point = new Point(-70, -20);
_local2 = mcRef.localToGlobal(_local2);
_local2 = mcRef.stage.globalToLocal(_local2);
_tooltip.x = _local2.x;
_tooltip.y = _local2.y;
_tooltip.ttipHelp.label_txt.text = fbu.username;
mcRef.stage.addChild(_tooltip);
}
override public function dispose():void{
mc.removeEventListener(MouseEvent.ROLL_OVER, _onShowTip);
mc.removeEventListener(MouseEvent.ROLL_OUT, _onHideTip);
}
override public function set selected(_arg1:Boolean):void{
super.selected = _arg1;
if (_arg1){
mc.swapChildren(select, mc["avatar_mc"]);
};
}
private function _onHideTip(_arg1:MouseEvent):void{
_tooltip.parent.removeChild(_tooltip);
_tooltip = null;
}
private function _setDetails(_arg1:String):void{
fbu = Main.fbm.getUserById(_arg1);
if (fbu.picUrl != ""){
_loader.scaleX = (_loader.scaleY = 0.8);
_loader.load(new URLRequest(fbu.picUrl));
};
}
public static function gatherIDsOfSelectedButtons(_arg1:Array):String{
var _local3:FacebookDynamicButton;
var _local2 = "";
for each (_local3 in _arg1) {
if (_local3.selected){
if (_local2 != ""){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + _local3.uid);
};
};
return (_local2);
}
}
}//package com.kerb.facebook
Section 266
//FriendList (com.kerb.facebook.FriendList)
package com.kerb.facebook {
import flash.events.*;
import com.facebook.events.*;
import com.facebook.*;
import com.facebook.data.users.*;
import com.facebook.data.friends.*;
import com.kerb.modnation.*;
import com.facebook.commands.users.*;
import com.facebook.commands.friends.*;
public final class FriendList extends EventDispatcher {
public var friends:FacebookUserCollection;
private var _friends:XMLList;
private var fb:Facebook;
public function FriendList(_arg1:Facebook){
friends = new FacebookUserCollection();
super();
fb = _arg1;
}
private function _onCallComplete(_arg1:FacebookEvent):void{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:GetInfo;
if (_arg1.success){
_local2 = (_arg1.data as GetFriendsData).friends.source;
_local3 = [];
_local4 = 0;
while (_local4 < _local2.length) {
_local3.push(_local2[_local4].uid);
_local4++;
};
trace("FB FRIENDS", _local3.length);
_local3.push(Main.fbm.uid);
_local5 = new GetInfo(_local3.slice(0, Math.min(_local3.length, 1000)), [GetInfoFieldValues.FIRST_NAME, GetInfoFieldValues.IS_APP_USER, GetInfoFieldValues.LAST_NAME, GetInfoFieldValues.PIC_SQUARE, "email", GetInfoFieldValues.PIC, GetInfoFieldValues.PIC_SQUARE_WITH_LOGO]);
_local5.addEventListener(FacebookEvent.COMPLETE, onFriendsGetInfo);
fb.post(_local5);
} else {
Main.fbm.handleError(false, "There was an error loading friends .");
};
}
public function idsAsString(_arg1:String=""):String{
var _local2:String;
var _local4:FacebookUser;
var _local5:String;
var _local3:int;
while (_local3 < friends.length) {
_local4 = FacebookUser(friends.getItemAt(_local3));
_local5 = (_arg1 + _local4.uid);
_local2 = ((_local2 == null)) ? _local5 : ((_local2 + ",") + _local5);
_local3++;
};
return (_local2);
}
public function load():void{
var _local1:GetFriends = new GetFriends();
_local1.addEventListener(FacebookEvent.COMPLETE, _onCallComplete);
fb.post(_local1);
}
protected function onFriendsGetInfo(_arg1:FacebookEvent):void{
_arg1.target.removeEventListener(FacebookEvent.COMPLETE, onFriendsGetInfo);
if (_arg1.success){
friends = (_arg1.data as GetInfoData).userCollection;
trace("FB FRIENDS DATA", friends.length);
dispatchEvent(_arg1);
} else {
Main.fbm.handleError(false, "There was an error loading your friends details.");
};
}
public function filterStringIDsbyAppUsers(_arg1:String, _arg2:Boolean, _arg3:Boolean):String{
var _local5:String;
var _local7:FacebookUser;
var _local8:String;
var _local4:Array = _arg1.split(",");
var _local6:int;
while (_local6 < _local4.length) {
_local7 = friends.getUserById(_local4[_local6]);
_local8 = (_arg3) ? ("FB_" + _local7.uid) : _local7.uid;
if (_local7.is_app_user == _arg2){
_local5 = ((_local5 == null)) ? _local8 : ((_local5 + ",") + _local8);
};
_local6++;
};
return (_local5);
}
}
}//package com.kerb.facebook
Section 267
//PublishActivity (com.kerb.facebook.PublishActivity)
package com.kerb.facebook {
import com.facebook.net.*;
import com.facebook.*;
import com.adobe.serialization.json.*;
public class PublishActivity extends FacebookCall {
public var type:String;
public var to_ids:Array;
public var activity:Object;
public static const SCHEMA:Array = ["activity"];
public static const METHOD_NAME:String = "dashboard.publishActivity";
public function PublishActivity(_arg1:Object){
super(METHOD_NAME);
this.activity = _arg1;
}
override facebook_internal function initialize():void{
applySchema(SCHEMA, JSON.encode(activity));
super.initialize();
}
}
}//package com.kerb.facebook
Section 268
//AbstractScreen (com.kerb.game.screencontrol.AbstractScreen)
package com.kerb.game.screencontrol {
import flash.events.*;
import flash.display.*;
public class AbstractScreen extends Sprite {
protected var mc:MovieClip;
public var initialisationEvent:ScreenEvent;
public function AbstractScreen(){
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
protected function init():void{
}
protected function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
stage.focus = stage;
init();
}
protected function initText():void{
}
public function refresh():void{
}
public function dispose():void{
}
}
}//package com.kerb.game.screencontrol
Section 269
//ScreenEvent (com.kerb.game.screencontrol.ScreenEvent)
package com.kerb.game.screencontrol {
import flash.events.*;
public class ScreenEvent extends Event {
public var data;
public static const EVENT:String = "onScreenEvent";
public function ScreenEvent(_arg1=null){
this.data = _arg1;
super(EVENT);
}
}
}//package com.kerb.game.screencontrol
Section 270
//ScreenManager (com.kerb.game.screencontrol.ScreenManager)
package com.kerb.game.screencontrol {
import flash.display.*;
public class ScreenManager extends Sprite {
protected var currentScreen:AbstractScreen;
public function ScreenManager(_arg1:AbstractScreen){
showScreen(_arg1);
}
public function refreshScreen():void{
if (currentScreen != null){
currentScreen.refresh();
};
}
public function showScreen(_arg1:AbstractScreen):void{
if (currentScreen != null){
currentScreen.dispose();
removeChild(currentScreen);
currentScreen.removeEventListener(ScreenEvent.EVENT, onScreenEvent);
currentScreen = null;
};
currentScreen = _arg1;
_arg1.addEventListener(ScreenEvent.EVENT, onScreenEvent, false, 0, true);
addChildAt(_arg1, 0);
if (_arg1.initialisationEvent){
_arg1.dispatchEvent(_arg1.initialisationEvent);
_arg1.initialisationEvent = null;
};
}
public function get screen(){
return (currentScreen);
}
protected function onScreenEvent(_arg1:ScreenEvent):void{
showScreen(AbstractScreen(_arg1.data));
}
}
}//package com.kerb.game.screencontrol
Section 271
//KerbLog (com.kerb.logger.KerbLog)
package com.kerb.logger {
import flash.events.*;
import flash.display.*;
public final class KerbLog extends EventDispatcher {
private var _view:KerbLogView;
private var _level:KerbLogLevel;
private var _entries:Array;
private static const MAX_ENTRIES:uint = 100;
private static var _allow:Boolean = false;
private static var _instance:KerbLog = null;
public function KerbLog(){
if (!_allow){
throw (new Error("direct instantiation of uk.kerb.utils.logger.Log is forbidden"));
};
_entries = new Array();
_level = KerbLogLevel.Info;
_view = new KerbLogView(this);
}
public function set stage(_arg1:Stage):void{
_view.stage = _arg1;
}
private function _add(_arg1:String):void{
_entries.push(new KerbLogEntry(_arg1));
if (_entries.length > MAX_ENTRIES){
_entries.shift();
};
}
public function fatal(_arg1:String):void{
_add(_arg1);
if ((((((_level == KerbLogLevel.Fatal)) || ((_level == KerbLogLevel.Info)))) || ((_level == KerbLogLevel.Debug)))){
_dispatch();
};
}
public function info(_arg1:String):void{
_add(_arg1);
if ((((_level == KerbLogLevel.Info)) || ((_level == KerbLogLevel.Debug)))){
_dispatch();
};
}
public function set level(_arg1:KerbLogLevel):void{
_level = _arg1;
}
private function _dispatch():void{
dispatchEvent(new KerbLogEvent(_entries[(_entries.length - 1)]));
}
public function debug(_arg1:String):void{
_add(_arg1);
if (_level == KerbLogLevel.Debug){
_dispatch();
};
}
public function get level():KerbLogLevel{
return (_level);
}
public static function instance():KerbLog{
if (_instance == null){
_allow = true;
_instance = new (KerbLog);
_allow = false;
};
return (_instance);
}
}
}//package com.kerb.logger
Section 272
//KerbLogEntry (com.kerb.logger.KerbLogEntry)
package com.kerb.logger {
final class KerbLogEntry {
private var _message:String;
private var _date:Date;
function KerbLogEntry(_arg1:String){
_message = _arg1;
_date = new Date();
}
public function get message():String{
return (_message);
}
public function get date():Date{
return (_date);
}
}
}//package com.kerb.logger
Section 273
//KerbLogEvent (com.kerb.logger.KerbLogEvent)
package com.kerb.logger {
import flash.events.*;
final class KerbLogEvent extends Event {
private var _logEntry:KerbLogEntry;
public static const TYPE:String = "onLogEntry";
function KerbLogEvent(_arg1:KerbLogEntry){
super(TYPE);
_logEntry = _arg1;
}
public function get logEntry():KerbLogEntry{
return (_logEntry);
}
}
}//package com.kerb.logger
Section 274
//KerbLogLevel (com.kerb.logger.KerbLogLevel)
package com.kerb.logger {
public final class KerbLogLevel {
public static const Debug:KerbLogLevel = new (KerbLogLevel);
;
public static const Fatal:KerbLogLevel = new (KerbLogLevel);
;
public static const Info:KerbLogLevel = new (KerbLogLevel);
;
public static const None:KerbLogLevel = new (KerbLogLevel);
;
}
}//package com.kerb.logger
Section 275
//KerbLogView (com.kerb.logger.KerbLogView)
package com.kerb.logger {
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.display.*;
import com.kerb.logger.*;
import flash.text.*;
import flash.ui.*;
final class KerbLogView {
private var _container:Sprite;
private var _log:KerbLog;
private var _timer:Timer;// = null
private var _dragBar:Sprite;
private var _closeButton:Sprite;
private var _textField:TextField;
private var _frames:uint;// = 0
private var _minimized:Boolean;// = false
private var _clearButton:Sprite;
private var _minButton:Sprite;
private var _copyButton:Sprite;
private var _fps:TextField;
private var _greyBox:Sprite;
private var _stage:Stage;
private static const HEIGHT:uint = 100;
private static const DRAG_BAR_HEIGHT:uint = 10;
private static const COLOUR_BLUE:uint = 0xFF;
private static const MARGIN:uint = 5;
private static const COLOUR_GREEN:uint = 0x66CC00;
private static const COLOUR_GREY:uint = 0x999999;
private static const BUTTON_LENGTH:uint = 10;
private static const DISPLAY_FONT_SIZE:uint = 11;
private static const COLOUR_WHITE:uint = 0xFFFFFF;
private static const COLOUR_RED:uint = 0xFF0000;
private static const DISPLAY_FONT_COLOUR:uint = 0xFFFFFF;
function KerbLogView(_arg1:KerbLog){
_log = _arg1;
_log.addEventListener(KerbLogEvent.TYPE, _eventHandler);
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, _onTimer);
}
private function _onCloseButtonClick(_arg1:MouseEvent):void{
_container.visible = false;
}
private function _createMinButton():void{
_minButton = new Sprite();
_minButton.x = ((_container.width - (2.5 * BUTTON_LENGTH)) - MARGIN);
_minButton.y = MARGIN;
_minButton.graphics.beginFill(COLOUR_RED);
_minButton.graphics.lineStyle(0, COLOUR_WHITE);
_minButton.graphics.drawRect(0, 0, BUTTON_LENGTH, BUTTON_LENGTH);
_minButton.graphics.endFill();
_minButton.graphics.moveTo(0, (BUTTON_LENGTH / 2));
_minButton.graphics.lineTo(BUTTON_LENGTH, (BUTTON_LENGTH / 2));
_minButton.buttonMode = true;
_minButton.addEventListener(MouseEvent.CLICK, _onMinButtonClick, false, 0, true);
_container.addChild(_minButton);
}
private function _createGraphics():void{
if (_container == null){
_createContainer();
_createDragBar();
_createFPSTextField();
_createCloseButton();
_createMinButton();
_createClearButton();
_createCopyButton();
_createTextField();
_container.addEventListener(MouseEvent.MOUSE_OVER, _onMouseOver);
_timer.start();
_container.addEventListener(Event.ENTER_FRAME, _onEnterFrame);
} else {
if (!_container.visible){
_container.visible = true;
};
};
}
private function _onDragBarMouseUp(_arg1:MouseEvent):void{
_container.removeEventListener(MouseEvent.MOUSE_MOVE, _onContainerMouseMove);
_container.stopDrag();
}
private function _onDragBarMouseDown(_arg1:MouseEvent):void{
_container.addEventListener(MouseEvent.MOUSE_MOVE, _onContainerMouseMove);
_container.startDrag();
}
private function _onEnterFrame(_arg1:Event):void{
_frames++;
}
private function _onCopyButtonClick(_arg1:MouseEvent):void{
System.setClipboard(_textField.text);
}
private function _createCopyButton():void{
_copyButton = new Sprite();
_copyButton.x = ((_container.width - (5.5 * BUTTON_LENGTH)) - MARGIN);
_copyButton.y = MARGIN;
_copyButton.graphics.beginFill(COLOUR_GREEN);
_copyButton.graphics.lineStyle(0, COLOUR_WHITE);
_copyButton.graphics.drawRect(0, 0, BUTTON_LENGTH, BUTTON_LENGTH);
_copyButton.graphics.endFill();
_copyButton.buttonMode = true;
_copyButton.addEventListener(MouseEvent.CLICK, _onCopyButtonClick, false, 0, true);
_container.addChild(_copyButton);
}
private function _onTimer(_arg1:TimerEvent):void{
_fps.text = (String(_frames) + " fps");
_frames = 0;
}
private function _onMinButtonClick(_arg1:MouseEvent):void{
_doMinButtonClick();
}
private function _createDragBar():void{
_dragBar = new Sprite();
_dragBar.x = 0;
_dragBar.y = 0;
_dragBar.graphics.beginFill(COLOUR_BLUE);
_dragBar.graphics.lineStyle(0, COLOUR_WHITE, 0);
_dragBar.graphics.drawRect(0, 0, _container.width, (2 * BUTTON_LENGTH));
_dragBar.graphics.endFill();
_dragBar.buttonMode = true;
_dragBar.addEventListener(MouseEvent.MOUSE_DOWN, _onDragBarMouseDown, false, 0, true);
_dragBar.addEventListener(MouseEvent.MOUSE_UP, _onDragBarMouseUp, false, 0, true);
_container.addChild(_dragBar);
}
private function _createFPSTextField():void{
_fps = new TextField();
_fps.x = MARGIN;
_fps.y = 1;
_fps.width = 100;
_fps.height = 30;
_fps.autoSize = TextFieldAutoSize.NONE;
_fps.embedFonts = false;
_fps.antiAliasType = AntiAliasType.NORMAL;
_fps.wordWrap = true;
_fps.selectable = false;
_fps.mouseEnabled = false;
_fps.defaultTextFormat = new TextFormat("_typewriter", DISPLAY_FONT_SIZE, DISPLAY_FONT_COLOUR);
_container.addChild(_fps);
}
private function _eventHandler(_arg1:KerbLogEvent):void{
var _local2:String;
_createGraphics();
if (_textField != null){
_local2 = ((timeTo24HourString(_arg1.logEntry.date) + ": ") + _arg1.logEntry.message);
_textField.appendText((_local2 + "\n"));
trace(_local2);
_textField.scrollV = _textField.maxScrollV;
};
}
private function _doMinButtonClick():void{
_minimized = !(_minimized);
_greyBox.visible = !(_minimized);
_textField.visible = !(_minimized);
_container.y = ((_stage.stageHeight - (_minimized) ? (2 * BUTTON_LENGTH) : HEIGHT) - MARGIN);
}
private function _createClearButton():void{
_clearButton = new Sprite();
_clearButton.x = ((_container.width - (4 * BUTTON_LENGTH)) - MARGIN);
_clearButton.y = MARGIN;
_clearButton.graphics.beginFill(COLOUR_GREY);
_clearButton.graphics.lineStyle(0, COLOUR_WHITE);
_clearButton.graphics.drawRect(0, 0, BUTTON_LENGTH, BUTTON_LENGTH);
_clearButton.graphics.endFill();
_clearButton.buttonMode = true;
_clearButton.addEventListener(MouseEvent.CLICK, _onClearButtonClick, false, 0, true);
_container.addChild(_clearButton);
}
private function _createTextField():void{
_textField = new TextField();
_textField.x = MARGIN;
_textField.y = ((2 * BUTTON_LENGTH) + MARGIN);
_textField.width = (_container.width - (2 * MARGIN));
_textField.height = ((_container.height - (2 * BUTTON_LENGTH)) - (2 * MARGIN));
_textField.autoSize = TextFieldAutoSize.NONE;
_textField.embedFonts = false;
_textField.antiAliasType = AntiAliasType.NORMAL;
_textField.wordWrap = true;
_textField.defaultTextFormat = new TextFormat("_typewriter", DISPLAY_FONT_SIZE, DISPLAY_FONT_COLOUR);
_container.addChild(_textField);
}
private function _onClearButtonClick(_arg1:MouseEvent):void{
_textField.text = "";
}
private function _createContainer():void{
_container = new Sprite();
_container.x = MARGIN;
_container.y = ((_stage.stageHeight - HEIGHT) - MARGIN);
_greyBox = new Sprite();
_greyBox.graphics.beginFill(COLOUR_GREY);
_greyBox.graphics.drawRect(0, 0, (_stage.stageWidth - (2 * MARGIN)), (HEIGHT - (2 * BUTTON_LENGTH)));
_greyBox.graphics.endFill();
_greyBox.y = (2 * BUTTON_LENGTH);
_container.addChild(_greyBox);
_stage.addChild(_container);
}
private function _createCloseButton():void{
_closeButton = new Sprite();
_closeButton.x = ((_container.width - BUTTON_LENGTH) - MARGIN);
_closeButton.y = MARGIN;
_closeButton.graphics.beginFill(COLOUR_RED);
_closeButton.graphics.lineStyle(0, COLOUR_WHITE);
_closeButton.graphics.drawRect(0, 0, BUTTON_LENGTH, BUTTON_LENGTH);
_closeButton.graphics.endFill();
_closeButton.graphics.moveTo(0, 0);
_closeButton.graphics.lineTo(BUTTON_LENGTH, BUTTON_LENGTH);
_closeButton.graphics.moveTo(BUTTON_LENGTH, 0);
_closeButton.graphics.lineTo(0, BUTTON_LENGTH);
_closeButton.buttonMode = true;
_closeButton.addEventListener(MouseEvent.CLICK, _onCloseButtonClick, false, 0, true);
_container.addChild(_closeButton);
}
private function _onContainerMouseMove(_arg1:MouseEvent):void{
_arg1.updateAfterEvent();
}
private function _onMouseOver(_arg1:MouseEvent):void{
Mouse.show();
}
public function set stage(_arg1:Stage):void{
_stage = _arg1;
}
public static function timeTo24HourString(_arg1:Date):String{
var _local2 = "";
_local2 = (_local2 + numberToFixedLengthString(_arg1.getHours(), 2, 0, "0"));
_local2 = (_local2 + ":");
_local2 = (_local2 + numberToFixedLengthString(_arg1.getMinutes(), 2, 0, "0"));
_local2 = (_local2 + ":");
_local2 = (_local2 + numberToFixedLengthString(_arg1.getSeconds(), 2, 0, "0"));
return (_local2);
}
public static function numberToFixedLengthString(_arg1:Number, _arg2:uint=4, _arg3:uint=4, _arg4:String=" "):String{
var _local5:String = String(((_arg1 == 0)) ? _arg1 : _arg1.toFixed(_arg3));
var _local6:uint = _arg2;
if (_arg3 > 0){
_local6 = (_local6 + (1 + _arg3));
};
_arg4 = _arg4.charAt(0);
while (_local5.length < _local6) {
_local5 = (_arg4 + _local5);
};
return (_local5);
}
}
}//package com.kerb.logger
Section 276
//AutoComplete (com.kerb.modnation.builder.AutoComplete)
package com.kerb.modnation.builder {
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import com.kerb.modnation.tracks.renderers.*;
public class AutoComplete extends Sprite {
public var _sx:Number;
public var _sy:Number;
private var bm:Bitmap;
public var _sr:Number;
private var _goodSlices:Array;
public var lastGoodSlice:Number;
private var carx:Number;
private var cary:Number;
private var _intersection:Point;
private var _projectedStart:Point;
private var _lastTestedPoint:Point;
public var _lx:Number;
public var _lr:Number;
private var _projectedLast:Point;
private var _curveCol:Number;// = 0xFFFFFF
public var _ly:Number;
private var _lastInterSection:Point;
private var _newGoodSlices:Boolean;// = true
public function AutoComplete(){
_goodSlices = [];
super();
bm = new Bitmap(null);
this.addChild(bm);
}
private function _checkMinLengths():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (_intersection != null){
_local1 = KerbMaths.distance(_intersection, new Point(_sx, _sy));
_local2 = KerbMaths.distance(_intersection, new Point(_lx, _ly));
_local3 = Math.min(_local1, _local2);
_local4 = Math.round(KerbMaths.angleBetweenDegrees(_intersection, new Point(_sx, _sy)));
_local5 = Math.round(KerbMaths.angleBetweenDegrees(_intersection, new Point(_lx, _ly)));
_local6 = (Math.abs(_local4) + Math.abs(_local5));
if (_local6 > 180){
_local6 = (_local6 - 180);
};
if ((Number((_local1 < 220)) ^ Number((_local2 < 220)))){
_intersection = null;
};
};
}
public function autoComplete(_arg1:Recorder, _arg2:BuilderRenderer):void{
var _local3:Object = _goodSlices[Math.floor((_goodSlices.length / 2))];
lastGoodSlice = _local3.slice;
_lastInterSection = _local3.intersection;
_lx = _local3.lx;
_ly = _local3.ly;
_sx = _local3.sx;
_sy = _local3.sy;
_arg1.undoTo(lastGoodSlice);
_intersection = _lastInterSection;
carx = _arg1.lastPosition.x;
cary = _arg1.lastPosition.y;
carx = _sx;
cary = _sy;
var _local4:BezierLength = new BezierLength();
_local4.pointA = new Point(_lx, _ly);
_local4.pointC = new Point(_sx, _sy);
_local4.pointB = _intersection;
var _local5:Number = (1 / _local4.approxArcLength());
var _local6:Number = 0;
while (_local6 < 1) {
carOnBezier(_local6, _lx, _ly, _sx, _sy, _intersection.x, _intersection.y, _arg1, _arg2);
_local6 = (_local6 + _local5);
};
}
public function _drawAutoComplete(_arg1:Number, _arg2:Builder):void{
var _local4:Number;
var _local5:Number;
var _local8:Number;
var _local9:Number;
var _local3:Sprite = this;
var _local6:Number = 30000;
_local4 = (_lx + (_sx - _lx));
_local5 = (_ly + (_sy - _ly));
var _local7:Point = new Point(_lx, _ly);
if ((((((_lastTestedPoint == null)) || (!((_lastTestedPoint.x == _local7.x))))) || (!((_lastTestedPoint.y == _local7.y))))){
_lastTestedPoint = _local7;
_local3.graphics.clear();
_local8 = _lr;
_local9 = (_local8 * (Math.PI / 180));
_projectedLast = new Point();
_projectedLast.x = ((_local6 * Math.cos(_local9)) + _lx);
_projectedLast.y = ((_local6 * Math.sin(_local9)) + _ly);
_local8 = (_sr - 180);
_local9 = (_local8 * (Math.PI / 180));
_projectedStart = new Point();
_projectedStart.x = ((_local6 * Math.cos(_local9)) + _sx);
_projectedStart.y = ((_local6 * Math.sin(_local9)) + _sy);
_intersection = KerbMaths.lineIntersectLine(_projectedStart, new Point(_sx, _sy), _projectedLast, new Point(_lx, _ly));
_checkOnScreen();
_checkMinLengths();
if (_intersection != null){
if (_newGoodSlices){
_goodSlices = [];
_newGoodSlices = false;
};
_goodSlices.push({slice:_arg1, intersection:_intersection, lx:_lx, ly:_ly, sx:_sx, sy:_sy});
lastGoodSlice = _arg1;
_lastInterSection = _intersection;
_local3.graphics.lineStyle(220, _curveCol, 1, false, LineScaleMode.NORMAL, CapsStyle.NONE);
_local3.graphics.moveTo(_lx, _ly);
_local3.graphics.curveTo(_intersection.x, _intersection.y, _sx, _sy);
} else {
_newGoodSlices = true;
};
};
}
private function _checkOnScreen():void{
if (_intersection != null){
if ((((((((_intersection.x < Game.TRACK_WITDH)) || ((_intersection.x > Constants.MAX_BITMAP_SIZE)))) || ((_intersection.y < Game.TRACK_WITDH)))) || ((_intersection.y > Constants.MAX_BITMAP_SIZE)))){
_intersection = null;
};
};
}
public function kill():void{
_lastInterSection = null;
}
private function carOnBezier(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Recorder, _arg9:BuilderRenderer):void{
var _local10:Number = (1 - _arg1);
var _local11:Number = (((((1 - _arg1) * _local10) * _arg2) + (((2 * _local10) * _arg1) * _arg6)) + ((_arg1 * _arg1) * _arg4));
var _local12:Number = ((((_local10 * _local10) * _arg3) + (((2 * _local10) * _arg1) * _arg7)) + ((_arg1 * _arg1) * _arg5));
var _local13:Number = (_local11 - carx);
var _local14:Number = (_local12 - cary);
var _local15:Number = Math.atan2(_local14, _local13);
var _local16:Number = _local11;
var _local17:Number = _local12;
_arg8.add(_local16, _local17, ((_arg1 == 0)) ? _arg8.lastPosition.r : _local15);
_arg9.renderSlice(_local16, _local17, _local15);
carx = _local11;
cary = _local12;
}
public function get canAutoComplete():Boolean{
return (!((_lastInterSection == null)));
}
}
}//package com.kerb.modnation.builder
Section 277
//BezierLength (com.kerb.modnation.builder.BezierLength)
package com.kerb.modnation.builder {
import flash.geom.*;
import com.degrafa.geometry.splines.math.*;
public class BezierLength {
public var pointA:Point;
private var __c2X:Number;
private var __c2Y:Number;
private var __c1Y:Number;
private var __c0Y:Number;
private var __c1X:Number;
public var pointC:Point;
public var pointB:Point;
private var __c0X:Number;
private var __integrate:Gauss;
public function BezierLength(){
__integrate = new Gauss();
super();
}
private function computeBezierCoef():void{
__c0X = pointA.x;
__c0Y = pointA.y;
__c1X = (2 * (pointB.x - pointA.x));
__c1Y = (2 * (pointB.y - pointA.y));
__c2X = ((pointA.x - (2 * pointB.x)) + pointC.x);
__c2Y = ((pointA.y - (2 * pointB.y)) + pointC.y);
}
public function approxArcLength():Number{
computeBezierCoef();
return (__integrate.eval(integrand, 0, 1, 5));
}
public function arcLengthByIntegral():Number{
var _local1:Number = ((pointA.x - (2 * pointB.x)) + pointC.x);
var _local2:Number = ((pointA.y - (2 * pointB.y)) + pointC.y);
var _local3:Number = ((2 * pointB.x) - (2 * pointA.x));
var _local4:Number = ((2 * pointB.y) - (2 * pointA.y));
var _local5:Number = (4 * ((_local1 * _local1) + (_local2 * _local2)));
var _local6:Number = (4 * ((_local1 * _local3) + (_local2 * _local4)));
var _local7:Number = ((_local3 * _local3) + (_local4 * _local4));
var _local8:Number = (2 * Math.sqrt(((_local5 + _local6) + _local7)));
var _local9:Number = Math.sqrt(_local5);
var _local10:Number = ((2 * _local5) * _local9);
var _local11:Number = (2 * Math.sqrt(_local7));
var _local12:Number = (_local6 / _local9);
return (((((_local10 * _local8) + ((_local9 * _local6) * (_local8 - _local11))) + ((((4 * _local7) * _local5) - (_local6 * _local6)) * Math.log(((((2 * _local9) + _local12) + _local8) / (_local12 + _local11))))) / (4 * _local10)));
}
private function integrand(_arg1:Number):Number{
var _local2:Number = (__c1X + ((2 * __c2X) * _arg1));
var _local3:Number = (__c1Y + ((2 * __c2Y) * _arg1));
return (Math.sqrt(((_local2 * _local2) + (_local3 * _local3))));
}
}
}//package com.kerb.modnation.builder
Section 278
//Builder (com.kerb.modnation.builder.Builder)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import com.gskinner.motion.*;
import com.miian.b2dcar.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.*;
import com.gskinner.motion.easing.*;
public class Builder extends Sprite implements IDisposable {
private var _undo:UndoManager;
private var _sx:Number;
private var _sy:Number;
private var _autocomplete:AutoComplete;
private var _tp:MovieClip;
private var _recorder:Recorder;
private var _renderer:BuilderRenderer;
private var _layer_mc:MovieClip;
private var _lr:Number;// = 0
public var _bm:Bitmap;
private var _lx:Number;// = 0
private var _ly:Number;// = 0
private var _class:Class;
private var _sr:Number;
public function Builder(){
_recorder = new Recorder();
_renderer = new BuilderRenderer();
_undo = new UndoManager();
_autocomplete = new AutoComplete();
_renderer.render(_recorder.trackData);
_tp = Main.afm.createMovieClip("ui", "trackPiece");
_layer_mc = Main.afm.createMovieClip("props", "trackLayer_mc");
_class = Object(_tp).constructor;
_bm = new Bitmap(_renderer.bitmapData);
this.addChild(_autocomplete);
this.addChild(_bm);
this.addChild(_layer_mc);
}
public function complete():void{
dispatchEvent(new Event(Event.COMPLETE));
}
public function autoComplete():void{
if (canAutoComplete){
_autocomplete.autoComplete(_recorder, _renderer);
dispatchEvent(new Event(Event.COMPLETE));
};
}
public function killAutoComplete():void{
_autocomplete.kill();
}
public function get trackData():TrackData{
return (_recorder.trackData);
}
public function introZoom():void{
var _local1:Point = new Point(_layer_mc.x, _layer_mc.y);
_local1 = localToGlobal(_local1);
_layer_mc.scaleX = 10;
_layer_mc.scaleY = 10;
new GTween(_layer_mc, 1, {scaleX:1, scaleY:1, ease:Quadratic.easeInOut}, {delay:1.5});
}
public function undo(_arg1:Boolean=false):Object{
trace("undo");
Main.playSoundFX(Main.SFX_NAMEts_delete);
var _local2:BitmapData = _undo.undo(_recorder, _arg1);
_renderer.bitmapData = _local2;
_bm.bitmapData = _renderer.bitmapData;
_bm.smoothing = true;
Game.playerCar = new Car((_recorder.lastPosition.x / 10), (_recorder.lastPosition.y / 10), _recorder.lastPosition.r);
return (_recorder.lastPosition);
}
public function dispose():void{
_undo.dispose();
}
public function layTrack(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local8:MovieClip;
var _local4:Boolean;
var _local5:Number = _arg1;
var _local6:Number = _arg2;
var _local7:Number = _arg3;
_layer_mc.x = _arg1;
_layer_mc.y = _arg2;
_layer_mc.rotation = (-90 + (_arg3 * KerbMaths.RAD_2_DEG));
_arg1 = Math.round(_arg1);
_arg2 = Math.round(_arg2);
_arg3 = Math.round((_arg3 * 57.2957795));
if (!(((((_arg1 == _lx)) && ((_arg2 == _ly)))) && ((_arg3 == _lr)))){
_local8 = _renderer.getTrackSlice(_arg3);
_local8.x = _arg1;
_local8.y = _arg2;
_local8.rotation = _arg3;
if (!_testTrackSection(_local8, _arg3)){
_recorder.add(_local5, _local6, _local7);
_renderer.renderSlice(_local5, _local6, _local7);
_undo.step(_renderer.bitmapData, _recorder);
_local4 = true;
};
_lx = _arg1;
_ly = _arg2;
_lr = _arg3;
_autocomplete._lx = _lx;
_autocomplete._ly = _ly;
_autocomplete._lr = _lr;
if (isNaN(_sx)){
_sx = _arg1;
_sy = _arg2;
_sr = _arg3;
_autocomplete._sx = _sx;
_autocomplete._sy = _sy;
_autocomplete._sr = _sr;
};
} else {
_local4 = true;
};
dispatchEvent(new Event(Event.CHANGE));
_autocomplete._drawAutoComplete(_recorder.numSlices, this);
return (_local4);
}
private function _testTrackSection(_arg1:MovieClip, _arg2:Number):Boolean{
var _local3:Boolean;
var _local4:MovieClip;
if (_arg2 == _lr){
_local3 = ((_testTrackPoint(_arg1.top_mc)) || (_testTrackPoint(_arg1.bottom_mc)));
} else {
_local4 = ((_arg2 > _lr)) ? _arg1.top_mc : _arg1.bottom_mc;
_local3 = _testTrackPoint(_local4);
};
return (_local3);
}
private function _testTrackPoint(_arg1:MovieClip):Boolean{
var _local2:Point = new Point(_arg1.x, _arg1.y);
_local2 = _arg1.parent.localToGlobal(_local2);
if ((((((((_local2.x < 0)) || ((_local2.y < 0)))) || ((_local2.x > Constants.MAX_BITMAP_SIZE)))) || ((_local2.y > Constants.MAX_BITMAP_SIZE)))){
return (true);
};
return (_bm.bitmapData.hitTest(new Point(0, 0), 0xFF, _local2));
}
public function get canAutoComplete():Boolean{
return (_autocomplete.canAutoComplete);
}
}
}//package com.kerb.modnation.builder
Section 279
//BuilderBreadCrumbs (com.kerb.modnation.builder.BuilderBreadCrumbs)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
public class BuilderBreadCrumbs extends EventDispatcher implements IDisposable {
private var _mc:MovieClip;
public function BuilderBreadCrumbs(_arg1:MovieClip, _arg2:Number){
_mc = _arg1;
var _local3 = 1;
while (_local3 <= 4) {
if (_local3 < _arg2){
step_setup(_mc.breadcrumbs_mc[("step" + _local3)], false, false, true);
};
if (_local3 == _arg2){
step_setup(_mc.breadcrumbs_mc[("step" + _local3)], false, true, false);
};
if (_local3 > _arg2){
step_setup(_mc.breadcrumbs_mc[("step" + _local3)], true, false, false);
};
_local3++;
};
TextManager.getInstance().setTextField(_arg1.txt, ("builder.title" + _arg2));
}
private function step_setup(_arg1:MovieClip, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean):void{
_arg1.static_mc.visible = _arg2;
_arg1.select_mc.visible = _arg3;
_arg1.complete_mc.visible = _arg4;
}
public function dispose():void{
}
}
}//package com.kerb.modnation.builder
Section 280
//BuilderController (com.kerb.modnation.builder.BuilderController)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.utils.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import flash.media.*;
import Box2D.Common.Math.*;
import com.miian.b2dcar.*;
import com.kerb.modnation.*;
import com.miian.b2dhelp.*;
import flash.ui.*;
public class BuilderController extends Game {
private const startPositions:Array;
private var _builder:Builder;
public function BuilderController(_arg1:Builder){
startPositions = [[800, 800, 90], [(Constants.MAX_BITMAP_SIZE - 800), 800, 90], [800, (Constants.MAX_BITMAP_SIZE - 800), 0], [(Constants.MAX_BITMAP_SIZE - 800), (Constants.MAX_BITMAP_SIZE - 800), 0], [1600, 1600, 90], [(Constants.MAX_BITMAP_SIZE - 1600), 1600, 90], [1600, (Constants.MAX_BITMAP_SIZE - 1600), 0], [(Constants.MAX_BITMAP_SIZE - 1600), (Constants.MAX_BITMAP_SIZE - 1600), 0]];
Game.ENGINE_SPEED = 20;
Game.STEER_SPEED = 0.09;
_builder = _arg1;
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_ON).play(0, 999999, new SoundTransform(0));
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_IDLE).play(0, 999999, new SoundTransform(1));
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_IDLE).fadeTo(1, 0.5);
super();
var _local2:int = Math.floor((Math.random() * startPositions.length));
var _local3:Number = startPositions[_local2][0];
var _local4:Number = startPositions[_local2][1];
playerCar = new Car((_local3 / 10), (_local4 / 10), (KerbMaths.DEG_2_RAD * startPositions[_local2][2]));
}
override protected function Update(_arg1:Event):void{
var _local3:Number;
var _local4:b2Vec2;
var _local5:Number;
var _local2 = 1;
while (_local2 < 20) {
if (isNaN(game_startTimeStep)){
game_startTimeStep = (getTimer() - 10);
};
_local3 = getTimer();
Helper.update((1 / 64), 1);
WheelController.update(((_local3 - game_startTimeStep) / 1000));
game_startTimeStep = _local3;
playerCar.steer(steeringAngle);
playerCar.drive(engineSpeed);
_local4 = playerCar.body.GetPosition();
_local5 = playerCar.body.GetAngle();
if (_builder.layTrack((playerCar.body.GetPosition().x * 10), (playerCar.body.GetPosition().y * 10), playerCar.body.GetAngle())){
} else {
_builder.undo();
};
_local2++;
};
}
override public function dispose():void{
super.dispose();
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_ON).stop();
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_IDLE).stop();
_builder = null;
}
public function killAutoComplete():void{
}
private function _autoComplete():void{
_builder.autoComplete();
}
override protected function keyReleased_handler(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.UP)) || ((_arg1.keyCode == Keyboard.DOWN)))){
engineSpeed = 0;
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_ON).fadeTo(0, 0.5);
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_IDLE).fadeTo(1, 0.5);
};
if ((((_arg1.keyCode == Keyboard.LEFT)) || ((_arg1.keyCode == Keyboard.RIGHT)))){
steeringAngle = 0;
};
}
override protected function keyPressed_handler(_arg1:KeyboardEvent):void{
var _local2:Object;
if (_arg1.keyCode == Keyboard.F5){
};
if (_arg1.keyCode == Keyboard.ENTER){
_autoComplete();
};
if (_arg1.keyCode == Keyboard.F2){
_builder.complete();
};
if (_arg1.keyCode == Keyboard.UP){
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_ON).fadeTo(1, 0.5);
Main.smSFX.getSoundByClassName(Main.SFX_NAME_CREATE_IDLE).fadeTo(0, 0.5);
playerCar.body.WakeUp();
engineSpeed = ENGINE_SPEED;
};
if (_arg1.keyCode == Keyboard.DOWN){
_builder.killAutoComplete();
_local2 = _builder.undo();
};
if (_arg1.keyCode == Keyboard.RIGHT){
steeringAngle = STEER_SPEED;
};
if (_arg1.keyCode == Keyboard.LEFT){
steeringAngle = -(STEER_SPEED);
};
}
}
}//package com.kerb.modnation.builder
Section 281
//BuilderPalette (com.kerb.modnation.builder.BuilderPalette)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import com.gskinner.motion.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
import com.gskinner.motion.easing.*;
public class BuilderPalette extends EventDispatcher implements IDisposable {
protected var _currIndex:Number;// = 0
protected var _scrollVertical:Number;
protected var _currList:Array;
protected var _WorkingPaletteIndex:Number;
protected var _upBtn:DynamicButton;
protected var _downBtn:DynamicButton;
protected var _start_x:Number;
protected var _start_y:Number;
protected var _isScrolling:Boolean;// = false
protected var _scrollHorizontal:Number;
protected var _mc:MovieClip;
protected var _numItemsInList:Number;
protected var _currentProp:Prop;
protected static const _desertEnviroProps:Array = ["ruins1", "camel", "oil_tower", "oil_derrick", "oil_barrel", "ruins2", "desert_argetent", "desert_fence1", "desert_fence2", "desert_housedesert", "desert_largeshackrow1", "desert_largeshackrow2", "desert_marketstalll", "desert_oasis1", "desert_palm3", "desert_potpile1", "desert_shack1", "desert_shack2", "desert_shack3", "desert_shack4", "desert_smallhut", "desert_smalltent", "desert_temple", "desert_tent", "desert_tent_encampement", "desert_tent1", "desert_tower", "desert_tower1", "desert_towerdesert", "desert_treabit", "desert_treabit2", "desert_treabitdes2", "desert_treeclump11", "desert_treesclump", "desert_wall_small_1", "desert_wall_small_2", "desert_wall1", "desert_wall2", "desert_wall3", "desert_wall4", "dessert_settlement"];
protected static const _trackProps:Array = ["boostside3", "boostside4", "boostup2", "oilslick", "oilspill", "water"];
protected static const _seasideEnviroProps:Array = ["aircon", "bigsatdish", "divingboard", "grassyarea", "hedge_1", "hotel2", "hotel3", "hotel4", "hotel6", "hotel7", "hyotel1", "lighthouse", "rails1", "rails2", "smallhouse1", "smallhouse2", "sshouse1", "sshouse2", "sshouse3", "sshouse4", "sshouse6", "ss_small_house", "ss_small_house_2", "ss_small_house_3", "ss_small_house_4", "ss_small_house_5", "sunlounger1", "sunlounger2", "swimladders", "umbrella1"];
protected static const _jungleEnviroProps:Array = ["airplane", "turtle", "crocs", "boat", "ddoublender", "flathutj1", "hovel1", "hovel3", "hut1", "hut3", "hutround", "jhovel1", "jrock1", "jtower1", "jtower1copy", "jtree_1", "jtree_2", "jtree_3", "jtree5", "jtree6", "jtree67", "junglepath1", "jwall1", "mudpath", "plant", "rockj1", "rockj3", "smallhuttall", "smallhuttallcopy", "smallroof22", "swamp1", "treefallen", "trrrrre"];
protected static const _alpineEnviroProps:Array = ["castle", "clock_tower", "sheep", "alpbench1", "alpbench2", "alphou1", "alphou3", "alphou3copy", "alphou3copy2", "alphou3copy3", "alphou5", "alphou6", "alphouplain1", "alphouplain1copy", "alphouplain2", "alplogs", "alppool_1", "alppool_2", "balconystairs", "bigrock1copy", "bigrock1snow", "castlewall1", "castlewall2", "church1", "house2", "house2copy", "house4", "pinetree1", "pinetree1copy", "pinetree2", "pond", "rock3copy", "rock3snow", "rocks_2copy", "rocks_2snow", "shingleroof", "squareturet", "stnetower1", "stump1", "swimmingpool", "turet1", "turet2", "umbrella2", "wallcurve", "wallsection", "wallsectionshort", "windmill"];
protected static const _genericEnviroProps:Array = ["backroadsign", "biplaneani", "bothturnroadsign", "car1", "caravan1", "caravan2", "cherrypicker", "chevsign1", "chevsign1copy", "chevronroadsign", "CONPY1", "directionblock1", "directionblock2", "FIXBASE", "forwardroadsign", "fourlights", "grandstand", "grandstand2", "grandstand3", "grandstand4", "hazardturnroadsign", "heliani", "hgospitalitystsnd", "hotdog_van", "ICECREAMVAN", "JCB_1", "leftturnroadsign", "lorry_1", "lorry_2", "lorry_3", "lorry_4", "narrowingroadsign", "neutral_fence", "neutral_fence_2", "neutral_fencetired_3", "neutral_fencetired_4", "neutral_rope_fence", "neutral_rope_fence_2", "noentryroadsign", "plainroadsign", "plainroadsigncopy", "rightturnroadsign", "sidecanopy", "squaregaz", "startfinish", "startfinish2", "startfinish3", "swerveturnroadsign", "veiwplatform", "white_van", "worksroadsign"];
protected static var palettes:Array;
public function BuilderPalette(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
palettes = [_alpineEnviroProps.concat(_genericEnviroProps), _desertEnviroProps.concat(_genericEnviroProps), _jungleEnviroProps.concat(_genericEnviroProps), _seasideEnviroProps.concat(_genericEnviroProps), _trackProps];
_mc = _arg1;
_scrollVertical = _arg4;
_scrollHorizontal = _arg5;
_numItemsInList = _arg3;
_upBtn = new DynamicButton(_mc.up_btn);
_downBtn = new DynamicButton(_mc.down_btn);
ButtonSupport.setupButton(_upBtn, _onScroll);
ButtonSupport.setupButton(_downBtn, _onScroll);
_WorkingPaletteIndex = _arg2;
}
protected function _getItemById(_arg1:String):DisplayObject{
var _local2:Prop = new Prop(_arg1);
_local2.width = 40;
_local2.height = 40;
_local2.tooltip = (_WorkingPaletteIndex == 5);
return ((_local2 as DisplayObject));
}
protected function step_setup(_arg1:MovieClip, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean):void{
_arg1.static_mc.visible = _arg2;
_arg1.select_mc.visible = _arg3;
_arg1.complete_mc.visible = _arg4;
}
protected function _onScrollComplete(_arg1:GTween):void{
_isScrolling = false;
_mc.content_mc.items_mc.y = _start_y;
_mc.content_mc.items_mc.x = _start_x;
paint_items();
}
protected function paint_items():void{
var _local3:MovieClip;
var _local4:DisplayObject;
var _local1:MovieClip = _mc.content_mc.items_mc;
var _local2 = 1;
while (_local2 <= _numItemsInList) {
_local3 = _local1[("item_" + _local2)];
_local3.buttonMode = true;
_local3.addEventListener(MouseEvent.MOUSE_DOWN, _onItemSelected, false, 0, true);
if (_local3.holder_mc.numChildren > 0){
_local3.holder_mc.removeChildAt(0);
};
_local4 = _getItemForPosition(_local2);
_local3.holder_mc.addChild(_local4);
if (_local4.hasOwnProperty("id")){
_local3.gotoAndStop(Main.am.lockedStatus(_local4["id"]));
};
_local2++;
};
}
public function dispose():void{
var _local3:MovieClip;
ButtonSupport.unsetupButton(_upBtn, _onScroll);
ButtonSupport.unsetupButton(_downBtn, _onScroll);
var _local1:MovieClip = _mc.content_mc.items_mc;
var _local2 = 1;
while (_local2 <= _numItemsInList) {
_local3 = _local1[("item_" + _local2)];
_local3.removeEventListener(MouseEvent.MOUSE_DOWN, _onItemSelected);
_local2++;
};
}
protected function _getItemForPosition(_arg1:Number):DisplayObject{
var _local3:Number;
var _local2:Number = ((_arg1 + _currIndex) - 1);
if (_local2 > (_currList.length - 1)){
_local3 = (_local2 - _currList.length);
} else {
_local3 = _local2;
};
var _local4:String = _currList[_local3];
return (((_local4)==null) ? (new Sprite() as DisplayObject) : _getItemById(_local4));
}
protected function _onScroll(_arg1:MouseEvent):void{
if (!_isScrolling){
_isScrolling = true;
_start_y = _mc.content_mc.items_mc.y;
_start_x = _mc.content_mc.items_mc.x;
if ((_arg1.currentTarget as DynamicButton).name == "up_btn"){
_currIndex = ((_currIndex == 0)) ? (_currList.length - 2) : (_currIndex - 2);
new GTween(_mc.content_mc.items_mc, 0.2, {y:_scrollVertical.toString(), x:_scrollHorizontal.toString(), ease:Quadratic.easeOut}, {onComplete:_onScrollComplete});
} else {
_currIndex = ((_currIndex == (_currList.length - 2))) ? 0 : (_currIndex + 2);
new GTween(_mc.content_mc.items_mc, 0.2, {y:-(_scrollVertical).toString(), x:-(_scrollHorizontal).toString(), ease:Quadratic.easeOut}, {onComplete:_onScrollComplete});
};
};
}
public function initalRender():void{
_currList = palettes[(_WorkingPaletteIndex - 1)];
if ((_currList.length % 2) == 1){
throw (new Error("Toolbar has gone wrong"));
};
paint_items();
}
public function get currentList():Array{
return (_currList);
}
protected function _onItemSelected(_arg1:MouseEvent):void{
var _local4:Prop;
var _local5:DynamicEvent;
var _local2:DisplayObject = (_arg1.currentTarget as DisplayObject);
var _local3:Prop = (_local2["holder_mc"].getChildAt(0) as Prop);
if (Main.am.lockedStatus(_local3.id) != AchievementsManager.LOCKED){
_local4 = new Prop(_local3.id);
_local5 = new DynamicEvent(Event.CHANGE);
_local5.prop = _local4;
dispatchEvent(_local5);
};
}
public static function test():void{
var _local1:Array;
var _local2:String;
for each (_local1 in palettes) {
for each (_local2 in _local1) {
new Prop(_local2);
};
};
}
}
}//package com.kerb.modnation.builder
Section 282
//BuilderToolbar (com.kerb.modnation.builder.BuilderToolbar)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.gskinner.motion.*;
import com.kerb.ui.*;
import com.gskinner.motion.easing.*;
public class BuilderToolbar extends EventDispatcher implements IDisposable {
private var _btnFinish:DynamicButton;
private var _bar:MovieClip;
private var _btnNextStep:DynamicButton;
private var _btnUndo:DynamicButton;
private var _btnPreview:DynamicButton;
private var _btnAuto:DynamicButton;
private var g:GTween;
private var _btnClear:DynamicButton;
private var _mc:MovieClip;
private var _btnHelp:DynamicButton;
public function BuilderToolbar(_arg1:MovieClip, _arg2:String){
_mc = _arg1;
_bar = _mc.countdown_mc.bar_mc;
TextManager.getInstance().setTextField(_mc.countdown_mc.text_mc.label_txt, _arg2);
_bar.gotoAndStop(1);
_btnHelp = new ToolTipDynamicButton(_mc.btnHelp, "help.btn");
_btnClear = new ToolTipDynamicButton(_mc.btnClear, "clear.btn");
_btnUndo = new ToolTipDynamicButton(_mc.btnUndo, "undo.btn");
_btnNextStep = new DynamicButton(_mc.nextStep_btn, "nextStep.btn");
_btnAuto = new ToolTipDynamicButton(_mc.btnAutocomp, "autopopulate.btn");
ButtonSupport.setupButton(_btnHelp, _handleClick);
ButtonSupport.setupButton(_btnClear, _handleClick);
ButtonSupport.setupButton(_btnUndo, _handleClick);
ButtonSupport.setupButton(_btnAuto, _handleClick);
ButtonSupport.setupButton(_btnNextStep, _handleClick);
}
private function _handleClick(_arg1:Event):void{
var _local2:DynamicEvent = new DynamicEvent(Event.CHANGE);
_local2.clickedItem = (_arg1.target as DynamicButton).name;
dispatchEvent(_local2);
}
public function hideAutoPopulate():void{
_btnAuto.visible = false;
}
public function dispose():void{
ButtonSupport.unsetupButton(_btnHelp, _handleClick);
ButtonSupport.unsetupButton(_btnClear, _handleClick);
ButtonSupport.unsetupButton(_btnUndo, _handleClick);
ButtonSupport.unsetupButton(_btnAuto, _handleClick);
ButtonSupport.unsetupButton(_btnNextStep, _handleClick);
}
public function get btnNextStep():DynamicButton{
return (_btnNextStep);
}
public function hideBar():void{
_mc.countdown_mc.visible = false;
}
public function pulseButton(_arg1:Boolean):void{
if (_arg1){
if (g == null){
g = new GTween(_btnNextStep.mcRef, 1, {blur:1, brightness:100}, {ease:Circular.easeOut, delay:0});
g.repeatCount = 999;
g.reflect = true;
};
} else {
if (g != null){
g.paused = true;
g = null;
};
};
}
public function setBarToPercent(_arg1:Number):void{
_bar.gotoAndStop(Math.round(_arg1));
}
}
}//package com.kerb.modnation.builder
Section 283
//CarPalette (com.kerb.modnation.builder.CarPalette)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class CarPalette extends BuilderPalette {
public function CarPalette(_arg1:MovieClip, _arg2:Number, _arg3:Number){
super(_arg1, _arg2, _arg3, 0, 100);
palettes = [["car_1", "car_2", "car_3", "car_4", "car_5", "car_6", "car_7", "car_8", "car_9", "car_10"]];
initalRender();
}
override protected function _getItemById(_arg1:String):DisplayObject{
var _local2:CarAsset = new CarAsset(_arg1);
_local2.scaleX = (_local2.scaleX + 0.5);
_local2.scaleY = (_local2.scaleY + 0.5);
return ((_local2 as DisplayObject));
}
override protected function _onItemSelected(_arg1:MouseEvent):void{
var _local4:String;
var _local5:DynamicEvent;
var _local2:DisplayObject = (_arg1.currentTarget as DisplayObject);
var _local3:CarAsset = (_local2["holder_mc"].getChildAt(0) as CarAsset);
if (Main.am.lockedStatus(_local3.id) != AchievementsManager.LOCKED){
_local4 = _local3.id;
_local5 = new DynamicEvent(Event.CHANGE);
_local5.id = _local4;
dispatchEvent(_local5);
};
}
}
}//package com.kerb.modnation.builder
Section 284
//Prop (com.kerb.modnation.builder.Prop)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
import flash.filters.*;
public class Prop extends Sprite implements IDisposable {
private var _tooltip:MovieClip;
public var isTrackProp:Boolean;
private var _badFilters:Array;
public var mc:MovieClip;
public var id:String;
private var _interactive:Boolean;
private var _doRotate:Boolean;// = false
private var _startAngle:Number;
private var _startPos:Point;
private var _doPosition:Boolean;// = false
private var _canPlace:Boolean;
private var _goodFilters:Array;
public static var activeProp:Prop;
public function Prop(_arg1:String){
_goodFilters = [];
_badFilters = [new ColorMatrixFilter([1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0])];
super();
this.id = _arg1;
mc = Main.afm.createMovieClip("props", _arg1);
this.addChild(mc);
var _local2:Rectangle = mc.getBounds(this);
mc.x = ((-(_local2.width) / 2) - _local2.x);
mc.y = ((-(_local2.height) / 2) - _local2.y);
}
private function _onShowTip(_arg1:MouseEvent):void{
_tooltip = Main.afm.createMovieClip("gui", "tool_tip");
var _local2:Point = new Point(x, y);
_local2 = localToGlobal(_local2);
_local2 = stage.globalToLocal(_local2);
_tooltip.x = _local2.x;
_tooltip.y = _local2.y;
TextManager.getInstance().setTextField(_tooltip.ttipHelp.label_txt, ("help." + id));
stage.addChild(_tooltip);
}
public function activate():void{
if (activeProp != null){
activeProp.deactivate();
};
var _local1:Rectangle = getBounds(this);
_createRotateHandle(_local1.bottomRight);
activeProp = this;
}
private function _onDown(_arg1:MouseEvent):void{
if (!_doRotate){
_doPosition = true;
};
if (activeProp != this){
activate();
};
}
public function set tooltip(_arg1:Boolean):void{
if (_arg1){
addEventListener(MouseEvent.ROLL_OVER, _onShowTip, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, _onHideTip, false, 0, true);
};
}
public function set interactive(_arg1:Boolean):void{
_interactive = _arg1;
if (_interactive){
buttonMode = true;
addEventListener(MouseEvent.MOUSE_DOWN, _onDown, false, 0, true);
};
}
private function _onHideTip(_arg1:MouseEvent):void{
_tooltip.parent.removeChild(_tooltip);
_tooltip = null;
}
private function _onHandleDown(_arg1:MouseEvent):void{
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
_startPos = new Point(x, y);
_startPos = parent.localToGlobal(_startPos);
_startAngle = -(KerbMaths.angleBetweenDegrees(_startPos, new Point(stage.mouseX, stage.mouseY)));
_doRotate = true;
_doPosition = false;
}
public function onUp():void{
_doPosition = false;
_doRotate = false;
}
private function _createRotateHandle(_arg1:Point):void{
var _local2:MovieClip = Main.afm.createMovieClip("gui", "rotate_prop");
_local2.buttonMode = true;
_local2.x = _arg1.x;
_local2.y = _arg1.y;
_local2.addEventListener(MouseEvent.MOUSE_DOWN, _onHandleDown, false, 0, true);
addChild(_local2);
}
public function dispose():void{
removeEventListener(MouseEvent.MOUSE_DOWN, _onDown);
removeEventListener(MouseEvent.ROLL_OVER, _onShowTip);
removeEventListener(MouseEvent.ROLL_OUT, _onHideTip);
}
public function position():void{
var _local1:Point;
if (_doPosition){
_local1 = new Point(stage.mouseX, stage.mouseY);
_local1 = parent.globalToLocal(_local1);
x = _local1.x;
y = _local1.y;
};
if (_doRotate){
rotation = (_startAngle - -(KerbMaths.angleBetweenDegrees(_startPos, new Point(stage.mouseX, stage.mouseY))));
};
}
public function get canPlace():Boolean{
return (_canPlace);
}
public function deactivate():void{
removeChildAt((numChildren - 1));
}
public function set canPlace(_arg1:Boolean):void{
_canPlace = _arg1;
mc.filters = (_canPlace) ? _goodFilters : _badFilters;
}
}
}//package com.kerb.modnation.builder
Section 285
//PropLayer (com.kerb.modnation.builder.PropLayer)
package com.kerb.modnation.builder {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.*;
public class PropLayer extends Sprite implements IDisposable {
private const SCROLL_SPEED:Number = 25;
private const SCROLL_ZONE_SIZE:Number = 130;
private var _trackData:TrackData;
private var _map:BitmapData;
private var _propXPlacementOffset:Number;
private var _recorder:Recorder;
private var _px:Number;
private var _py:Number;
private var _renderer:RacerRenderer;
private var _undo:UndoManager;
private var _autocomplete:AutoComplete;
private var _holder;
private var _vx:Number;// = 0
private var _vy:Number;// = 0
public var isTrackProp:Boolean;// = false
private var _bm:Bitmap;
private var _lastPropPlace:Point;
private var v:Number;// = 0.1
private var _sp:Sprite;
public function PropLayer(){
_lastPropPlace = new Point(-1000000, -100000);
super();
this.addEventListener(Event.ADDED_TO_STAGE, _onAdded);
_trackData = UserManager.instance().currentTrack;
_px = _trackData.startX;
_py = _trackData.startY;
_recorder = new Recorder();
_renderer = UserManager.instance().renderer;
RacerRenderer.cacheTrack = isTrackProp;
_undo = new UndoManager();
_renderer.addEventListener(Event.COMPLETE, _onRenderComplete);
_renderer.render(_trackData);
}
private function _onMouseDown(_arg1:MouseEvent):void{
if (Prop.activeProp != null){
if (!Prop.activeProp.hitTestPoint(stage.mouseX, stage.mouseY)){
_sp.startDrag();
};
} else {
_sp.startDrag();
};
}
private function _positionProp():void{
if (Prop.activeProp != null){
Prop.activeProp.position();
Prop.activeProp.canPlace = _canPlace();
};
}
private function _onRenderComplete(_arg1:Event):void{
_renderer.removeEventListener(Event.COMPLETE, _onRenderComplete);
}
private function _scaleView():void{
this.scaleX = (this.scaleY = (this.scaleX + ((v - this.scaleX) / 6)));
}
private function _onEnterFrame(_arg1:Event):void{
_scaleView();
_positionProp();
}
public function dispose():void{
_undo.dispose();
removeEventListener(Event.ENTER_FRAME, _onEnterFrame);
_sp.removeEventListener(MouseEvent.DOUBLE_CLICK, _onDoubleClick);
}
public function changeZoom(_arg1:Number):void{
v = (v + _arg1);
v = Math.max(0.1, v);
v = Math.min(2, v);
}
private function _onAdded(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, _onAdded);
_holder = new Sprite();
_sp = Main.afm.createMovieClip("gui", "track_canvas_holder");
_bm = new Bitmap(_renderer.bitmapData);
_bm.smoothing = true;
_map = _renderer.mapBitmapData;
this.addChild(_holder);
_holder.addChild(_sp);
_sp.addChild(_bm);
_bm.x = -(Game.MAX_SIZE_D_2);
_bm.y = -(Game.MAX_SIZE_D_2);
_sp.doubleClickEnabled = true;
_sp.mouseEnabled = true;
_sp.addEventListener(MouseEvent.DOUBLE_CLICK, _onDoubleClick);
this.x = (stage.stageWidth / 2);
this.y = (stage.stageHeight / 2);
_sp.x = 0;
_sp.y = 0;
_sp.addEventListener(MouseEvent.MOUSE_DOWN, _onMouseDown, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, _onMouseUp, false, 0, true);
this.scaleX = (this.scaleY = v);
addEventListener(Event.ENTER_FRAME, _onEnterFrame);
}
public function addPropsToTrack():void{
var _local2:Prop;
var _local1 = 1;
while (_local1 < _sp.numChildren) {
if ((_sp.getChildAt(_local1) is Prop)){
_local2 = (_sp.getChildAt(_local1) as Prop);
if (_local2.canPlace){
_recorder.addProp(_local2.x, _local2.y, _local2.rotation, _local2.id);
};
};
_local1++;
};
}
private function _positionView():void{
_sp.x = (Game.MAX_SIZE_D_2 - _px);
_sp.y = (Game.MAX_SIZE_D_2 - _py);
}
private function _onMouseUp(_arg1:MouseEvent):void{
_sp.stopDrag();
if (Prop.activeProp != null){
Prop.activeProp.onUp();
};
}
private function _testTrackPoint(_arg1:MovieClip):Boolean{
var _local2:Point = new Point(_arg1.x, _arg1.y);
_local2 = _arg1.parent.localToGlobal(_local2);
if ((((((((_local2.x < 0)) || ((_local2.y < 0)))) || ((_local2.x > Constants.MAX_BITMAP_SIZE)))) || ((_local2.y > Constants.MAX_BITMAP_SIZE)))){
return (true);
};
return (_bm.bitmapData.hitTest(new Point(0, 0), 0xFF, _local2));
}
public function get numberOfProps():Number{
return (_sp.numChildren);
}
private function _onDoubleClick(_arg1:MouseEvent):void{
if (_arg1.shiftKey){
changeZoom(-0.1);
} else {
changeZoom(0.1);
};
}
public function undo(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (_sp.numChildren > 2){
_sp.removeChildAt((_sp.numChildren - 1));
};
} else {
_local2 = _sp.numChildren;
while (_local2 > 2) {
_sp.removeChildAt((_local2 - 1));
_local2--;
};
};
dispatchEvent(new Event(Event.CHANGE));
}
public function setProp(_arg1:Prop):void{
var _local2:Point = new Point((stage.stageWidth / 2), (stage.stageHeight / 2));
_local2 = _sp.globalToLocal(_local2);
if ((((_local2.x == _lastPropPlace.x)) && ((_local2.y == _lastPropPlace.y)))){
_propXPlacementOffset = (_propXPlacementOffset + 10);
_local2.x = (_local2.x + _propXPlacementOffset);
} else {
_lastPropPlace = _local2;
_propXPlacementOffset = 0;
};
_sp.addChild(_arg1);
_arg1.x = _local2.x;
_arg1.y = _local2.y;
_arg1.interactive = true;
_arg1.isTrackProp = isTrackProp;
_arg1.activate();
trace(("activated prop:" + _arg1.id));
dispatchEvent(new Event(Event.CHANGE));
}
public function autoAdd(_arg1:Array):void{
var _local4:Number;
var _local5:Prop;
var _local2:Number = (isTrackProp) ? 5 : 10;
var _local3:int;
while (_local3 < _local2) {
if (numberOfProps < Constants.MAX_PROPS){
do {
_local4 = Math.floor((Math.random() * _arg1.length));
} while (Main.am.lockedStatus(_arg1[_local4]) == AchievementsManager.LOCKED);
_local5 = new Prop(_arg1[_local4]);
setProp(_local5);
do {
_local5.rotation = (Math.random() * 360);
_local5.x = ((Math.random() * Constants.MAX_BITMAP_SIZE) - Game.MAX_SIZE_D_2);
_local5.y = ((Math.random() * Constants.MAX_BITMAP_SIZE) - Game.MAX_SIZE_D_2);
} while (!(_canPlace()));
_local5.canPlace = true;
};
_local3++;
};
}
private function _canPlace():Boolean{
var _local4:uint;
var _local1:Rectangle = Prop.activeProp.mc.getBounds(_bm);
var _local2:ByteArray = _map.getPixels(_local1);
var _local3:uint;
_local2.position = 0;
while (_local2.bytesAvailable) {
_local4 = _local2.readUnsignedInt();
if (((!(isTrackProp)) && (!((_local4 == 0))))){
_local3++;
};
if (((isTrackProp) && ((_local4 == 0)))){
_local3++;
};
};
return ((_local3 < ((_local1.height * _local1.width) / 8)));
}
}
}//package com.kerb.modnation.builder
Section 286
//Recorder (com.kerb.modnation.builder.Recorder)
package com.kerb.modnation.builder {
import flash.events.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
public class Recorder extends EventDispatcher {
private var _data:TrackData;
public function Recorder(){
_data = UserManager.instance().currentTrack;
}
public function add(_arg1:Number, _arg2:Number, _arg3:Number):void{
_data.push({x:_arg1, y:_arg2, r:_arg3});
}
public function addProp(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String):void{
_data.addProp({x:_arg1, y:_arg2, r:_arg3, id:_arg4});
}
public function get trackData():TrackData{
return (_data);
}
public function get lastPosition():Object{
return (_data.track[(_data.track.length - 1)]);
}
public function get numSlices():Number{
return ((_data.track.length - 1));
}
public function undoTo(_arg1:Number):void{
_data.track = _data.track.slice(0, _arg1);
}
}
}//package com.kerb.modnation.builder
Section 287
//ToolTipDynamicButton (com.kerb.modnation.builder.ToolTipDynamicButton)
package com.kerb.modnation.builder {
import flash.display.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.ui.*;
public class ToolTipDynamicButton extends DynamicButton {
public function ToolTipDynamicButton(_arg1:Sprite, _arg2:String="", _arg3:Boolean=true){
super(_arg1, _arg2, _arg3);
}
override public function initText(_arg1:String=null):void{
if (_arg1 != null){
labelID = _arg1;
};
if (labelID != ""){
if (up.getChildByName("ttipHelp") != null){
(up.getChildByName("ttipHelp") as MovieClip).mouseEnabled = false;
TextManager.getInstance().setTextField((up.ttipHelp.getChildByName("label_txt") as TextField), labelID);
};
if (over.getChildByName("ttipHelp") != null){
(over.getChildByName("ttipHelp") as MovieClip).mouseEnabled = false;
TextManager.getInstance().setTextField((over.ttipHelp.getChildByName("label_txt") as TextField), labelID);
};
if (down.getChildByName("ttipHelp") != null){
(down.getChildByName("ttipHelp") as MovieClip).mouseEnabled = false;
TextManager.getInstance().setTextField((down.ttipHelp.getChildByName("label_txt") as TextField), labelID);
};
if (((!((select == null))) && (!((select.getChildByName("ttipHelp") == null))))){
TextManager.getInstance().setTextField((select.ttipHelp.getChildByName("label_txt") as TextField), labelID);
};
};
}
}
}//package com.kerb.modnation.builder
Section 288
//UndoManager (com.kerb.modnation.builder.UndoManager)
package com.kerb.modnation.builder {
import flash.display.*;
import flash.geom.*;
import com.kerb.utils.*;
public class UndoManager implements IDisposable {
private const MAX_UNDO:Number = 5;
private const STEPS_PER_UNDO:Number = 500;
private var _currentStep:Number;// = 0
private var _undoRenders:Array;
public function UndoManager(){
_undoRenders = [];
super();
}
public function undo(_arg1:Recorder, _arg2:Boolean):BitmapData{
var _local4:BitmapData;
var _local5:Number;
var _local3:Object = _undoRenders.pop();
if (((!((_local3 == null))) && (!(_arg2)))){
_local4 = (_local3.bitmap as BitmapData);
_local5 = (_local3.pos as Number);
_arg1.undoTo(_local5);
_currentStep = STEPS_PER_UNDO;
return (_local4);
};
_arg1.undoTo(1);
return (new BitmapData(Constants.MAX_BITMAP_SIZE, Constants.MAX_BITMAP_SIZE, true, 0));
}
public function step(_arg1:BitmapData, _arg2:Recorder):void{
var _local3:BitmapData;
if (_currentStep == 0){
if (_undoRenders.length == MAX_UNDO){
_undoRenders = _undoRenders.slice(1);
};
_local3 = new BitmapData(_arg1.width, _arg1.height);
_local3.copyPixels(_arg1, new Rectangle(0, 0, _arg1.width, _arg1.height), new Point(0, 0));
_undoRenders.push({bitmap:_local3, pos:_arg2.trackData.track.length});
_currentStep = STEPS_PER_UNDO;
};
_currentStep--;
}
public function dispose():void{
var _local1:BitmapData;
while (_undoRenders.length > 0) {
_local1 = _undoRenders.pop().bitmap;
_local1 = null;
};
_undoRenders = null;
}
}
}//package com.kerb.modnation.builder
Section 289
//AchievementsManager (com.kerb.modnation.data.AchievementsManager)
package com.kerb.modnation.data {
import flash.events.*;
import flash.utils.*;
import com.kerb.modnation.domain.*;
import com.kerb.modnation.*;
public class AchievementsManager extends EventDispatcher {
public var lastID:Number;
private var _xmlData:XML;
private var _lockedItems:Object;
public static const LOCKED:String = "LOCKED";
public static const UNLOCKED:String = "UNLOCKED";
public static const OPEN:String = "OPEN";
private static var _allow:Boolean;
private static var _instance:AchievementsManager;
public function AchievementsManager(_arg1:IEventDispatcher=null){
_lockedItems = {};
super(_arg1);
if (!_allow){
throw (new Error("class is singleton"));
};
_init();
}
public function initFromClass(_arg1:Class):void{
var _local3:XML;
var _local2:ByteArray = ByteArray(new (_arg1));
var _local4:String = _local2.readUTFBytes(3);
if (_local4.length == 1){
this._xmlData = new XML(_local2.readUTFBytes((_local2.length - 3)));
} else {
this._xmlData = new XML((_local4 + _local2.readUTFBytes((_local2.length - 3))));
};
}
public function setUnlockedItems(_arg1:Array):void{
var item:AchievementDetails;
var x:XML;
var a = _arg1;
for each (item in a) {
x = _xmlData..item.(@backendid == item.type)[0];
x.@unlocked = "true";
lastID = item.type;
};
}
public function getAchievementID(_arg1:Number):String{
var x:XML;
var id = _arg1;
x = _xmlData..item.(@backendid == id)[0];
return (x.@unlock);
}
public function lockedStatus(_arg1:String):String{
var x:XML;
var id = _arg1;
x = _xmlData.item.(@unlock == id)[0];
if (x == null){
return (OPEN);
};
if (x.hasOwnProperty("@unlocked")){
return (UNLOCKED);
};
return (LOCKED);
}
private function _init():void{
initFromClass(Main.unlocks);
}
public static function instance():AchievementsManager{
if (_instance == null){
_allow = true;
_instance = new (AchievementsManager);
_allow = false;
};
return (_instance);
}
}
}//package com.kerb.modnation.data
Section 290
//UserManager (com.kerb.modnation.data.UserManager)
package com.kerb.modnation.data {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.modnation.UI.*;
import com.kerb.social.*;
import flash.net.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.*;
import com.kerb.modnation.social.*;
public class UserManager extends EventDispatcher {
private var _ghost:Ghost;
private var _currentUser:UserDetails;
protected var _isLogged:Boolean;// = false
private var _currentChallengeDetails:ChallengeDetails;
public var currentCart:Number;// = 1
public var renderer:RacerRenderer;
public var ghosts:Array;
private var _track:TrackData;
private var _currentTrackDetails:TrackDetails;
private var _xml:XML;
public var currentFacebookUser:ISocialUser;
protected var _onCompleteCallBack:Function;
private var _currentCompetitionDetails:ChallengeDetails;
public var currentTime:Number;// = 0
private static var _allow:Boolean;
private static var _instance:UserManager;
public function UserManager(_arg1:IEventDispatcher=null){
super(_arg1);
if (!_allow){
throw (new Error("class is singleton"));
};
_init();
}
public function get currentGhost():Ghost{
return (((_ghost == null)) ? new Ghost() : _ghost);
}
public function get currentTrackDetails():TrackDetails{
return (_currentTrackDetails);
}
public function get currentUserId():int{
if (_currentUser == null){
return (0);
};
return (_currentUser.id);
}
public function set currentTrack(_arg1:TrackData):void{
_track = _arg1;
}
public function set currentTrackDetails(_arg1:TrackDetails):void{
_currentTrackDetails = _arg1;
}
public function set currentGhost(_arg1:Ghost):void{
_ghost = _arg1;
}
public function set currentCompetitionDetails(_arg1:ChallengeDetails):void{
_currentCompetitionDetails = _arg1;
}
private function onSocialNetworkComplete(_arg1:Event):void{
Main.um.currentFacebookUser = Main.fbm.getUserById(Main.fbm.uid);
Main.rdm.addEventListener(RemoteDataManager.GET_USER, _onUserLoaded);
var _local2:String = Main.fbm.uid;
trace((("----------------ID: " + Main.fbm.uidPrefix) + Main.fbm.uid));
trace(("----------------NAME: " + Main.fbm.getUserById(_local2).username));
trace(("----------------EMAIL: " + Main.fbm.getUserById(_local2).email));
trace(("----------------LOCALE: " + Constants.LOCALE));
if (((!((Main.fbm.getUserById(_local2).username == " "))) && (!((Main.fbm.getUserById(_local2).email == null))))){
Main.fbm.removeEventListener(Event.COMPLETE, onSocialNetworkComplete);
Main.rdm.getUser((Main.fbm.uidPrefix + Main.fbm.uid), Main.um.currentFacebookUser.username, Main.um.currentFacebookUser.email, Constants.LOCALE);
};
}
public function set isLogged(_arg1:Boolean):void{
_isLogged = _arg1;
}
public function set achievements(_arg1:XML):void{
_xml = _arg1;
}
private function _onUserLoaded(_arg1:RemoteDataManagerEvent):void{
Main.rdm.removeEventListener(RemoteDataManager.GET_USER, _onUserLoaded);
var _local2:UserDetails = _arg1.user;
trace(("----------Current user is " + _local2));
UserManager.instance().currentUser = _local2;
Main.rdm.getCompetitionDetails(_local2.id, Constants.LOCALE);
var _local3:SharedObject = SharedObject.getLocal(Constants.APP_NAME);
_local3.data.facebookuser = _local2;
_local3.flush();
Main.STAGE.dispatchEvent(new Event(UI.EVENT_HIDE_LOGIN));
allComplete();
}
public function set currentUser(_arg1:UserDetails):void{
_currentUser = _arg1;
}
public function ghostAtIndex(_arg1:Number):GhostRacer{
return ((ghosts[_arg1] as GhostRacer));
}
public function get currentTrack():TrackData{
return (_track);
}
public function get isLogged():Boolean{
trace("isLogged", _isLogged);
return (_isLogged);
}
public function get currentCompetitionDetails():ChallengeDetails{
return (_currentCompetitionDetails);
}
public function get currentUser():UserDetails{
return (_currentUser);
}
public function login(_arg1:Function=null):void{
if (_arg1 != null){
_onCompleteCallBack = _arg1;
};
if (Constants.KERB_SOCIAL_ID == Constants.KERB_SOCIAL_FACEBOOK_CONNECT){
Tracking.track(Tracking.LOG_IN_WITH_FACEBOOK_CONNECT);
};
Main.fbm.addEventListener(Event.COMPLETE, onSocialNetworkComplete);
Main.fbm.init();
}
private function _init():void{
}
public function set currentChallengeDetails(_arg1:ChallengeDetails):void{
_currentChallengeDetails = _arg1;
}
public function get userName():String{
return (((currentFacebookUser == null)) ? "Player One" : currentFacebookUser.username);
}
public function get currentChallengeDetails():ChallengeDetails{
return (_currentChallengeDetails);
}
protected function allComplete():void{
if ((Main.fbm is ModnationSeededSocialManager)){
trace("Seeded Version Loaded");
} else {
trace("Social Version Loaded");
_isLogged = true;
};
dispatchEvent(new Event(Event.COMPLETE));
Main.sm.refreshScreen();
if (_onCompleteCallBack != null){
_onCompleteCallBack();
_onCompleteCallBack = null;
};
}
public static function instance():UserManager{
if (_instance == null){
_allow = true;
_instance = new (UserManager);
_allow = false;
};
return (_instance);
}
}
}//package com.kerb.modnation.data
Section 291
//AchievementDetails (com.kerb.modnation.domain.AchievementDetails)
package com.kerb.modnation.domain {
import com.kerb.utils.*;
public class AchievementDetails {
public var type:int;
public var timestamp:Date;
public function AchievementDetails(_arg1:XML){
type = parseInt(_arg1.type.text());
timestamp = DateHelper.parse(_arg1.timestamp.text());
}
public function toString():String{
return (((("type: " + type) + ", timestamp: ") + timestamp));
}
}
}//package com.kerb.modnation.domain
Section 292
//ChallengeDetails (com.kerb.modnation.domain.ChallengeDetails)
package com.kerb.modnation.domain {
import com.kerb.utils.*;
public class ChallengeDetails {
public var isRated:Boolean;
public var competitionLocale:String;
public var name:String;
public var trackCreatorName:String;
public var myTime:int;
public var id:int;
public var trackCreatorLocale:String;
public var trackUrl:String;
public var timestamp:Date;
public var creatorLocale:String;
public var trackRatingCount:int;
public var expires:Date;
public var isCompetition:Boolean;
public var topUserLocale:String;
public var totalEntries:int;
public var topUser:int;
public var topTime:int;
public var competitionPostMessageUrl:String;
public var trackEnvironment:int;
public var user:int;
public var competitionTermsUrl:String;
public var track:int;
public var creatorName:String;
public var trackRatingTotal:int;
public var trackThumbnailUrl:String;
public var topUserName:String;
public var finished:Boolean;
public var competitionPreMessageUrl:String;
public var trackName:String;
public var myRank:int;
public var competitionImageUrl:String;
public function ChallengeDetails(_arg1:XML){
id = parseInt(_arg1.id.text());
user = parseInt(_arg1.user.text());
track = parseInt(_arg1.track.text());
name = _arg1.name.text();
timestamp = DateHelper.parse(_arg1.timestamp.text());
expires = DateHelper.parse(_arg1.expires.text());
isCompetition = (_arg1.isCompetition.text() == 1);
competitionLocale = _arg1.competitionLocale.text();
competitionImageUrl = _arg1.competitionImageUrl.text();
competitionPreMessageUrl = _arg1.competitionPreMessageUrl.text();
competitionPostMessageUrl = _arg1.competitionPostMessageUrl.text();
competitionTermsUrl = _arg1.competitionTermsUrl.text();
finished = (_arg1.finished.text() == 1);
trackName = _arg1.trackName.text();
trackCreatorName = _arg1.trackCreatorName.text();
trackCreatorLocale = _arg1.trackCreatorLocale.text();
trackEnvironment = parseInt(_arg1.trackEnvironment.text());
trackRatingCount = parseInt(_arg1.trackRatingCount.text());
trackRatingTotal = parseInt(_arg1.trackRatingTotal.text());
trackThumbnailUrl = _arg1.trackThumbnailUrl.text();
trackUrl = _arg1.trackUrl.text();
topTime = parseInt(_arg1.topTime.text());
topUser = parseInt(_arg1.topUser.text());
topUserName = _arg1.topUserName.text();
topUserLocale = _arg1.topUserLocale.text();
creatorName = _arg1.creatorName.text();
creatorLocale = _arg1.creatorLocale.text();
myTime = parseInt(_arg1.myTime.text());
myRank = parseInt(_arg1.myRank.text());
isRated = (_arg1.isRated.text() == 1);
totalEntries = parseInt(_arg1.totalEntries.text());
}
public function toString():String{
return (((((((("id: " + id) + ", user: ") + user) + ", track: ") + track) + ", name: ") + name));
}
}
}//package com.kerb.modnation.domain
Section 293
//GhostVectors (com.kerb.modnation.domain.GhostVectors)
package com.kerb.modnation.domain {
import com.kerb.utils.*;
public class GhostVectors {
public var cart:int;
public var rank:int;
public var userLocale:String;
public var user:int;
public var time:int;
public var timestamp:Date;
public var vectors:String;
public var userExternalId:String;
public var userName:String;
public function GhostVectors(_arg1:XML){
user = parseInt(_arg1.user.text());
userName = _arg1.userName.text();
userLocale = _arg1.userLocale.text();
userExternalId = _arg1.userExternalId.text();
time = parseInt(_arg1.time.text());
rank = parseInt(_arg1.rank.text());
cart = parseInt(_arg1.cart.text());
vectors = _arg1.vectors.text();
timestamp = DateHelper.parse(_arg1.timestamp.text());
}
public function toString():String{
return ((((((((((("user: " + user) + ", userName: ") + userName) + ", cart: ") + cart) + ", timestamp: ") + timestamp) + ", vectors: ") + vectors.length) + " bytes"));
}
}
}//package com.kerb.modnation.domain
Section 294
//TimeDetails (com.kerb.modnation.domain.TimeDetails)
package com.kerb.modnation.domain {
import com.kerb.utils.*;
public class TimeDetails {
public var isRated:Boolean;
public var totalEntries:int;
public var userLocale:String;
public var trackEnvironment:int;
public var user:int;
public var time:int;
public var rank:int;
public var track:int;
public var creatorName:String;
public var trackRatingTotal:int;
public var timestamp:Date;
public var cart:int;
public var challenge:int;
public var trackUrl:String;
public var trackThumbnailUrl:String;
public var trackRatingCount:int;
public var creatorLocale:String;
public var userName:String;
public var trackName:String;
public function TimeDetails(_arg1:XML){
user = parseInt(_arg1.user.text());
track = parseInt(_arg1.track.text());
challenge = ((_arg1.challenge.text() == "null")) ? 0 : parseInt(_arg1.challenge.text());
userName = _arg1.userName.text();
userLocale = _arg1.userLocale.text();
time = parseInt(_arg1.time.text());
cart = parseInt(_arg1.cart.text());
rank = parseInt(_arg1.rank.text());
totalEntries = parseInt(_arg1.totalEntries.text());
timestamp = DateHelper.parse(_arg1.timestamp.text());
trackName = _arg1.trackName.text();
trackEnvironment = parseInt(_arg1.trackEnvironment.text());
trackRatingCount = parseInt(_arg1.trackRatingCount.text());
trackRatingTotal = parseInt(_arg1.trackRatingTotal.text());
trackThumbnailUrl = _arg1.trackThumbnailUrl.text();
trackUrl = _arg1.trackUrl.text();
creatorName = _arg1.creatorName.text();
creatorLocale = _arg1.creatorLocale.text();
isRated = (_arg1.isRated.text() == 1);
}
public function toString():String{
return (((((((("user: " + user) + ", track: ") + track) + ", challenge: ") + challenge) + ", time: ") + time));
}
}
}//package com.kerb.modnation.domain
Section 295
//TrackDetails (com.kerb.modnation.domain.TrackDetails)
package com.kerb.modnation.domain {
import com.kerb.utils.*;
public class TrackDetails {
public var topUser:int;
public var topUserLocale:String;
public var topTime:int;
public var isRated:Boolean;
public var user:int;
public var timesRaced:int;
public var totalEntries:int;
public var name:String;
public var environment:int;
public var timestamp:Date;
public var creatorName:String;
public var myTime:int;
public var id:int;
public var thumbnailUrl:String;
public var ratingTotal:int;
public var topUserName:String;
public var creatorLocale:String;
public var ratingCount:int;
public var myRank:int;
public function TrackDetails(_arg1:XML){
id = parseInt(_arg1.id.text());
user = parseInt(_arg1.user.text());
name = _arg1.name.text();
environment = parseInt(_arg1.environment.text());
timestamp = DateHelper.parse(_arg1.timestamp.text());
ratingCount = parseInt(_arg1.ratingCount.text());
ratingTotal = parseInt(_arg1.ratingTotal.text());
thumbnailUrl = _arg1.thumbnailUrl.text();
timesRaced = parseInt(_arg1.timesRaced.text());
creatorName = _arg1.creatorName.text();
creatorLocale = _arg1.creatorLocale.text();
topTime = parseInt(_arg1.topTime.text());
topUser = parseInt(_arg1.topUser.text());
topUserName = _arg1.topUserName.text();
topUserLocale = _arg1.topUserLocale.text();
myTime = parseInt(_arg1.myTime.text());
myRank = parseInt(_arg1.myRank.text());
isRated = (_arg1.isRated.text() == 1);
totalEntries = parseInt(_arg1.totalEntries.text());
}
public function toString():String{
return (((((("id: " + id) + ", user: ") + user) + ", name: ") + name));
}
}
}//package com.kerb.modnation.domain
Section 296
//TrackVectors (com.kerb.modnation.domain.TrackVectors)
package com.kerb.modnation.domain {
public class TrackVectors {
public var trackVectors:String;
public function TrackVectors(_arg1:XML){
trackVectors = _arg1.trackVectors.text();
}
public function toString():String{
return ((("track: " + trackVectors.length) + " bytes"));
}
}
}//package com.kerb.modnation.domain
Section 297
//UserDetails (com.kerb.modnation.domain.UserDetails)
package com.kerb.modnation.domain {
import com.kerb.utils.*;
public class UserDetails {
public var user:int;
public var lastLogin:Date;
public var id:int;
public function UserDetails(_arg1:XML){
id = parseInt(_arg1.id.text());
user = parseInt(_arg1.user.text());
lastLogin = DateHelper.parse(_arg1.lastLogin.text());
}
public function toString():String{
return (((((("id: " + id) + ", user: ") + user) + ", lastLogin: ") + lastLogin));
}
}
}//package com.kerb.modnation.domain
Section 298
//ChallengeIcon (com.kerb.modnation.profile.ChallengeIcon)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
public class ChallengeIcon extends EventDispatcher implements IDisposable {
private var iconName:String;
private var meIcon:Sprite;
private var themIcon:Sprite;
private var mc:MovieClip;
private static const NAMESPACE:String = "ChallengeIcon_";
public static const THEM:String = (NAMESPACE + "Them");
public static const ME:String = (NAMESPACE + "Me");
public function ChallengeIcon(_arg1:MovieClip){
mc = _arg1;
themIcon = Sprite(_arg1.challenge_them_mc);
meIcon = Sprite(_arg1.challenge_me_mc);
removeIcons();
}
private function removeIcons():void{
removeIcon(themIcon);
removeIcon(meIcon);
}
public function dispose():void{
removeIcons();
themIcon = null;
meIcon = null;
}
public function set icon(_arg1:String):void{
if (_arg1 == iconName){
return;
};
iconName = _arg1;
removeIcons();
switch (iconName){
case THEM:
mc.addChild(themIcon);
break;
case ME:
mc.addChild(meIcon);
break;
};
}
private function removeIcon(_arg1:Sprite):void{
if ((_arg1.parent is DisplayObject)){
_arg1.parent.removeChild(_arg1);
};
}
}
}//package com.kerb.modnation.profile
Section 299
//ChallengeTimer (com.kerb.modnation.profile.ChallengeTimer)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
public class ChallengeTimer extends EventDispatcher implements IDisposable {
private var mc:MovieClip;
public function ChallengeTimer(_arg1:MovieClip){
mc = _arg1;
percentage = 100;
}
public function set percentage(_arg1:int):void{
mc.gotoAndStop(_arg1);
}
public function dispose():void{
}
}
}//package com.kerb.modnation.profile
Section 300
//EnvironmentIcon (com.kerb.modnation.profile.EnvironmentIcon)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
public class EnvironmentIcon extends EventDispatcher implements IDisposable {
private var iconID_p:int;
private var desertIcon:Sprite;
private var alpineIcon:Sprite;
private var mc:MovieClip;
private var beachIcon:Sprite;
private var jungleIcon:Sprite;
public function EnvironmentIcon(_arg1:MovieClip){
mc = _arg1;
alpineIcon = Sprite(_arg1.alpine_mc);
desertIcon = Sprite(_arg1.desert_mc);
jungleIcon = Sprite(_arg1.jungle_mc);
beachIcon = Sprite(_arg1.beach_mc);
removeIcons();
}
private function removeIcon(_arg1:Sprite):void{
if ((_arg1.parent is DisplayObject)){
_arg1.parent.removeChild(_arg1);
};
}
public function set iconID(_arg1:int):void{
if (_arg1 == iconID_p){
return;
};
iconID_p = _arg1;
removeIcons();
switch (iconID_p){
case Constants.ENVIRO_ALPINE:
mc.addChild(alpineIcon);
break;
case Constants.ENVIRO_DESERT:
mc.addChild(desertIcon);
break;
case Constants.ENVIRO_JUNGLE:
mc.addChild(jungleIcon);
break;
case Constants.ENVIRO_SEASIDE:
mc.addChild(beachIcon);
break;
};
}
private function removeIcons():void{
removeIcon(alpineIcon);
removeIcon(desertIcon);
removeIcon(jungleIcon);
removeIcon(beachIcon);
}
public function dispose():void{
}
}
}//package com.kerb.modnation.profile
Section 301
//ExternalURLsBox (com.kerb.modnation.profile.ExternalURLsBox)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.system.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ExternalURLsBox extends EventDispatcher implements IDisposable {
private var URLLabel:TextField;
private var facebookLabel:TextField;
private var sharedURLLabel:TextField;
private var mc:MovieClip;
private var facebookBtn:DynamicButton;
public static var shareURL:String;
public static var imgURL:String;
public static var trackName:String;
public static var by:String;
public function ExternalURLsBox(_arg1:MovieClip){
mc = _arg1;
sharedURLLabel = mc.share_url_txt;
facebookLabel = mc.facebook_txt;
URLLabel = mc.share_mc.label_txt;
URLLabel.addEventListener(FocusEvent.FOCUS_IN, onFocus);
var _local2:TextManager = TextManager.getInstance();
facebookBtn = new DynamicButton(mc.facebook_btn, "facebook.btn");
mc.hyves_btn.visible = false;
mc.netlog_btn.visible = false;
mc.studyvz_btn.visible = false;
ButtonSupport.setupButton(facebookBtn, onFBClick);
facebookLabel.text = _local2.getTextById("post.competition");
sharedURLLabel.text = _local2.getTextById("track.details.share");
challengeURL = "";
}
public function set shareLabel(_arg1:String):void{
sharedURLLabel.text = _arg1;
}
private function onFBClick(_arg1:MouseEvent):void{
if (Main.um.isLogged){
doWallPost();
} else {
Main.um.login(doWallPost);
};
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
}
private function doWallPost():void{
Tracking.track(Tracking.POST_TO_FACEBOOK_BTN);
Main.fbm.sendMessage({route:"WALL", url:(Constants.FACEBOOK_APP_URL + shareURL), imgURL:imgURL, trackName:trackName, by:by});
}
public function set challengeURL(_arg1:String):void{
shareURL = _arg1;
URLLabel.text = (Constants.FACEBOOK_APP_URL + _arg1);
}
private function onFocus(_arg1:FocusEvent):void{
System.setClipboard(URLLabel.text.toString());
}
public function dispose():void{
URLLabel.removeEventListener(FocusEvent.FOCUS_IN, onFocus);
ButtonSupport.unsetupButton(facebookBtn, onFBClick);
facebookBtn.dispose();
}
}
}//package com.kerb.modnation.profile
Section 302
//IProfileRow (com.kerb.modnation.profile.IProfileRow)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.utils.*;
public interface IProfileRow extends IEventDispatcher, IDisposable {
function populate(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
}
}//package com.kerb.modnation.profile
Section 303
//IScreenProfileDetails (com.kerb.modnation.profile.IScreenProfileDetails)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.utils.*;
public interface IScreenProfileDetails extends IEventDispatcher, IDisposable {
function get detailsIndex():int;
function slide(_arg1:Boolean):void;
function populate(_arg1:Object, _arg2:int, _arg3:int):void;
}
}//package com.kerb.modnation.profile
Section 304
//PrintTrack (com.kerb.modnation.profile.PrintTrack)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.utils.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.*;
import flash.printing.*;
public class PrintTrack extends EventDispatcher implements IDisposable {
private var rr:RacerRenderer;
private var tl:TrackLoader;
public function PrintTrack(_arg1:Number){
Tracking.track(Tracking.PRINT_TRACK_BTN);
tl = new TrackLoader();
tl.addEventListener(Event.COMPLETE, onTrackComplete);
tl.loadTrack(_arg1);
}
private function onTrackComplete(_arg1:Event):void{
rr = new RacerRenderer();
rr.addEventListener(Event.COMPLETE, onRenderComplete);
rr.render(Main.um.currentTrack);
}
public function dispose():void{
rr.removeEventListener(Event.COMPLETE, onRenderComplete);
rr = null;
tl.removeEventListener(Event.COMPLETE, onTrackComplete);
tl = null;
}
private function onRenderComplete(_arg1:Event):void{
var sp:Sprite;
var scale:Number;
var matrix:Matrix;
var bm:Bitmap;
var e = _arg1;
var p:PrintJob = new PrintJob();
var pagesToPrint:uint;
if (p.start()){
sp = new Sprite();
scale = 0.32;
matrix = new Matrix();
matrix.scale(scale, scale);
bm = new Bitmap(rr.bitmapData);
sp.addChild(bm);
bm.width = p.pageWidth;
bm.height = p.pageWidth;
try {
p.addPage(sp);
pagesToPrint = (pagesToPrint + 1);
} catch(e:Error) {
};
if (pagesToPrint > 0){
p.send();
};
dispatchEvent(new Event(Event.COMPLETE));
} else {
dispatchEvent(new Event(Event.COMPLETE));
};
}
}
}//package com.kerb.modnation.profile
Section 305
//ProfilePagination (com.kerb.modnation.profile.ProfilePagination)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ProfilePagination extends EventDispatcher implements IDisposable {
private var nextButton:DynamicButton;
private var previousButton:DynamicButton;
private var currentIndex_p:int;
private var mc:MovieClip;
private var currentIndexLabel:TextField;
private static const NAMESPACE:String = "ProfilePagination_";
public static const PAGE_NUMBER_CHANGED:String = "PageNumberChanged";
private static var totalItems_p:int;
public function ProfilePagination(_arg1:MovieClip){
currentIndex_p = 1;
totalItems_p = 1;
mc = _arg1;
previousButton = new DynamicButton(mc.left_btn);
nextButton = new DynamicButton(mc.right_btn);
currentIndexLabel = mc.pages_name_txt;
previousButton.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
nextButton.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
displayPageNumber();
toggleButtons();
}
public function set currentIndex(_arg1:int):void{
if (_arg1 == currentIndex_p){
return;
};
currentIndex_p = _arg1;
displayPageNumber();
toggleButtons();
}
private function toggleButtons():void{
if ((((currentIndex_p < 2)) || ((totalItems_p < 2)))){
previousButton.disable();
} else {
previousButton.enable();
};
if ((((currentIndex_p == totalItems_p)) || ((totalItems_p < 2)))){
nextButton.disable();
} else {
nextButton.enable();
};
}
private function onClick(_arg1:MouseEvent):void{
switch (true){
case (_arg1.target == previousButton):
currentIndex = (currentIndex_p - 1);
dispatchEvent(new Event(PAGE_NUMBER_CHANGED));
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
break;
case (_arg1.target == nextButton):
currentIndex = (currentIndex_p + 1);
dispatchEvent(new Event(PAGE_NUMBER_CHANGED));
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
break;
};
}
public function set totalItems(_arg1:int):void{
if (_arg1 == totalItems_p){
return;
};
totalItems_p = _arg1;
toggleButtons();
}
public function get currentIndex():int{
return (currentIndex_p);
}
public function displayPageNumber():void{
var _local1:TextManager = TextManager.getInstance();
currentIndexLabel.text = ((((((_local1.getTextById("pagination.page") + " ") + currentIndex_p) + " ") + _local1.getTextById("pagination.of")) + " ") + Math.max(1, totalItems_p).toString());
}
public function get totalItems():int{
return (totalItems_p);
}
public function dispose():void{
previousButton.removeEventListener(MouseEvent.CLICK, onClick);
nextButton.removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package com.kerb.modnation.profile
Section 306
//ProfileTabs (com.kerb.modnation.profile.ProfileTabs)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import flash.utils.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ProfileTabs extends EventDispatcher implements IDisposable {
protected var tab5:DynamicButton;
protected var tab6:DynamicButton;
protected var tab1:DynamicButton;
private var d:Number;
protected var deleteBtn:DynamicButton;
protected var _mc:MovieClip;
protected var tab2:DynamicButton;
protected var tab3:DynamicButton;
protected var tab4:DynamicButton;
private static const NAMESPACE:String = "ProfileTabs_";
public static const TAB_CLICK:String = (NAMESPACE + "_TabClick");
public function ProfileTabs(_arg1:MovieClip, _arg2:int){
d = getTimer();
this._mc = _arg1;
_defineButtons();
if (tab1 != null){
tab1.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
};
if (tab2 != null){
tab2.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
};
if (tab3 != null){
tab3.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
};
if (tab4 != null){
tab4.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
};
if (tab5 != null){
tab5.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
};
if (tab6 != null){
tab6.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
};
ButtonSupport.setupButton(deleteBtn, onDelete);
switch (_arg2){
case 1:
tab1.selected = true;
break;
case 2:
tab2.selected = true;
break;
case 3:
tab3.selected = true;
break;
case 4:
tab4.selected = true;
break;
case 5:
tab5.selected = true;
break;
case 6:
tab6.selected = true;
break;
};
}
protected function _defineButtons():void{
tab1 = new DynamicCenteredLabelButton(_mc.nav_1_btn, "tabs.all.tracks");
tab2 = new DynamicCenteredLabelButton(_mc.nav_2_btn, "tabs.friends.tracks");
tab3 = new DynamicCenteredLabelButton(_mc.nav_3_btn, "tabs.my.tracks");
tab4 = new DynamicCenteredLabelButton(_mc.nav_4_btn, "tabs.challenges");
tab5 = new DynamicCenteredLabelButton(_mc.nav_5_btn, "tabs.results");
tab6 = new DynamicCenteredLabelButton(_mc.nav_6_btn, "tabs.trophies");
var _local1:TextManager = TextManager.getInstance();
deleteBtn = new DynamicButton(_mc.delete_btn);
if (!Main.um.isLogged){
deleteBtn.visible = false;
};
}
public function refresh():void{
deleteBtn.visible = Main.um.isLogged;
}
private function traceme(_arg1:Event):void{
}
public function dispose():void{
if (tab1 != null){
tab1.removeEventListener(MouseEvent.CLICK, onClick);
tab1.dispose();
};
if (tab2 != null){
tab2.removeEventListener(MouseEvent.CLICK, onClick);
tab2.dispose();
};
if (tab3 != null){
tab3.removeEventListener(MouseEvent.CLICK, onClick);
tab3.dispose();
};
if (tab4 != null){
tab4.removeEventListener(MouseEvent.CLICK, onClick);
tab4.dispose();
};
if (tab5 != null){
tab5.removeEventListener(MouseEvent.CLICK, onClick);
tab5.dispose();
};
if (tab6 != null){
tab6.removeEventListener(MouseEvent.CLICK, onClick);
tab6.dispose();
};
ButtonSupport.unsetupButton(deleteBtn, onDelete);
tab1 = null;
tab2 = null;
tab3 = null;
tab4 = null;
tab5 = null;
tab6 = null;
}
protected function onClick(_arg1:MouseEvent):void{
var _local2:AbstractScreen;
switch (_arg1.target){
case tab1:
_local2 = new ScreenSelectTrack();
break;
case tab2:
_local2 = new ScreenSelectTrackFriends();
break;
case tab3:
_local2 = new ScreenSelectTrackMy();
break;
case tab4:
_local2 = new ScreenProfileChallenges();
break;
case tab5:
_local2 = new ScreenProfileResults();
break;
case tab6:
_local2 = new ScreenProfileTrophies();
break;
};
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
Main.sm.showScreen(_local2);
}
private function onDeleteClose(_arg1:DynamicParamsEvent):void{
Main.STAGE.removeEventListener(UI.EVENT_HIDE_OVERLAY, onDeleteClose);
if (_arg1.flag){
Main.rdm.deleteUserDetails(Main.um.currentUserId);
};
}
protected function onDelete(_arg1:MouseEvent):void{
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local2.overlay = new PopupOverlay("delete_profile");
Main.STAGE.dispatchEvent(_local2);
Main.STAGE.addEventListener(UI.EVENT_HIDE_OVERLAY, onDeleteClose);
}
}
}//package com.kerb.modnation.profile
Section 307
//ScreenProfileAbstract (com.kerb.modnation.profile.ScreenProfileAbstract)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import com.gskinner.motion.*;
import com.kerb.game.screencontrol.*;
import com.kerb.modnation.*;
public class ScreenProfileAbstract extends AbstractScreen {
protected var items:Array;
protected var searchTab:SearchTab;
protected var populateDetails:Boolean;
protected var TOTAL_ROWS:int;// = 4
protected var row1:IProfileRow;
protected var row2:IProfileRow;
protected var row3:IProfileRow;
protected var row5:IProfileRow;
protected var row6:IProfileRow;
protected var totalPages:int;
protected var row4:IProfileRow;
protected var pagination:ProfilePagination;
protected var totalCount:int;
protected var detailsOverlay:IScreenProfileDetails;
protected var tabs:ProfileTabs;
protected var itemIndex:int;
protected function saveItems(_arg1:Array):void{
if (!(items is Array)){
items = new Array(totalCount);
};
var _local2:int = (pagination.currentIndex - 1);
var _local3:int = (_local2 * TOTAL_ROWS);
var _local4:int = (_local3 + _arg1.length);
var _local5:int;
var _local6:int = _local3;
while (_local6 < _local4) {
if (!items[_local6]){
items[_local6] = _arg1[_local5];
};
_local5++;
_local6++;
};
}
protected function onPageNumberChanged(_arg1:Event=null):Boolean{
if (((!((items is Array))) || (!((items[((pagination.currentIndex - 1) * TOTAL_ROWS)] is Object))))){
getRemoteData();
return (true);
};
populateItems();
return (false);
}
protected function getRemoteData():void{
}
protected function onDetailsIndexChanged(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
itemIndex = detailsOverlay.detailsIndex;
var _local2:int = Math.ceil((itemIndex / TOTAL_ROWS));
if (_local2 != pagination.currentIndex){
pagination.currentIndex = _local2;
getRemoteData();
populateDetails = true;
} else {
populateItemDetails();
};
}
protected function onOverlayClose(_arg1:Event):void{
var _local2:int = Math.ceil((itemIndex / TOTAL_ROWS));
pagination.totalItems = totalPages;
pagination.currentIndex = _local2;
if (onPageNumberChanged()){
populateDetails = true;
};
}
protected function onInit(_arg1:Event):void{
populateDetails = false;
if (pagination != null){
pagination.addEventListener(ProfilePagination.PAGE_NUMBER_CHANGED, onPageNumberChanged, false, 0, true);
};
if (detailsOverlay != null){
detailsOverlay.addEventListener(ProfilePagination.PAGE_NUMBER_CHANGED, onDetailsIndexChanged, false, 0, true);
detailsOverlay.addEventListener(Event.CLOSE, onOverlayClose, false, 0, true);
};
if (searchTab != null){
searchTab.addEventListener(Event.CHANGE, onSearchChange, false, 0, true);
};
onPageNumberChanged();
}
override protected function init():void{
mc.addEventListener(Event.INIT, onInit);
addChild(mc);
mc.alpha = 0;
}
override public function refresh():void{
if (tabs != null){
tabs.refresh();
};
}
protected function onSearchChange(_arg1:Event):void{
items = null;
pagination.currentIndex = 1;
pagination.totalItems = 1;
getRemoteData();
}
protected function populateItemDetails():void{
var _local1:Object = items[(itemIndex - 1)];
detailsOverlay.populate(_local1, itemIndex, totalCount);
detailsOverlay.slide(true);
}
override public function dispose():void{
if ((pagination is ProfilePagination)){
pagination.removeEventListener(ProfilePagination.PAGE_NUMBER_CHANGED, onPageNumberChanged);
pagination.dispose();
};
if ((detailsOverlay is IScreenProfileDetails)){
detailsOverlay.removeEventListener(ProfilePagination.PAGE_NUMBER_CHANGED, onDetailsIndexChanged);
detailsOverlay.dispose();
};
if ((searchTab is SearchTab)){
searchTab.removeEventListener(Event.CHANGE, onSearchChange);
searchTab.dispose();
};
if (tabs != null){
tabs.dispose();
};
if (row1 != null){
row1.dispose();
};
if (row2 != null){
row2.dispose();
};
if (row3 != null){
row3.dispose();
};
if (row4 != null){
row4.dispose();
};
if (row5 != null){
row4.dispose();
};
if (row6 != null){
row4.dispose();
};
row1 = null;
row2 = null;
row3 = null;
row4 = null;
row5 = null;
row6 = null;
searchTab = null;
detailsOverlay = null;
pagination = null;
tabs = null;
items = null;
}
protected function onItemsReceived(_arg1:RemoteDataManagerEvent):void{
populateItems();
pagination.totalItems = totalPages;
if (populateDetails){
populateDetails = false;
populateItemDetails();
};
}
protected function saveCounts(_arg1:RemoteDataManagerEvent):void{
totalPages = _arg1.pages;
totalCount = _arg1.totalCount;
pagination.totalItems = totalPages;
pagination.displayPageNumber();
}
protected function populateItems():void{
var _local4:IProfileRow;
var _local1:int = (pagination.currentIndex - 1);
var _local2:int = (_local1 * TOTAL_ROWS);
var _local3:int = (_local2 + TOTAL_ROWS);
var _local5 = 1;
var _local6:int = _local2;
while (_local6 < _local3) {
var _temp1 = _local5;
_local5 = (_local5 + 1);
_local4 = IProfileRow(this[("row" + _temp1)]);
if (((!((items[_local6] == null))) && ((_local6 < items.length)))){
trace("populateItems ", _local6, items.length, items[_local6]);
_local4.visible = true;
_local4.populate(items[_local6]);
} else {
_local4.visible = false;
};
_local6++;
};
new GTween(mc, 0.3, {alpha:1});
}
}
}//package com.kerb.modnation.profile
Section 308
//ScreenProfileChallenges (com.kerb.modnation.profile.ScreenProfileChallenges)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class ScreenProfileChallenges extends ScreenProfileAbstract {
public function ScreenProfileChallenges(){
if (!Main.um.isLogged){
Main.um.login(init);
};
}
override protected function init():void{
if (Main.um.isLogged){
mc = Main.afm.createMovieClip("profile", "screen_profile_challenges");
super.init();
};
}
override protected function onItemsReceived(_arg1:RemoteDataManagerEvent):void{
trace("onItemsReceived ", _arg1.challenges.length, _arg1.pages, _arg1.totalCount);
saveCounts(_arg1);
saveItems(_arg1.challenges);
super.onItemsReceived(_arg1);
}
override protected function getRemoteData():void{
Main.rdm.searchChallenges(UserManager.instance().currentUserId, searchTab.sortByFilter, pagination.currentIndex, TOTAL_ROWS, searchTab.forFilter, searchTab.sortByName, searchTab.enviromentFilter, Constants.LOCALE, Main.fbm.filterStringIDsbyAppUsers(Main.fbm.friendsIDsAsString(), true, true));
}
private function onGetItemDetails(_arg1:DynamicEvent):void{
var _local2:ChallengeDetails = _arg1.challengeDetails;
itemIndex = (items.indexOf(_local2) + 1);
populateItemDetails();
}
override protected function onInit(_arg1:Event):void{
TextManager.getInstance().setTextField(mc.challenge_1_mc.challenge_txt, "profile.headers.challenge");
TextManager.getInstance().setTextField(mc.challenge_1_mc.created_txt, "profile.headers.created.by");
TextManager.getInstance().setTextField(mc.challenge_1_mc.rank_txt, "profile.headers.challenge.info");
tabs = new ProfileTabs(mc.tab_nav_mc, 4);
row1 = new ScreenProfileChallengesRow(mc.challenge_1_mc.challenge_row_1_mc);
row2 = new ScreenProfileChallengesRow(mc.challenge_1_mc.challenge_row_2_mc);
row3 = new ScreenProfileChallengesRow(mc.challenge_1_mc.challenge_row_3_mc);
row4 = new ScreenProfileChallengesRow(mc.challenge_1_mc.challenge_row_4_mc);
row1.addEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails, false, 0, true);
row2.addEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails, false, 0, true);
row3.addEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails, false, 0, true);
row4.addEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails, false, 0, true);
pagination = new ProfilePagination(mc.challenge_1_mc.pages_mc);
detailsOverlay = new ScreenProfileChallengesDetails(mc.challenges_overlay_mc);
searchTab = new SearchTab(mc.challenge_1_mc.search_mc);
Main.rdm.addEventListener(RemoteDataManager.SEARCH_CHALLENGES, onItemsReceived);
Main.ui.challengeBtnSelected = true;
super.onInit(_arg1);
}
override public function dispose():void{
if (row1 != null){
row1.removeEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails);
};
if (row2 != null){
row2.removeEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails);
};
if (row3 != null){
row3.removeEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails);
};
if (row4 != null){
row4.removeEventListener(ScreenProfileChallengesRow.GET_CHALLENGE_DETAILS, onGetItemDetails);
};
Main.rdm.removeEventListener(RemoteDataManager.SEARCH_CHALLENGES, onItemsReceived);
super.dispose();
}
}
}//package com.kerb.modnation.profile
Section 309
//ScreenProfileChallengesDetails (com.kerb.modnation.profile.ScreenProfileChallengesDetails)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.modnation.UI.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ScreenProfileChallengesDetails extends ScreenProfileDetailsAbstract implements IScreenProfileDetails {
private var challengeNameLabel:TextField;
private var challengeCreatorLabel:TextField;
private var challengeData:ChallengeDetails;
private var challengeRatingLabel:TextField;
private var challengeTypeLabel:TextField;
private var challengeCreatedByLabel:TextField;
private var challengeTimeLeftLabel:TextField;
public function ScreenProfileChallengesDetails(_arg1:MovieClip){
container = _arg1;
mc = container.challenges_1_mc;
environmentIcon = new EnvironmentIcon(mc.challenges_detail_mc.thumbnail_mc.enviro_type_mc);
challengeIcon = new ChallengeIcon(mc.challenges_detail_mc.challenge_icon_mc);
challengeTimer = new ChallengeTimer(mc.challenges_detail_mc.timer_mc);
starRatings = new StarRatings(mc.challenges_detail_mc.stars_mc);
externalURLsBox = new ExternalURLsBox(mc.challenges_detail_mc.share_chalenge_mc);
pagination = new ProfilePagination(mc.pages_mc);
trackNameLabel = mc.challenges_detail_mc.track_name_txt;
environmentTypeLabel = mc.challenges_detail_mc.enviro_txt;
trackRatingLabel = mc.challenges_detail_mc.rating_txt;
trackCreatedByLabel = mc.challenges_detail_mc.createdBy_txt;
trackCreatorLabel = mc.challenges_detail_mc.creator_txt;
trackPrintLabel = mc.challenges_detail_mc.print_txt;
trackReportLabel = mc.challenges_detail_mc.report_txt;
challengeNameLabel = mc.challenges_detail_mc.challenge_name_txt;
challengeCreatedByLabel = mc.challenges_detail_mc.challenge_createdBy_txt;
challengeCreatorLabel = mc.challenges_detail_mc.challenge_creator_txt;
challengeTypeLabel = mc.challenges_detail_mc.challenge_type_txt;
challengeTimeLeftLabel = mc.challenges_detail_mc.time_left_txt;
challengeRankLabel = mc.challenges_detail_mc.challenge_rank_txt;
myRankLabel = mc.challenges_detail_mc.challenge_pos_1_txt;
totalEntriesLabel = mc.challenges_detail_mc.challenge_pos_2_txt;
thumbHolder = Sprite(mc.challenges_detail_mc.thumbnail_mc.trackPic_mc);
raceTrackBtn = new DynamicButton(mc.challenges_detail_mc.race_track_btn, "race.track.btn");
backBtn = new DynamicButton(mc.challenges_detail_mc.back_btn, "back.btn");
printBtn = new DynamicButton(mc.challenges_detail_mc.print_btn);
reportBtn = new ReportButton(mc.challenges_detail_mc.report_btn);
ButtonSupport.setupButton(printBtn, onPrint);
super();
}
override public function dispose():void{
super.dispose();
}
override public function populate(_arg1:Object, _arg2:int, _arg3:int):void{
challengeData = ChallengeDetails(_arg1);
Constants.trackId = 0;
if (((!(Main.um.isLogged)) || (!((Constants.TRACKS_POOL.indexOf(challengeData.track) == -1))))){
reportBtn.visible = false;
trackReportLabel.visible = false;
} else {
reportBtn.visible = true;
trackReportLabel.visible = true;
};
Constants.challengeId = challengeData.id;
Main.rdm.getTrackTimes(challengeData.track, challengeData.id, 1, 20);
var _local4:TextManager = TextManager.getInstance();
var _local5:UserManager = UserManager.instance();
environmentIcon.iconID = challengeData.trackEnvironment;
environmentTypeLabel.text = _local4.getTextById(("environment.title." + challengeData.trackEnvironment));
starRatings.setDetails(challengeData.track, challengeData.isRated, challengeData.user, challengeData.trackRatingTotal, challengeData.trackRatingCount);
starRatings.interactive = false;
externalURLsBox.challengeURL = ("challenge/" + challengeData.id);
ExternalURLsBox.imgURL = challengeData.trackThumbnailUrl;
ExternalURLsBox.trackName = challengeData.trackName;
ExternalURLsBox.by = challengeData.creatorName;
trackNameLabel.text = challengeData.trackName;
trackRatingLabel.text = ((challengeData.trackRatingCount.toString() + " ") + _local4.getTextById("votes"));
trackCreatorLabel.text = ((challengeData.trackCreatorName == " ")) ? TextManager.getInstance().getTextById("noname.player") : challengeData.trackCreatorName;
_local4.setTextField(mc.challenges_detail_mc.top_times_txt, "challenge.results.header");
challengeNameLabel.text = challengeData.name;
challengeCreatedByLabel.text = _local4.getTextById("challenge.created.by");
challengeCreatorLabel.text = ((challengeData.creatorName == " ")) ? TextManager.getInstance().getTextById("noname.player") : challengeData.creatorName;
challengeRankLabel.text = _local4.getTextById("challenge.my.rank");
myRankLabel.text = challengeData.myRank.toString();
totalEntriesLabel.text = challengeData.totalEntries.toString();
if (challengeData.user == _local5.currentUserId){
challengeTypeLabel.text = _local4.getTextById("challenger.me");
challengeIcon.icon = ChallengeIcon.ME;
} else {
challengeTypeLabel.text = _local4.getTextById("challenger.them");
challengeIcon.icon = ChallengeIcon.THEM;
};
var _local6:Date = new Date();
var _local7:Number = (_local6.getTime() - challengeData.timestamp.getTime());
var _local8:Number = (challengeData.expires.getTime() - challengeData.timestamp.getTime());
challengeTimeLeftLabel.text = RaceTimer.formatTime(_local8);
challengeTimer.percentage = Math.round(((_local7 / _local8) * 100));
super.populate(_arg1, _arg2, _arg3);
}
override protected function onRaceTrackButtonClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
if (challengeData.isCompetition){
Main.sm.showScreen(new ScreenTitleCompetitionRoute());
} else {
Main.sm.showScreen(new ScreenTitleChallengeRoute());
};
trace("onRaceTrackButtonClick");
}
override protected function onTrackTimesReceived(_arg1:RemoteDataManagerEvent):void{
if (scrollingResults != null){
scrollingResults.dispose();
};
scrollingResults = new ScrollingResultsArea(mc.challenges_detail_mc.scroll_area_mc, _arg1.times, challengeData.topTime, challengeData.creatorName, Constants.LOCALE);
}
override public function get detailsIndex():int{
return (pagination.currentIndex);
}
}
}//package com.kerb.modnation.profile
Section 310
//ScreenProfileChallengesRow (com.kerb.modnation.profile.ScreenProfileChallengesRow)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.modnation.*;
import mx.formatters.*;
public class ScreenProfileChallengesRow extends ScreenProfileRowAbstract implements IProfileRow {
private var creatorsLabel:TextField;
private var totalParticipantsLabel:TextField;
private var challengeLabel:TextField;
private var yourRankLabel:TextField;
private var challengeTypeLabel:TextField;
private var challengeEndsLabel:TextField;
private var trackNameLabel:TextField;
static const GET_CHALLENGE_DETAILS:String = "getChallengeDetails";
public function ScreenProfileChallengesRow(_arg1:MovieClip){
super(_arg1);
environmentIcon = new EnvironmentIcon(mc.enviro_type_mc);
starRatings = new StarRatings(mc.stars_mc);
challengeIcon = new ChallengeIcon(mc.challenge_icon_mc);
challengeTimer = new ChallengeTimer(mc.timer_mc);
challengeLabel = mc.challenge_name_txt;
trackNameLabel = mc.track_name_txt;
creatorsLabel = mc.creator_name_txt;
challengeTypeLabel = mc.challenge_type_txt;
yourRankLabel = mc.challenge_pos_1_txt;
totalParticipantsLabel = mc.challenge_pos_2_txt;
challengeEndsLabel = mc.timer_txt;
}
override protected function onDetailsButtonClick(_arg1:MouseEvent):void{
var _local2:DynamicEvent = new DynamicEvent(GET_CHALLENGE_DETAILS);
_local2.challengeDetails = rowData;
dispatchEvent(_local2);
}
override public function populate(_arg1:Object):void{
var _local2:TextManager = TextManager.getInstance();
var _local3:UserManager = UserManager.instance();
rowData = ChallengeDetails(_arg1);
if (ChallengeDetails(_arg1).isCompetition){
mc.gotoAndStop("compON");
ChallengeDetails(_arg1).trackThumbnailUrl = ChallengeDetails(_arg1).competitionPreMessageUrl;
clear();
} else {
mc.gotoAndStop("compOFF");
};
challengeLabel.text = rowData.name;
trackNameLabel.text = rowData.trackName;
creatorsLabel.text = ((rowData.creatorName == " ")) ? TextManager.getInstance().getTextById("noname.player") : rowData.creatorName;
var _local4:DateFormatter = new DateFormatter();
_local4.formatString = "MM/DD/YYYY J:NN";
challengeEndsLabel.text = _local4.format(ChallengeDetails(_arg1).expires.toString());
yourRankLabel.text = rowData.myRank.toString();
totalParticipantsLabel.text = rowData.totalEntries.toString();
environmentIcon.iconID = rowData.trackEnvironment;
starRatings.setDetails(rowData.track, rowData.isRated, rowData.user, rowData.trackRatingTotal, rowData.trackRatingCount);
starRatings.interactive = false;
var _local5:Date = new Date();
var _local6:Number = (_local5.getTime() - rowData.timestamp.getTime());
var _local7:Number = (rowData.expires.getTime() - rowData.timestamp.getTime());
challengeTimer.percentage = Math.round(((_local6 / _local7) * 100));
if (rowData.user == _local3.currentUserId){
challengeTypeLabel.text = _local2.getTextById("challenger.me");
challengeIcon.icon = ChallengeIcon.ME;
} else {
challengeTypeLabel.text = _local2.getTextById("challenger.them");
challengeIcon.icon = ChallengeIcon.THEM;
};
mc.challenge_icon_mc.visible = false;
challengeTypeLabel.text = "";
super.populate(_arg1);
}
override protected function onThumbClick(_arg1:MouseEvent):void{
Constants.challengeId = ChallengeDetails(rowData).id;
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
if (ChallengeDetails(rowData).isCompetition){
Main.sm.showScreen(new ScreenTitleCompetitionRoute());
} else {
Main.sm.showScreen(new ScreenTitleChallengeRoute());
};
trace("onRaceTrackButtonClick");
}
override public function dispose():void{
challengeIcon.dispose();
challengeTimer.dispose();
super.dispose();
challengeIcon = null;
challengeTimer = null;
rowData = null;
}
}
}//package com.kerb.modnation.profile
Section 311
//ScreenProfileDetailsAbstract (com.kerb.modnation.profile.ScreenProfileDetailsAbstract)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.text.*;
import com.gskinner.motion.*;
import com.kerb.modnation.UI.*;
import flash.net.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
import com.gskinner.motion.easing.*;
public class ScreenProfileDetailsAbstract extends EventDispatcher implements IScreenProfileDetails {
protected var trackCreatedByLabel:TextField;
protected var container:MovieClip;
protected var externalURLsBox:ExternalURLsBox;
protected var challengeRankLabel:TextField;
protected var environmentTypeLabel:TextField;
protected var trackRatingLabel:TextField;
protected var raceTrackBtn:DynamicButton;
protected var trackCreatorLabel:TextField;
protected var mc:MovieClip;
protected var reportBtn:ReportButton;
protected var pagination:ProfilePagination;
protected var trackNameLabel:TextField;
protected var challengeTimer:ChallengeTimer;
protected var printTrack:PrintTrack;
protected var totalEntriesLabel:TextField;
protected var thumbHolder:Sprite;
protected var trackID:Number;
protected var environmentIcon:EnvironmentIcon;
protected var scrollingResultsLabel:TextField;
protected var scrollingResults:ScrollingResultsArea;
protected var starRatings:StarRatings;
protected var trackReportLabel:TextField;
protected var myRankLabel:TextField;
protected var thumbnail:Loader;
protected var printBtn:DynamicButton;
protected var trackPrintLabel:TextField;
protected var backBtn:DynamicButton;
protected var challengeIcon:ChallengeIcon;
protected static const THUMBNAIL_SIZE:int = 116;
public function ScreenProfileDetailsAbstract(){
Main.rdm.addEventListener(RemoteDataManager.GET_TRACK_TIMES, onTrackTimesReceived);
pagination.addEventListener(ProfilePagination.PAGE_NUMBER_CHANGED, onPageNumberChanged, false, 0, true);
raceTrackBtn.addEventListener(MouseEvent.CLICK, onRaceTrackButtonClick, false, 0, true);
backBtn.addEventListener(MouseEvent.CLICK, onBackButtonClick, false, 0, true);
}
protected function onPrint(_arg1:MouseEvent):void{
mc.stage.dispatchEvent(new Event(UI.EVENT_SHOW_LOADING));
printTrack = new PrintTrack(trackID);
printTrack.addEventListener(Event.COMPLETE, onPrintComplete);
}
protected function onRaceTrackButtonClick(_arg1:MouseEvent):void{
trace("onRaceTrackButtonClick");
}
public function dispose():void{
Main.rdm.removeEventListener(RemoteDataManager.GET_TRACK_TIMES, onTrackTimesReceived);
removeThumbnailListeners();
pagination.removeEventListener(ProfilePagination.PAGE_NUMBER_CHANGED, onPageNumberChanged);
raceTrackBtn.removeEventListener(MouseEvent.CLICK, onRaceTrackButtonClick);
backBtn.removeEventListener(MouseEvent.CLICK, onBackButtonClick);
ButtonSupport.unsetupButton(printBtn, onPrint);
environmentIcon.dispose();
starRatings.dispose();
externalURLsBox.dispose();
pagination.dispose();
if ((scrollingResults is ScrollingResultsArea)){
scrollingResults.dispose();
};
externalURLsBox.dispose();
starRatings.dispose();
raceTrackBtn.dispose();
backBtn.dispose();
printBtn.dispose();
reportBtn.dispose();
if (printTrack != null){
printTrack.dispose();
};
thumbHolder = null;
environmentIcon = null;
starRatings = null;
externalURLsBox = null;
pagination = null;
scrollingResults = null;
externalURLsBox = null;
starRatings = null;
raceTrackBtn = null;
backBtn = null;
printTrack = null;
}
public function get detailsIndex():int{
return (pagination.currentIndex);
}
public function slide(_arg1:Boolean):void{
Main.playSoundFX(Main.SFX_NAME_GUI_BACK);
var _local2:Number = (_arg1) ? 0 : 590;
if (container.x == _local2){
return;
};
new GTween(container, 0.25, {x:_local2, ease:Quadratic.easeInOut});
}
protected function onThumbnailComplete(_arg1:Event):void{
var _local2:int;
var _local3:Number;
removeThumbnailListeners();
if (thumbnail.content != null){
_local2 = thumbnail.content.width;
_local3 = (THUMBNAIL_SIZE / _local2);
thumbnail.content.scaleX = (thumbnail.content.scaleY = _local3);
thumbHolder.addChild(thumbnail);
};
}
protected function onThumbnailError(_arg1:Event):void{
removeThumbnailListeners();
clear();
}
protected function onPageNumberChanged(_arg1:Event=null):void{
dispatchEvent(_arg1);
}
protected function onBackButtonClick(_arg1:MouseEvent):void{
slide(false);
dispatchEvent(new Event(Event.CLOSE));
}
public function clear():void{
var _local1:int;
var _local2:int;
if (thumbnail != null){
_local1 = thumbHolder.numChildren;
_local2 = (_local1 - 1);
while (_local2 >= 0) {
thumbHolder.removeChildAt(_local2);
_local2--;
};
thumbnail = null;
};
}
protected function removeThumbnailListeners():void{
if (!(thumbnail is Loader)){
return;
};
if (thumbnail.contentLoaderInfo.hasEventListener(Event.COMPLETE)){
thumbnail.contentLoaderInfo.removeEventListener(Event.COMPLETE, onThumbnailComplete);
};
if (thumbnail.contentLoaderInfo.hasEventListener(IOErrorEvent.IO_ERROR)){
thumbnail.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onThumbnailError);
};
}
protected function onPrintComplete(_arg1:Event):void{
printTrack.removeEventListener(Event.COMPLETE, onPrintComplete);
printTrack = null;
mc.stage.dispatchEvent(new Event(UI.EVENT_HIDE_LOADING));
}
public function populate(_arg1:Object, _arg2:int, _arg3:int):void{
var _local6:String;
removeThumbnailListeners();
trackID = (_arg1.hasOwnProperty("track")) ? _arg1.track : _arg1.id;
if (((((_arg1.hasOwnProperty("track")) && (_arg1.hasOwnProperty("id")))) && (!(_arg1.hasOwnProperty("isCompetition"))))){
_arg1.id = _arg1.track;
};
var _local4:TextManager = TextManager.getInstance();
var _local5:UserManager = UserManager.instance();
UserManager.instance().currentTrackDetails = (_arg1 as TrackDetails);
if ((challengeRankLabel is TextField)){
challengeRankLabel.text = _local4.getTextById("challenge.my.rank");
};
externalURLsBox.shareLabel = _local4.getTextById("challenge.share.url");
trackCreatedByLabel.text = _local4.getTextById("track.created.by");
trackPrintLabel.text = _local4.getTextById("track.details.print.btn");
trackReportLabel.text = _local4.getTextById("track.details.report.btn");
pagination.currentIndex = _arg2;
pagination.totalItems = _arg3;
pagination.displayPageNumber();
switch (true){
case (_arg1 is TrackDetails):
_local6 = _arg1.thumbnailUrl;
break;
default:
_local6 = _arg1.trackThumbnailUrl;
break;
};
if (((_local6) && (_local6.length))){
thumbnail = new Loader();
thumbnail.contentLoaderInfo.addEventListener(Event.COMPLETE, onThumbnailComplete);
thumbnail.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onThumbnailError);
thumbnail.load(new URLRequest(_local6));
};
}
protected function onTrackTimesReceived(_arg1:RemoteDataManagerEvent):void{
}
}
}//package com.kerb.modnation.profile
Section 312
//ScreenProfileResults (com.kerb.modnation.profile.ScreenProfileResults)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class ScreenProfileResults extends ScreenProfileAbstract {
public function ScreenProfileResults(){
if (!Main.um.isLogged){
Main.um.login(init);
};
}
override protected function init():void{
if (Main.um.isLogged){
mc = Main.afm.createMovieClip("profile", "screen_profile_results");
super.init();
};
}
override protected function onItemsReceived(_arg1:RemoteDataManagerEvent):void{
saveCounts(_arg1);
saveItems(_arg1.times);
super.onItemsReceived(_arg1);
}
override protected function getRemoteData():void{
Main.rdm.getTimes(UserManager.instance().currentUserId, searchTab.sortByFilter, pagination.currentIndex, TOTAL_ROWS, searchTab.forFilter, searchTab.sortByName, searchTab.enviromentFilter, searchTab.countryFilter, "");
}
private function onGetItemDetails(_arg1:DynamicEvent):void{
var _local2:TimeDetails = _arg1.timeDetails;
itemIndex = (items.indexOf(_local2) + 1);
populateItemDetails();
}
override protected function onInit(_arg1:Event):void{
TextManager.getInstance().setTextField(mc.results_1_mc.track_txt, "profile.headers.track");
TextManager.getInstance().setTextField(mc.results_1_mc.rnk_txt, "profile.headers.my.rank");
tabs = new ProfileTabs(mc.tab_nav_mc, 5);
row1 = new ScreenProfileResultsRow(mc.results_1_mc.results_row_1_mc);
row2 = new ScreenProfileResultsRow(mc.results_1_mc.results_row_2_mc);
row3 = new ScreenProfileResultsRow(mc.results_1_mc.results_row_3_mc);
row4 = new ScreenProfileResultsRow(mc.results_1_mc.results_row_4_mc);
row1.addEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails, false, 0, true);
row2.addEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails, false, 0, true);
row3.addEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails, false, 0, true);
row4.addEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails, false, 0, true);
pagination = new ProfilePagination(mc.results_1_mc.pages_mc);
detailsOverlay = new ScreenProfileResultsDetails(mc.results_overlay_mc);
searchTab = new SearchTab(mc.results_1_mc.search_mc);
Main.rdm.addEventListener(RemoteDataManager.GET_TIMES, onItemsReceived);
super.onInit(_arg1);
}
override public function dispose():void{
if (row1 != null){
row1.removeEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails);
};
if (row2 != null){
row2.removeEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails);
};
if (row3 != null){
row3.removeEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails);
};
if (row4 != null){
row4.removeEventListener(ScreenProfileResultsRow.GET_TIME_DETAILS, onGetItemDetails);
};
Main.rdm.removeEventListener(RemoteDataManager.GET_TIMES, onItemsReceived);
super.dispose();
}
}
}//package com.kerb.modnation.profile
Section 313
//ScreenProfileResultsDetails (com.kerb.modnation.profile.ScreenProfileResultsDetails)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.modnation.UI.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ScreenProfileResultsDetails extends ScreenProfileDetailsAbstract implements IScreenProfileDetails {
private var timeLabel:TextField;
private var challengeCreatorLabel:TextField;
private var timeLeftLabel:TextField;
private var timeData:TimeDetails;
private var challengeCreatedByLabel:TextField;
public function ScreenProfileResultsDetails(_arg1:MovieClip){
container = _arg1;
mc = container.results_1_mc;
environmentIcon = new EnvironmentIcon(mc.results_detail_mc.thumbnail_mc.enviro_type_mc);
starRatings = new StarRatings(mc.results_detail_mc.stars_mc);
externalURLsBox = new ExternalURLsBox(mc.results_detail_mc.share_chalenge_mc);
trackNameLabel = mc.results_detail_mc.track_name_txt;
trackRatingLabel = mc.results_detail_mc.rating_txt;
challengeCreatedByLabel = mc.results_detail_mc.createdBy_txt;
challengeCreatorLabel = mc.results_detail_mc.creator_txt;
trackPrintLabel = mc.results_detail_mc.print_txt;
trackReportLabel = mc.results_detail_mc.report_txt;
timeLabel = mc.results_detail_mc.time_txt;
timeLeftLabel = mc.results_detail_mc.time_num_txt;
challengeRankLabel = mc.results_detail_mc.challenge_rank_txt;
myRankLabel = mc.results_detail_mc.challenge_pos_1_txt;
totalEntriesLabel = mc.results_detail_mc.challenge_pos_2_txt;
pagination = new ProfilePagination(mc.pages_mc);
environmentTypeLabel = mc.results_detail_mc.enviro_txt;
trackCreatedByLabel = mc.results_detail_mc.createdBy_txt;
trackCreatorLabel = mc.results_detail_mc.creator_txt;
thumbHolder = Sprite(mc.results_detail_mc.thumbnail_mc.trackPic_mc);
var _local2:TextManager = TextManager.getInstance();
printBtn = new DynamicButton(mc.results_detail_mc.print_btn);
reportBtn = new ReportButton(mc.results_detail_mc.report_btn);
ButtonSupport.setupButton(printBtn, onPrint);
raceTrackBtn = new DynamicButton(mc.results_detail_mc.race_track_btn, "race.track.btn");
backBtn = new DynamicButton(mc.results_detail_mc.back_btn, "back.btn");
super();
}
override protected function onRaceTrackButtonClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
if (timeData.challenge != 0){
Constants.challengeId = timeData.challenge;
if (((!((Main.um.currentCompetitionDetails == null))) && ((timeData.challenge == Main.um.currentCompetitionDetails.id)))){
Main.sm.showScreen(new ScreenTitleCompetitionRoute());
} else {
Main.sm.showScreen(new ScreenTitleChallengeRoute());
};
} else {
Constants.trackId = timeData.track;
Main.sm.showScreen(new ScreenTitleTrackRoute());
};
trace("onRaceTrackButtonClick");
}
override public function dispose():void{
super.dispose();
}
override public function populate(_arg1:Object, _arg2:int, _arg3:int):void{
timeData = TimeDetails(_arg1);
Constants.trackId = timeData.track;
if (((!(Main.um.isLogged)) || (!((Constants.TRACKS_POOL.indexOf(timeData.track) == -1))))){
reportBtn.visible = false;
trackReportLabel.visible = false;
} else {
reportBtn.visible = true;
trackReportLabel.visible = true;
};
Main.rdm.getTrackTimes(timeData.track, timeData.challenge, 1, 20);
var _local4:TextManager = TextManager.getInstance();
var _local5:UserManager = UserManager.instance();
_local4.setTextField(mc.results_detail_mc.top_times_txt, "challenge.results.header");
environmentIcon.iconID = timeData.trackEnvironment;
environmentTypeLabel.text = _local4.getTextById(("environment.title." + timeData.trackEnvironment));
starRatings.setDetails(timeData.track, timeData.isRated, timeData.user, timeData.trackRatingTotal, timeData.trackRatingCount);
starRatings.interactive = false;
externalURLsBox.challengeURL = ((timeData.challenge)!=0) ? ("challenge/" + timeData.challenge) : ("track/" + timeData.track);
ExternalURLsBox.imgURL = timeData.trackThumbnailUrl;
ExternalURLsBox.trackName = timeData.trackName;
ExternalURLsBox.by = timeData.creatorName;
trackNameLabel.text = timeData.trackName;
trackRatingLabel.text = timeData.trackRatingCount.toString();
trackRatingLabel.text = ((timeData.trackRatingCount.toString() + " ") + _local4.getTextById("votes"));
trackCreatorLabel.text = timeData.creatorName;
timeLabel.text = _local4.getTextById("my.time");
timeLeftLabel.text = RaceTimer.formatTime(timeData.time);
challengeCreatedByLabel.text = _local4.getTextById("challenge.created.by");
challengeCreatorLabel.text = ((timeData.creatorName == " ")) ? TextManager.getInstance().getTextById("noname.player") : timeData.creatorName;
challengeRankLabel.text = _local4.getTextById("challenge.my.rank");
myRankLabel.text = timeData.rank.toString();
totalEntriesLabel.text = timeData.totalEntries.toString();
super.populate(_arg1, _arg2, _arg3);
}
override protected function onTrackTimesReceived(_arg1:RemoteDataManagerEvent):void{
if (scrollingResults != null){
scrollingResults.dispose();
};
scrollingResults = new ScrollingResultsArea(mc.results_detail_mc.scroll_area_mc, _arg1.times, timeData.time, timeData.creatorName, Constants.LOCALE);
}
override public function get detailsIndex():int{
return (pagination.currentIndex);
}
}
}//package com.kerb.modnation.profile
Section 314
//ScreenProfileResultsRow (com.kerb.modnation.profile.ScreenProfileResultsRow)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.modnation.*;
public class ScreenProfileResultsRow extends ScreenProfileRowAbstract implements IDisposable {
private var flag:MovieClip;
private var totalParticipantsLabel:TextField;
private var yourRankLabel:TextField;
private var trackNameLabel:TextField;
static const GET_TIME_DETAILS:String = "getTimeDetails";
public function ScreenProfileResultsRow(_arg1:MovieClip){
super(_arg1);
flag = mc.flag_mc;
trackNameLabel = mc.track_name_txt;
yourRankLabel = mc.challenge_pos_1_txt;
totalParticipantsLabel = mc.challenge_pos_2_txt;
}
override public function dispose():void{
super.dispose();
}
override protected function onThumbClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
if (TimeDetails(rowData).challenge != 0){
Constants.challengeId = TimeDetails(rowData).challenge;
if (((!((Main.um.currentCompetitionDetails == null))) && ((TimeDetails(rowData).challenge == Main.um.currentCompetitionDetails.id)))){
Main.sm.showScreen(new ScreenTitleCompetitionRoute());
} else {
Main.sm.showScreen(new ScreenTitleChallengeRoute());
};
} else {
Constants.trackId = rowData.track;
Main.sm.showScreen(new ScreenTitleTrackRoute());
};
trace("onRaceTrackButtonClick");
}
override public function populate(_arg1:Object):void{
rowData = TimeDetails(_arg1);
environmentIcon.iconID = rowData.trackEnvironment;
starRatings.setDetails(rowData.track, rowData.isRated, rowData.user, rowData.trackRatingTotal, rowData.trackRatingCount);
starRatings.interactive = false;
flag.gotoAndStop(rowData.creatorLocale);
trackNameLabel.text = rowData.trackName;
yourRankLabel.text = rowData.rank.toString();
totalParticipantsLabel.text = rowData.totalEntries.toString();
super.populate(_arg1);
}
override protected function onDetailsButtonClick(_arg1:MouseEvent):void{
var _local2:DynamicEvent = new DynamicEvent(GET_TIME_DETAILS);
_local2.timeDetails = rowData;
dispatchEvent(_local2);
}
}
}//package com.kerb.modnation.profile
Section 315
//ScreenProfileRowAbstract (com.kerb.modnation.profile.ScreenProfileRowAbstract)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.net.*;
import com.kerb.ui.*;
public class ScreenProfileRowAbstract extends EventDispatcher implements IProfileRow {
private var _race_btn:DynamicButton;
protected var thumbnail:Loader;
protected var starRatings:StarRatings;
protected var detailsButton:DynamicButton;
protected var defaultThumb:Sprite;
protected var mc:MovieClip;
protected var challengeTimer:ChallengeTimer;
protected var thumbHolder:Sprite;
protected var rowData:Object;
protected var environmentIcon:EnvironmentIcon;
protected var challengeIcon:ChallengeIcon;
protected static const THUMBNAIL_SIZE:int = 44;
public function ScreenProfileRowAbstract(_arg1:MovieClip){
mc = _arg1;
thumbHolder = Sprite(mc.thumb_holder_mc.thumb_mc);
defaultThumb = Sprite(mc.thumb_holder_mc.default_mc);
defaultThumb.visible = false;
var _local2:TextManager = TextManager.getInstance();
environmentIcon = new EnvironmentIcon(mc.enviro_type_mc);
starRatings = new StarRatings(mc.stars_mc);
detailsButton = new DynamicButton(mc.details_btn, "view.details.btn");
detailsButton.addEventListener(MouseEvent.CLICK, onDetailsButtonClick, false, 0, true);
if (mc.hasOwnProperty("race_track_btn")){
_race_btn = new DynamicButton(mc.race_track_btn, "race.btn");
ButtonSupport.setupButton(_race_btn, onThumbClick);
};
}
protected function onThumbnailError(_arg1:Event):void{
removeThumbnailListeners();
defaultThumb.visible = true;
clear();
}
public function set visible(_arg1:Boolean):void{
mc.visible = _arg1;
}
protected function onThumbClick(_arg1:MouseEvent):void{
}
protected function removeThumbnailListeners():void{
if (!(thumbnail is Loader)){
return;
};
if (thumbnail.contentLoaderInfo.hasEventListener(Event.COMPLETE)){
thumbnail.contentLoaderInfo.removeEventListener(Event.COMPLETE, onThumbnailComplete);
};
if (thumbnail.contentLoaderInfo.hasEventListener(IOErrorEvent.IO_ERROR)){
thumbnail.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onThumbnailError);
};
}
public function clear():void{
var _local1:int;
var _local2:int;
if (thumbnail != null){
_local1 = thumbHolder.numChildren;
_local2 = (_local1 - 1);
while (_local2 >= 0) {
thumbHolder.removeChildAt(_local2);
_local2--;
};
thumbnail = null;
};
}
public function dispose():void{
removeThumbnailListeners();
detailsButton.removeEventListener(MouseEvent.CLICK, onDetailsButtonClick);
detailsButton.dispose();
starRatings.dispose();
environmentIcon.dispose();
if (_race_btn != null){
ButtonSupport.unsetupButton(_race_btn, onThumbClick);
_race_btn.dispose();
};
starRatings = null;
environmentIcon = null;
thumbHolder = null;
defaultThumb = null;
}
protected function onThumbnailComplete(_arg1:Event):void{
var _local2:int;
var _local3:Number;
removeThumbnailListeners();
if (thumbnail.content != null){
_local2 = thumbnail.content.width;
_local3 = (THUMBNAIL_SIZE / _local2);
thumbnail.content.scaleX = (thumbnail.content.scaleY = _local3);
thumbHolder.addChild(thumbnail);
};
}
public function populate(_arg1:Object):void{
var _local2:String;
removeThumbnailListeners();
switch (true){
case (_arg1 is TrackDetails):
_local2 = _arg1.thumbnailUrl;
break;
default:
_local2 = _arg1.trackThumbnailUrl;
break;
};
if (((_local2) && (_local2.length))){
thumbnail = new Loader();
thumbnail.contentLoaderInfo.addEventListener(Event.COMPLETE, onThumbnailComplete);
thumbnail.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onThumbnailError);
thumbnail.load(new URLRequest(_local2));
thumbHolder.buttonMode = true;
thumbHolder.addEventListener(MouseEvent.CLICK, onThumbClick, false, 0, true);
};
}
protected function onDetailsButtonClick(_arg1:MouseEvent):void{
}
}
}//package com.kerb.modnation.profile
Section 316
//ScreenProfileTracksDetails (com.kerb.modnation.profile.ScreenProfileTracksDetails)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.modnation.UI.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ScreenProfileTracksDetails extends ScreenProfileDetailsAbstract implements IScreenProfileDetails {
private var timeLabel:TextField;
private var timeAmountLabel:TextField;
private var challengeRatingLabel:TextField;
private var trackData:TrackDetails;
private var totalRacesLabel:TextField;
private var challengeTimeLeftLabel:TextField;
private var totalRacesAmountLabel:TextField;
public function ScreenProfileTracksDetails(_arg1:MovieClip){
container = _arg1;
mc = container.tracks_1_mc;
environmentIcon = new EnvironmentIcon(mc.tracks_detail_mc.thumbnail_mc.enviro_type_mc);
starRatings = new StarRatings(mc.tracks_detail_mc.stars_mc);
externalURLsBox = new ExternalURLsBox(mc.tracks_detail_mc.share_chalenge_mc);
pagination = new ProfilePagination(mc.pages_mc);
trackNameLabel = mc.tracks_detail_mc.track_name_txt;
environmentTypeLabel = mc.tracks_detail_mc.enviro_txt;
trackRatingLabel = mc.tracks_detail_mc.rating_txt;
trackCreatedByLabel = mc.tracks_detail_mc.createdBy_txt;
trackCreatorLabel = mc.tracks_detail_mc.creator_txt;
trackPrintLabel = mc.tracks_detail_mc.print_txt;
trackReportLabel = mc.tracks_detail_mc.report_txt;
totalRacesLabel = mc.tracks_detail_mc.totalRaces_txt;
totalRacesAmountLabel = mc.tracks_detail_mc.totalRaces_num_txt;
timeLabel = mc.tracks_detail_mc.time_txt;
timeAmountLabel = mc.tracks_detail_mc.time_num_txt;
challengeTimeLeftLabel = mc.tracks_detail_mc.time_left_txt;
challengeRankLabel = mc.tracks_detail_mc.challenge_rank_txt;
myRankLabel = mc.tracks_detail_mc.challenge_pos_1_txt;
totalEntriesLabel = mc.tracks_detail_mc.challenge_pos_2_txt;
thumbHolder = Sprite(mc.tracks_detail_mc.thumbnail_mc.trackPic_mc);
scrollingResultsLabel = mc.tracks_detail_mc.top_times_txt;
raceTrackBtn = new DynamicButton(mc.tracks_detail_mc.race_track_btn, "race.track.btn");
backBtn = new DynamicButton(mc.tracks_detail_mc.back_btn, "back.btn");
printBtn = new DynamicButton(mc.tracks_detail_mc.print_btn);
reportBtn = new ReportButton(mc.tracks_detail_mc.report_btn);
ButtonSupport.setupButton(printBtn, onPrint);
super();
}
override protected function onRaceTrackButtonClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Constants.trackId = trackData.id;
Main.sm.showScreen(new ScreenTitleTrackRoute());
trace("onRaceTrackButtonClick");
}
override public function populate(_arg1:Object, _arg2:int, _arg3:int):void{
trackData = TrackDetails(_arg1);
if (((!(Main.um.isLogged)) || (!((Constants.TRACKS_POOL.indexOf(trackData.id) == -1))))){
reportBtn.visible = false;
trackReportLabel.visible = false;
} else {
reportBtn.visible = true;
trackReportLabel.visible = true;
};
trace("ScreenProfileTracksDetails populate **** ", (_arg1 is TrackDetails), trackData);
Main.rdm.getTrackTimes(trackData.id, 0, 1, 20);
var _local4:TextManager = TextManager.getInstance();
var _local5:UserManager = UserManager.instance();
_local4.setTextField(mc.tracks_detail_mc.top_times_txt, "challenge.results.header");
environmentIcon.iconID = trackData.environment;
starRatings.setDetails(trackData.id, trackData.isRated, trackData.user, trackData.ratingTotal, trackData.ratingCount);
starRatings.interactive = false;
externalURLsBox.challengeURL = ("track/" + trackData.id);
ExternalURLsBox.imgURL = trackData.thumbnailUrl;
ExternalURLsBox.trackName = trackData.name;
ExternalURLsBox.by = trackData.creatorName;
trackNameLabel.text = trackData.name;
environmentTypeLabel.text = _local4.getTextById(("environment.title." + trackData.environment));
trackRatingLabel.text = ((trackData.ratingCount.toString() + " ") + _local4.getTextById("votes"));
trackCreatorLabel.text = ((trackData.creatorName == " ")) ? TextManager.getInstance().getTextById("noname.player") : trackData.creatorName;
totalRacesLabel.text = _local4.getTextById("total.races");
totalRacesAmountLabel.text = RaceTimer.formatNumberAsFigure(trackData.timesRaced);
timeLabel.text = _local4.getTextById("my.time");
timeAmountLabel.text = RaceTimer.formatTime(trackData.myTime);
myRankLabel.text = trackData.myRank.toString();
totalEntriesLabel.text = trackData.totalEntries.toString();
scrollingResultsLabel.text = _local4.getTextById("challenge.results.header");
super.populate(_arg1, _arg2, _arg3);
}
override protected function onTrackTimesReceived(_arg1:RemoteDataManagerEvent):void{
if (scrollingResults != null){
scrollingResults.dispose();
};
scrollingResults = new ScrollingResultsArea(mc.tracks_detail_mc.scroll_area_mc, _arg1.times, trackData.topTime, trackData.creatorName, Constants.LOCALE);
}
override public function dispose():void{
super.dispose();
}
}
}//package com.kerb.modnation.profile
Section 317
//ScreenProfileTracksRow (com.kerb.modnation.profile.ScreenProfileTracksRow)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.modnation.*;
public class ScreenProfileTracksRow extends ScreenProfileRowAbstract implements IProfileRow {
private var amountOfRacesLabel:TextField;
private var fastestCompetitorTimeLabel:TextField;
private var fastestCompetitorNameLabel:TextField;
private var trackNameLabel:TextField;
public static const GET_TRACK_DETAILS:String = "getTrackDetails";
public function ScreenProfileTracksRow(_arg1:MovieClip){
super(_arg1);
amountOfRacesLabel = mc.race_num_txt;
trackNameLabel = mc.track_name_txt;
fastestCompetitorNameLabel = mc.racer_name_txt;
fastestCompetitorTimeLabel = mc.time_num_txt;
}
override public function populate(_arg1:Object):void{
rowData = TrackDetails(_arg1);
var _local2:UserManager = UserManager.instance();
environmentIcon.iconID = rowData.environment;
amountOfRacesLabel.text = RaceTimer.formatNumberAsFigure(rowData.timesRaced);
trackNameLabel.text = rowData.name;
fastestCompetitorNameLabel.text = ((rowData.topUserName == " ")) ? TextManager.getInstance().getTextById("noname.player") : rowData.topUserName;
fastestCompetitorTimeLabel.text = RaceTimer.formatTime(rowData.topTime);
trace(rowData.topUserName, RaceTimer.formatTime(rowData.topTime), rowData.topTime);
starRatings.setDetails(rowData.id, rowData.isRated, rowData.user, rowData.ratingTotal, rowData.ratingCount);
starRatings.interactive = false;
super.populate(_arg1);
}
override protected function onDetailsButtonClick(_arg1:MouseEvent):void{
var _local2:DynamicEvent = new DynamicEvent(GET_TRACK_DETAILS);
_local2.trackDetails = rowData;
dispatchEvent(_local2);
}
override public function clear():void{
super.clear();
}
override public function dispose():void{
super.dispose();
}
override protected function onThumbClick(_arg1:MouseEvent):void{
Constants.trackId = rowData.id;
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Main.sm.showScreen(new ScreenTitleTrackRoute());
trace("onRaceTrackButtonClick");
}
}
}//package com.kerb.modnation.profile
Section 318
//ScreenProfileTrophies (com.kerb.modnation.profile.ScreenProfileTrophies)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.modnation.*;
public class ScreenProfileTrophies extends ScreenProfileAbstract {
private var _trophies:Array;
private var _achieved:Array;
public function ScreenProfileTrophies(){
TOTAL_ROWS = 6;
if (!Main.um.isLogged){
Main.um.login(init);
};
}
override protected function saveCounts(_arg1:RemoteDataManagerEvent):void{
totalPages = (Constants.MAX_TROPHY / 6);
totalCount = Constants.MAX_TROPHY;
pagination.totalItems = totalPages;
pagination.displayPageNumber();
}
override protected function onItemsReceived(_arg1:RemoteDataManagerEvent):void{
saveCounts(_arg1);
_achieved = _arg1.achievements;
_buildTrophyList();
saveItems(_trophies);
super.onItemsReceived(_arg1);
}
override protected function getRemoteData():void{
Main.rdm.getAchievements(UserManager.instance().currentUserId);
}
override protected function onInit(_arg1:Event):void{
tabs = new ProfileTabs(mc.tab_nav_mc, 6);
row1 = new ScreenProfileTrophiesRow(mc.results_1_mc.trophies_mod_mc.content_mc.items_mc.item_1);
row2 = new ScreenProfileTrophiesRow(mc.results_1_mc.trophies_mod_mc.content_mc.items_mc.item_2);
row3 = new ScreenProfileTrophiesRow(mc.results_1_mc.trophies_mod_mc.content_mc.items_mc.item_3);
row4 = new ScreenProfileTrophiesRow(mc.results_1_mc.trophies_enviro_mc.content_mc.items_mc.item_1);
row5 = new ScreenProfileTrophiesRow(mc.results_1_mc.trophies_enviro_mc.content_mc.items_mc.item_2);
row6 = new ScreenProfileTrophiesRow(mc.results_1_mc.trophies_enviro_mc.content_mc.items_mc.item_3);
pagination = new ProfilePagination(mc.results_1_mc.pages_mc);
Main.rdm.addEventListener(RemoteDataManager.GET_ACHIEVEMENTS, onItemsReceived);
Main.ui.trophyBtnSelected = true;
super.onInit(_arg1);
}
override protected function init():void{
if (Main.um.isLogged){
mc = Main.afm.createMovieClip("profile", "screen_profile_trophies2");
super.init();
};
}
private function isNotAchieved(_arg1:Number):Boolean{
var _local3:AchievementDetails;
var _local2:Boolean;
for each (_local3 in _achieved) {
if (_local3.type == _arg1){
_local2 = false;
};
};
return (_local2);
}
private function _buildTrophyList():void{
_trophies = [];
var _local1 = 1;
while (_local1 <= Constants.MAX_TROPHY) {
if (isNotAchieved(_local1)){
_trophies.push({id:_local1});
} else {
_trophies = [{id:_local1, unlocked:true}].concat(_trophies);
};
_local1++;
};
}
override public function dispose():void{
_trophies = null;
Main.rdm.removeEventListener(RemoteDataManager.GET_ACHIEVEMENTS, onItemsReceived);
super.dispose();
}
}
}//package com.kerb.modnation.profile
Section 319
//ScreenProfileTrophiesRow (com.kerb.modnation.profile.ScreenProfileTrophiesRow)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import flash.text.*;
public class ScreenProfileTrophiesRow extends EventDispatcher implements IProfileRow {
protected var rowData:Object;
private var copy:TextField;
protected var mc:MovieClip;
private var title:TextField;
static const GET_CHALLENGE_DETAILS:String = "getChallengeDetails";
public function ScreenProfileTrophiesRow(_arg1:MovieClip){
mc = _arg1;
copy = mc.copy_txt;
}
public function dispose():void{
}
public function populate(_arg1:Object):void{
var _local2:AchievementsManager = AchievementsManager.instance();
var _local3:TextManager = TextManager.getInstance();
var _local4:UserManager = UserManager.instance();
if (_arg1.hasOwnProperty("unlocked")){
mc.gotoAndStop("unlocked");
} else {
mc.gotoAndStop("locked");
};
copy.textColor = (_arg1.hasOwnProperty("unlocked")) ? 0xFFFFFF : 0x3300;
_local3.setTextField(copy, ("trophy.desc" + _arg1.id));
var _local5:String = _local2.getAchievementID(Number(_arg1.id));
var _local6:Trophy = new Trophy(_local5);
if (mc.holder_mc.numChildren != 0){
mc.holder_mc.removeChildAt(0);
};
mc.holder_mc.addChild(_local6);
}
public function set visible(_arg1:Boolean):void{
mc.visible = _arg1;
}
}
}//package com.kerb.modnation.profile
Section 320
//ScreenSelectTrack (com.kerb.modnation.profile.ScreenSelectTrack)
package com.kerb.modnation.profile {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class ScreenSelectTrack extends ScreenProfileAbstract {
public function ScreenSelectTrack(){
Tracking.track(Tracking.EXPLORE_TRACKS);
}
override protected function init():void{
mc = Main.afm.createMovieClip("profile", "screen_profile_tracks");
super.init();
}
override protected function onItemsReceived(_arg1:RemoteDataManagerEvent):void{
trace("onItemsReceived ", _arg1.tracks.length, _arg1.pages, _arg1.totalCount);
saveCounts(_arg1);
saveItems(_arg1.tracks);
super.onItemsReceived(_arg1);
}
override protected function getRemoteData():void{
Main.rdm.searchTracks(Main.um.currentUserId, searchTab.sortByFilter, pagination.currentIndex, TOTAL_ROWS, searchTab.forFilter, searchTab.sortByName, searchTab.enviromentFilter, searchTab.countryFilter, "");
}
override protected function onInit(_arg1:Event):void{
initTabs();
TextManager.getInstance().setTextField(mc.tracks_1_mc.races_txt, "profile.headers.total.races");
TextManager.getInstance().setTextField(mc.tracks_1_mc.top_txt, "profile.headers.top.time");
row1 = new ScreenProfileTracksRow(mc.tracks_1_mc.track_row_1_mc);
row2 = new ScreenProfileTracksRow(mc.tracks_1_mc.track_row_2_mc);
row3 = new ScreenProfileTracksRow(mc.tracks_1_mc.track_row_3_mc);
row4 = new ScreenProfileTracksRow(mc.tracks_1_mc.track_row_4_mc);
row1.addEventListener(ScreenProfileTracksRow.GET_TRACK_DETAILS, onGetItemDetails, false, 0, true);
row2.addEventListener(ScreenProfileTracksRow.GET_TRACK_DETAILS, onGetItemDetails, false, 0, true);
row3.addEventListener(ScreenProfileTracksRow.GET_TRACK_DETAILS, onGetItemDetails, false, 0, true);
row4.addEventListener(ScreenProfileTracksRow.GET_TRACK_DETAILS, onGetItemDetails, false, 0, true);
pagination = new ProfilePagination(mc.tracks_1_mc.pages_mc);
detailsOverlay = new ScreenProfileTracksDetails(mc.tracks_overlay_mc);
searchTab = new SearchTab(mc.tracks_1_mc.search_mc);
Main.rdm.addEventListener(RemoteDataManager.GET_TRACKS, onItemsReceived);
Main.rdm.addEventListener(RemoteDataManager.SEARCH_TRACKS, onItemsReceived);
super.onInit(_arg1);
}
private function onGetItemDetails(_arg1:DynamicEvent):void{
var _local2:TrackDetails = _arg1.trackDetails;
itemIndex = (items.indexOf(_local2) + 1);
populateItemDetails();
}
protected function initTabs():void{
tabs = new ProfileTabs(mc.tab_nav_mc, 1);
}
override public function dispose():void{
Main.rdm.removeEventListener(RemoteDataManager.GET_TRACKS, onItemsReceived);
Main.rdm.removeEventListener(RemoteDataManager.SEARCH_TRACKS, onItemsReceived);
super.dispose();
}
}
}//package com.kerb.modnation.profile
Section 321
//ScreenSelectTrackFriends (com.kerb.modnation.profile.ScreenSelectTrackFriends)
package com.kerb.modnation.profile {
import com.kerb.modnation.*;
public class ScreenSelectTrackFriends extends ScreenSelectTrack {
public function ScreenSelectTrackFriends(){
if (!Main.um.isLogged){
Main.um.login(init);
};
}
override protected function init():void{
if (Main.um.isLogged){
mc = Main.afm.createMovieClip("profile", "screen_profile_tracks");
super.init();
};
}
override protected function getRemoteData():void{
Main.rdm.searchTracks(Main.um.currentUserId, searchTab.sortByFilter, pagination.currentIndex, TOTAL_ROWS, searchTab.forFilter, searchTab.sortByName, searchTab.enviromentFilter, searchTab.countryFilter, Main.fbm.filterStringIDsbyAppUsers(Main.fbm.friendsIDsAsString(), true, true));
}
override protected function initTabs():void{
tabs = new ProfileTabs(mc.tab_nav_mc, 2);
}
}
}//package com.kerb.modnation.profile
Section 322
//ScreenSelectTrackMy (com.kerb.modnation.profile.ScreenSelectTrackMy)
package com.kerb.modnation.profile {
import com.kerb.modnation.*;
public class ScreenSelectTrackMy extends ScreenSelectTrack {
public function ScreenSelectTrackMy(){
if (!Main.um.isLogged){
Main.um.login(init);
};
}
override protected function init():void{
if (Main.um.isLogged){
mc = Main.afm.createMovieClip("profile", "screen_profile_tracks");
super.init();
};
}
override protected function getRemoteData():void{
Main.rdm.searchTracks(Main.um.currentUserId, searchTab.sortByFilter, pagination.currentIndex, TOTAL_ROWS, searchTab.forFilter, searchTab.sortByName, searchTab.enviromentFilter, searchTab.countryFilter, ("FB_" + Main.fbm.uid));
}
override protected function initTabs():void{
tabs = new ProfileTabs(mc.tab_nav_mc, 3);
}
}
}//package com.kerb.modnation.profile
Section 323
//SearchTab (com.kerb.modnation.profile.SearchTab)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.text.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
import flash.ui.*;
public class SearchTab extends EventDispatcher implements IDisposable {
private var sortByBestBtn:DynamicButton;
private var dropdownSortBy:Sprite;
private var enviroJungleBtn:DynamicButton;
private var enviroSeasideBtn:DynamicButton;
private var btnSortBy:DynamicButton;
private var mc:MovieClip;
private var searchClearBtn:DynamicButton;
private var btnCountry:DynamicButton;
private var sortByHighestBtn:DynamicButton;
private var countryFilter_p:String;
private var btnSearch:DynamicButton;
private var sortByFilter_p:String;
private var searchTxt:TextField;
private var enviroDesertBtn:DynamicButton;
private var forCreatorBtn:DynamicButton;
private var sortByLowestBtn:DynamicButton;
private var sortByLatestBtn:DynamicButton;
private var state_p:String;
private var dropdownCountry:Sprite;
private var enviromentFilter_p:int;
private var dropdownEnviro:Sprite;
private var countryBtns:Array;
private var sortByOldestBtn:DynamicButton;
private var forFilter_p:String;
private var btnFor:DynamicButton;
private var btnEnviro:DynamicButton;
private var lastSearchTerm_p:String;
private var enviroAlpineBtn:DynamicButton;
private var forTrackBtn:DynamicButton;
private var btnClose:DynamicButton;
private var dropdownFor:Sprite;
private static const OPEN:String = "Open";
private static const CLOSED:String = "Closed";
public function SearchTab(_arg1:MovieClip){
mc = _arg1;
init();
}
private function toggleDropdowns(_arg1:Sprite=null):void{
var _local2:Sprite;
var _local3:Array = [dropdownFor, dropdownEnviro, dropdownCountry, dropdownSortBy];
var _local4:int = _local3.length;
var _local5:int;
while (_local5 < _local4) {
_local2 = Sprite(_local3[_local5]);
_local2.visible = ((_local2 == _arg1)) ? !(_local2.visible) : false;
_local5++;
};
}
public function dispose():void{
searchTxt.removeEventListener(FocusEvent.FOCUS_IN, onSearchFocusOut);
searchTxt.removeEventListener(KeyboardEvent.KEY_UP, onSearchKeyUp);
btnSearch.removeEventListener(MouseEvent.CLICK, onSearchClick);
btnClose.removeEventListener(MouseEvent.CLICK, onCloseClick);
btnFor.removeEventListener(MouseEvent.CLICK, onDropdownHeaderClick);
btnEnviro.removeEventListener(MouseEvent.CLICK, onDropdownHeaderClick);
btnCountry.removeEventListener(MouseEvent.CLICK, onDropdownHeaderClick);
btnSortBy.removeEventListener(MouseEvent.CLICK, onDropdownHeaderClick);
searchClearBtn.removeEventListener(MouseEvent.CLICK, onClear);
forTrackBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
forCreatorBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
enviroAlpineBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
enviroDesertBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
enviroJungleBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
enviroSeasideBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
sortByLatestBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
sortByOldestBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
sortByHighestBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
sortByLowestBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
sortByBestBtn.removeEventListener(MouseEvent.CLICK, onDropdownClick);
btnSearch.dispose();
btnClose.dispose();
btnFor.dispose();
btnEnviro.dispose();
btnCountry.dispose();
btnSortBy.dispose();
searchClearBtn.dispose();
forTrackBtn.dispose();
forCreatorBtn.dispose();
enviroAlpineBtn.dispose();
enviroDesertBtn.dispose();
enviroJungleBtn.dispose();
enviroSeasideBtn.dispose();
sortByLatestBtn.dispose();
sortByOldestBtn.dispose();
sortByHighestBtn.dispose();
sortByLowestBtn.dispose();
sortByBestBtn.dispose();
}
public function get enviromentFilter():int{
return (enviromentFilter_p);
}
private function onCloseClick(_arg1:MouseEvent):void{
state = CLOSED;
}
public function get forFilter():String{
return (forFilter_p);
}
private function set state(_arg1:String):void{
if (state_p == _arg1){
return;
};
state_p = _arg1;
toggleDropdowns();
switch (state_p){
case OPEN:
mc.gotoAndPlay("trans_in");
break;
case CLOSED:
mc.gotoAndPlay("trans_out");
break;
};
}
private function onSearchKeyUp(_arg1:KeyboardEvent):void{
if (_arg1.charCode == Keyboard.ENTER){
onSearchFocusOut();
};
}
private function init():void{
var _local2:MovieClip;
var _local3:DynamicButton;
state_p = CLOSED;
forFilter_p = Constants.FILTER_FOR_TRACK;
enviromentFilter_p = Number(null);
countryFilter_p = "";
sortByFilter_p = Constants.FILTER_SORT_BY_MOST_RACED;
mc.gotoAndStop(1);
var _local1:TextManager = TextManager.getInstance();
searchTxt = mc.search_mc.search_txt;
searchTxt.text = "";
btnSearch = new DynamicButton(mc.search_mc.search_btn, "search.search.btn");
btnClose = new DynamicButton(mc.search_mc.close_btn);
btnFor = new DynamicButton(mc.search_mc.for_btn, "search.for.track.btn");
btnEnviro = new DynamicButton(mc.search_mc.enviro_btn, "search.enviro.all.btn");
btnCountry = new DynamicButton(mc.search_mc.country_btn, "search.country.btn");
btnSortBy = new DynamicButton(mc.search_mc.sort_by_btn, "search.sort.by.latest.btn");
searchTxt.addEventListener(FocusEvent.FOCUS_IN, onSearchFocusOut, false, 0, true);
searchTxt.addEventListener(KeyboardEvent.KEY_UP, onSearchKeyUp, false, 0, true);
btnSearch.addEventListener(MouseEvent.CLICK, onSearchClick, false, 0, true);
btnClose.addEventListener(MouseEvent.CLICK, onCloseClick, false, 0, true);
btnFor.addEventListener(MouseEvent.CLICK, onDropdownHeaderClick, false, 0, true);
btnEnviro.addEventListener(MouseEvent.CLICK, onDropdownHeaderClick, false, 0, true);
btnCountry.addEventListener(MouseEvent.CLICK, onDropdownHeaderClick, false, 0, true);
btnSortBy.addEventListener(MouseEvent.CLICK, onDropdownHeaderClick, false, 0, true);
dropdownFor = Sprite(mc.search_mc.dropdown_for_mc);
dropdownEnviro = Sprite(mc.search_mc.dropdown_enviro_mc);
dropdownCountry = Sprite(mc.search_mc.dropdown_country_mc);
dropdownSortBy = Sprite(mc.search_mc.dropdown_sort_by_mc);
dropdownFor.visible = (dropdownEnviro.visible = (dropdownCountry.visible = (dropdownSortBy.visible = false)));
forTrackBtn = new DynamicButton(mc.search_mc.dropdown_for_mc.for_track_btn, "search.for.track.btn");
forCreatorBtn = new DynamicButton(mc.search_mc.dropdown_for_mc.for_creator_btn, "search.for.creator.btn");
enviroAlpineBtn = new DynamicButton(mc.search_mc.dropdown_enviro_mc.enviro_alpine_btn, "search.enviro.alpine.btn");
enviroDesertBtn = new DynamicButton(mc.search_mc.dropdown_enviro_mc.enviro_desert_btn, "search.enviro.desert.btn");
enviroJungleBtn = new DynamicButton(mc.search_mc.dropdown_enviro_mc.enviro_jungle_btn, "search.enviro.jungle.btn");
enviroSeasideBtn = new DynamicButton(mc.search_mc.dropdown_enviro_mc.enviro_seaside_btn, "search.enviro.all.btn");
searchClearBtn = new DynamicButton(mc.search_mc.clear_btn, "search.clear.all.btn");
var _local4:int = (mc.search_mc.dropdown_country_mc.numChildren - 1);
countryBtns = new Array(_local4);
var _local5:int;
while (_local5 < _local4) {
_local2 = mc.search_mc.dropdown_country_mc[(("flag_" + (_local5 + 1)) + "_mc")];
_local2.useHandCursor = (_local2.buttonMode = true);
_local2.gotoAndStop(ScreenLanguageSelect.COUNTRIES[_local5]);
_local2.addEventListener(MouseEvent.CLICK, onDropdownClick);
countryBtns[_local5] = _local2;
_local5++;
};
sortByLatestBtn = new DynamicButton(mc.search_mc.dropdown_sort_by_mc.sort_by_latest_btn, "search.sort.by.latest.btn");
sortByOldestBtn = new DynamicButton(mc.search_mc.dropdown_sort_by_mc.sort_by_oldest_btn, "search.sort.by.oldest.btn");
sortByHighestBtn = new DynamicButton(mc.search_mc.dropdown_sort_by_mc.sort_by_highest_btn, "search.sort.by.highest.btn");
sortByLowestBtn = new DynamicButton(mc.search_mc.dropdown_sort_by_mc.sort_by_lowest_btn, "search.sort.by.lowest.btn");
sortByBestBtn = new DynamicButton(mc.search_mc.dropdown_sort_by_mc.sort_by_best_btn, "search.sort.by.best.btn");
searchClearBtn.addEventListener(MouseEvent.CLICK, onClear, false, 0, true);
forTrackBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
forCreatorBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
enviroAlpineBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
enviroDesertBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
enviroJungleBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
enviroSeasideBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
sortByLatestBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
sortByOldestBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
sortByHighestBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
sortByLowestBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
sortByBestBtn.addEventListener(MouseEvent.CLICK, onDropdownClick, false, 0, true);
}
private function onClear(_arg1:MouseEvent):void{
btnCountry.initText("search.country.btn");
btnSortBy.initText("search.sort.by.latest.btn");
forTrackBtn.initText("search.for.track.btn");
btnEnviro.initText("search.enviro.all.btn");
forFilter_p = Constants.FILTER_FOR_TRACK;
enviromentFilter_p = Number(null);
countryFilter_p = "";
sortByFilter_p = Constants.FILTER_SORT_BY_MOST_RACED;
searchTxt.text = "";
dispatchEvent(new Event(Event.CHANGE));
}
private function onDropdownHeaderClick(_arg1:MouseEvent):void{
var _local2:Sprite;
switch (_arg1.target){
case btnFor:
_local2 = dropdownFor;
break;
case btnEnviro:
_local2 = dropdownEnviro;
break;
case btnCountry:
_local2 = dropdownCountry;
break;
case btnSortBy:
_local2 = dropdownSortBy;
break;
};
toggleDropdowns(_local2);
}
public function get sortByName():String{
return (((searchTxt.text == "Search")) ? "" : searchTxt.text);
}
private function onSearchFocusOut(_arg1:FocusEvent=null):void{
if (searchTxt.text == lastSearchTerm_p){
return;
};
lastSearchTerm_p = searchTxt.text;
dispatchEvent(new Event(Event.CHANGE));
}
private function onDropdownClick(_arg1:MouseEvent):void{
var _local3:String;
var _local4:*;
var _local5:DynamicButton;
var _local6:Sprite;
var _local7:int;
var _local2:TextManager = TextManager.getInstance();
switch (_arg1.target){
case forTrackBtn:
_local3 = "search.for.track.btn";
_local4 = Constants.FILTER_FOR_TRACK;
break;
case forCreatorBtn:
_local3 = "search.for.creator.btn";
_local4 = Constants.FILTER_FOR_CREATOR;
break;
case enviroAlpineBtn:
_local3 = "search.enviro.alpine.btn";
_local4 = Constants.ENVIRO_ALPINE;
break;
case enviroDesertBtn:
_local3 = "search.enviro.desert.btn";
_local4 = Constants.ENVIRO_DESERT;
break;
case enviroJungleBtn:
_local3 = "search.enviro.jungle.btn";
_local4 = Constants.ENVIRO_JUNGLE;
break;
case enviroSeasideBtn:
_local3 = "search.enviro.all.btn";
_local4 = "";
break;
case sortByLatestBtn:
_local3 = "search.sort.by.latest.btn";
_local4 = Constants.FILTER_SORT_BY_LATEST;
break;
case sortByOldestBtn:
_local3 = "search.sort.by.oldest.btn";
_local4 = Constants.FILTER_SORT_BY_OLDEST;
break;
case sortByHighestBtn:
_local3 = "search.sort.by.highest.btn";
_local4 = Constants.FILTER_SORT_BY_HIGHEST;
break;
case sortByLowestBtn:
_local3 = "search.sort.by.lowest.btn";
_local4 = Constants.FILTER_SORT_BY_LOWEST;
break;
case sortByBestBtn:
_local3 = "search.sort.by.best.btn";
_local4 = Constants.FILTER_SORT_BY_BEST;
break;
default:
_local7 = countryBtns.indexOf(_arg1.target.parent.parent);
_local3 = ("search.country." + ScreenLanguageSelect.COUNTRIES[_local7]);
_local4 = ScreenLanguageSelect.COUNTRIES[_local7];
_local4 = String(_local4).split("_")[1];
break;
};
switch (_arg1.target){
case forTrackBtn:
case forCreatorBtn:
_local5 = btnFor;
forFilter_p = _local4;
_local6 = dropdownFor;
break;
case enviroAlpineBtn:
case enviroDesertBtn:
case enviroJungleBtn:
case enviroSeasideBtn:
_local5 = btnEnviro;
enviromentFilter_p = _local4;
_local6 = dropdownEnviro;
break;
case sortByLatestBtn:
case sortByOldestBtn:
case sortByHighestBtn:
case sortByLowestBtn:
case sortByBestBtn:
_local5 = btnSortBy;
sortByFilter_p = _local4;
_local6 = dropdownSortBy;
break;
default:
_local5 = btnCountry;
countryFilter_p = _local4;
_local6 = dropdownCountry;
break;
};
_local5.initText(_local3);
_local6.visible = false;
dispatchEvent(new Event(Event.CHANGE));
}
private function onSearchClick(_arg1:MouseEvent):void{
state = ((state_p == CLOSED)) ? OPEN : CLOSED;
}
public function get countryFilter():String{
return (countryFilter_p);
}
public function get sortByFilter():String{
return (sortByFilter_p);
}
}
}//package com.kerb.modnation.profile
Section 324
//StarRatings (com.kerb.modnation.profile.StarRatings)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class StarRatings extends EventDispatcher implements IDisposable {
private var _trackRatingTotal:int;
private var starSpace_p:Number;
private var _trackRatingCount:int;
private var _userID:Number;
private var threeStar:Sprite;
private var halfStarSpace_p:Number;
private var interactive_p:Boolean;
private var mc:MovieClip;
private var fourStar:Sprite;
private var oneStar:Sprite;
private var noStars:Sprite;
private var fiveStar:Sprite;
private var _trackID:Number;
private var _tempRating:int;
private var _isRated:Boolean;
private var _rating:int;
private var twoStar:Sprite;
public function StarRatings(_arg1:MovieClip){
_rating = 0;
_tempRating = -1;
interactive_p = false;
mc = _arg1;
noStars = Sprite(_arg1.star_bg_mc);
oneStar = Sprite(_arg1.star1_mc);
twoStar = Sprite(_arg1.star2_mc);
threeStar = Sprite(_arg1.star3_mc);
fourStar = Sprite(_arg1.star4_mc);
fiveStar = Sprite(_arg1.star5_mc);
starSpace_p = (noStars.width / 5);
halfStarSpace_p = (starSpace_p / 2);
oneStar.mouseEnabled = (oneStar.mouseChildren = (twoStar.mouseEnabled = (twoStar.mouseChildren = (threeStar.mouseEnabled = (threeStar.mouseChildren = (fourStar.mouseEnabled = (fourStar.mouseChildren = (fiveStar.mouseEnabled = (fiveStar.mouseChildren = false)))))))));
removeStars();
}
public function dispose():void{
if (noStars.hasEventListener(MouseEvent.MOUSE_OVER)){
noStars.removeEventListener(MouseEvent.MOUSE_OVER, onStarsOver);
};
if (noStars.hasEventListener(MouseEvent.MOUSE_OUT)){
noStars.removeEventListener(MouseEvent.MOUSE_OUT, onStarsOut);
};
if (noStars.hasEventListener(MouseEvent.MOUSE_MOVE)){
noStars.removeEventListener(MouseEvent.MOUSE_MOVE, onStarsMove);
};
if (noStars.hasEventListener(MouseEvent.CLICK)){
noStars.removeEventListener(MouseEvent.CLICK, onStarsClick);
};
noStars.buttonMode = false;
}
public function set interactive(_arg1:Boolean):void{
if (_arg1 == interactive_p){
return;
};
interactive_p = _arg1;
if (interactive_p){
noStars.buttonMode = true;
noStars.addEventListener(MouseEvent.MOUSE_OVER, onStarsOver);
noStars.addEventListener(MouseEvent.MOUSE_OUT, onStarsOut);
noStars.addEventListener(MouseEvent.CLICK, onStarsClick);
} else {
dispose();
};
}
public function setDetails(_arg1:Number, _arg2:Boolean, _arg3:Number, _arg4:int, _arg5:int):void{
_trackID = _arg1;
_isRated = _arg2;
_userID = _arg3;
_trackRatingTotal = _arg4;
_trackRatingCount = _arg5;
if (((((!(_isRated)) && (!((_userID == UserManager.instance().currentUserId))))) && (Main.um.isLogged))){
interactive = true;
};
rating = Math.round((_arg4 / _arg5));
}
private function onStarsMove(_arg1:MouseEvent=null):void{
var _local2:Number = (noStars.mouseX + halfStarSpace_p);
tempRating = int((_local2 / starSpace_p));
}
private function removeStars():void{
removeStar(oneStar);
removeStar(twoStar);
removeStar(threeStar);
removeStar(fourStar);
removeStar(fiveStar);
}
private function onStarsOver(_arg1:MouseEvent):void{
noStars.addEventListener(MouseEvent.MOUSE_MOVE, onStarsMove);
onStarsMove();
}
public function get rating():int{
return (_rating);
}
public function get interactive():Boolean{
return (interactive_p);
}
private function removeStar(_arg1:Sprite):void{
if ((_arg1.parent is DisplayObject)){
_arg1.parent.removeChild(_arg1);
};
}
public function set tempRating(_arg1:int):void{
_tempRating = _arg1;
removeStars();
switch (_arg1){
case 1:
mc.addChild(oneStar);
break;
case 2:
mc.addChild(twoStar);
break;
case 3:
mc.addChild(threeStar);
break;
case 4:
mc.addChild(fourStar);
break;
case 5:
mc.addChild(fiveStar);
break;
};
}
private function onStarsClick(_arg1:MouseEvent):void{
onStarsMove();
Main.rdm.rateTrack(Main.um.currentUserId, _trackID, _tempRating);
interactive = false;
rating = Math.round(((_trackRatingTotal + _tempRating) / (_trackRatingCount + 1)));
_tempRating = -1;
}
private function onStarsOut(_arg1:MouseEvent):void{
noStars.removeEventListener(MouseEvent.MOUSE_MOVE, onStarsMove);
tempRating = rating;
}
public function set rating(_arg1:int):void{
if (_arg1 == _rating){
return;
};
_rating = _arg1;
removeStars();
switch (_arg1){
case 1:
mc.addChild(oneStar);
break;
case 2:
mc.addChild(twoStar);
break;
case 3:
mc.addChild(threeStar);
break;
case 4:
mc.addChild(fourStar);
break;
case 5:
mc.addChild(fiveStar);
break;
};
}
}
}//package com.kerb.modnation.profile
Section 325
//ThumbnailLoader (com.kerb.modnation.profile.ThumbnailLoader)
package com.kerb.modnation.profile {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.net.*;
public class ThumbnailLoader extends EventDispatcher implements IDisposable {
private var enviroIcon:EnvironmentIcon;
public var loader:Loader;
private var mc:MovieClip;
protected static const THUMBNAIL_SIZE:int = 100;
public function ThumbnailLoader(_arg1:MovieClip, _arg2:Number, _arg3:String){
this.mc = _arg1;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onThumbnailComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onThumbnailError);
loader.load(new URLRequest(_arg3));
enviroIcon = new EnvironmentIcon(_arg1.enviro_type_mc);
enviroIcon.iconID = _arg2;
}
private function clear():void{
var _local1:int;
var _local2:int;
if (loader != null){
_local1 = this.mc.trackPic_mc.numChildren;
_local2 = (_local1 - 1);
while (_local2 >= 0) {
this.mc.trackPic_mc.removeChildAt(_local2);
_local2--;
};
loader = null;
};
}
public function dispose():void{
removeThumbnailListeners();
enviroIcon.dispose();
loader = null;
}
protected function onThumbnailComplete(_arg1:Event):void{
var _local2:int;
var _local3:Number;
removeThumbnailListeners();
if (loader.content != null){
_local2 = loader.content.width;
_local3 = (THUMBNAIL_SIZE / _local2);
loader.content.scaleX = (loader.content.scaleY = _local3);
this.mc.trackPic_mc.addChild(loader);
};
}
protected function removeThumbnailListeners():void{
if (loader.contentLoaderInfo.hasEventListener(Event.COMPLETE)){
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onThumbnailComplete);
};
if (loader.contentLoaderInfo.hasEventListener(IOErrorEvent.IO_ERROR)){
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onThumbnailError);
};
}
protected function onThumbnailError(_arg1:Event):void{
removeThumbnailListeners();
clear();
}
}
}//package com.kerb.modnation.profile
Section 326
//Trophy (com.kerb.modnation.profile.Trophy)
package com.kerb.modnation.profile {
import flash.display.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import com.kerb.modnation.builder.*;
public class Trophy extends Sprite implements IDisposable {
private var item:Sprite;
public function Trophy(_arg1:String){
if (!_arg1.indexOf("car_")){
item = new CarAsset(_arg1);
} else {
item = new Prop(_arg1);
};
this.addChild(item);
item.width = 40;
item.height = 40;
}
public function dispose():void{
if (item.parent){
item.parent.removeChild(item);
};
IDisposable(item).dispose();
item = null;
}
}
}//package com.kerb.modnation.profile
Section 327
//BoostBar (com.kerb.modnation.racer.BoostBar)
package com.kerb.modnation.racer {
import flash.display.*;
import com.kerb.utils.*;
public class BoostBar implements IDisposable {
private var _boost:Number;// = 0
private var _boostbar:MovieClip;
private var _isBoosting:Boolean;// = false
public function BoostBar(_arg1:MovieClip){
_boostbar = _arg1;
_boost = 99;
boostUp(1);
}
public function boost():void{
if (_boost == 100){
_isBoosting = true;
};
}
public function dispose():void{
}
public function get isBoosting():Boolean{
return (_isBoosting);
}
public function boostFactor():Number{
if (_isBoosting){
_boost = (_boost - 0.2);
if (_boost < 1){
_isBoosting = false;
};
};
return ((_isBoosting) ? 2.5 : 1);
}
public function update():void{
if (_boostbar.bar_mc.currentFrame != Math.round(_boost)){
_boostbar.bar_mc.gotoAndStop(Math.round(_boost));
};
}
public function boostUp(_arg1:Number):void{
if (!_isBoosting){
_boost = (_boost + Math.abs(_arg1));
_boost = Math.min(_boost, 100);
};
}
}
}//package com.kerb.modnation.racer
Section 328
//CarAsset (com.kerb.modnation.racer.CarAsset)
package com.kerb.modnation.racer {
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class CarAsset extends Sprite implements IDisposable {
public var id:String;
private var _skidFireOn:Boolean;
private var _fireOn:Boolean;// = true
public var car:MovieClip;
public function CarAsset(_arg1:String){
this.id = _arg1;
x;
car = Main.afm.createMovieClip("cars", _arg1);
this.addChild(car);
car.body_mc.gotoAndStop(15);
fire = false;
skidfire = false;
car.fire_mc.alpha = 0;
car.wheels_fire_mc.alpha = 0;
}
public function set bodyAngle(_arg1:Number):void{
car.body_mc.gotoAndStop(_arg1);
}
public function set fire(_arg1:Boolean):void{
if (_fireOn != _arg1){
car.flame_mc.alpha = (_arg1) ? 1 : 0;
_fireOn = _arg1;
};
}
public function set wheelAngle(_arg1:Number):void{
car.fl_mc.rotation = _arg1;
car.fr_mc.rotation = _arg1;
}
public function set skidfire(_arg1:Boolean):void{
if (_skidFireOn != _arg1){
_skidFireOn = _arg1;
if (_arg1){
car.fire_mc.gotoAndStop(((car.fl_mc.rotation > 0)) ? 1 : 2);
};
};
car.wheels_fire_mc.alpha = (_arg1) ? Math.min(1, (car.wheels_fire_mc.alpha + 0.2)) : Math.max(0, (car.wheels_fire_mc.alpha - 0.2));
car.fire_mc.alpha = (_arg1) ? Math.min(1, (car.fire_mc.alpha + 0.2)) : Math.max(0, (car.fire_mc.alpha - 0.2));
}
public function dispose():void{
}
}
}//package com.kerb.modnation.racer
Section 329
//Game (com.kerb.modnation.racer.Game)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.miian.b2dcar.*;
public class Game extends Sprite implements IDisposable {
public var count:Number;
private var maxx:Number;
private var maxy:Number;
protected var shoudlDispose:Boolean;// = false
private var carWid:Number;// = 2.1
private var carLen:Number;// = 4.2
protected var steeringAngle:Number;
protected var engineSpeed:Number;
private var minx:Number;
private var miny:Number;
protected var game_startTimeStep:Number;
public static const CAR_OFFSET_POSIITON:Number = 110;
public static const MAX_SCREEN_SIZE_WIDTH_D_2:Number = 275;
public static const MAX_SIZE_D_2:Number = 1440;
public static const MAX_SCREEN_SIZE_HEIGHT_D_2:Number = 220;
public static const HOLDER_ROTATION:Number = 90;
public static const TRACK_WITDH:Number = 220;
public static var ZOOM_MIN:Number = 0.6;
public static var CURR_WHEEL_CONTROLLER_DAMP:Number = WHEEL_CONTROLLER_DAMP;
public static var STEER_SPEED:Number = 1;
public static var WHEEL_CONTROLLER_DAMP:Number = 50;
public static var ENGINE_SPEED_CURR:Number = 0;
public static var ENGINE_SPEED:Number = 200;
public static var playerCar:Car;
public static var ZOOM_MAX:Number = 2;
public static var DEFAULT_STEER_SPEED:Number = 0.07;
public static var STEER_SPEED_MOD:Number = 1;
public function Game(){
count = Math.random();
super();
addEventListener(Event.ADDED_TO_STAGE, _onAdded);
count++;
}
protected function keyReleased_handler(_arg1:KeyboardEvent):void{
}
public function init():void{
stage.focus = this;
addEventListener(Event.ENTER_FRAME, Update);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed_handler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased_handler);
}
protected function keyPressed_handler(_arg1:KeyboardEvent):void{
}
public function dispose():void{
removeEventListener(Event.ADDED_TO_STAGE, _onAdded);
removeEventListener(Event.ENTER_FRAME, Update);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed_handler);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased_handler);
}
protected function _onAdded(_arg1:Event):void{
engineSpeed = 0;
steeringAngle = 0;
}
protected function formatAngle(_arg1:Number):Number{
while (_arg1 < -(Math.PI)) {
_arg1 = (_arg1 + (2 * Math.PI));
};
while (_arg1 > Math.PI) {
_arg1 = (_arg1 - (2 * Math.PI));
};
return (_arg1);
}
protected function Update(_arg1:Event):void{
stage.focus = this;
}
protected function compareAngle(_arg1:Number, _arg2:Number):Number{
return (formatAngle((_arg1 - _arg2)));
}
}
}//package com.kerb.modnation.racer
Section 330
//Ghost (com.kerb.modnation.racer.Ghost)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.utils.*;
import com.kerb.utils.*;
import mx.utils.*;
import com.robertpenner.easing.*;
public class Ghost extends EventDispatcher implements IDisposable {
public var ghostKart:Number;// = 1
public var _ltimestamp:Number;
public var _lrot:Number;
private var count:Number;// = 0
public var _timestamp:Number;// = 1
public var _rot:Number;// = 0
public var _px:Number;// = 0
public var _py:Number;// = 0
public var _byteArray:ByteArray;
public var _lpx:Number;
public var _lpy:Number;
private var smooth:Number;// = 100
public var currtime:Number;
public function Ghost(){
_byteArray = new ByteArray();
super();
}
public function deserialize(_arg1:String):void{
trace("deserialize");
var _local2:Base64Decoder = new Base64Decoder();
_local2.decode(_arg1);
_byteArray = _local2.toByteArray();
trace(((_byteArray.length + ":") + (_byteArray.length / 0x0400)));
_byteArray.uncompress();
trace(((_byteArray.length + ":") + (_byteArray.length / 0x0400)));
}
public function get px():Number{
if (_byteArray.bytesAvailable){
return (Linear.easeNone((currtime - _ltimestamp), _lpx, (_px - _lpx), (_timestamp - _ltimestamp)));
};
return (NaN);
}
public function step():void{
currtime = RaceTimer.time;
while (((_byteArray.bytesAvailable) && ((_timestamp < RaceTimer.time)))) {
if (currtime > 300){
_ltimestamp = _timestamp;
_lpx = _px;
_lpy = _py;
};
_lrot = _rot;
_timestamp = _byteArray.readInt();
_px = _byteArray.readDouble();
_py = _byteArray.readDouble();
_rot = _byteArray.readDouble();
};
}
public function debug():void{
_byteArray.position = 0;
while (_byteArray.bytesAvailable) {
_timestamp = _byteArray.readInt();
trace(_timestamp);
_px = _byteArray.readDouble();
_py = _byteArray.readDouble();
_rot = _byteArray.readDouble();
};
}
public function reset():void{
_byteArray.position = 0;
var _local1:Number = RaceTimer.time;
_ltimestamp = 0;
_timestamp = 0;
}
public function push(_arg1:Number, _arg2:Number, _arg3:Number):void{
if (count != 0){
_lpx = (_lpx + _arg1);
_lpy = (_lpy + _arg2);
_lrot = (_lrot + _arg3);
count--;
} else {
_byteArray.writeInt(RaceTimer.time);
_byteArray.writeDouble(_arg1);
_byteArray.writeDouble(_arg2);
_byteArray.writeDouble(_arg3);
_lpx = 0;
_lpy = 0;
_lrot = 0;
count = smooth;
};
}
public function dispose():void{
}
public function serialize():String{
trace("serialize");
trace(((_byteArray.length + ":") + (_byteArray.length / 0x0400)));
_byteArray.compress();
trace(((_byteArray.length + ":") + (_byteArray.length / 0x0400)));
var _local1:Base64Encoder = new Base64Encoder();
_local1.encodeBytes(_byteArray);
var _local2:String = _local1.toString();
deserialize(_local2);
return (_local2);
}
public function get py():Number{
if (_byteArray.bytesAvailable){
return (Linear.easeNone((currtime - _ltimestamp), _lpy, (_py - _lpy), (_timestamp - _ltimestamp)));
};
return (NaN);
}
public function initalstep(_arg1:Number, _arg2:Number, _arg3:Number):void{
_lpx = _arg1;
_lpy = _arg2;
_px = _arg1;
_py = _arg2;
_lrot = (_rot = _arg3);
}
public function get rot():Number{
if (_byteArray.bytesAvailable){
return (Linear.easeNone((currtime - _ltimestamp), _lrot, (_rot - _lrot), (_timestamp - _ltimestamp)));
};
return (NaN);
}
}
}//package com.kerb.modnation.racer
Section 331
//GhostRacer (com.kerb.modnation.racer.GhostRacer)
package com.kerb.modnation.racer {
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
import flash.filters.*;
public class GhostRacer extends Sprite implements IDisposable {
public var ghostVectors:GhostVectors;
private var _currentTime:Number;// = 0
public var ghost:Ghost;
private var car:MovieClip;
private var _cy:Number;// = 0
private var _cx:Number;// = 0
private var _nextTime:Number;// = 0
public function GhostRacer(_arg1:GhostVectors){
this.ghostVectors = _arg1;
ghost = new Ghost();
ghost.deserialize(_arg1.vectors);
car = Main.afm.createMovieClip("cars", "ghost");
var _local2:ColorTransform = new ColorTransform();
_local2.color = 0xFFFFFF;
car.transform.colorTransform = _local2;
car.alpha = 0.3;
car.cacheAsBitmap = true;
addChild(car);
var _local3:Loader = Main.fbm.getPicForUser(_arg1.userExternalId, true);
this.addChild(_local3);
var _local4:MovieClip = Main.afm.createMovieClip("gui", "GhostInfo");
_local4.flag.gotoAndStop(_arg1.userLocale);
_local4.lab.label_txt.text = _arg1.userName;
this.addChild(_local4);
_local4.scaleX = (_local4.scaleY = 0.4);
_local3.scaleX = (_local3.scaleY = 0.2);
_local4.y = 10;
_local3.x = -5;
_local3.y = -10;
_local3.filters = [new GlowFilter(0, 1, 3, 3)];
}
public function dispose():void{
}
public function step(_arg1:Number, _arg2:Number):void{
ghost.step();
var _local3:Number = ((_arg1 - ghost.px) * 10);
var _local4:Number = ((_arg2 - ghost.py) * 10);
if (!isNaN(_local3)){
_cx = (_cx + ((_local3 - _cx) / 5));
_cy = (_cy + ((_local4 - _cy) / 5));
this.x = -((Game.MAX_SIZE_D_2 - ((_arg1 * 10) - _cx)));
this.y = -((Game.MAX_SIZE_D_2 - ((_arg2 * 10) - _cy)));
} else {
_cx = 0;
_cy = 0;
};
this.rotation = ((ghost.rot * 57.2957795) + 90);
}
public function initalstep(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Number = (Math.cos(_arg3) * _arg4);
var _local7:Number = (Math.sin(_arg3) * _arg4);
trace(((_local6 + ":") + _local7));
_arg1 = (_arg1 + _local6);
_arg2 = (_arg2 + _local7);
ghost.initalstep(_arg1, _arg2, _arg5);
this.x = -((Game.MAX_SIZE_D_2 - (_arg1 * 10)));
this.y = -((Game.MAX_SIZE_D_2 - (_arg2 * 10)));
this.rotation = ((_arg5 * KerbMaths.RAD_2_DEG) + 90);
}
}
}//package com.kerb.modnation.racer
Section 332
//GhostRacerManager (com.kerb.modnation.racer.GhostRacerManager)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class GhostRacerManager extends EventDispatcher implements IDisposable {
private var _trackSprite:Sprite;
public static var followGhost:Number;
public function GhostRacerManager(_arg1:IEventDispatcher=null){
super(_arg1);
followGhost = 0;
}
public function dispose():void{
var _local1:int = (_trackSprite.numChildren - 1);
while (_local1 >= 0) {
_trackSprite.removeChildAt(_local1);
_local1--;
};
}
public function getFollowGhost():GhostRacer{
return (Main.um.ghostAtIndex(followGhost));
}
public function updateMiniMap(_arg1:MiniMap):void{
var _local2:int;
while (_local2 < Main.um.ghosts.length) {
_arg1.updateGhost(_local2, Main.um.ghostAtIndex(_local2).ghost.px, Main.um.ghostAtIndex(_local2).ghost.py);
_local2++;
};
}
public function step(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < Main.um.ghosts.length) {
Main.um.ghostAtIndex(_local3).step(_arg1, _arg2);
_local3++;
};
}
public function setup(_arg1:Sprite, _arg2:MiniMap, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Number;
var _local8:Number;
var _local9:Number;
_trackSprite = _arg1;
_local6 = (_arg5 - KerbMaths.HALF_PI);
trace(((("**********" + _arg5) + "**") + _local6));
if (Main.um.ghosts == null){
Main.um.ghosts = [];
};
var _local7:int;
while (_local7 < Main.um.ghosts.length) {
_local8 = (Main.um.ghosts.length / 2);
if (_local7 < _local8){
_local9 = (((_local7 / _local8) * 6) + 3);
} else {
_local9 = -(((((_local7 - _local8) / _local8) * 6) + 3));
};
_arg1.addChild(Main.um.ghostAtIndex(_local7));
Main.um.ghostAtIndex(_local7).initalstep(_arg3, _arg4, _local6, _local9, _arg5);
_arg2.addGhost(Main.um.ghostAtIndex(_local7).ghostVectors.userExternalId);
_local7++;
};
}
public function reset():void{
var _local1:int;
while (_local1 < Main.um.ghosts.length) {
Main.um.ghostAtIndex(_local1).ghost.reset();
_local1++;
};
}
}
}//package com.kerb.modnation.racer
Section 333
//MiniMap (com.kerb.modnation.racer.MiniMap)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.utils.*;
import com.kerb.social.*;
import flash.net.*;
import com.kerb.modnation.*;
import flash.filters.*;
public class MiniMap extends Sprite implements IDisposable {
private var ghosts:Array;
private var _minimap:Bitmap;
private var car:MovieClip;
public function MiniMap(_arg1:BitmapData){
ghosts = [];
car = Main.afm.createMovieClip("ui", "carTest");
car.scaleX = (car.scaleY = 0.4);
car.filters = [new GlowFilter(0xFF00)];
_minimap = new Bitmap(_arg1);
addEventListener(Event.ADDED_TO_STAGE, _onAdded);
}
private function _onAdded(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAdded);
_minimap.width = 100;
_minimap.height = 100;
addChild(_minimap);
addChild(car);
}
public function updatePlayer(_arg1:Number, _arg2:Number):void{
var _local3:Point = new Point((_arg1 * 10), (_arg2 * 10));
_local3 = _minimap.localToGlobal(_local3);
_local3 = this.globalToLocal(_local3);
car.x = _local3.x;
car.y = _local3.y;
}
public function updateGhost(_arg1:Number, _arg2:Number, _arg3:Number):void{
if (((isNaN(_arg2)) || (isNaN(_arg3)))){
_arg2 = Main.um.currentTrack.startX;
_arg3 = Main.um.currentTrack.startY;
};
var _local4:MovieClip = (ghosts[_arg1] as MovieClip);
var _local5:Point = new Point((_arg2 * 10), (_arg3 * 10));
_local5 = _minimap.localToGlobal(_local5);
_local5 = this.globalToLocal(_local5);
_local4.x = _local5.x;
_local4.y = _local5.y;
}
public function addGhost(_arg1:String):void{
var _local4:Loader;
var _local2:ISocialUser = Main.fbm.getUserById(_arg1.split("_")[1]);
var _local3:MovieClip = Main.afm.createMovieClip("ui", "carTest");
if (((((!((_local2 == null))) && (!((_local2.picUrl == null))))) && (!((_local2.picUrl == ""))))){
_local4 = new Loader();
_local4.load(new URLRequest(_local2.picUrl));
_local3.addChild(_local4);
_local4.scaleX = (_local4.scaleY = 0.5);
_local4.x = -12.5;
_local4.y = -12.5;
};
_local3.scaleX = (_local3.scaleY = 0.4);
addChild(_local3);
ghosts.push(_local3);
}
public function dispose():void{
var _local1:DisplayObject;
for each (_local1 in ghosts) {
_local1.parent.removeChild(_local1);
};
ghosts = [];
}
}
}//package com.kerb.modnation.racer
Section 334
//Player (com.kerb.modnation.racer.Player)
package com.kerb.modnation.racer {
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import Box2D.Common.Math.*;
public class Player extends Sprite implements IDisposable {
public var car:CarAsset;
public var ghost:Ghost;
public function Player(){
car = new CarAsset(("car_" + UserManager.instance().currentCart));
addChild(car);
ghost = new Ghost();
}
public function steer(_arg1:Number):void{
_arg1 = ((_arg1 * KerbMaths.RAD_2_DEG) * 4);
car.wheelAngle = _arg1;
}
public function smoke():void{
this.addChild(new SmokeParticle(this));
}
public function drawDb(_arg1:b2Vec2):void{
this.graphics.clear();
this.graphics.lineStyle(2, 0xFFFFFF, 1);
this.graphics.moveTo(0, 0);
this.graphics.lineTo(_arg1.x, _arg1.y);
this.graphics.endFill();
}
public function drift(_arg1:Number):void{
var _local2:Number;
_arg1 = Math.max(-45, Math.min(45, _arg1));
_local2 = (_arg1 + 45);
_local2 = (_local2 / 90);
_local2 = (_local2 * 30);
_local2 = Math.round(_local2);
car.bodyAngle = _local2;
}
public function dispose():void{
ghost = null;
}
}
}//package com.kerb.modnation.racer
Section 335
//Racer (com.kerb.modnation.racer.Racer)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.system.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.utils.*;
import com.gskinner.motion.*;
import com.kerb.modnation.UI.*;
import Box2D.Common.Math.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.*;
import com.robertpenner.easing.*;
import com.gskinner.motion.easing.*;
public class Racer extends Sprite implements IDisposable {
private var _currentZone:Number;
private var _cx:Number;// = 0
public var repositioning:Boolean;// = false
private var _cy:Number;// = 0
private var _mapItems:BitmapData;
private var _lr:Number;// = 0
private var position:b2Vec2;
private var _lx:Number;// = 0
private var _ly:Number;// = 0
private var _skids_mc:MovieClip;
private var skid_count:Number;// = 0
private var introG:GTween;
private var _ghostRacerManager:GhostRacerManager;
private var minv:Number;// = 1111111
private var racerSounds:RacerSounds;
public var boostBar:BoostBar;
public var restarting:Boolean;// = false
private var v:Number;
private var _highestFriction:Number;
private var _repositionCounter:int;// = 0
private var _posrl:b2Vec2;
private var _sliceWrongWayTimer:Number;// = 0
private var maxv:Number;// = 5
private var _nextZoneSlice:Number;
private var _posrr:b2Vec2;
private var _ghost:Ghost;
public var currentSlice:Number;
private var _trackBitmap:Bitmap;
public var trackData:TrackData;
private var _map:BitmapData;
public var onItem:String;
public var onTrack:Boolean;// = true
private var _halfway_reached:Boolean;// = false
private var _last_position:b2Vec2;
private var _lposrl:b2Vec2;
public var restartSlice:Number;// = 0
private var _lposrr:b2Vec2;
private var _holder:Sprite;
private var steer:Number;
public var renderer:RacerRenderer;
public var car:Player;
private var _racerHUD:RacerHUD;
public var rot:Number;
private var _finished:Boolean;// = false
private var _lap:Number;// = 1
public var lastGoodSlice:Number;// = 1
private var _sliceDelta:Number;// = 0
private var _sliceCounter:Number;
private var _sp:Sprite;
public static var RR:Number;
public static var FL:Number;
public static var _avgFriction:Number;
public static var FR:Number;
public static var RL:Number;
public static var FollowGhost:Boolean = false;
public function Racer(_arg1:TrackData, _arg2:Ghost){
_last_position = new b2Vec2();
_lposrr = new b2Vec2();
_lposrl = new b2Vec2();
super();
this.visible = false;
trace((Math.round((System.totalMemory / 0x0400)) + "*****"));
racerSounds = new RacerSounds();
addEventListener(Event.ADDED_TO_STAGE, _onAdded);
_ghost = _arg2;
this.trackData = _arg1;
_currentZone = 0;
RaceTimer.pause();
FollowGhost = false;
Main.um.currentTime = 9999999;
_skids_mc = Main.afm.createMovieClip("ui", "skids");
renderer = UserManager.instance().renderer;
this.addEventListener(Event.ADDED_TO_STAGE, _onRenderComplete, false, 0, true);
renderer.addEventListener(Event.COMPLETE, _onRenderComplete, false, 0, true);
renderer.render(this.trackData);
}
private function _onRenderComplete(_arg1:Event):void{
if (((!((this.stage == null))) && (renderer.isRendered))){
renderedAndAdded();
};
}
public function saveGhost():void{
car.ghost.serialize();
}
public function dispose():void{
if (introG != null){
introG.paused = true;
};
introG = null;
renderer.removeEventListener(Event.COMPLETE, _onRenderComplete);
this.removeEventListener(Event.ADDED_TO_STAGE, _onRenderComplete);
removeEventListener(Event.ADDED_TO_STAGE, _onAdded);
_ghostRacerManager.dispose();
parent.removeChild(_racerHUD);
_racerHUD.dispose();
car.dispose();
racerSounds.dispose();
Main.playMusic(Main.MUSIC_1);
}
private function _onAdded(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAdded);
Main.ui.showLoadingText = true;
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_LOADING);
stage.dispatchEvent(_local2);
}
private function _getResistance(_arg1:b2Vec2):Number{
var _local2:uint = _map.getPixel32((_arg1.x * 10), (_arg1.y * 10));
var _local3:Number = (_local2 & 0xFF);
if (_local3 > _highestFriction){
_highestFriction = _local3;
};
_avgFriction = (_avgFriction + _local3);
return (_avgFriction);
}
private function _beginIntroComplete(_arg1:GTween):void{
_racerHUD.beginCountdown();
}
private function renderedAndAdded():void{
renderer.removeEventListener(Event.COMPLETE, _onRenderComplete);
this.removeEventListener(Event.ADDED_TO_STAGE, _onRenderComplete);
var _local1:DynamicEvent = new DynamicEvent(UI.EVENT_HIDE_LOADING);
stage.dispatchEvent(_local1);
_trackBitmap = new Bitmap(renderer.bitmapData);
_map = renderer.mapBitmapData;
_mapItems = renderer.itemsBitmapData;
_trackBitmap.smoothing = true;
_holder = new Sprite();
_sp = new Sprite();
this.addChild(_holder);
_holder.addChild(_sp);
_sp.addChild(_trackBitmap);
_trackBitmap.x = -(Game.MAX_SIZE_D_2);
_trackBitmap.y = -(Game.MAX_SIZE_D_2);
this.x = 275;
this.y = (210 + Game.CAR_OFFSET_POSIITON);
_holder.rotation = -(Game.HOLDER_ROTATION);
car = new Player();
addChild(car);
_racerHUD = (parent.addChild(new RacerHUD()) as RacerHUD);
_racerHUD.addEventListener(Event.COMPLETE, _onHUDComplete);
boostBar = _racerHUD.boostBar;
_ghostRacerManager = new GhostRacerManager();
_ghostRacerManager.setup(_sp, _racerHUD.minimap, position.x, position.y, this.rot);
_positionTrack();
Main.playMusic(Main.MUSIC_2);
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local2.overlay = new PopupOverlay("Instructions_5_controls");
stage.dispatchEvent(_local2);
stage.addEventListener(UI.EVENT_HIDE_OVERLAY, onInstructionsClear);
_racerHUD.minimap.updatePlayer(position.x, position.y);
_ghostRacerManager.updateMiniMap(_racerHUD.minimap);
}
public function complete():void{
_finished = true;
dispatchEvent(new Event(Event.COMPLETE));
}
public function reset():void{
RacerRenderer.cacheProps = true;
RacerRenderer.cacheTrack = true;
Main.sm.showScreen(new ScreenRacer());
}
private function repositionOver(_arg1:GTween):void{
Game.ENGINE_SPEED_CURR = 0;
repositioning = true;
_repositionCounter = 0;
restarting = false;
dispatchEvent(new Event(Event.CHANGE));
}
public function record():void{
car.ghost.push(position.x, position.y, (rot + RacerController.drift_angle));
}
public function initPosition(_arg1:Number, _arg2:Number, _arg3:Number):void{
position = new b2Vec2(_arg1, _arg2);
this.rot = _arg3;
}
private function _getItem(_arg1:b2Vec2):void{
var _local2:uint = _mapItems.getPixel(Math.round((_arg1.x * 10)), Math.round((_arg1.y * 10)));
if (repositioning){
onItem = null;
_repositionCounter++;
if (_repositionCounter > 300){
repositioning = false;
};
} else {
onItem = ((_local2 == 0)) ? null : trackData.props[(_local2 - 1)].id;
};
}
public function reposition(_arg1:Number, _arg2:Number, _arg3:Number):void{
new GTween(this, 1, {rot:_arg3});
new GTween(car, 0.2, {alpha:0});
new GTween(car, 0.1, {alpha:1}, {delay:0.9, onComplete:repositionOver});
new GTween(position, 1, {x:_arg1, y:_arg2}, {onChange:repostionChange});
Game.ENGINE_SPEED_CURR = 0;
Main.playSoundFX(Main.SFX_NAME_REPLACE);
}
private function onInstructionsClear(_arg1:Event):void{
stage.removeEventListener(UI.EVENT_HIDE_OVERLAY, onInstructionsClear);
_beginIntroZoom();
}
private function _checkCarPositionAroundTrack():void{
var _local2:Number;
var _local1:Number = renderer.slicesBitmapData.getPixel((position.x * 10), (position.y * 10));
currentSlice = _local1;
if ((((currentSlice > 0)) && ((currentSlice < trackData.track.length)))){
lastGoodSlice = currentSlice;
};
if (lastGoodSlice == renderer.nextSliceValueForZoneByIndex(_currentZone)){
restartSlice = renderer.nextSliceValueForZoneByIndex((_currentZone - 1));
_currentZone++;
};
if (_currentZone == (renderer.numZonesOnTrack + 1)){
Main.playSoundFX(Main.SFX_NAMEhud_race_lapCall_3);
_local2 = RaceTimer.time;
_lap++;
_racerHUD.updateLap(_lap, _local2);
_currentZone = 0;
trace(((("currtime:" + _local2) + " bestTime :") + Main.um.currentTime));
if (_local2 < Main.um.currentTime){
Main.um.currentTime = _local2;
Main.um.currentGhost = car.ghost;
};
RaceTimer.startClock();
car.ghost = new Ghost();
_ghostRacerManager.reset();
};
_racerHUD.wrongway = ((lastGoodSlice + renderer._zonesToSlices[0]) < renderer._zonesToSlices[_currentZone]);
if (_lap == 4){
complete();
};
}
private function _scaleView():void{
if (maxv < v){
maxv = v;
};
maxv = 5;
v = (1 - (v / maxv));
v = (v * (Game.ZOOM_MAX - Game.ZOOM_MIN));
v = (Game.ZOOM_MIN + v);
v = Math.max(v, Game.ZOOM_MIN);
if (FollowGhost){
v = 0.4;
};
this.scaleX = (this.scaleY = (this.scaleX + ((v - this.scaleX) / 100)));
}
private function _positionTrack():void{
if (!FollowGhost){
_sp.x = (Game.MAX_SIZE_D_2 - (position.x * 10));
_sp.y = (Game.MAX_SIZE_D_2 - (position.y * 10));
_holder.rotation = (-((rot * 57.2957795)) - Game.HOLDER_ROTATION);
car.visible = true;
} else {
car.visible = false;
_sp.x = (Game.MAX_SIZE_D_2 - (_ghostRacerManager.getFollowGhost().ghost.px * 10));
_sp.y = (Game.MAX_SIZE_D_2 - (_ghostRacerManager.getFollowGhost().ghost.py * 10));
_holder.rotation = -((_ghostRacerManager.getFollowGhost().ghost.rot * 57.2957795));
};
}
public function tick():void{
if (position != null){
_scaleView();
_positionTrack();
_drift();
_ghostRacerManager.step(position.x, position.y);
car.car.fire = boostBar.isBoosting;
boostBar.update();
_racerHUD.updateTime();
_racerHUD.minimap.updatePlayer(position.x, position.y);
_ghostRacerManager.updateMiniMap(_racerHUD.minimap);
_last_position.x = position.x;
_last_position.y = position.y;
racerSounds.skidVol((Math.min(skid_count, 10) / 10));
racerSounds.engineVol((Game.ENGINE_SPEED_CURR / Game.ENGINE_SPEED));
racerSounds.offRoadVol((_highestFriction / 0xFF));
racerSounds.boostVol((boostBar.isBoosting) ? 1 : 0);
racerSounds.BoostItemVol(((onItem == null)) ? 0 : 1);
};
}
private function _drift():void{
var _local1:Number;
var _local2:Point;
var _local3:Number;
var _local4:int;
var _local5:Matrix;
if (_posrr != null){
_local1 = (RacerController.drift_angle * 130);
car.car.rotation = (car.car.rotation + ((_local1 - car.car.rotation) / 8));
car.drift(car.car.rotation);
car.steer(this.steer);
if (Math.abs(RacerController.drift_angle) > 0.225){
_local2 = new Point(car.car.car.fl_mc.x, (car.car.car.fl_mc.y + 20));
_local2 = car.car.car.localToGlobal(_local2);
_local2 = _trackBitmap.globalToLocal(_local2);
_posrl.x = _local2.x;
_posrl.y = _local2.y;
_local2 = new Point(car.car.car.fr_mc.x, (car.car.car.fr_mc.y + 20));
_local2 = car.car.car.localToGlobal(_local2);
_local2 = _trackBitmap.globalToLocal(_local2);
_posrr.x = _local2.x;
_posrr.y = _local2.y;
_local3 = 5;
_local4 = 0;
while (_local4 < _local3) {
_local5 = new Matrix();
_local5.tx = Linear.easeNone(_local4, _lposrr.x, (_posrr.x - _lposrr.x), (_local3 + 1));
_local5.ty = Linear.easeNone(_local4, _lposrr.y, (_posrr.y - _lposrr.y), (_local3 + 1));
_trackBitmap.bitmapData.draw(_skids_mc, _local5);
_local5 = new Matrix();
_local5.tx = Linear.easeNone(_local4, _lposrl.x, (_posrl.x - _lposrl.x), (_local3 + 1));
_local5.ty = Linear.easeNone(_local4, _lposrl.y, (_posrl.y - _lposrl.y), (_local3 + 1));
_trackBitmap.bitmapData.draw(_skids_mc, _local5);
_local4++;
};
if (skid_count++ > 4){
car.smoke();
};
if (skid_count > 16){
car.car.skidfire = true;
};
} else {
skid_count = 0;
car.car.skidfire = false;
};
_lposrr.x = _posrr.x;
_lposrr.y = _posrr.y;
_lposrl.x = _posrl.x;
_lposrl.y = _posrl.y;
};
}
private function _beginIntroZoom():void{
this.visible = true;
dispatchEvent(new Event(Event.INIT));
racerSounds.engineVol(0);
this.scaleX = (this.scaleY = 0.1);
new GTween(this, 4, {scaleX:2.8, scaleY:2.8, rotation:360, y:180}, {delay:0.5, ease:Quadratic.easeInOut});
introG = new GTween(this, 2, {scaleX:1, scaleY:1, rotation:0, y:(210 + Game.CAR_OFFSET_POSIITON)}, {delay:6, ease:Quadratic.easeInOut, onComplete:_beginIntroComplete});
}
public function syncToPhysics(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:Number, _arg7:Number, _arg8:Number):Number{
_highestFriction = 0;
_avgFriction = 0;
this.position = _arg1;
this.rot = _arg6;
this.v = _arg7;
this.steer = _arg8;
_getResistance(_arg1);
_getItem(_arg1);
_posrl = _arg4;
_posrr = _arg5;
_checkCarPositionAroundTrack();
return (_highestFriction);
}
private function _onHUDComplete(_arg1:Event):void{
Main.um.currentTime = 999999;
RaceTimer.startClock();
_ghostRacerManager.reset();
}
private function repostionChange(_arg1:GTween):void{
Game.ENGINE_SPEED_CURR = 0;
_positionTrack();
}
}
}//package com.kerb.modnation.racer
Section 336
//RacerController (com.kerb.modnation.racer.RacerController)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.utils.*;
import Box2D.Common.Math.*;
import com.miian.b2dcar.*;
import com.kerb.modnation.*;
import com.miian.b2dhelp.*;
import flash.ui.*;
public class RacerController extends Game {
private const MS2:Number = 1.953125;
private const MS:Number = 15.625;
private var _racer:Racer;
private var skid_count:Number;// = 0
private var _lastbodyfriction:Number;
private var boost:Number;// = 0
private var _framesoverspill:Number;// = 0
private var _offTimer:Number;// = 0
private var _restoreSpeed:Boolean;// = true
public static var drift_angle:Number = 0;
public static var INFO_OUT:String;
public function RacerController(_arg1:Racer, _arg2:Number, _arg3:Number, _arg4:Number){
_racer = _arg1;
_racer.initPosition((_arg2 / 10), (_arg3 / 10), _arg4);
Game.ENGINE_SPEED = 25;
Game.STEER_SPEED = Game.DEFAULT_STEER_SPEED;
Game.ENGINE_SPEED_CURR = Game.ENGINE_SPEED;
super();
playerCar = new Car((_arg2 / 10), (_arg3 / 10), _arg4);
}
override protected function keyReleased_handler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
Game.CURR_WHEEL_CONTROLLER_DAMP = Game.WHEEL_CONTROLLER_DAMP;
};
if ((((_arg1.keyCode == Keyboard.UP)) || ((_arg1.keyCode == Keyboard.DOWN)))){
engineSpeed = 0;
_restoreSpeed = false;
};
if ((((_arg1.keyCode == Keyboard.LEFT)) || ((_arg1.keyCode == Keyboard.RIGHT)))){
steeringAngle = 0;
};
}
override protected function keyPressed_handler(_arg1:KeyboardEvent):void{
if (!_racer.restarting){
if (_arg1.keyCode == Keyboard.SPACE){
_racer.boostBar.boost();
};
if (_arg1.keyCode == Keyboard.F2){
_racer.complete();
};
if (_arg1.keyCode == Keyboard.F3){
_racer.reset();
};
if (_arg1.keyCode == Keyboard.F4){
};
if (_arg1.keyCode == Keyboard.F5){
};
if (_arg1.keyCode == Keyboard.F7){
Racer.FollowGhost = !(Racer.FollowGhost);
};
if (_arg1.keyCode == Keyboard.F8){
GhostRacerManager.followGhost++;
if (GhostRacerManager.followGhost >= Main.um.ghosts.length){
GhostRacerManager.followGhost = 0;
};
};
if (_arg1.keyCode == Keyboard.UP){
Game.DEFAULT_STEER_SPEED = 0.07;
playerCar.body.WakeUp();
engineSpeed = ENGINE_SPEED;
_restoreSpeed = true;
};
if (_arg1.keyCode == Keyboard.DOWN){
Game.DEFAULT_STEER_SPEED = (0.07 * 3);
engineSpeed = -(ENGINE_SPEED);
};
if (_arg1.keyCode == Keyboard.RIGHT){
steeringAngle = STEER_SPEED;
};
if (_arg1.keyCode == Keyboard.LEFT){
steeringAngle = -(STEER_SPEED);
};
};
}
private function reposition():void{
var _local1:Object = Main.um.currentTrack.track[_racer.restartSlice];
playerCar = new Car((_local1.x / 10), (_local1.y / 10), _local1.r);
_racer.reposition((_local1.x / 10), (_local1.y / 10), _local1.r);
_racer.restarting = true;
engineSpeed = 0;
ENGINE_SPEED_CURR = 0;
}
override public function dispose():void{
super.dispose();
_racer = null;
playerCar = null;
}
override protected function Update(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:Number;
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:b2Vec2;
if (!RaceTimer.isPaused){
if (isNaN(game_startTimeStep)){
game_startTimeStep = (getTimer() - 10);
};
_local2 = getTimer();
_local3 = (_local2 - game_startTimeStep);
_local4 = Math.floor((_local3 / MS2));
_framesoverspill = (_framesoverspill + (_local3 % MS2));
if (_framesoverspill >= MS2){
_local4++;
_framesoverspill = (_framesoverspill - MS2);
};
_local5 = 0;
while (_local5 < _local4) {
if (((!((_racer == null))) && (!(_racer.restarting)))){
Game.ENGINE_SPEED_CURR = (Game.ENGINE_SPEED_CURR + ((((engineSpeed * _racer.boostBar.boostFactor()) + boost) - Game.ENGINE_SPEED_CURR) / 500));
_local6 = playerCar.steer(steeringAngle);
_local7 = playerCar.body.GetPosition();
playerCar.body.GetAngularVelocity();
_local8 = playerCar.body.GetAngle();
_local9 = _racer.syncToPhysics(_local7, playerCar.wheelFL.GetPosition(), playerCar.wheelFR.GetPosition(), playerCar.wheelRL.GetPosition(), playerCar.wheelRR.GetPosition(), _local8, playerCar.body.m_linearVelocity.Length(), _local6);
if (((!((_racer == null))) && ((_racer.currentSlice == 0xFFFFFF)))){
_offTimer++;
if (_offTimer > 100){
reposition();
};
Game.ENGINE_SPEED_CURR = 0;
} else {
_offTimer = 0;
};
if (_racer != null){
_local10 = TrackProp.boost(_racer.onItem);
if (_local10 != 1){
trace(_local10);
boost = _local10;
} else {
boost = Math.max(0, --boost);
};
_local11 = ((0x0100 - _local9) / 0x0100);
_local11 = Math.max(0.2, _local11);
_local12 = _local9;
Game.STEER_SPEED = ((Game.ENGINE_SPEED_CURR < Game.ENGINE_SPEED)) ? (Game.DEFAULT_STEER_SPEED * 2) : (Game.DEFAULT_STEER_SPEED * 2);
if (_racer.onItem == "water"){
_local11 = 0.1;
};
if (_lastbodyfriction < _local11){
playerCar.drive((Game.ENGINE_SPEED_CURR * 1));
} else {
playerCar.drive(((Game.ENGINE_SPEED_CURR * _local11) * 1));
};
_lastbodyfriction = _local11;
_local13 = TrackProp.oil(_racer.onItem);
if (_local13 != 1){
_local15 = playerCar.wheelFR.GetXForm().R.col1.Copy();
playerCar.body.SetAngularVelocity(_local13);
};
Helper.update((1 / 64), 1);
_racer.record();
WheelController.update((1 / 64));
game_startTimeStep = _local2;
_local14 = Game.playerCar.body.GetAngularVelocity();
_local14 = (_local14 * 1.5);
_local14 = ((Math.abs(_local14) > 0.3)) ? _local14 : 0;
drift_angle = (drift_angle + ((_local14 - drift_angle) / 100));
if (Math.abs(RacerController.drift_angle) > 0.225){
if (skid_count++ > 200){
_racer.boostBar.boostUp(0.2);
};
} else {
skid_count = 0;
};
};
};
_local5++;
};
if (((!((_racer == null))) && (!(_racer.restarting)))){
_racer.tick();
};
};
}
public function restoreAfterReposition():void{
Game.ENGINE_SPEED_CURR = 0;
game_startTimeStep = (getTimer() - 10);
engineSpeed = (_restoreSpeed) ? ENGINE_SPEED : 0;
}
}
}//package com.kerb.modnation.racer
Section 337
//RacerHUD (com.kerb.modnation.racer.RacerHUD)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
public class RacerHUD extends Sprite implements IDisposable {
public var minimap:MiniMap;
public var boostBar:BoostBar;
private var _mc:MovieClip;
public function RacerHUD(){
_mc = Main.afm.createMovieClip("gui", "RacerHUD");
addChild(_mc);
_mc.addEventListener(Event.ADDED_TO_STAGE, _onAdded);
var _local1:UserManager = UserManager.instance();
minimap = (_mc.minimap_mc.addChild(new MiniMap(_local1.renderer.mapBitmapData)) as MiniMap);
_mc.time_txt.text = RaceTimer.formatTime(0);
boostBar = new BoostBar(_mc.boost_mc);
wrongway = false;
_mc.start_countdown_mc.visible = false;
updateLap(1, 0);
}
private function _onAdded(_arg1:Event):void{
}
private function _onCountdownChange(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_LIGHTS_START_COUNTDOWN);
}
public function set wrongway(_arg1:Boolean):void{
_mc.wrong_way_mc.visible = _arg1;
}
public function dispose():void{
_mc.start_countdown_mc.stop();
_mc.start_countdown_mc.removeEventListener(Event.COMPLETE, _onCountdownComplete);
_mc.start_countdown_mc.removeEventListener(Event.CHANGE, _onCountdownChange);
_mc.removeEventListener(Event.ADDED_TO_STAGE, _onAdded);
minimap.dispose();
boostBar.dispose();
}
public function beginCountdown():void{
_mc.start_countdown_mc.addEventListener(Event.COMPLETE, _onCountdownComplete);
_mc.start_countdown_mc.addEventListener(Event.CHANGE, _onCountdownChange);
_mc.start_countdown_mc.visible = true;
_mc.start_countdown_mc.play();
}
public function get wrongway():Boolean{
return (_mc.wrong_way_mc.visible);
}
private function _onCountdownComplete(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_START_GO);
_mc.start_countdown_mc.addEventListener(Event.CHANGE, _onCountdownChange);
_mc.start_countdown_mc.removeEventListener(Event.COMPLETE, _onCountdownComplete);
_mc.start_countdown_mc.visible = false;
_mc.removeChild(_mc.start_countdown_mc);
dispatchEvent(new Event(Event.COMPLETE));
}
public function updateLap(_arg1:Number, _arg2:Number):void{
_mc.lap_txt.text = (((((TextManager.getInstance().getTextById("lap") + " ") + _arg1.toString()) + " ") + TextManager.getInstance().getTextById("of")) + " 3");
if (_arg2 != 0){
_mc.lap2_txt.text = (_mc.lap2_txt.text + (RaceTimer.formatTime(_arg2) + "/"));
} else {
_mc.lap2_txt.text = "";
};
}
public function updateTime():void{
_mc.time_txt.text = RaceTimer.formatTime(RaceTimer.time);
}
}
}//package com.kerb.modnation.racer
Section 338
//RacerSounds (com.kerb.modnation.racer.RacerSounds)
package com.kerb.modnation.racer {
import flash.events.*;
import com.kerb.utils.*;
import flash.media.*;
import com.kerb.sound.*;
import com.kerb.modnation.*;
public class RacerSounds extends EventDispatcher implements IDisposable {
private var sounds:Array;
public function RacerSounds(){
var _local1:ExtendedSound;
sounds = [];
super();
sounds[Main.SFX_NAME_SKIDDING] = Main.smSFX.getSoundByClassName(Main.SFX_NAME_SKIDDING);
sounds[Main.SFX_NAME_ENGINE] = Main.smSFX.getSoundByClassName(Main.SFX_NAME_ENGINE);
sounds[Main.SFX_NAME_BOOSTING] = Main.smSFX.getSoundByClassName(Main.SFX_NAME_BOOSTING);
sounds[Main.SFX_NAME_BOOST] = Main.smSFX.getSoundByClassName(Main.SFX_NAME_BOOST);
sounds[Main.SFX_NAME_REVS] = Main.smSFX.getSoundByClassName(Main.SFX_NAME_REVS);
sounds[Main.SFX_NAME_OFF_ROAD] = Main.smSFX.getSoundByClassName(Main.SFX_NAME_OFF_ROAD);
for each (_local1 in sounds) {
_local1.play(0, 99999, new SoundTransform(0));
};
}
public function boostVol(_arg1:Number):void{
Main.smSFX.getSoundByClassName(Main.SFX_NAME_BOOSTING).setVolume(_arg1);
}
public function engineVol(_arg1:Number):void{
Main.smSFX.getSoundByClassName(Main.SFX_NAME_ENGINE).setVolume(_arg1);
Main.smSFX.getSoundByClassName(Main.SFX_NAME_REVS).setVolume((1 - _arg1));
}
public function skidVol(_arg1:Number):void{
Main.smSFX.getSoundByClassName(Main.SFX_NAME_SKIDDING).setVolume(_arg1);
}
public function offRoadVol(_arg1:Number):void{
Main.smSFX.getSoundByClassName(Main.SFX_NAME_OFF_ROAD).setVolume(_arg1);
}
public function BoostItemVol(_arg1:Number):void{
Main.smSFX.getSoundByClassName(Main.SFX_NAME_BOOST).setVolume(_arg1);
}
public function dispose():void{
var _local1:ExtendedSound;
for each (_local1 in sounds) {
_local1.stop();
};
sounds = [];
}
}
}//package com.kerb.modnation.racer
Section 339
//RaceTimer (com.kerb.modnation.racer.RaceTimer)
package com.kerb.modnation.racer {
import flash.utils.*;
public class RaceTimer {
public static const MILLIS_PER_DAY:Number = 86400000;
private static var _paused:Boolean;
private static var _pausedTime:Number = 0;
private static var _startGetTimer:Number;
private static var _pausedGetTimer:Number;
public static function get time():Number{
return (((getTimer() - _startGetTimer) - _pausedTime));
}
public static function formatTime(_arg1:Number):String{
var _local2:Date = new Date(_arg1);
var _local3:String = ((_local2.getMinutes() < 10)) ? ("0" + _local2.getMinutes()) : _local2.getMinutes().toString();
var _local4:String = ((_local2.getSeconds() < 10)) ? ("0" + _local2.getSeconds()) : _local2.getSeconds().toString();
var _local5:String = ((_local2.getMilliseconds() < 10)) ? ("0" + _local2.getMilliseconds()) : _local2.getMilliseconds().toString().slice(0, 2);
return (((((_local3 + ".") + _local4) + ".") + _local5));
}
public static function startClock():void{
_pausedTime = 0;
_startGetTimer = getTimer();
_paused = false;
}
public static function formatNumberAsFigure(_arg1:Number):String{
var _local2:int = int(_arg1);
var _local3:Number = (_arg1 - _local2);
var _local4:String = _arg1.toString();
var _local5 = "";
var _local6 = 3;
var _local7:int = Math.ceil((_local4.length / _local6));
var _local8:int;
while (_local8 < _local7) {
if (_local8 > 0){
_local5 = ("," + _local5);
};
_local5 = (_local4.substring((_local4.length - ((_local8 + 1) * _local6)), (_local4.length - (_local8 * _local6))) + _local5);
_local8++;
};
if (_local3 > 0){
_local3 = (Math.round((_local3 * 100)) / 100);
_local5 = (_local5 + ("." + _local3));
};
return (_local5);
}
public static function pause():void{
_paused = true;
_pausedGetTimer = getTimer();
}
public static function unpause():void{
_paused = false;
_pausedTime = (_pausedTime + (getTimer() - _pausedGetTimer));
}
public static function get isPaused():Boolean{
return (_paused);
}
}
}//package com.kerb.modnation.racer
Section 340
//SmokeParticle (com.kerb.modnation.racer.SmokeParticle)
package com.kerb.modnation.racer {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.*;
public class SmokeParticle extends Sprite {
private var player:Player;
private var vy:Number;
private var vx:Number;
private var count:Number;// = 0
private var sm1:MovieClip;
private var sm2:MovieClip;
public function SmokeParticle(_arg1:Player){
this.player = _arg1;
addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onAdded(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAdded);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
var _local2:Point = new Point(player.car.car.fl_mc.x, (player.car.car.fl_mc.y + 30));
_local2 = player.car.car.localToGlobal(_local2);
_local2 = globalToLocal(_local2);
sm1 = Main.afm.createMovieClip("ui", "firesmoke");
sm1.x = _local2.x;
sm1.y = _local2.y;
_local2 = new Point(player.car.car.fr_mc.x, (player.car.car.fr_mc.y + 30));
_local2 = player.car.car.localToGlobal(_local2);
_local2 = globalToLocal(_local2);
sm2 = Main.afm.createMovieClip("ui", "firesmoke");
sm2.x = _local2.x;
sm2.y = _local2.y;
addChild(sm1);
addChild(sm2);
sm1.scaleX = (sm1.scaleY = (sm2.scaleX = (sm2.scaleY = 1.3)));
this.vx = (-6 + (Math.random() * 12));
this.alpha = 0.2;
}
private function onEnterFrame(_arg1:Event):void{
this.y = (this.y + 6);
this.x = (this.x + vx);
vx = (vx * 0.9);
sm1.scaleX = (sm1.scaleY = (sm2.scaleX = (sm2.scaleY = (sm2.scaleY + 0.2))));
this.alpha = (this.alpha - 0.01);
if (count++ == 30){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
parent.removeChild(this);
};
}
}
}//package com.kerb.modnation.racer
Section 341
//TrackProp (com.kerb.modnation.racer.TrackProp)
package com.kerb.modnation.racer {
public class TrackProp {
public static function oil(_arg1:String):Number{
switch (_arg1){
case "oilslick":
return (1.2);
case "oilspill":
return (-1.5);
default:
return (1);
};
}
public static function boost(_arg1:String):Number{
switch (_arg1){
case "boostside3":
return (80);
case "boostup2":
return (90);
case "boostside4":
return (100.5);
case "water":
return (0.1);
default:
return (1);
};
}
}
}//package com.kerb.modnation.racer
Section 342
//ModnationFacebookSocialApp (com.kerb.modnation.social.ModnationFacebookSocialApp)
package com.kerb.modnation.social {
import com.kerb.utils.*;
import com.kerb.social.*;
public class ModnationFacebookSocialApp implements ISocialApp {
public function buildMessage(_arg1:Object):String{
if (_arg1.hasOwnProperty("invite")){
return (buildInviteURL(_arg1.userIDs));
};
return (TextManager.getInstance().getTextById("facebook.wall.post"));
}
public function buildAttachment(_arg1:Object):Object{
var _local2:String = _arg1.trackName;
var _local3:String = _arg1.by;
var _local4:String = _arg1.url;
var _local5:String = _arg1.imgURL;
trace(_local2, _local3, _local4, _local5);
var _local6:TextManager = TextManager.getInstance();
var _local7:Object = {name:((((_local2 + " ") + _local6.getTextById("facebook.wall.by")) + " ") + _local3), href:_local4, caption:("{*actor*} " + _local6.getTextById("facebook.wall.post.2")), description:((_local6.getTextById("facebook.wall.post.3") + " ") + _local3), media:[{type:"image", src:_local5, href:_local4}]};
trace(_local7.toString());
return (_local7);
}
private function buildInviteURL(_arg1:String):String{
var _local2:TextManager = TextManager.getInstance();
var _local3:String = ((Constants.FACEBOOK_APP_URL + "invite?exclude_ids=") + _arg1);
_local3 = (_local3 + ("&msg1=" + _local2.getTextById("facebook.challenge.invite.1")));
_local3 = (_local3 + ("&msg2=" + _local2.getTextById("facebook.challenge.invite.2")));
_local3 = (_local3 + ("&challengeID=" + Constants.challengeId));
_local3 = (_local3 + ("&butmsg=" + _local2.getTextById("facebook.challenge.invite.button")));
return (_local3);
}
}
}//package com.kerb.modnation.social
Section 343
//ModnationOpenSocialApp (com.kerb.modnation.social.ModnationOpenSocialApp)
package com.kerb.modnation.social {
import com.kerb.social.*;
public class ModnationOpenSocialApp implements ISocialApp {
public function buildMessage(_arg1:Object):String{
return (null);
}
public function buildAttachment(_arg1:Object):Object{
return (null);
}
}
}//package com.kerb.modnation.social
Section 344
//ModnationSeededSocialApp (com.kerb.modnation.social.ModnationSeededSocialApp)
package com.kerb.modnation.social {
import com.kerb.social.*;
public class ModnationSeededSocialApp implements ISocialApp {
public function buildMessage(_arg1:Object):String{
return (null);
}
public function buildAttachment(_arg1:Object):Object{
return (null);
}
}
}//package com.kerb.modnation.social
Section 345
//ModnationSeededSocialManager (com.kerb.modnation.social.ModnationSeededSocialManager)
package com.kerb.modnation.social {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.social.*;
import com.kerb.modnation.*;
import com.kerb.modnation.profile.*;
public class ModnationSeededSocialManager extends AbstractSocialManager implements ISocialManager {
public function ModnationSeededSocialManager(_arg1:LoaderInfo){
super(_arg1);
}
override public function init():void{
super.init();
var _local1:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local1.overlay = new PopupOverlay("seeded_popup");
Main.STAGE.dispatchEvent(_local1);
Main.STAGE.addEventListener(UI.EVENT_HIDE_OVERLAY, onPopupClose);
}
override public function getUserById(_arg1:String):ISocialUser{
Main.um.isLogged = false;
return (new ModnationSeededSocialUser());
}
override public function get uidPrefix():String{
return ("SEED_");
}
private function onPopupClose(_arg1:Event):void{
Main.STAGE.removeEventListener(UI.EVENT_HIDE_OVERLAY, onPopupClose);
allComplete();
Main.um.isLogged = false;
if ((((((((Main.sm.screen is ScreenSelectTrackFriends)) || ((Main.sm.screen is ScreenSelectTrackMy)))) || ((Main.sm.screen is ScreenProfileChallenges)))) || ((Main.sm.screen is ScreenProfileResults)))){
Main.sm.showScreen(new ScreenTitle());
};
}
}
}//package com.kerb.modnation.social
Section 346
//ModnationSeededSocialUser (com.kerb.modnation.social.ModnationSeededSocialUser)
package com.kerb.modnation.social {
import com.kerb.social.*;
import com.kerb.modnation.*;
public class ModnationSeededSocialUser implements ISocialUser {
public function get uid():String{
Main.um.isLogged = false;
return ("");
}
public function get isAppUser():Boolean{
Main.um.isLogged = false;
return (false);
}
public function get picUrl():String{
Main.um.isLogged = false;
return (null);
}
public function get email():String{
Main.um.isLogged = false;
return (null);
}
public function get username():String{
Main.um.isLogged = false;
return ("");
}
}
}//package com.kerb.modnation.social
Section 347
//ModnationSocialManagerFactory (com.kerb.modnation.social.ModnationSocialManagerFactory)
package com.kerb.modnation.social {
import flash.display.*;
import com.kerb.social.*;
import com.kerb.modnation.*;
public class ModnationSocialManagerFactory {
public static function SelectSMFromLoaderInfo(_arg1:LoaderInfo):ISocialManager{
var _local2:ISocialManager = SocialManagerFactory.SelectSMFromLoaderInfo(_arg1);
switch (Constants.KERB_SOCIAL_ID){
case Constants.KERB_SOCIAL_FACEBOOK_APP:
Tracking.track(Tracking.GAME_LOADED_FACEBOOK_APP);
_local2.app = new ModnationFacebookSocialApp();
break;
case Constants.KERB_SOCIAL_LOCAL_TEST:
Tracking.track(Tracking.GAME_LOADED_KERB_SOCIAL_LOCAL_TEST);
_local2.app = new ModnationFacebookSocialApp();
break;
case Constants.KERB_SOCIAL_FACEBOOK_CONNECT:
Tracking.track(Tracking.GAME_LOADED_SONY_SITE_FB_CONNECT);
_local2.app = new ModnationFacebookSocialApp();
break;
case Constants.KERB_SOCIAL_VZ:
Tracking.track(Tracking.GAME_LOADED_STUDIVZ);
case Constants.KERB_SOCIAL_NETLOG:
Tracking.track(Tracking.GAME_LOADED_NETLOG);
case Constants.KERB_SOCIAL_HYVES:
Tracking.track(Tracking.GAME_LOADED_HYVES);
_local2.app = new ModnationOpenSocialApp();
break;
default:
Tracking.track(Tracking.GAME_LOADED_SEEDED_VERSION);
_local2 = new ModnationSeededSocialManager(_arg1);
_local2.app = new ModnationSeededSocialApp();
break;
};
trace(("Constants.KERB_SOCIAL_ID:" + Constants.KERB_SOCIAL_ID));
return (_local2);
}
}
}//package com.kerb.modnation.social
Section 348
//AbstractRenderer (com.kerb.modnation.tracks.renderers.AbstractRenderer)
package com.kerb.modnation.tracks.renderers {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.*;
public class AbstractRenderer extends EventDispatcher {
public static const trackColorHex:Array = [0, 0x5E5E5E, 0x5E5E5E, 8219728, 0x5E5E5E];
public function AbstractRenderer(_arg1:IEventDispatcher=null){
super(_arg1);
}
public function getTrackSlice(_arg1:Number):MovieClip{
var _local2:MovieClip = Main.afm.createMovieClip("ui", "trackPiece");
var _local3:ColorTransform = new ColorTransform();
_local3.color = trackColorHex[Main.um.currentTrack.trackDetails.environment];
_local2.transform.colorTransform = _local3;
_local2.rotation = _arg1;
return (_local2);
}
protected function onRenderComplete():void{
dispatchEvent(new Event(Event.COMPLETE));
}
public function render(_arg1:TrackData):void{
}
}
}//package com.kerb.modnation.tracks.renderers
Section 349
//BuilderRenderer (com.kerb.modnation.tracks.renderers.BuilderRenderer)
package com.kerb.modnation.tracks.renderers {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.*;
public class BuilderRenderer extends AbstractRenderer {
protected var _bm:BitmapData;
protected var _sp:Sprite;
public function BuilderRenderer(_arg1:IEventDispatcher=null){
super(_arg1);
}
public function set bitmapData(_arg1:BitmapData):void{
_bm = _arg1;
}
override public function render(_arg1:TrackData):void{
var _local2:Object;
_bm = new BitmapData(Constants.MAX_BITMAP_SIZE, Constants.MAX_BITMAP_SIZE, true, 0);
for each (_local2 in _arg1.track) {
renderSlice(_local2.x, _local2.y, _local2.r);
};
}
public function get bitmapData():BitmapData{
return (_bm);
}
public function renderSlice(_arg1:Number, _arg2:Number, _arg3:Number):void{
_sp = new Sprite();
var _local4:MovieClip = getTrackSlice(Math.round((_arg3 * 57.2957795)));
_local4.x = Math.round(_arg1);
_local4.y = Math.round(_arg2);
_local4.scaleY = ((Main.um.currentTrack.trackDetails.environment == Constants.ENVIRO_DESERT)) ? Constants.DESERT_WIDTH : 1;
_sp.addChild(_local4);
_bm.draw(_sp);
_sp.removeChild(_local4);
}
}
}//package com.kerb.modnation.tracks.renderers
Section 350
//RacerRenderer (com.kerb.modnation.tracks.renderers.RacerRenderer)
package com.kerb.modnation.tracks.renderers {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.builder.*;
import com.kerb.modnation.*;
public class RacerRenderer extends AbstractRenderer {
private var _currentZone:Number;// = 0
private var _startRenderIndex:Number;
private var _sliceRenders:Array;
private var _sliceColor:Number;// = 0
private var slice:Number;// = 1
private var _trackData:TrackData;
protected var _map:BitmapData;
private var _isRendered:Boolean;
private var trackmc:MovieClip;
private var _mapItems:BitmapData;
private var _endRenderIndex:Number;
private var _tickTimer:Timer;
public var startrot:Number;
private var _map3:BitmapData;
private var _mapRenders:Array;
private var bd:Bitmap;
private var _startRenderTime:Number;
public var startx:Number;
public var starty:Number;
private var _mapSegments:BitmapData;
public var _zonesToSlices:Array;
private var m:Matrix;
protected var _bm:BitmapData;
private var startmc:MovieClip;
private var mapmc:MovieClip;
private static const THUMBNAIL_WIDTH:int = 100;
public static const bgBlockColorHex:Array = [0, 0x387800, 13150778, 0x264400, 14140799];
private static const THUMBNAIL_HEIGHT:int = 100;
public static const bgColorHex:Array = [0, 4753417, 14203466, 3560458, 15193487];
private static var _slices:Array;
public static var cacheTrack:Boolean = false;
private static var _startgridslices:Array;
public static var cacheProps:Boolean = false;
private static var _track_mc_width:Number;
private static var _currentSlicesEnviroment:Number = 0;
private static var _mapslices:Array;
public function set bitmapData(_arg1:BitmapData):void{
_bm = _arg1;
}
private function _createBitmaps():void{
if (!cacheTrack){
_bm = new BitmapData(Constants.MAX_BITMAP_SIZE, Constants.MAX_BITMAP_SIZE, false, bgColorHex[_trackData.trackDetails.environment]);
_map = new BitmapData(Constants.MAX_BITMAP_SIZE, Constants.MAX_BITMAP_SIZE, true, 0xFFFFFF);
_mapItems = new BitmapData(Constants.MAX_BITMAP_SIZE, Constants.MAX_BITMAP_SIZE, false, 0);
_mapSegments = new BitmapData(Constants.MAX_BITMAP_SIZE, Constants.MAX_BITMAP_SIZE, false, 0xFFFFFF);
};
}
public function get numZonesOnTrack():Number{
return ((_zonesToSlices.length - 1));
}
public function get bitmapData():BitmapData{
return (_bm);
}
override public function render(_arg1:TrackData):void{
var _local2:Number;
_isRendered = false;
if (!cacheTrack){
_zonesToSlices = [];
_currentZone = 0;
_trackData = _arg1;
_startRenderTime = getTimer();
_local2 = 0;
bd = new Bitmap(new BitmapData(3, 220));
bd.y = -110;
bd.x = 0;
createSlices();
slice = 0;
_createBitmaps();
_sliceRenders = [];
_mapRenders = [];
_startRenderIndex = 0;
_tickTimer = new Timer(1);
_tickTimer.addEventListener(TimerEvent.TIMER, _onTick);
_tickTimer.start();
} else {
_renderProps();
onRenderComplete();
};
}
private function _renderBitmaps():void{
var _local2:Sprite;
var _local3:Sprite;
var _local4:ColorTransform;
_zonesToSlices[_currentZone] = _endRenderIndex;
_currentZone++;
var _local1:int;
while (_local1 < _sliceRenders.length) {
_local2 = _sliceRenders[_local1];
_local3 = _mapRenders[_local1];
_map.draw(_local3);
_bm.draw(_local2);
_local4 = new ColorTransform();
_local4.color = _endRenderIndex;
_mapSegments.draw(_local3, null, _local4);
_local1++;
};
_sliceRenders = [];
_mapRenders = [];
}
private function createSlices():void{
var _local1:Bitmap;
mapmc = Main.afm.createMovieClip("ui", "trackPieceGrad");
startmc = Main.afm.createMovieClip("props", "startgrid");
trackmc = Main.afm.createMovieClip("props", "trackSlices1");
if (_currentSlicesEnviroment != _trackData.trackDetails.environment){
trace(("creating slices for enviroment:" + _trackData.trackDetails.environment));
_currentSlicesEnviroment = _trackData.trackDetails.environment;
trackmc = Main.afm.createMovieClip("props", ("trackSlices" + _currentSlicesEnviroment));
_track_mc_width = trackmc.width;
_slices = [];
_mapslices = [];
_startgridslices = [];
m = new Matrix(1, 0, 0, 1, -(slice), 0);
slice = 0;
while (slice < trackmc.width) {
m.tx = -(slice);
_local1 = new Bitmap(new BitmapData(3, 220));
_local1.y = -110;
_local1.x = 0;
_local1.bitmapData.draw(trackmc, m);
_slices[slice] = _local1;
slice++;
};
slice = 0;
while (slice < trackmc.width) {
_local1 = new Bitmap(new BitmapData(3, 220));
_local1.y = -110;
_local1.x = 0;
_local1.bitmapData.draw(mapmc);
_mapslices[slice] = _local1;
slice++;
};
};
}
private function _onTick(_arg1:TimerEvent):void{
var _local5:Object;
var _local6:Sprite;
var _local7:Sprite;
var _local8:Array;
var _local2:Sprite = new Sprite();
var _local3:Sprite = new Sprite();
_sliceRenders.push(_local2);
_mapRenders.push(_local3);
_endRenderIndex = Math.min((_startRenderIndex + 100), (_trackData.track.length - 1));
var _local4:int = _startRenderIndex;
while (_local4 <= _endRenderIndex) {
_local5 = _trackData.track[_local4];
if (slice == (_track_mc_width - 4)){
_renderBitmaps();
_local2 = new Sprite();
_local3 = new Sprite();
_sliceRenders.push(_local2);
_mapRenders.push(_local3);
slice = 0;
} else {
slice++;
};
_local6 = new Sprite();
_local6.visible = true;
_local2.addChild(_local6);
_local6.addChild(_slices[slice]);
_local7 = new Sprite();
_local7.visible = true;
_local3.addChild(_local7);
_local8 = _mapslices;
_local7.addChild(_mapslices[slice]);
_sliceColor++;
_local6.x = _local5.x;
_local6.y = _local5.y;
_local6.rotation = (_local5.r * 57.2957795);
_local6.scaleY = ((_currentSlicesEnviroment == Constants.ENVIRO_DESERT)) ? Constants.DESERT_WIDTH : 1;
_local7.x = _local5.x;
_local7.y = _local5.y;
_local7.rotation = (_local5.r * 57.2957795);
_local7.scaleY = ((_currentSlicesEnviroment == Constants.ENVIRO_DESERT)) ? Constants.DESERT_WIDTH : 1;
_local4++;
};
if (_endRenderIndex >= (_trackData.track.length - 1)){
_tickTimer.stop();
_tickTimer.removeEventListener(TimerEvent.TIMER, _onTick);
_renderBitmaps();
_renderProps();
onRenderComplete();
} else {
_startRenderIndex = _endRenderIndex;
};
}
public function getTrackMapSlice(_arg1:Number):MovieClip{
var _local2:MovieClip = Main.afm.createMovieClip("ui", "trackPieceGrad");
_local2.rotation = _arg1;
return (_local2);
}
override protected function onRenderComplete():void{
_isRendered = true;
cacheTrack = false;
cacheProps = false;
super.onRenderComplete();
}
private function _renderProps():void{
var _local1:Matrix;
var _local2:int;
var _local3:Sprite;
var _local4:Object;
var _local5:Prop;
var _local6:Sprite;
var _local7:ColorTransform;
var _local8:Bitmap;
var _local9:Rectangle;
if (!cacheProps){
_local1 = new Matrix();
_local2 = 0;
while (_local2 < _trackData.props.length) {
_local4 = (_trackData.props[_local2] as Object);
_local5 = new Prop(_local4.id);
_local6 = new Sprite();
_local6.addChild(_local5);
_local1 = new Matrix();
_local1.translate((_local4.x + Game.MAX_SIZE_D_2), (_local4.y + Game.MAX_SIZE_D_2));
_local5.rotation = _local4.r;
_local5.x = (_local4.x + Game.MAX_SIZE_D_2);
_local5.y = (_local4.y + Game.MAX_SIZE_D_2);
_bm.draw(_local6);
_local7 = new ColorTransform();
_local7.color = (_local2 + 1);
_local8 = new Bitmap(new BitmapData(_local5.width, _local5.height, false, _local2));
_local9 = _local5.getBounds(_local5);
_local1.translate(_local9.x, _local9.y);
_mapItems.draw(_local8, _local1, _local7);
_local2++;
};
startmc = Main.afm.createMovieClip("props", "startgrid");
startmc.scaleY = (startmc.scaleX = ((_currentSlicesEnviroment == Constants.ENVIRO_DESERT)) ? 1.4 : 1);
startmc.x = _trackData.track[0].x;
startmc.y = _trackData.track[0].y;
startmc.rotation = (_trackData.track[0].r * 57.2957795);
_local3 = new Sprite();
_local3.addChild(startmc);
_bm.draw(_local3);
};
trace(((_sliceColor + "slices render time:") + (getTimer() - _startRenderTime).toString()));
}
public function nextSliceValueForZoneByIndex(_arg1:Number):Number{
return (((_arg1)==numZonesOnTrack) ? _zonesToSlices[0] : _zonesToSlices[(_arg1 + 1)]);
}
public function get itemsBitmapData():BitmapData{
return (_mapItems);
}
public function get thumbnail():BitmapData{
if (_bm == null){
trace("_bm is null, can't generate thumbnail");
return (new BitmapData(0, 0));
};
var _local1:BitmapData = new BitmapData(THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, true, 0);
var _local2:Matrix = new Matrix();
_local2.scale((THUMBNAIL_WIDTH / _bm.width), (THUMBNAIL_HEIGHT / _bm.height));
_local1.draw(_bm, _local2);
return (_local1);
}
public function get mapBitmapData():BitmapData{
return (_map);
}
public function get slicesBitmapData():BitmapData{
return (_mapSegments);
}
override public function getTrackSlice(_arg1:Number):MovieClip{
m.tx = -(slice);
var _local2:MovieClip = new MovieClip();
_local2.addChild(bd);
_local2.rotation = _arg1;
return (_local2);
}
public function get isRendered():Boolean{
return (_isRendered);
}
}
}//package com.kerb.modnation.tracks.renderers
Section 351
//TrackData (com.kerb.modnation.tracks.TrackData)
package com.kerb.modnation.tracks {
import flash.events.*;
import flash.utils.*;
import com.kerb.modnation.domain.*;
import com.kerb.modnation.*;
import mx.utils.*;
public class TrackData extends EventDispatcher {
public var track:Array;
public var props:Array;
private var _byteArray:ByteArray;
public var trackDetails:TrackDetails;
public function TrackData(){
track = [];
props = [];
_byteArray = new ByteArray();
super();
}
public function serialize():String{
var _local1:Object;
var _local2:Base64Encoder;
trace("serialize track");
_byteArray = new ByteArray();
_byteArray.writeObject(props);
for each (_local1 in track) {
_byteArray.writeInt(int(_local1.x));
_byteArray.writeInt(int(_local1.y));
_byteArray.writeFloat(_local1.r);
};
_byteArray.compress();
_local2 = new Base64Encoder();
_local2.encodeBytes(_byteArray);
return (_local2.toString());
}
public function get startRot():Number{
return (track[0].r);
}
public function push(_arg1):void{
_arg1.x = int(_arg1.x);
_arg1.y = int(_arg1.y);
track.push(_arg1);
}
public function addProp(_arg1):void{
props.push(_arg1);
}
public function get startX():Number{
return (track[0].x);
}
public function get startY():Number{
return (track[0].y);
}
public function deserialize(_arg1:String):void{
var s = _arg1;
trace("deserialize track");
var dec:Base64Decoder = new Base64Decoder();
dec.decode(s);
var b:ByteArray = dec.toByteArray();
b.uncompress();
props = (b.readObject() as Array);
while (b.bytesAvailable) {
try {
push({x:b.readInt(), y:b.readInt(), r:b.readFloat()});
} catch(e:Error) {
trace("track Error");
Main.sm.showScreen(new ScreenIntroduction());
};
};
}
}
}//package com.kerb.modnation.tracks
Section 352
//Background (com.kerb.modnation.UI.Background)
package com.kerb.modnation.UI {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.gskinner.motion.*;
import com.kerb.modnation.*;
public class Background extends Sprite {
private var _bg:MovieClip;
private var count:Number;// = 0
public static const EVENT_CHANGE_BG:String = "EVENT_CHANGE_BG";
public function Background(){
this.addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onAdded(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, onAdded);
stage.addEventListener(Background.EVENT_CHANGE_BG, _onBGChange);
_bg = Main.afm.createMovieClip("gui", "backgrounds_mc");
this.addChild(_bg);
var _local2:DynamicEvent = new DynamicEvent(Background.EVENT_CHANGE_BG);
_local2.enviroment = 1;
stage.dispatchEvent(_local2);
}
public function _onBGChange(_arg1:DynamicEvent):void{
var _local2:Number = Number(_arg1.enviroment);
var _local3:MovieClip = _bg[(("bg_" + _local2) + "_mc")];
_bg.bg_1_mc.visible = false;
_bg.bg_2_mc.visible = false;
_bg.bg_3_mc.visible = false;
_bg.bg_4_mc.visible = false;
_local3.alpha = 0;
_local3.visible = true;
new GTween(_local3, 0.6, {alpha:1});
}
}
}//package com.kerb.modnation.UI
Section 353
//CTABadge (com.kerb.modnation.UI.CTABadge)
package com.kerb.modnation.UI {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class CTABadge extends DynamicButton {
public function CTABadge(_arg1:MovieClip){
super(_arg1, "CTA.sticker");
this.mcRef.addEventListener(MouseEvent.CLICK, onClickNav);
}
private function onClickNav(_arg1:MouseEvent):void{
Tracking.track(Tracking.FIND_OUT_MORE);
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Main.sm.showScreen(new ScreenAbout());
}
override public function initText(_arg1:String=null):void{
up["tagline_txt"].text = (down["tagline_txt"].text = (over["tagline_txt"].text = ((((TextManager.getInstance().getTextById("CTA.sticker.esrb") == "")) || ((TextManager.getInstance().getTextById("CTA.sticker.esrb") == " ")))) ? "" : TextManager.getInstance().getTextById("CTA.sticker.esrb")));
super.initText(_arg1);
}
override public function dispose():void{
this.mcRef.removeEventListener(MouseEvent.CLICK, onClickNav);
super.dispose();
}
}
}//package com.kerb.modnation.UI
Section 354
//ErrorOverlay (com.kerb.modnation.UI.ErrorOverlay)
package com.kerb.modnation.UI {
import flash.events.*;
import flash.display.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ErrorOverlay extends Sprite {
private var _error:String;
private var _report:DynamicButton;
private var _rules:DynamicButton;
private var _cancel:DynamicButton;
private var _reportURL:String;
public function ErrorOverlay(_arg1:String, _arg2:String){
_error = _arg2;
_reportURL = _arg1;
this.addEventListener(Event.ADDED_TO_STAGE, _onAdded);
}
private function _onAdded(_arg1:Event):void{
var _local2:MovieClip = (this.addChild(Main.afm.createMovieClip("error", "error")) as MovieClip);
this.addEventListener(MouseEvent.CLICK, _onCancel, false, 0, true);
}
private function _onCancel(_arg1:MouseEvent):void{
this.removeEventListener(MouseEvent.CLICK, _onCancel);
Main.sm.showScreen(new ScreenTitle());
dispatchEvent(new Event(UI.EVENT_HIDE_ERROR, true));
}
}
}//package com.kerb.modnation.UI
Section 355
//FacebookOverlay (com.kerb.modnation.UI.FacebookOverlay)
package com.kerb.modnation.UI {
import flash.events.*;
import com.kerb.utils.*;
import com.kerb.modnation.*;
import com.kerb.social.facebook.*;
public class FacebookOverlay extends PopupOverlay {
private var trip:Boolean;// = true
override protected function _but2Click(_arg1:MouseEvent):void{
if (trip){
TextManager.getInstance().setTextField(mc.panel_mc.copy_txt, "facebooklogin.closenow.copy");
(Main.fbm as FacebookLocalTestManager).continueLogin();
} else {
(Main.fbm as FacebookLocalTestManager).validateLogin();
super._but2Click(_arg1);
};
trip = !(trip);
}
}
}//package com.kerb.modnation.UI
Section 356
//LoadingOverlay (com.kerb.modnation.UI.LoadingOverlay)
package com.kerb.modnation.UI {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.*;
public class LoadingOverlay extends Sprite {
private var _mc:DisplayObject;
public function LoadingOverlay(){
this.addEventListener(Event.ADDED_TO_STAGE, _onAdded);
}
private function _onAdded(_arg1:Event):void{
_mc = this.addChild(Main.afm.createMovieClip("loading", "loading"));
mouseChildren = false;
}
public function set text(_arg1:String):void{
if (_mc != null){
_mc["info_txt"].text = _arg1;
};
}
}
}//package com.kerb.modnation.UI
Section 357
//PopupOverlay (com.kerb.modnation.UI.PopupOverlay)
package com.kerb.modnation.UI {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import com.gskinner.motion.*;
import flash.net.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
import com.kerb.modnation.profile.*;
public class PopupOverlay extends Sprite implements IDisposable {
protected var _but2Btn:DynamicButton;
private var _useContent:String;
private var _paramsObj:Object;
protected var mc:MovieClip;
protected var _toggle1Btn:DynamicToggleButton;
protected var _but1Btn:DynamicButton;
private var _butx:DynamicButton;
protected var _toggle2Btn:DynamicToggleButton;
public function PopupOverlay(_arg1:String=null){
var _local2:MovieClip;
super();
_useContent = _arg1;
mc = (this.addChild(Main.afm.createMovieClip("gui", "popup_orange_NEXT_CLOSE_mc")) as MovieClip);
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
if (_arg1 != null){
mc.panel_mc.btnClose.visible = false;
mc.panel_mc.btnPrev.visible = false;
_local2 = (this.addChild(Main.afm.createMovieClip("pops", _arg1)) as MovieClip);
mc.panel_mc.addChild(_local2);
mc.panel_mc = _local2;
};
this.addEventListener(Event.ADDED_TO_STAGE, _onAdded);
}
private function _launchFacebookVersion(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(Constants.GAME_URL), "_blank");
}
protected function onKeyUp(_arg1:KeyboardEvent):void{
Main.STAGE.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
_onExit(null);
}
protected function _deleteAccount(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_paramsObj["flag"] = true;
_onExit(_arg1);
}
protected function _verifykey(_arg1:MouseEvent):void{
if (mc.panel_mc.copy_txt.text == "m0db3t423"){
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_onExit(_arg1);
};
}
protected function _toggle1Click(_arg1:MouseEvent):void{
_toggle1Btn.selected = !(_toggle1Btn.selected);
}
protected function _onExit(_arg1:MouseEvent):void{
mc.play();
}
protected function _onComplete(_arg1:Event):void{
dispatchEvent(new DynamicParamsEvent(UI.EVENT_HIDE_OVERLAY, true, _paramsObj));
_paramsObj = {};
}
protected function _but1Click(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_onExit(_arg1);
}
public function dispose():void{
if (_but1Btn != null){
_but1Btn.dispose();
ButtonSupport.unsetupButton(_but1Btn);
};
if (_but2Btn != null){
_but2Btn.dispose();
ButtonSupport.unsetupButton(_but2Btn, _but2Click);
};
if (_toggle1Btn != null){
_toggle1Btn.dispose();
ButtonSupport.unsetupButton(_toggle1Btn);
};
if (_toggle2Btn != null){
_toggle2Btn.dispose();
ButtonSupport.unsetupButton(_toggle2Btn);
};
Main.STAGE.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
protected function _toggle2Click(_arg1:MouseEvent):void{
_toggle2Btn.selected = !(_toggle2Btn.selected);
}
protected function _onInit(_arg1:Event):void{
var _local2:MovieClip;
var _local3:AchievementsManager;
var _local4:TextManager;
var _local5:UserManager;
var _local6:String;
var _local7:Trophy;
mc.removeEventListener(Event.INIT, _onInit);
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_paramsObj = {};
switch (_useContent){
case "trophy":
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "new.trophy.btn");
_but1Btn = new DynamicButton(mc.panel_mc.btnClose, "tabs.trophies");
_but2Btn = new DynamicButton(mc.panel_mc.btnLogin, "track.details.report.close.btn");
_local2 = mc.panel_mc.item_1;
_local2.alpha = 0;
new GTween(_local2, 1, {alpha:1}, {delay:0.5});
_local3 = AchievementsManager.instance();
_local4 = TextManager.getInstance();
_local5 = UserManager.instance();
_local4.setTextField(_local2.copy_txt, ("trophy.desc" + _local3.lastID));
_local6 = _local3.getAchievementID(Number(_local3.lastID));
_local7 = new Trophy(_local6);
if (_local2.holder_mc.numChildren != 0){
_local2.holder_mc.removeChildAt(0);
};
_local2.holder_mc.addChild(_local7);
ButtonSupport.setupButton(_but1Btn, _myTrophies);
ButtonSupport.setupButton(_but2Btn, _but1Click);
break;
case "report_track":
_but1Btn = new DynamicButton(mc.panel_mc.btnClose, "track.details.report.close.btn");
_but2Btn = new DynamicButton(mc.panel_mc.btnReport, "track.details.report.report.btn");
_toggle1Btn = new DynamicToggleButton(mc.panel_mc.tickLayout_btn);
_toggle1Btn.toggleable = true;
_toggle2Btn = new DynamicToggleButton(mc.panel_mc.tickName_btn);
_toggle2Btn.toggleable = true;
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "track.details.report.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy_txt, "track.details.report.copy");
TextManager.getInstance().setTextField(mc.panel_mc.copyLayout_txt, "track.details.report.layoutToggle");
TextManager.getInstance().setTextField(mc.panel_mc.copyName_txt, "track.details.report.nameToggle");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _reportTrack);
ButtonSupport.setupButton(_toggle1Btn, _toggle1Click);
ButtonSupport.setupButton(_toggle2Btn, _toggle2Click);
break;
case "seeded_popup":
_but1Btn = new DynamicButton(mc.panel_mc.btnClose, "profile.delete.close.btn");
_but2Btn = new DynamicButton(mc.panel_mc.btnLogin, "next.btn");
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "play.full.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy_txt, "play.full.copy");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _launchFacebookVersion);
break;
case "delete_profile":
_but1Btn = new DynamicButton(mc.panel_mc.btnClose, "profile.delete.close.btn");
_but2Btn = new DynamicButton(mc.panel_mc.btnDelete, "profile.delete.delete.btn");
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "profile.delete.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy_txt, "profile.delete.copy");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _deleteAccount);
break;
case "beta_key":
_but2Btn = new DynamicButton(mc.panel_mc.btnClose, "continue.btn");
ButtonSupport.setupButton(_but1Btn, _verifykey);
ButtonSupport.setupButton(_but2Btn, _verifykey);
Main.STAGE.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
break;
case "Instructions_1_select_theme":
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "help.create.theme.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy_txt, "help.create.theme");
_but2Btn = new DynamicButton(mc.panel_mc.btnClose, "continue.btn");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _but2Click);
break;
case "Instructions_2_create_track":
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "help.create.laytrack.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy1_txt, "help.create.laytrack.1");
TextManager.getInstance().setTextField(mc.panel_mc.copy2_txt, "help.create.laytrack.2");
TextManager.getInstance().setTextField(mc.panel_mc.copy3_txt, "help.create.laytrack.3");
TextManager.getInstance().setTextField(mc.panel_mc.copy4_txt, "help.create.laytrack.4");
TextManager.getInstance().setTextField(mc.panel_mc.copy5_txt, "help.create.laytrack.5");
_but2Btn = new DynamicButton(mc.panel_mc.btnClose, "continue.btn");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _but2Click);
break;
case "Instructions_3_obstacles":
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "help.create.obstacles.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy1_txt, "help.create.obstacles.1");
TextManager.getInstance().setTextField(mc.panel_mc.copy2_txt, "help.create.obstacles.2");
_but2Btn = new DynamicButton(mc.panel_mc.btnClose, "continue.btn");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _but2Click);
break;
case "Instructions_4_decorate":
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "help.create.layprops.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy1_txt, "help.create.layprops.1");
TextManager.getInstance().setTextField(mc.panel_mc.copy2_txt, "help.create.layprops.2");
_but2Btn = new DynamicButton(mc.panel_mc.btnClose, "continue.btn");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _but2Click);
break;
case "Instructions_5_controls":
TextManager.getInstance().setTextField(mc.panel_mc.title_txt, "help.race.title");
TextManager.getInstance().setTextField(mc.panel_mc.copy1_txt, "help.race.accelerate");
TextManager.getInstance().setTextField(mc.panel_mc.copy2_txt, "help.race.left");
TextManager.getInstance().setTextField(mc.panel_mc.copy3_txt, "help.race.right");
TextManager.getInstance().setTextField(mc.panel_mc.copy4_txt, "help.race.brake");
TextManager.getInstance().setTextField(mc.panel_mc.copy5_txt, "help.race.boost");
_but2Btn = new DynamicButton(mc.panel_mc.btnClose, "race.btn");
ButtonSupport.setupButton(_but2Btn, _but2Click);
break;
default:
_but1Btn = new DynamicButton(mc.panel_mc.btnPrev, "continue.btn");
_but2Btn = new DynamicButton(mc.panel_mc.btnClose, "continue.btn");
ButtonSupport.setupButton(_but1Btn, _but1Click);
ButtonSupport.setupButton(_but2Btn, _but2Click);
break;
};
}
protected function _onAdded(_arg1:Event):void{
Main.STAGE.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
protected function _but2Click(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_onExit(_arg1);
}
protected function _myTrophies(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_onExit(_arg1);
Main.sm.showScreen(new ScreenProfileTrophies());
}
protected function _reportTrack(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_paramsObj["flag"] = true;
_paramsObj["trackLayout"] = _toggle1Btn.selected;
_paramsObj["trackName"] = _toggle2Btn.selected;
_onExit(_arg1);
}
}
}//package com.kerb.modnation.UI
Section 358
//ReportButton (com.kerb.modnation.UI.ReportButton)
package com.kerb.modnation.UI {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ReportButton extends DynamicButton {
public function ReportButton(_arg1:MovieClip){
super(_arg1);
this.mcRef.addEventListener(MouseEvent.CLICK, onReportClicked);
}
protected function onReportClicked(_arg1:MouseEvent):void{
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local2.overlay = new PopupOverlay("report_track");
Main.STAGE.dispatchEvent(_local2);
Main.STAGE.addEventListener(UI.EVENT_HIDE_OVERLAY, onReportClose);
}
private function onReportClose(_arg1:DynamicParamsEvent):void{
var _local2:String;
Main.STAGE.removeEventListener(UI.EVENT_HIDE_OVERLAY, onReportClose);
if (_arg1.flag){
_local2 = "";
if (_arg1.trackLayout){
_local2 = (_local2 + TextManager.getInstance().getTextById("track.details.report.layoutToggle"));
if (_arg1.trackName){
_local2 = (_local2 + ", ");
};
};
if (_arg1.trackName){
_local2 = (_local2 + TextManager.getInstance().getTextById("track.details.report.nameToggle"));
};
Main.rdm.reportTrack(UserManager.instance().currentUserId, UserManager.instance().currentTrackDetails.id, _local2);
};
}
override public function dispose():void{
this.mcRef.removeEventListener(MouseEvent.CLICK, onReportClicked);
super.dispose();
}
}
}//package com.kerb.modnation.UI
Section 359
//ScrollingFacebookArea (com.kerb.modnation.UI.ScrollingFacebookArea)
package com.kerb.modnation.UI {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.social.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
import com.kerb.facebook.*;
public class ScrollingFacebookArea extends EventDispatcher implements IDisposable {
protected const item_height:Number = 44;
public var buttons:Array;
private var _scrollBar:Scrollbar;
private var mc:MovieClip;
private var _results:Array;
public function ScrollingFacebookArea(_arg1:MovieClip, _arg2:Array){
buttons = [];
super();
mc = _arg1;
_results = _arg2;
paint();
}
protected function setup_scrollbars():void{
_scrollBar = new Scrollbar();
_scrollBar.addEventListener(Event.ADDED_TO_STAGE, _onScrollAdded);
mc.addChild(_scrollBar);
}
protected function paint_item(_arg1:MovieClip, _arg2:Number, _arg3:String):void{
var _local4:Number;
var _local5:Number;
_arg1.y = (item_height * Math.floor((_arg2 / 6)));
_arg1.x = (item_height * (_arg2 % 6));
trace(_arg2, _arg1.x, _arg1.y);
var _local6:FacebookDynamicButton = new FacebookDynamicButton(_arg1, _arg3);
_local6.addEventListener(MouseEvent.CLICK, _onFBClick);
buttons.push(_local6);
}
private function _onScrollAdded(_arg1:Event):void{
_scrollBar.removeEventListener(Event.ADDED_TO_STAGE, _onScrollAdded);
_scrollBar.init(mc.content_mc, mc.mask_mc, mc.scroll_up_btn, mc.scroll_down_btn, mc.handle_mc, mc.track_mc);
}
private function _onFBClick(_arg1:MouseEvent):void{
var _local2:FacebookDynamicButton = (_arg1.currentTarget as FacebookDynamicButton);
_local2.selected = !(_local2.selected);
}
public function paint():void{
var _local2:MovieClip;
var _local3:ISocialUser;
var _local1:int;
while (_local1 < _results.length) {
_local2 = Main.afm.createMovieClip("gui", "Large_with_avatar_mc");
_local3 = (_results[_local1] as ISocialUser);
if (_local3.uid != Main.fbm.uid){
paint_item(_local2, _local1, _local3.uid);
mc.content_mc.addChild(_local2);
};
_local1++;
};
setup_scrollbars();
}
public function dispose():void{
var _local1:FacebookDynamicButton;
while (buttons.length != 0) {
_local1 = (buttons.pop as FacebookDynamicButton);
_local1.dispose();
};
buttons = [];
_scrollBar.dispose();
}
}
}//package com.kerb.modnation.UI
Section 360
//ScrollingResultsArea (com.kerb.modnation.UI.ScrollingResultsArea)
package com.kerb.modnation.UI {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
public class ScrollingResultsArea extends EventDispatcher implements IDisposable {
protected const item_height:Number = 19;
private var _playerAdded:Boolean;// = false
private var _scrollBar:Scrollbar;
private var _player_name:String;
private var mc:MovieClip;
private var _results:Array;
private var _player_locale:String;
private var _player_time:Number;
public function ScrollingResultsArea(_arg1:MovieClip, _arg2:Array, _arg3:Number, _arg4:String, _arg5:String){
mc = _arg1;
_results = _arg2;
_player_time = _arg3;
_player_name = _arg4;
_player_locale = _arg5;
paint();
}
protected function paint_item(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String, _arg6:String, _arg7:Boolean=false):void{
_arg1.y = (item_height * _arg2);
_arg1.my_score_mc.visible = _arg7;
_arg1.position_txt.text = (_arg3 + 1).toString();
_arg1.flag_mc.gotoAndStop(_arg6);
_arg1.player_txt.text = _arg5;
_arg1.time_txt.text = RaceTimer.formatTime(_arg4);
}
protected function setup_scrollbars():void{
_scrollBar = new Scrollbar();
_scrollBar.useEasing = true;
_scrollBar.addEventListener(Event.ADDED_TO_STAGE, _onScrollAdded);
mc.addChild(_scrollBar);
}
private function _onScrollAdded(_arg1:Event):void{
_scrollBar.removeEventListener(Event.ADDED_TO_STAGE, _onScrollAdded);
_scrollBar.init(mc.content_mc, mc.mask_mc, mc.scroll_up_btn, mc.scroll_down_btn, mc.handle_mc, mc.track_mc);
}
public function paint():void{
var _local2:MovieClip;
var _local3:TimeDetails;
var _local1:int;
while (_local1 < _results.length) {
_local2 = Main.afm.createMovieClip("gui", "results_times_holder");
_local3 = _results[_local1];
paint_item(_local2, (_playerAdded) ? (_local1 + 1) : _local1, (_playerAdded) ? (_local3.rank + 1) : _local1, _local3.time, ((_local3.userName == " ")) ? TextManager.getInstance().getTextById("noname.player") : _local3.userName, _local3.userLocale);
mc.content_mc.addChild(_local2);
_local1++;
};
setup_scrollbars();
}
public function dispose():void{
while (mc.content_mc.numChildren != 0) {
mc.content_mc.removeChildAt(0);
};
_scrollBar.dispose();
}
}
}//package com.kerb.modnation.UI
Section 361
//ShareWidget (com.kerb.modnation.UI.ShareWidget)
package com.kerb.modnation.UI {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import com.kerb.ui.*;
public class ShareWidget extends EventDispatcher {
private var _link:String;
private var _open_btn:DynamicButton;
private var _inTransition:Boolean;
private var _open:Boolean;
private var _title:String;
private var _mc:MovieClip;
public function ShareWidget(_arg1:MovieClip, _arg2:String, _arg3:String){
_mc = _arg1;
_link = _arg2;
_title = _arg3;
_open = false;
_inTransition = false;
_open_btn = new DynamicButton(_mc.share_btn);
ButtonSupport.setupButton(_open_btn, _onShareButtonOpenClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.close_btn, _onShareButtonClosedClicked);
}
private function _onShareButtonOpenClicked(_arg1:Event=null):void{
open();
}
private function onShareOnSocialNetworkClicked(_arg1:Event):void{
var _local2:String = String(_arg1.currentTarget.name);
_local2 = _local2.substr(0, (_local2.length - 4));
genericShare(_local2);
}
private function onSharePopupClosed(_arg1:Event=null):void{
_mc.sharepopup_mc.removeEventListener(Event.COMPLETE, onSharePopupClosed);
_inTransition = false;
_open = false;
}
private function onSelectAll(_arg1:Event=null):void{
if (_mc.stage != null){
_mc.stage.focus = _mc.sharepopup_mc.widget_txt;
};
_mc.sharepopup_mc.widget_txt.setSelection(0, _mc.sharepopup_mc.widget_txt.text.length);
}
private function genericShare(_arg1:String):void{
var _local2:String;
var _local3:String = encodeURIComponent(_title);
var _local4:String = encodeURIComponent(_link);
switch (_arg1){
case "mail":
_local2 = ((("mailto:?subject=" + _local3) + "&body=") + _local4);
break;
case "facebook":
_local2 = ((("http://www.facebook.com/sharer.php?u=" + _local4) + "&t=") + _local3);
break;
case "twitter":
_local2 = ((("http://twitter.com/home?status=" + _title) + " - ") + _link);
break;
case "myspace":
_local2 = ((("http://www.myspace.com/Modules/PostTo/Pages/?l=3&u=" + _link) + "&t=") + _title);
break;
case "bebo":
_local2 = ((("http://www.bebo.com/c/share?Url=" + _local4) + "&Title=") + _local3);
break;
case "reddit":
_local2 = ((("http://reddit.com/submit?url=" + _local4) + "&title=") + _local3);
break;
case "stumbleupon":
_local2 = ((("http://www.stumbleupon.com/submit?url=" + _link) + "&title=") + _local3);
break;
case "digg":
_local2 = ((("http://digg.com/submit?phase=2&url=" + _local4) + "&title=") + _local3);
break;
case "delicious":
_local2 = ((("http://delicious.com/save?url=" + _local4) + "&title=") + _local3);
break;
case "technorati":
_local2 = ("http://www.technorati.com/faves?add=" + _link);
break;
case "friendfeed":
_local2 = ((("http://friendfeed.com/share?url=" + _local4) + "&title=") + _local3);
break;
case "linkedin":
_local2 = (((("http://www.linkedin.com/shareArticle?mini=true&url=" + _local4) + "&title=") + _local3) + "&summary=&source=");
break;
case "live":
_local2 = (((("https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=" + _local4) + "&title=") + _local3) + "&top=1");
break;
case "google":
_local2 = ((("http://www.google.com/bookmarks/mark?op=edit&bkmk=" + _local4) + "&title=") + _local3);
break;
case "yahoo":
_local2 = ((("http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u=" + _local4) + "&t=") + _local3);
break;
case "aol":
_local2 = ((("http://connect.aim.com/share/?url=" + _local4) + "&title=") + _local3);
break;
};
if (_local2 != null){
navigateToURL(new URLRequest(_local2), "_blank");
} else {
trace(("unknown social network " + _arg1));
};
}
private function _onShareButtonClosedClicked(_arg1:Event=null):void{
close();
}
public function set title(_arg1:String):void{
_title = _arg1;
}
public function open():void{
if (((_open) || (_inTransition))){
return;
};
dispatchEvent(new Event(Event.OPEN));
_inTransition = true;
_mc.sharepopup_mc.addEventListener(Event.COMPLETE, onSharePopupOpened);
_mc.sharepopup_mc.gotoAndPlay("open");
}
public function close(_arg1:Boolean=false):void{
if (((!(_arg1)) && (((!(_open)) || (_inTransition))))){
return;
};
dispatchEvent(new Event(Event.CLOSE));
ButtonSupport.unsetupButton(_mc.sharepopup_mc.selectall_btn, onSelectAll);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.mail_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.facebook_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.twitter_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.myspace_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.bebo_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.reddit_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.stumbleupon_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.digg_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.delicious_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.technorati_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.friendfeed_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.linkedin_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.live_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.google_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.yahoo_btn, onShareOnSocialNetworkClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.aol_btn, onShareOnSocialNetworkClicked);
_inTransition = true;
_mc.sharepopup_mc.addEventListener(Event.COMPLETE, onSharePopupClosed);
_mc.sharepopup_mc.gotoAndPlay("close");
}
public function set link(_arg1:String):void{
_link = _arg1;
if (_mc.sharepopup_mc.widget_txt != null){
_mc.sharepopup_mc.widget_txt.text = _link;
};
}
private function onSharePopupOpened(_arg1:Event=null):void{
_mc.sharepopup_mc.removeEventListener(Event.COMPLETE, onSharePopupOpened);
_inTransition = false;
_open = true;
_mc.sharepopup_mc.widget_txt.text = _link;
ButtonSupport.setupButton(_mc.sharepopup_mc.selectall_btn, onSelectAll);
ButtonSupport.setupButton(_mc.sharepopup_mc.mail_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.facebook_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.twitter_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.myspace_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.bebo_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.reddit_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.stumbleupon_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.digg_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.delicious_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.technorati_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.friendfeed_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.linkedin_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.live_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.google_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.yahoo_btn, onShareOnSocialNetworkClicked);
ButtonSupport.setupButton(_mc.sharepopup_mc.aol_btn, onShareOnSocialNetworkClicked);
}
public function dispose():void{
ButtonSupport.unsetupButton(_open_btn, _onShareButtonOpenClicked);
ButtonSupport.unsetupButton(_mc.sharepopup_mc.close_btn, _onShareButtonClosedClicked);
_open_btn.dispose();
}
}
}//package com.kerb.modnation.UI
Section 362
//UI (com.kerb.modnation.UI.UI)
package com.kerb.modnation.UI {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.builder.*;
import com.kerb.ui.*;
import com.kerb.modnation.*;
import com.kerb.modnation.profile.*;
public class UI extends Sprite {
private var _share_widget:ShareWidget;
private var _loading:LoadingOverlay;
private var _profile_btn:DynamicButton;
private var _error:ErrorOverlay;
private var _overlay:IDisposable;
private var _login_btn:DynamicButton;
private var _video_btn:DynamicButton;
private var _new_challenge_btn:ToolTipDynamicButton;
private var _psp_btn:DynamicButton;
private var _gallery_btn:DynamicButton;
private var _about_btn:DynamicButton;
private var _mc:MovieClip;
private var _modnation_vis:Boolean;// = true
private var _langSelectButton:DynamicButton;
private var _startCreating:DynamicButton;
private var _soundControl_btn:SoundControl;
public var showLoadingText:Boolean;// = false
private var _exploreTracksButton:DynamicButton;
private var _home_btn:DynamicButton;
private var _modnation_btn:DynamicButton;
private var _new_trophy_btn:ToolTipDynamicButton;
private var _frame:MovieClip;
private var _quickRaceButton:DynamicButton;
private var tl:TrackLoader;
private var _loaderCount:Number;// = 0
public static const EVENT_HIDE_LOADING:String = "EVENT_HIDE_LOADING";
public static const EVENT_SHOW_ERROR:String = "EVENT_SHOW_ERROR";
public static const EVENT_HIDE_LOGIN:String = "EVENT_HIDE_LOGIN";
public static const EVENT_SHOW_OVERLAY:String = "EVENT_SHOW_OVERLAY";
public static const EVENT_HIDE_ERROR:String = "EVENT_HIDE_ERROR";
public static const EVENT_HIDE_OVERLAY:String = "EVENT_HIDE_OVERLAY";
public static const EVENT_CHANGE_LOCALE:String = "EVENT_CHANGE_LOCALE";
public static const EVENT_SHOW_LOADING:String = "EVENT_SHOW_LOADING";
public function UI(){
this.addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function _onQuickRace(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
tl = new TrackLoader();
tl.loadRandomTrack();
tl.addEventListener(Event.COMPLETE, _onTrackLoaderComplete);
}
private function _onChalleng(_arg1:MouseEvent):void{
Tracking.track(Tracking.NEW_CHALLENGE_ICON);
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Main.sm.showScreen(new ScreenProfileChallenges());
}
private function _onHideError(_arg1:Event):void{
if (_error != null){
this.removeChild(_error);
};
stage.tabChildren = true;
_error = null;
}
public function get shareWidget():ShareWidget{
return (_share_widget);
}
private function _onLogin(_arg1:MouseEvent):void{
Main.um.login();
}
private function _onHome(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Constants.ROUTE = Constants.ROUTE_COLD;
Main.sm.showScreen(new ScreenTitle());
}
private function _onCreate(_arg1:MouseEvent):void{
Main.sm.showScreen(new ScreenBuilderEnviromentChooser());
}
private function _onLangRollOver(_arg1:Event):void{
_mc.lang_select_btn.scaleX = (_mc.lang_select_btn.scaleY = 1);
}
private function _onShowLoading(_arg1:Event):void{
_loaderCount++;
trace(("_loaderCount:" + _loaderCount));
if (_loading == null){
_loading = (this.addChild(new LoadingOverlay()) as LoadingOverlay);
stage.tabChildren = false;
trace("added loader");
};
if (showLoadingText){
_loading.text = TextManager.getInstance().getTextById("loading.title");
};
}
private function _onVideo(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
Main.sm.showScreen(new ScreenVideo());
}
private function _checkAchievementsComplete(_arg1:RemoteDataManagerEvent):void{
var _local3:DynamicEvent;
var _local2:Array = _arg1.achievements;
Main.am.setUnlockedItems(_local2);
if (_local2.length > 0){
_local3 = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local3.overlay = new PopupOverlay("trophy");
_onShowOverlay(_local3);
_new_trophy_btn.selected = (Main.um.currentUserId == 0);
};
}
private function _checkAchievementsCompleteBasic(_arg1:RemoteDataManagerEvent):void{
var _local2:Array = _arg1.achievements;
Main.am.setUnlockedItems(_local2);
}
private function _onShowError(_arg1:DynamicEvent):void{
_onHideLoading(null);
stage.tabChildren = false;
if (_error != null){
this.removeChild(_error);
};
_error = (this.addChild(new ErrorOverlay(_arg1.url, _arg1.error)) as ErrorOverlay);
}
private function _onLangSelect(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Constants.ROUTE = Constants.ROUTE_COLD;
Tracking.track(Tracking.COUNTRY_SELECT_BTN);
Main.sm.showScreen(new ScreenLanguageSelect());
}
private function _onAbout(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Main.sm.showScreen(new ScreenAbout());
}
private function _onTrackLoaderComplete(_arg1:Event):void{
tl.removeEventListener(Event.COMPLETE, _onTrackLoaderComplete);
Main.sm.showScreen(new ScreenSting());
}
private function _onHideLoading(_arg1:Event):void{
_loaderCount--;
if (_loaderCount < 0){
_loaderCount = 0;
};
trace(("_loaderCount:" + _loaderCount));
if (_loaderCount == 0){
trace("removing loader");
if (_loading != null){
this.removeChild(_loading);
};
_loading = null;
stage.tabChildren = true;
};
showLoadingText = false;
if (_loading != null){
_loading.text = "";
};
}
private function _sound_off(_arg1:MouseEvent):void{
Main.muteSound();
}
private function _onChangeLocale(_arg1:Event):void{
_mc.lang_select_btn.up.gotoAndStop(Constants.LOCALE);
Main.rdm.getCompetitionDetails(Main.um.currentUserId, Constants.LOCALE);
if (_modnation_btn != null){
_modnation_btn.initText("home.btn");
_gallery_btn.initText("gallery.btn");
_about_btn.initText("about.btn");
_video_btn.initText("video.btn");
_quickRaceButton.initText("quickrace.btn");
_exploreTracksButton.initText("play.btn");
_startCreating.initText("create.btn");
_new_trophy_btn.initText("new.trophy.btn");
_new_challenge_btn.initText("new.challenge.btn");
};
}
private function _onProfile(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Main.sm.showScreen(new ScreenProfileResults());
}
private function _checkAchievements(_arg1:RemoteDataManagerEvent):void{
if (Main.um.currentUserId != 0){
Main.rdm.getUnreadAchievements(Main.um.currentUserId);
};
}
private function _onHideOverlay(_arg1:Event):void{
if (_overlay != null){
this.removeChild((_overlay as DisplayObject));
_overlay.dispose();
};
stage.tabChildren = true;
_overlay = null;
}
public function set trophyBtnSelected(_arg1:Boolean):void{
_new_trophy_btn.selected = _arg1;
}
private function _onExplore(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
Main.sm.showScreen(new ScreenSelectTrack());
}
private function _checkCOMPETITION_DETAILS(_arg1:RemoteDataManagerEvent):void{
var _local2:ChallengeDetails = _arg1.challenge;
Main.um.currentCompetitionDetails = _local2;
if (_new_challenge_btn != null){
_new_challenge_btn.selected = false;
};
if (Main.um.currentUserId != 0){
Main.rdm.getAchievements(Main.um.currentUserId);
};
}
private function _help_on(_arg1:MouseEvent):void{
}
private function onAdded(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, onAdded);
_mc = Main.afm.createMovieClip("gui", "UI_global_nav");
_mc.addEventListener(Event.INIT, _onTimelineinit);
_frame = Main.afm.createMovieClip("gui", "frame_mc");
this.addChild(_frame);
this.addChild(_mc);
stage.addEventListener(EVENT_SHOW_LOADING, _onShowLoading);
stage.addEventListener(EVENT_HIDE_LOADING, _onHideLoading);
stage.addEventListener(EVENT_SHOW_OVERLAY, _onShowOverlay);
stage.addEventListener(EVENT_HIDE_OVERLAY, _onHideOverlay);
stage.addEventListener(EVENT_SHOW_ERROR, _onShowError);
stage.addEventListener(EVENT_HIDE_ERROR, _onHideError);
stage.addEventListener(EVENT_HIDE_LOGIN, _onHideLogin);
stage.addEventListener(EVENT_CHANGE_LOCALE, _onChangeLocale);
var _local2:RemoteDataManager = RemoteDataManager.instance();
_local2.addEventListener(RemoteDataManager.GET_ACHIEVEMENTS, _checkAchievementsCompleteBasic);
_local2.addEventListener(RemoteDataManager.GET_UNREAD_ACHIEVEMENTS, _checkAchievementsComplete);
_local2.addEventListener(RemoteDataManager.GET_COMPETITION_DETAILS, _checkCOMPETITION_DETAILS);
_local2.addEventListener(RemoteDataManager.SAVE_TRACK, _checkAchievements);
_local2.addEventListener(RemoteDataManager.RATE_TRACK, _checkAchievements);
_local2.addEventListener(RemoteDataManager.SAVE_TIME, _checkAchievements);
_local2.addEventListener(RemoteDataManager.INVITE_TO_CHALLENGE, _checkAchievements);
}
private function _onTrophy(_arg1:MouseEvent):void{
Tracking.track(Tracking.NEW_TROPHIES_ICON);
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
Main.sm.showScreen(new ScreenProfileTrophies());
}
public function set challengeBtnSelected(_arg1:Boolean):void{
_new_challenge_btn.selected = _arg1;
}
private function _onHideLogin(_arg1:Event):void{
}
private function _onLangRollOut(_arg1:Event):void{
_mc.lang_select_btn.scaleX = (_mc.lang_select_btn.scaleY = 0.8);
}
private function _onTimelineinit(_arg1:Event):void{
_mc.removeEventListener(Event.INIT, _onTimelineinit);
_modnation_btn = new DynamicButton(_mc.modnation_btn, "home.btn");
_modnation_btn.visible = _modnation_vis;
_gallery_btn = new DynamicButton(_mc.gallery_btn, "gallery.btn");
_about_btn = new DynamicButton(_mc.about_btn, "about.btn");
_video_btn = new DynamicButton(_mc.video_btn, "video.btn");
_quickRaceButton = new DynamicButton(_mc.race_btn, "quickrace.btn");
_exploreTracksButton = new DynamicButton(_mc.tracks_btn, "play.btn");
_startCreating = new DynamicButton(_mc.create_btn, "create.btn");
_new_trophy_btn = new ToolTipDynamicButton(_mc.new_trophy_btn, "new.trophy.btn");
_new_challenge_btn = new ToolTipDynamicButton(_mc.new_challenge_btn, "new.challenge.btn");
_share_widget = new ShareWidget(_mc.share_mc, ((Constants.GAME_URL + Constants.LOCALE.toLowerCase()) + "/minigame/index.htm"), "ModNation Racers");
ButtonSupport.setupButton(_new_trophy_btn, _onTrophy);
ButtonSupport.setupButton(_quickRaceButton, _onQuickRace);
ButtonSupport.setupButton(_startCreating, _onCreate);
ButtonSupport.setupButton(_exploreTracksButton, _onExplore);
ButtonSupport.setupButton(_new_challenge_btn, _onChalleng);
ButtonSupport.setupButton(_gallery_btn, _onGallery);
ButtonSupport.setupButton(_video_btn, _onVideo);
ButtonSupport.setupButton(_modnation_btn, _onHome);
_new_trophy_btn.selected = true;
_new_challenge_btn.selected = true;
_about_btn.addEventListener(MouseEvent.CLICK, _onAbout);
_soundControl_btn = new SoundControl(_mc.soundControl_btn, Main.smSFX, Main.smMusic);
_onChangeLocale(null);
ButtonSupport.setupButton(_mc.lang_select_btn, _onLangSelect, _onLangRollOver, _onLangRollOut);
}
private function _onChangeVis(_arg1:DynamicEvent):void{
_modnation_vis = _arg1.visible;
if (_modnation_btn != null){
_modnation_btn.visible = _modnation_vis;
};
}
private function _onGallery(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
Main.sm.showScreen(new ScreenGallery());
}
private function _sound_on(_arg1:MouseEvent):void{
Main.unmuteSound();
}
private function _onShowOverlay(_arg1:DynamicEvent):void{
_onHideOverlay(null);
_overlay = _arg1.overlay;
stage.tabChildren = false;
this.addChild((_overlay as DisplayObject));
}
}
}//package com.kerb.modnation.UI
Section 363
//Main (com.kerb.modnation.Main)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.logger.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.social.*;
import com.kerb.game.screencontrol.*;
import flash.media.*;
import com.kerb.sound.*;
import flash.net.*;
import com.gskinner.motion.plugins.*;
import com.kerb.modnation.social.*;
public class Main extends Sprite {
private var PROPSSWFBytes:Class;
private var GUISWFBytes:Class;
private var LOADINGSWFBytes:Class;
private var CARSSWFBytes:Class;
private var ErrorSWFBytes:Class;
private var _section:Sprite;
private var POPSSWFBytes:Class;
private var SOUNDSSWFBytes:Class;
private var PROFILESWFBytes:Class;
private var UISWFBytes:Class;
public static const SFX_NAME_START_GO:String = "hud_race_GO";
public static const SFX_NAME_REVS:String = "KartEngine_01";
public static const SFX_NAME_CREATE_IDLE:String = "ts_track_engine_idle_01";
public static const SFX_NAME_BOOSTING:String = "ai_SuperBoostLoop1";
public static const SFX_NAMEts_fd_zoom_in:String = "hud_camera_zoom_in";
public static const SFX_NAME_GUI_TRANSITION:String = "hud_creation_station_nav";
public static const SFX_NAMEhud_race_lapCall_3:String = "hud_race_lapCall_3";
public static const SFX_NAME_GUI_BACK:String = "hud_circle_menu_back";
public static const SFX_NAME_CREATE_ON:String = "ts_track_create_loop_01";
public static const MUSIC_1:String = "MainTune1";
public static const MUSIC_2:String = "MainTune2";
public static const SFX_NAME_REPLACE:String = "OffTrack";
public static const MUSIC_NAME:String = "background_music";
public static const SFX_NAME_LIGHTS_START_COUNTDOWN:String = "hud_race_321";
public static const SFX_NAME_ENGINE:String = "KartEngine_04";
public static const smSFX:SoundManager = new SoundManager();
public static const SFX_NAME_SKIDDING:String = "chirp_01";
public static const SFX_NAMEts_delete:String = "ts_delete";
public static const SFX_NAMEts_fd_zoom_out:String = "hud_camera_zoom_out";
public static const SFX_NAME_BOOST:String = "Kart_boostStop2b";
public static const smMusic:SoundManager = new SoundManager();
public static const afm:AssetFactoryManager = new AssetFactoryManager();
public static const SFX_NAME_OFF_ROAD:String = "dirt_gravel_01";
public static const SFX_NAME_GUI_AUTOPLACE:String = "hud_cs_acc_apply_01";
public static const SFX_NAME_GUI_SELECT:String = "hud_circle_menu_select";
public static const SFX_NAME_GUI_SELECT_CAR:String = "hud_kart_select_in_01";
public static var text_fr_BE:Class = Main_text_fr_BE;
public static var text_sv_SE:Class = Main_text_sv_SE;
public static var text_fr_CA:Class = Main_text_fr_CA;
public static var text_de_AT:Class = Main_text_de_AT;
public static var text_en_CA:Class = Main_text_en_CA;
public static var am:AchievementsManager;
public static var text_it_IT:Class = Main_text_it_IT;
public static var fbm:AbstractSocialManager;
public static var text_fi_FI:Class = Main_text_fi_FI;
public static var text_fr_CH:Class = Main_text_fr_CH;
public static var text_ru_RU:Class = Main_text_ru_RU;
public static var text_es_MX:Class = Main_text_es_MX;
public static var text_es_ES:Class = Main_text_es_ES;
public static var musicName:String;
public static var text_de_CH:Class = Main_text_de_CH;
public static var text_nl_NL:Class = Main_text_nl_NL;
public static var text_fr_LU:Class = Main_text_fr_LU;
public static var sm:ScreenManager;
public static var text_en_US:Class = Main_text_en_US;
private static var soundFXName:String = "";
public static var text_it_CH:Class = Main_text_it_CH;
public static var text_de_DE:Class = Main_text_de_DE;
public static var isLocal:Boolean;
public static var text_no_NO:Class = Main_text_no_NO;
public static var text_de_LU:Class = Main_text_de_LU;
public static var rdm:RemoteDataManager;
public static var text_fr_FR:Class = Main_text_fr_FR;
public static var text_en_NZ:Class = Main_text_en_NZ;
public static var um:UserManager;
public static var text_pl_PL:Class = Main_text_pl_PL;
public static var text_en_GB:Class = Main_text_en_GB;
public static var ui:UI;
public static var text_pt_PT:Class = Main_text_pt_PT;
public static var unlocks:Class = Main_unlocks;
public static var text_nl_BE:Class = Main_text_nl_BE;
public static var text_pt_BR:Class = Main_text_pt_BR;
public static var STAGE:Stage;
public static var text_en_IE:Class = Main_text_en_IE;
public static var text_da_DK:Class = Main_text_da_DK;
public static var text_en_AU:Class = Main_text_en_AU;
public function Main(){
UISWFBytes = Main_UISWFBytes;
ErrorSWFBytes = Main_ErrorSWFBytes;
GUISWFBytes = Main_GUISWFBytes;
PROFILESWFBytes = Main_PROFILESWFBytes;
LOADINGSWFBytes = Main_LOADINGSWFBytes;
PROPSSWFBytes = Main_PROPSSWFBytes;
CARSSWFBytes = Main_CARSSWFBytes;
POPSSWFBytes = Main_POPSSWFBytes;
SOUNDSSWFBytes = Main_SOUNDSSWFBytes;
super();
addEventListener(Event.ADDED_TO_STAGE, _addedToStage);
}
private function _addedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _addedToStage);
ColorTransformPlugin.install();
MotionBlurPlugin.install();
BlurPlugin.install();
ColorAdjustPlugin.install();
STAGE = stage;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
isLocal = (stage.loaderInfo.url.slice(0, 5) == "file:");
KerbLog.instance().stage = stage;
KerbLog.instance().level = KerbLogLevel.None;
KerbLog.instance().info("Welcome to Modnation.");
afm.addEventListener(Event.COMPLETE, _assetFactoryManagerReady);
afm.addAssetFactory("ui", UISWFBytes);
afm.addAssetFactory("gui", GUISWFBytes);
afm.addAssetFactory("profile", PROFILESWFBytes);
afm.addAssetFactory("props", PROPSSWFBytes);
afm.addAssetFactory("cars", CARSSWFBytes);
afm.addAssetFactory("error", ErrorSWFBytes);
afm.addAssetFactory("loading", LOADINGSWFBytes);
afm.addAssetFactory("pops", POPSSWFBytes);
afm.addAssetFactory("sound", SOUNDSSWFBytes);
um = UserManager.instance();
Tracking._initTracking(root);
fbm = (ModnationSocialManagerFactory.SelectSMFromLoaderInfo(stage.loaderInfo) as AbstractSocialManager);
rdm = RemoteDataManager.instance();
am = AchievementsManager.instance();
rdm.addEventListener(RemoteDataManager.EVENT_STARTED_LOADING, _onLoadingStarted);
rdm.addEventListener(RemoteDataManager.EVENT_FINISHED_LOADING, _onLoadingFinished);
rdm.addEventListener(RemoteDataManager.EVENT_LOADING_ERROR, _onLoadingError);
}
private function _onLoadingStarted(_arg1:Event):void{
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_LOADING, true);
stage.dispatchEvent(_local2);
}
private function _initUI():void{
ui = new UI();
addChild(ui);
}
private function _initStageEvents():void{
}
private function _onLoadingError(_arg1:Event):void{
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_ERROR, true);
_local2.error = "Server Error";
stage.dispatchEvent(_local2);
}
private function determineFirstAndPostIntroScreen():void{
if (stage.loaderInfo.parameters.hasOwnProperty("trackId")){
Constants.trackId = Number(stage.loaderInfo.parameters["trackId"]);
Constants.ROUTE = Constants.ROUTE_TRACK;
} else {
if (stage.loaderInfo.parameters.hasOwnProperty("challengeId")){
Constants.challengeId = Number(stage.loaderInfo.parameters["challengeId"]);
Constants.ROUTE = Constants.ROUTE_CHALLENGE;
_loadChallenge();
} else {
Constants.ROUTE = Constants.ROUTE_COLD;
};
};
var _local1:SharedObject = SharedObject.getLocal(Constants.APP_NAME);
if (((((_local1.data.hasOwnProperty("facebookuser")) && (!(um.isLogged)))) && (!((Main.fbm.uidPrefix == "SEED_"))))){
um.login();
};
if (stage.loaderInfo.parameters.hasOwnProperty("locale")){
Constants.LOCALE = stage.loaderInfo.parameters.locale;
initText();
sm.showScreen(new ScreenIntroduction());
} else {
if (_local1.data.hasOwnProperty("locale")){
Constants.LOCALE = _local1.data.locale;
initText();
sm.showScreen(new ScreenIntroduction());
} else {
sm.showScreen(new ScreenLanguageSelect());
initText();
};
};
if ((((((((((Constants.LOCALE == "fr_CA")) || ((Constants.LOCALE == "en_CA")))) || ((Constants.LOCALE == "es_MX")))) || ((Constants.LOCALE == "pt_BR")))) || ((Constants.LOCALE == "en_US")))){
Constants.VIDEO_BASE_URL = Constants.VIDEO_BASE_US_URL;
} else {
Constants.VIDEO_BASE_URL = Constants.VIDEO_BASE_DEFAULT_URL;
};
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local2.overlay = new PopupOverlay("beta_key");
}
private function _loadChallenge():void{
Main.rdm.addEventListener(RemoteDataManager.GET_CHALLENGE_DETAILS, _onLoadChallenge);
Main.rdm.getChallengeDetails(um.currentUserId, Constants.challengeId);
}
private function _assetFactoryManagerReady(_arg1:Event):void{
afm.removeEventListener(Event.COMPLETE, _assetFactoryManagerReady);
_init();
}
private function _onLoadingFinished(_arg1:Event):void{
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_HIDE_LOADING, true);
stage.dispatchEvent(_local2);
}
protected function initSounds():void{
smSFX.registerSound(afm.createSound("sound", SFX_NAME_BOOSTING));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_REVS));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_SKIDDING));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_ENGINE));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_LIGHTS_START_COUNTDOWN));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_START_GO));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_GUI_SELECT));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_GUI_SELECT_CAR));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_GUI_BACK));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_GUI_TRANSITION));
smSFX.registerSound(afm.createSound("sound", SFX_NAMEhud_race_lapCall_3));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_BOOST));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_OFF_ROAD));
smSFX.registerSound(afm.createSound("sound", SFX_NAMEts_delete));
smSFX.registerSound(afm.createSound("sound", SFX_NAMEts_fd_zoom_in));
smSFX.registerSound(afm.createSound("sound", SFX_NAMEts_fd_zoom_out));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_CREATE_IDLE));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_CREATE_ON));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_GUI_AUTOPLACE));
smSFX.registerSound(afm.createSound("sound", SFX_NAME_REPLACE));
smMusic.registerSound(afm.createSound("sound", MUSIC_1));
smMusic.registerSound(afm.createSound("sound", MUSIC_2));
Main.playMusic(MUSIC_1);
}
private function _init():void{
_initStageEvents();
initText();
initSounds();
sm = new ScreenManager(new AbstractScreen());
this.addChild(new Background());
this.addChild(sm);
_initUI();
determineFirstAndPostIntroScreen();
}
private function _onLoadChallenge(_arg1:RemoteDataManagerEvent):void{
Main.rdm.removeEventListener(RemoteDataManager.GET_CHALLENGE_DETAILS, _onLoadChallenge);
var _local2:ChallengeDetails = _arg1.challenge;
if (_local2 == null){
Constants.ROUTE = Constants.ROUTE_COLD;
} else {
Constants.ROUTE = (_local2.isCompetition) ? Constants.ROUTE_COMPETITION : Constants.ROUTE_CHALLENGE;
um.currentChallengeDetails = _local2;
};
sm.showScreen(new ScreenIntroduction());
}
public static function onButtonPress():void{
smSFX.getSoundByClassName("SFXButton").play(0, 1);
}
public static function stopMusic():void{
if (musicName == null){
return;
};
Main.smMusic.getSoundByClassName(musicName).stop();
musicName = null;
}
public static function playSoundFX(_arg1:String):void{
soundFXName = _arg1;
smSFX.getSoundByClassName(_arg1).play(0, 1);
}
public static function initText():void{
var _local1:Class;
_local1 = Main[("text_" + Constants.LOCALE)];
trace(_local1);
TextManager.getInstance().initFromClass(_local1);
Main.STAGE.dispatchEvent(new Event(UI.EVENT_CHANGE_LOCALE));
}
public static function playMusic(_arg1:String):void{
stopMusic();
musicName = _arg1;
smMusic.getSoundByClassName(musicName).play(0, 99909);
}
public static function muteSound():void{
SoundMixer.soundTransform = new SoundTransform(0);
}
public static function get isSoundOn():Boolean{
return ((SoundMixer.soundTransform.volume > 0));
}
public static function unmuteSound():void{
SoundMixer.soundTransform = new SoundTransform(1);
}
}
}//package com.kerb.modnation
Section 364
//Main_CARSSWFBytes (com.kerb.modnation.Main_CARSSWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_CARSSWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 365
//Main_ErrorSWFBytes (com.kerb.modnation.Main_ErrorSWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_ErrorSWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 366
//Main_GUISWFBytes (com.kerb.modnation.Main_GUISWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_GUISWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 367
//Main_LOADINGSWFBytes (com.kerb.modnation.Main_LOADINGSWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_LOADINGSWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 368
//Main_POPSSWFBytes (com.kerb.modnation.Main_POPSSWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_POPSSWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 369
//Main_PROFILESWFBytes (com.kerb.modnation.Main_PROFILESWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_PROFILESWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 370
//Main_PROPSSWFBytes (com.kerb.modnation.Main_PROPSSWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_PROPSSWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 371
//Main_SOUNDSSWFBytes (com.kerb.modnation.Main_SOUNDSSWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_SOUNDSSWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 372
//Main_text_da_DK (com.kerb.modnation.Main_text_da_DK)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_da_DK extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 373
//Main_text_de_AT (com.kerb.modnation.Main_text_de_AT)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_de_AT extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 374
//Main_text_de_CH (com.kerb.modnation.Main_text_de_CH)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_de_CH extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 375
//Main_text_de_DE (com.kerb.modnation.Main_text_de_DE)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_de_DE extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 376
//Main_text_de_LU (com.kerb.modnation.Main_text_de_LU)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_de_LU extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 377
//Main_text_en_AU (com.kerb.modnation.Main_text_en_AU)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_en_AU extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 378
//Main_text_en_CA (com.kerb.modnation.Main_text_en_CA)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_en_CA extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 379
//Main_text_en_GB (com.kerb.modnation.Main_text_en_GB)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_en_GB extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 380
//Main_text_en_IE (com.kerb.modnation.Main_text_en_IE)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_en_IE extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 381
//Main_text_en_NZ (com.kerb.modnation.Main_text_en_NZ)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_en_NZ extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 382
//Main_text_en_US (com.kerb.modnation.Main_text_en_US)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_en_US extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 383
//Main_text_es_ES (com.kerb.modnation.Main_text_es_ES)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_es_ES extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 384
//Main_text_es_MX (com.kerb.modnation.Main_text_es_MX)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_es_MX extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 385
//Main_text_fi_FI (com.kerb.modnation.Main_text_fi_FI)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_fi_FI extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 386
//Main_text_fr_BE (com.kerb.modnation.Main_text_fr_BE)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_fr_BE extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 387
//Main_text_fr_CA (com.kerb.modnation.Main_text_fr_CA)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_fr_CA extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 388
//Main_text_fr_CH (com.kerb.modnation.Main_text_fr_CH)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_fr_CH extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 389
//Main_text_fr_FR (com.kerb.modnation.Main_text_fr_FR)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_fr_FR extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 390
//Main_text_fr_LU (com.kerb.modnation.Main_text_fr_LU)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_fr_LU extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 391
//Main_text_it_CH (com.kerb.modnation.Main_text_it_CH)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_it_CH extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 392
//Main_text_it_IT (com.kerb.modnation.Main_text_it_IT)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_it_IT extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 393
//Main_text_nl_BE (com.kerb.modnation.Main_text_nl_BE)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_nl_BE extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 394
//Main_text_nl_NL (com.kerb.modnation.Main_text_nl_NL)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_nl_NL extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 395
//Main_text_no_NO (com.kerb.modnation.Main_text_no_NO)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_no_NO extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 396
//Main_text_pl_PL (com.kerb.modnation.Main_text_pl_PL)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_pl_PL extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 397
//Main_text_pt_BR (com.kerb.modnation.Main_text_pt_BR)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_pt_BR extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 398
//Main_text_pt_PT (com.kerb.modnation.Main_text_pt_PT)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_pt_PT extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 399
//Main_text_ru_RU (com.kerb.modnation.Main_text_ru_RU)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_ru_RU extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 400
//Main_text_sv_SE (com.kerb.modnation.Main_text_sv_SE)
package com.kerb.modnation {
import mx.core.*;
public class Main_text_sv_SE extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 401
//Main_UISWFBytes (com.kerb.modnation.Main_UISWFBytes)
package com.kerb.modnation {
import mx.core.*;
public class Main_UISWFBytes extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 402
//Main_unlocks (com.kerb.modnation.Main_unlocks)
package com.kerb.modnation {
import mx.core.*;
public class Main_unlocks extends ByteArrayAsset {
}
}//package com.kerb.modnation
Section 403
//ScreenAbout (com.kerb.modnation.ScreenAbout)
package com.kerb.modnation {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.text.*;
import com.gskinner.motion.*;
import com.kerb.game.screencontrol.*;
import flash.net.*;
import br.com.stimuli.loading.*;
import com.kerb.ui.*;
public class ScreenAbout extends AbstractScreen {
private var bg:MovieClip;
private var bl:BulkLoader;
private var ticker_link:String;
private var news:XML;
private var link_btn:DynamicButton;
private var _nextScreen:AbstractScreen;
private var g:GTween;
private var ul:URLLoader;
private var ticker_txt:TextField;
private var newsIndex:int;// = 0
public function ScreenAbout(){
Tracking.track(Tracking.EXPLORE_MODNATION_BTN);
}
private function onNewsClicked(_arg1:MouseEvent):void{
if (ticker_link != null){
navigateToURL(new URLRequest(ticker_link), "_blank");
};
}
protected function _onChange(_arg1:Event):void{
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_about_gallery_mc");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
mc.addEventListener(Event.CHANGE, _onChange);
addChild(mc);
link_btn = new DynamicButton(mc.create_btn);
}
private function _onLink(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(TextManager.getInstance().getTextById("website.url")), "_blank");
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.COMPLETE, _onComplete);
mc.removeEventListener(Event.CHANGE, _onChange);
ul.removeEventListener(Event.COMPLETE, onNewsLoaded);
ButtonSupport.unsetupButton(link_btn, _onLink);
link_btn.dispose();
if (g != null){
g.paused = true;
};
g = null;
}
private function showNextNewsItem(_arg1:GTween=null):void{
ticker_txt.text = news..item[newsIndex].title;
ticker_txt.appendText(" : ");
ticker_txt.appendText(news..item[newsIndex].description);
ticker_link = news..item[newsIndex].link;
ticker_txt.x = (bg.x + bg.width);
newsIndex = ((newsIndex == (news..item.length() - 1))) ? 0 : (newsIndex + 1);
g = new GTween(ticker_txt, (ticker_txt.textWidth * 0.02), {x:(bg.x - (ticker_txt.textWidth + 16))}, {onComplete:showNextNewsItem});
}
protected function _onInit(_arg1:Event):void{
ul = new URLLoader();
ul.load(new URLRequest(((Constants.BASE_URL + "facebook/xml_proxy.php?url=") + TextManager.getInstance().getTextById("news.rss"))));
mc.about_mc.ticker_mc.visible = true;
ul.addEventListener(Event.COMPLETE, onNewsLoaded);
ticker_txt = mc.about_mc.ticker_mc.ticker_txt;
ticker_txt.autoSize = TextFieldAutoSize.RIGHT;
ticker_txt.mouseEnabled = false;
bg = mc.about_mc.ticker_mc.bg;
mc.about_mc.packshot_mc.gotoAndStop(Constants.LOCALE);
mc.about_mc.ticker_mc.buttonMode = true;
mc.about_mc.ticker_mc.addEventListener(MouseEvent.CLICK, onNewsClicked);
TextManager.getInstance().setTextField(mc.about_mc.news_txt, "about.news");
ticker_txt.text = "";
TextManager.getInstance().setTextField(mc.about_mc.title_txt, "about.title");
TextManager.getInstance().setTextField(mc.about_mc.copy_txt, "about.copy");
TextManager.getInstance().setTextField(mc.about_mc.about_mc.label_txt, "about.title");
ButtonSupport.setupButton(link_btn, _onLink);
mc.stop();
}
private function onNewsLoaded(_arg1:Event):void{
var _local2:String = ul.data;
news = new XML(_local2);
newsIndex = 0;
showNextNewsItem();
}
protected function _onComplete(_arg1:Event):void{
dispatchEvent(new ScreenEvent(_nextScreen));
}
}
}//package com.kerb.modnation
Section 404
//ScreenBuilderEnviromentChooser (com.kerb.modnation.ScreenBuilderEnviromentChooser)
package com.kerb.modnation {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.modnation.builder.*;
import com.kerb.ui.*;
public class ScreenBuilderEnviromentChooser extends AbstractScreen {
private var _am:AchievementsManager;
private var _currSelected:Number;// = 1
private var _next_btn:DynamicButton;
private var _builderBreadCrumbs:BuilderBreadCrumbs;
private var _eb2:DynamicButton;
private var _eb3:DynamicButton;
private var _eb4:DynamicButton;
private var _eb1:DynamicButton;
public function ScreenBuilderEnviromentChooser(){
Tracking.track(Tracking.START_CREATING);
}
private function _setupEnviroButton(_arg1:MovieClip):void{
_arg1.buttonMode = true;
_arg1.addEventListener(MouseEvent.CLICK, _onEnviroClick, false, 0, true);
}
private function _onChange(_arg1:Event):void{
mc.stop();
}
override protected function init():void{
var _local1:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local1.overlay = new PopupOverlay("Instructions_1_select_theme");
_local1.overlay.addEventListener(Event.REMOVED_FROM_STAGE, _onPopupClosed);
stage.dispatchEvent(_local1);
}
private function _onEnviroClick(_arg1:MouseEvent):void{
var _local2:Number = Number((_arg1.currentTarget as DynamicButton).mcRef.name.split("_")[1]);
_selectEnviroment(_local2);
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
}
private function _onComplete(_arg1:Event):void{
mc.removeEventListener(Event.COMPLETE, _onComplete);
dispatchEvent(new ScreenEvent(new ScreenBuilderLayTrack()));
}
private function _onPopupClosed(_arg1:Event):void{
_arg1.currentTarget.removeEventListener(Event.REMOVED_FROM_STAGE, _onPopupClosed);
_am = AchievementsManager.instance();
mc = Main.afm.createMovieClip("gui", "Environment");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.CHANGE, _onChange);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.CHANGE, _onChange);
mc.removeEventListener(Event.COMPLETE, _onComplete);
ButtonSupport.unsetupButton(_eb1, _onEnviroClick);
ButtonSupport.unsetupButton(_eb2, _onEnviroClick);
ButtonSupport.unsetupButton(_eb3, _onEnviroClick);
ButtonSupport.unsetupButton(_next_btn, _onClick);
}
private function _onInit(_arg1:Event):void{
mc.removeEventListener(Event.INIT, _onInit);
_eb1 = new DynamicButton(mc.content_mc.enviro_holders_mc.enviroHolder_1);
_eb2 = new DynamicButton(mc.content_mc.enviro_holders_mc.enviroHolder_2);
_eb3 = new DynamicButton(mc.content_mc.enviro_holders_mc.enviroHolder_3);
_next_btn = new DynamicButton(mc.next_btn, "next.btn");
TextManager.getInstance().setTextField(mc.content_mc.enviro_holders_mc.enviro_txt_comingSoon.label_txt, "coming.soon");
ButtonSupport.setupButton(_eb1, _onEnviroClick);
ButtonSupport.setupButton(_eb2, _onEnviroClick);
ButtonSupport.setupButton(_eb3, _onEnviroClick);
ButtonSupport.setupButton(_next_btn, _onClick);
_builderBreadCrumbs = new BuilderBreadCrumbs(mc.title_panel_mc, 1);
_selectEnviroment(1);
}
private function _onClick(_arg1:MouseEvent):void{
var _local2:TrackData = new TrackData();
_local2.trackDetails = new TrackDetails(<track></track>
);
_local2.trackDetails.environment = _currSelected;
UserManager.instance().currentTrack = _local2;
mc.play();
}
private function _selectEnviroment(_arg1:Number):void{
_currSelected = _arg1;
TextManager.getInstance().setTextField(mc.content_mc.copy_txt, ("environment.copy." + _arg1));
TextManager.getInstance().setTextField(mc.content_mc.title_txt, ("environment.title." + _arg1));
mc.content_mc.img_mc.gotoAndStop(("enviro" + _arg1));
var _local2:DynamicEvent = new DynamicEvent(Background.EVENT_CHANGE_BG);
_local2.enviroment = _arg1;
stage.dispatchEvent(_local2);
}
}
}//package com.kerb.modnation
Section 405
//ScreenBuilderEnviroProps (com.kerb.modnation.ScreenBuilderEnviroProps)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.modnation.builder.*;
import com.kerb.ui.*;
public class ScreenBuilderEnviroProps extends AbstractScreen {
private var _trackProps:Boolean;
private var _builderToolbar:BuilderToolbar;
private var _btnZoomIn:DynamicButton;
private var _trackData:TrackData;
private var _btnZoomOut:DynamicButton;
private var _propLayer:PropLayer;
private var _builderBreadCrumbs:BuilderBreadCrumbs;
private var _builderPalette:BuilderPalette;
public function ScreenBuilderEnviroProps(_arg1:Boolean=false):void{
_trackProps = _arg1;
}
private function nextPropScreen():void{
Tracking.track(Tracking.PLACE_THEME_PROPS_NEXT_STEP_BTN);
dispatchEvent(new ScreenEvent(new ScreenBuilderEnviroProps(true)));
}
private function _onRenderComplete(_arg1:Event):void{
UserManager.instance().renderer.removeEventListener(Event.COMPLETE, _onRenderComplete);
stage.dispatchEvent(new Event(UI.EVENT_HIDE_LOADING));
_propLayer.changeZoom(0.4);
}
private function _onChange(_arg1:Event):void{
_propLayer = new PropLayer();
_propLayer.addEventListener(Event.CHANGE, _onPropsChange, false, 0, true);
_propLayer.isTrackProp = _trackProps;
mc.addChildAt(_propLayer, 0);
}
override protected function init():void{
var _local1:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local1.overlay = new PopupOverlay((_trackProps) ? "Instructions_3_obstacles" : "Instructions_4_decorate");
_local1.overlay.addEventListener(Event.REMOVED_FROM_STAGE, _onPopupClosed);
stage.dispatchEvent(_local1);
}
private function _onToolBarChange(_arg1:DynamicEvent):void{
var _local2:DynamicEvent;
switch (_arg1.clickedItem){
case "btnClear":
Main.playSoundFX(Main.SFX_NAMEts_delete);
_propLayer.undo(true);
Tracking.track(Tracking.START_OVER_BTN);
break;
case "btnHelp":
_local2 = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local2.overlay = new PopupOverlay((_trackProps) ? "Instructions_3_obstacles" : "Instructions_4_decorate");
stage.dispatchEvent(_local2);
break;
case "btnUndo":
_propLayer.undo();
Main.playSoundFX(Main.SFX_NAMEts_delete);
break;
case "btnPreview":
dispatchEvent(new ScreenEvent(new ScreenBuilderRacer()));
break;
case "nextStep_btn":
_propLayer.addPropsToTrack();
if (!_trackProps){
nextPropScreen();
} else {
nextRaceScreen();
};
break;
case "btnAutocomp":
Main.playSoundFX(Main.SFX_NAME_GUI_AUTOPLACE);
_propLayer.autoAdd(_builderPalette.currentList);
break;
};
}
private function _onComplete(_arg1:Event):void{
}
private function _onPopupClosed(_arg1:Event):void{
_arg1.currentTarget.removeEventListener(Event.REMOVED_FROM_STAGE, _onPopupClosed);
stage.dispatchEvent(new Event(UI.EVENT_SHOW_LOADING));
_trackData = UserManager.instance().currentTrack;
mc = Main.afm.createMovieClip("gui", "BuilderLayPropsEnviro");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
mc.addEventListener(Event.CHANGE, _onChange);
_builderBreadCrumbs = new BuilderBreadCrumbs(mc.title_panel_mc, (_trackProps) ? 4 : 3);
_builderPalette = new BuilderPalette(mc.palette_mc, (_trackProps) ? 5 : _trackData.trackDetails.environment, 10, 60, 0);
_builderPalette.initalRender();
UserManager.instance().renderer.addEventListener(Event.COMPLETE, _onRenderComplete);
addChild(mc);
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.COMPLETE, _onComplete);
_builderToolbar.removeEventListener(Event.CHANGE, _onToolBarChange);
_builderPalette.removeEventListener(Event.CHANGE, _onPaletteChange);
ButtonSupport.unsetupButton(_btnZoomIn, _zoomOut);
ButtonSupport.unsetupButton(_btnZoomIn, _zoomIn);
_builderToolbar.dispose();
_builderPalette.dispose();
_propLayer.dispose();
}
private function _onPropsChange(_arg1:Event):void{
_builderToolbar.setBarToPercent(((_propLayer.numberOfProps / Constants.MAX_PROPS) * 100));
}
private function _onPaletteChange(_arg1:DynamicEvent):void{
_propLayer.setProp(_arg1.prop);
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
}
private function _onInit(_arg1:Event):void{
_btnZoomOut = new ToolTipDynamicButton(mc.btnZoomOut, "zoom.out.btn");
_btnZoomIn = new ToolTipDynamicButton(mc.btnZoomIn, "zoom.in.btn");
ButtonSupport.setupButton(_btnZoomOut, _zoomOut);
ButtonSupport.setupButton(_btnZoomIn, _zoomIn);
_builderToolbar = new BuilderToolbar(mc.toolbar_mc, "builder.props.remaining");
if (_trackProps){
_builderToolbar.hideBar();
_builderToolbar.hideAutoPopulate();
};
_builderToolbar.addEventListener(Event.CHANGE, _onToolBarChange, false, 0, true);
_builderPalette.addEventListener(Event.CHANGE, _onPaletteChange, false, 0, true);
}
private function nextRaceScreen():void{
Tracking.track(Tracking.PLACE_TRACK_PROPS_NEXT_STEP_BTN);
dispatchEvent(new ScreenEvent(new ScreenBuilderRacer()));
}
private function _zoomIn(_arg1:MouseEvent):void{
_propLayer.changeZoom(0.1);
Main.playSoundFX(Main.SFX_NAMEts_fd_zoom_in);
}
private function _zoomOut(_arg1:MouseEvent):void{
_propLayer.changeZoom(-0.1);
Main.playSoundFX(Main.SFX_NAMEts_fd_zoom_out);
}
}
}//package com.kerb.modnation
Section 406
//ScreenBuilderLayTrack (com.kerb.modnation.ScreenBuilderLayTrack)
package com.kerb.modnation {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.modnation.builder.*;
import com.kerb.modnation.tracks.renderers.*;
public class ScreenBuilderLayTrack extends AbstractScreen {
private var _builderBreadCrumbs:BuilderBreadCrumbs;
private var _builder:Builder;
private var _control:BuilderController;
private var _builderToolbar:BuilderToolbar;
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.CHANGE, _onChange);
_builder.dispose();
_control.dispose();
_builderToolbar.dispose();
}
private function _onBuilderChange(_arg1:Event):void{
_builderToolbar.setBarToPercent(((_builder.trackData.track.length / Constants.MAX_TRACK_LENGTH) * 100));
_builderToolbar.btnNextStep.visible = _builder.canAutoComplete;
_builderToolbar.pulseButton(_builder.canAutoComplete);
}
private function _onChange(_arg1:Event):void{
mc.stop();
_control.init();
_builder.introZoom();
}
private function _onToolBarChange(_arg1:DynamicEvent):void{
var _local2:DynamicEvent;
switch (_arg1.clickedItem){
case "btnUndo":
_builder.undo();
_builder.killAutoComplete();
break;
case "btnClear":
_builder.undo(true);
_builder.killAutoComplete();
break;
case "btnHelp":
_local2 = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local2.overlay = new PopupOverlay("Instructions_2_create_track");
stage.dispatchEvent(_local2);
break;
case "nextStep_btn":
_builder.autoComplete();
break;
};
}
override protected function init():void{
Tracking.track(Tracking.CHOOSE_THEME_NEXT_STEP_BTN);
var _local1:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local1.overlay = new PopupOverlay("Instructions_2_create_track");
_local1.overlay.addEventListener(Event.REMOVED_FROM_STAGE, _onPopupClosed);
stage.dispatchEvent(_local1);
}
private function _onInit(_arg1:Event):void{
_builderToolbar = new BuilderToolbar(mc.toolbar_mc, "builder.track.remaining");
_builderToolbar.addEventListener(Event.CHANGE, _onToolBarChange, false, 0, true);
_builderToolbar.hideAutoPopulate();
_builderToolbar.btnNextStep.visible = false;
_builder = new Builder();
_control = new BuilderController(_builder);
var _local2:Sprite = new Sprite();
_local2.graphics.beginFill(0);
_local2.graphics.drawRect(0, 0, mc.builder_mc.width, mc.builder_mc.height);
_local2.graphics.endFill();
_builder.width = mc.builder_mc.width;
_builder.height = mc.builder_mc.height;
_builder.mask = _local2;
var _local3:Sprite = new Sprite();
_local3.graphics.beginFill(RacerRenderer.bgColorHex[Main.um.currentTrack.trackDetails.environment]);
_local3.graphics.drawRect(0, 0, mc.builder_mc.width, mc.builder_mc.height);
_local3.graphics.endFill();
mc.builder_mc.addChild(_local3);
_builder.addEventListener(Event.COMPLETE, _onBuilderComplete, false, 0, true);
_builder.addEventListener(Event.CHANGE, _onBuilderChange, false, 0, true);
mc.builder_mc.addChild(_local2);
mc.builder_mc.addChild(_builder);
mc.builder_mc.addChild(_control);
}
private function _onBuilderComplete(_arg1:Event):void{
Tracking.track(Tracking.DRAW_TRACK_NEXT_STEP_BTN);
dispatchEvent(new ScreenEvent(new ScreenBuilderEnviroProps(false)));
_builderToolbar.btnNextStep.visible = true;
}
private function _onPopupClosed(_arg1:Event):void{
mc = Main.afm.createMovieClip("gui", "Builder");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.CHANGE, _onChange);
_builderBreadCrumbs = new BuilderBreadCrumbs(mc.title_panel_mc, 2);
addChild(mc);
_arg1.currentTarget.removeEventListener(Event.REMOVED_FROM_STAGE, _onPopupClosed);
stage.focus = _control;
}
}
}//package com.kerb.modnation
Section 407
//ScreenBuilderRacer (com.kerb.modnation.ScreenBuilderRacer)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.modnation.data.*;
import com.kerb.game.screencontrol.*;
public class ScreenBuilderRacer extends ScreenRacer {
public function ScreenBuilderRacer():void{
var _local1:UserManager = UserManager.instance();
_trackData = _local1.currentTrack;
_trackDetails = _local1.currentTrackDetails;
_local1.ghosts = [];
_ghost = _local1.currentGhost;
super();
}
override protected function _onRacerComplete(_arg1:Event):void{
dispatchEvent(new ScreenEvent(new ScreenSaveTrack()));
}
}
}//package com.kerb.modnation
Section 408
//ScreenCarSelect (com.kerb.modnation.ScreenCarSelect)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import com.kerb.game.screencontrol.*;
import com.kerb.modnation.builder.*;
import com.kerb.ui.*;
public class ScreenCarSelect extends AbstractScreen {
private var _carPalette:CarPalette;
private var _am:AchievementsManager;
private var _next_btn:DynamicButton;
private var _builderBreadCrumbs:BuilderBreadCrumbs;
private var _currSelected:Number;// = 1
private function _onClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
UserManager.instance().currentCart = _currSelected;
mc.play();
}
private function _onInit(_arg1:Event):void{
mc.removeEventListener(Event.INIT, _onInit);
TextManager.getInstance().setTextField(mc.title_panel_mc.txt, "modsandcarts.title");
_carPalette = new CarPalette(mc.content_mc.car_palette, 1, 8);
_carPalette.addEventListener(Event.CHANGE, _onCarSelect, false, 0, true);
_next_btn = new DynamicButton(mc.next_btn, "next.btn");
_next_btn.addEventListener(MouseEvent.CLICK, _onClick);
_selectKart(1);
}
override protected function init():void{
_am = AchievementsManager.instance();
mc = Main.afm.createMovieClip("gui", "ModsCarts");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
}
private function _onCarSelect(_arg1:DynamicEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT_CAR);
var _local2:String = _arg1.id;
var _local3:Number = Number(_local2.split("_")[1]);
_selectKart(_local3);
}
private function _onComplete(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
mc.removeEventListener(Event.COMPLETE, _onComplete);
dispatchEvent(new ScreenEvent(new ScreenSting()));
}
private function _selectKart(_arg1:Number):void{
_currSelected = _arg1;
TextManager.getInstance().setTextField(mc.content_mc.kartTxt.title_txt, ("kart.title." + _arg1));
TextManager.getInstance().setTextField(mc.content_mc.kartTxt.txt, ("kart.copy." + _arg1));
mc.content_mc.KartVideo.gotoAndStop(("kartVid" + _arg1));
}
}
}//package com.kerb.modnation
Section 409
//ScreenCreateChallenge (com.kerb.modnation.ScreenCreateChallenge)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.modnation.profile.*;
import com.kerb.facebook.*;
public class ScreenCreateChallenge extends AbstractScreen {
private var _scrollingFacebookArea:ScrollingFacebookArea;
private var _but1_btn:DynamicButton;
private var _but2_btn:DynamicButton;
private var _days_btn:DynamicButton;
private var days:Number;// = 1
private var _nextScreen:AbstractScreen;
public function ScreenCreateChallenge(){
Tracking.track(Tracking.CHALLENGE_FRIENDS_BTN);
}
private function _onInviteComplete(_arg1:RemoteDataManagerEvent):void{
Tracking.track(Tracking.CREATE_CHALLENGE_BTN);
Main.sm.showScreen(new ScreenProfileChallenges());
}
private function _onDays(_arg1:MouseEvent):void{
days = ((days == 3)) ? 1 : (days + 1);
setDays();
}
private function _onCreateComplete(_arg1:RemoteDataManagerEvent):void{
var _local2:ChallengeDetails = _arg1.challenge;
var _local3:String = FacebookDynamicButton.gatherIDsOfSelectedButtons(_scrollingFacebookArea.buttons);
Constants.challengeId = _local2.id;
Main.rdm.addEventListener(RemoteDataManager.INVITE_TO_CHALLENGE, _onInviteComplete);
Main.rdm.inviteToChallenge(_local2.user, _local2.id, Main.fbm.filterStringIDsbyAppUsers(_local3, true, true), mc.message_txt.text);
}
protected function _onComplete(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
dispatchEvent(new ScreenEvent(_nextScreen));
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_create_challenge");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
mc.addEventListener(Event.CHANGE, _onChange);
addChild(mc);
_but1_btn = new DynamicButton(mc.create_btn, "create.challenge.btn");
_but2_btn = new DynamicButton(mc.load_btn, "home.btn");
_days_btn = new DynamicButton(mc.days_btn);
ButtonSupport.setupButton(_but1_btn, _onBut1);
ButtonSupport.setupButton(_but2_btn, _onBut2);
ButtonSupport.setupButton(_days_btn, _onDays);
}
protected function _onInit(_arg1:Event):void{
TextManager.getInstance().setTextField(mc.title_panel_mc.title_txt, "create.challenge.title");
TextManager.getInstance().setTextField(mc.challenge_name_title_txt, "create.challenge.name.title");
TextManager.getInstance().setTextField(mc.duration_title_txt, "create.challenge.duration.title");
TextManager.getInstance().setTextField(mc.message_title_txt, "create.challenge.message.title");
TextManager.getInstance().setTextField(mc.invite_title_txt, "create.challenge.invite.title");
_scrollingFacebookArea = new ScrollingFacebookArea(mc.scroll_area_mc, Main.fbm.friends);
setDays();
}
private function _onBut2(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
dispatchEvent(new ScreenEvent(new ScreenTitle()));
}
private function setDays():void{
TextManager.getInstance().setTextField(mc.duration_txt, ("create.challenge.duration." + days));
}
private function _onBut1(_arg1:MouseEvent):void{
var _local2:String = FacebookDynamicButton.gatherIDsOfSelectedButtons(_scrollingFacebookArea.buttons);
Main.fbm.sendAppInvites(_local2);
var _local3:Number = new Date().time;
var _local4:Array = [0, 1, 3, 7];
var _local5:Number = _local4[days];
if (((isNaN(_local5)) || ((_local5 < 1)))){
_local5 = 1;
};
var _local6:UserManager = UserManager.instance();
Main.rdm.addEventListener(RemoteDataManager.CREATE_CHALLENGE, _onCreateComplete);
Main.rdm.createChallenge(_local6.currentUserId, _local6.currentTrackDetails.id, ((mc.challenge_name_title_txt.text == "")) ? "Modnation Racers!!!" : mc.challenge_name_txt.text, _local5, _local6.currentTime, _local6.currentCart, _local6.currentGhost.serialize());
}
protected function _onChange(_arg1:Event):void{
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.COMPLETE, _onComplete);
mc.removeEventListener(Event.CHANGE, _onChange);
ButtonSupport.unsetupButton(_but1_btn, _onBut1);
ButtonSupport.unsetupButton(_but2_btn, _onBut2);
ButtonSupport.unsetupButton(_days_btn, _onDays);
_but1_btn.dispose();
_but2_btn.dispose();
_days_btn.dispose();
Main.rdm.removeEventListener(RemoteDataManager.CREATE_CHALLENGE, _onCreateComplete);
Main.rdm.removeEventListener(RemoteDataManager.INVITE_TO_CHALLENGE, _onInviteComplete);
}
}
}//package com.kerb.modnation
Section 410
//ScreenGallery (com.kerb.modnation.ScreenGallery)
package com.kerb.modnation {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
public class ScreenGallery extends AbstractScreen {
private var _but1_btn:DynamicButton;
private var _but2_btn:DynamicButton;
private var _nextScreen:AbstractScreen;
private function onChangeItem(_arg1:MouseEvent):void{
var _local2:Number = Number((_arg1.currentTarget as SimpleButton).name.split("_")[1]);
changeItem(_local2);
}
private function changeItem(_arg1:Number):void{
mc.gallery_mc.image_mc.gotoAndStop(_arg1);
}
protected function _onInit(_arg1:Event):void{
ButtonSupport.setupButton(mc.gallery_mc.thumb_1_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_2_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_3_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_4_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_5_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_6_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_7_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_8_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_9_btn, onChangeItem);
ButtonSupport.setupButton(mc.gallery_mc.thumb_10_btn, onChangeItem);
TextManager.getInstance().setTextField(mc.gallery_mc.down.label_txt, "gallery.btn");
mc.stop();
}
private function _onBut2(_arg1:MouseEvent):void{
_nextScreen = new AbstractScreen();
mc.play();
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_gallery");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
mc.addEventListener(Event.CHANGE, _onChange);
addChild(mc);
changeItem(1);
}
protected function _onChange(_arg1:Event):void{
}
protected function _onComplete(_arg1:Event):void{
dispatchEvent(new ScreenEvent(_nextScreen));
}
private function _onBut1(_arg1:MouseEvent):void{
_nextScreen = new ScreenIntroduction();
mc.play();
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.COMPLETE, _onComplete);
mc.removeEventListener(Event.CHANGE, _onChange);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_1_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_2_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_3_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_4_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_5_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_6_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_7_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_8_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_9_btn, onChangeItem);
ButtonSupport.unsetupButton(mc.gallery_mc.thumb_10_btn, onChangeItem);
}
}
}//package com.kerb.modnation
Section 411
//ScreenIntroduction (com.kerb.modnation.ScreenIntroduction)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.video.*;
public class ScreenIntroduction extends AbstractScreen {
private var _but1_btn:DynamicButton;
private var _but2_btn:DynamicButton;
private var vid:SimpleVideoPlayer;
private var ctaBadge:CTABadge;
private function _restartVid(_arg1:Event):void{
vid.stopVideo();
vid.unpauseVideo();
}
protected function _onInit(_arg1:Event):void{
vid = new SimpleVideoPlayer();
vid.playVideo((Constants.VIDEO_BASE_DEFAULT_URL + "tutorial_new.flv"));
vid.addEventListener(Event.COMPLETE, _restartVid);
vid.addEventListener(Event.CHANGE, _newCuePoint);
mc.video_mc.addChildAt(vid, 0);
vid.x = 108;
vid.y = 26;
}
private function _onBut2(_arg1:MouseEvent):void{
}
override protected function init():void{
_onComplete(null);
}
protected function _onChange(_arg1:Event):void{
}
protected function _onComplete(_arg1:Event):void{
var _local2:AbstractScreen;
switch (Constants.ROUTE){
case Constants.ROUTE_COLD:
_local2 = new ScreenTitle();
break;
case Constants.ROUTE_COMPETITION:
_local2 = new ScreenTitleCompetitionRoute();
break;
case Constants.ROUTE_CHALLENGE:
_local2 = new ScreenTitleChallengeRoute();
break;
case Constants.ROUTE_TRACK:
_local2 = new ScreenTitleTrackRoute();
break;
};
dispatchEvent(new ScreenEvent(_local2));
}
private function _onBut1(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
mc.play();
}
private function _newCuePoint(_arg1:DynamicEvent):void{
mc.video_mc.tag_1_mc.vid_1_txt.text = TextManager.getInstance().getTextById(("video.intro." + _arg1.info.name));
mc.video_mc.gotoAndPlay("loop");
}
override public function dispose():void{
}
}
}//package com.kerb.modnation
Section 412
//ScreenLanguageSelect (com.kerb.modnation.ScreenLanguageSelect)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.utils.*;
import com.kerb.game.screencontrol.*;
import flash.net.*;
import com.kerb.ui.*;
public class ScreenLanguageSelect extends AbstractScreen {
public static const LOCALES:Array = ["da_DK", "de_AT", "de_CH", "de_DE", "en_AU", "en_CA", "en_GB", "en_IE", "en_NZ", "en_US", "es_ES", "es_MX", "fi_FI", "fr_BE", "fr_CA", "fr_CH", "fr_FR", "de_LU", "fr_LU", "it_CH", "it_IT", "nl_BE", "nl_NL", "no_NO", "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sv_SE"];
public static const COUNTRIES:Array = ["da_DK", "de_AT", "xx_CH", "de_DE", "xx_LU", "en_AU", "en_GB", "es_ES", "en_IE", "en_NZ", "en_US", "es_MX", "fi_FI", "xx_BE", "xx_CA", "fr_FR", "it_IT", "nl_NL", "no_NO", "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sv_SE"];
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "language_select");
addChild(mc);
mc = mc.mc;
mc.addEventListener(Event.INIT, onTransitionInit, false, 0, true);
mc.gotoAndPlay(1);
}
private function onTransitionInit(_arg1:Event):void{
var _local3:String;
var _local2:uint;
while (_local2 < LOCALES.length) {
_local3 = LOCALES[_local2];
ButtonSupport.setupButton(mc.flags_mc.getChildByName((_local3 + "_btn")), onLanguageClicked);
if (mc.flags_mc.getChildByName((_local3 + "_btn")) == null){
trace(("no " + _local3));
};
_local2++;
};
mc.addEventListener(Event.COMPLETE, onTransitionOutFinished, false, 0, true);
}
private function onLanguageClicked(_arg1:MouseEvent):void{
var _local6:String;
var _local2:String = _arg1.currentTarget.name;
var _local3:String = _local2.substring(0, (_local2.length - 4));
Constants.LOCALE = _local3;
if ((((((((((Constants.LOCALE == "fr_CA")) || ((Constants.LOCALE == "en_CA")))) || ((Constants.LOCALE == "es_MX")))) || ((Constants.LOCALE == "pt_BR")))) || ((Constants.LOCALE == "en_US")))){
Constants.VIDEO_BASE_URL = Constants.VIDEO_BASE_US_URL;
} else {
Constants.VIDEO_BASE_URL = Constants.VIDEO_BASE_DEFAULT_URL;
};
Main.ui.shareWidget.link = ((Constants.GAME_URL + Constants.LOCALE.toLowerCase()) + "/minigame/index.htm");
var _local4:SharedObject = SharedObject.getLocal(Constants.APP_NAME);
_local4.data.locale = _local3;
_local4.flush();
Main.initText();
var _local5:uint;
while (_local5 < LOCALES.length) {
_local6 = LOCALES[_local5];
ButtonSupport.unsetupButton(mc.flags_mc.getChildByName((_local6 + "_btn")), onLanguageClicked);
_local5++;
};
mc.play();
}
private function onTransitionOutFinished(_arg1:Event):void{
dispatchEvent(new ScreenEvent(new ScreenIntroduction()));
}
private function onLogoClick(_arg1:MouseEvent):void{
Main.onButtonPress();
var _local2:String = TextManager.getInstance().getTextById("url.logo");
navigateToURL(new URLRequest(_local2), "_blank");
}
override public function dispose():void{
ButtonSupport.unsetupButton(mc.title_mc, onLogoClick);
mc.removeEventListener(Event.COMPLETE, onTransitionOutFinished);
}
}
}//package com.kerb.modnation
Section 413
//ScreenRacer (com.kerb.modnation.ScreenRacer)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.game.screencontrol.*;
import com.kerb.modnation.tracks.renderers.*;
public class ScreenRacer extends AbstractScreen {
protected var _racer:Racer;
protected var _control:RacerController;
protected var _ghost:Ghost;
protected var _trackData:TrackData;
protected var _trackDetails:TrackDetails;
protected var _challengeDetails:ChallengeDetails;
public function ScreenRacer():void{
switch (Constants.ROUTE){
case Constants.ROUTE_COMPETITION:
Tracking.track(Tracking.RACE_TRACK_ACCEPT_COMPETITION);
break;
case Constants.ROUTE_CHALLENGE:
Tracking.track(Tracking.RACE_TRACK_ACCEPT_CHALLENGE);
break;
default:
Tracking.track(Tracking.RACE_TRACK);
break;
};
var _local1:UserManager = UserManager.instance();
_trackDetails = _local1.currentTrack.trackDetails;
_trackData = _local1.currentTrack;
_ghost = _local1.currentGhost;
_challengeDetails = null;
super();
}
private function _onReposition(_arg1:Event):void{
if (_control != null){
_control.restoreAfterReposition();
};
}
private function _onRacerINIT(_arg1:Event):void{
this.graphics.beginFill(RacerRenderer.bgColorHex[_trackDetails.environment], 1);
this.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
this.graphics.endFill();
_control.init();
}
protected function _onRacerComplete(_arg1:Event):void{
switch (Constants.ROUTE){
case Constants.ROUTE_CHALLENGE:
dispatchEvent(new ScreenEvent(new ScreenResultsChallenge()));
break;
case Constants.ROUTE_COMPETITION:
dispatchEvent(new ScreenEvent(new ScreenResultsCompetition()));
break;
default:
dispatchEvent(new ScreenEvent(new ScreenResults()));
break;
};
}
override protected function init():void{
_racer = new Racer(_trackData, _ghost);
_control = new RacerController(_racer, _trackData.startX, _trackData.startY, _trackData.startRot);
_racer.addEventListener(Event.COMPLETE, _onRacerComplete, false, 0, true);
_racer.addEventListener(Event.INIT, _onRacerINIT, false, 0, true);
_racer.addEventListener(Event.CHANGE, _onReposition);
addChild(_racer);
addChild(_control);
}
override public function dispose():void{
_racer.removeEventListener(Event.COMPLETE, _onRacerComplete);
_racer.addEventListener(Event.CHANGE, _onReposition);
_racer.removeEventListener(Event.INIT, _onRacerINIT);
_control.dispose();
_racer.dispose();
_control = null;
_racer = null;
}
}
}//package com.kerb.modnation
Section 414
//ScreenResults (com.kerb.modnation.ScreenResults)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.profile.*;
public class ScreenResults extends AbstractScreen {
protected var externalURLsBox:ExternalURLsBox;
protected var starRatings:StarRatings;
protected var preview:Bitmap;
protected var testAgain_btn:DynamicButton;
protected var time:int;
protected var trackData:TrackData;
protected var ghost:Ghost;
protected var reportBtn:ReportButton;
protected var save_and_challenge_btn:DynamicButton;
protected var challengeDetails:ChallengeDetails;
protected var cart:int;
protected var facebook_btn:DynamicButton;
protected var _nextScreen:AbstractScreen;
protected var details_btn:DynamicButton;
protected var thumbnail:BitmapData;
public function ScreenResults(){
trace("ScreenResults******");
var _local1:UserManager = UserManager.instance();
this.trackData = _local1.currentTrack;
this.ghost = _local1.currentGhost;
this.time = _local1.currentTime;
this.cart = _local1.currentCart;
super();
}
protected function _quitClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
dispatchEvent(new ScreenEvent(new ScreenTitle()));
}
protected function _onGetTrackTimesAround(_arg1:RemoteDataManagerEvent):void{
var _local3:TimeDetails;
var _local2 = 1;
while (_local2 < 4) {
_local3 = ((_arg1.times.length < _local2)) ? new TimeDetails(<time/>
) : _arg1.times[(_local2 - 1)];
mc[(("time_" + (_local2 + 1)) + "_rank_txt")].text = ((_local3.rank == 0)) ? "----" : _local3.rank.toString();
mc[(("time_" + (_local2 + 1)) + "_name_txt")].text = ((_local3.userName.toString() == " ")) ? TextManager.getInstance().getTextById("noname.player") : _local3.userName.toString();
mc[(("time_" + (_local2 + 1)) + "_time_txt")].text = ((_local3.time == 0)) ? "--:--:--" : RaceTimer.formatTime(_local3.time);
_local2++;
};
}
protected function _saveTime():void{
var _local1:int;
trace("Saving time");
if (Main.um.isLogged){
Main.rdm.addEventListener(RemoteDataManager.SAVE_TIME, _onTimeSaved);
_local1 = ((Constants.TRACKS_POOL.indexOf(trackData.trackDetails.id))!=-1) ? 0 : 1;
Main.rdm.saveTime(UserManager.instance().currentUserId, trackData.trackDetails.id, 0, time, cart, ghost.serialize(), _local1);
};
}
protected function getTimesAround():void{
Main.rdm.getTrackTimesAround(UserManager.instance().currentUserId, this.trackData.trackDetails.id, 0, 1);
}
protected function _challengeClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
if (Main.um.isLogged){
_nextScreen = new ScreenCreateChallenge();
mc.play();
} else {
Main.um.login(_saveTime);
};
}
protected function _testAgainClick(_arg1:MouseEvent):void{
RacerRenderer.cacheProps = true;
RacerRenderer.cacheTrack = true;
dispatchEvent(new ScreenEvent(new ScreenRacer()));
}
protected function _onTimeSaved(_arg1:RemoteDataManagerEvent):void{
Main.rdm.removeEventListener(RemoteDataManager.SAVE_TIME, _onTimeSaved);
save_and_challenge_btn.initText("challenge.btn");
trace(("saved time to server with success " + _arg1.success));
getTimesAround();
var _local2:String = TextManager.getInstance().getTextById("facebook.dashboard.newtime");
_local2 = _local2.replace("{trackname}", trackData.trackDetails.name);
_local2 = _local2.replace("{time}", RaceTimer.formatTime(Main.um.currentTime));
Main.fbm.sendMessage({route:"DASHBOARD", message:_local2});
}
protected function _onSaveClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_saveTime();
}
protected function _onComplete(_arg1:Event):void{
mc.removeEventListener(Event.COMPLETE, _onComplete);
dispatchEvent(new ScreenEvent(_nextScreen));
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_results");
Main.rdm.addEventListener(RemoteDataManager.GET_TRACK_TIMES_AROUND, _onGetTrackTimesAround);
UserManager.instance().currentTrackDetails = UserManager.instance().currentTrack.trackDetails;
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
mc.time_1_time_txt.text = RaceTimer.formatTime(time);
testAgain_btn = new DynamicButton(mc.testAgain_btn, "raceAgain.btn");
details_btn = new DynamicButton(mc.quit_btn, "details.btn");
save_and_challenge_btn = new DynamicButton(mc.shareTrack_mc.save_and_challenge_btn, (Main.um.isLogged) ? "challenge.btn" : "logon.to.save.score");
reportBtn = new ReportButton(mc.report_btn);
if (((!(Main.um.isLogged)) || (!((Constants.TRACKS_POOL.indexOf(trackData.trackDetails.id) == -1))))){
reportBtn.visible = false;
mc.report_txt.visible = false;
} else {
reportBtn.visible = true;
mc.report_txt.visible = true;
};
ButtonSupport.setupButton(testAgain_btn, _testAgainClick);
ButtonSupport.setupButton(details_btn, _quitClick);
ButtonSupport.setupButton(save_and_challenge_btn, _challengeClick);
mc.trackName_txt.text = trackData.trackDetails.name;
mc.time_1_time_txt.text = RaceTimer.formatTime(Main.um.currentTime);
externalURLsBox = new ExternalURLsBox(mc.shareTrack_mc);
externalURLsBox.challengeURL = ("track/" + trackData.trackDetails.id);
ExternalURLsBox.imgURL = trackData.trackDetails.thumbnailUrl;
ExternalURLsBox.trackName = trackData.trackDetails.name;
ExternalURLsBox.by = trackData.trackDetails.creatorName;
starRatings = new StarRatings(mc.stars_mc);
starRatings.setDetails(trackData.trackDetails.id, trackData.trackDetails.isRated, trackData.trackDetails.user, trackData.trackDetails.ratingTotal, trackData.trackDetails.ratingCount);
TextManager.getInstance().setTextField(mc.raceComp_txt, "track.details.times.my");
TextManager.getInstance().setTextField(mc.yourTime_txt, "challenge.my.rank");
TextManager.getInstance().setTextField(mc.rate_mc.label_txt, "results.rate.this.track");
TextManager.getInstance().setTextField(mc.report_txt, "track.details.report.btn");
preview = new Bitmap(UserManager.instance().renderer.thumbnail);
preview.height = (preview.width = 120);
preview.smoothing = true;
mc.thumbnail_mc.trackPic_mc.addChild(preview);
getTimesAround();
}
protected function _onInit(_arg1:Event):void{
mc.stop();
mc.removeEventListener(Event.INIT, _onInit);
if (Main.um.isLogged){
_saveTime();
};
}
override public function dispose():void{
Main.rdm.removeEventListener(RemoteDataManager.GET_TRACK_TIMES_AROUND, _onGetTrackTimesAround);
ButtonSupport.unsetupButton(testAgain_btn, _testAgainClick);
ButtonSupport.unsetupButton(details_btn, _quitClick);
ButtonSupport.unsetupButton(save_and_challenge_btn, _challengeClick);
reportBtn.dispose();
testAgain_btn.dispose();
details_btn.dispose();
save_and_challenge_btn.dispose();
starRatings.dispose();
externalURLsBox.dispose();
}
protected function _onTitleClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_nextScreen = new ScreenTitle();
mc.play();
}
}
}//package com.kerb.modnation
Section 415
//ScreenResultsChallenge (com.kerb.modnation.ScreenResultsChallenge)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.ui.*;
import com.kerb.modnation.profile.*;
public class ScreenResultsChallenge extends ScreenResults {
public function ScreenResultsChallenge(){
trace("ScreenResultsChallenge******");
super();
}
override protected function init():void{
UserManager.instance().currentTrackDetails = UserManager.instance().currentTrack.trackDetails;
this.challengeDetails = Main.um.currentChallengeDetails;
mc = Main.afm.createMovieClip("gui", "screen_results_challenge");
Main.rdm.addEventListener(RemoteDataManager.GET_TRACK_TIMES_AROUND, _onGetTrackTimesAround);
Main.rdm.getTrackTimesAround(UserManager.instance().currentUserId, this.trackData.trackDetails.id, 0, 1);
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
mc.time_1_time_txt.text = RaceTimer.formatTime(time);
externalURLsBox = new ExternalURLsBox(mc.shareTrack_mc);
externalURLsBox.challengeURL = ("challenge/" + Constants.challengeId);
ExternalURLsBox.imgURL = trackData.trackDetails.thumbnailUrl;
ExternalURLsBox.trackName = trackData.trackDetails.name;
ExternalURLsBox.by = trackData.trackDetails.creatorName;
testAgain_btn = new DynamicButton(mc.testAgain_btn, "raceAgain.btn");
details_btn = new DynamicButton(mc.quit_btn, "details.btn");
save_and_challenge_btn = new DynamicButton(mc.shareTrack_mc.save_and_challenge_btn, (Main.um.isLogged) ? "challenge.btn" : "logon.to.save.score");
reportBtn = new ReportButton(mc.report_btn);
if (((!(Main.um.isLogged)) || (!((Constants.TRACKS_POOL.indexOf(trackData.trackDetails.id) == -1))))){
reportBtn.visible = false;
mc.report_txt.visible = false;
} else {
reportBtn.visible = true;
mc.report_txt.visible = true;
};
ButtonSupport.setupButton(testAgain_btn, _testAgainClick);
ButtonSupport.setupButton(details_btn, _quitClick);
ButtonSupport.setupButton(save_and_challenge_btn, _challengeClick);
TextManager.getInstance().setTextField(mc.raceComp_txt, "track.details.times.my");
TextManager.getInstance().setTextField(mc.yourTime_txt, "challenge.my.rank");
TextManager.getInstance().setTextField(mc.rate_mc.label_txt, "results.rate.this.track");
starRatings = new StarRatings(mc.stars_mc);
starRatings.setDetails(trackData.trackDetails.id, trackData.trackDetails.isRated, trackData.trackDetails.user, trackData.trackDetails.ratingTotal, trackData.trackDetails.ratingCount);
preview = new Bitmap(UserManager.instance().renderer.thumbnail);
preview.height = (preview.width = 120);
preview.smoothing = true;
mc.thumbnail_mc.trackPic_mc.addChild(preview);
}
override protected function _saveTime():void{
trace("Saving time");
Main.rdm.addEventListener(RemoteDataManager.SAVE_TIME, _onTimeSaved);
Main.rdm.saveTime(UserManager.instance().currentUserId, trackData.trackDetails.id, challengeDetails.id, time, cart, ghost.serialize());
}
override protected function getTimesAround():void{
Main.rdm.getTrackTimesAround(UserManager.instance().currentUserId, this.trackData.trackDetails.id, challengeDetails.id, 1);
}
}
}//package com.kerb.modnation
Section 416
//ScreenResultsCompetition (com.kerb.modnation.ScreenResultsCompetition)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import flash.net.*;
import com.kerb.ui.*;
import com.kerb.modnation.profile.*;
import com.kerb.validation.*;
public class ScreenResultsCompetition extends ScreenResultsChallenge {
private var _countryIndex:String;
private var _tempLastName_txt:String;
private var countryDropdown:MovieClip;
private var countryBtns:Array;
private var _tempName_txt:String;
private var agreeBtn:DynamicToggleButton;
private var _countrySelected:Boolean;
private var termsBtn:DynamicButton;
private var okBtn:DynamicButton;
private var _tempEmail_txt:String;
private var tickOptOutBtn:DynamicToggleButton;
private var countryBtn:DynamicButton;
private var tickAgeBtn:DynamicToggleButton;
private var _allGood:Boolean;
private function _countryBtnClick(_arg1:MouseEvent):void{
countryDropdown.visible = !(countryDropdown.visible);
}
private function _okMouseOut(_arg1:MouseEvent):void{
mc.submitComp_mc.input_email_txt.text = _tempEmail_txt;
mc.submitComp_mc.input_name_txt.text = _tempName_txt;
mc.submitComp_mc.input_nameLast_txt.text = _tempLastName_txt;
}
override protected function _saveTime():void{
mc.submitComp_mc.visible = false;
trace("Saving time");
Main.rdm.addEventListener(RemoteDataManager.SAVE_TIME, _onTimeSaved);
Main.rdm.saveTime(UserManager.instance().currentUserId, trackData.trackDetails.id, challengeDetails.id, time, cart, ghost.serialize(), 1, mc.submitComp_mc.input_name_txt.text, mc.submitComp_mc.input_nameLast_txt.text, mc.submitComp_mc.input_email_txt.text, _countryIndex, (tickOptOutBtn.selected) ? "0" : "1");
}
private function _okMouseClick(_arg1:MouseEvent):void{
if (_allGood){
if (Main.um.isLogged){
_saveTime();
} else {
Main.um.login(_saveTime);
};
};
}
override protected function init():void{
var _local1:MovieClip;
this.challengeDetails = Main.um.currentChallengeDetails;
mc = Main.afm.createMovieClip("gui", "screen_results_competition");
Main.rdm.addEventListener(RemoteDataManager.GET_TRACK_TIMES_AROUND, _onGetTrackTimesAround);
Main.rdm.getTrackTimesAround(UserManager.instance().currentUserId, this.trackData.trackDetails.id, 0, 1);
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
mc.time_1_time_txt.text = RaceTimer.formatTime(time);
externalURLsBox = new ExternalURLsBox(mc.shareTrack_mc);
externalURLsBox.challengeURL = ("challenge/" + Constants.challengeId);
ExternalURLsBox.imgURL = trackData.trackDetails.thumbnailUrl;
ExternalURLsBox.trackName = trackData.trackDetails.name;
ExternalURLsBox.by = trackData.trackDetails.creatorName;
testAgain_btn = new DynamicButton(mc.testAgain_btn, "raceAgain.btn");
save_and_challenge_btn = new DynamicButton(mc.shareTrack_mc.save_and_challenge_btn, (Main.um.isLogged) ? "challenge.btn" : "logon.to.save.score");
ButtonSupport.setupButton(testAgain_btn, _testAgainClick);
ButtonSupport.setupButton(save_and_challenge_btn, _challengeClick);
agreeBtn = new DynamicToggleButton(mc.submitComp_mc.tick_btn, "results.comp.agree.btn");
agreeBtn.toggleable = true;
okBtn = new DynamicButton(mc.submitComp_mc.submit_btn, "results.comp.submit.btn");
termsBtn = new DynamicButton(mc.submitComp_mc.TandC_mc, "results.comp.terms.txt");
tickOptOutBtn = new DynamicToggleButton(mc.submitComp_mc.tickOptOut_btn, "results.comp.tickoptout.btn");
tickOptOutBtn.toggleable = true;
tickAgeBtn = new DynamicToggleButton(mc.submitComp_mc.tickAge_btn, "results.comp.tickage.btn");
tickAgeBtn.toggleable = true;
countryBtn = new DynamicButton(mc.submitComp_mc.country_btn, "results.comp.country.btn");
countryDropdown = mc.submitComp_mc.dropdown_country_mc;
countryDropdown.visible = false;
okBtn.visible = false;
ButtonSupport.setupButton(agreeBtn, _agreeClick);
ButtonSupport.setupButton(okBtn, _okMouseClick, _okMouseOver, _okMouseOut);
ButtonSupport.setupButton(termsBtn, _termsClick);
ButtonSupport.setupButton(tickOptOutBtn, _optOutClick);
ButtonSupport.setupButton(tickAgeBtn, _ageClick);
ButtonSupport.setupButton(countryBtn, _countryBtnClick);
var _local2:int = (countryDropdown.numChildren - 1);
countryBtns = new Array(_local2);
var _local3:int;
while (_local3 < _local2) {
_local1 = countryDropdown[(("flag_" + (_local3 + 1)) + "_mc")];
_local1.useHandCursor = (_local1.buttonMode = true);
_local1.gotoAndStop(ScreenLanguageSelect.COUNTRIES[_local3]);
_local1.addEventListener(MouseEvent.CLICK, _onDropdownClick);
countryBtns[_local3] = _local1;
_local3++;
};
countryBtn.initText(("search.country." + Constants.LOCALE));
_countryIndex = Constants.LOCALE;
TextManager.getInstance().setTextField(mc.submitComp_mc.title_txt, "results.comp.submit.your.entry");
TextManager.getInstance().setTextField(mc.submitComp_mc.name_txt, "results.comp.name");
TextManager.getInstance().setTextField(mc.submitComp_mc.nameLast_txt, "results.comp.name.last");
TextManager.getInstance().setTextField(mc.submitComp_mc.email_txt, "results.comp.email");
TextManager.getInstance().setTextField(mc.submitComp_mc.optOut_txt, "results.comp.optout.txt");
TextManager.getInstance().setTextField(mc.submitComp_mc.age_txt, "results.comp.overage.txt");
TextManager.getInstance().setTextField(mc.raceComp_txt, "track.details.times.my");
TextManager.getInstance().setTextField(mc.yourTime_txt, "challenge.my.rank");
this.addEventListener(KeyboardEvent.KEY_DOWN, monitorEmailField);
mc.submitComp_mc.input_name_txt.text = "";
mc.submitComp_mc.input_nameLast_txt.text = "";
mc.submitComp_mc.input_email_txt.text = "";
var _local4:Loader = new Loader();
_local4.load(new URLRequest(Main.um.currentChallengeDetails.competitionPostMessageUrl));
mc.thumbCTA_mc.CTA_mc.addChild(_local4);
}
private function _onDropdownClick(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int = countryBtns.indexOf(_arg1.target.parent.parent);
_local2 = ("search.country." + ScreenLanguageSelect.COUNTRIES[_local3]);
_countryIndex = ScreenLanguageSelect.COUNTRIES[_local3];
countryBtn.initText(_local2);
countryDropdown.visible = false;
_countrySelected = true;
_checkIfAllDone();
}
private function _agreeClick(_arg1:MouseEvent):void{
agreeBtn.selected = !(agreeBtn.selected);
_checkIfAllDone();
}
override protected function _onTimeSaved(_arg1:RemoteDataManagerEvent):void{
Tracking.track(Tracking.SUBMIT_TRACK_ENTRY_BTN);
super._onTimeSaved(_arg1);
}
private function _checkIfAllDone():void{
if (((agreeBtn.selected) && (tickAgeBtn.selected))){
okBtn.visible = true;
} else {
okBtn.visible = false;
};
}
override public function dispose():void{
this.removeEventListener(KeyboardEvent.KEY_DOWN, monitorEmailField);
ButtonSupport.unsetupButton(testAgain_btn, _testAgainClick);
ButtonSupport.unsetupButton(save_and_challenge_btn, _challengeClick);
ButtonSupport.unsetupButton(agreeBtn, _agreeClick);
ButtonSupport.unsetupButton(okBtn, _okMouseClick, _okMouseOver, _okMouseOut);
ButtonSupport.unsetupButton(termsBtn, _termsClick);
ButtonSupport.unsetupButton(tickOptOutBtn, _optOutClick);
ButtonSupport.unsetupButton(tickAgeBtn, _ageClick);
ButtonSupport.unsetupButton(countryBtn, _countryBtnClick);
testAgain_btn.dispose();
save_and_challenge_btn.dispose();
agreeBtn.dispose();
okBtn.dispose();
termsBtn.dispose();
tickOptOutBtn.dispose();
tickAgeBtn.dispose();
countryBtn.dispose();
}
private function _okMouseOver(_arg1:MouseEvent):void{
_allGood = true;
_tempEmail_txt = mc.submitComp_mc.input_email_txt.text;
_tempName_txt = mc.submitComp_mc.input_name_txt.text;
_tempLastName_txt = mc.submitComp_mc.input_nameLast_txt.text;
if (!EmailValidator.validate(mc.submitComp_mc.input_email_txt.text)){
_allGood = false;
mc.submitComp_mc.input_email_txt.text = TextManager.getInstance().getTextById("results.comp.invalid.email");
};
if (mc.submitComp_mc.input_name_txt.text == ""){
_allGood = false;
mc.submitComp_mc.input_name_txt.text = TextManager.getInstance().getTextById("results.comp.invalid.name");
};
if (mc.submitComp_mc.input_nameLast_txt.text == ""){
_allGood = false;
mc.submitComp_mc.input_nameLast_txt.text = TextManager.getInstance().getTextById("results.comp.invalid.lastname");
};
}
private function _ageClick(_arg1:MouseEvent):void{
tickAgeBtn.selected = !(tickAgeBtn.selected);
_checkIfAllDone();
}
override protected function _onInit(_arg1:Event):void{
mc.stop();
mc.removeEventListener(Event.INIT, _onInit);
}
private function _termsClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(Main.um.currentCompetitionDetails.competitionTermsUrl), "_blank");
}
private function _optOutClick(_arg1:MouseEvent):void{
tickOptOutBtn.selected = !(tickOptOutBtn.selected);
}
private function monitorEmailField(_arg1:Event):void{
var _local2:String = mc.submitComp_mc.input_email_txt.text;
mc.submitComp_mc.input_email_txt.text = _local2.replace("\"", "@");
}
}
}//package com.kerb.modnation
Section 417
//ScreenSaveTrack (com.kerb.modnation.ScreenSaveTrack)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import flash.utils.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.tracks.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.adobe.images.*;
import mx.utils.*;
import com.kerb.modnation.profile.*;
public class ScreenSaveTrack extends AbstractScreen {
protected var externalURLsBox:ExternalURLsBox;
private var saved:Boolean;// = false
private var preview:Bitmap;
private var testAgain_btn:DynamicButton;
private var time:int;
private var ghost:Ghost;
private var trackData:TrackData;
private var save_and_challenge_btn:DynamicButton;
private var _nextScreen:AbstractScreen;
private var cart:int;
private var save_btn:DynamicButton;
private var facebook_btn:DynamicButton;
private var quit_btn:DynamicButton;
private var thumbnail:BitmapData;
public function ScreenSaveTrack(){
var _local1:UserManager = UserManager.instance();
this.trackData = _local1.currentTrack;
this.ghost = _local1.currentGhost;
this.time = _local1.currentTime;
this.cart = _local1.currentCart;
super();
}
private function _onSaveAndChallengeClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
_nextScreen = new ScreenCreateChallenge();
mc.play();
}
private function _onRecheckLogin():void{
_saveTrack();
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_save_track");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
mc.yourTime_mc.label_txt.text = RaceTimer.formatTime(time);
mc.shareTrack_mc.visible = false;
externalURLsBox = new ExternalURLsBox(mc.shareTrack_mc);
save_btn = new DynamicButton(mc.nameTrack_mc.save_btn, "save.btn");
testAgain_btn = new DynamicButton(mc.testAgain_btn, "testAgain.btn");
quit_btn = new DynamicButton(mc.quit_btn, "quit.btn");
save_and_challenge_btn = new DynamicButton(mc.shareTrack_mc.save_and_challenge_btn, "challenge.friends.btn");
mc.raceComp_txt.text = TextManager.getInstance().getTextById("track.details.times.my");
mc.nameTrack_mc.nametrack_mc.label_txt.text = TextManager.getInstance().getTextById("track.name");
preview = new Bitmap(UserManager.instance().renderer.thumbnail);
preview.height = (preview.width = 120);
preview.smoothing = true;
mc.thumbnail_mc.trackPic_mc.addChild(preview);
}
private function _onQuitClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
_nextScreen = new ScreenBuilderEnviromentChooser();
mc.play();
}
private function _onComplete(_arg1:Event):void{
mc.removeEventListener(Event.COMPLETE, _onComplete);
dispatchEvent(new ScreenEvent(_nextScreen));
}
private function _saveTrack():void{
var _local1:ByteArray;
var _local2:Base64Encoder;
var _local3:String;
if (Main.um.isLogged){
save_btn.removeEventListener(MouseEvent.CLICK, _onSaveClick);
trace("Saving track");
_local1 = new ByteArray();
if (preview.bitmapData != null){
_local1 = PNGEncoder.encode(preview.bitmapData);
} else {
trace("No thumbnail data found");
};
trace(("thumbnail size is " + _local1.length));
_local2 = new Base64Encoder();
_local2.encodeBytes(_local1);
_local3 = _local2.toString();
trace(("base64 encoded size is " + _local3.length));
Main.rdm.addEventListener(RemoteDataManager.SAVE_TRACK, _onTrackSaved);
Main.rdm.saveTrack(UserManager.instance().currentUserId, mc.nameTrack_mc.track_name_mc.label_txt.text, trackData.trackDetails.environment, trackData.serialize(), _local3, trackData.track.length, trackData.props.length, time, cart, ghost.serialize());
} else {
Main.um.login(_onRecheckLogin);
};
}
private function _onTrackSaved(_arg1:RemoteDataManagerEvent):void{
saved = true;
mc.shareTrack_mc.visible = true;
Main.rdm.removeEventListener(RemoteDataManager.SAVE_TRACK, _onTrackSaved);
var _local2:TrackDetails = _arg1.track;
Main.um.currentTrackDetails = _local2;
externalURLsBox.challengeURL = ("track/" + _local2.id);
ExternalURLsBox.imgURL = _local2.thumbnailUrl;
ExternalURLsBox.trackName = _local2.name;
ExternalURLsBox.by = _local2.creatorName;
Constants.trackId = _arg1.track.id;
trace(("saved track to server with id " + _arg1.track.id));
var _local3:String = TextManager.getInstance().getTextById("facebook.dashboard.newtrack");
_local3 = _local3.replace("{trackname}", _arg1.track.name);
Main.fbm.sendMessage({route:"DASHBOARD", message:_local3});
Tracking.track(Tracking.SAVE_TRACK_AND_TIME_BTN);
}
private function _onSaveClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
_saveTrack();
mc.nameTrack_mc.visible = false;
}
private function _onInit(_arg1:Event):void{
mc.stop();
mc.removeEventListener(Event.INIT, _onInit);
save_btn.addEventListener(MouseEvent.CLICK, _onSaveClick, false, 0, true);
save_and_challenge_btn.addEventListener(MouseEvent.CLICK, _onSaveAndChallengeClick, false, 0, true);
quit_btn.addEventListener(MouseEvent.CLICK, _onQuitClick, false, 0, true);
testAgain_btn.addEventListener(MouseEvent.CLICK, _ontestAgainClick, false, 0, true);
}
override public function dispose():void{
_nextScreen = null;
externalURLsBox.dispose();
}
private function _ontestAgainClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
_nextScreen = (saved) ? new ScreenTitleTrackRoute() : new ScreenBuilderRacer();
mc.play();
}
}
}//package com.kerb.modnation
Section 418
//ScreenSting (com.kerb.modnation.ScreenSting)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.video.*;
public class ScreenSting extends AbstractScreen {
private var _but1_btn:DynamicButton;
private var vid:SimpleVideoPlayer;
private var ctaBadge:CTABadge;
private var _nextScreen:AbstractScreen;
private function _restartVid(_arg1:Event):void{
vid.stopVideo();
vid.unpauseVideo();
}
protected function _onInit(_arg1:Event):void{
vid = new SimpleVideoPlayer();
vid.playVideo((Constants.VIDEO_BASE_DEFAULT_URL + "pre_race_sting_01.flv"));
vid.addEventListener(Event.COMPLETE, _restartVid);
mc.video_mc.addChildAt(vid, 0);
vid.x = 108;
vid.y = 26;
_but1_btn = new DynamicButton(mc.video_mc.next_btn, "race.btn");
ButtonSupport.setupButton(_but1_btn, _onComplete);
TextManager.getInstance().setTextField(mc.video_mc.tag_1_mc.vid_1_txt, "video.intro.exclusive");
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_sting");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
mc.addEventListener(Event.CHANGE, _onChange);
addChild(mc);
ctaBadge = new CTABadge(mc.video_mc.CTAsticker_btn);
}
protected function _onChange(_arg1:Event):void{
}
protected function _onComplete(_arg1:Event):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
dispatchEvent(new ScreenEvent(new ScreenRacer()));
}
private function _onBut1(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
_nextScreen = new ScreenIntroduction();
mc.play();
}
override public function dispose():void{
vid.removeEventListener(Event.COMPLETE, _restartVid);
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.COMPLETE, _onComplete);
mc.removeEventListener(Event.CHANGE, _onChange);
ButtonSupport.unsetupButton(_but1_btn, _onComplete);
_but1_btn.dispose();
vid.dispose();
ctaBadge.dispose();
_nextScreen = null;
vid = null;
}
}
}//package com.kerb.modnation
Section 419
//ScreenTitle (com.kerb.modnation.ScreenTitle)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import flash.net.*;
import com.kerb.ui.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.video.*;
import com.kerb.modnation.profile.*;
public class ScreenTitle extends AbstractScreen {
private var terms:MovieClip;
private var vid:SimpleVideoPlayer;
private var terms_US:MovieClip;
private var create_btn:DynamicButton;
private var quickrace_btn:DynamicButton;
protected var ctaBadge:CTABadge;
private var race_btn:DynamicButton;
private var tl:TrackLoader;
private var nextScreen:AbstractScreen;
private function _onChange(_arg1:Event):void{
mc.stop();
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_title");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.CHANGE, _onChange);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
terms = MovieClip(mc.terms_mc);
terms_US = MovieClip(mc.terms_US_mc);
create_btn = new DynamicCenteredLabelButton(mc.create_btn, "create.btn", true, false);
race_btn = new DynamicCenteredLabelButton(mc.race_btn, "play.btn", true, false);
quickrace_btn = new DynamicCenteredLabelButton(mc.quikrace_btn, "quickrace.btn", true, false);
UserManager.instance().renderer = new RacerRenderer();
ctaBadge = new CTABadge(mc.CTAsticker_btn);
}
private function _onCreateClick(_arg1:MouseEvent):void{
nextScreen = new ScreenBuilderEnviromentChooser();
mc.play();
}
private function _onComplete(_arg1:Event):void{
mc.removeEventListener(Event.COMPLETE, _onComplete);
dispatchEvent(new ScreenEvent(nextScreen));
}
private function onCompClick(_arg1:MouseEvent):void{
Constants.challengeId = Main.um.currentCompetitionDetails.id;
Main.sm.showScreen(new ScreenTitleCompetitionRoute());
}
private function _newCuePoint(_arg1:DynamicEvent):void{
mc.video_mc.tag_1_mc.vid_1_txt.text = TextManager.getInstance().getTextById(("video.intro." + _arg1.info.name));
mc.video_mc.gotoAndPlay("loop");
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.CHANGE, _onChange);
mc.removeEventListener(Event.COMPLETE, _onComplete);
if (tl != null){
tl.removeEventListener(Event.COMPLETE, _onTrackLoaderComplete);
};
if (mc.thumbCTA_mc != null){
mc.thumbCTA_mc.removeEventListener(MouseEvent.CLICK, onCompClick);
};
ButtonSupport.unsetupButton(create_btn, _onCreateClick);
ButtonSupport.unsetupButton(race_btn, _onRaceClick);
ButtonSupport.unsetupButton(quickrace_btn, _onQuickRaceClick);
if (ctaBadge){
ctaBadge.dispose();
};
create_btn.dispose();
race_btn.dispose();
quickrace_btn.dispose();
ctaBadge.dispose();
vid.dispose();
quickrace_btn = null;
nextScreen = null;
tl = null;
ctaBadge = null;
vid = null;
}
private function _onRaceClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
nextScreen = new ScreenSelectTrack();
mc.play();
}
private function _restartVid(_arg1:Event):void{
vid.stopVideo();
vid.unpauseVideo();
}
private function _onQuickRaceClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_TRANSITION);
tl = new TrackLoader();
tl.loadRandomTrack();
tl.addEventListener(Event.COMPLETE, _onTrackLoaderComplete);
}
private function _onInit(_arg1:Event):void{
var _local2:Loader = new Loader();
if (Main.um.currentCompetitionDetails == null){
mc.thumbCTA_mc.visible = false;
} else {
mc.thumbCTA_mc.visible = true;
_local2.load(new URLRequest(Main.um.currentCompetitionDetails.competitionPreMessageUrl));
mc.thumbCTA_mc.CTA_mc.addChild(_local2);
mc.thumbCTA_mc.buttonMode = true;
mc.thumbCTA_mc.addEventListener(MouseEvent.CLICK, onCompClick);
};
if ((((((((((Constants.LOCALE == "fr_CA")) || ((Constants.LOCALE == "en_CA")))) || ((Constants.LOCALE == "es_MX")))) || ((Constants.LOCALE == "pt_BR")))) || ((Constants.LOCALE == "en_US")))){
terms_US.visible = true;
terms.visible = false;
} else {
terms_US.visible = false;
terms.visible = true;
};
mc.removeEventListener(Event.INIT, _onInit);
TextManager.getInstance().setTextField(mc.instructions_txt, "instructions.1");
TextManager.getInstance().setTextField(mc.title2_txt, "game.logo");
ButtonSupport.setupButton(create_btn, _onCreateClick);
ButtonSupport.setupButton(race_btn, _onRaceClick);
ButtonSupport.setupButton(quickrace_btn, _onQuickRaceClick);
vid = new SimpleVideoPlayer();
vid.playVideo((Constants.VIDEO_BASE_DEFAULT_URL + "title_screen_vid.flv"));
vid.addEventListener(Event.COMPLETE, _restartVid);
vid.addEventListener(Event.CHANGE, _newCuePoint);
mc.video_mc.videoFrame_mc.titleVideo_mc.addChildAt(vid, 0);
}
private function _onTrackLoaderComplete(_arg1:Event):void{
tl.removeEventListener(Event.COMPLETE, _onTrackLoaderComplete);
nextScreen = new ScreenSting();
mc.play();
}
}
}//package com.kerb.modnation
Section 420
//ScreenTitleChallengeOver (com.kerb.modnation.ScreenTitleChallengeOver)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.modnation.racer.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.video.*;
public class ScreenTitleChallengeOver extends AbstractScreen {
private var _but1_btn:DynamicButton;
private var vid:SimpleVideoPlayer;
private var ctaBadge:CTABadge;
private var _nextScreen:AbstractScreen;
private function _setChallengeDetails():void{
mc.time_2_time_txt.text = RaceTimer.formatTime(Main.um.currentChallengeDetails.topTime);
mc.Racer_name_txt.text = ((Main.um.currentChallengeDetails.topUserName == " ")) ? TextManager.getInstance().getTextById("noname.player") : Main.um.currentChallengeDetails.topUserName;
}
protected function _onInit(_arg1:Event):void{
TextManager.getInstance().setTextField(mc.title_txt, "challenege.over.1");
TextManager.getInstance().setTextField(mc.instructions_txt, "challenege.over.2");
TextManager.getInstance().setTextField(mc.raceComp_txt, "challenege.over.toptime");
_but1_btn = new DynamicButton(mc.home_btn, "home.btn");
ButtonSupport.setupButton(_but1_btn, _onComplete);
ctaBadge = new CTABadge(mc.CTAsticker_btn);
_setChallengeDetails();
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_title_challenge_OVER");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
mc.addEventListener(Event.CHANGE, _onChange);
addChild(mc);
}
protected function _onChange(_arg1:Event):void{
}
protected function _onComplete(_arg1:Event):void{
dispatchEvent(new ScreenEvent(new ScreenTitle()));
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.COMPLETE, _onComplete);
mc.removeEventListener(Event.CHANGE, _onChange);
ButtonSupport.unsetupButton(_but1_btn, _onComplete);
if (_but1_btn != null){
_but1_btn.dispose();
};
if (ctaBadge != null){
ctaBadge.dispose();
};
_nextScreen = null;
super.dispose();
}
}
}//package com.kerb.modnation
Section 421
//ScreenTitleChallengeRoute (com.kerb.modnation.ScreenTitleChallengeRoute)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.UI.*;
import com.kerb.ui.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.profile.*;
public class ScreenTitleChallengeRoute extends ScreenTitleTrackRoute {
private var ctaBadge:CTABadge;
override protected function init():void{
Constants.ROUTE = Constants.ROUTE_CHALLENGE;
mc = Main.afm.createMovieClip("gui", "screen_title_challenge");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
ctaBadge = new CTABadge(mc.CTAsticker_btn);
load_btn = new DynamicButton(mc.load_btn, "race.btn");
UserManager.instance().renderer = new RacerRenderer();
starRatings = new StarRatings(mc.stars_mc);
}
override protected function displayTrackTime():void{
mc.time_2_time_txt.text = RaceTimer.formatTime(Main.um.currentChallengeDetails.topTime);
}
override protected function _loadTrack():void{
tl = new TrackLoader();
tl.loadChallenge(Constants.challengeId);
tl.addEventListener(Event.COMPLETE, _onTrackLoaderComplete);
tl.addEventListener(Event.CHANGE, _onTrackLoaderDetailsComplete);
}
override protected function _onTrackLoaderDetailsComplete(_arg1:Event):void{
if (Main.um.currentChallengeDetails.finished){
tl.removeEventListener(Event.COMPLETE, _onTrackLoaderComplete);
tl.removeEventListener(Event.CHANGE, _onTrackLoaderDetailsComplete);
Constants.ROUTE = Constants.ROUTE_COLD;
Main.sm.showScreen(new ScreenTitleChallengeOver());
};
super._onTrackLoaderDetailsComplete(_arg1);
}
override public function dispose():void{
if (ctaBadge){
ctaBadge.dispose();
};
super.dispose();
}
}
}//package com.kerb.modnation
Section 422
//ScreenTitleCompetitionRoute (com.kerb.modnation.ScreenTitleCompetitionRoute)
package com.kerb.modnation {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.data.*;
import flash.net.*;
import com.kerb.ui.*;
import com.kerb.modnation.tracks.renderers.*;
public class ScreenTitleCompetitionRoute extends ScreenTitleChallengeRoute {
override protected function init():void{
Constants.ROUTE = Constants.ROUTE_COMPETITION;
mc = Main.afm.createMovieClip("gui", "screen_title_competition");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
load_btn = new DynamicButton(mc.load_btn, "load.btn");
UserManager.instance().renderer = new RacerRenderer();
}
override protected function _onTrackLoaderDetailsComplete(_arg1:Event):void{
tl.removeEventListener(Event.CHANGE, _onTrackLoaderDetailsComplete);
var _local2:Loader = new Loader();
trace(Main.um.currentChallengeDetails.competitionImageUrl);
_local2.load(new URLRequest(Main.um.currentChallengeDetails.competitionImageUrl));
mc.largCTA_mc.CTAholder_mc.addChild(_local2);
}
override protected function _onInit(_arg1:Event):void{
mc.stop();
mc.removeEventListener(Event.INIT, _onInit);
ButtonSupport.setupButton(load_btn, _onLoadClick);
_loadTrack();
}
}
}//package com.kerb.modnation
Section 423
//ScreenTitleTrackRoute (com.kerb.modnation.ScreenTitleTrackRoute)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.data.*;
import com.kerb.modnation.data.*;
import com.kerb.modnation.racer.*;
import com.kerb.modnation.domain.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.modnation.tracks.renderers.*;
import com.kerb.modnation.profile.*;
public class ScreenTitleTrackRoute extends AbstractScreen {
protected var load_btn:DynamicButton;
protected var starRatings:StarRatings;
protected var create_btn:DynamicButton;
protected var thumbnailLoader:ThumbnailLoader;
private var ctaBadge:CTABadge;
protected var trackDetails:TrackDetails;
protected var tl:TrackLoader;
protected var nextScreen:AbstractScreen;
protected function _loadTrack():void{
tl = new TrackLoader();
tl.loadTrack(Constants.trackId);
tl.addEventListener(Event.COMPLETE, _onTrackLoaderComplete);
tl.addEventListener(Event.CHANGE, _onTrackLoaderDetailsComplete);
}
override protected function init():void{
Constants.ROUTE = Constants.ROUTE_TRACK;
mc = Main.afm.createMovieClip("gui", "screen_title_challenge");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
addChild(mc);
ctaBadge = new CTABadge(mc.CTAsticker_btn);
load_btn = new DynamicButton(mc.load_btn, "race.btn");
UserManager.instance().renderer = new RacerRenderer();
starRatings = new StarRatings(mc.stars_mc);
}
protected function displayTrackTime():void{
mc.time_2_time_txt.text = RaceTimer.formatTime(Main.um.currentTrackDetails.topTime);
}
protected function _onComplete(_arg1:Event):void{
mc.removeEventListener(Event.COMPLETE, _onComplete);
dispatchEvent(new ScreenEvent(nextScreen));
}
protected function _onTrackLoaderDetailsComplete(_arg1:Event):void{
tl.removeEventListener(Event.CHANGE, _onTrackLoaderDetailsComplete);
displayTrackTime();
thumbnailLoader = new ThumbnailLoader(mc.thumbnail_mc, Main.um.currentTrackDetails.environment, UserManager.instance().currentTrackDetails.thumbnailUrl);
thumbnailLoader.loader.x = (thumbnailLoader.loader.x + 7);
thumbnailLoader.loader.y = (thumbnailLoader.loader.y + 5);
mc.track_txt.text = Main.um.currentTrackDetails.name;
starRatings.setDetails(Main.um.currentTrackDetails.id, Main.um.currentTrackDetails.isRated, Main.um.currentTrackDetails.user, Main.um.currentTrackDetails.ratingTotal, Main.um.currentTrackDetails.ratingCount);
starRatings.interactive = false;
}
protected function _onLoadClick(_arg1:MouseEvent):void{
Main.playSoundFX(Main.SFX_NAME_GUI_SELECT);
nextScreen = new ScreenCarSelect();
mc.play();
}
override public function dispose():void{
ButtonSupport.setupButton(load_btn, _onLoadClick);
load_btn.dispose();
if (starRatings != null){
starRatings.dispose();
};
}
protected function _onInit(_arg1:Event):void{
mc.stop();
mc.removeEventListener(Event.INIT, _onInit);
TextManager.getInstance().setTextField(mc.title_txt, "title.route.track");
TextManager.getInstance().setTextField(mc.instructions_txt, "instructions.route.track.1");
ButtonSupport.setupButton(load_btn, _onLoadClick);
_loadTrack();
}
protected function _onTrackLoaderComplete(_arg1:Event):void{
tl.removeEventListener(Event.COMPLETE, _onTrackLoaderComplete);
}
}
}//package com.kerb.modnation
Section 424
//ScreenVideo (com.kerb.modnation.ScreenVideo)
package com.kerb.modnation {
import flash.events.*;
import com.kerb.utils.*;
import com.kerb.game.screencontrol.*;
import com.kerb.ui.*;
import com.kerb.video.*;
public class ScreenVideo extends AbstractScreen {
private var vid:SimpleVideoPlayer;
private var _nextScreen:AbstractScreen;
private var thumb_1_btn:DynamicButton;
private var thumb_2_btn:DynamicButton;
private var thumb_3_btn:DynamicButton;
private var thumb_4_btn:DynamicButton;
private var thumb_6_btn:DynamicButton;
private var thumb_7_btn:DynamicButton;
private var currentItem:int;
private var thumb_5_btn:DynamicButton;
private function unselectAll():void{
var _local1 = 1;
while (_local1 <= 7) {
this[(("thumb_" + _local1.toString()) + "_btn")].selected = false;
_local1++;
};
}
protected function _onChange(_arg1:Event):void{
}
override protected function init():void{
mc = Main.afm.createMovieClip("gui", "screen_video");
mc.addEventListener(Event.INIT, _onInit);
mc.addEventListener(Event.COMPLETE, _onComplete);
mc.addEventListener(Event.CHANGE, _onChange);
thumb_1_btn = new DynamicButton(mc.gallery_mc.thumb_1_btn);
thumb_2_btn = new DynamicButton(mc.gallery_mc.thumb_2_btn);
thumb_3_btn = new DynamicButton(mc.gallery_mc.thumb_3_btn);
thumb_4_btn = new DynamicButton(mc.gallery_mc.thumb_4_btn);
thumb_5_btn = new DynamicButton(mc.gallery_mc.thumb_5_btn);
thumb_6_btn = new DynamicButton(mc.gallery_mc.thumb_6_btn);
thumb_7_btn = new DynamicButton(mc.gallery_mc.thumb_7_btn);
addChild(mc);
changeItem(1);
}
override public function dispose():void{
mc.removeEventListener(Event.INIT, _onInit);
mc.removeEventListener(Event.COMPLETE, _onComplete);
mc.removeEventListener(Event.CHANGE, _onChange);
ButtonSupport.unsetupButton(thumb_1_btn, onChangeItem);
ButtonSupport.unsetupButton(thumb_2_btn, onChangeItem);
ButtonSupport.unsetupButton(thumb_3_btn, onChangeItem);
ButtonSupport.unsetupButton(thumb_4_btn, onChangeItem);
ButtonSupport.unsetupButton(thumb_5_btn, onChangeItem);
ButtonSupport.unsetupButton(thumb_6_btn, onChangeItem);
ButtonSupport.unsetupButton(thumb_7_btn, onChangeItem);
thumb_1_btn.dispose();
thumb_2_btn.dispose();
thumb_3_btn.dispose();
thumb_4_btn.dispose();
thumb_5_btn.dispose();
thumb_6_btn.dispose();
thumb_7_btn.dispose();
vid.stopVideo();
vid.dispose();
Main.smMusic.getSoundByClassName(Main.musicName).setVolume(1);
}
private function changeItem(_arg1:Number):void{
if (currentItem == _arg1){
return;
};
currentItem = _arg1;
unselectAll();
this[(("thumb_" + _arg1.toString()) + "_btn")].selected = true;
if (vid != null){
vid.stopVideo();
vid.dispose();
mc.video_mc.removeChild(vid);
};
vid = new SimpleVideoPlayer();
mc.video_mc.addChild(vid);
vid.playVideo((((Constants.VIDEO_BASE_URL + "gallery") + _arg1.toString()) + ".flv"));
Main.smMusic.getSoundByClassName(Main.musicName).fadeTo(0, 1);
}
private function onChangeItem(_arg1:MouseEvent):void{
var _local2:Number = Number((_arg1.currentTarget as DynamicButton).name.split("_")[1]);
changeItem(_local2);
}
protected function _onInit(_arg1:Event):void{
thumb_7_btn.visible = false;
ButtonSupport.setupButton(thumb_1_btn, onChangeItem);
ButtonSupport.setupButton(thumb_2_btn, onChangeItem);
ButtonSupport.setupButton(thumb_3_btn, onChangeItem);
ButtonSupport.setupButton(thumb_4_btn, onChangeItem);
ButtonSupport.setupButton(thumb_5_btn, onChangeItem);
ButtonSupport.setupButton(thumb_6_btn, onChangeItem);
ButtonSupport.setupButton(thumb_7_btn, onChangeItem);
TextManager.getInstance().setTextField(mc.gallery_mc.movies_mc.label_txt, "video.btn");
mc.stop();
}
protected function _onComplete(_arg1:Event):void{
dispatchEvent(new ScreenEvent(_nextScreen));
}
}
}//package com.kerb.modnation
Section 425
//Tracking (com.kerb.modnation.Tracking)
package com.kerb.modnation {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import com.kerb.tracking.*;
import com.memecounter.*;
public class Tracking {
public static const PLACE_TRACK_PROPS_NEXT_STEP_BTN:String = "Place Track Props - Next Step Button";
public static const QUICK_RACE:String = "Quick Race - Main Page";
public static const FIND_OUT_MORE:String = "Find Out More - Main Page";
public static const DRAW_TRACK_NEXT_STEP_BTN:String = "Draw Track - Next Step Button";
public static const RACE_TRACK_ACCEPT_CHALLENGE:String = "Race Track - Accept Challenge";
public static const GAME_LOADED_KERB_SOCIAL_LOCAL_TEST:String = "Game Loaded - Facebook Local Test";
public static const NEW_CHALLENGE_ICON:String = "New Challenge Icon";
public static const START_CREATING:String = "Start Creating - Main Page";
public static const PSP_URL_CLICKTHROUGH:String = "PSP URL Clickthrough";
public static const GAME_LOADED_SONY_SITE_FB_CONNECT:String = "Game Loaded - Sony Site/FB Connect";
public static const SUBMIT_TRACK_ENTRY_BTN:String = "Submit Track Entry Button";
public static const GAME_LOADED_STUDIVZ:String = "Game Loaded - studiVZ";
public static const RACE_TRACK_ACCEPT_COMPETITION:String = "Race Track - Accept Competition";
public static const START_OVER_BTN:String = "Start Over Button";
public static const GAME_LOADED_SEEDED_VERSION:String = "Game Loaded - Seeded Version";
public static const GAME_LOADED_FACEBOOK_APP:String = "Game Loaded - Facebook App";
public static const CREATE_CHALLENGE_BTN:String = "Create Challenge Button";
public static const GAME_LOADED_HYVES:String = "Game Loaded - Hyves";
public static const NEW_TROPHIES_ICON:String = "New Trophies Icon";
public static const RACE_TRACK:String = "Race Track";
public static const RACE_AGAIN_BTN:String = "Race Again Button";
public static const EXPLORE_TRACKS:String = "Explore Tracks - Main Page";
public static const POST_TO_STUDIVZ_BTN:String = "Post to studiVZ";
public static const CHOOSE_THEME_NEXT_STEP_BTN:String = "Choose Theme - Next Step Button";
public static const EXPLORE_MODNATION_BTN:String = "Explore Modnation Racers Button - Main Page";
public static const COUNTRY_SELECT_BTN:String = "Country Select Button";
public static const POST_TO_HYVES_BTN:String = "Post to Hyves";
public static const POST_TO_FACEBOOK_BTN:String = "Post To Facebook Button";
public static const POST_TO_NETLOG_BTN:String = "Post to Netlog";
public static const LOG_IN_WITH_FACEBOOK_CONNECT:String = "Log in with Facebook Connect";
public static const SAVE_TRACK_AND_TIME_BTN:String = "Save Track & Time Button";
public static const GAME_LOADED:String = "Game Loaded";
public static const CHALLENGE_FRIENDS_BTN:String = "Challenge Friends Button";
public static const PLACE_THEME_PROPS_NEXT_STEP_BTN:String = "Place Theme Props - Next Step Button";
public static const GAME_LOADED_NETLOG:String = "Game Loaded - Netvibes";
public static const PS3_URL_CLICKTHROUGH:String = "PS3 URL Clickthrough";
public static const PRINT_TRACK_BTN:String = "Print Track Button";
private static var _timer:Timer;
private static var _buffer:Array = [];
public static function track(_arg1:String):void{
var _local2:int;
var _local3:int;
var _local4 = "";
if (_arg1 == GAME_LOADED){
_local2 = 677;
_local3 = 13611;
_local4 = (Constants.LOCALE + "/Global/Loaded");
};
if (_arg1 == QUICK_RACE){
_local2 = 678;
_local3 = 13614;
_local4 = (Constants.LOCALE + "/Global/QuickRace");
};
if (_arg1 == EXPLORE_TRACKS){
_local2 = 679;
_local3 = 13615;
_local4 = (Constants.LOCALE + "/Global/ExploreTracks");
};
if (_arg1 == START_CREATING){
_local2 = 680;
_local3 = 13616;
_local4 = (Constants.LOCALE + "/Global/StartCreating");
};
if (_arg1 == FIND_OUT_MORE){
_local2 = 681;
_local3 = 13617;
_local4 = (Constants.LOCALE + "/Global/FindOutMore");
};
if (_arg1 == EXPLORE_MODNATION_BTN){
_local2 = 682;
_local3 = 13618;
_local4 = (Constants.LOCALE + "/Global/ExploreModNationBtn");
};
if (_arg1 == PSP_URL_CLICKTHROUGH){
_local2 = 683;
_local3 = 13619;
_local4 = (Constants.LOCALE + "/Global/PSPUrlClickthrough");
};
if (_arg1 == PS3_URL_CLICKTHROUGH){
_local2 = 684;
_local3 = 13622;
_local4 = (Constants.LOCALE + "/Global/PS3UrlClickthrough");
};
if (_arg1 == COUNTRY_SELECT_BTN){
_local2 = 685;
_local3 = 13623;
_local4 = (Constants.LOCALE + "/Global/CountrySelectBtn");
};
if (_arg1 == NEW_CHALLENGE_ICON){
_local2 = 686;
_local3 = 13624;
_local4 = (Constants.LOCALE + "/Global/NewChallengeIcon");
};
if (_arg1 == NEW_TROPHIES_ICON){
_local2 = 687;
_local3 = 13625;
_local4 = (Constants.LOCALE + "/Global/NewTrophiesIcon");
};
if (_arg1 == CHOOSE_THEME_NEXT_STEP_BTN){
_local2 = 688;
_local3 = 13626;
_local4 = (Constants.LOCALE + "/Global/ChooseThemeNextStepBtn");
};
if (_arg1 == DRAW_TRACK_NEXT_STEP_BTN){
_local2 = 689;
_local3 = 13627;
_local4 = (Constants.LOCALE + "/Global/DrawTrackNextStepBtn");
};
if (_arg1 == PLACE_THEME_PROPS_NEXT_STEP_BTN){
_local2 = 690;
_local3 = 13628;
_local4 = (Constants.LOCALE + "/Global/PlaceThemePropsNextStepBtn");
};
if (_arg1 == PLACE_TRACK_PROPS_NEXT_STEP_BTN){
_local2 = 691;
_local3 = 13629;
_local4 = (Constants.LOCALE + "/Global/PlaceTrackPropsNextStepBtn");
};
if (_arg1 == START_OVER_BTN){
_local2 = 692;
_local3 = 13630;
_local4 = (Constants.LOCALE + "/Global/StartOverBtn");
};
if (_arg1 == SAVE_TRACK_AND_TIME_BTN){
_local2 = 693;
_local3 = 13631;
_local4 = (Constants.LOCALE + "/Global/SaveTrackAndTimeBtn");
};
if (_arg1 == CHALLENGE_FRIENDS_BTN){
_local2 = 694;
_local3 = 13632;
_local4 = (Constants.LOCALE + "/Global/ChallengeFriendsBtn");
};
if (_arg1 == POST_TO_FACEBOOK_BTN){
_local2 = 695;
_local3 = 13633;
_local4 = (Constants.LOCALE + "/Global/PostToFacebookBtn");
};
if (_arg1 == POST_TO_NETLOG_BTN){
_local2 = 696;
_local3 = 13634;
_local4 = (Constants.LOCALE + "/Global/PostToNetlogBtn");
};
if (_arg1 == POST_TO_STUDIVZ_BTN){
_local2 = 697;
_local3 = 13635;
_local4 = (Constants.LOCALE + "/Global/PostToStudiVZBtn");
};
if (_arg1 == POST_TO_HYVES_BTN){
_local2 = 698;
_local3 = 13639;
_local4 = (Constants.LOCALE + "/Global/PostToHyvesBtn");
};
if (_arg1 == CREATE_CHALLENGE_BTN){
_local2 = 699;
_local3 = 13640;
_local4 = (Constants.LOCALE + "/Global/CreateChallengeBtn");
};
if (_arg1 == RACE_AGAIN_BTN){
_local2 = 700;
_local3 = 13641;
_local4 = (Constants.LOCALE + "/Global/RaceAgainBtn");
};
if (_arg1 == RACE_TRACK_ACCEPT_CHALLENGE){
_local2 = 701;
_local3 = 13642;
_local4 = (Constants.LOCALE + "/Global/RaceTrackAcceptChallenge");
};
if (_arg1 == LOG_IN_WITH_FACEBOOK_CONNECT){
_local2 = 702;
_local3 = 13643;
_local4 = (Constants.LOCALE + "/Global/FacebookConnect");
};
if (_arg1 == PRINT_TRACK_BTN){
_local2 = 703;
_local3 = 13644;
_local4 = (Constants.LOCALE + "/Global/PrintTrackBtn");
};
if (_arg1 == SUBMIT_TRACK_ENTRY_BTN){
_local2 = 704;
_local3 = 13645;
_local4 = (Constants.LOCALE + "/Global/SubmitTrackEntryBtn");
};
if (_arg1 == GAME_LOADED_FACEBOOK_APP){
_local2 = 733;
_local3 = 13646;
_local4 = (Constants.LOCALE + "/Global/GameLoadedFacebook");
};
if (_arg1 == GAME_LOADED_NETLOG){
_local2 = 734;
_local3 = 13647;
_local4 = (Constants.LOCALE + "/Global/GameLoadedNetlog");
};
if (_arg1 == GAME_LOADED_STUDIVZ){
_local2 = 735;
_local3 = 13648;
_local4 = (Constants.LOCALE + "/Global/GameLoadedStudiVZ");
};
if (_arg1 == GAME_LOADED_HYVES){
_local2 = 736;
_local3 = 13649;
_local4 = (Constants.LOCALE + "/Global/GameLoadedHyves");
};
if (_arg1 == GAME_LOADED_SEEDED_VERSION){
_local2 = 737;
_local3 = 13650;
_local4 = (Constants.LOCALE + "/Global/GameLoadedSeededVersion");
};
if (_arg1 == GAME_LOADED_SONY_SITE_FB_CONNECT){
_local2 = 738;
_local3 = 13651;
_local4 = (Constants.LOCALE + "/Global/GameLoadedSOnySiteFBConnect");
};
if (_arg1 == GAME_LOADED_KERB_SOCIAL_LOCAL_TEST){
_local2 = 739;
_local3 = 13703;
_local4 = (Constants.LOCALE + "/Global/GameLoadedKerbSocialLocalTest");
};
if (_arg1 == RACE_TRACK_ACCEPT_COMPETITION){
_local2 = 740;
_local3 = 13745;
_local4 = (Constants.LOCALE + "/Global/RaceTrackAcceptCompetition");
};
if (_arg1 == RACE_TRACK){
_local2 = 741;
_local3 = 13746;
_local4 = (Constants.LOCALE + "/Global/RaceTrack");
};
if (_local4 != ""){
_buffer.push({tracker:"wt", value:_local4, tracking_const:_arg1});
};
if (_local2 > 0){
_buffer.push({tracker:"dq", value:_local2});
};
if (_local3 > 0){
_buffer.push({tracker:"me", value:_local3});
};
}
private static function _trackTick(_arg1:TimerEvent):void{
var _local2:Object;
var _local3:String;
if (((Tracker.isReady) && ((_buffer.length > 0)))){
_local2 = _buffer.shift();
for (_local3 in _local2) {
trace(((_local3 + " is ") + _local2[_local3]));
};
switch (_local2.tracker){
case "wt":
WebTrends.event2(_local2.value, _local2.tracking_const, Constants.LOCALE);
break;
case "dq":
DoubleQuick.event(_local2.value);
break;
case "me":
Tracker.kvEvent(_local2.value);
break;
};
};
}
public static function _initTracking(_arg1:DisplayObject):void{
DoubleQuick.init(_arg1, 106);
Tracker.init(880, _arg1);
if (Constants.KERB_SOCIAL_ID == Constants.KERB_SOCIAL_FACEBOOK_APP){
WebTrends.init(_arg1, "webtrends.eu.playstation.com", "dcswgust510000ctuw0jz1t5i_6r4w", "FBApp_10007");
} else {
WebTrends.init(_arg1, "webtrends.eu.playstation.com", "dcsdlgrgz00000g8t8imx9t5i_1x5z", "game_10016");
};
_timer = new Timer(100);
_timer.addEventListener(TimerEvent.TIMER, _trackTick);
_timer.start();
Tracking.track(GAME_LOADED);
}
}
}//package com.kerb.modnation
Section 426
//EmptySocialManager (com.kerb.social.empty.EmptySocialManager)
package com.kerb.social.empty {
import flash.display.*;
import com.kerb.social.*;
public class EmptySocialManager extends AbstractSocialManager {
public function EmptySocialManager(_arg1:LoaderInfo){
super(_arg1);
}
}
}//package com.kerb.social.empty
Section 427
//FacebookAppManager (com.kerb.social.facebook.FacebookAppManager)
package com.kerb.social.facebook {
import flash.display.*;
import com.kerb.social.*;
import flash.net.*;
import com.facebook.events.*;
import com.facebook.data.*;
import com.facebook.*;
import com.facebook.data.users.*;
import com.facebook.utils.*;
import com.kerb.facebook.*;
import com.facebook.commands.users.*;
public class FacebookAppManager extends AbstractSocialManager implements ISocialManager {
private var bridge:FBJSBridgeUtil;
protected var friendsList:FriendList;
protected var _fbSessionUtil:FacebookSessionUtil;
protected var fb:Facebook;
public function FacebookAppManager(_arg1:LoaderInfo){
super(_arg1);
}
override public function get uidPrefix():String{
return ("FB_");
}
protected function _checkPermissions():void{
trace("checking email permisison");
var _local1:HasAppPermission = new HasAppPermission(HasAppPermissionValues.EMAIL);
_local1.addEventListener(FacebookEvent.COMPLETE, _onPermissionDisclosed, false, 0, true);
fb.post(_local1);
}
override public function getUserById(_arg1:String):ISocialUser{
return (((friendsList == null)) ? new SocialUserBasic() : new SocialUserFacebook(friendsList.friends.getUserById(_arg1)));
}
protected function _onPermissionDisclosed(_arg1:FacebookEvent):void{
if (((_arg1.success) && ((_arg1.data as BooleanResultData).value))){
trace(" email permisison ok");
loadFriends();
} else {
trace("asking for email permisison");
if (bridge != null){
bridge.call("Facebook.showPermissionDialog", ["publish_stream,email"]);
} else {
loadFriends();
};
};
}
override public function loadFriends():void{
trace("loadFriends");
friendsList = new FriendList(fb);
friendsList.addEventListener(FacebookEvent.COMPLETE, _onFriendsLoaded);
friendsList.load();
}
override public function get uid():String{
return (fb.uid);
}
override public function sendAppInvites(_arg1:String=null):void{
var _local3:String;
var _local4:Array;
var _local5:Array;
var _local6:String;
var _local7:int;
var _local8:String;
var _local9:Boolean;
var _local10:int;
var _local2:String = filterStringIDsbyAppUsers(_arg1, false, false);
if (((!((_local2 == null))) && (!((_local2 == ""))))){
_local3 = friendsIDsAsString();
_local4 = _local2.split(",");
_local5 = _local3.split(",");
_local6 = "";
_local7 = 0;
while (_local7 < _local5.length) {
_local9 = true;
_local10 = 0;
while (_local10 < _local4.length) {
if (_local4[_local10] == _local5[_local7]){
_local9 = false;
};
_local10++;
};
if (_local9){
_local6 = ((_local6 == "")) ? _local5[_local7] : ((_local6 + ",") + _local5[_local7]);
};
_local7++;
};
_local8 = app.buildMessage({invite:true, userIDs:_local6});
navigateToURL(new URLRequest(_local8));
};
}
override public function get friends():Array{
var _local2:int;
var _local3:FacebookUser;
var _local1:Array = [];
if (((!((friendsList == null))) && (!((friendsList.friends == null))))){
_local2 = 0;
while (_local2 < friendsList.friends.length) {
_local3 = FacebookUser(friendsList.friends.getItemAt(_local2));
_local1.push(new SocialUserFacebook(_local3));
_local2++;
};
};
_local1.sortOn("username");
return (_local1);
}
protected function _onFriendsLoaded(_arg1:FacebookEvent):void{
allComplete();
}
protected function onFacebookConnect(_arg1:FacebookEvent):void{
_fbSessionUtil.removeEventListener(FacebookEvent.CONNECT, onFacebookConnect);
trace("connect complete");
_checkPermissions();
}
override public function init():void{
super.init();
if (loaderInfo.parameters.hasOwnProperty("fb_local_connection")){
trace(("Setting up bridge " + loaderInfo.parameters["fb_local_connection"]));
bridge = new FBJSBridgeUtil(Constants.FACEBOOK_API_KEY, loaderInfo.parameters.fb_local_connection, loaderInfo.parameters.fb_fbjs_connection);
};
_fbSessionUtil = new FacebookSessionUtil(Constants.FACEBOOK_API_KEY, loaderInfo.parameters.prfb_sig_ss, loaderInfo);
fb = _fbSessionUtil.facebook;
_fbSessionUtil.addEventListener(FacebookEvent.CONNECT, onFacebookConnect);
_fbSessionUtil.verifySession();
}
override public function generateInternalLink(_arg1:Object, _arg2:Function):void{
}
override public function sendMessage(_arg1:Object):void{
var _local2:String;
var _local3:PublishActivity;
switch (_arg1.route){
case "DASHBOARD":
_local2 = _arg1.message;
_local3 = new PublishActivity({message:_local2});
fb.post(_local3);
break;
case "WALL":
if (bridge != null){
bridge.call("Facebook.streamPublish", app.buildMessage(_arg1), app.buildAttachment(_arg1));
};
break;
};
}
}
}//package com.kerb.social.facebook
Section 428
//FacebookConnectManager (com.kerb.social.facebook.FacebookConnectManager)
package com.kerb.social.facebook {
import flash.display.*;
import com.kerb.social.*;
import com.facebook.events.*;
import com.facebook.session.*;
import com.facebook.*;
import com.kerb.facebook.*;
import flash.external.*;
public class FacebookConnectManager extends FacebookAppManager implements ISocialManager {
protected var sessionData:Object;
protected var session2:WebSession;
public function FacebookConnectManager(_arg1:LoaderInfo){
super(_arg1);
}
override protected function onFacebookConnect(_arg1:FacebookEvent):void{
session2.removeEventListener(FacebookEvent.CONNECT, onFacebookConnect);
trace("connect complete");
if (_arg1.success){
trace("success");
_checkPermissions();
};
}
override public function sendMessage(_arg1:Object):void{
var _local2:String;
var _local3:PublishActivity;
switch (_arg1.route){
case "DASHBOARD":
_local2 = _arg1.message;
_local3 = new PublishActivity({message:_local2});
fb.post(_local3);
break;
case "WALL":
ExternalInterface.call("FB.Connect.streamPublish", app.buildMessage(_arg1), app.buildAttachment(_arg1));
break;
};
}
override public function get uid():String{
if (sessionData != null){
return (sessionData.uid);
};
return (fb.uid);
}
override public function init():void{
ExternalInterface.addCallback("onSession", onSession);
ExternalInterface.call("fbconnectlogin");
}
protected function onSession(_arg1:Object):void{
trace("session returned");
sessionData = _arg1;
session2 = new WebSession(Constants.FACEBOOK_API_KEY, sessionData.secret, sessionData.session_key);
session2.addEventListener(FacebookEvent.CONNECT, onFacebookConnect);
fb = new Facebook();
fb.startSession(session2);
trace("started session");
session2.verifySession();
trace("started verifySession");
}
}
}//package com.kerb.social.facebook
Section 429
//FacebookLocalTestManager (com.kerb.social.facebook.FacebookLocalTestManager)
package com.kerb.social.facebook {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import com.kerb.modnation.UI.*;
import com.kerb.social.*;
import com.facebook.events.*;
import com.kerb.modnation.*;
public class FacebookLocalTestManager extends FacebookAppManager implements ISocialManager {
public function FacebookLocalTestManager(_arg1:LoaderInfo){
super(_arg1);
}
public function validateLogin():void{
_fbSessionUtil.validateLogin();
}
public function continueLogin():void{
_fbSessionUtil.addEventListener(FacebookEvent.CONNECT, onFacebookConnect, false, 0, true);
_fbSessionUtil.login(false);
}
private function showWaitforLogin():void{
var _local1:FacebookOverlay = new FacebookOverlay();
var _local2:DynamicEvent = new DynamicEvent(UI.EVENT_SHOW_OVERLAY);
_local2.overlay = _local1;
Main.STAGE.dispatchEvent(_local2);
}
override protected function onFacebookConnect(_arg1:FacebookEvent):void{
_fbSessionUtil.removeEventListener(FacebookEvent.CONNECT, onFacebookConnect);
trace("connect complete");
if (_arg1.success){
trace("success");
_checkPermissions();
} else {
trace("fail");
Main.STAGE.dispatchEvent(new Event(UI.EVENT_HIDE_LOADING));
showWaitforLogin();
};
}
}
}//package com.kerb.social.facebook
Section 430
//SocialUserFacebook (com.kerb.social.facebook.SocialUserFacebook)
package com.kerb.social.facebook {
import com.kerb.social.*;
import com.facebook.data.users.*;
public class SocialUserFacebook implements ISocialUser {
private var _fbu:FacebookUser;
public function SocialUserFacebook(_arg1:FacebookUser){
_fbu = ((_arg1 == null)) ? new FacebookUser() : _arg1;
super();
}
public function get isAppUser():Boolean{
return (_fbu.is_app_user);
}
public function get picUrl():String{
return (_fbu.pic_square);
}
public function get uid():String{
return (_fbu.uid);
}
public function get username():String{
return (((_fbu.first_name + " ") + _fbu.last_name));
}
public function get email():String{
return (_fbu.email);
}
}
}//package com.kerb.social.facebook
Section 431
//HyvesOpenSocialManager (com.kerb.social.opensocial.HyvesOpenSocialManager)
package com.kerb.social.opensocial {
import flash.display.*;
import com.kerb.social.*;
public class HyvesOpenSocialManager extends OpenSocialManager implements ISocialManager {
public function HyvesOpenSocialManager(_arg1:LoaderInfo){
super(_arg1);
}
override public function get uidPrefix():String{
return ("HY_");
}
}
}//package com.kerb.social.opensocial
Section 432
//NetlogOpenSocialManager (com.kerb.social.opensocial.NetlogOpenSocialManager)
package com.kerb.social.opensocial {
import flash.display.*;
import com.kerb.social.*;
public class NetlogOpenSocialManager extends OpenSocialManager implements ISocialManager {
public function NetlogOpenSocialManager(_arg1:LoaderInfo){
super(_arg1);
}
override public function get uidPrefix():String{
return ("NL_");
}
}
}//package com.kerb.social.opensocial
Section 433
//OpenSocialManager (com.kerb.social.opensocial.OpenSocialManager)
package com.kerb.social.opensocial {
import flash.display.*;
import com.kerb.social.*;
import flash.external.*;
public class OpenSocialManager extends AbstractSocialManager implements ISocialManager {
protected var _friends:Array;
protected var currentUser:OpenSocialUser;
public function OpenSocialManager(_arg1:LoaderInfo){
super(_arg1);
ExternalInterface.call("hideLoader");
}
protected function onSendMessage(_arg1:Boolean):void{
}
override public function get uidPrefix():String{
return ("OS_");
}
protected function onAddWallPost(_arg1:Boolean):void{
}
override public function getUserById(_arg1:String):ISocialUser{
return (((friends)==null) ? null : _getUserById(_arg1));
}
override public function init():void{
ExternalInterface.addCallback("onGetCurrentUserData", onGetCurrentUserData);
ExternalInterface.addCallback("onGetFriendsWithApp", onGetFriendsWithApp);
ExternalInterface.addCallback("onSendInvite", onSendInvite);
ExternalInterface.addCallback("onSendMessage", onSendMessage);
ExternalInterface.addCallback("onAddWallPost", onAddWallPost);
trace("calling getCurrentUserData");
ExternalInterface.call("getCurrentUserData");
}
override public function sendAppInvites(_arg1:String=null):void{
trace("sendAppInvites");
ExternalInterface.call("sendInvite", _arg1);
}
override public function get friends():Array{
return (_friends);
}
override public function get uid():String{
return (((currentUser == null)) ? null : currentUser.uid);
}
override public function loadFriends():void{
trace("calling getFriendsWithApp");
ExternalInterface.call("getFriendsWithApp");
}
override public function sendMessage(_arg1:Object):void{
var _local2:String;
var _local3:String;
_arg1.openSocialTitle = true;
_local2 = app.buildMessage(_arg1);
_arg1.openSocialTitle = false;
_arg1.openSocialBody = true;
_local3 = app.buildMessage(_arg1);
switch (_arg1.route){
case "DASHBOARD":
ExternalInterface.call("sendMessage", uid, _local2, _local3);
break;
case "WALL":
ExternalInterface.call("addWallPost", _local2, _local3);
break;
};
}
protected function onSendInvite(_arg1:Number):void{
}
protected function _getUserById(_arg1:String):ISocialUser{
var _local2:ISocialUser;
var _local3:int;
var _local4:OpenSocialUser;
if (_arg1 == currentUser.uid){
_local2 = currentUser;
} else {
_local3 = 0;
while (_local3 < friends.length) {
_local4 = OpenSocialUser(friends[_local3]);
if (_local4.uid == _arg1){
_local2 = _local4;
break;
};
_local3++;
};
};
return (_local2);
}
protected function onGetCurrentUserData(_arg1:Object):void{
currentUser = new OpenSocialUser(_arg1);
loadFriends();
}
override public function generateInternalLink(_arg1:Object, _arg2:Function):void{
}
protected function onGetFriendsWithApp(_arg1:Array):void{
_friends = [];
var _local2:int;
while (_local2 < _arg1.length) {
_friends[_local2] = new OpenSocialUser(_arg1[_local2]);
_local2++;
};
sendAppInvites();
allComplete();
}
}
}//package com.kerb.social.opensocial
Section 434
//OpenSocialUser (com.kerb.social.opensocial.OpenSocialUser)
package com.kerb.social.opensocial {
import com.kerb.social.*;
public class OpenSocialUser implements ISocialUser {
private var _data:Object;
public function OpenSocialUser(_arg1:Object){
_data = _arg1;
trace(uid, username, picUrl);
}
public function get isAppUser():Boolean{
return (_data.isAppUser);
}
public function get email():String{
return (_data.email);
}
public function get picUrl():String{
return (_data.picUrl);
}
public function get uid():String{
return (_data.uid);
}
public function get username():String{
return (_data.username);
}
}
}//package com.kerb.social.opensocial
Section 435
//VZOpenSocialManager (com.kerb.social.opensocial.VZOpenSocialManager)
package com.kerb.social.opensocial {
import flash.display.*;
import com.kerb.social.*;
public class VZOpenSocialManager extends OpenSocialManager implements ISocialManager {
public function VZOpenSocialManager(_arg1:LoaderInfo){
super(_arg1);
}
override public function get uidPrefix():String{
return ("VZ_");
}
}
}//package com.kerb.social.opensocial
Section 436
//AbstractSocialManager (com.kerb.social.AbstractSocialManager)
package com.kerb.social {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class AbstractSocialManager extends EventDispatcher implements ISocialManager {
protected var loaderInfo:LoaderInfo;
public var _app:ISocialApp;
public static const EVENT_LOADING_COMPLETE:String = "EVENT_LOADING_COMPLETE";
public static const EVENT_LOADING:String = "EVENT_LOADING";
public function AbstractSocialManager(_arg1:LoaderInfo){
loaderInfo = _arg1;
trace(("SocialManager:" + uidPrefix));
}
public function getPicForUser(_arg1:String, _arg2:Boolean):Loader{
var _local4:String;
var _local5:String;
var _local6:ISocialUser;
var _local3:Loader = new Loader();
_local4 = _arg1.split("_")[1];
switch (_arg1.split("_")[0]){
case "FB":
_local5 = (("http://graph.facebook.com/" + _local4) + "/picture");
break;
case "OS":
case "VZ":
case "HY":
case "NL":
_local6 = getUserById(_local4);
if (((((!((_local6 == null))) && (!((_local6.picUrl == null))))) && (!((_local6.picUrl == ""))))){
_local5 = _local6.picUrl;
};
break;
};
if (_local5 != null){
_local3.load(new URLRequest(_local5));
};
return (_local3);
}
protected function allComplete():void{
dispatchEvent(new Event(Event.COMPLETE));
}
public function friendsIDsAsString(_arg1:String=""):String{
return (((friends == null)) ? "" : _idsAsString(_arg1));
}
public function handleError(_arg1:Boolean, _arg2:String=null):void{
trace(_arg2);
}
public function get uidPrefix():String{
return (null);
}
public function filterStringIDsbyAppUsers(_arg1:String, _arg2:Boolean, _arg3:Boolean):String{
return (((friends == null)) ? "" : _filterStringIDsbyAppUsers(_arg1, _arg2, _arg3));
}
private function _filterStringIDsbyAppUsers(_arg1:String, _arg2:Boolean, _arg3:Boolean):String{
var _local4:Array;
var _local5:String;
var _local6:int;
var _local7:ISocialUser;
var _local8:String;
if (_arg1 != null){
_local4 = _arg1.split(",");
_local6 = 0;
while (_local6 < _local4.length) {
_local7 = getUserById(_local4[_local6]);
if (_local7 != null){
_local8 = (_arg3) ? (uidPrefix + _local7.uid) : _local7.uid;
if (_local7.isAppUser == _arg2){
_local5 = ((_local5 == null)) ? _local8 : ((_local5 + ",") + _local8);
};
};
_local6++;
};
return (_local5);
//unresolved jump
};
return ("");
}
public function init():void{
}
public function get friends():Array{
return (null);
}
public function loadFriends():void{
}
public function get uid():String{
return (null);
}
public function sendAppInvites(_arg1:String=null):void{
}
public function sendMessage(_arg1:Object):void{
}
public function set app(_arg1:ISocialApp):void{
_app = _arg1;
}
public function generateInternalLink(_arg1:Object, _arg2:Function):void{
}
public function get app():ISocialApp{
return (_app);
}
public function getUserById(_arg1:String):ISocialUser{
return (((friends)==null) ? null : null);
}
private function _idsAsString(_arg1:String=""):String{
var _local2:String;
var _local4:ISocialUser;
var _local5:String;
var _local3:int;
while (_local3 < friends.length) {
_local4 = ISocialUser(friends[_local3]);
_local5 = (_arg1 + _local4.uid);
_local2 = ((_local2 == null)) ? _local5 : ((_local2 + ",") + _local5);
_local3++;
};
return (_local2);
}
}
}//package com.kerb.social
Section 437
//ISocialApp (com.kerb.social.ISocialApp)
package com.kerb.social {
public interface ISocialApp {
function buildAttachment(_arg1:Object):Object;
function buildMessage(_arg1:Object):String;
}
}//package com.kerb.social
Section 438
//ISocialManager (com.kerb.social.ISocialManager)
package com.kerb.social {
public interface ISocialManager {
function get app():ISocialApp;
function set app(_arg1:ISocialApp):void;
function get uidPrefix():String;
function generateInternalLink(_arg1:Object, _arg2:Function):void;
function loadFriends():void;
function init():void;
function sendAppInvites(_arg1:String=null):void;
function getUserById(_arg1:String):ISocialUser;
function get friends():Array;
function get uid():String;
function sendMessage(_arg1:Object):void;
}
}//package com.kerb.social
Section 439
//ISocialUser (com.kerb.social.ISocialUser)
package com.kerb.social {
public interface ISocialUser {
function get uid():String;
function get isAppUser():Boolean;
function get picUrl():String;
function get username():String;
function get email():String;
}
}//package com.kerb.social
Section 440
//SocialManagerFactory (com.kerb.social.SocialManagerFactory)
package com.kerb.social {
import flash.display.*;
import com.kerb.social.facebook.*;
import com.kerb.social.opensocial.*;
import com.kerb.social.empty.*;
public class SocialManagerFactory {
public static function SelectSMFromLoaderInfo(_arg1:LoaderInfo):ISocialManager{
var _local2:ISocialManager;
Constants.KERB_SOCIAL_ID = _arg1.parameters["kerb_social_id"];
switch (Constants.KERB_SOCIAL_ID){
case Constants.KERB_SOCIAL_FACEBOOK_APP:
_local2 = new FacebookAppManager(_arg1);
break;
case Constants.KERB_SOCIAL_LOCAL_TEST:
_local2 = new FacebookLocalTestManager(_arg1);
break;
case Constants.KERB_SOCIAL_FACEBOOK_CONNECT:
_local2 = new FacebookConnectManager(_arg1);
break;
case Constants.KERB_SOCIAL_VZ:
_local2 = new VZOpenSocialManager(_arg1);
break;
case Constants.KERB_SOCIAL_NETLOG:
_local2 = new NetlogOpenSocialManager(_arg1);
break;
case Constants.KERB_SOCIAL_HYVES:
_local2 = new HyvesOpenSocialManager(_arg1);
break;
default:
_local2 = new EmptySocialManager(_arg1);
break;
};
return (_local2);
}
}
}//package com.kerb.social
Section 441
//SocialUserBasic (com.kerb.social.SocialUserBasic)
package com.kerb.social {
public class SocialUserBasic implements ISocialUser {
public function get uid():String{
return ("");
}
public function get isAppUser():Boolean{
return (false);
}
public function get picUrl():String{
return ("");
}
public function get email():String{
return ("");
}
public function get username():String{
return ("");
}
}
}//package com.kerb.social
Section 442
//ExtendedSound (com.kerb.sound.ExtendedSound)
package com.kerb.sound {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class ExtendedSound extends EventDispatcher {
protected var fadeStartVolume:Number;
protected var panStartPosition:Number;
protected var sound:Sound;
protected var stopAfterFade:Boolean;
protected var masterVolume:Number;// = 1
protected var panTimer:Timer;
protected var fadeTimer:Timer;
protected var paused:Boolean;
protected var fadeDuration:Number;
protected var fadeStartTime:Number;
protected var fadeEndVolume:Number;
protected var playingLoops:Number;
protected var panEndPosition:Number;
protected var actualVolume:Number;// = 1
protected var panStartTime:Number;
protected var panDuration:Number;
protected var pauseTime:Number;
protected var transform:SoundTransform;
protected var soundChannel:SoundChannel;
private static const TIMER_UPDATE_RATE:Number = 20;
public function ExtendedSound(_arg1:Sound){
sound = _arg1;
}
public function stop():void{
stopFade();
if (soundChannel != null){
soundChannel.stop();
soundChannel.removeEventListener(Event.SOUND_COMPLETE, onSoundComplete);
soundChannel = null;
stopFade();
};
}
protected function updatePan(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number = ((getTimer() - panStartTime) / panDuration);
if (_local3 >= 1){
stopPan();
_local2 = panEndPosition;
} else {
if (_local3 > 0){
_local2 = ((_local3 * (panEndPosition - panStartPosition)) + panStartPosition);
};
};
if (soundChannel == null){
return;
};
var _local4:Number = soundChannel.soundTransform.volume;
transform = new SoundTransform(_local4, _local2);
soundChannel.soundTransform = transform;
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
if (((soundChannel) && (soundChannel.soundTransform))){
fadeStartTime = getTimer();
fadeDuration = _arg2;
fadeStartVolume = (soundChannel.soundTransform.volume / masterVolume);
fadeEndVolume = _arg1;
startFade();
};
}
public function setMasterVolume(_arg1:Number):void{
var _local2:Number;
masterVolume = Math.max(0, Math.min(1, _arg1));
if (soundChannel != null){
_local2 = soundChannel.soundTransform.pan;
transform = new SoundTransform((actualVolume * masterVolume), _local2);
soundChannel.soundTransform = transform;
};
}
public function setVolume(_arg1:Number):void{
var _local2:Number;
if (soundChannel != null){
actualVolume = Math.max(0, Math.min(1, _arg1));
_local2 = soundChannel.soundTransform.pan;
transform = new SoundTransform((actualVolume * masterVolume), _local2);
soundChannel.soundTransform = transform;
stopFade();
};
}
protected function stopFade():void{
if (((!((fadeTimer == null))) && (fadeTimer.running))){
fadeTimer.reset();
};
}
public function fadeOut(_arg1:Number=0):void{
if ((((((_arg1 > 0)) && (soundChannel))) && (soundChannel.soundTransform))){
fadeStartTime = getTimer();
fadeDuration = _arg1;
fadeStartVolume = (soundChannel.soundTransform.volume / masterVolume);
fadeEndVolume = 0;
stopAfterFade = true;
startFade();
} else {
stop();
};
}
public function play(_arg1:Number=0, _arg2:int=0, _arg3:SoundTransform=null):SoundChannel{
if (_arg3 != null){
actualVolume = _arg3.volume;
} else {
actualVolume = 1;
_arg3 = new SoundTransform(masterVolume);
};
_arg3.volume = (actualVolume * masterVolume);
soundChannel = sound.play(_arg1, _arg2, _arg3);
if (soundChannel != null){
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
};
playingLoops = _arg2;
transform = _arg3;
paused = false;
return (soundChannel);
}
protected function stopPan():void{
if (((!((panTimer == null))) && (panTimer.running))){
panTimer.reset();
};
}
protected function onSoundComplete(_arg1:Event):void{
dispatchEvent(_arg1);
}
public function get position():Number{
if (soundChannel == null){
return (0);
};
return (soundChannel.position);
}
public function fadeIn(_arg1:Number=0, _arg2:Number=1, _arg3:Number=0, _arg4:int=0, _arg5:Number=0):SoundChannel{
fadeStartVolume = Math.max(0, Math.min(1, _arg1));
play(_arg5, _arg4, new SoundTransform((fadeStartVolume * masterVolume)));
if (_arg3 > 0){
fadeStartTime = getTimer();
fadeDuration = _arg3;
fadeEndVolume = Math.max(0, Math.min(1, _arg2));
startFade();
};
return (soundChannel);
}
public function setPan(_arg1:Number):void{
var _local2:Number;
if (soundChannel != null){
_arg1 = Math.max(-1, Math.min(1, _arg1));
_local2 = soundChannel.soundTransform.volume;
transform = new SoundTransform(_local2, _arg1);
soundChannel.soundTransform = transform;
stopPan();
};
}
protected function startPan():void{
if (panTimer == null){
panTimer = new Timer(TIMER_UPDATE_RATE);
panTimer.addEventListener(TimerEvent.TIMER, updatePan);
};
stopPan();
panTimer.start();
}
protected function updateFade(_arg1:TimerEvent):void{
var _local2:Number = ((getTimer() - fadeStartTime) / fadeDuration);
if (_local2 >= 1){
if (stopAfterFade){
stopAfterFade = false;
stop();
} else {
stopFade();
};
actualVolume = fadeEndVolume;
} else {
if (_local2 > 0){
actualVolume = ((_local2 * (fadeEndVolume - fadeStartVolume)) + fadeStartVolume);
};
};
if (soundChannel == null){
return;
};
var _local3:Number = soundChannel.soundTransform.pan;
transform = new SoundTransform((actualVolume * masterVolume), _local3);
soundChannel.soundTransform = transform;
}
public function getSoundChannel():SoundChannel{
return (soundChannel);
}
override public function toString():String{
var _local1:String = getQualifiedClassName(sound);
if (soundChannel != null){
_local1 = (_local1 + ((" vol[" + (soundChannel.soundTransform.volume / masterVolume)) + "]"));
_local1 = (_local1 + ((" pan[" + soundChannel.soundTransform.pan) + "]"));
};
return (_local1);
}
public function pause():void{
if (soundChannel == null){
return;
};
pauseTime = soundChannel.position;
stop();
}
public function panTo(_arg1:Number, _arg2:Number):void{
if (_arg2 > 0){
panStartTime = getTimer();
panDuration = _arg2;
panStartPosition = soundChannel.soundTransform.pan;
panEndPosition = _arg1;
startPan();
} else {
setPan(_arg1);
};
}
public function unpause():void{
play(pauseTime, playingLoops, transform);
}
protected function startFade():void{
if (fadeTimer == null){
fadeTimer = new Timer(TIMER_UPDATE_RATE);
fadeTimer.addEventListener(TimerEvent.TIMER, updateFade);
};
stopFade();
fadeTimer.start();
}
}
}//package com.kerb.sound
Section 443
//SoundManager (com.kerb.sound.SoundManager)
package com.kerb.sound {
import flash.utils.*;
import flash.media.*;
public class SoundManager {
private var sounds:Array;
private var prevMasterVolume:Number;
private var muteState:Boolean;// = false
private var masterVolume:Number;// = 1
public function SoundManager(){
prevMasterVolume = masterVolume;
sounds = new Array();
super();
}
public function unregisterSound(_arg1:String):void{
if (sounds[_arg1] != null){
sounds[_arg1].stop();
sounds[_arg1] = null;
};
}
public function stopAllSounds():void{
var _local1:String;
for (_local1 in sounds) {
sounds[_local1].stop();
};
}
public function setMasterVolume(_arg1:Number):void{
var _local2:String;
prevMasterVolume = masterVolume;
masterVolume = Math.max(0, Math.min(1, _arg1));
for (_local2 in sounds) {
sounds[_local2].setMasterVolume(masterVolume);
};
}
public function get muted():Boolean{
return (muteState);
}
public function registerSound(_arg1:Sound, _arg2:String=null, _arg3:Boolean=false):void{
if (_arg2 == null){
_arg2 = getQualifiedClassName(_arg1);
};
var _local4:ExtendedSound = new ExtendedSound(_arg1);
if (sounds[_arg2] != null){
if (_arg3){
unregisterSound(_arg2);
} else {
throw (new Error((("Class name conflict: A sound with the class name [" + _arg2) + "] already exists in SoundManager.")));
};
};
sounds[_arg2] = _local4;
_local4.setMasterVolume(masterVolume);
}
public function unmute():void{
if (muteState){
muteState = false;
setMasterVolume(prevMasterVolume);
};
}
public function getSoundByClassName(_arg1:String):ExtendedSound{
return (sounds[_arg1]);
}
public function mute():void{
if (!muteState){
muteState = true;
setMasterVolume(0);
};
}
public function toString():String{
var _local2:String;
var _local1 = "====================\n";
_local1 = (_local1 + "SoundManager\n");
_local1 = (_local1 + "--------------------\n");
_local1 = (_local1 + (("master vol[" + masterVolume) + "]\n"));
_local1 = (_local1 + "--------------------");
for (_local2 in sounds) {
_local1 = (_local1 + ("\n" + sounds[_local2].toString()));
};
_local1 = (_local1 + "\n====================");
return (_local1);
}
}
}//package com.kerb.sound
Section 444
//DoubleQuick (com.kerb.tracking.DoubleQuick)
package com.kerb.tracking {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
public class DoubleQuick {
private static const SO_SESSION_PROPERTY_NAME:String = "sessionkey";
private static const SO_NAME:String = "doublequick";
private static const TICKER_PERIOD:Number = 30000;
private static const TRACKER_SESSION_URL:String = "http://doublequick.kerb.co.uk/tracking/session.htm";
private static const TICKER_URL:String = "http://doublequick.kerb.co.uk/tracking/ticker.htm";
private static const TRACKER_URL:String = "http://doublequick.kerb.co.uk/tracking/trackflash.htm";
private static const SO_EXPIRY_PROPERTY_NAME:String = "expo";
private static var tickerURL:URLRequest = null;
private static var initialised:Boolean = false;
private static var queue:Array = new Array();
private static var projectId:Number;
private static var baseurl:String;
private static var dq:DoubleQuick;
private static var traceEvents:Boolean;
public function startTimer():void{
var _local1:Timer = new Timer(TICKER_PERIOD, 0);
_local1.start();
_local1.addEventListener(TimerEvent.TIMER, pingProxy, false, 0, true);
}
public function pingProxy(_arg1:TimerEvent):void{
DoubleQuick.ping();
}
private static function doTrace(_arg1:String):void{
if (traceEvents){
trace(_arg1);
};
}
public static function event(_arg1:Number):void{
var loader:URLLoader;
var request:URLRequest;
var watchId = _arg1;
if (!initialised){
doTrace((("DoubleQuick event " + watchId) + " queued"));
queue.push(watchId);
} else {
doTrace(("DoubleQuick event " + watchId));
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(IOErrorEvent.IO_ERROR, onError, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, false, 0, true);
request = generateURL(watchId);
request.method = URLRequestMethod.GET;
try {
loader.load(request);
} catch(error:Error) {
onError();
};
};
}
public static function click(_arg1:Number, _arg2:String=null):void{
doTrace(("DoubleQuick clickThrough " + _arg1));
navigateToURL(generateURL(_arg1), _arg2);
}
private static function onInit(_arg1:Event):void{
var _local4:Date;
var _local2:URLLoader = URLLoader(_arg1.target);
var _local3:SharedObject = SharedObject.getLocal(DoubleQuick.SO_NAME);
if (((!((_local2.data["sessionkey"] == ""))) && (!((_local2.data["sessionkey"] == null))))){
doTrace(("DoubleQuick acquired session key " + _local2.data["sessionkey"]));
_local3.setProperty(DoubleQuick.SO_SESSION_PROPERTY_NAME, _local2.data["sessionkey"]);
_local4 = new Date((new Date().getTime() + ((_local2.data["timeout"] * 60) * 1000)));
_local3.setProperty(DoubleQuick.SO_EXPIRY_PROPERTY_NAME, _local4);
};
DoubleQuick.initialisationFinished();
}
public static function init(_arg1:DisplayObject, _arg2:Number, _arg3:Boolean=true):void{
var loader:URLLoader;
var request:URLRequest;
var root = _arg1;
var _projectId = _arg2;
var _traceEvents = _arg3;
projectId = _projectId;
traceEvents = _traceEvents;
baseurl = root.loaderInfo.url;
doTrace(((("DoubleQuick initialising with project " + projectId) + " and baseurl ") + baseurl));
var so:SharedObject = SharedObject.getLocal(DoubleQuick.SO_NAME);
var isExpired:Boolean;
var currentDate:Date = new Date();
if (currentDate < so.data[DoubleQuick.SO_EXPIRY_PROPERTY_NAME]){
isExpired = false;
};
if ((((so.data[DoubleQuick.SO_SESSION_PROPERTY_NAME] == undefined)) || (isExpired))){
doTrace("DoubleQuick requesting new session key");
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, onInit, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onError, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, false, 0, true);
request = new URLRequest(((TRACKER_SESSION_URL + "?project=") + projectId));
request.method = URLRequestMethod.GET;
try {
loader.load(request);
} catch(error:Error) {
onError();
};
} else {
DoubleQuick.initialisationFinished();
};
}
public static function initialisationFinished():void{
doTrace("DoubleQuick initialised");
initialised = true;
var _local1:int;
while (_local1 < queue.length) {
event(queue[_local1]);
_local1++;
};
queue = new Array();
var _local2:SharedObject = SharedObject.getLocal(DoubleQuick.SO_NAME);
tickerURL = new URLRequest(((((TICKER_URL + "?project=") + projectId) + "&session=") + _local2.data[DoubleQuick.SO_SESSION_PROPERTY_NAME]));
tickerURL.method = URLRequestMethod.GET;
dq = new (DoubleQuick);
dq.startTimer();
}
private static function onError(_arg1:Event=null):void{
}
public static function ping():void{
var loader:URLLoader;
if (tickerURL != null){
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(IOErrorEvent.IO_ERROR, onError, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, false, 0, true);
doTrace("DoubleQuick ticker");
try {
loader.load(tickerURL);
} catch(error:Error) {
onError();
};
};
}
private static function generateURL(_arg1:Number):URLRequest{
var _local2:SharedObject = SharedObject.getLocal(DoubleQuick.SO_NAME);
var _local3:String = ((((((((TRACKER_URL + "?watch=") + _arg1) + "&project=") + projectId) + "&session=") + _local2.data[DoubleQuick.SO_SESSION_PROPERTY_NAME]) + "&baseurl=") + escape(baseurl));
return (new URLRequest(_local3));
}
}
}//package com.kerb.tracking
Section 445
//WebTrends (com.kerb.tracking.WebTrends)
package com.kerb.tracking {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class WebTrends {
private static var trackurl:String;
private static var traceEvents:Boolean;
private static var baseurl:String;
private static function doTrace(_arg1:String):void{
if (traceEvents){
trace(_arg1);
};
}
private static function dummyListener(_arg1:Event):void{
}
private static function ioErrorHandler(_arg1:IOErrorEvent):void{
doTrace(("WebTrends IOError : " + _arg1));
}
public static function init(_arg1:DisplayObject, _arg2:String, _arg3:String, _arg4:String="", _arg5:Boolean=true):void{
var _local7:String;
var _local8:String;
traceEvents = _arg5;
baseurl = _arg1.loaderInfo.url;
trackurl = "";
if (_arg2.indexOf("://") == -1){
trackurl = (trackurl + "http://");
};
trackurl = (trackurl + (((_arg2 + "/") + _arg3) + "/dcs.gif?"));
if (_arg4 != ""){
trackurl = (trackurl + (("WT.mc_id=" + escape(_arg4)) + "&"));
};
var _local6:Array = baseurl.match("(.*?)://([^/:]+).*");
if (_local6 != null){
_local7 = _local6[1];
_local8 = _local6[2];
if (_local7.toLowerCase() != "file"){
trackurl = (trackurl + (("dcssip=" + escape(_local8)) + "&"));
};
};
doTrace(((("WebTrends initialised with trackurl " + trackurl) + " and baseurl ") + baseurl));
}
public static function event2(_arg1:String, _arg2:String, _arg3:String=""):void{
var uri = _arg1;
var title = _arg2;
var locale = _arg3;
doTrace(("WebTrends event " + uri));
var url:String = ((((trackurl + "dcsuri=") + escape(uri)) + "&WT.ti=") + escape(title));
if (locale != ""){
url = (url + ("&WT.sp=" + locale));
};
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dummyListener);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
try {
loader.load(new URLRequest(url));
} catch(e:Error) {
doTrace(("WebTrends Error : " + e));
};
}
public static function event(_arg1:String, _arg2:String):void{
event2(_arg1, _arg2, null);
}
}
}//package com.kerb.tracking
Section 446
//ButtonSupport (com.kerb.ui.ButtonSupport)
package com.kerb.ui {
import flash.events.*;
import flash.display.*;
public class ButtonSupport {
public static function unsetupButton(_arg1, _arg2:Function=null, _arg3:Function=null, _arg4:Function=null):void{
var _local5:SimpleButton;
var _local6:DynamicButton;
var _local7:MovieClip;
if ((_arg1 is SimpleButton)){
_local5 = (_arg1 as SimpleButton);
if (_arg2 != null){
_local5.removeEventListener(MouseEvent.CLICK, _arg2);
};
if (_arg3 != null){
_local5.removeEventListener(MouseEvent.ROLL_OVER, _arg3);
};
if (_arg4 != null){
_local5.removeEventListener(MouseEvent.ROLL_OUT, _arg4);
};
} else {
if ((_arg1 is DynamicButton)){
_local6 = (_arg1 as DynamicButton);
if (_arg2 != null){
_local6.removeEventListener(MouseEvent.CLICK, _arg2);
};
if (_arg3 != null){
_local6.removeEventListener(MouseEvent.ROLL_OVER, _arg3);
};
if (_arg4 != null){
_local6.removeEventListener(MouseEvent.ROLL_OUT, _arg4);
};
} else {
if ((_arg1 is MovieClip)){
_local7 = (_arg1 as MovieClip);
if (_arg2 != null){
_local7.removeEventListener(MouseEvent.CLICK, _arg2);
};
if (_arg3 != null){
_local7.removeEventListener(MouseEvent.ROLL_OVER, _arg3);
};
if (_arg4 != null){
_local7.removeEventListener(MouseEvent.ROLL_OUT, _arg4);
};
_local7.mouseEnabled = false;
_local7.mouseChildren = true;
_local7.buttonMode = false;
} else {
trace((("WARNING : unknown object " + _arg1) + " passed to ButtonSupport.unsetupButton"));
};
};
};
}
public static function setupButton(_arg1, _arg2:Function=null, _arg3:Function=null, _arg4:Function=null):void{
var _local5:SimpleButton;
var _local6:DynamicButton;
var _local7:MovieClip;
if ((_arg1 is SimpleButton)){
_local5 = (_arg1 as SimpleButton);
if (_arg2 != null){
_local5.addEventListener(MouseEvent.CLICK, _arg2, false, 0, true);
};
if (_arg3 != null){
_local5.addEventListener(MouseEvent.ROLL_OVER, _arg3, false, 0, true);
};
if (_arg4 != null){
_local5.addEventListener(MouseEvent.ROLL_OUT, _arg4, false, 0, true);
};
} else {
if ((_arg1 is DynamicButton)){
_local6 = (_arg1 as DynamicButton);
if (_arg2 != null){
_local6.addEventListener(MouseEvent.CLICK, _arg2, false, 0, true);
};
if (_arg3 != null){
_local6.addEventListener(MouseEvent.ROLL_OVER, _arg3, false, 0, true);
};
if (_arg4 != null){
_local6.addEventListener(MouseEvent.ROLL_OUT, _arg4, false, 0, true);
};
} else {
if ((_arg1 is MovieClip)){
_local7 = (_arg1 as MovieClip);
if (_arg2 != null){
_local7.addEventListener(MouseEvent.CLICK, _arg2, false, 0, true);
};
if (_arg3 != null){
_local7.addEventListener(MouseEvent.ROLL_OVER, _arg3, false, 0, true);
};
if (_arg4 != null){
_local7.addEventListener(MouseEvent.ROLL_OUT, _arg4, false, 0, true);
};
_local7.mouseEnabled = true;
_local7.mouseChildren = false;
_local7.buttonMode = true;
} else {
trace((("WARNING : unknown object " + _arg1) + " passed to ButtonSupport.setupButton"));
};
};
};
}
}
}//package com.kerb.ui
Section 447
//DynamicButton (com.kerb.ui.DynamicButton)
package com.kerb.ui {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.text.*;
public class DynamicButton extends EventDispatcher {
protected var hitArea:MovieClip;
protected var select:MovieClip;
protected var labelID:String;
protected var over:MovieClip;
protected var mc:Sprite;
protected var down:MovieClip;
protected var up:MovieClip;
protected var label:String;
public function DynamicButton(_arg1:Sprite, _arg2:String="", _arg3:Boolean=true){
this.mc = _arg1;
this.labelID = _arg2;
if (_arg1 == null){
throw (new Error("Null movieclip passed to DynamicButton"));
};
if (_arg1.getChildByName("up") == null){
throw (new Error((("DynamicButton \"" + _arg1) + "\" does not have all states")));
};
if (_arg1.getChildByName("down") == null){
throw (new Error((("DynamicButton \"" + _arg1) + "\" does not have all states")));
};
if (_arg1.getChildByName("over") == null){
throw (new Error((("DynamicButton \"" + _arg1) + "\" does not have all states")));
};
if (_arg1.getChildByName("hit") == null){
throw (new Error((("DynamicButton \"" + _arg1) + "\" does not have all states")));
};
_arg1.addEventListener(MouseEvent.CLICK, onClick, false, 0, _arg3);
_arg1.addEventListener(MouseEvent.ROLL_OVER, onRollOver, false, 0, _arg3);
_arg1.addEventListener(MouseEvent.ROLL_OUT, onRollOut, false, 0, _arg3);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, _arg3);
_arg1.buttonMode = true;
_arg1.mouseChildren = false;
hitArea = (_arg1.getChildByName("hit") as MovieClip);
_arg1.hitArea = hitArea;
hitArea.visible = false;
hitArea.mouseEnabled = false;
hitArea.mouseChildren = false;
up = (_arg1.getChildByName("up") as MovieClip);
over = (_arg1.getChildByName("over") as MovieClip);
down = (_arg1.getChildByName("down") as MovieClip);
select = (_arg1.getChildByName("select") as MovieClip);
initText();
_arg1.removeChild(over);
_arg1.removeChild(down);
if (select != null){
_arg1.removeChild(select);
};
}
public function enable():void{
mc.mouseEnabled = true;
}
protected function onMouseDown(_arg1:MouseEvent):void{
if (up.parent){
mc.removeChild(up);
};
if (over.parent){
mc.removeChild(over);
};
if (!down.parent){
mc.addChildAt(down, 0);
};
down.gotoAndPlay(1);
dispatchEvent(_arg1);
}
public function get name():String{
return (mc.name);
}
public function get selected():Boolean{
if (!select){
return (false);
};
return (!((select.parent == null)));
}
public function initText(_arg1:String=null):void{
if (_arg1 != null){
labelID = _arg1;
};
if (labelID != ""){
if (up.getChildByName("label_txt") != null){
TextManager.getInstance().setTextField((up.getChildByName("label_txt") as TextField), labelID);
};
if (over.getChildByName("label_txt") != null){
TextManager.getInstance().setTextField((over.getChildByName("label_txt") as TextField), labelID);
};
if (down.getChildByName("label_txt") != null){
TextManager.getInstance().setTextField((down.getChildByName("label_txt") as TextField), labelID);
};
if (((!((select == null))) && (!((select.getChildByName("label_txt") == null))))){
TextManager.getInstance().setTextField((select.getChildByName("label_txt") as TextField), labelID);
};
};
}
public function dispose():void{
mc.buttonMode = false;
mc.mouseEnabled = false;
mc.removeEventListener(MouseEvent.CLICK, onClick);
mc.removeEventListener(MouseEvent.ROLL_OVER, onRollOver);
mc.removeEventListener(MouseEvent.ROLL_OUT, onRollOut);
mc.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
public function set visible(_arg1:Boolean):void{
mc.visible = _arg1;
}
public function get alpha():Number{
return (mc.alpha);
}
private function onClick(_arg1:MouseEvent):void{
dispatchEvent(_arg1);
}
protected function onRollOver(_arg1:MouseEvent):void{
if (up.parent){
mc.removeChild(up);
};
if (!over.parent){
mc.addChildAt(over, 0);
};
if (down.parent){
mc.removeChild(down);
};
over.gotoAndPlay(1);
dispatchEvent(_arg1);
}
protected function onRollOut(_arg1:MouseEvent):void{
if (!up.parent){
mc.addChildAt(up, 0);
};
if (over.parent){
mc.removeChild(over);
};
if (down.parent){
mc.removeChild(down);
};
up.gotoAndPlay(1);
dispatchEvent(_arg1);
}
public function get mcRef():Sprite{
return (mc);
}
public function set selected(_arg1:Boolean):void{
if (!select){
return;
};
if (_arg1){
mc.mouseEnabled = false;
up.visible = false;
down.visible = false;
over.visible = false;
if (!select.parent){
mc.addChildAt(select, 0);
};
} else {
mc.mouseEnabled = true;
up.visible = true;
down.visible = true;
over.visible = true;
if (select.parent){
mc.removeChild(select);
};
};
}
public function disable():void{
mc.mouseEnabled = false;
}
public function get visible():Boolean{
return (mc.visible);
}
public function set alpha(_arg1:Number):void{
mc.alpha = _arg1;
}
}
}//package com.kerb.ui
Section 448
//DynamicCenteredLabelButton (com.kerb.ui.DynamicCenteredLabelButton)
package com.kerb.ui {
import flash.display.*;
import com.kerb.utils.*;
import flash.text.*;
public class DynamicCenteredLabelButton extends DynamicButton {
private var _aroundZero:Boolean;
public function DynamicCenteredLabelButton(_arg1:Sprite, _arg2:String="", _arg3:Boolean=true, _arg4:Boolean=true){
_aroundZero = _arg4;
super(_arg1, _arg2, _arg3);
}
override public function initText(_arg1:String=null):void{
if (_arg1 != null){
labelID = _arg1;
};
if (labelID != ""){
if (up.getChildByName("label_txt") != null){
TextManager.getInstance().setTextField((up.getChildByName("label_txt") as TextField), labelID);
TextManager.getInstance().centerTextField((up.getChildByName("label_txt") as TextField), _aroundZero);
};
if (over.getChildByName("label_txt") != null){
TextManager.getInstance().setTextField((over.getChildByName("label_txt") as TextField), labelID);
TextManager.getInstance().centerTextField((over.getChildByName("label_txt") as TextField), _aroundZero);
};
if (down.getChildByName("label_txt") != null){
TextManager.getInstance().setTextField((down.getChildByName("label_txt") as TextField), labelID);
TextManager.getInstance().centerTextField((down.getChildByName("label_txt") as TextField), _aroundZero);
};
if (((!((select == null))) && (!((select.getChildByName("label_txt") == null))))){
TextManager.getInstance().setTextField((select.getChildByName("label_txt") as TextField), labelID);
TextManager.getInstance().centerTextField((select.getChildByName("label_txt") as TextField), _aroundZero);
};
};
}
}
}//package com.kerb.ui
Section 449
//DynamicToggleButton (com.kerb.ui.DynamicToggleButton)
package com.kerb.ui {
import flash.display.*;
public class DynamicToggleButton extends DynamicButton {
protected var _toggleable:Boolean;// = false
public function DynamicToggleButton(_arg1:Sprite, _arg2:String="", _arg3:Boolean=true){
super(_arg1, _arg2, _arg3);
}
override public function set selected(_arg1:Boolean):void{
if (!select){
return;
};
if (_arg1){
if (!_toggleable){
mc.mouseEnabled = false;
};
up.visible = false;
down.visible = false;
over.visible = false;
if (!select.parent){
mc.addChildAt(select, 0);
};
} else {
mc.mouseEnabled = true;
up.visible = true;
down.visible = true;
over.visible = true;
if (select.parent){
mc.removeChild(select);
};
};
}
public function set toggleable(_arg1:Boolean):void{
_toggleable = _arg1;
}
public function get toggleable():Boolean{
return (_toggleable);
}
}
}//package com.kerb.ui
Section 450
//Scrollbar (com.kerb.ui.Scrollbar)
package com.kerb.ui {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
public class Scrollbar extends Sprite implements IDisposable {
protected var _contentEasing:Number;// = 0.1
protected var _handleMaxStep:Number;// = 5
protected var trackTop:Number;
protected var contentMaxY:Number;
protected var handleMinY:Number;
protected var state:int;
protected var _useEasing:Boolean;// = false
protected var trackBtn:SimpleButton;
protected var handleBtn:SimpleButton;
protected var _minHandleHeight:Number;// = 10
protected var content_mc:DisplayObject;
protected var trackGoalY:Number;
protected var contentGoalY:Number;
protected var handleY:Number;
protected var handleMaxY:Number;
protected var upBtn:SimpleButton;
protected var mouseOffsetY:Number;
protected var mask_mc:DisplayObject;
protected var trackHeight:Number;
protected var _scaleHandle:Boolean;// = true
protected var trackBottom:Number;
protected var downBtn:SimpleButton;
protected var contentMinY:Number;
protected var handleCurrStep:Number;
protected static const STATE_DEACTIVATED:int = 5;
public static const SCROLLBAR_ACTIVATE:String = "onActivate";
public static const SCROLLBAR_DEACTIVATE:String = "onDeactivate";
protected static const STATE_TRACK:int = 4;
public static const SCROLLBAR_MOVED:String = "onScroll";
protected static const DEFAULT_HANDLE_STEP:Number = 5;
protected static const STATE_IDLE:int = 0;
protected static const DEFAULT_CONTENT_EASING:Number = 0.1;
protected static const STATE_UP:int = 1;
protected static const DEFAULT_MIN_HANDLE_HEIGHT:Number = 10;
protected static const STATE_HANDLE:int = 3;
protected static const HANDLE_ACCELERATION:Number = 0.1;
protected static const STATE_DOWN:int = 2;
public function setContentPosition(_arg1:Number):void{
contentGoalY = Math.min(contentMaxY, Math.max(contentMinY, _arg1));
onMouseUp(new MouseEvent(MouseEvent.MOUSE_UP));
if (handleBtn != null){
_arg1 = ((contentMaxY - contentGoalY) / (contentMaxY - contentMinY));
_arg1 = (_arg1 * trackHeight);
_arg1 = (_arg1 + trackTop);
moveHandle(_arg1);
};
}
protected function onPressTrack(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
state = STATE_TRACK;
if (handleBtn != null){
trackGoalY = (mouseY - (0.5 * handleBtn.height));
} else {
trackGoalY = mouseY;
};
handleCurrStep = _handleMaxStep;
}
public function set contentEasing(_arg1:Number):void{
this._contentEasing = Math.min(1, Math.max(0, _arg1));
}
public function init(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:SimpleButton=null, _arg4:SimpleButton=null, _arg5:SimpleButton=null, _arg6:SimpleButton=null):void{
content_mc = _arg1;
mask_mc = _arg2;
content_mc.mask = mask_mc;
content_mc.x = mask_mc.x;
content_mc.y = mask_mc.y;
contentGoalY = mask_mc.y;
handleCurrStep = 0;
upBtn = ((_arg3)!=null) ? _arg3 : (getChildByName("up_btn") as SimpleButton);
downBtn = ((_arg4)!=null) ? _arg4 : (getChildByName("down_btn") as SimpleButton);
handleBtn = ((_arg5)!=null) ? _arg5 : (getChildByName("handle_btn") as SimpleButton);
trackBtn = ((_arg6)!=null) ? _arg6 : (getChildByName("track_btn") as SimpleButton);
if (trackBtn != null){
trackBtn.addEventListener(MouseEvent.MOUSE_DOWN, onPressTrack);
trackBtn.useHandCursor = false;
trackTop = trackBtn.y;
trackBottom = (trackTop + trackBtn.height);
} else {
if (((!((upBtn == null))) && (!((downBtn == null))))){
trackTop = (upBtn.y + upBtn.height);
trackBottom = downBtn.y;
} else {
trackTop = 0;
trackBottom = 100;
};
};
trackHeight = (trackBottom - trackTop);
handleY = trackTop;
if (upBtn != null){
upBtn.addEventListener(MouseEvent.MOUSE_DOWN, onPressUp);
upBtn.useHandCursor = false;
};
if (downBtn != null){
downBtn.addEventListener(MouseEvent.MOUSE_DOWN, onPressDown);
downBtn.useHandCursor = false;
};
if (handleBtn != null){
handleBtn.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandle);
handleMinY = trackTop;
handleMaxY = (trackBottom - handleBtn.height);
handleBtn.y = handleMinY;
handleBtn.useHandCursor = false;
} else {
handleMinY = trackTop;
handleMaxY = trackBottom;
};
if (stage != null){
stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
};
state = STATE_IDLE;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function dispose():void{
if (stage){
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
protected function setButtonsActive(_arg1:Boolean):void{
if (upBtn != null){
upBtn.enabled = _arg1;
};
if (downBtn != null){
downBtn.enabled = _arg1;
};
if (handleBtn != null){
handleBtn.enabled = _arg1;
};
if (trackBtn != null){
trackBtn.enabled = _arg1;
};
}
public function set handleStep(_arg1:Number):void{
this._handleMaxStep = _arg1;
}
public function set useEasing(_arg1:Boolean):void{
this._useEasing = _arg1;
}
protected function moveHandleToTrackGoal():void{
var _local1:Number;
if (trackBtn == null){
return;
};
if (trackBtn.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (handleY > trackGoalY){
_local1 = Math.max(trackGoalY, (handleY - handleCurrStep));
moveHandle(_local1);
} else {
if (handleY < trackGoalY){
_local1 = Math.min(trackGoalY, (handleY + handleCurrStep));
moveHandle(_local1);
};
};
};
}
protected function onEnterFrame(_arg1:Event):void{
doEnterFrame();
}
public function set scaleHandle(_arg1:Boolean):void{
this._scaleHandle = _arg1;
}
public function set minHandleHeight(_arg1:Number):void{
this._minHandleHeight = _arg1;
}
public function get scaleHandle():Boolean{
return (_scaleHandle);
}
protected function onMouseUp(_arg1:MouseEvent):void{
if (stage){
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
};
state = STATE_IDLE;
handleCurrStep = 0;
}
protected function updateContentPosition():void{
var _local2:Number;
var _local1:Number = (handleMaxY - handleMinY);
if (_local1 > 0){
_local2 = (1 - ((handleY - handleMinY) / _local1));
_local2 = (_local2 * (contentMaxY - contentMinY));
contentGoalY = (contentMinY + _local2);
} else {
contentGoalY = contentMinY;
};
}
public function getPercentagePosition():Number{
var _local1:Number = 0;
var _local2:Number = (handleMaxY - handleMinY);
if (_local2 > 0){
_local1 = (100 * ((handleBtn.y - handleMinY) / _local2));
_local1 = Math.min(100, Math.max(0, _local1));
};
return (_local1);
}
protected function onPressUp(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
state = STATE_UP;
mouseOffsetY = upBtn.mouseY;
}
public function setPercentagePosition(_arg1:Number):void{
doEnterFrame();
_arg1 = Math.min(100, Math.max(0, _arg1));
_arg1 = (_arg1 / 100);
var _local2:Number = (handleMinY + (_arg1 * (handleMaxY - handleMinY)));
moveHandle(_local2);
}
protected function doEnterFrame():void{
contentMinY = ((mask_mc.y + mask_mc.height) - content_mc.height);
contentMaxY = mask_mc.y;
updateHandleMaxY();
if (contentMaxY <= contentMinY){
dispatchEvent(new Event(SCROLLBAR_DEACTIVATE));
state = STATE_DEACTIVATED;
setButtonsActive(false);
} else {
if (state == STATE_DEACTIVATED){
dispatchEvent(new Event(SCROLLBAR_ACTIVATE));
state = STATE_IDLE;
setButtonsActive(true);
};
};
switch (state){
case STATE_UP:
moveHandle((handleY - handleCurrStep));
break;
case STATE_DOWN:
moveHandle((handleY + handleCurrStep));
break;
case STATE_HANDLE:
moveHandle((mouseY - mouseOffsetY));
break;
case STATE_TRACK:
moveHandleToTrackGoal();
break;
};
var _local1:Number = content_mc.y;
if (_useEasing){
content_mc.y = (content_mc.y + (_contentEasing * (contentGoalY - content_mc.y)));
} else {
content_mc.y = contentGoalY;
};
content_mc.y = Math.round(content_mc.y);
if (content_mc.y != _local1){
dispatchEvent(new Event(SCROLLBAR_MOVED));
};
}
protected function moveHandle(_arg1:Number):void{
handleY = Math.min(handleMaxY, Math.max(handleMinY, _arg1));
if (handleBtn != null){
handleBtn.y = handleY;
};
updateContentPosition();
handleCurrStep = (handleCurrStep + (HANDLE_ACCELERATION * (_handleMaxStep - handleCurrStep)));
}
protected function onPressHandle(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
state = STATE_HANDLE;
mouseOffsetY = (handleBtn.mouseY * handleBtn.scaleY);
}
private function updateHandleMaxY():void{
var _local1:Number;
if (((!((handleBtn == null))) && (_scaleHandle))){
_local1 = ((trackHeight * mask_mc.height) / content_mc.height);
_local1 = Math.min(trackHeight, Math.max(_minHandleHeight, _local1));
handleBtn.height = _local1;
handleMaxY = (trackBottom - handleBtn.height);
};
}
protected function onPressDown(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
state = STATE_DOWN;
mouseOffsetY = downBtn.mouseY;
}
protected function onMouseWheel(_arg1:MouseEvent):void{
var _local2:Boolean;
if (this.hitTestPoint(_arg1.stageX, _arg1.stageY, true)){
_local2 = true;
} else {
if ((((((((mask_mc.mouseX > 0)) && ((mask_mc.mouseX < mask_mc.width)))) && ((mask_mc.mouseY > 0)))) && ((mask_mc.mouseY < mask_mc.height)))){
_local2 = true;
};
};
if (_local2){
if (_arg1.delta < 0){
moveHandle((handleY + _handleMaxStep));
} else {
moveHandle((handleY - _handleMaxStep));
};
};
}
}
}//package com.kerb.ui
Section 451
//SoundControl (com.kerb.ui.SoundControl)
package com.kerb.ui {
import flash.events.*;
import flash.display.*;
import com.kerb.sound.*;
public class SoundControl {
private var master:Toggle;
private var sfxSoundManager:SoundManager;
private var music:Toggle;
private var musicSoundManager:SoundManager;
private var sfx:Toggle;
public var mc:MovieClip;
private var propagateChange:Boolean;
private var singleManager:Boolean;
public function SoundControl(_arg1:MovieClip, _arg2:SoundManager, _arg3:SoundManager=null){
this.mc = _arg1;
this.sfxSoundManager = _arg2;
this.musicSoundManager = _arg3;
singleManager = (_arg3 == null);
init();
}
private function setMutes():void{
if (!singleManager){
if (((music.isOn) && (musicSoundManager.muted))){
musicSoundManager.unmute();
} else {
if (((!(music.isOn)) && (!(musicSoundManager.muted)))){
musicSoundManager.mute();
};
};
if (((sfx.isOn) && (sfxSoundManager.muted))){
sfxSoundManager.unmute();
} else {
if (((!(sfx.isOn)) && (!(sfxSoundManager.muted)))){
sfxSoundManager.mute();
};
};
} else {
if (((master.isOn) && (sfxSoundManager.muted))){
sfxSoundManager.unmute();
} else {
if (((!(master.isOn)) && (!(sfxSoundManager.muted)))){
sfxSoundManager.mute();
};
};
};
}
private function updateMaster():void{
if (propagateChange){
propagateChange = false;
if (!singleManager){
if (((music.isOn) || (sfx.isOn))){
master.isOn = true;
} else {
if (((!(music.isOn)) && (!(sfx.isOn)))){
master.isOn = false;
};
};
};
propagateChange = true;
};
setMutes();
}
private function onMusicChange(_arg1:Event=null):void{
updateMaster();
}
private function onSFXChange(_arg1:Event=null):void{
updateMaster();
}
private function init():void{
mc.mouseEnabled = false;
if (singleManager){
master = new Toggle(mc.master, !(sfxSoundManager.muted));
music = null;
sfx = null;
master.addEventListener(Event.CHANGE, onMasterChange, false, 0, true);
} else {
master = new Toggle(mc.master, ((!(sfxSoundManager.muted)) || (!(musicSoundManager.muted))));
sfx = new Toggle(mc.sfx, !(sfxSoundManager.muted));
music = new Toggle(mc.music, !(musicSoundManager.muted));
master.addEventListener(Event.CHANGE, onMasterChange, false, 0, true);
music.addEventListener(Event.CHANGE, onMusicChange, false, 0, true);
sfx.addEventListener(Event.CHANGE, onSFXChange, false, 0, true);
mc.master.addEventListener(MouseEvent.ROLL_OVER, onMasterRollOver, false, 0, true);
music.visible = false;
sfx.visible = false;
};
propagateChange = true;
}
private function onMasterChange(_arg1:Event=null):void{
if (propagateChange){
propagateChange = false;
if (!singleManager){
music.isOn = master.isOn;
sfx.isOn = master.isOn;
};
propagateChange = true;
};
setMutes();
}
private function onEnterFrame(_arg1:Event=null):void{
var _local2:Boolean;
if (!singleManager){
_local2 = ((((master.mouseIsOver) || (music.mouseIsOver))) || (sfx.mouseIsOver));
if (!_local2){
music.visible = false;
sfx.visible = false;
mc.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
};
}
private function onMasterRollOver(_arg1:MouseEvent=null):void{
if (!singleManager){
music.visible = true;
sfx.visible = true;
};
mc.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
}
}//package com.kerb.ui
Section 452
//Toggle (com.kerb.ui.Toggle)
package com.kerb.ui {
import flash.events.*;
import flash.display.*;
public class Toggle extends EventDispatcher {
private var mouseOver:Boolean;
private var mouseDown:Boolean;
private var toggleOn:Boolean;
private var mc:MovieClip;
public function Toggle(_arg1:MovieClip, _arg2:Boolean=true){
this.mc = _arg1;
this.toggleOn = _arg2;
init();
}
private function onRollOut(_arg1:MouseEvent=null):void{
mouseOver = false;
mouseDown = false;
setGraphics();
}
public function get mouseIsOver():Boolean{
return (mouseOver);
}
public function set visible(_arg1:Boolean):void{
mc.visible = _arg1;
}
private function onMouseDown(_arg1:MouseEvent=null):void{
mouseDown = true;
setGraphics();
}
public function get isOn():Boolean{
return (toggleOn);
}
private function setGraphics():void{
mc.upOff.visible = ((!(toggleOn)) && (!(mouseOver)));
mc.overOff.visible = ((((!(toggleOn)) && (mouseOver))) && (!(mouseDown)));
mc.downOff.visible = ((!(toggleOn)) && (mouseDown));
mc.upOn.visible = ((toggleOn) && (!(mouseOver)));
mc.overOn.visible = ((((toggleOn) && (mouseOver))) && (!(mouseDown)));
mc.downOn.visible = ((toggleOn) && (mouseDown));
}
private function init():void{
mc.addEventListener(MouseEvent.ROLL_OVER, onRollOver, false, 0, true);
mc.addEventListener(MouseEvent.ROLL_OUT, onRollOut, false, 0, true);
mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
mc.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
mc.buttonMode = true;
mc.mouseChildren = false;
mc.hitArea = mc.hit;
mc.hit.visible = false;
mouseOver = false;
mouseDown = false;
setGraphics();
}
public function get mouseIsDown():Boolean{
return (mouseDown);
}
public function set isOn(_arg1:Boolean):void{
toggleOn = _arg1;
setGraphics();
dispatchEvent(new Event(Event.CHANGE));
}
private function onRollOver(_arg1:MouseEvent=null):void{
mouseOver = true;
setGraphics();
}
private function onClick(_arg1:MouseEvent=null):void{
mouseDown = false;
isOn = !(toggleOn);
}
}
}//package com.kerb.ui
Section 453
//AssetFactory (com.kerb.utils.AssetFactory)
package com.kerb.utils {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public final class AssetFactory extends EventDispatcher {
private var _loader:Loader;// = null
public static const EVENT_ASSET_FACTORY_READY:String = "EVENT_ASSET_FACTORY_READY";
public function initialize(_arg1:Class):void{
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.INIT, _onLibraryReady);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, _onIOError);
_loader.loadBytes(new (_arg1));
}
private function _onIOError(_arg1:Event):void{
}
public function createDisplayObject(_arg1:String):DisplayObject{
var _local2:Class = Class(_loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1));
return ((new (_local2) as DisplayObject));
}
private function _onLibraryReady(_arg1:Event):void{
_loader.contentLoaderInfo.removeEventListener(Event.INIT, _onLibraryReady);
dispatchEvent(new Event(EVENT_ASSET_FACTORY_READY));
}
public function createSound(_arg1:String):Sound{
var _local2:Class = Class(_loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1));
return ((new (_local2) as Sound));
}
public function createMovieClip(_arg1:String):MovieClip{
var _local2:Class = Class(_loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1));
return ((new (_local2) as MovieClip));
}
public function createBitmapDataObject(_arg1:String):BitmapData{
var _local2:Class = Class(_loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1));
return ((new _local2(0, 0) as BitmapData));
}
}
}//package com.kerb.utils
Section 454
//AssetFactoryManager (com.kerb.utils.AssetFactoryManager)
package com.kerb.utils {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
public class AssetFactoryManager extends EventDispatcher {
protected var numFactories:int;
protected var numLoaded:int;
protected var assetFactories:Dictionary;
public function AssetFactoryManager(){
assetFactories = new Dictionary();
numFactories = 0;
numLoaded = 0;
}
public function createDisplayObject(_arg1:String, _arg2:String):DisplayObject{
if (assetFactories[_arg1]){
return (assetFactories[_arg1].createDisplayObject(_arg2));
};
return (null);
}
protected function onAssetFactoryReady(_arg1:Event):void{
_arg1.target.removeEventListener(AssetFactory.EVENT_ASSET_FACTORY_READY, onAssetFactoryReady);
if (++numLoaded == numFactories){
dispatchEvent(new Event(Event.COMPLETE));
};
}
public function createBitmapDataObject(_arg1:String, _arg2:String):BitmapData{
if (assetFactories[_arg1]){
return (assetFactories[_arg1].createBitmapDataObject(_arg2));
};
return (null);
}
public function getAssetFactory(_arg1:String):AssetFactory{
return (assetFactories[_arg1]);
}
public function createSound(_arg1:String, _arg2:String):Sound{
if (assetFactories[_arg1]){
return (assetFactories[_arg1].createSound(_arg2));
};
return (null);
}
public function addAssetFactory(_arg1:String, _arg2:Class):void{
var _local3:AssetFactory = new AssetFactory();
assetFactories[_arg1] = _local3;
numFactories++;
_local3.addEventListener(AssetFactory.EVENT_ASSET_FACTORY_READY, onAssetFactoryReady);
_local3.initialize(_arg2);
}
public function createMovieClip(_arg1:String, _arg2:String):MovieClip{
if (assetFactories[_arg1]){
return (assetFactories[_arg1].createMovieClip(_arg2));
};
return (null);
}
}
}//package com.kerb.utils
Section 455
//Crypto (com.kerb.utils.Crypto)
package com.kerb.utils {
public final class Crypto {
private static var KEYS:Array = new Array("98sdfa23Ql", "ADF8b3w2fq", "ER2b79hwfO", "clkenf0FSj", "4R7d6ASYU3", "ASDQsjhW02", "kCQ6YH9asc", "ADIx7g19SP", "Nd98fhiOAF", "a09hADNFkf");
private static var SALT:String = "8008135";
public static function encrypt(_arg1:int):String{
var _local2:String = ((_arg1 + "") + SALT);
var _local3 = "";
var _local4:int = Math.floor((Math.random() * KEYS.length));
var _local5:int = _local4;
var _local6:int;
while (_local6 < _local2.length) {
_local3 = (_local3 + KEYS[_local5].charAt(parseInt(_local2.charAt(_local6))));
_local5 = ((_local5 + 1) % KEYS.length);
_local6++;
};
_local3 = (_local3 + ("" + _local4));
return (_local3);
}
public static function decrypt(_arg1:String):int{
var _local6:int;
var _local2:int = parseInt(_arg1.substr(-1));
var _local3:String = _arg1.substr(0, (_arg1.length - 1));
var _local4 = "";
var _local5:int;
while (_local5 < _local3.length) {
_local6 = KEYS[_local2].indexOf(_local3.charAt(_local5));
if (_local6 > -1){
_local4 = (_local4 + ("" + _local6));
} else {
return (0);
};
_local2 = ((_local2 + 1) % KEYS.length);
_local5++;
};
if (_local4.substr(-(SALT.length)) != SALT){
return (0);
};
return (parseInt(_local4.substr(0, (_local4.length - SALT.length))));
}
}
}//package com.kerb.utils
Section 456
//DateHelper (com.kerb.utils.DateHelper)
package com.kerb.utils {
public final class DateHelper {
private static const PHP_DATE:RegExp = /([0-9]{4})\-([0-9]{2})\-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})/;
public static function parse(_arg1:String):Date{
if (_arg1.match(PHP_DATE)){
_arg1 = _arg1.replace(PHP_DATE, "$1/$2/$3 $4:$5:$6 GMT");
};
var _local2:Number = Date.parse(_arg1);
var _local3:Date = new Date();
_local3.setTime(_local2);
return (_local3);
}
}
}//package com.kerb.utils
Section 457
//DynamicEvent (com.kerb.utils.DynamicEvent)
package com.kerb.utils {
import flash.events.*;
public dynamic class DynamicEvent extends Event {
public function DynamicEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package com.kerb.utils
Section 458
//IDisposable (com.kerb.utils.IDisposable)
package com.kerb.utils {
public interface IDisposable {
function dispose():void;
}
}//package com.kerb.utils
Section 459
//KerbMaths (com.kerb.utils.KerbMaths)
package com.kerb.utils {
import flash.geom.*;
public final class KerbMaths {
public static const HALF_PI:Number = 1.5707963267949;
public static const QUARTER_PI:Number = 0.785398163397448;
public static const RAD_2_DEG:Number = 57.2957795130823;
public static const TWO_PI:Number = 6.28318530717959;
public static const DEG_2_RAD:Number = 0.0174532925199433;
public function KerbMaths(){
throw (new Error("class is static"));
}
public static function hex2rgb(_arg1:int, _arg2:Array=null):Array{
var _local3 = ((_arg1 >> 16) & 0xFF);
var _local4 = ((_arg1 >> 8) & 0xFF);
var _local5 = (_arg1 & 0xFF);
if (_arg2 == null){
_arg2 = new Array(3);
} else {
_arg2.length = 3;
};
_arg2[0] = _local3;
_arg2[1] = _local4;
_arg2[2] = _local5;
return (_arg2);
}
public static function lineIntersectLine(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Boolean=true):Point{
var _local6:Point;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local7 = (_arg2.y - _arg1.y);
_local9 = (_arg1.x - _arg2.x);
_local11 = ((_arg2.x * _arg1.y) - (_arg1.x * _arg2.y));
_local8 = (_arg4.y - _arg3.y);
_local10 = (_arg3.x - _arg4.x);
_local12 = ((_arg4.x * _arg3.y) - (_arg3.x * _arg4.y));
var _local13:Number = ((_local7 * _local10) - (_local8 * _local9));
if (_local13 == 0){
return (null);
};
_local6 = new Point();
_local6.x = (((_local9 * _local12) - (_local10 * _local11)) / _local13);
_local6.y = (((_local8 * _local11) - (_local7 * _local12)) / _local13);
if (_arg5){
if ((Math.pow((_local6.x - _arg2.x), 2) + Math.pow((_local6.y - _arg2.y), 2)) > (Math.pow((_arg1.x - _arg2.x), 2) + Math.pow((_arg1.y - _arg2.y), 2))){
return (null);
};
if ((Math.pow((_local6.x - _arg1.x), 2) + Math.pow((_local6.y - _arg1.y), 2)) > (Math.pow((_arg1.x - _arg2.x), 2) + Math.pow((_arg1.y - _arg2.y), 2))){
return (null);
};
if ((Math.pow((_local6.x - _arg4.x), 2) + Math.pow((_local6.y - _arg4.y), 2)) > (Math.pow((_arg3.x - _arg4.x), 2) + Math.pow((_arg3.y - _arg4.y), 2))){
return (null);
};
if ((Math.pow((_local6.x - _arg3.x), 2) + Math.pow((_local6.y - _arg3.y), 2)) > (Math.pow((_arg3.x - _arg4.x), 2) + Math.pow((_arg3.y - _arg4.y), 2))){
return (null);
};
};
return (_local6);
}
public static function round(_arg1:Number, _arg2:int):Number{
var _local3:Number = Math.pow(10, _arg2);
return ((Math.round((_local3 * _arg1)) / _local3));
}
public static function angleBetweenDegrees(_arg1:Point, _arg2:Point):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return ((Math.atan2(_local4, _local3) * RAD_2_DEG));
}
public static function angleBetween(_arg1:Point, _arg2:Point):Number{
var _local3:Number = (_arg1.x - _arg2.x);
var _local4:Number = (_arg1.y - _arg2.y);
return (Math.atan2(_local4, _local3));
}
public static function distance(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local4 = (_arg2.x - _arg1.x);
_local5 = (_arg2.y - _arg1.y);
_local3 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
return (_local3);
}
public static function rgb2hex(_arg1:int, _arg2:int, _arg3:int):int{
return ((((_arg1 << 16) | (_arg2 << 8)) | _arg3));
}
}
}//package com.kerb.utils
Section 460
//TextManager (com.kerb.utils.TextManager)
package com.kerb.utils {
import flash.utils.*;
import flash.text.*;
public class TextManager {
private var _xmlData:XML;
private var _fontOverrideFunction:Function;
private static var instance:TextManager;
public function setRawTextField(_arg1:TextField, _arg2:String, _arg3:Boolean=false):void{
var _local4:TextFormat;
if (_fontOverrideFunction != null){
_fontOverrideFunction(_arg1);
};
if (_arg3){
_arg1.htmlText = _arg2;
} else {
if ((((((((_fontOverrideFunction == null)) && ((_arg1.length > 0)))) && (!(_arg1.defaultTextFormat.bold)))) && (_arg1.getTextFormat(0).bold))){
_local4 = new TextFormat();
_local4.bold = true;
_arg1.defaultTextFormat = _local4;
};
_arg1.text = _arg2;
};
}
public function setTextField(_arg1:TextField, _arg2:String, _arg3:Boolean=false):void{
setRawTextField(_arg1, getTextById(_arg2), _arg3);
}
public function setFontOverrideFunction(_arg1:Function):void{
_fontOverrideFunction = _arg1;
}
public function init(_arg1:XML):void{
this._xmlData = _arg1;
}
public function getTextById(_arg1:String):String{
var result:String;
var id = _arg1;
if (_xmlData){
result = _xmlData.text.(@id == id);
if (result){
return (result);
};
if (id != null){
trace(("TextManager Unknown Field:" + id));
};
return ((("[[" + id) + "]]"));
//unresolved jump
};
return (id);
}
public function centerTextField(_arg1:TextField, _arg2:Boolean=true):void{
_arg1.y = ((_arg2) ? 0 : _arg1.y + ((_arg1.height - (_arg1.textHeight + 4)) / 2));
}
public function hasId(_arg1:String):Boolean{
var result:String;
var id = _arg1;
if (_xmlData){
result = _xmlData.text.(@id == id);
if (result){
return (true);
};
};
return (false);
}
public function initFromClass(_arg1:Class):void{
var _local3:XML;
var _local2:ByteArray = ByteArray(new (_arg1));
var _local4:String = _local2.readUTFBytes(3);
if (_local4.length == 1){
this._xmlData = new XML(_local2.readUTFBytes((_local2.length - 3)));
} else {
this._xmlData = new XML((_local4 + _local2.readUTFBytes((_local2.length - 3))));
};
}
public static function getInstance():TextManager{
if (instance == null){
instance = new (TextManager);
};
return (instance);
}
}
}//package com.kerb.utils
Section 461
//EmailValidator (com.kerb.validation.EmailValidator)
package com.kerb.validation {
public class EmailValidator {
public static function validate(_arg1:String):Boolean{
var _local2:String = _arg1.toLowerCase();
var _local3:int = _local2.indexOf("@");
var _local4:String = _local2.substring(0, _local3);
var _local5:int = (_local2.length - 1);
var _local6:int = _local2.lastIndexOf(".");
var _local7:String = _local2.substring((_local3 + 1), _local6);
var _local8:int = (_local5 - (_local6 + 1));
if (_local3 == -1){
return (false);
};
if (_local3 != _local2.lastIndexOf("@")){
return (false);
};
if (xCheckSUVC(_local4) != true){
return (false);
};
if (_local4.length < 1){
return (false);
};
if (xCheckSUVC(_local7) != true){
return (false);
};
if (_local7.length < 1){
return (false);
};
if (xCheckSUVC(_local2.substr((_local6 + 1), _local5)) != true){
return (false);
};
if ((((_local8 < 1)) || ((_local8 > 3)))){
return (false);
};
return (true);
}
private static function xCheckSUVC(_arg1:String):Boolean{
var _local2:Boolean;
var _local3:Array = new Array("!", "�", "$", "%", "^", "&", "*", "+", "=", "?", ":", ";", "'", "\t", " ", "\"", "~", "#", "/");
var _local4:int;
while (_local4 <= (_local3.length - 1)) {
if (_arg1.indexOf(_local3[_local4], 0) != -1){
_local2 = false;
break;
};
_local4++;
};
return (_local2);
}
}
}//package com.kerb.validation
Section 462
//SimpleVideoPlayer (com.kerb.video.SimpleVideoPlayer)
package com.kerb.video {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.media.*;
import flash.net.*;
public class SimpleVideoPlayer extends Sprite implements IDisposable {
private var stream:NetStream;
private var length:Number;
private var video:Video;
private var connection:NetConnection;
public function SimpleVideoPlayer(){
connection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
connection.connect(null);
}
private function netStatusHandler(_arg1:NetStatusEvent):void{
switch (_arg1.info.code){
case "NetStream.Play.Stop":
dispatchEvent(new Event(Event.COMPLETE));
break;
case "NetConnection.Connect.Success":
stream = new NetStream(connection);
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
stream.client = this;
break;
case "NetStream.Play.StreamNotFound":
trace("Unable to locate video");
break;
};
}
public function unloadVideo():void{
if (video == null){
return;
};
removeChild(video);
video = null;
stream.close();
}
public function pauseVideo():void{
if (stream == null){
return;
};
stream.pause();
}
public function get position():Number{
if (length == 0){
return (0);
};
return ((stream.time / length));
}
public function onCuePoint(_arg1:Object):void{
trace(((((("cuepoint: time=" + _arg1.time) + " name=") + _arg1.name) + " type=") + _arg1.type));
var _local2:DynamicEvent = new DynamicEvent(Event.CHANGE);
_local2.info = _arg1;
dispatchEvent(_local2);
}
public function unpauseVideo():void{
if (stream == null){
return;
};
stream.resume();
}
public function playVideo(_arg1:String):void{
unloadVideo();
video = new Video();
video.attachNetStream(stream);
length = 0;
stream.play(_arg1);
trace(_arg1);
addChild(video);
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
trace(("securityErrorHandler: " + _arg1));
}
public function onMetaData(_arg1:Object):void{
length = parseFloat(_arg1.duration);
trace(((((((("metadata: duration=" + _arg1.duration) + " width=") + _arg1.width) + " height=") + _arg1.height) + " framerate=") + _arg1.framerate));
video.width = _arg1.width;
video.height = _arg1.height;
}
public function stopVideo():void{
if (stream == null){
return;
};
stream.seek(0);
stream.pause();
}
public function dispose():void{
unloadVideo();
connection.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
stream.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
stream.close();
connection.close();
stream = null;
connection = null;
}
}
}//package com.kerb.video
Section 463
//Tracker (com.memecounter.Tracker)
package com.memecounter {
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.display.*;
import flash.net.*;
public class Tracker {
public static const ORI_DOM:String = "ori_dom";
public static const LOCALHOST:String = "localhost";
public static const LOCAL:String = "Local";
public static const TRACKER_PATH:String = "/node/tracking/trackerAS3.swf";
private static var ori_dom:String;
private static var lurl:String;
private static var _isReady:Boolean = false;
public static var a:uint = 0;
public static var root:DisplayObject;
public static var c:uint;
public static var d:String = "";
private static var _isInited:Boolean = false;
public static var mcEvent:Function;
public static var fpv:String = "";
private static var l:Loader;
private static var tracker:MovieClip;
public static var da:Array = ["distralytics.com", "distralytics.co.uk"];
private static function loadError(_arg1:Event):void{
a++;
lc();
}
public static function init(_arg1:uint, _arg2:DisplayObject):void{
var _local3:uint;
if (!_isInited){
_isInited = true;
c = _arg1;
root = _arg2;
_local3 = 0;
while (_local3 < da.length) {
Security.allowDomain(("*" + da[_local3]));
Security.allowDomain(da[_local3]);
Security.allowDomain(((c + ".c.") + da[_local3]));
Security.allowDomain(("*." + da[_local3]));
_local3++;
};
ori_dom = (root.loaderInfo.parameters.hasOwnProperty(ORI_DOM)) ? root.loaderInfo.parameters[ORI_DOM] : "";
d = ((ori_dom)!="") ? ori_dom : ((new LocalConnection().domain.indexOf(LOCALHOST))==-1) ? new LocalConnection().domain : LOCAL;
fpv = Capabilities.version.split(" ")[1].split(",")[0];
lurl = (((((((((TRACKER_PATH + "?c=") + c) + "&r=") + Math.floor((Math.random() * 10000000000))) + "&d=") + d) + "&p=") + fpv) + "&as=3");
l = new Loader();
l.contentLoaderInfo.addEventListener(Event.INIT, loadComplete);
l.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
lc();
mcEvent = kvEvent;
};
}
public static function kvClick(_arg1:uint):void{
if (_isReady){
tracker.kvClick(_arg1);
};
}
public static function get isReady():Boolean{
return (_isReady);
}
public static function mcClick(_arg1:String, _arg2:String=null):void{
if (_isReady){
tracker.mcClick(_arg1, _arg2);
};
}
public static function kvEvent(_arg1):void{
if (_isReady){
tracker.kvEvent(_arg1);
};
}
public static function kvCountry():String{
if (_isReady){
return (tracker.kvCountry());
};
return ("");
}
private static function lc():void{
var _local1:String;
var _local2:String = da[(a % da.length)];
if (_local2.charAt(0) === "."){
_local1 = (("http://" + _local2.substr(1, (_local2.length - 1))) + lurl);
} else {
_local1 = (((("http://" + c) + ".c.") + _local2) + lurl);
};
Security.allowDomain(_local1);
l.load(new URLRequest(_local1));
}
private static function loadComplete(_arg1:Event):void{
var e = _arg1;
try {
tracker = e.target.content;
tracker.init(getDefinitionByName("com.memecounter.Tracker"), root);
_isReady = true;
} catch(e:Error) {
trace("Memecounter error: unable to access tracker object due to security sandbox.");
};
}
}
}//package com.memecounter
Section 464
//Car (com.miian.b2dcar.Car)
package com.miian.b2dcar {
import com.kerb.modnation.racer.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import com.miian.b2dhelp.*;
public class Car extends NpcCar {
private var jointRL:b2Joint;
private var jointRR:b2Joint;
private var jointFL:b2RevoluteJoint;
public var wheelRL:b2Body;
private var jointFR:b2RevoluteJoint;
private var lastDrive:Number;// = 0
public var wheelFL:b2Body;
private var lastSteer:Number;// = 0
public var wheelFR:b2Body;
public var wheelRR:b2Body;
public var brakeOn:Boolean;// = false
public static var currentCar:Car;
public function Car(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0.8, _arg5:Number=1, _arg6:Number=0.8, _arg7:Number=0.5, _arg8:Number=0.2, _arg9:Number=0.1){
if (currentCar != null){
currentCar.remove();
};
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
currentCar = this;
}
public function applyForces():void{
wheelRL.m_linearDamping = Racer.RL;
wheelRL.m_angularDamping = Racer.RL;
wheelRR.m_linearDamping = Racer.RR;
wheelRR.m_angularDamping = Racer.RR;
wheelFL.m_linearDamping = Racer.FL;
wheelFL.m_angularDamping = Racer.FR;
wheelFR.m_linearDamping = Racer.FR;
wheelFR.m_angularDamping = Racer.FR;
}
override public function buildCar(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):void{
var _local10:Number = (_arg5 + ((_arg6 + _arg7) / 2));
var _local11:Number = Math.cos(_arg3);
var _local12:Number = Math.sin(_arg3);
var _local13:Number = (_arg4 - _arg9);
var _local14:Number = (_local10 * _arg4);
var _local15:Number = (_arg8 * _arg9);
var _local16:Number = ((_local14 / _local15) / 4);
_local16 = (_local16 * 0.85);
carBody = Helper.addBoxBodyMass((_arg1 + (((_arg6 - _arg7) * _local11) / 2)), (_arg2 + (((_arg6 - _arg7) * _local12) / 2)), _local10, _arg4, _arg3, 1);
wheelFL = Helper.addBoxBody(((_arg1 + (_arg5 * _local11)) + (_local13 * _local12)), ((_arg2 + (_arg5 * _local12)) - (_local13 * _local11)), (_arg8 * 2), _arg9, _arg3, _local16);
wheelFR = Helper.addBoxBody(((_arg1 + (_arg5 * _local11)) - (_local13 * _local12)), ((_arg2 + (_arg5 * _local12)) + (_local13 * _local11)), (_arg8 * 2), _arg9, _arg3, _local16);
wheelRL = Helper.addBoxBody(((_arg1 - (_arg5 * _local11)) + (_local13 * _local12)), ((_arg2 - (_arg5 * _local12)) - (_local13 * _local11)), (_arg8 * 2), _arg9, _arg3, _local16);
wheelRR = Helper.addBoxBody(((_arg1 - (_arg5 * _local11)) - (_local13 * _local12)), ((_arg2 - (_arg5 * _local12)) + (_local13 * _local11)), (_arg8 * 2), _arg9, _arg3, _local16);
wheelFL.SetUserData("FL");
wheelFR.SetUserData("FR");
wheelRL.SetUserData("RL");
wheelRR.SetUserData("RR");
jointFL = (Helper.buildJoint(carBody, wheelFL) as b2RevoluteJoint);
jointFR = (Helper.buildJoint(carBody, wheelFR) as b2RevoluteJoint);
jointRL = Helper.buildJoint(carBody, wheelRL, "prismatic");
jointRR = Helper.buildJoint(carBody, wheelRR, "prismatic");
WheelController.control(wheelFL);
WheelController.control(wheelFR);
WheelController.control(wheelRL);
WheelController.control(wheelRR);
}
override public function remove():void{
Helper.removeJoint(jointFL);
Helper.removeJoint(jointFR);
Helper.removeJoint(jointRL);
Helper.removeJoint(jointRR);
Helper.removeBody(carBody);
Helper.removeBody(wheelFL);
Helper.removeBody(wheelFR);
Helper.removeBody(wheelRL);
Helper.removeBody(wheelRR);
}
public function steer(_arg1:Number):Number{
var _local2:Number;
lastSteer = _arg1;
var _local3:Number = jointFL.GetJointAngle();
_local2 = (_arg1 - jointFL.GetJointAngle());
jointFL.SetMotorSpeed((_local2 * Game.STEER_SPEED_MOD));
_local2 = (_arg1 - jointFR.GetJointAngle());
jointFR.SetMotorSpeed((_local2 * Game.STEER_SPEED_MOD));
return (_local3);
}
public function applyF(_arg1:Number):void{
wheelRL.m_linearDamping = _arg1;
wheelRL.m_angularDamping = _arg1;
wheelRR.m_linearDamping = _arg1;
wheelRR.m_angularDamping = _arg1;
wheelFL.m_linearDamping = _arg1;
wheelFL.m_angularDamping = _arg1;
wheelFR.m_linearDamping = _arg1;
wheelFR.m_angularDamping = _arg1;
}
public function drive(_arg1:Number):void{
lastDrive = _arg1;
var _local2:b2Vec2 = wheelFL.GetXForm().R.col1.Copy();
_local2.Multiply(_arg1);
var _local3:b2Vec2 = wheelFR.GetXForm().R.col1.Copy();
_local3.Multiply(_arg1);
wheelFL.ApplyForce(_local2, wheelFL.GetPosition());
wheelFR.ApplyForce(_local3, wheelFR.GetPosition());
}
public function get body():b2Body{
return (carBody);
}
override public function applyBreak():void{
brakeOn = true;
drive(0);
jointFL.SetMotorSpeed(0);
jointFR.SetMotorSpeed(0);
carBody.m_linearDamping = 100;
carBody.m_angularDamping = 100;
wheelRL.m_linearDamping = 100;
wheelRL.m_angularDamping = 100;
wheelRR.m_linearDamping = 100;
wheelRR.m_angularDamping = 100;
wheelFL.m_linearDamping = 100;
wheelFL.m_angularDamping = 100;
wheelFR.m_linearDamping = 100;
wheelFR.m_angularDamping = 100;
}
public function keepMoving():void{
steer(lastSteer);
drive(lastDrive);
}
override public function releaseBreak():void{
brakeOn = true;
carBody.m_linearDamping = 1;
carBody.m_angularDamping = 1;
wheelRL.m_linearDamping = 1;
wheelRL.m_angularDamping = 1;
wheelRR.m_linearDamping = 1;
wheelRR.m_angularDamping = 1;
wheelFL.m_linearDamping = 1;
wheelFL.m_angularDamping = 1;
wheelFR.m_linearDamping = 1;
wheelFR.m_angularDamping = 1;
}
}
}//package com.miian.b2dcar
Section 465
//NpcCar (com.miian.b2dcar.NpcCar)
package com.miian.b2dcar {
import Box2D.Dynamics.*;
import com.miian.b2dhelp.*;
public class NpcCar {
protected var carBody:b2Body;
public function NpcCar(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0.8, _arg5:Number=1, _arg6:Number=0.8, _arg7:Number=0.5, _arg8:Number=0.2, _arg9:Number=0.1){
buildCar(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
}
public function applyBreak():void{
carBody.m_linearDamping = 50;
carBody.m_angularDamping = 50;
}
public function remove():void{
Helper.removeBody(carBody);
}
public function buildCar(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):void{
var _local10:Number = Math.cos(_arg3);
var _local11:Number = Math.sin(_arg3);
var _local12:Number = (_arg5 + ((_arg6 + _arg7) / 2));
carBody = Helper.addBoxBody((_arg1 + (((_arg6 - _arg7) * _local10) / 2)), (_arg2 + (((_arg6 - _arg7) * _local11) / 2)), _local12, _arg4, _arg3, 2);
}
public function releaseBreak():void{
carBody.m_linearDamping = 1;
carBody.m_angularDamping = 1;
}
}
}//package com.miian.b2dcar
Section 466
//WheelController (com.miian.b2dcar.WheelController)
package com.miian.b2dcar {
import Box2D.Dynamics.*;
import com.boristhebrave.Box2D.Controllers.*;
public class WheelController {
public var ctrler:b2TensorDampingController;
private static var _ins:WheelController;
public function WheelController(){
ctrler = new b2TensorDampingController();
var _local1:int;
while (_local1 < 0xFF) {
ctrler.SetAxisAligned(0, _local1);
ctrler.Ts[_local1] = ctrler.T;
_local1++;
};
}
public function step(_arg1:Number):void{
ctrler.Step(_arg1);
}
public function addBody(_arg1:b2Body):void{
ctrler.AddBody(_arg1);
}
public static function update(_arg1:Number):void{
getController().step(_arg1);
}
public static function getController():WheelController{
if (_ins == null){
_ins = new (WheelController);
};
return (_ins);
}
public static function control(_arg1:b2Body):void{
getController().addBody(_arg1);
}
}
}//package com.miian.b2dcar
Section 467
//Helper (com.miian.b2dhelp.Helper)
package com.miian.b2dhelp {
import flash.display.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
public class Helper {
private static var _world:b2World;
public static function addBoxBodyMass(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=1):b2Body{
var _local7:b2BodyDef;
_local7 = new b2BodyDef();
_local7.position.x = _arg1;
_local7.position.y = _arg2;
_local7.angle = _arg5;
_local7.linearDamping = 1;
_local7.angularDamping = 1;
var _local8:b2PolygonDef = new b2PolygonDef();
_local8.SetAsBox(_arg3, _arg4);
_local8.density = _arg6;
_local8.friction = 0.5;
_local8.restitution = 0.2;
var _local9:b2Body = world.CreateBody(_local7);
_local9.CreateShape(_local8);
var _local10:b2MassData = new b2MassData();
_local10.mass = (5.28 / 2);
_local10.I = 3;
_local10.center.x = -1;
_local9.SetMass(_local10);
return (_local9);
}
public static function buildWorld(_arg1:b2ContactListener=null):Sprite{
var _local2:b2AABB = new b2AABB();
_local2.lowerBound.Set(-1000, -1000);
_local2.upperBound.Set(1000, 1000);
var _local3:b2Vec2 = new b2Vec2(0, 0);
var _local4:Boolean;
_world = new b2World(_local2, _local3, _local4);
if (_arg1 != null){
_world.SetContactListener(_arg1);
};
return (new Sprite());
}
public static function removeJoint(_arg1:b2Joint):void{
world.DestroyJoint(_arg1);
}
public static function update(_arg1:Number, _arg2:Number):void{
world.Step(_arg1, _arg2);
}
public static function buildDebugView():Sprite{
var _local1:b2DebugDraw = new b2DebugDraw();
var _local2:Sprite = new Sprite();
_local1.m_sprite = _local2;
_local1.m_drawScale = 10;
_local1.m_fillAlpha = 0;
_local1.m_lineThickness = 1;
_local1.m_drawFlags = (b2DebugDraw.e_shapeBit | b2DebugDraw.e_centerOfMassBit);
return (_local2);
}
public static function addBoxBody(_arg1:Number, _arg2:Number, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=1):b2Body{
var _local7:b2BodyDef;
_local7 = new b2BodyDef();
_local7.position.x = _arg1;
_local7.position.y = _arg2;
_local7.angle = _arg5;
_local7.linearDamping = 1;
_local7.angularDamping = 1;
var _local8:b2PolygonDef = new b2PolygonDef();
_local8.SetAsBox(_arg3, _arg4);
_local8.density = _arg6;
_local8.friction = 0.5;
_local8.restitution = 0.2;
var _local9:b2Body = world.CreateBody(_local7);
_local9.CreateShape(_local8);
_local9.SetMassFromShapes();
return (_local9);
}
public static function buildPrisJoint(_arg1:b2Body, _arg2:b2Body):b2Joint{
var _local3:b2PrismaticJointDef = new b2PrismaticJointDef();
_local3.Initialize(_arg1, _arg2, _arg2.GetWorldCenter(), new b2Vec2(1, 0));
_local3.enableLimit = true;
_local3.lowerTranslation = (_local3.upperTranslation = 0);
var _local4:b2Joint = world.CreateJoint(_local3);
return (_local4);
}
public static function get world():b2World{
if (_world == null){
buildWorld();
};
return (_world);
}
public static function removeBody(_arg1:b2Body):void{
world.DestroyBody(_arg1);
}
public static function buildRevJoint(_arg1:b2Body, _arg2:b2Body):b2RevoluteJoint{
var _local3:b2RevoluteJointDef = new b2RevoluteJointDef();
_local3.Initialize(_arg1, _arg2, _arg2.GetWorldCenter());
_local3.enableMotor = true;
_local3.maxMotorTorque = 100;
var _local4:b2RevoluteJoint = b2RevoluteJoint(world.CreateJoint(_local3));
return (_local4);
}
public static function addCircleBody(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):b2Body{
var _local5:b2BodyDef = new b2BodyDef();
_local5.position.x = _arg1;
_local5.position.y = _arg2;
var _local6:b2CircleDef = new b2CircleDef();
_local6.radius = _arg3;
_local6.density = 1;
_local6.friction = 0.5;
_local6.restitution = 0.2;
var _local7:b2Body = world.CreateBody(_local5);
_local7.CreateShape(_local6);
_local7.SetMassFromShapes();
return (_local7);
}
public static function buildJoint(_arg1:b2Body, _arg2:b2Body, _arg3:String="revolute"):b2Joint{
if (_arg3 == "revolute"){
return (buildRevJoint(_arg1, _arg2));
};
return (buildPrisJoint(_arg1, _arg2));
}
}
}//package com.miian.b2dhelp
Section 468
//Linear (com.robertpenner.easing.Linear)
package com.robertpenner.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.robertpenner.easing
Section 469
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray {
}
}//package mx.core
Section 470
//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.5.0.12683";
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 471
//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.5.0.12683";
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 472
//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.5.0.12683";
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 473
//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.5.0.12683";
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 474
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 475
//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 476
//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 477
//IContainer (mx.core.IContainer)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.media.*;
import mx.managers.*;
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 478
//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 479
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
import flash.utils.*;
public interface IFlexModuleFactory {
function get preloadedRSLs():Dictionary;
function allowInsecureDomain(... _args):void;
function create(... _args):Object;
function allowDomain(... _args):void;
function info():Object;
}
}//package mx.core
Section 480
//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 481
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 482
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 483
//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 484
//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 485
//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 486
//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 487
//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 488
//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 489
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.5.0.12683";
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 490
//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 491
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
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.5.0.12683";
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 492
//PropertyChangeEvent (mx.events.PropertyChangeEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class PropertyChangeEvent extends Event {
public var newValue:Object;
public var kind:String;
public var property:Object;
public var oldValue:Object;
public var source:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const PROPERTY_CHANGE:String = "propertyChange";
public function PropertyChangeEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=null, _arg5:Object=null, _arg6:Object=null, _arg7:Object=null, _arg8:Object=null){
super(_arg1, _arg2, _arg3);
this.kind = _arg4;
this.property = _arg5;
this.oldValue = _arg6;
this.newValue = _arg7;
this.source = _arg8;
}
override public function clone():Event{
return (new PropertyChangeEvent(type, bubbles, cancelable, kind, property, oldValue, newValue, source));
}
public static function createUpdateEvent(_arg1:Object, _arg2:Object, _arg3:Object, _arg4:Object):PropertyChangeEvent{
var _local5:PropertyChangeEvent = new PropertyChangeEvent(PROPERTY_CHANGE);
_local5.kind = PropertyChangeEventKind.UPDATE;
_local5.oldValue = _arg3;
_local5.newValue = _arg4;
_local5.source = _arg1;
_local5.property = _arg2;
return (_local5);
}
}
}//package mx.events
Section 493
//PropertyChangeEventKind (mx.events.PropertyChangeEventKind)
package mx.events {
import mx.core.*;
public final class PropertyChangeEventKind {
mx_internal static const VERSION:String = "3.5.0.12683";
public static const UPDATE:String = "update";
public static const DELETE:String = "delete";
}
}//package mx.events
Section 494
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.5.0.12683";
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 495
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.5.0.12683";
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 496
//DateBase (mx.formatters.DateBase)
package mx.formatters {
import flash.events.*;
import mx.core.*;
import mx.resources.*;
public class DateBase {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var _resourceManager:IResourceManager;
private static var monthNamesShortOverride:Array;
private static var _dayNamesShort:Array;
private static var initialized:Boolean = false;
private static var _dayNamesLong:Array;
private static var dayNamesLongOverride:Array;
private static var _monthNamesLong:Array;
private static var timeOfDayOverride:Array;
private static var monthNamesLongOverride:Array;
private static var _monthNamesShort:Array;
private static var _timeOfDay:Array;
private static var dayNamesShortOverride:Array;
public static function get monthNamesLong():Array{
initialize();
return (_monthNamesLong);
}
public static function set monthNamesLong(_arg1:Array):void{
var _local2:String;
var _local3:int;
var _local4:int;
monthNamesLongOverride = _arg1;
_monthNamesLong = ((_arg1)!=null) ? _arg1 : resourceManager.getStringArray("SharedResources", "monthNames");
if (_arg1 == null){
_local2 = resourceManager.getString("SharedResources", "monthSymbol");
if (_local2 != " "){
_local3 = (_monthNamesLong) ? _monthNamesLong.length : 0;
_local4 = 0;
while (_local4 < _local3) {
_monthNamesLong[_local4] = (_monthNamesLong[_local4] + _local2);
_local4++;
};
};
};
}
public static function get dayNamesLong():Array{
initialize();
return (_dayNamesLong);
}
private static function static_resourceManager_changeHandler(_arg1:Event):void{
static_resourcesChanged();
}
mx_internal static function get defaultStringKey():Array{
initialize();
return (monthNamesLong.concat(timeOfDay));
}
public static function set dayNamesLong(_arg1:Array):void{
dayNamesLongOverride = _arg1;
_dayNamesLong = ((_arg1)!=null) ? _arg1 : resourceManager.getStringArray("SharedResources", "dayNames");
}
public static function set timeOfDay(_arg1:Array):void{
timeOfDayOverride = _arg1;
var _local2:String = resourceManager.getString("formatters", "am");
var _local3:String = resourceManager.getString("formatters", "pm");
_timeOfDay = ((_arg1)!=null) ? _arg1 : [_local2, _local3];
}
public static function set monthNamesShort(_arg1:Array):void{
var _local2:String;
var _local3:int;
var _local4:int;
monthNamesShortOverride = _arg1;
_monthNamesShort = ((_arg1)!=null) ? _arg1 : resourceManager.getStringArray("formatters", "monthNamesShort");
if (_arg1 == null){
_local2 = resourceManager.getString("SharedResources", "monthSymbol");
if (_local2 != " "){
_local3 = (_monthNamesShort) ? _monthNamesShort.length : 0;
_local4 = 0;
while (_local4 < _local3) {
_monthNamesShort[_local4] = (_monthNamesShort[_local4] + _local2);
_local4++;
};
};
};
}
public static function get dayNamesShort():Array{
initialize();
return (_dayNamesShort);
}
private static function static_resourcesChanged():void{
dayNamesLong = dayNamesLongOverride;
dayNamesShort = dayNamesShortOverride;
monthNamesLong = monthNamesLongOverride;
monthNamesShort = monthNamesShortOverride;
timeOfDay = timeOfDayOverride;
}
public static function get timeOfDay():Array{
initialize();
return (_timeOfDay);
}
mx_internal static function extractTokenDate(_arg1:Date, _arg2:Object):String{
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
initialize();
var _local3 = "";
var _local4:int = (int(_arg2.end) - int(_arg2.begin));
switch (_arg2.token){
case "Y":
_local7 = _arg1.getFullYear().toString();
if (_local4 < 3){
return (_local7.substr(2));
};
if (_local4 > 4){
return (setValue(Number(_local7), _local4));
};
return (_local7);
case "M":
_local8 = int(_arg1.getMonth());
if (_local4 < 3){
_local8++;
_local3 = (_local3 + setValue(_local8, _local4));
return (_local3);
};
if (_local4 == 3){
return (monthNamesShort[_local8]);
};
return (monthNamesLong[_local8]);
case "D":
_local5 = int(_arg1.getDate());
_local3 = (_local3 + setValue(_local5, _local4));
return (_local3);
case "E":
_local5 = int(_arg1.getDay());
if (_local4 < 3){
_local3 = (_local3 + setValue(_local5, _local4));
return (_local3);
};
if (_local4 == 3){
return (dayNamesShort[_local5]);
};
return (dayNamesLong[_local5]);
case "A":
_local6 = int(_arg1.getHours());
if (_local6 < 12){
return (timeOfDay[0]);
};
return (timeOfDay[1]);
case "H":
_local6 = int(_arg1.getHours());
if (_local6 == 0){
_local6 = 24;
};
_local3 = (_local3 + setValue(_local6, _local4));
return (_local3);
case "J":
_local6 = int(_arg1.getHours());
_local3 = (_local3 + setValue(_local6, _local4));
return (_local3);
case "K":
_local6 = int(_arg1.getHours());
if (_local6 >= 12){
_local6 = (_local6 - 12);
};
_local3 = (_local3 + setValue(_local6, _local4));
return (_local3);
case "L":
_local6 = int(_arg1.getHours());
if (_local6 == 0){
_local6 = 12;
} else {
if (_local6 > 12){
_local6 = (_local6 - 12);
};
};
_local3 = (_local3 + setValue(_local6, _local4));
return (_local3);
case "N":
_local9 = int(_arg1.getMinutes());
_local3 = (_local3 + setValue(_local9, _local4));
return (_local3);
case "S":
_local10 = int(_arg1.getSeconds());
_local3 = (_local3 + setValue(_local10, _local4));
return (_local3);
case "Q":
_local11 = int(_arg1.getMilliseconds());
_local3 = (_local3 + setValue(_local11, _local4));
return (_local3);
};
return (_local3);
}
private static function initialize():void{
if (!initialized){
resourceManager.addEventListener(Event.CHANGE, static_resourceManager_changeHandler, false, 0, true);
static_resourcesChanged();
initialized = true;
};
}
public static function set dayNamesShort(_arg1:Array):void{
dayNamesShortOverride = _arg1;
_dayNamesShort = ((_arg1)!=null) ? _arg1 : resourceManager.getStringArray("formatters", "dayNamesShort");
}
private static function get resourceManager():IResourceManager{
if (!_resourceManager){
_resourceManager = ResourceManager.getInstance();
};
return (_resourceManager);
}
public static function get monthNamesShort():Array{
initialize();
return (_monthNamesShort);
}
private static function setValue(_arg1:Object, _arg2:int):String{
var _local5:int;
var _local6:int;
var _local3 = "";
var _local4:int = _arg1.toString().length;
if (_local4 < _arg2){
_local5 = (_arg2 - _local4);
_local6 = 0;
while (_local6 < _local5) {
_local3 = (_local3 + "0");
_local6++;
};
};
_local3 = (_local3 + _arg1.toString());
return (_local3);
}
}
}//package mx.formatters
Section 497
//DateFormatter (mx.formatters.DateFormatter)
package mx.formatters {
import mx.core.*;
public class DateFormatter extends Formatter {
private var formatStringOverride:String;
private var _formatString:String;
mx_internal static const VERSION:String = "3.5.0.12683";
private static const VALID_PATTERN_CHARS:String = "Y,M,D,A,E,H,J,K,L,N,S,Q";
public function set formatString(_arg1:String):void{
formatStringOverride = _arg1;
_formatString = ((_arg1)!=null) ? _arg1 : resourceManager.getString("SharedResources", "dateFormat");
}
override protected function resourcesChanged():void{
super.resourcesChanged();
formatString = formatStringOverride;
}
override public function format(_arg1:Object):String{
var _local2:String;
if (error){
error = null;
};
if (((!(_arg1)) || ((((_arg1 is String)) && ((_arg1 == "")))))){
error = defaultInvalidValueError;
return ("");
};
if ((_arg1 is String)){
_arg1 = _slot1.parseDateString(String(_arg1));
if (!_arg1){
error = defaultInvalidValueError;
return ("");
};
} else {
if (!(_arg1 is Date)){
error = defaultInvalidValueError;
return ("");
};
};
var _local3:int;
var _local4 = "";
var _local5:int = formatString.length;
var _local6:int;
while (_local6 < _local5) {
_local2 = formatString.charAt(_local6);
if (((!((VALID_PATTERN_CHARS.indexOf(_local2) == -1))) && (!((_local2 == ","))))){
_local3++;
if (_local4.indexOf(_local2) == -1){
_local4 = (_local4 + _local2);
} else {
if (_local2 != formatString.charAt(Math.max((_local6 - 1), 0))){
error = defaultInvalidFormatError;
return ("");
};
};
};
_local6++;
};
if (_local3 < 1){
error = defaultInvalidFormatError;
return ("");
};
var _local7:StringFormatter = new StringFormatter(formatString, VALID_PATTERN_CHARS, DateBase.mx_internal::extractTokenDate);
return (_local7.formatValue(_arg1));
}
public function get formatString():String{
return (_formatString);
}
public static function parseDateString(_arg1:String):Date{
var _local14:String;
var _local15:int;
var _local16:int;
var _local17:String;
var _local18:String;
var _local19:int;
if (((!(_arg1)) || ((_arg1 == "")))){
return (null);
};
var _local2 = -1;
var _local3 = -1;
var _local4 = -1;
var _local5 = -1;
var _local6 = -1;
var _local7 = -1;
var _local8 = "";
var _local9:Object = 0;
var _local10:int;
var _local11:int = _arg1.length;
var _local12:RegExp = /(GMT|UTC)((\+|-)\d\d\d\d )?/ig;
_arg1 = _arg1.replace(_local12, "");
while (_local10 < _local11) {
_local8 = _arg1.charAt(_local10);
_local10++;
if ((((_local8 <= " ")) || ((_local8 == ",")))){
} else {
if ((((((((_local8 == "/")) || ((_local8 == ":")))) || ((_local8 == "+")))) || ((_local8 == "-")))){
_local9 = _local8;
} else {
if (((((("a" <= _local8)) && ((_local8 <= "z")))) || (((("A" <= _local8)) && ((_local8 <= "Z")))))){
_local14 = _local8;
while (_local10 < _local11) {
_local8 = _arg1.charAt(_local10);
if (!((((("a" <= _local8)) && ((_local8 <= "z")))) || (((("A" <= _local8)) && ((_local8 <= "Z")))))){
break;
};
_local14 = (_local14 + _local8);
_local10++;
};
_local15 = DateBase.mx_internal::defaultStringKey.length;
_local16 = 0;
while (_local16 < _local15) {
_local17 = String(DateBase.mx_internal::defaultStringKey[_local16]);
if ((((_local17.toLowerCase() == _local14.toLowerCase())) || ((_local17.toLowerCase().substr(0, 3) == _local14.toLowerCase())))){
if (_local16 == 13){
if ((((_local5 > 12)) || ((_local5 < 1)))){
break;
} else {
if (_local5 < 12){
_local5 = (_local5 + 12);
};
};
} else {
if (_local16 == 12){
if ((((_local5 > 12)) || ((_local5 < 1)))){
break;
} else {
if (_local5 == 12){
_local5 = 0;
};
};
} else {
if (_local16 < 12){
if (_local3 < 0){
_local3 = _local16;
} else {
break;
};
};
};
};
break;
};
_local16++;
};
_local9 = 0;
} else {
if (((("0" <= _local8)) && ((_local8 <= "9")))){
_local18 = _local8;
while (((((("0" <= (_local8 = _arg1.charAt(_local10)))) && ((_local8 <= "9")))) && ((_local10 < _local11)))) {
_local18 = (_local18 + _local8);
_local10++;
};
_local19 = int(_local18);
if (_local19 >= 70){
if (_local2 != -1){
break;
} else {
if ((((((((((((_local8 <= " ")) || ((_local8 == ",")))) || ((_local8 == ".")))) || ((_local8 == "/")))) || ((_local8 == "-")))) || ((_local10 >= _local11)))){
_local2 = _local19;
} else {
break;
};
};
} else {
if ((((((_local8 == "/")) || ((_local8 == "-")))) || ((_local8 == ".")))){
if (_local3 < 0){
_local3 = (_local19 - 1);
} else {
if (_local4 < 0){
_local4 = _local19;
} else {
break;
};
};
} else {
if (_local8 == ":"){
if (_local5 < 0){
_local5 = _local19;
} else {
if (_local6 < 0){
_local6 = _local19;
} else {
break;
};
};
} else {
if ((((_local5 >= 0)) && ((_local6 < 0)))){
_local6 = _local19;
} else {
if ((((_local6 >= 0)) && ((_local7 < 0)))){
_local7 = _local19;
} else {
if (_local4 < 0){
_local4 = _local19;
} else {
if ((((((_local2 < 0)) && ((_local3 >= 0)))) && ((_local4 >= 0)))){
_local2 = (2000 + _local19);
} else {
break;
};
};
};
};
};
};
};
_local9 = 0;
};
};
};
};
};
if ((((((((((_local2 < 0)) || ((_local3 < 0)))) || ((_local3 > 11)))) || ((_local4 < 1)))) || ((_local4 > 31)))){
return (null);
};
if (_local7 < 0){
_local7 = 0;
};
if (_local6 < 0){
_local6 = 0;
};
if (_local5 < 0){
_local5 = 0;
};
var _local13:Date = new Date(_local2, _local3, _local4, _local5, _local6, _local7);
if (((!((_local4 == _local13.getDate()))) || (!((_local3 == _local13.getMonth()))))){
return (null);
};
return (_local13);
}
}
}//package mx.formatters
Section 498
//Formatter (mx.formatters.Formatter)
package mx.formatters {
import flash.events.*;
import mx.core.*;
import mx.resources.*;
public class Formatter {
private var _resourceManager:IResourceManager;
public var error:String;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var defaultInvalidFormatErrorOverride:String;
private static var _defaultInvalidValueError:String;
private static var _static_resourceManager:IResourceManager;
private static var initialized:Boolean = false;
private static var defaultInvalidValueErrorOverride:String;
private static var _defaultInvalidFormatError:String;
public function Formatter(){
_resourceManager = ResourceManager.getInstance();
super();
resourceManager.addEventListener(Event.CHANGE, resourceManager_changeHandler, false, 0, true);
resourcesChanged();
}
protected function resourcesChanged():void{
}
private function resourceManager_changeHandler(_arg1:Event):void{
resourcesChanged();
}
public function format(_arg1:Object):String{
error = ("This format function is abstract. " + "Subclasses must override it.");
return ("");
}
protected function get resourceManager():IResourceManager{
return (_resourceManager);
}
private static function static_resourcesChanged():void{
defaultInvalidFormatError = defaultInvalidFormatErrorOverride;
defaultInvalidValueError = defaultInvalidValueErrorOverride;
}
public static function set defaultInvalidValueError(_arg1:String):void{
defaultInvalidValueErrorOverride = _arg1;
_defaultInvalidValueError = ((_arg1)!=null) ? _arg1 : static_resourceManager.getString("formatters", "defaultInvalidValueError");
}
private static function static_resourceManager_changeHandler(_arg1:Event):void{
static_resourcesChanged();
}
public static function get defaultInvalidValueError():String{
initialize();
return (_defaultInvalidValueError);
}
private static function get static_resourceManager():IResourceManager{
if (!_static_resourceManager){
_static_resourceManager = ResourceManager.getInstance();
};
return (_static_resourceManager);
}
public static function set defaultInvalidFormatError(_arg1:String):void{
defaultInvalidFormatErrorOverride = _arg1;
_defaultInvalidFormatError = ((_arg1)!=null) ? _arg1 : static_resourceManager.getString("formatters", "defaultInvalidFormatError");
}
private static function initialize():void{
if (!initialized){
static_resourceManager.addEventListener(Event.CHANGE, static_resourceManager_changeHandler, false, 0, true);
static_resourcesChanged();
initialized = true;
};
}
public static function get defaultInvalidFormatError():String{
initialize();
return (_defaultInvalidFormatError);
}
}
}//package mx.formatters
Section 499
//StringFormatter (mx.formatters.StringFormatter)
package mx.formatters {
import mx.core.*;
public class StringFormatter {
private var reqFormat:String;
private var extractToken:Function;
private var patternInfo:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
public function StringFormatter(_arg1:String, _arg2:String, _arg3:Function){
formatPattern(_arg1, _arg2);
extractToken = _arg3;
}
public function formatValue(_arg1:Object):String{
var _local2:Object = patternInfo[0];
var _local3:String = (reqFormat.substring(0, _local2.begin) + extractToken(_arg1, _local2));
var _local4:Object = _local2;
var _local5:int = patternInfo.length;
var _local6 = 1;
while (_local6 < _local5) {
_local2 = patternInfo[_local6];
_local3 = (_local3 + (reqFormat.substring(_local4.end, _local2.begin) + extractToken(_arg1, _local2)));
_local4 = _local2;
_local6++;
};
if ((((_local4.end > 0)) && (!((_local4.end == reqFormat.length))))){
_local3 = (_local3 + reqFormat.substring(_local4.end));
};
return (_local3);
}
private function compareValues(_arg1:Object, _arg2:Object):int{
if (_arg1.begin > _arg2.begin){
return (1);
};
if (_arg1.begin < _arg2.begin){
return (-1);
};
return (0);
}
private function formatPattern(_arg1:String, _arg2:String):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array = _arg2.split(",");
reqFormat = _arg1;
patternInfo = [];
var _local7:int = _local6.length;
var _local8:int;
while (_local8 < _local7) {
_local3 = reqFormat.indexOf(_local6[_local8]);
if ((((_local3 >= 0)) && ((_local3 < reqFormat.length)))){
_local4 = reqFormat.lastIndexOf(_local6[_local8]);
_local4 = ((_local4 >= 0)) ? (_local4 + 1) : (_local3 + 1);
patternInfo.splice(_local5, 0, {token:_local6[_local8], begin:_local3, end:_local4});
_local5++;
};
_local8++;
};
patternInfo.sort(compareValues);
}
}
}//package mx.formatters
Section 500
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import mx.utils.*;
import flash.filters.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.5.0.12683";
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 501
//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 502
//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 503
//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 504
//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 505
//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 506
//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 507
//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;
public static var dispatchingEventToOtherSystemManagers:Boolean;
}
}//package mx.managers
Section 508
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.system.*;
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 509
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.5.0.12683";
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.utils.*;
import flash.system.*;
import flash.display.*;
import mx.events.*;
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;
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.READY);
_local2.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
_local2.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
dispatchEvent(_local2);
}
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 510
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
}
}//package mx.modules
Section 511
//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 512
//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 513
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 514
//LocaleSorter (mx.resources.LocaleSorter)
package mx.resources {
import mx.core.*;
public class LocaleSorter {
mx_internal static const VERSION:String = "3.5.0.12683";
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];
appendElements(_local1, extended_langs);
if (script != ""){
_local1.push(script);
};
if (region != ""){
_local1.push(region);
};
appendElements(_local1, variants);
for (_local2 in extensions) {
if (extensions.hasOwnProperty(_local2)){
_local1.push(_local2);
appendElements(_local1, extensions[_local2]);
};
};
if (privates.length > 0){
_local1.push("x");
appendElements(_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);
}
private static function appendElements(_arg1:Array, _arg2:Array):void{
var _local3:uint;
var _local4:uint = _arg2.length;
while (_local3 < _local4) {
_arg1.push(_arg2[_local3]);
_local3++;
};
}
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 515
//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.5.0.12683";
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 516
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import mx.core.*;
public class ResourceManager {
mx_internal static const VERSION:String = "3.5.0.12683";
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 517
//ResourceManagerImpl (mx.resources.ResourceManagerImpl)
package mx.resources {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
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.5.0.12683";
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{
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local3:ResourceModuleInfo = resourceModules[_arg1];
if (!_local3){
return;
};
if (_local3.resourceModule){
_local4 = _local3.resourceModule.resourceBundles;
if (_local4){
_local5 = _local4.length;
_local6 = 0;
while (_local6 < _local5) {
_local7 = _local4[_local6].locale;
_local8 = _local4[_local6].bundleName;
removeResourceBundle(_local7, _local8);
_local6++;
};
};
};
resourceModules[_arg1] = null;
delete resourceModules[_arg1];
_local3.moduleInfo.unload();
if (_arg2){
this.update();
};
}
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 518
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
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.5.0.12683";
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:Number;
var _local11:Array;
var _local12: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 = Math.max((radius - Math.max(_local6.top, _local6.left, _local6.right)), 0);
_local10 = (bRoundedCorners) ? Math.max((radius - Math.max(_local6.bottom, _local6.left, _local6.right)), 0) : 0;
radiusObj = {tl:_local9, tr:_local9, bl:_local10, br:_local10};
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)))){
_local11 = getStyle("highlightAlphas");
_local12 = (_local11) ? _local11[0] : 0.3;
drawRoundRect(0, 0, _arg1, _arg2, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, _local12, 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 519
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
import mx.skins.*;
import mx.utils.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
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();
if (_local3){
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 520
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.5.0.12683";
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 521
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
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.5.0.12683";
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 522
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import mx.styles.*;
import flash.system.*;
import flash.display.*;
import flash.geom.*;
import mx.resources.*;
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.5.0.12683";
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{
if (((((_backgroundImageBounds) && (_arg1))) && (_backgroundImageBounds.equals(_arg1)))){
return;
};
_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 523
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.display.*;
import mx.managers.*;
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.5.0.12683";
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 524
//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 525
//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 526
//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 527
//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 528
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 529
//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.5.0.12683";
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 530
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.*;
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.5.0.12683";
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);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
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 531
//Base64Decoder (mx.utils.Base64Decoder)
package mx.utils {
import flash.utils.*;
import mx.resources.*;
public class Base64Decoder {
private var filled:int;// = 0
private var data:ByteArray;
private var count:int;// = 0
private var work:Array;
private var resourceManager:IResourceManager;
private static const ESCAPE_CHAR_CODE:Number = 61;
private static const inverse:Array = [64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64, 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64];
public function Base64Decoder(){
work = [0, 0, 0, 0];
resourceManager = ResourceManager.getInstance();
super();
data = new ByteArray();
}
public function flush():ByteArray{
var _local1:String;
if (count > 0){
_local1 = resourceManager.getString("utils", "partialBlockDropped", [count]);
throw (new Error(_local1));
};
return (drain());
}
public function reset():void{
data = new ByteArray();
count = 0;
filled = 0;
}
public function decode(_arg1:String):void{
var _local3:Number;
var _local2:uint;
for (;_local2 < _arg1.length;_local2++) {
_local3 = _arg1.charCodeAt(_local2);
if (_local3 == ESCAPE_CHAR_CODE){
var _local4 = count++;
work[_local4] = -1;
} else {
if (inverse[_local3] != 64){
_local4 = count++;
work[_local4] = inverse[_local3];
} else {
continue;
};
};
if (count == 4){
count = 0;
data.writeByte(((work[0] << 2) | ((work[1] & 0xFF) >> 4)));
filled++;
if (work[2] == -1){
break;
};
data.writeByte(((work[1] << 4) | ((work[2] & 0xFF) >> 2)));
filled++;
if (work[3] == -1){
break;
};
data.writeByte(((work[2] << 6) | work[3]));
filled++;
};
};
}
public function toByteArray():ByteArray{
var _local1:ByteArray = flush();
reset();
return (_local1);
}
public function drain():ByteArray{
var _local1:ByteArray = new ByteArray();
copyByteArray(data, _local1, filled);
filled = 0;
return (_local1);
}
private static function copyByteArray(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint=0):void{
var _local4:int = _arg1.position;
_arg1.position = 0;
_arg2.position = 0;
var _local5:uint;
while ((((_arg1.bytesAvailable > 0)) && ((_local5 < _arg3)))) {
_arg2.writeByte(_arg1.readByte());
_local5++;
};
_arg1.position = _local4;
_arg2.position = 0;
}
}
}//package mx.utils
Section 532
//Base64Encoder (mx.utils.Base64Encoder)
package mx.utils {
import flash.utils.*;
public class Base64Encoder {
private var _line:uint;
private var _count:uint;
private var _buffers:Array;
public var insertNewLines:Boolean;// = true
private var _work:Array;
public static const MAX_BUFFER_SIZE:uint = 32767;
private static const ALPHABET_CHAR_CODES:Array = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47];
public static const CHARSET_UTF_8:String = "UTF-8";
private static const ESCAPE_CHAR_CODE:Number = 61;
public static var newLine:int = 10;
public function Base64Encoder(){
_work = [0, 0, 0];
super();
reset();
}
public function flush():String{
if (_count > 0){
encodeBlock();
};
var _local1:String = drain();
reset();
return (_local1);
}
public function toString():String{
return (flush());
}
public function reset():void{
_buffers = [];
_buffers.push([]);
_count = 0;
_line = 0;
_work[0] = 0;
_work[1] = 0;
_work[2] = 0;
}
public function encodeBytes(_arg1:ByteArray, _arg2:uint=0, _arg3:uint=0):void{
if (_arg3 == 0){
_arg3 = _arg1.length;
};
var _local4:uint = _arg1.position;
_arg1.position = _arg2;
var _local5:uint = _arg2;
var _local6:uint = (_arg2 + _arg3);
if (_local6 > _arg1.length){
_local6 = _arg1.length;
};
while (_local5 < _local6) {
_work[_count] = _arg1[_local5];
_count++;
if ((((_count == _work.length)) || (((_local6 - _local5) == 1)))){
encodeBlock();
_count = 0;
_work[0] = 0;
_work[1] = 0;
_work[2] = 0;
};
_local5++;
};
_arg1.position = _local4;
}
public function encode(_arg1:String, _arg2:uint=0, _arg3:uint=0):void{
if (_arg3 == 0){
_arg3 = _arg1.length;
};
var _local4:uint = _arg2;
var _local5:uint = (_arg2 + _arg3);
if (_local5 > _arg1.length){
_local5 = _arg1.length;
};
while (_local4 < _local5) {
_work[_count] = _arg1.charCodeAt(_local4);
_count++;
if ((((_count == _work.length)) || (((_local5 - _local4) == 1)))){
encodeBlock();
_count = 0;
_work[0] = 0;
_work[1] = 0;
_work[2] = 0;
};
_local4++;
};
}
private function encodeBlock():void{
var _local1:Array = (_buffers[(_buffers.length - 1)] as Array);
if (_local1.length >= MAX_BUFFER_SIZE){
_local1 = [];
_buffers.push(_local1);
};
_local1.push(ALPHABET_CHAR_CODES[((_work[0] & 0xFF) >> 2)]);
_local1.push(ALPHABET_CHAR_CODES[(((_work[0] & 3) << 4) | ((_work[1] & 240) >> 4))]);
if (_count > 1){
_local1.push(ALPHABET_CHAR_CODES[(((_work[1] & 15) << 2) | ((_work[2] & 192) >> 6))]);
} else {
_local1.push(ESCAPE_CHAR_CODE);
};
if (_count > 2){
_local1.push(ALPHABET_CHAR_CODES[(_work[2] & 63)]);
} else {
_local1.push(ESCAPE_CHAR_CODE);
};
if (insertNewLines){
if ((_line = (_line + 4)) == 76){
_local1.push(newLine);
_line = 0;
};
};
}
public function encodeUTFBytes(_arg1:String):void{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
_local2.position = 0;
encodeBytes(_local2);
}
public function drain():String{
var _local3:Array;
var _local1 = "";
var _local2:uint;
while (_local2 < _buffers.length) {
_local3 = (_buffers[_local2] as Array);
_local1 = (_local1 + String.fromCharCode.apply(null, _local3));
_local2++;
};
_buffers = [];
_buffers.push([]);
return (_local1);
}
}
}//package mx.utils
Section 533
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
import mx.core.*;
public class ColorUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
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 534
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
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 535
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import mx.core.*;
import flash.utils.*;
import flash.display.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
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 536
//StringUtil (mx.utils.StringUtil)
package mx.utils {
import mx.core.*;
public class StringUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
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 537
//_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 538
//_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 539
//_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 540
//_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 541
//_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 542
//_CompiledResourceBundleInfo (_CompiledResourceBundleInfo)
package {
public class _CompiledResourceBundleInfo {
public static function get compiledLocales():Array{
return (["en_US"]);
}
public static function get compiledResourceBundleNames():Array{
return (["SharedResources", "formatters", "utils"]);
}
}
}//package
Section 543
//_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 544
//_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 545
//_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 546
//_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 547
//_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 548
//_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 549
//_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 550
//_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 551
//_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 552
//_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 553
//_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 554
//_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 555
//_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 556
//_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 557
//_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 558
//_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 559
//_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 560
//_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 561
//Constants (Constants)
package {
import com.kerb.modnation.tracks.renderers.*;
public class Constants {
public static const FACEBOOK_API_KEY:String = "7fb4c17ed831c06bfba56fa910eeab48";
public static const FILTER_SORT_BY_MOST_RACED:String = "most_raced";
public static const API_BASE_URL:String = (BASE_URL + "api/");
public static const MAX_PROPS:Number = 100;
public static const APP_NAME:String = "Modnation_racers";
public static const MAX_TROPHY:Number = 70;
public static const ROUTE_COMPETITION:String = "ROUTE_COMPETITION";
public static const GAME_URL:String = "http://www.modnation.com/";
public static const ROUTE_TRACK:String = "ROUTE_TRACK";
public static const MAX_BITMAP_SIZE:Number = 2880;
public static const FACEBOOK_APP_URL:String = "http://apps.facebook.com/modnation_mini_game/";
public static const KERB_SOCIAL_HYVES:String = "HYVES";
public static const ENVIRO_SEASIDE:Number = 4;
public static const FILTER_SORT_BY_BEST:String = "my_best_rank";
public static const KERB_SOCIAL_LOCAL_TEST:String = "FBT";
public static const KERB_SOCIAL_NETLOG:String = "NETLOG";
public static const FILTER_SORT_BY_HIGHEST:String = "highest_rated";
public static const FILTER_FOR_TRACK:String = "track";
public static const VIDEO_BASE_DEFAULT_URL:String = "http://e1.dl.playstation.net/e1/campaignsite/modnation.com/";
public static const ROUTE_CHALLENGE:String = "ROUTE_CHALLENGE";
public static const KERB_SOCIAL_FACEBOOK_CONNECT:String = "FBC";
public static const FILTER_FOR_CREATOR:String = "user";
public static const FILTER_SORT_BY_LATEST:String = "newest";
public static const ROUTE_COLD:String = "ROUTE_COLD";
public static const ENVIRO_DESERT:Number = 2;
public static const ENVIRO_ALPINE:Number = 1;
public static const FILTER_SORT_BY_OLDEST:String = "oldest";
public static const MAX_TRACK_LENGTH:Number = 10000;
public static const FILTER_SORT_BY_LOWEST:String = "lowest_rated";
public static const BASE_URL:String = "http://minigames.software.eu.playstation.com/modnation/";
public static const ENVIRO_JUNGLE:Number = 3;
public static const KERB_SOCIAL_FACEBOOK_APP:String = "FBA";
public static const KERB_SOCIAL_VZ:String = "VZ";
public static const TRACKS_POOL:Array = [27, 9, 3, 170, 32, 165, 166, 6, 79, 168];
public static const DESERT_WIDTH:Number = 1.8;
public static const VIDEO_BASE_US_URL:String = "http://e1.dl.playstation.net/e1/campaignsite/modnation.com/en_US/";
public static var _trackId:Number;
public static var ROUTE:String;
private static var CHEAT_MODE:Boolean = false;
public static var KERB_SOCIAL_ID:String;
public static var VIDEO_BASE_URL:String = "http://e1.dl.playstation.net/e1/campaignsite/modnation.com/";
public static var challengeId:Number;
private static var _LOCALE:String = "en_GB";
public static function set trackId(_arg1:Number):void{
if (_trackId != _arg1){
RacerRenderer.cacheTrack = false;
};
_trackId = _arg1;
}
public static function set LOCALE(_arg1:String):void{
_LOCALE = _arg1;
}
public static function get trackId():Number{
return (_trackId);
}
public static function get LOCALE():String{
return (_LOCALE);
}
}
}//package
Section 562
//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 563
//en_US$formatters_properties (en_US$formatters_properties)
package {
import mx.resources.*;
public class en_US$formatters_properties extends ResourceBundle {
public function en_US$formatters_properties(){
super("en_US", "formatters");
}
override protected function getContent():Object{
var _local1:Object = {zipCodeFormat:"#####", defaultInvalidFormatError:"Invalid format", pm:"PM", useThousandsSeparator:"true", useNegativeSign:"true", am:"AM", areaCode:"-1", validPatternChars:"+()#- .", phoneNumberFormat:"(###) ###-####", defaultInvalidValueError:"Invalid value", areaCodeFormat:"(###)", monthNamesShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", numberFormatterPrecision:"-1", dayNamesShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat", rounding:"none", currencyFormatterPrecision:"-1"};
return (_local1);
}
}
}//package
Section 564
//en_US$SharedResources_properties (en_US$SharedResources_properties)
package {
import mx.resources.*;
public class en_US$SharedResources_properties extends ResourceBundle {
public function en_US$SharedResources_properties(){
super("en_US", "SharedResources");
}
override protected function getContent():Object{
var _local1:Object = {dateFormat:"MM/DD/YYYY", dayNames:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday", thousandsSeparatorFrom:",", monthNames:"January,February,March,April,May,June,July,August,September,October,November,December", decimalSeparatorFrom:".", currencySymbol:"$", decimalSeparatorTo:".", thousandsSeparatorTo:",", monthSymbol:"", alignSymbol:"left"};
return (_local1);
}
}
}//package
Section 565
//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 566
//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 567
//en_US$utils_properties (en_US$utils_properties)
package {
import mx.resources.*;
public class en_US$utils_properties extends ResourceBundle {
public function en_US$utils_properties(){
super("en_US", "utils");
}
override protected function getContent():Object{
var _local1:Object = {partialBlockDropped:"A partial block ({0} of 4 bytes) was dropped. Decoded data is probably truncated!"};
return (_local1);
}
}
}//package
Section 568
//Modnation (Modnation)
package {
import flash.events.*;
import flash.display.*;
import com.kerb.modnation.*;
public class Modnation extends Sprite {
private var sp:Sprite;
public function Modnation(){
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(_arg1:Event):void{
sp = new Sprite();
sp.graphics.beginFill(0, 1);
sp.graphics.drawRect(0, 0, 600, 400);
sp.graphics.endFill();
addChildAt(new Main(), 0);
addChild(sp);
this.mask = sp;
}
}
}//package
Section 569
//PreLoader (PreLoader)
package {
import flash.events.*;
import flash.display.*;
import com.kerb.utils.*;
import flash.utils.*;
public final class PreLoader extends MovieClip {
private var _af:AssetFactory;
private var swfBytes:Class;
private var _clip:MovieClip;
public function PreLoader(){
swfBytes = PreLoader_swfBytes;
super();
stop();
trace("PRELOADER");
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
protected function _preloadComplete():void{
var _local1:Class;
if (currentFrame == 1){
trace("nextframe");
nextFrame();
} else {
trace("removing");
removeEventListener(Event.ENTER_FRAME, _onEnterFrame);
_local1 = Class(getDefinitionByName("Modnation"));
addChild((new (_local1) as DisplayObject));
removeChild(_clip);
_clip = null;
};
}
protected function onAddedToStage(_arg1:Event):void{
trace("PRELOADER ADDED ");
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
_af = new AssetFactory();
_af.addEventListener(AssetFactory.EVENT_ASSET_FACTORY_READY, _onAssetFactoryReady);
_af.initialize(swfBytes);
}
private function _onEnterFrame(_arg1:Event):void{
var _local2:int = stage.loaderInfo.bytesLoaded;
var _local3:int = (stage.loaderInfo.parameters.hasOwnProperty("swfTotalBytes")) ? Number(stage.loaderInfo.parameters.swfTotalBytes) : stage.loaderInfo.bytesTotal;
var _local4:int = Math.ceil(((100 * _local2) / _local3));
if (_clip.currentFrame != _local4){
_clip.gotoAndStop(_local4);
};
trace(_local4, _local2, _local3);
if (_local4 >= 100){
_preloadComplete();
};
}
private function _drawLetterbox():void{
var _local1:int = loaderInfo.width;
var _local2:int = loaderInfo.height;
var _local3:Sprite = new Sprite();
var _local4:Graphics = _local3.graphics;
_local4.beginFill(0);
_local4.drawRect(-1000, -1000, (2000 + _local1), 1000);
_local4.drawRect(-1000, _local2, (2000 + _local1), 1000);
_local4.drawRect(-1000, -1000, 1000, (1000 + _local2));
_local4.drawRect(_local1, -1000, 1000, (1000 + _local2));
_local4.endFill();
addChild(_local3);
}
private function _onAssetFactoryReady(_arg1:Event):void{
_af.removeEventListener(AssetFactory.EVENT_ASSET_FACTORY_READY, _onAssetFactoryReady);
_clip = (_af.createDisplayObject("PreLoaderAsset") as MovieClip);
addChildAt(_clip, 0);
_af = null;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
_drawLetterbox();
addEventListener(Event.ENTER_FRAME, _onEnterFrame);
}
}
}//package
Section 570
//PreLoader_swfBytes (PreLoader_swfBytes)
package {
import mx.core.*;
public class PreLoader_swfBytes extends ByteArrayAsset {
}
}//package