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(def:b2ShapeDef){
m_localPosition = new b2Vec2();
super(def);
var circleDef:b2CircleDef = (def as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(circleDef.localPosition);
m_radius = circleDef.radius;
}
override public function TestSegment(transform:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean{
var sY:Number;
var tMat:b2Mat22 = transform.R;
var positionX:Number = (transform.position.x + ((tMat.col1.x * m_localPosition.x) + (tMat.col2.x * m_localPosition.y)));
var positionY:Number = (transform.position.x + ((tMat.col1.y * m_localPosition.x) + (tMat.col2.y * m_localPosition.y)));
var sX:Number = (segment.p1.x - positionX);
sY = (segment.p1.y - positionY);
var b:Number = (((sX * sX) + (sY * sY)) - (m_radius * m_radius));
if (b < 0){
return (false);
};
var rX:Number = (segment.p2.x - segment.p1.x);
var rY:Number = (segment.p2.y - segment.p1.y);
var c:Number = ((sX * rX) + (sY * rY));
var rr:Number = ((rX * rX) + (rY * rY));
var sigma:Number = ((c * c) - (rr * b));
if ((((sigma < 0)) || ((rr < Number.MIN_VALUE)))){
return (false);
};
var a:Number = -((c + Math.sqrt(sigma)));
if ((((0 <= a)) && ((a <= (maxLambda * rr))))){
a = (a / rr);
lambda[0] = a;
normal.x = (sX + (a * rX));
normal.y = (sY + (a * rY));
normal.Normalize();
return (true);
};
return (false);
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
public function GetRadius():Number{
return (m_radius);
}
override public function ComputeSweptAABB(aabb:b2AABB, transform1:b2XForm, transform2:b2XForm):void{
var tMat:b2Mat22;
tMat = transform1.R;
var p1X:Number = (transform1.position.x + ((tMat.col1.x * m_localPosition.x) + (tMat.col2.x * m_localPosition.y)));
var p1Y:Number = (transform1.position.y + ((tMat.col1.y * m_localPosition.x) + (tMat.col2.y * m_localPosition.y)));
tMat = transform2.R;
var p2X:Number = (transform2.position.x + ((tMat.col1.x * m_localPosition.x) + (tMat.col2.x * m_localPosition.y)));
var p2Y:Number = (transform2.position.y + ((tMat.col1.y * m_localPosition.x) + (tMat.col2.y * m_localPosition.y)));
aabb.lowerBound.Set((((p1X < p2X)) ? p1X : p2X - m_radius), (((p1Y < p2Y)) ? p1Y : p2Y - m_radius));
aabb.upperBound.Set((((p1X > p2X)) ? p1X : p2X + m_radius), (((p1Y > p2Y)) ? p1Y : p2Y + m_radius));
}
override public function ComputeMass(massData:b2MassData):void{
massData.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
massData.center.SetV(m_localPosition);
massData.I = (massData.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function UpdateSweepRadius(center:b2Vec2):void{
var dX:Number = (m_localPosition.x - center.x);
var dY:Number = (m_localPosition.y - center.y);
dX = Math.sqrt(((dX * dX) + (dY * dY)));
m_sweepRadius = ((dX + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(aabb:b2AABB, transform:b2XForm):void{
var tMat:b2Mat22 = transform.R;
var pX:Number = (transform.position.x + ((tMat.col1.x * m_localPosition.x) + (tMat.col2.x * m_localPosition.y)));
var pY:Number = (transform.position.y + ((tMat.col1.y * m_localPosition.x) + (tMat.col2.y * m_localPosition.y)));
aabb.lowerBound.Set((pX - m_radius), (pY - m_radius));
aabb.upperBound.Set((pX + m_radius), (pY + m_radius));
}
override public function TestPoint(transform:b2XForm, p:b2Vec2):Boolean{
var tMat:b2Mat22 = transform.R;
var dX:Number = (transform.position.x + ((tMat.col1.x * m_localPosition.x) + (tMat.col2.x * m_localPosition.y)));
var dY:Number = (transform.position.y + ((tMat.col1.y * m_localPosition.x) + (tMat.col2.y * m_localPosition.y)));
dX = (p.x - dX);
dY = (p.y - dY);
return ((((dX * dX) + (dY * dY)) <= (m_radius * m_radius)));
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2ConcaveArcDef (Box2D.Collision.Shapes.b2ConcaveArcDef)
package Box2D.Collision.Shapes {
public class b2ConcaveArcDef extends b2PolygonDef {
public var radius:Number;
public function b2ConcaveArcDef(){
super();
type = b2Shape.e_concaveArcShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2ConcaveArcShape (Box2D.Collision.Shapes.b2ConcaveArcShape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ConcaveArcShape extends b2PolygonShape {
public var m_radius:Number;
public var m_radius2:Number;
public var m_arcCenter:b2Vec2;
public var m_dot:Number;
public var m_norm:Number;
public function b2ConcaveArcShape(def:b2ShapeDef){
var nx:Number;
var ny:Number;
super(def);
var arcDef:b2ConcaveArcDef = (def as b2ConcaveArcDef);
m_radius = arcDef.radius;
m_radius2 = (m_radius * m_radius);
var p1:b2Vec2 = m_vertices[0];
var p2:b2Vec2 = m_vertices[1];
var dx:Number = (p1.x - p2.x);
var dy:Number = (p1.y - p2.y);
var d2:Number = ((dx * dx) + (dy * dy));
var d:Number = Math.sqrt(d2);
if ((d2 / 4) > m_radius2){
m_radius2 = (d2 / 4);
m_radius = (d / 2);
};
var dot:Number = Math.sqrt((m_radius2 - (d2 * 0.25)));
m_arcCenter = new b2Vec2((((p1.x + p2.x) / 2) + (dot * m_normals[0].x)), (((p1.y + p2.y) / 2) + (dot * m_normals[0].y)));
m_dot = (dot / m_radius);
m_norm = ((d / 2) / m_radius);
var coreRadius2:Number = ((m_radius + b2Settings.b2_toiSlop) * (m_radius + b2Settings.b2_toiSlop));
nx = m_normals[(m_vertexCount - 1)].x;
ny = m_normals[(m_vertexCount - 1)].y;
dx = (m_coreVertices[0].x - m_arcCenter.x);
dy = (m_coreVertices[0].y - m_arcCenter.y);
d = ((dx * nx) + (dy * ny));
d2 = Math.sqrt((coreRadius2 - (d * d)));
m_coreVertices[0].x = ((m_arcCenter.x + (d * nx)) + (d2 * ny));
m_coreVertices[0].y = ((m_arcCenter.y + (d * ny)) - (d2 * nx));
nx = m_normals[1].x;
ny = m_normals[1].y;
dx = (m_coreVertices[1].x - m_arcCenter.x);
dy = (m_coreVertices[1].y - m_arcCenter.y);
d = ((dx * nx) + (dy * ny));
d2 = Math.sqrt((coreRadius2 - (d * d)));
m_coreVertices[1].x = ((m_arcCenter.x + (d * nx)) - (d2 * ny));
m_coreVertices[1].y = ((m_arcCenter.y + (d * ny)) + (d2 * nx));
m_type = b2Shape.e_concaveArcShape;
}
override public function TestSegment(xf:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean{
b2Settings.b2Assert(false);
return (false);
}
override public function ComputeMass(massData:b2MassData):void{
super.ComputeMass(massData);
}
override public function TestPoint(xf:b2XForm, p:b2Vec2):Boolean{
var tVec:b2Vec2;
var dot:Number;
var tMat:b2Mat22 = xf.R;
var tX:Number = (p.x - xf.position.x);
var tY:Number = (p.y - xf.position.y);
var pLocalX:Number = ((tX * tMat.col1.x) + (tY * tMat.col1.y));
var pLocalY:Number = ((tX * tMat.col2.x) + (tY * tMat.col2.y));
var i:int;
while (i < m_vertexCount) {
tVec = m_vertices[i];
tX = (pLocalX - tVec.x);
tY = (pLocalY - tVec.y);
dot = ((tVec.x * tX) + (tVec.y * tY));
if (dot > 0){
return (false);
};
i++;
};
tX = (pLocalX - m_arcCenter.x);
tY = (pLocalY - m_arcCenter.y);
return ((((tX * tX) + (tY * tY)) > m_radius2));
}
public static function TriangleMass(massData:b2MassData, p1:b2Vec2, p2:b2Vec2, p3:b2Vec2, density:Number):void{
var k_inv3:Number;
var e1X:Number;
var e1Y:Number;
var e2X:Number;
var e2Y:Number;
var D:Number;
k_inv3 = (1 / 3);
e1X = (p2.x - p1.x);
e1Y = (p2.y - p1.y);
e2X = (p3.x - p1.x);
e2Y = (p3.y - p1.y);
D = ((e1X * e2Y) - (e1Y * e2X));
var triangleArea:Number = (0.5 * D);
massData.mass = (triangleArea * density);
massData.center.x = (k_inv3 * ((p1.x + p2.x) + p3.x));
massData.center.y = (k_inv3 * ((p1.y + p2.y) + p3.y));
var px:Number = p1.x;
var py:Number = p1.y;
var ex1:Number = e1X;
var ey1:Number = e1Y;
var ex2:Number = e2X;
var ey2:Number = e2Y;
var intx2:Number = ((k_inv3 * ((0.25 * (((ex1 * ex1) + (ex2 * ex1)) + (ex2 * ex2))) + ((px * ex1) + (px * ex2)))) + ((0.5 * px) * px));
var inty2:Number = ((k_inv3 * ((0.25 * (((ey1 * ey1) + (ey2 * ey1)) + (ey2 * ey2))) + ((py * ey1) + (py * ey2)))) + ((0.5 * py) * py));
massData.I = ((D * (intx2 + inty2)) * density);
}
public static function SegmentMass(massData:b2MassData, arcCenter:b2Vec2, radius:Number, norm:b2Vec2, d:Number, density:Number):void{
var theta:Number;
theta = (Math.asin(((d / radius) / 2)) * 2);
massData.mass = ((((0.5 * radius) * radius) * theta) * density);
var v:Number = (((2 / 3) * d) / theta);
if (theta < Number.MIN_VALUE){
v = ((2 / 3) * radius);
};
massData.center = new b2Vec2((arcCenter.x - (norm.x * v)), (arcCenter.y - (norm.y * v)));
massData.I = ((((0.5 * massData.mass) * radius) * radius) - ((massData.mass * v) * v));
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2ConvexArcShape (Box2D.Collision.Shapes.b2ConvexArcShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ConvexArcShape extends b2Shape {
public var m_localPosition:b2Vec2;
public var m_offset:Number;
public var m_norm:b2Vec2;
public var m_dot:Number;
public var m_vertices:Array;
public var m_d:Number;
public var m_radius:Number;
public var m_obb:b2OBB;
public function b2ConvexArcShape(def:b2ShapeDef){
m_localPosition = new b2Vec2();
m_obb = new b2OBB();
m_vertices = [new b2Vec2(), new b2Vec2()];
m_norm = new b2Vec2();
super(def);
}
override public function TestSegment(xf:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean{
b2Settings.b2Assert(false);
return (false);
}
override public function ComputeMass(massData:b2MassData):void{
}
override public function ComputeSweptAABB(aabb:b2AABB, transform1:b2XForm, transform2:b2XForm):void{
super.ComputeSweptAABB(aabb, transform1, transform2);
}
public function Support(xf:b2XForm, dX:Number, dY:Number):b2Vec2{
b2Settings.b2Assert(false);
return (null);
}
override public function UpdateSweepRadius(center:b2Vec2):void{
}
override public function ComputeAABB(aabb:b2AABB, xf:b2XForm):void{
super.ComputeAABB(aabb, xf);
}
public function GetOBB():b2OBB{
return (m_obb);
}
override public function TestPoint(xf:b2XForm, p:b2Vec2):Boolean{
b2Settings.b2Assert(false);
return (false);
}
}
}//package Box2D.Collision.Shapes
Section 6
//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 b2FilterData(){
super();
}
public function Copy():b2FilterData{
var copy:b2FilterData = new b2FilterData();
copy.categoryBits = categoryBits;
copy.maskBits = maskBits;
copy.groupIndex = groupIndex;
return (copy);
}
}
}//package Box2D.Collision.Shapes
Section 7
//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();
}
public function Set(massData:b2MassData):void{
mass = massData.mass;
center.x = massData.center.x;
center.y = massData.center.y;
I = massData.I;
}
public static function Add(... _args):b2MassData{
var massData:b2MassData;
var r:b2Vec2;
var finalMass:b2MassData = new (b2MassData);
for each (massData in _args) {
finalMass.mass = (finalMass.mass + massData.mass);
};
if (Math.abs(finalMass.mass) > Number.MIN_VALUE){
for each (massData in _args) {
finalMass.center.x = (finalMass.center.x + (massData.mass * massData.center.x));
finalMass.center.y = (finalMass.center.y + (massData.mass * massData.center.y));
};
finalMass.center.x = (finalMass.center.x / finalMass.mass);
finalMass.center.y = (finalMass.center.y / finalMass.mass);
for each (massData in _args) {
finalMass.I = (finalMass.I + massData.I);
r = b2Math.SubtractVV(massData.center, finalMass.center);
finalMass.I = (finalMass.I + (massData.mass * b2Math.b2Dot(r, r)));
};
};
return (finalMass);
}
}
}//package Box2D.Collision.Shapes
Section 8
//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 i:int;
while (i < b2Settings.b2_maxPolygonVertices) {
vertices[i] = new b2Vec2();
i++;
};
}
public function SetAsOrientedBox(hx:Number, hy:Number, center:b2Vec2=null, angle:Number=0):void{
var xfPosition:b2Vec2;
var xfR:b2Mat22;
var i:int;
vertexCount = 4;
vertices[0].Set(-(hx), -(hy));
vertices[1].Set(hx, -(hy));
vertices[2].Set(hx, hy);
vertices[3].Set(-(hx), hy);
if (center){
xfPosition = center;
xfR = s_mat;
xfR.Set(angle);
i = 0;
while (i < vertexCount) {
center = vertices[i];
hx = (xfPosition.x + ((xfR.col1.x * center.x) + (xfR.col2.x * center.y)));
center.y = (xfPosition.y + ((xfR.col1.y * center.x) + (xfR.col2.y * center.y)));
center.x = hx;
i++;
};
};
}
public function SetAsBox(hx:Number, hy:Number):void{
vertexCount = 4;
vertices[0].Set(-(hx), -(hy));
vertices[1].Set(hx, -(hy));
vertices[2].Set(hx, hy);
vertices[3].Set(-(hx), hy);
}
}
}//package Box2D.Collision.Shapes
Section 9
//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(def:b2ShapeDef){
var i:int;
var edgeX:Number;
var edgeY:Number;
var len:Number;
var n1X:Number;
var n1Y:Number;
var n2X:Number;
var n2Y:Number;
var vX:Number;
var vY:Number;
var dX:Number;
var dY:Number;
var det: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(def);
m_type = e_polygonShape;
var poly:b2PolygonDef = (def as b2PolygonDef);
m_vertexCount = poly.vertexCount;
var i1:int = i;
var i2:int = i;
i = 0;
while (i < m_vertexCount) {
m_vertices[i] = poly.vertices[i].Copy();
i++;
};
i = 0;
while (i < m_vertexCount) {
i1 = i;
i2 = (((i + 1) < m_vertexCount)) ? (i + 1) : 0;
edgeX = (m_vertices[i2].x - m_vertices[i1].x);
edgeY = (m_vertices[i2].y - m_vertices[i1].y);
len = Math.sqrt(((edgeX * edgeX) + (edgeY * edgeY)));
m_normals[i] = new b2Vec2((edgeY / len), (-(edgeX) / len));
i++;
};
m_centroid = ComputeCentroid(poly.vertices, poly.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
i = 0;
while (i < m_vertexCount) {
i1 = (((i - 1) >= 0)) ? (i - 1) : (m_vertexCount - 1);
i2 = i;
n1X = m_normals[i1].x;
n1Y = m_normals[i1].y;
n2X = m_normals[i2].x;
n2Y = m_normals[i2].y;
vX = (m_vertices[i].x - m_centroid.x);
vY = (m_vertices[i].y - m_centroid.y);
dX = (((n1X * vX) + (n1Y * vY)) - b2Settings.b2_toiSlop);
dY = (((n2X * vX) + (n2Y * vY)) - b2Settings.b2_toiSlop);
det = (1 / ((n1X * n2Y) - (n1Y * n2X)));
m_coreVertices[i] = new b2Vec2(((det * ((n2Y * dX) - (n1Y * dY))) + m_centroid.x), ((det * ((n1X * dY) - (n2X * dX))) + m_centroid.y));
i++;
};
}
override public function ComputeSweptAABB(aabb:b2AABB, transform1:b2XForm, transform2:b2XForm):void{
var aabb1:b2AABB = s_sweptAABB1;
var aabb2:b2AABB = s_sweptAABB2;
ComputeAABB(aabb1, transform1);
ComputeAABB(aabb2, transform2);
aabb.lowerBound.Set(((aabb1.lowerBound.x < aabb2.lowerBound.x)) ? aabb1.lowerBound.x : aabb2.lowerBound.x, ((aabb1.lowerBound.y < aabb2.lowerBound.y)) ? aabb1.lowerBound.y : aabb2.lowerBound.y);
aabb.upperBound.Set(((aabb1.upperBound.x > aabb2.upperBound.x)) ? aabb1.upperBound.x : aabb2.upperBound.x, ((aabb1.upperBound.y > aabb2.upperBound.y)) ? aabb1.upperBound.y : aabb2.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(xf:b2XForm):b2Vec2{
return (b2Math.b2MulX(xf, m_coreVertices[0]));
}
public function Centroid(xf:b2XForm):b2Vec2{
return (b2Math.b2MulX(xf, m_centroid));
}
override public function TestSegment(xf:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean{
var tX:Number;
var tY:Number;
var tMat:b2Mat22;
var tVec:b2Vec2;
var numerator:Number;
var denominator:Number;
var lower:Number = 0;
var upper:Number = maxLambda;
tX = (segment.p1.x - xf.position.x);
tY = (segment.p1.y - xf.position.y);
tMat = xf.R;
var p1X:Number = ((tX * tMat.col1.x) + (tY * tMat.col1.y));
var p1Y:Number = ((tX * tMat.col2.x) + (tY * tMat.col2.y));
tX = (segment.p2.x - xf.position.x);
tY = (segment.p2.y - xf.position.y);
tMat = xf.R;
var p2X:Number = ((tX * tMat.col1.x) + (tY * tMat.col1.y));
var p2Y:Number = ((tX * tMat.col2.x) + (tY * tMat.col2.y));
var dX:Number = (p2X - p1X);
var dY:Number = (p2Y - p1Y);
var index = -1;
var i:int;
while (i < m_vertexCount) {
tVec = m_vertices[i];
tX = (tVec.x - p1X);
tY = (tVec.y - p1Y);
tVec = m_normals[i];
numerator = ((tVec.x * tX) + (tVec.y * tY));
denominator = ((tVec.x * dX) + (tVec.y * dY));
if ((((denominator < 0)) && ((numerator < (lower * denominator))))){
lower = (numerator / denominator);
index = i;
} else {
if ((((denominator > 0)) && ((numerator < (upper * denominator))))){
upper = (numerator / denominator);
};
};
if (upper < lower){
return (false);
};
i++;
};
if (index >= 0){
lambda[0] = lower;
tMat = xf.R;
tVec = m_normals[index];
normal.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
normal.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
return (true);
};
return (false);
}
override public function ComputeMass(massData:b2MassData):void{
var p2:b2Vec2;
var p3:b2Vec2;
var e1X:Number;
var e1Y:Number;
var e2X:Number;
var e2Y:Number;
var D:Number;
var triangleArea:Number;
var px:Number;
var py:Number;
var ex1:Number;
var ey1:Number;
var ex2:Number;
var ey2:Number;
var intx2:Number;
var inty2:Number;
var centerX:Number = 0;
var centerY:Number = 0;
var area:Number = 0;
var I:Number = 0;
var p1X:Number = 0;
var p1Y:Number = 0;
var k_inv3:Number = (1 / 3);
var i:int;
while (i < m_vertexCount) {
p2 = m_vertices[i];
p3 = (((i + 1) < m_vertexCount)) ? m_vertices[int((i + 1))] : m_vertices[0];
e1X = (p2.x - p1X);
e1Y = (p2.y - p1Y);
e2X = (p3.x - p1X);
e2Y = (p3.y - p1Y);
D = ((e1X * e2Y) - (e1Y * e2X));
triangleArea = (0.5 * D);
area = (area + triangleArea);
centerX = (centerX + ((triangleArea * k_inv3) * ((p1X + p2.x) + p3.x)));
centerY = (centerY + ((triangleArea * k_inv3) * ((p1Y + p2.y) + p3.y)));
px = p1X;
py = p1Y;
ex1 = e1X;
ey1 = e1Y;
ex2 = e2X;
ey2 = e2Y;
intx2 = ((k_inv3 * ((0.25 * (((ex1 * ex1) + (ex2 * ex1)) + (ex2 * ex2))) + ((px * ex1) + (px * ex2)))) + ((0.5 * px) * px));
inty2 = ((k_inv3 * ((0.25 * (((ey1 * ey1) + (ey2 * ey1)) + (ey2 * ey2))) + ((py * ey1) + (py * ey2)))) + ((0.5 * py) * py));
I = (I + (D * (intx2 + inty2)));
i++;
};
massData.mass = (m_density * area);
centerX = (centerX * (1 / area));
centerY = (centerY * (1 / area));
massData.center.Set(centerX, centerY);
massData.I = (m_density * I);
}
public function GetNormals():Array{
return (m_normals);
}
public function Support(xf:b2XForm, dX:Number, dY:Number):b2Vec2{
var tVec:b2Vec2;
var tMat:b2Mat22;
var value:Number;
tMat = xf.R;
var dLocalX:Number = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
var dLocalY:Number = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
var bestIndex:int;
tVec = m_coreVertices[0];
var bestValue:Number = ((tVec.x * dLocalX) + (tVec.y * dLocalY));
var i = 1;
while (i < m_vertexCount) {
tVec = m_coreVertices[i];
value = ((tVec.x * dLocalX) + (tVec.y * dLocalY));
if (value > bestValue){
bestIndex = i;
bestValue = value;
};
i++;
};
tMat = xf.R;
tVec = m_coreVertices[bestIndex];
s_supportVec.x = (xf.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
s_supportVec.y = (xf.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeAABB(aabb:b2AABB, xf:b2XForm):void{
var tMat:b2Mat22;
var tVec:b2Vec2;
var R:b2Mat22 = s_computeMat;
tMat = xf.R;
tVec = m_obb.R.col1;
R.col1.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
R.col1.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
tVec = m_obb.R.col2;
R.col2.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
R.col2.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
R.Abs();
var absR:b2Mat22 = R;
tVec = m_obb.extents;
var hX:Number = ((absR.col1.x * tVec.x) + (absR.col2.x * tVec.y));
var hY:Number = ((absR.col1.y * tVec.x) + (absR.col2.y * tVec.y));
tMat = xf.R;
tVec = m_obb.center;
var positionX:Number = (xf.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var positionY:Number = (xf.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
aabb.lowerBound.Set((positionX - hX), (positionY - hY));
aabb.upperBound.Set((positionX + hX), (positionY + hY));
}
override public function UpdateSweepRadius(center:b2Vec2):void{
var tVec:b2Vec2;
var dX:Number;
var dY:Number;
m_sweepRadius = 0;
var i:int;
while (i < m_vertexCount) {
tVec = m_coreVertices[i];
dX = (tVec.x - center.x);
dY = (tVec.y - center.y);
dX = Math.sqrt(((dX * dX) + (dY * dY)));
if (dX > m_sweepRadius){
m_sweepRadius = dX;
};
i++;
};
}
override public function TestPoint(xf:b2XForm, p:b2Vec2):Boolean{
var tVec:b2Vec2;
var dot:Number;
var tMat:b2Mat22 = xf.R;
var tX:Number = (p.x - xf.position.x);
var tY:Number = (p.y - xf.position.y);
var pLocalX:Number = ((tX * tMat.col1.x) + (tY * tMat.col1.y));
var pLocalY:Number = ((tX * tMat.col2.x) + (tY * tMat.col2.y));
var i:int;
while (i < m_vertexCount) {
tVec = m_vertices[i];
tX = (pLocalX - tVec.x);
tY = (pLocalY - tVec.y);
tVec = m_normals[i];
dot = ((tVec.x * tX) + (tVec.y * tY));
if (dot > 0){
return (false);
};
i++;
};
return (true);
}
public static function ComputeCentroid(vs:Array, count:int):b2Vec2{
var c:b2Vec2;
var inv3:Number;
var p2:b2Vec2;
var p3:b2Vec2;
var e1X:Number;
var e1Y:Number;
var e2X:Number;
var e2Y:Number;
var D:Number;
var triangleArea:Number;
c = new b2Vec2();
var area:Number = 0;
var p1X:Number = 0;
var p1Y:Number = 0;
inv3 = (1 / 3);
var i:int;
while (i < count) {
p2 = vs[i];
p3 = (((i + 1) < count)) ? vs[int((i + 1))] : vs[0];
e1X = (p2.x - p1X);
e1Y = (p2.y - p1Y);
e2X = (p3.x - p1X);
e2Y = (p3.y - p1Y);
D = ((e1X * e2Y) - (e1Y * e2X));
triangleArea = (0.5 * D);
area = (area + triangleArea);
c.x = (c.x + ((triangleArea * inv3) * ((p1X + p2.x) + p3.x)));
c.y = (c.y + ((triangleArea * inv3) * ((p1Y + p2.y) + p3.y)));
i++;
};
c.x = (c.x * (1 / area));
c.y = (c.y * (1 / area));
return (c);
}
public static function ComputeOBB(obb:b2OBB, vs:Array, count:int):void{
var i:int;
var root:b2Vec2;
var uxX:Number;
var uxY:Number;
var length:Number;
var uyX:Number;
var uyY:Number;
var lowerX:Number;
var lowerY:Number;
var upperX:Number;
var upperY:Number;
var j:int;
var area:Number;
var dX:Number;
var dY:Number;
var rX:Number;
var rY:Number;
var centerX:Number;
var centerY:Number;
var tMat:b2Mat22;
var p:Array = new Array((b2Settings.b2_maxPolygonVertices + 1));
i = 0;
while (i < count) {
p[i] = vs[i];
i++;
};
p[count] = p[0];
var minArea:Number = Number.MAX_VALUE;
i = 1;
while (i <= count) {
root = p[int((i - 1))];
uxX = (p[i].x - root.x);
uxY = (p[i].y - root.y);
length = Math.sqrt(((uxX * uxX) + (uxY * uxY)));
uxX = (uxX / length);
uxY = (uxY / length);
uyX = -(uxY);
uyY = uxX;
lowerX = Number.MAX_VALUE;
lowerY = Number.MAX_VALUE;
upperX = -(Number.MAX_VALUE);
upperY = -(Number.MAX_VALUE);
j = 0;
while (j < count) {
dX = (p[j].x - root.x);
dY = (p[j].y - root.y);
rX = ((uxX * dX) + (uxY * dY));
rY = ((uyX * dX) + (uyY * dY));
if (rX < lowerX){
lowerX = rX;
};
if (rY < lowerY){
lowerY = rY;
};
if (rX > upperX){
upperX = rX;
};
if (rY > upperY){
upperY = rY;
};
j++;
};
area = ((upperX - lowerX) * (upperY - lowerY));
if (area < (0.95 * minArea)){
minArea = area;
obb.R.col1.x = uxX;
obb.R.col1.y = uxY;
obb.R.col2.x = uyX;
obb.R.col2.y = uyY;
centerX = (0.5 * (lowerX + upperX));
centerY = (0.5 * (lowerY + upperY));
tMat = obb.R;
obb.center.x = (root.x + ((tMat.col1.x * centerX) + (tMat.col2.x * centerY)));
obb.center.y = (root.y + ((tMat.col1.y * centerX) + (tMat.col2.y * centerY)));
obb.extents.x = (0.5 * (upperX - lowerX));
obb.extents.y = (0.5 * (upperY - lowerY));
};
i++;
};
}
}
}//package Box2D.Collision.Shapes
Section 10
//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_concaveArcShape:int = 5;
public static const e_convexArcShape:int = 4;
public static const e_unknownShape:int = -1;
public static const e_meshShape:int = 3;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 7;
public static const e_staticEdgeShape:int = 6;
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(def:b2ShapeDef){
super();
m_userData = def.userData;
m_friction = def.friction;
m_restitution = def.restitution;
m_density = def.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = def.filter.Copy();
m_isSensor = def.isSensor;
}
public function SetUserData(data):void{
m_userData = data;
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(aabb:b2AABB, xf1:b2XForm, xf2: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(xf:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean{
return (false);
}
public function RefilterProxy(broadPhase:b2BroadPhase, transform:b2XForm):void{
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
broadPhase.DestroyProxy(m_proxyId);
var aabb:b2AABB = s_resetAABB;
ComputeAABB(aabb, transform);
var inRange:Boolean = broadPhase.InRange(aabb);
if (inRange){
m_proxyId = broadPhase.CreateProxy(aabb, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(filter:b2FilterData):void{
m_filter = filter.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(broadPhase:b2BroadPhase, transform1:b2XForm, transform2:b2XForm):Boolean{
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
var aabb:b2AABB = s_syncAABB;
ComputeSweptAABB(aabb, transform1, transform2);
if (broadPhase.InRange(aabb)){
broadPhase.MoveProxy(m_proxyId, aabb);
return (true);
};
return (false);
}
public function ComputeMass(massData:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(broadPhase:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
broadPhase.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(center:b2Vec2):void{
}
public function ComputeAABB(aabb:b2AABB, xf:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(broadPhase:b2BroadPhase, transform:b2XForm):void{
var aabb:b2AABB = s_proxyAABB;
ComputeAABB(aabb, transform);
var inRange:Boolean = broadPhase.InRange(aabb);
if (inRange){
m_proxyId = broadPhase.CreateProxy(aabb, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function TestPoint(xf:b2XForm, p:b2Vec2):Boolean{
return (false);
}
public static function Destroy(shape:b2Shape, allocator):void{
}
public static function Create(def:b2ShapeDef, allocator):b2Shape{
switch (def.type){
case e_circleShape:
return (new b2CircleShape(def));
case e_polygonShape:
return (new b2PolygonShape(def));
case e_convexArcShape:
return (new b2ConvexArcShape(def));
case e_concaveArcShape:
return (new b2ConcaveArcShape(def));
default:
throw (new Error("Shape type not found or cannot be added to Dynamic Bodies."));
};
}
}
}//package Box2D.Collision.Shapes
Section 11
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var friction:Number;// = 0.2
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var type:int;
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 12
//b2StaticEdgeChain (Box2D.Collision.Shapes.b2StaticEdgeChain)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2StaticEdgeChain {
public var isFloating:Boolean;
public var isALoop:Boolean;
public var edges:Array;
public function b2StaticEdgeChain(def:b2ShapeDef, world:b2World){
var i:int;
var v1:b2Vec2;
var v2:b2Vec2;
var s2:b2StaticEdgeShape;
var angle:Number;
var angle2:Number;
var s:b2StaticEdgeShape;
var core:b2Vec2;
var cornerDir:b2Vec2;
edges = new Array();
super();
var edgeDef:b2StaticEdgeChainDef = (def as b2StaticEdgeChainDef);
isALoop = edgeDef.isALoop;
isFloating = edgeDef.isFloating;
if (edgeDef.isALoop){
i = 0;
v1 = edgeDef.vertices[(edgeDef.vertexCount - 1)];
} else {
i = 1;
v1 = edgeDef.vertices[0];
};
v1 = v1.Copy();
while (i < edgeDef.vertexCount) {
v2 = edgeDef.vertices[i];
v2 = v2.Copy();
s = new b2StaticEdgeShape(v1, v2, edgeDef);
edges.push(s);
s.m_chain = this;
s.m_next = world.m_groundBody.m_shapeList;
world.m_groundBody.m_shapeList = s;
world.m_groundBody.m_shapeCount++;
s.m_body = world.m_groundBody;
s.CreateProxy(world.m_broadPhase, world.m_groundBody.m_xf);
s.UpdateSweepRadius(world.m_groundBody.m_sweep.localCenter);
v1 = v2;
i++;
};
if (edgeDef.isALoop){
s = edges[(edgeDef.vertexCount - 1)];
i = 0;
} else {
s = edges[0];
i = 1;
};
angle = Math.atan2(s.m_direction.y, s.m_direction.x);
while (i < edges.length) {
s2 = edges[i];
angle2 = Math.atan2(s2.m_direction.y, s2.m_direction.x);
core = s2.m_direction.Copy();
core.Multiply(Math.tan(((angle2 - angle) * 0.5)));
core.Subtract(s2.m_normal);
core.Multiply(b2Settings.b2_toiSlop);
core.Add(s2.m_v1);
cornerDir = s.m_direction.Copy();
cornerDir.Add(s2.m_direction);
cornerDir.Normalize();
s.SetNextEdge(s2, core, cornerDir);
s2.SetPrevEdge(s, core, cornerDir);
s = s2;
angle = angle2;
i++;
};
}
}
}//package Box2D.Collision.Shapes
Section 13
//b2StaticEdgeChainDef (Box2D.Collision.Shapes.b2StaticEdgeChainDef)
package Box2D.Collision.Shapes {
public class b2StaticEdgeChainDef extends b2ShapeDef {
public var isFloating:Boolean;
public var vertices:Array;
public var vertexCount:int;
public var isALoop:Boolean;
public function b2StaticEdgeChainDef(){
vertices = new Array();
super();
type = b2Shape.e_staticEdgeShape;
isALoop = true;
isFloating = false;
vertexCount = 0;
}
}
}//package Box2D.Collision.Shapes
Section 14
//b2StaticEdgeShape (Box2D.Collision.Shapes.b2StaticEdgeShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2StaticEdgeShape extends b2Shape {
public var m_cornerDir1:b2Vec2;
public var m_v1:b2Vec2;
public var isFloating:Boolean;
public var m_coreV1:b2Vec2;
public var m_coreV2:b2Vec2;
public var m_v2:b2Vec2;
public var m_cornerDir2:b2Vec2;
public var m_nextEdge:b2StaticEdgeShape;
public var m_direction:b2Vec2;
public var m_prevEdge:b2StaticEdgeShape;
public var m_chain:b2StaticEdgeChain;
public var m_length:Number;
public var m_normal:b2Vec2;
public function b2StaticEdgeShape(v1:b2Vec2, v2:b2Vec2, edgeDef:b2StaticEdgeChainDef){
super(edgeDef);
isFloating = edgeDef.isFloating;
m_type = e_staticEdgeShape;
m_v1 = v1;
m_v2 = v2;
m_direction = m_v2.Copy();
m_direction.Subtract(m_v1);
m_length = m_direction.Normalize();
m_normal = new b2Vec2(m_direction.y, -(m_direction.x));
m_coreV1 = m_normal.Copy();
m_coreV1.Subtract(m_direction);
m_coreV1.Multiply(-(b2Settings.b2_toiSlop));
m_coreV1.Add(m_v1);
m_coreV2 = m_normal.Copy();
m_coreV2.Add(m_direction);
m_coreV2.Multiply(-(b2Settings.b2_toiSlop));
m_coreV2.Add(m_v2);
if (isFloating){
m_cornerDir1 = (m_cornerDir2 = m_direction);
} else {
m_cornerDir1 = m_normal;
m_cornerDir2 = m_normal.Copy();
m_cornerDir2.Multiply(-1);
};
}
public function SetNextEdge(edge:b2StaticEdgeShape, core:b2Vec2, cornerDir:b2Vec2):void{
m_nextEdge = edge;
m_coreV2 = core;
m_cornerDir2 = cornerDir;
}
public function GetDirectionVector():b2Vec2{
return (m_direction);
}
override public function ComputeSweptAABB(aabb:b2AABB, transform1:b2XForm, transform2:b2XForm):void{
return (ComputeAABB(aabb, transform1));
}
public function GetFirstVertex(xf:b2XForm):b2Vec2{
return (m_coreV1);
}
public function GetNormalVector():b2Vec2{
return (m_normal);
}
override public function TestSegment(transform:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean{
return (false);
}
public function GetParentChain():b2StaticEdgeChain{
return (m_chain);
}
public function Support(xf:b2XForm, dX:Number, dY:Number):b2Vec2{
return (((((m_coreV1.x * dX) + (m_coreV1.y * dY)) > ((m_coreV2.x * dX) + (m_coreV2.y * dY)))) ? m_coreV1 : m_coreV2);
}
public function SetPrevEdge(edge:b2StaticEdgeShape, core:b2Vec2, cornerDir:b2Vec2):void{
m_prevEdge = edge;
m_coreV1 = core;
m_cornerDir1 = cornerDir;
}
override public function UpdateSweepRadius(center:b2Vec2):void{
var dX:Number = (m_v1.x - center.x);
var dY:Number = (m_v1.y - center.y);
var d1:Number = ((dX * dX) + (dY * dY));
dX = (m_v2.x - center.x);
dY = (m_v2.y - center.y);
var d2:Number = ((dX * dX) + (dY * dY));
dX = Math.sqrt(((d1 > d2)) ? d1 : d2);
m_sweepRadius = dX;
}
public function GetVertex1():b2Vec2{
return (m_v1);
}
override public function ComputeAABB(aabb:b2AABB, transform:b2XForm):void{
if (m_v1.x < m_v2.x){
aabb.lowerBound.x = m_v1.x;
aabb.upperBound.x = m_v2.x;
} else {
aabb.lowerBound.x = m_v2.x;
aabb.upperBound.x = m_v1.x;
};
if (m_v1.y < m_v2.y){
aabb.lowerBound.y = m_v1.y;
aabb.upperBound.y = m_v2.y;
} else {
aabb.lowerBound.y = m_v2.y;
aabb.upperBound.y = m_v1.y;
};
}
public function GetVertex2():b2Vec2{
return (m_v2);
}
}
}//package Box2D.Collision.Shapes
Section 15
//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 dX:Number = (upperBound.x - lowerBound.x);
var dY:Number = (upperBound.y - lowerBound.y);
var valid:Boolean = (((dX >= 0)) && ((dY >= 0)));
valid = ((((valid) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (valid);
}
}
}//package Box2D.Collision
Section 16
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var value:uint;
public var proxyId:uint;
public var stabbingCount:uint;
public function b2Bound(){
super();
}
public function Swap(b:b2Bound):void{
var tempValue:uint = value;
var tempProxyId:uint = proxyId;
var tempStabbingCount:uint = stabbingCount;
value = b.value;
proxyId = b.proxyId;
stabbingCount = b.stabbingCount;
b.value = tempValue;
b.proxyId = tempProxyId;
b.stabbingCount = tempStabbingCount;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 17
//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 18
//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(worldAABB:b2AABB, callback:b2PairCallback){
var i:int;
var dY:Number;
var tProxy:b2Proxy;
var j: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, callback);
m_worldAABB = worldAABB;
m_proxyCount = 0;
i = 0;
while (i < b2Settings.b2_maxProxies) {
m_queryResults[i] = 0;
i++;
};
m_bounds = new Array(2);
i = 0;
while (i < 2) {
m_bounds[i] = new Array((2 * b2Settings.b2_maxProxies));
j = 0;
while (j < (2 * b2Settings.b2_maxProxies)) {
m_bounds[i][j] = new b2Bound();
j++;
};
i++;
};
var dX:Number = (worldAABB.upperBound.x - worldAABB.lowerBound.x);
dY = (worldAABB.upperBound.y - worldAABB.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / dX);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / dY);
i = 0;
while (i < (b2Settings.b2_maxProxies - 1)) {
tProxy = new b2Proxy();
m_proxyPool[i] = tProxy;
tProxy.SetNext((i + 1));
tProxy.timeStamp = 0;
tProxy.overlapCount = b2_invalid;
tProxy.userData = null;
i++;
};
tProxy = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = tProxy;
tProxy.SetNext(b2Pair.b2_nullProxy);
tProxy.timeStamp = 0;
tProxy.overlapCount = b2_invalid;
tProxy.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(aabb:b2AABB, userData, maxCount:int):int{
var lowerIndex:uint;
var upperIndex:uint;
var proxy:b2Proxy;
var lowerValues:Array = new Array();
var upperValues:Array = new Array();
ComputeBounds(lowerValues, upperValues, aabb);
var lowerIndexOut:Array = [lowerIndex];
var upperIndexOut:Array = [upperIndex];
Query(lowerIndexOut, upperIndexOut, lowerValues[0], upperValues[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(lowerIndexOut, upperIndexOut, lowerValues[1], upperValues[1], m_bounds[1], (2 * m_proxyCount), 1);
var count:int;
var i:int;
while ((((i < m_queryResultCount)) && ((count < maxCount)))) {
proxy = m_proxyPool[m_queryResults[i]];
userData[i] = proxy.userData;
i++;
count++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (count);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(proxyId:int):b2Proxy{
var proxy:b2Proxy = m_proxyPool[proxyId];
if ((((proxyId == b2Pair.b2_nullProxy)) || ((proxy.IsValid() == false)))){
return (null);
};
return (proxy);
}
private function IncrementTimeStamp():void{
var i:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
i = 0;
while (i < b2Settings.b2_maxProxies) {
(m_proxyPool[i] as b2Proxy).timeStamp = 0;
i++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(lowerQueryOut:Array, upperQueryOut:Array, lowerValue:uint, upperValue:uint, bounds:Array, boundCount:uint, axis:int):void{
var bound:b2Bound;
var i:int;
var s:int;
var proxy:b2Proxy;
var lowerQuery:uint = BinarySearch(bounds, boundCount, lowerValue);
var upperQuery:uint = BinarySearch(bounds, boundCount, upperValue);
var j:uint = lowerQuery;
while (j < upperQuery) {
bound = bounds[j];
if (bound.IsLower()){
IncrementOverlapCount(bound.proxyId);
};
j++;
};
if (lowerQuery > 0){
i = (lowerQuery - 1);
bound = bounds[i];
s = bound.stabbingCount;
while (s) {
bound = bounds[i];
if (bound.IsLower()){
proxy = m_proxyPool[bound.proxyId];
if (lowerQuery <= proxy.upperBounds[axis]){
IncrementOverlapCount(bound.proxyId);
s--;
};
};
i--;
};
};
lowerQueryOut[0] = lowerQuery;
upperQueryOut[0] = upperQuery;
}
private function TestOverlapValidate(p1:b2Proxy, p2:b2Proxy):Boolean{
var bounds:Array;
var bound1:b2Bound;
var bound2:b2Bound;
var axis:int;
while (axis < 2) {
bounds = m_bounds[axis];
bound1 = bounds[p1.lowerBounds[axis]];
bound2 = bounds[p2.upperBounds[axis]];
if (bound1.value > bound2.value){
return (false);
};
bound1 = bounds[p1.upperBounds[axis]];
bound2 = bounds[p2.lowerBounds[axis]];
if (bound1.value < bound2.value){
return (false);
};
axis++;
};
return (true);
}
private function ComputeBounds(lowerValues:Array, upperValues:Array, aabb:b2AABB):void{
var minVertexX:Number = aabb.lowerBound.x;
var minVertexY:Number = aabb.lowerBound.y;
minVertexX = b2Math.b2Min(minVertexX, m_worldAABB.upperBound.x);
minVertexY = b2Math.b2Min(minVertexY, m_worldAABB.upperBound.y);
minVertexX = b2Math.b2Max(minVertexX, m_worldAABB.lowerBound.x);
minVertexY = b2Math.b2Max(minVertexY, m_worldAABB.lowerBound.y);
var maxVertexX:Number = aabb.upperBound.x;
var maxVertexY:Number = aabb.upperBound.y;
maxVertexX = b2Math.b2Min(maxVertexX, m_worldAABB.upperBound.x);
maxVertexY = b2Math.b2Min(maxVertexY, m_worldAABB.upperBound.y);
maxVertexX = b2Math.b2Max(maxVertexX, m_worldAABB.lowerBound.x);
maxVertexY = b2Math.b2Max(maxVertexY, m_worldAABB.lowerBound.y);
lowerValues[0] = (uint((m_quantizationFactor.x * (minVertexX - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
upperValues[0] = ((uint((m_quantizationFactor.x * (maxVertexX - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
lowerValues[1] = (uint((m_quantizationFactor.y * (minVertexY - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
upperValues[1] = ((uint((m_quantizationFactor.y * (maxVertexY - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(aabb:b2AABB, userData):uint{
var index:uint;
var proxy:b2Proxy;
var bounds:Array;
var lowerIndex:uint;
var upperIndex:uint;
var lowerIndexOut:Array;
var upperIndexOut:Array;
var tArr:Array;
var j:int;
var tEnd:int;
var tBound1:b2Bound;
var tBound2:b2Bound;
var tBoundAS3:b2Bound;
var tIndex:int;
var proxy2:b2Proxy;
var proxyId:uint = m_freeProxy;
proxy = m_proxyPool[proxyId];
m_freeProxy = proxy.GetNext();
proxy.overlapCount = 0;
proxy.userData = userData;
var boundCount:uint = (2 * m_proxyCount);
var lowerValues:Array = new Array();
var upperValues:Array = new Array();
ComputeBounds(lowerValues, upperValues, aabb);
var axis:int;
while (axis < 2) {
bounds = m_bounds[axis];
lowerIndexOut = [lowerIndex];
upperIndexOut = [upperIndex];
Query(lowerIndexOut, upperIndexOut, lowerValues[axis], upperValues[axis], bounds, boundCount, axis);
lowerIndex = lowerIndexOut[0];
upperIndex = upperIndexOut[0];
tArr = new Array();
tEnd = (boundCount - upperIndex);
j = 0;
while (j < tEnd) {
tArr[j] = new b2Bound();
tBound1 = tArr[j];
tBound2 = bounds[int((upperIndex + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
tEnd = tArr.length;
tIndex = (upperIndex + 2);
j = 0;
while (j < tEnd) {
tBound2 = tArr[j];
tBound1 = bounds[int((tIndex + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
tArr = new Array();
tEnd = (upperIndex - lowerIndex);
j = 0;
while (j < tEnd) {
tArr[j] = new b2Bound();
tBound1 = tArr[j];
tBound2 = bounds[int((lowerIndex + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
tEnd = tArr.length;
tIndex = (lowerIndex + 1);
j = 0;
while (j < tEnd) {
tBound2 = tArr[j];
tBound1 = bounds[int((tIndex + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
upperIndex++;
tBound1 = bounds[lowerIndex];
tBound2 = bounds[upperIndex];
tBound1.value = lowerValues[axis];
tBound1.proxyId = proxyId;
tBound2.value = upperValues[axis];
tBound2.proxyId = proxyId;
tBoundAS3 = bounds[int((lowerIndex - 1))];
tBound1.stabbingCount = ((lowerIndex == 0)) ? 0 : tBoundAS3.stabbingCount;
tBoundAS3 = bounds[int((upperIndex - 1))];
tBound2.stabbingCount = tBoundAS3.stabbingCount;
index = lowerIndex;
while (index < upperIndex) {
tBoundAS3 = bounds[index];
tBoundAS3.stabbingCount++;
index++;
};
index = lowerIndex;
while (index < (boundCount + 2)) {
tBound1 = bounds[index];
proxy2 = m_proxyPool[tBound1.proxyId];
if (tBound1.IsLower()){
proxy2.lowerBounds[axis] = index;
} else {
proxy2.upperBounds[axis] = index;
};
index++;
};
axis++;
};
m_proxyCount++;
var i:int;
while (i < m_queryResultCount) {
m_pairManager.AddBufferedPair(proxyId, m_queryResults[i]);
i++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (proxyId);
}
public function DestroyProxy(proxyId:uint):void{
var tBound1:b2Bound;
var tBound2:b2Bound;
var bounds:Array;
var lowerIndex:uint;
var upperIndex:uint;
var lowerValue:uint;
var upperValue:uint;
var tArr:Array;
var j:int;
var tEnd:int;
var tIndex:int;
var index:uint;
var index2:int;
var proxy2:b2Proxy;
var proxy:b2Proxy = m_proxyPool[proxyId];
var boundCount:int = (2 * m_proxyCount);
var axis:int;
while (axis < 2) {
bounds = m_bounds[axis];
lowerIndex = proxy.lowerBounds[axis];
upperIndex = proxy.upperBounds[axis];
tBound1 = bounds[lowerIndex];
lowerValue = tBound1.value;
tBound2 = bounds[upperIndex];
upperValue = tBound2.value;
tArr = new Array();
tEnd = ((upperIndex - lowerIndex) - 1);
j = 0;
while (j < tEnd) {
tArr[j] = new b2Bound();
tBound1 = tArr[j];
tBound2 = bounds[int(((lowerIndex + 1) + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
tEnd = tArr.length;
tIndex = lowerIndex;
j = 0;
while (j < tEnd) {
tBound2 = tArr[j];
tBound1 = bounds[int((tIndex + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
tArr = new Array();
tEnd = ((boundCount - upperIndex) - 1);
j = 0;
while (j < tEnd) {
tArr[j] = new b2Bound();
tBound1 = tArr[j];
tBound2 = bounds[int(((upperIndex + 1) + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
tEnd = tArr.length;
tIndex = (upperIndex - 1);
j = 0;
while (j < tEnd) {
tBound2 = tArr[j];
tBound1 = bounds[int((tIndex + j))];
tBound1.value = tBound2.value;
tBound1.proxyId = tBound2.proxyId;
tBound1.stabbingCount = tBound2.stabbingCount;
j++;
};
tEnd = (boundCount - 2);
index = lowerIndex;
while (index < tEnd) {
tBound1 = bounds[index];
proxy2 = m_proxyPool[tBound1.proxyId];
if (tBound1.IsLower()){
proxy2.lowerBounds[axis] = index;
} else {
proxy2.upperBounds[axis] = index;
};
index++;
};
tEnd = (upperIndex - 1);
index2 = lowerIndex;
while (index2 < tEnd) {
tBound1 = bounds[index2];
tBound1.stabbingCount--;
index2++;
};
Query([0], [0], lowerValue, upperValue, bounds, (boundCount - 2), axis);
axis++;
};
var i:int;
while (i < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(proxyId, m_queryResults[i]);
i++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
proxy.userData = null;
proxy.overlapCount = b2_invalid;
proxy.lowerBounds[0] = b2_invalid;
proxy.lowerBounds[1] = b2_invalid;
proxy.upperBounds[0] = b2_invalid;
proxy.upperBounds[1] = b2_invalid;
proxy.SetNext(m_freeProxy);
m_freeProxy = proxyId;
m_proxyCount--;
}
public function TestOverlap(b:b2BoundValues, p:b2Proxy):Boolean{
var bounds:Array;
var bound:b2Bound;
var axis:int;
while (axis < 2) {
bounds = m_bounds[axis];
bound = bounds[p.upperBounds[axis]];
if (b.lowerValues[axis] > bound.value){
return (false);
};
bound = bounds[p.lowerBounds[axis]];
if (b.upperValues[axis] < bound.value){
return (false);
};
axis++;
};
return (true);
}
public function Validate():void{
var pair:b2Pair;
var proxy1:b2Proxy;
var proxy2:b2Proxy;
var overlap:Boolean;
var bounds:b2Bound;
var boundCount:uint;
var stabbingCount:uint;
var i:uint;
var bound:b2Bound;
var axis:int;
while (axis < 2) {
bounds = m_bounds[axis];
boundCount = (2 * m_proxyCount);
stabbingCount = 0;
i = 0;
while (i < boundCount) {
bound = bounds[i];
if (bound.IsLower() == true){
stabbingCount++;
} else {
stabbingCount--;
};
i++;
};
axis++;
};
}
private function IncrementOverlapCount(proxyId:uint):void{
var proxy:b2Proxy = m_proxyPool[proxyId];
if (proxy.timeStamp < m_timeStamp){
proxy.timeStamp = m_timeStamp;
proxy.overlapCount = 1;
} else {
proxy.overlapCount = 2;
m_queryResults[m_queryResultCount] = proxyId;
m_queryResultCount++;
};
}
public function InRange(aabb:b2AABB):Boolean{
var dX:Number;
var dY:Number;
var d2X:Number;
var d2Y:Number;
dX = aabb.lowerBound.x;
dY = aabb.lowerBound.y;
dX = (dX - m_worldAABB.upperBound.x);
dY = (dY - m_worldAABB.upperBound.y);
d2X = m_worldAABB.lowerBound.x;
d2Y = m_worldAABB.lowerBound.y;
d2X = (d2X - aabb.upperBound.x);
d2Y = (d2Y - aabb.upperBound.y);
dX = b2Math.b2Max(dX, d2X);
dY = b2Math.b2Max(dY, d2Y);
return ((b2Math.b2Max(dX, dY) < 0));
}
public function MoveProxy(proxyId:uint, aabb:b2AABB):void{
var as3arr:Array;
var as3int:int;
var axis:uint;
var index:uint;
var bound:b2Bound;
var prevBound:b2Bound;
var nextBound:b2Bound;
var nextProxyId:uint;
var nextProxy:b2Proxy;
var bounds:Array;
var lowerIndex:uint;
var upperIndex:uint;
var lowerValue:uint;
var upperValue:uint;
var deltaLower:int;
var deltaUpper:int;
var prevProxyId:uint;
var prevProxy:b2Proxy;
if ((((proxyId == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= proxyId)))){
return;
};
if (aabb.IsValid() == false){
return;
};
var boundCount:uint = (2 * m_proxyCount);
var proxy:b2Proxy = m_proxyPool[proxyId];
var newValues:b2BoundValues = new b2BoundValues();
ComputeBounds(newValues.lowerValues, newValues.upperValues, aabb);
var oldValues:b2BoundValues = new b2BoundValues();
axis = 0;
while (axis < 2) {
bound = m_bounds[axis][proxy.lowerBounds[axis]];
oldValues.lowerValues[axis] = bound.value;
bound = m_bounds[axis][proxy.upperBounds[axis]];
oldValues.upperValues[axis] = bound.value;
axis++;
};
axis = 0;
while (axis < 2) {
bounds = m_bounds[axis];
lowerIndex = proxy.lowerBounds[axis];
upperIndex = proxy.upperBounds[axis];
lowerValue = newValues.lowerValues[axis];
upperValue = newValues.upperValues[axis];
bound = bounds[lowerIndex];
deltaLower = (lowerValue - bound.value);
bound.value = lowerValue;
bound = bounds[upperIndex];
deltaUpper = (upperValue - bound.value);
bound.value = upperValue;
if (deltaLower < 0){
index = lowerIndex;
while ((((index > 0)) && ((lowerValue < (bounds[int((index - 1))] as b2Bound).value)))) {
bound = bounds[index];
prevBound = bounds[int((index - 1))];
prevProxyId = prevBound.proxyId;
prevProxy = m_proxyPool[prevBound.proxyId];
prevBound.stabbingCount++;
if (prevBound.IsUpper() == true){
if (TestOverlap(newValues, prevProxy)){
m_pairManager.AddBufferedPair(proxyId, prevProxyId);
};
as3arr = prevProxy.upperBounds;
as3int = as3arr[axis];
as3int++;
as3arr[axis] = as3int;
bound.stabbingCount++;
} else {
as3arr = prevProxy.lowerBounds;
as3int = as3arr[axis];
as3int++;
as3arr[axis] = as3int;
bound.stabbingCount--;
};
as3arr = proxy.lowerBounds;
as3int = as3arr[axis];
as3int--;
as3arr[axis] = as3int;
bound.Swap(prevBound);
index--;
};
};
if (deltaUpper > 0){
index = upperIndex;
while ((((index < (boundCount - 1))) && (((bounds[int((index + 1))] as b2Bound).value <= upperValue)))) {
bound = bounds[index];
nextBound = bounds[int((index + 1))];
nextProxyId = nextBound.proxyId;
nextProxy = m_proxyPool[nextProxyId];
nextBound.stabbingCount++;
if (nextBound.IsLower() == true){
if (TestOverlap(newValues, nextProxy)){
m_pairManager.AddBufferedPair(proxyId, nextProxyId);
};
as3arr = nextProxy.lowerBounds;
as3int = as3arr[axis];
as3int--;
as3arr[axis] = as3int;
bound.stabbingCount++;
} else {
as3arr = nextProxy.upperBounds;
as3int = as3arr[axis];
as3int--;
as3arr[axis] = as3int;
bound.stabbingCount--;
};
as3arr = proxy.upperBounds;
as3int = as3arr[axis];
as3int++;
as3arr[axis] = as3int;
bound.Swap(nextBound);
index++;
};
};
if (deltaLower > 0){
index = lowerIndex;
while ((((index < (boundCount - 1))) && (((bounds[int((index + 1))] as b2Bound).value <= lowerValue)))) {
bound = bounds[index];
nextBound = bounds[int((index + 1))];
nextProxyId = nextBound.proxyId;
nextProxy = m_proxyPool[nextProxyId];
nextBound.stabbingCount--;
if (nextBound.IsUpper()){
if (TestOverlap(oldValues, nextProxy)){
m_pairManager.RemoveBufferedPair(proxyId, nextProxyId);
};
as3arr = nextProxy.upperBounds;
as3int = as3arr[axis];
as3int--;
as3arr[axis] = as3int;
bound.stabbingCount--;
} else {
as3arr = nextProxy.lowerBounds;
as3int = as3arr[axis];
as3int--;
as3arr[axis] = as3int;
bound.stabbingCount++;
};
as3arr = proxy.lowerBounds;
as3int = as3arr[axis];
as3int++;
as3arr[axis] = as3int;
bound.Swap(nextBound);
index++;
};
};
if (deltaUpper < 0){
index = upperIndex;
while ((((index > 0)) && ((upperValue < (bounds[int((index - 1))] as b2Bound).value)))) {
bound = bounds[index];
prevBound = bounds[int((index - 1))];
prevProxyId = prevBound.proxyId;
prevProxy = m_proxyPool[prevProxyId];
prevBound.stabbingCount--;
if (prevBound.IsLower() == true){
if (TestOverlap(oldValues, prevProxy)){
m_pairManager.RemoveBufferedPair(proxyId, prevProxyId);
};
as3arr = prevProxy.lowerBounds;
as3int = as3arr[axis];
as3int++;
as3arr[axis] = as3int;
bound.stabbingCount--;
} else {
as3arr = prevProxy.upperBounds;
as3int = as3arr[axis];
as3int++;
as3arr[axis] = as3int;
bound.stabbingCount++;
};
as3arr = proxy.upperBounds;
as3int = as3arr[axis];
as3int--;
as3arr[axis] = as3int;
bound.Swap(prevBound);
index--;
};
};
axis++;
};
}
public static function BinarySearch(bounds:Array, count:int, value:uint):uint{
var mid:int;
var bound:b2Bound;
var low:int;
var high:int = (count - 1);
while (low <= high) {
mid = ((low + high) / 2);
bound = bounds[mid];
if (bound.value > value){
high = (mid - 1);
} else {
if (bound.value < value){
low = (mid + 1);
} else {
return (uint(mid));
};
};
};
return (uint(low));
}
}
}//package Box2D.Collision
Section 19
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
public function b2BufferedPair(){
super();
}
}
}//package Box2D.Collision
Section 20
//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 function b2Collision(){
super();
}
public static function EdgeSeparation(poly1:b2PolygonShape, xf1:b2XForm, edge1:int, poly2:b2PolygonShape, xf2:b2XForm):Number{
var tMat:b2Mat22;
var tVec:b2Vec2;
var dot:Number;
var count1:int = poly1.m_vertexCount;
var vertices1:Array = poly1.m_vertices;
var normals1:Array = poly1.m_normals;
var count2:int = poly2.m_vertexCount;
var vertices2:Array = poly2.m_vertices;
tMat = xf1.R;
tVec = normals1[edge1];
var normal1WorldX:Number = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
var normal1WorldY:Number = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
tMat = xf2.R;
var normal1X:Number = ((tMat.col1.x * normal1WorldX) + (tMat.col1.y * normal1WorldY));
var normal1Y:Number = ((tMat.col2.x * normal1WorldX) + (tMat.col2.y * normal1WorldY));
var index:int;
var minDot:Number = Number.MAX_VALUE;
var i:int;
while (i < count2) {
tVec = vertices2[i];
dot = ((tVec.x * normal1X) + (tVec.y * normal1Y));
if (dot < minDot){
minDot = dot;
index = i;
};
i++;
};
tVec = vertices1[edge1];
tMat = xf1.R;
var v1X:Number = (xf1.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var v1Y:Number = (xf1.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
tVec = vertices2[index];
tMat = xf2.R;
var v2X:Number = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var v2Y:Number = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
v2X = (v2X - v1X);
v2Y = (v2Y - v1Y);
var separation:Number = ((v2X * normal1WorldX) + (v2Y * normal1WorldY));
return (separation);
}
public static function b2TestOverlap(a:b2AABB, b:b2AABB):Boolean{
var t1:b2Vec2 = b.lowerBound;
var t2:b2Vec2 = a.upperBound;
var d1X:Number = (t1.x - t2.x);
var d1Y:Number = (t1.y - t2.y);
t1 = a.lowerBound;
t2 = b.upperBound;
var d2X:Number = (t1.x - t2.x);
var d2Y:Number = (t1.y - t2.y);
if ((((d1X > 0)) || ((d1Y > 0)))){
return (false);
};
if ((((d2X > 0)) || ((d2Y > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(c:Array, poly1:b2PolygonShape, xf1:b2XForm, edge1:int, poly2:b2PolygonShape, xf2:b2XForm):void{
var tMat:b2Mat22;
var tVec:b2Vec2;
var tClip:ClipVertex;
var dot:Number;
var count1:int = poly1.m_vertexCount;
var normals1:Array = poly1.m_normals;
var count2:int = poly2.m_vertexCount;
var vertices2:Array = poly2.m_vertices;
var normals2:Array = poly2.m_normals;
tMat = xf1.R;
tVec = normals1[edge1];
var normal1X:Number = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
var normal1Y:Number = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
tMat = xf2.R;
var tX:Number = ((tMat.col1.x * normal1X) + (tMat.col1.y * normal1Y));
normal1Y = ((tMat.col2.x * normal1X) + (tMat.col2.y * normal1Y));
normal1X = tX;
var index:int;
var minDot:Number = Number.MAX_VALUE;
var i:int;
while (i < count2) {
tVec = normals2[i];
dot = ((normal1X * tVec.x) + (normal1Y * tVec.y));
if (dot < minDot){
minDot = dot;
index = i;
};
i++;
};
var i1:int = index;
var i2:int = (((i1 + 1) < count2)) ? (i1 + 1) : 0;
tClip = c[0];
tVec = vertices2[i1];
tMat = xf2.R;
tClip.v.x = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
tClip.v.y = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
tClip.id.features.referenceEdge = edge1;
tClip.id.features.incidentEdge = i1;
tClip.id.features.incidentVertex = 0;
tClip = c[1];
tVec = vertices2[i2];
tMat = xf2.R;
tClip.v.x = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
tClip.v.y = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
tClip.id.features.referenceEdge = edge1;
tClip.id.features.incidentEdge = i2;
tClip.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(manifold:b2Manifold, polyA:b2PolygonShape, xfA:b2XForm, polyB:b2PolygonShape, xfB:b2XForm):void{
var cv:ClipVertex;
var poly1:b2PolygonShape;
var poly2:b2PolygonShape;
var edge1:int;
var flip:uint;
var np:int;
var v12:b2Vec2;
var separation:Number;
var cp:b2ManifoldPoint;
manifold.pointCount = 0;
var edgeA:int;
var edgeAO:Array = [edgeA];
var separationA:Number = FindMaxSeparation(edgeAO, polyA, xfA, polyB, xfB);
edgeA = edgeAO[0];
if (separationA > 0){
return;
};
var edgeB:int;
var edgeBO:Array = [edgeB];
var separationB:Number = FindMaxSeparation(edgeBO, polyB, xfB, polyA, xfA);
edgeB = edgeBO[0];
if (separationB > 0){
return;
};
var xf1:b2XForm = new b2XForm();
var xf2:b2XForm = new b2XForm();
var k_relativeTol:Number = 0.98;
var k_absoluteTol:Number = 0.001;
if (separationB > ((k_relativeTol * separationA) + k_absoluteTol)){
poly1 = polyB;
poly2 = polyA;
xf1.Set(xfB);
xf2.Set(xfA);
edge1 = edgeB;
flip = 1;
} else {
poly1 = polyA;
poly2 = polyB;
xf1.Set(xfA);
xf2.Set(xfB);
edge1 = edgeA;
flip = 0;
};
var incidentEdge:Array = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);
var count1:int = poly1.m_vertexCount;
var vertices1:Array = poly1.m_vertices;
var tVec:b2Vec2 = vertices1[edge1];
var v11:b2Vec2 = tVec.Copy();
if ((edge1 + 1) < count1){
tVec = vertices1[int((edge1 + 1))];
v12 = tVec.Copy();
} else {
tVec = vertices1[0];
v12 = tVec.Copy();
};
var dv:b2Vec2 = b2Math.SubtractVV(v12, v11);
var sideNormal:b2Vec2 = b2Math.b2MulMV(xf1.R, b2Math.SubtractVV(v12, v11));
sideNormal.Normalize();
var frontNormal:b2Vec2 = b2Math.b2CrossVF(sideNormal, 1);
v11 = b2Math.b2MulX(xf1, v11);
v12 = b2Math.b2MulX(xf1, v12);
var frontOffset:Number = b2Math.b2Dot(frontNormal, v11);
var sideOffset1:Number = -(b2Math.b2Dot(sideNormal, v11));
var sideOffset2:Number = b2Math.b2Dot(sideNormal, v12);
var clipPoints1:Array = [new ClipVertex(), new ClipVertex()];
var clipPoints2:Array = [new ClipVertex(), new ClipVertex()];
np = ClipSegmentToLine(clipPoints1, incidentEdge, sideNormal.Negative(), sideOffset1);
if (np < 2){
return;
};
np = ClipSegmentToLine(clipPoints2, clipPoints1, sideNormal, sideOffset2);
if (np < 2){
return;
};
manifold.normal = (flip) ? frontNormal.Negative() : frontNormal.Copy();
var pointCount:int;
var i:int;
while (i < b2Settings.b2_maxManifoldPoints) {
cv = clipPoints2[i];
separation = (b2Math.b2Dot(frontNormal, cv.v) - frontOffset);
if (separation <= 0){
cp = manifold.points[pointCount];
cp.separation = separation;
cp.localPoint1 = b2Math.b2MulXT(xfA, cv.v);
cp.localPoint2 = b2Math.b2MulXT(xfB, cv.v);
cp.id.key = cv.id._key;
cp.id.features.flip = flip;
pointCount++;
};
i++;
};
manifold.pointCount = pointCount;
}
public static function FindMaxSeparation(edgeIndex:Array, poly1:b2PolygonShape, xf1:b2XForm, poly2:b2PolygonShape, xf2:b2XForm):Number{
var tVec:b2Vec2;
var tMat:b2Mat22;
var bestEdge:int;
var bestSeparation:Number;
var increment:int;
var dot:Number;
var count1:int = poly1.m_vertexCount;
var normals1:Array = poly1.m_normals;
tMat = xf2.R;
tVec = poly2.m_centroid;
var dX:Number = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var dY:Number = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
tMat = xf1.R;
tVec = poly1.m_centroid;
dX = (dX - (xf1.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y))));
dY = (dY - (xf1.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y))));
var dLocal1X:Number = ((dX * xf1.R.col1.x) + (dY * xf1.R.col1.y));
var dLocal1Y:Number = ((dX * xf1.R.col2.x) + (dY * xf1.R.col2.y));
var edge:int;
var maxDot:Number = -(Number.MAX_VALUE);
var i:int;
while (i < count1) {
tVec = normals1[i];
dot = ((tVec.x * dLocal1X) + (tVec.y * dLocal1Y));
if (dot > maxDot){
maxDot = dot;
edge = i;
};
i++;
};
var s:Number = EdgeSeparation(poly1, xf1, edge, poly2, xf2);
if (s > 0){
return (s);
};
var prevEdge:int = (((edge - 1) >= 0)) ? (edge - 1) : (count1 - 1);
var sPrev:Number = EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2);
if (sPrev > 0){
return (sPrev);
};
var nextEdge:int = (((edge + 1) < count1)) ? (edge + 1) : 0;
var sNext:Number = EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2);
if (sNext > 0){
return (sNext);
};
if ((((sPrev > s)) && ((sPrev > sNext)))){
increment = -1;
bestEdge = prevEdge;
bestSeparation = sPrev;
} else {
if (sNext > s){
increment = 1;
bestEdge = nextEdge;
bestSeparation = sNext;
} else {
edgeIndex[0] = edge;
return (s);
};
};
while (true) {
if (increment == -1){
edge = (((bestEdge - 1) >= 0)) ? (bestEdge - 1) : (count1 - 1);
} else {
edge = (((bestEdge + 1) < count1)) ? (bestEdge + 1) : 0;
};
s = EdgeSeparation(poly1, xf1, edge, poly2, xf2);
if (s > 0){
return (s);
};
if (s > bestSeparation){
bestEdge = edge;
bestSeparation = s;
} else {
break;
};
};
edgeIndex[0] = bestEdge;
return (bestSeparation);
}
public static function ClipSegmentToLine(vOut:Array, vIn:Array, normal:b2Vec2, offset:Number):int{
var cv:ClipVertex;
var numOut:int;
var vIn0:b2Vec2;
var vIn1:b2Vec2;
var distance0:Number;
var interp:Number;
var tVec:b2Vec2;
var cv2:ClipVertex;
numOut = 0;
cv = vIn[0];
vIn0 = cv.v;
cv = vIn[1];
vIn1 = cv.v;
distance0 = (b2Math.b2Dot(normal, vIn0) - offset);
var distance1:Number = (b2Math.b2Dot(normal, vIn1) - offset);
if (distance0 <= 0){
var _temp1 = numOut;
numOut = (numOut + 1);
var _local14 = _temp1;
vOut[_local14] = vIn[0];
};
if (distance1 <= 0){
var _temp2 = numOut;
numOut = (numOut + 1);
_local14 = _temp2;
vOut[_local14] = vIn[1];
};
if ((distance0 * distance1) < 0){
interp = (distance0 / (distance0 - distance1));
cv = vOut[numOut];
tVec = cv.v;
tVec.x = (vIn0.x + (interp * (vIn1.x - vIn0.x)));
tVec.y = (vIn0.y + (interp * (vIn1.y - vIn0.y)));
cv = vOut[numOut];
if (distance0 > 0){
cv2 = vIn[0];
cv.id = cv2.id;
} else {
cv2 = vIn[1];
cv.id = cv2.id;
};
numOut++;
};
return (numOut);
}
public static function b2CollideCircles(manifold:b2Manifold, circle1:b2CircleShape, xf1:b2XForm, circle2:b2CircleShape, xf2:b2XForm):void{
var tMat:b2Mat22;
var tVec:b2Vec2;
var separation:Number;
var dist:Number;
var a:Number;
manifold.pointCount = 0;
tMat = xf1.R;
tVec = circle1.m_localPosition;
var p1X:Number = (xf1.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var p1Y:Number = (xf1.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
tMat = xf2.R;
tVec = circle2.m_localPosition;
var p2X:Number = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var p2Y:Number = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
var dX:Number = (p2X - p1X);
var dY:Number = (p2Y - p1Y);
var distSqr:Number = ((dX * dX) + (dY * dY));
var r1:Number = circle1.m_radius;
var r2:Number = circle2.m_radius;
var radiusSum:Number = (r1 + r2);
if (distSqr > (radiusSum * radiusSum)){
return;
};
if (distSqr < Number.MIN_VALUE){
separation = -(radiusSum);
manifold.normal.Set(0, 1);
} else {
dist = Math.sqrt(distSqr);
separation = (dist - radiusSum);
a = (1 / dist);
manifold.normal.x = (a * dX);
manifold.normal.y = (a * dY);
};
manifold.pointCount = 1;
var tPoint:b2ManifoldPoint = manifold.points[0];
tPoint.id.key = 0;
tPoint.separation = separation;
p1X = (p1X + (r1 * manifold.normal.x));
p1Y = (p1Y + (r1 * manifold.normal.y));
p2X = (p2X - (r2 * manifold.normal.x));
p2Y = (p2Y - (r2 * manifold.normal.y));
var pX:Number = (0.5 * (p1X + p2X));
var pY:Number = (0.5 * (p1Y + p2Y));
var tX:Number = (pX - xf1.position.x);
var tY:Number = (pY - xf1.position.y);
tPoint.localPoint1.x = ((tX * xf1.R.col1.x) + (tY * xf1.R.col1.y));
tPoint.localPoint1.y = ((tX * xf1.R.col2.x) + (tY * xf1.R.col2.y));
tX = (pX - xf2.position.x);
tY = (pY - xf2.position.y);
tPoint.localPoint2.x = ((tX * xf2.R.col1.x) + (tY * xf2.R.col1.y));
tPoint.localPoint2.y = ((tX * xf2.R.col2.x) + (tY * xf2.R.col2.y));
}
public static function b2CollidePolygonAndCircle(manifold:b2Manifold, polygon:b2PolygonShape, xf1:b2XForm, circle:b2CircleShape, xf2:b2XForm):void{
var tPoint:b2ManifoldPoint;
var dX:Number;
var dY:Number;
var positionX:Number;
var positionY:Number;
var tVec:b2Vec2;
var tMat:b2Mat22;
var dist:Number;
var pX:Number;
var pY:Number;
var s:Number;
manifold.pointCount = 0;
tMat = xf2.R;
tVec = circle.m_localPosition;
var cX:Number = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var cY:Number = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
dX = (cX - xf1.position.x);
dY = (cY - xf1.position.y);
tMat = xf1.R;
var cLocalX:Number = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
var cLocalY:Number = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
var normalIndex:int;
var separation:Number = -(Number.MAX_VALUE);
var radius:Number = circle.m_radius;
var vertexCount:int = polygon.m_vertexCount;
var vertices:Array = polygon.m_vertices;
var normals:Array = polygon.m_normals;
var i:int;
while (i < vertexCount) {
tVec = vertices[i];
dX = (cLocalX - tVec.x);
dY = (cLocalY - tVec.y);
tVec = normals[i];
s = ((tVec.x * dX) + (tVec.y * dY));
if (s > radius){
return;
};
if (s > separation){
separation = s;
normalIndex = i;
};
i++;
};
if (separation < Number.MIN_VALUE){
manifold.pointCount = 1;
tVec = normals[normalIndex];
tMat = xf1.R;
manifold.normal.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
manifold.normal.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
tPoint = manifold.points[0];
tPoint.id.features.incidentEdge = normalIndex;
tPoint.id.features.incidentVertex = b2_nullFeature;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
positionX = (cX - (radius * manifold.normal.x));
positionY = (cY - (radius * manifold.normal.y));
dX = (positionX - xf1.position.x);
dY = (positionY - xf1.position.y);
tMat = xf1.R;
tPoint.localPoint1.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint1.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = (positionX - xf2.position.x);
dY = (positionY - xf2.position.y);
tMat = xf2.R;
tPoint.localPoint2.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint2.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
tPoint.separation = (separation - radius);
return;
};
var vertIndex1:int = normalIndex;
var vertIndex2:int = (((vertIndex1 + 1) < vertexCount)) ? (vertIndex1 + 1) : 0;
tVec = vertices[vertIndex1];
var tVec2:b2Vec2 = vertices[vertIndex2];
var eX:Number = (tVec2.x - tVec.x);
var eY:Number = (tVec2.y - tVec.y);
var length:Number = Math.sqrt(((eX * eX) + (eY * eY)));
eX = (eX / length);
eY = (eY / length);
dX = (cLocalX - tVec.x);
dY = (cLocalY - tVec.y);
var u:Number = ((dX * eX) + (dY * eY));
tPoint = manifold.points[0];
if (u <= 0){
pX = tVec.x;
pY = tVec.y;
tPoint.id.features.incidentEdge = b2_nullFeature;
tPoint.id.features.incidentVertex = vertIndex1;
} else {
if (u >= length){
pX = tVec2.x;
pY = tVec2.y;
tPoint.id.features.incidentEdge = b2_nullFeature;
tPoint.id.features.incidentVertex = vertIndex2;
} else {
pX = ((eX * u) + tVec.x);
pY = ((eY * u) + tVec.y);
tPoint.id.features.incidentEdge = normalIndex;
tPoint.id.features.incidentVertex = 0;
};
};
dX = (cLocalX - pX);
dY = (cLocalY - pY);
dist = Math.sqrt(((dX * dX) + (dY * dY)));
dX = (dX / dist);
dY = (dY / dist);
if (dist > radius){
return;
};
manifold.pointCount = 1;
tMat = xf1.R;
manifold.normal.x = ((tMat.col1.x * dX) + (tMat.col2.x * dY));
manifold.normal.y = ((tMat.col1.y * dX) + (tMat.col2.y * dY));
positionX = (cX - (radius * manifold.normal.x));
positionY = (cY - (radius * manifold.normal.y));
dX = (positionX - xf1.position.x);
dY = (positionY - xf1.position.y);
tMat = xf1.R;
tPoint.localPoint1.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint1.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = (positionX - xf2.position.x);
dY = (positionY - xf2.position.y);
tMat = xf2.R;
tPoint.localPoint2.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint2.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
tPoint.separation = (dist - radius);
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 21
//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(id:b2ContactID):void{
key = id._key;
}
public function Copy():b2ContactID{
var id:b2ContactID = new b2ContactID();
id.key = key;
return (id);
}
public function set key(value:uint):void{
_key = value;
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 22
//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 23
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Distance {
public static var s_initialized:Boolean = false;
public static var g_GJK_Iterations:int = 0;
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
public static var s_registers:Array;
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
public static var t:Number = -1;
public static var t2:String = "";
public function b2Distance(){
super();
}
public static function DistanceGeneric(x1:b2Vec2, x2:b2Vec2, shape1, xf1:b2XForm, shape2, xf2:b2XForm):Number{
var tVec:b2Vec2;
var vX:Number;
var vY:Number;
var w1:b2Vec2;
var w2:b2Vec2;
var wX:Number;
var wY:Number;
var vw:Number;
var maxSqr:Number;
var i:int;
var p1s:Array = s_p1s;
var p2s:Array = s_p2s;
var points:Array = s_points;
var pointCount:int;
x1.SetV(shape1.GetFirstVertex(xf1));
x2.SetV(shape2.GetFirstVertex(xf2));
var vSqr:Number = 0;
var maxIterations = 20;
var iter:int;
while (iter < maxIterations) {
vX = (x2.x - x1.x);
vY = (x2.y - x1.y);
w1 = shape1.Support(xf1, vX, vY);
w2 = shape2.Support(xf2, -(vX), -(vY));
vSqr = ((vX * vX) + (vY * vY));
wX = (w2.x - w1.x);
wY = (w2.y - w1.y);
vw = ((vX * wX) + (vY * wY));
if ((vSqr - ((vX * wX) + (vY * wY))) <= (0.01 * vSqr)){
if (pointCount == 0){
x1.SetV(w1);
x2.SetV(w2);
};
g_GJK_Iterations = iter;
return (Math.sqrt(vSqr));
};
switch (pointCount){
case 0:
tVec = p1s[0];
tVec.SetV(w1);
tVec = p2s[0];
tVec.SetV(w2);
tVec = points[0];
tVec.x = wX;
tVec.y = wY;
x1.SetV(p1s[0]);
x2.SetV(p2s[0]);
pointCount++;
break;
case 1:
tVec = p1s[1];
tVec.SetV(w1);
tVec = p2s[1];
tVec.SetV(w2);
tVec = points[1];
tVec.x = wX;
tVec.y = wY;
pointCount = ProcessTwo(x1, x2, p1s, p2s, points);
break;
case 2:
tVec = p1s[2];
tVec.SetV(w1);
tVec = p2s[2];
tVec.SetV(w2);
tVec = points[2];
tVec.x = wX;
tVec.y = wY;
pointCount = ProcessThree(x1, x2, p1s, p2s, points);
break;
};
if (pointCount == 3){
g_GJK_Iterations = iter;
return (0);
};
maxSqr = -(Number.MAX_VALUE);
i = 0;
while (i < pointCount) {
tVec = points[i];
maxSqr = b2Math.b2Max(maxSqr, ((tVec.x * tVec.x) + (tVec.y * tVec.y)));
i++;
};
if ((((pointCount == 3)) || ((vSqr <= ((100 * Number.MIN_VALUE) * maxSqr))))){
g_GJK_Iterations = iter;
vX = (x2.x - x1.x);
vY = (x2.y - x1.y);
vSqr = ((vX * vX) + (vY * vY));
return (Math.sqrt(vSqr));
};
iter++;
};
g_GJK_Iterations = maxIterations;
return (Math.sqrt(vSqr));
}
public static function InPoints(w:b2Vec2, points:Array, pointCount:int):Boolean{
var points_i:b2Vec2;
var dX:Number;
var dY:Number;
var mX:Number;
var mY:Number;
var k_tolerance:Number = (100 * Number.MIN_VALUE);
var i:int;
while (i < pointCount) {
points_i = points[i];
dX = Math.abs((w.x - points_i.x));
dY = Math.abs((w.y - points_i.y));
mX = Math.max(Math.abs(w.x), Math.abs(points_i.x));
mY = Math.max(Math.abs(w.y), Math.abs(points_i.y));
if ((((dX < (k_tolerance * (mX + 1)))) && ((dY < (k_tolerance * (mY + 1)))))){
return (true);
};
i++;
};
return (false);
}
public static function ProcessThree(x1:b2Vec2, x2:b2Vec2, p1s:Array, p2s:Array, points:Array):int{
var points_0:b2Vec2;
var points_1:b2Vec2;
var lambda:Number;
points_0 = points[0];
points_1 = points[1];
var points_2:b2Vec2 = points[2];
var p1s_0:b2Vec2 = p1s[0];
var p1s_1:b2Vec2 = p1s[1];
var p1s_2:b2Vec2 = p1s[2];
var p2s_0:b2Vec2 = p2s[0];
var p2s_1:b2Vec2 = p2s[1];
var p2s_2:b2Vec2 = p2s[2];
var aX:Number = points_0.x;
var aY:Number = points_0.y;
var bX:Number = points_1.x;
var bY:Number = points_1.y;
var cX:Number = points_2.x;
var cY:Number = points_2.y;
var abX:Number = (bX - aX);
var abY:Number = (bY - aY);
var acX:Number = (cX - aX);
var acY:Number = (cY - aY);
var bcX:Number = (cX - bX);
var bcY:Number = (cY - bY);
var sn:Number = -(((aX * abX) + (aY * abY)));
var sd:Number = ((bX * abX) + (bY * abY));
var tn:Number = -(((aX * acX) + (aY * acY)));
var td:Number = ((cX * acX) + (cY * acY));
var un:Number = -(((bX * bcX) + (bY * bcY)));
var ud:Number = ((cX * bcX) + (cY * bcY));
if ((((td <= 0)) && ((ud <= 0)))){
x1.SetV(p1s_2);
x2.SetV(p2s_2);
p1s_0.SetV(p1s_2);
p2s_0.SetV(p2s_2);
points_0.SetV(points_2);
return (1);
};
var n:Number = ((abX * acY) - (abY * acX));
var vc:Number = (n * ((aX * bY) - (aY * bX)));
var va:Number = (n * ((bX * cY) - (bY * cX)));
if ((((((((va <= 0)) && ((un >= 0)))) && ((ud >= 0)))) && (((un + ud) > 0)))){
lambda = (un / (un + ud));
x1.x = (p1s_1.x + (lambda * (p1s_2.x - p1s_1.x)));
x1.y = (p1s_1.y + (lambda * (p1s_2.y - p1s_1.y)));
x2.x = (p2s_1.x + (lambda * (p2s_2.x - p2s_1.x)));
x2.y = (p2s_1.y + (lambda * (p2s_2.y - p2s_1.y)));
p1s_0.SetV(p1s_2);
p2s_0.SetV(p2s_2);
points_0.SetV(points_2);
return (2);
};
var vb:Number = (n * ((cX * aY) - (cY * aX)));
if ((((((((vb <= 0)) && ((tn >= 0)))) && ((td >= 0)))) && (((tn + td) > 0)))){
lambda = (tn / (tn + td));
x1.x = (p1s_0.x + (lambda * (p1s_2.x - p1s_0.x)));
x1.y = (p1s_0.y + (lambda * (p1s_2.y - p1s_0.y)));
x2.x = (p2s_0.x + (lambda * (p2s_2.x - p2s_0.x)));
x2.y = (p2s_0.y + (lambda * (p2s_2.y - p2s_0.y)));
p1s_1.SetV(p1s_2);
p2s_1.SetV(p2s_2);
points_1.SetV(points_2);
return (2);
};
var denom:Number = ((va + vb) + vc);
denom = (1 / denom);
var u:Number = (va * denom);
var v:Number = (vb * denom);
var w:Number = ((1 - u) - v);
x1.x = (((u * p1s_0.x) + (v * p1s_1.x)) + (w * p1s_2.x));
x1.y = (((u * p1s_0.y) + (v * p1s_1.y)) + (w * p1s_2.y));
x2.x = (((u * p2s_0.x) + (v * p2s_1.x)) + (w * p2s_2.x));
x2.y = (((u * p2s_0.y) + (v * p2s_1.y)) + (w * p2s_2.y));
return (3);
}
public static function Distance(x1:b2Vec2, x2:b2Vec2, shape1:b2Shape, xf1:b2XForm, shape2:b2Shape, xf2:b2XForm):Number{
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
var type1:int = shape1.GetType();
var type2:int = shape2.GetType();
var register:Object = s_registers[type1][type2];
if (register.fcn){
if (register.primary){
return (register.fcn(x1, x2, shape1, xf1, shape2, xf2));
};
return (register.fcn(x2, x1, shape2, xf2, shape1, xf1));
};
return (0);
}
public static function DistancePC(x1:b2Vec2, x2:b2Vec2, polygon, xf1:b2XForm, circle:b2CircleShape, xf2:b2XForm):Number{
var tMat:b2Mat22;
var tVec:b2Vec2;
var dX:Number;
var dY:Number;
var dLen:Number;
var point:b2Point = gPoint;
tVec = circle.m_localPosition;
tMat = xf2.R;
point.p.x = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
point.p.y = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
var distance:Number = DistanceGeneric(x1, x2, polygon, xf1, point, b2Math.b2XForm_identity);
var r:Number = (circle.m_radius - b2Settings.b2_toiSlop);
if (distance > r){
distance = (distance - r);
dX = (x2.x - x1.x);
dY = (x2.y - x1.y);
dLen = Math.sqrt(((dX * dX) + (dY * dY)));
dX = (dX / dLen);
dY = (dY / dLen);
x2.x = (x2.x - (r * dX));
x2.y = (x2.y - (r * dY));
} else {
distance = 0;
x2.x = x1.x;
x2.y = x1.y;
};
return (distance);
}
public static function AddType(fcn:Function, type1:int, type2:int):void{
s_registers[type1][type2].fcn = fcn;
s_registers[type1][type2].primary = true;
if (type1 != type2){
s_registers[type2][type1].fcn = fcn;
s_registers[type2][type1].primary = false;
};
}
public static function DistanceCcaC(x1:b2Vec2, x2:b2Vec2, polygon:b2ConcaveArcShape, xf1:b2XForm, circle:b2CircleShape, xf2:b2XForm):Number{
var tMat:b2Mat22;
var tVec:b2Vec2;
var arcCenter:b2Vec2;
var c2X:Number;
var c2Y:Number;
var norm:Number;
var c:Number;
var dX:Number;
var dY:Number;
var dLen:Number;
var point:b2Point = gPoint;
tVec = circle.m_localPosition;
tMat = xf2.R;
point.p.x = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
point.p.y = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
var distance:Number = DistanceGeneric(x1, x2, polygon, xf1, point, b2Math.b2XForm_identity);
var r:Number = (circle.m_radius - b2Settings.b2_toiSlop);
var vx0:b2Vec2 = b2Math.b2MulX(xf1, polygon.m_coreVertices[0]);
var normal:b2Vec2 = b2Math.b2MulMV(xf1.R, polygon.m_normals[0]);
var n:Number = (((x1.x - vx0.x) * normal.x) + ((x1.y - vx0.y) * normal.y));
if (n >= 0){
arcCenter = b2Math.b2MulX(xf1, polygon.m_arcCenter);
c2X = (point.p.x - arcCenter.x);
c2Y = (point.p.y - arcCenter.y);
norm = ((-(normal.y) * c2X) + (normal.x * c2Y));
if (((c2X * normal.x) + (c2Y * normal.y)) > 0){
if (norm < 0){
tVec = vx0;
} else {
tVec = b2Math.b2MulX(xf1, polygon.m_coreVertices[1]);
};
} else {
if (norm <= -(polygon.m_norm)){
tVec = vx0;
} else {
if (norm >= polygon.m_norm){
tVec = b2Math.b2MulX(xf1, polygon.m_coreVertices[1]);
} else {
c = Math.sqrt(((c2X * c2X) + (c2Y * c2Y)));
distance = (((polygon.m_radius + (b2Settings.b2_toiSlop * 2)) - r) - c);
c2X = (c2X / c);
c2Y = (c2Y / c);
if (distance < 0){
distance = 0;
};
x1.x = (arcCenter.x + (c2X * (polygon.m_radius + b2Settings.b2_toiSlop)));
x1.y = (arcCenter.y + (c2Y * (polygon.m_radius + b2Settings.b2_toiSlop)));
x2.x = (x2.x + (c2X * r));
x2.y = (x2.y + (c2Y * r));
return (distance);
};
};
};
x1.SetV(tVec);
tVec.x = (tVec.x - point.p.x);
tVec.y = (tVec.y - point.p.y);
distance = (tVec.Normalize() - r);
if (distance > 0){
x2.x = (x2.x + (r * tVec.x));
x2.y = (x2.y + (r * tVec.y));
return (distance);
};
x2.SetV(x1);
return (0);
};
if (distance > r){
distance = (distance - r);
dX = (x2.x - x1.x);
dY = (x2.y - x1.y);
dLen = Math.sqrt(((dX * dX) + (dY * dY)));
dX = (dX / dLen);
dY = (dY / dLen);
x2.x = (x2.x - (r * dX));
x2.y = (x2.y - (r * dY));
} else {
distance = 0;
x2.x = x1.x;
x2.y = x1.y;
};
return (distance);
}
public static function InitializeRegisters():void{
var j:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
var i:int;
while (i < b2Shape.e_shapeTypeCount) {
s_registers[i] = new Array(b2Shape.e_shapeTypeCount);
j = 0;
while (j < b2Shape.e_shapeTypeCount) {
s_registers[i][j] = {};
j++;
};
i++;
};
AddType(b2Distance.DistanceCC, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2Distance.DistancePC, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2Distance.DistanceGeneric, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
AddType(b2Distance.DistanceCcaC, b2Shape.e_concaveArcShape, b2Shape.e_circleShape);
AddType(b2Distance.DistancePCca, b2Shape.e_polygonShape, b2Shape.e_concaveArcShape);
AddType(b2Distance.DistancePC, b2Shape.e_staticEdgeShape, b2Shape.e_circleShape);
AddType(b2Distance.DistanceGeneric, b2Shape.e_polygonShape, b2Shape.e_staticEdgeShape);
}
public static function DistancePCca(x1:b2Vec2, x2:b2Vec2, polygon:b2PolygonShape, xf1:b2XForm, arc:b2ConcaveArcShape, xf2:b2XForm):Number{
var dist2:Number;
var dist:Number;
var norm:Number;
t = -1;
t2 = "";
var gd:Number = DistanceGeneric(x1, x2, polygon, xf1, arc, xf2);
var vx0:b2Vec2 = b2Math.b2MulX(xf2, arc.m_coreVertices[0]);
var normal:b2Vec2 = b2Math.b2MulMV(xf2.R, arc.m_normals[0]);
var n:Number = (((x2.x - vx0.x) * normal.x) + ((x2.y - vx0.y) * normal.y));
if ((((n < (-(b2Settings.b2_linearSlop) / 4))) && ((gd > 0)))){
t = 0;
return (gd);
};
var vx1:b2Vec2 = b2Math.b2MulX(xf2, arc.m_coreVertices[1]);
var tVec:b2Vec2 = new b2Vec2();
var tolerance:Number = (b2Settings.b2_linearSlop * b2Settings.b2_linearSlop);
tVec.x = (vx0.x - x2.x);
tVec.y = (vx0.y - x2.y);
if (((tVec.x * tVec.x) + (tVec.y * tVec.y)) < tolerance){
t = 1;
return (gd);
};
tVec.x = (vx1.x - x2.x);
tVec.y = (vx1.y - x2.y);
if (((tVec.x * tVec.x) + (tVec.y * tVec.y)) < tolerance){
t = 2;
return (gd);
};
var localCenter:b2Vec2 = b2Math.b2MulXT(xf1, b2Math.b2MulX(xf2, arc.m_arcCenter));
var localNorm:b2Vec2 = b2Math.b2MulTMV(xf1.R, normal);
var maxDist2:Number = -1;
var bestVx:Number = -1;
var separation:Number = Number.MAX_VALUE;
var i:Number = 0;
while (i < polygon.m_vertexCount) {
tVec.x = (polygon.m_coreVertices[i].x - localCenter.x);
tVec.y = (polygon.m_coreVertices[i].y - localCenter.y);
norm = ((tVec.x * localNorm.y) - (tVec.y * localNorm.x));
dist2 = ((tVec.x * tVec.x) + (tVec.y * tVec.y));
if (((((norm * norm) < ((arc.m_norm * arc.m_norm) * dist2))) && ((((tVec.x * localNorm.x) + (tVec.y * localNorm.y)) < 0)))){
t2 = (t2 + (("(" + i) + ") "));
if (dist2 > maxDist2){
maxDist2 = dist2;
bestVx = i;
dist = Math.sqrt(dist2);
separation = ((arc.m_radius + b2Settings.b2_toiSlop) - dist);
if (separation < 0){
separation = 0;
};
x1.SetV(b2Math.b2MulX(xf1, polygon.m_coreVertices[i]));
tVec.x = (tVec.x * ((arc.m_radius + b2Settings.b2_toiSlop) / dist));
tVec.y = (tVec.y * ((arc.m_radius + b2Settings.b2_toiSlop) / dist));
tVec.x = (tVec.x + localCenter.x);
tVec.y = (tVec.y + localCenter.y);
x2.SetV(b2Math.b2MulX(xf1, tVec));
t = 3;
};
};
i++;
};
var sx1:b2Vec2 = new b2Vec2();
var sx2:b2Vec2 = new b2Vec2();
var point:b2Point = gPoint;
point.p.SetV(vx0);
var anotherDistance:Number = DistanceGeneric(sx1, sx2, polygon, xf1, point, b2Math.b2XForm_identity);
if (anotherDistance < separation){
t = 4;
separation = anotherDistance;
x1.SetV(sx1);
x2.SetV(sx2);
};
point.p.SetV(vx1);
anotherDistance = DistanceGeneric(sx1, sx2, polygon, xf1, point, b2Math.b2XForm_identity);
if (anotherDistance < separation){
t = 5;
separation = anotherDistance;
x1.SetV(sx1);
x2.SetV(sx2);
};
return (separation);
}
public static function DistanceCC(x1:b2Vec2, x2:b2Vec2, circle1:b2CircleShape, xf1:b2XForm, circle2:b2CircleShape, xf2:b2XForm):Number{
var tMat:b2Mat22;
var tVec:b2Vec2;
var dLen:Number;
var distance:Number;
tMat = xf1.R;
tVec = circle1.m_localPosition;
var p1X:Number = (xf1.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var p1Y:Number = (xf1.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
tMat = xf2.R;
tVec = circle2.m_localPosition;
var p2X:Number = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
var p2Y:Number = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
var dX:Number = (p2X - p1X);
var dY:Number = (p2Y - p1Y);
var dSqr:Number = ((dX * dX) + (dY * dY));
var r1:Number = (circle1.m_radius - b2Settings.b2_toiSlop);
var r2:Number = (circle2.m_radius - b2Settings.b2_toiSlop);
var r:Number = (r1 + r2);
if (dSqr > (r * r)){
dLen = Math.sqrt(dSqr);
dX = (dX / dLen);
dY = (dY / dLen);
distance = (dLen - r);
x1.x = (p1X + (r1 * dX));
x1.y = (p1Y + (r1 * dY));
x2.x = (p2X - (r2 * dX));
x2.y = (p2Y - (r2 * dY));
return (distance);
};
if (dSqr > (Number.MIN_VALUE * Number.MIN_VALUE)){
dLen = Math.sqrt(dSqr);
dX = (dX / dLen);
dY = (dY / dLen);
x1.x = (p1X + (r1 * dX));
x1.y = (p1Y + (r1 * dY));
x2.x = x1.x;
x2.y = x1.y;
return (0);
};
x1.x = p1X;
x1.y = p1Y;
x2.x = x1.x;
x2.y = x1.y;
return (0);
}
public static function ProcessTwo(x1:b2Vec2, x2:b2Vec2, p1s:Array, p2s:Array, points:Array):int{
var p2s_0:b2Vec2;
var lambda:Number;
var points_0:b2Vec2 = points[0];
var points_1:b2Vec2 = points[1];
var p1s_0:b2Vec2 = p1s[0];
var p1s_1:b2Vec2 = p1s[1];
p2s_0 = p2s[0];
var p2s_1:b2Vec2 = p2s[1];
var rX:Number = -(points_1.x);
var rY:Number = -(points_1.y);
var dX:Number = (points_0.x - points_1.x);
var dY:Number = (points_0.y - points_1.y);
var length:Number = Math.sqrt(((dX * dX) + (dY * dY)));
dX = (dX / length);
dY = (dY / length);
lambda = ((rX * dX) + (rY * dY));
if ((((lambda <= 0)) || ((length < Number.MIN_VALUE)))){
x1.SetV(p1s_1);
x2.SetV(p2s_1);
p1s_0.SetV(p1s_1);
p2s_0.SetV(p2s_1);
points_0.SetV(points_1);
return (1);
};
lambda = (lambda / length);
x1.x = (p1s_1.x + (lambda * (p1s_0.x - p1s_1.x)));
x1.y = (p1s_1.y + (lambda * (p1s_0.y - p1s_1.y)));
x2.x = (p2s_1.x + (lambda * (p2s_0.x - p2s_1.x)));
x2.y = (p2s_1.y + (lambda * (p2s_0.y - p2s_1.y)));
return (2);
}
}
}//package Box2D.Collision
Section 24
//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(){
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
var i:int;
while (i < b2Settings.b2_maxManifoldPoints) {
points[i] = new b2ManifoldPoint();
i++;
};
normal = new b2Vec2();
}
public function Set(m:b2Manifold):void{
pointCount = m.pointCount;
var i:int;
while (i < b2Settings.b2_maxManifoldPoints) {
(points[i] as b2ManifoldPoint).Set(m.points[i]);
i++;
};
normal.SetV(m.normal);
}
public function Reset():void{
var i:int;
while (i < b2Settings.b2_maxManifoldPoints) {
(points[i] as b2ManifoldPoint).Reset();
i++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 25
//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(m:b2ManifoldPoint):void{
localPoint1.SetV(m.localPoint1);
localPoint2.SetV(m.localPoint2);
separation = m.separation;
normalImpulse = m.normalImpulse;
tangentImpulse = m.tangentImpulse;
id.key = m.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 26
//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 27
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var proxyId1:uint;
public var userData;// = null
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = b2Settings.USHRT_MAX;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = b2Settings.USHRT_MAX;
public static var b2_tableCapacity:int = b2Settings.b2_maxPairs;
public function b2Pair(){
super();
}
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 28
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function b2PairCallback(){
super();
}
public function PairRemoved(proxyUserData1, proxyUserData2, pairUserData):void{
}
public function PairAdded(proxyUserData1, proxyUserData2){
return (null);
}
}
}//package Box2D.Collision
Section 29
//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 i:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
i = 0;
while (i < b2Pair.b2_tableCapacity) {
m_hashTable[i] = b2Pair.b2_nullPair;
i++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
i = 0;
while (i < b2Settings.b2_maxPairs) {
m_pairs[i] = new b2Pair();
i++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
i = 0;
while (i < b2Settings.b2_maxPairs) {
m_pairBuffer[i] = new b2BufferedPair();
i++;
};
i = 0;
while (i < b2Settings.b2_maxPairs) {
m_pairs[i].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[i].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[i].userData = null;
m_pairs[i].status = 0;
m_pairs[i].next = (i + 1);
i++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(proxyId1:uint, proxyId2:uint, hash:uint):b2Pair{
var pair:b2Pair;
var index:uint = m_hashTable[hash];
pair = m_pairs[index];
while (((!((index == b2Pair.b2_nullPair))) && ((Equals(pair, proxyId1, proxyId2) == false)))) {
index = pair.next;
pair = m_pairs[index];
};
if (index == b2Pair.b2_nullPair){
return (null);
};
return (pair);
}
private function Find(proxyId1:uint, proxyId2:uint):b2Pair{
var temp:uint;
if (proxyId1 > proxyId2){
temp = proxyId1;
proxyId1 = proxyId2;
proxyId2 = temp;
};
var hash:uint = (Hash(proxyId1, proxyId2) & b2Pair.b2_tableMask);
return (FindHash(proxyId1, proxyId2, hash));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var bufferedPair:b2BufferedPair;
var i:int;
var pair:b2Pair;
var proxy1:b2Proxy;
var proxy2:b2Proxy;
var removeCount:int;
var proxies:Array = m_broadPhase.m_proxyPool;
i = 0;
while (i < m_pairBufferCount) {
bufferedPair = m_pairBuffer[i];
pair = Find(bufferedPair.proxyId1, bufferedPair.proxyId2);
pair.ClearBuffered();
proxy1 = proxies[pair.proxyId1];
proxy2 = proxies[pair.proxyId2];
if (pair.IsRemoved()){
if (pair.IsFinal() == true){
m_callback.PairRemoved(proxy1.userData, proxy2.userData, pair.userData);
};
bufferedPair = m_pairBuffer[removeCount];
bufferedPair.proxyId1 = pair.proxyId1;
bufferedPair.proxyId2 = pair.proxyId2;
removeCount++;
} else {
if (pair.IsFinal() == false){
pair.userData = m_callback.PairAdded(proxy1.userData, proxy2.userData);
pair.SetFinal();
};
};
i++;
};
i = 0;
while (i < removeCount) {
bufferedPair = m_pairBuffer[i];
RemovePair(bufferedPair.proxyId1, bufferedPair.proxyId2);
i++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(proxyId1:int, proxyId2:int):void{
var bufferedPair:b2BufferedPair;
var pair:b2Pair = Find(proxyId1, proxyId2);
if (pair == null){
return;
};
if (pair.IsBuffered() == false){
pair.SetBuffered();
bufferedPair = m_pairBuffer[m_pairBufferCount];
bufferedPair.proxyId1 = pair.proxyId1;
bufferedPair.proxyId2 = pair.proxyId2;
m_pairBufferCount++;
};
pair.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(proxyId1:uint, proxyId2:uint){
var pair:b2Pair;
var temp:uint;
var index:uint;
var userData:*;
if (proxyId1 > proxyId2){
temp = proxyId1;
proxyId1 = proxyId2;
proxyId2 = temp;
};
var hash:uint = (Hash(proxyId1, proxyId2) & b2Pair.b2_tableMask);
var node:uint = m_hashTable[hash];
var pNode:b2Pair;
while (node != b2Pair.b2_nullPair) {
if (Equals(m_pairs[node], proxyId1, proxyId2)){
index = node;
pair = m_pairs[node];
if (pNode){
pNode.next = pair.next;
} else {
m_hashTable[hash] = pair.next;
};
pair = m_pairs[index];
userData = pair.userData;
pair.next = m_freePair;
pair.proxyId1 = b2Pair.b2_nullProxy;
pair.proxyId2 = b2Pair.b2_nullProxy;
pair.userData = null;
pair.status = 0;
m_freePair = index;
m_pairCount--;
return (userData);
} else {
pNode = m_pairs[node];
node = pNode.next;
};
};
return (null);
}
public function Initialize(broadPhase:b2BroadPhase, callback:b2PairCallback):void{
m_broadPhase = broadPhase;
m_callback = callback;
}
public function AddBufferedPair(proxyId1:int, proxyId2:int):void{
var bufferedPair:b2BufferedPair;
var pair:b2Pair = AddPair(proxyId1, proxyId2);
if (pair.IsBuffered() == false){
pair.SetBuffered();
bufferedPair = m_pairBuffer[m_pairBufferCount];
bufferedPair.proxyId1 = pair.proxyId1;
bufferedPair.proxyId2 = pair.proxyId2;
m_pairBufferCount++;
};
pair.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(proxyId1:uint, proxyId2:uint):b2Pair{
var temp:uint;
if (proxyId1 > proxyId2){
temp = proxyId1;
proxyId1 = proxyId2;
proxyId2 = temp;
};
var hash:uint = (Hash(proxyId1, proxyId2) & b2Pair.b2_tableMask);
var pair = FindHash(proxyId1, proxyId2, hash);
if (pair != null){
return (pair);
};
var pIndex:uint = m_freePair;
pair = m_pairs[pIndex];
m_freePair = pair.next;
pair.proxyId1 = proxyId1;
pair.proxyId2 = proxyId2;
pair.status = 0;
pair.userData = null;
pair.next = m_hashTable[hash];
m_hashTable[hash] = pIndex;
m_pairCount++;
return (pair);
}
private function ValidateTable():void{
}
public static function EqualsPair(pair1:b2BufferedPair, pair2:b2BufferedPair):Boolean{
return ((((pair1.proxyId1 == pair2.proxyId1)) && ((pair1.proxyId2 == pair2.proxyId2))));
}
public static function Hash(proxyId1:uint, proxyId2:uint):uint{
var key:uint = (((proxyId2 << 16) & 4294901760) | proxyId1);
key = (~(key) + ((key << 15) & 4294934528));
key = (key ^ ((key >> 12) & 1048575));
key = (key + ((key << 2) & 4294967292));
key = (key ^ ((key >> 4) & 268435455));
key = (key * 2057);
key = (key ^ ((key >> 16) & 0xFFFF));
return (key);
}
public static function Equals(pair:b2Pair, proxyId1:uint, proxyId2:uint):Boolean{
return ((((pair.proxyId1 == proxyId1)) && ((pair.proxyId2 == proxyId2))));
}
}
}//package Box2D.Collision
Section 30
//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(xf:b2XForm):b2Vec2{
return (p);
}
public function Support(xf:b2XForm, vX:Number, vY:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 31
//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(next:uint):void{
lowerBounds[0] = (next & 0xFFFF);
}
}
}//package Box2D.Collision
Section 32
//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(lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean{
var bX:Number;
var bY:Number;
var a:Number;
var mu2:Number;
var nLen:Number;
var s:b2Vec2 = segment.p1;
var rX:Number = (segment.p2.x - s.x);
var rY:Number = (segment.p2.y - s.y);
var dX:Number = (p2.x - p1.x);
var dY:Number = (p2.y - p1.y);
var nX:Number = dY;
var nY:Number = -(dX);
var k_slop:Number = (100 * Number.MIN_VALUE);
var denom:Number = -(((rX * nX) + (rY * nY)));
if (denom > k_slop){
bX = (s.x - p1.x);
bY = (s.y - p1.y);
a = ((bX * nX) + (bY * nY));
if ((((0 <= a)) && ((a <= (maxLambda * denom))))){
mu2 = ((-(rX) * bY) + (rY * bX));
if (((((-(k_slop) * denom) <= mu2)) && ((mu2 <= (denom * (1 + k_slop)))))){
a = (a / denom);
nLen = Math.sqrt(((nX * nX) + (nY * nY)));
nX = (nX / nLen);
nY = (nY / nLen);
lambda[0] = a;
normal.Set(nX, nY);
return (true);
};
};
};
return (false);
}
}
}//package Box2D.Collision
Section 33
//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 function b2TimeOfImpact(){
super();
}
public static function TimeOfImpact(shape1:b2Shape, sweep1:b2Sweep, shape2:b2Shape, sweep2:b2Sweep):Number{
var math1:Number;
var math2:Number;
var t:Number;
var xf1:b2XForm;
var xf2:b2XForm;
var nLen:Number;
var approachVelocityBound:Number;
var dAlpha:Number;
var newAlpha:Number;
var r1:Number = shape1.m_sweepRadius;
var r2:Number = shape2.m_sweepRadius;
var t0:Number = sweep1.t0;
var v1X:Number = (sweep1.c.x - sweep1.c0.x);
var v1Y:Number = (sweep1.c.y - sweep1.c0.y);
var v2X:Number = (sweep2.c.x - sweep2.c0.x);
var v2Y:Number = (sweep2.c.y - sweep2.c0.y);
var omega1:Number = (sweep1.a - sweep1.a0);
var omega2:Number = (sweep2.a - sweep2.a0);
var alpha:Number = 0;
var p1:b2Vec2 = s_p1;
var p2:b2Vec2 = s_p2;
var k_maxIterations = 20;
var iter:int;
var normalX:Number = 0;
var normalY:Number = 0;
var distance:Number = 0;
var targetDistance:Number = 0;
while (true) {
t = (((1 - alpha) * t0) + alpha);
xf1 = s_xf1;
xf2 = s_xf2;
sweep1.GetXForm(xf1, t);
sweep2.GetXForm(xf2, t);
distance = b2Distance.Distance(p1, p2, shape1, xf1, shape2, xf2);
if (iter == 0){
if (distance > (2 * b2Settings.b2_toiSlop)){
targetDistance = (1.5 * b2Settings.b2_toiSlop);
} else {
math1 = (0.05 * b2Settings.b2_toiSlop);
math2 = (distance - (0.5 * b2Settings.b2_toiSlop));
targetDistance = ((math1 > math2)) ? math1 : math2;
};
};
if (((((distance - targetDistance) < (0.05 * b2Settings.b2_toiSlop))) || ((iter == k_maxIterations)))){
break;
};
normalX = (p2.x - p1.x);
normalY = (p2.y - p1.y);
nLen = Math.sqrt(((normalX * normalX) + (normalY * normalY)));
normalX = (normalX / nLen);
normalY = (normalY / nLen);
approachVelocityBound = ((((normalX * (v1X - v2X)) + (normalY * (v1Y - v2Y))) + (((omega1 < 0)) ? -(omega1) : omega1 * r1)) + (((omega2 < 0)) ? -(omega2) : omega2 * r2));
if (approachVelocityBound == 0){
alpha = 1;
break;
};
dAlpha = ((distance - targetDistance) / approachVelocityBound);
newAlpha = (alpha + dAlpha);
if ((((newAlpha < 0)) || ((1 < newAlpha)))){
alpha = 1;
break;
};
if (newAlpha < ((1 + (100 * Number.MIN_VALUE)) * alpha)){
break;
};
alpha = newAlpha;
iter++;
};
return (alpha);
}
}
}//package Box2D.Collision
Section 34
//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 35
//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 Features(){
super();
}
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(value:int):void{
_incidentVertex = value;
_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(value:int):void{
_referenceEdge = value;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set flip(value:int):void{
_flip = value;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function set incidentEdge(value:int):void{
_incidentEdge = value;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 36
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(angle:Number=0, c1:b2Vec2=null, c2:b2Vec2=null){
var c:Number;
var s:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((c1 == null))) && (!((c2 == null))))){
col1.SetV(c1);
col2.SetV(c2);
} else {
c = Math.cos(angle);
s = Math.sin(angle);
col1.x = c;
col2.x = -(s);
col1.y = s;
col2.y = c;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function SetVV(c1:b2Vec2, c2:b2Vec2):void{
col1.SetV(c1);
col2.SetV(c2);
}
public function Set(angle:Number):void{
var c:Number;
c = Math.cos(angle);
var s:Number = Math.sin(angle);
col1.x = c;
col2.x = -(s);
col1.y = s;
col2.y = c;
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(m:b2Mat22):void{
col1.SetV(m.col1);
col2.SetV(m.col2);
}
public function AddM(m:b2Mat22):void{
col1.x = (col1.x + m.col1.x);
col1.y = (col1.y + m.col1.y);
col2.x = (col2.x + m.col2.x);
col2.y = (col2.y + m.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(out:b2Mat22):b2Mat22{
var a:Number;
var c:Number;
var det:Number;
a = col1.x;
var b:Number = col2.x;
c = col1.y;
var d:Number = col2.y;
det = ((a * d) - (b * c));
det = (1 / det);
out.col1.x = (det * d);
out.col2.x = (-(det) * b);
out.col1.y = (-(det) * c);
out.col2.y = (det * a);
return (out);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(out:b2Vec2, bX:Number, bY:Number):b2Vec2{
var a11:Number = col1.x;
var a12:Number = col2.x;
var a21:Number = col1.y;
var a22:Number = col2.y;
var det:Number = ((a11 * a22) - (a12 * a21));
det = (1 / det);
out.x = (det * ((a22 * bX) - (a12 * bY)));
out.y = (det * ((a11 * bY) - (a21 * bX)));
return (out);
}
}
}//package Box2D.Common.Math
Section 37
//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 function b2Math(){
super();
}
public static function b2CrossVF(a:b2Vec2, s:Number):b2Vec2{
var v:b2Vec2 = new b2Vec2((s * a.y), (-(s) * a.x));
return (v);
}
public static function AddVV(a:b2Vec2, b:b2Vec2):b2Vec2{
var v:b2Vec2 = new b2Vec2((a.x + b.x), (a.y + b.y));
return (v);
}
public static function b2IsValid(x:Number):Boolean{
return (isFinite(x));
}
public static function b2MinV(a:b2Vec2, b:b2Vec2):b2Vec2{
var c:b2Vec2 = new b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y));
return (c);
}
public static function b2MulX(T:b2XForm, v:b2Vec2):b2Vec2{
var a:b2Vec2;
a = b2MulMV(T.R, v);
a.x = (a.x + T.position.x);
a.y = (a.y + T.position.y);
return (a);
}
public static function b2DistanceSquared(a:b2Vec2, b:b2Vec2):Number{
var cX:Number = (a.x - b.x);
var cY:Number = (a.y - b.y);
return (((cX * cX) + (cY * cY)));
}
public static function b2Swap(a:Array, b:Array):void{
var tmp:* = a[0];
a[0] = b[0];
b[0] = tmp;
}
public static function b2AbsM(A:b2Mat22):b2Mat22{
var B:b2Mat22 = new b2Mat22(0, b2AbsV(A.col1), b2AbsV(A.col2));
return (B);
}
public static function SubtractVV(a:b2Vec2, b:b2Vec2):b2Vec2{
var v:b2Vec2 = new b2Vec2((a.x - b.x), (a.y - b.y));
return (v);
}
public static function b2MulXT(T:b2XForm, v:b2Vec2):b2Vec2{
var a:b2Vec2;
var tX:Number;
a = SubtractVV(v, T.position);
tX = ((a.x * T.R.col1.x) + (a.y * T.R.col1.y));
a.y = ((a.x * T.R.col2.x) + (a.y * T.R.col2.y));
a.x = tX;
return (a);
}
public static function b2Abs(a:Number):Number{
return (((a > 0)) ? a : -(a));
}
public static function b2Clamp(a:Number, low:Number, high:Number):Number{
return (b2Max(low, b2Min(a, high)));
}
public static function b2AbsV(a:b2Vec2):b2Vec2{
var b:b2Vec2 = new b2Vec2(b2Abs(a.x), b2Abs(a.y));
return (b);
}
public static function MulFV(s:Number, a:b2Vec2):b2Vec2{
var v:b2Vec2 = new b2Vec2((s * a.x), (s * a.y));
return (v);
}
public static function b2CrossVV(a:b2Vec2, b:b2Vec2):Number{
return (((a.x * b.y) - (a.y * b.x)));
}
public static function b2Dot(a:b2Vec2, b:b2Vec2):Number{
return (((a.x * b.x) + (a.y * b.y)));
}
public static function b2CrossFV(s:Number, a:b2Vec2):b2Vec2{
var v:b2Vec2 = new b2Vec2((-(s) * a.y), (s * a.x));
return (v);
}
public static function AddMM(A:b2Mat22, B:b2Mat22):b2Mat22{
var C:b2Mat22 = new b2Mat22(0, AddVV(A.col1, B.col1), AddVV(A.col2, B.col2));
return (C);
}
public static function b2Distance(a:b2Vec2, b:b2Vec2):Number{
var cX:Number = (a.x - b.x);
var cY:Number = (a.y - b.y);
return (Math.sqrt(((cX * cX) + (cY * cY))));
}
public static function b2MulTMM(A:b2Mat22, B:b2Mat22):b2Mat22{
var c1:b2Vec2 = new b2Vec2(b2Dot(A.col1, B.col1), b2Dot(A.col2, B.col1));
var c2:b2Vec2 = new b2Vec2(b2Dot(A.col1, B.col2), b2Dot(A.col2, B.col2));
var C:b2Mat22 = new b2Mat22(0, c1, c2);
return (C);
}
public static function b2MaxV(a:b2Vec2, b:b2Vec2):b2Vec2{
var c:b2Vec2 = new b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y));
return (c);
}
public static function b2IsPowerOfTwo(x:uint):Boolean{
var result:Boolean = (((x > 0)) && (((x & (x - 1)) == 0)));
return (result);
}
public static function b2ClampV(a:b2Vec2, low:b2Vec2, high:b2Vec2):b2Vec2{
return (b2MaxV(low, b2MinV(a, high)));
}
public static function b2RandomRange(lo:Number, hi:Number):Number{
var r:Number = Math.random();
r = (((hi - lo) * r) + lo);
return (r);
}
public static function b2MulTMV(A:b2Mat22, v:b2Vec2):b2Vec2{
var u:b2Vec2 = new b2Vec2(b2Dot(v, A.col1), b2Dot(v, A.col2));
return (u);
}
public static function b2Min(a:Number, b:Number):Number{
return (((a < b)) ? a : b);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(A:b2Mat22, B:b2Mat22):b2Mat22{
var C:b2Mat22 = new b2Mat22(0, b2MulMV(A, B.col1), b2MulMV(A, B.col2));
return (C);
}
public static function b2NextPowerOfTwo(x:uint):uint{
x = (x | ((x >> 1) & 2147483647));
x = (x | ((x >> 2) & 1073741823));
x = (x | ((x >> 4) & 268435455));
x = (x | ((x >> 8) & 0xFFFFFF));
x = (x | ((x >> 16) & 0xFFFF));
return ((x + 1));
}
public static function b2Max(a:Number, b:Number):Number{
return (((a > b)) ? a : b);
}
public static function b2MulMV(A:b2Mat22, v:b2Vec2):b2Vec2{
var u:b2Vec2 = new b2Vec2(((A.col1.x * v.x) + (A.col2.x * v.y)), ((A.col1.y * v.x) + (A.col2.y * v.y)));
return (u);
}
}
}//package Box2D.Common.Math
Section 38
//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(t:Number):void{
var alpha:Number;
if ((((t0 < t)) && (((1 - t0) > Number.MIN_VALUE)))){
alpha = ((t - t0) / (1 - t0));
c0.x = (((1 - alpha) * c0.x) + (alpha * c.x));
c0.y = (((1 - alpha) * c0.y) + (alpha * c.y));
a0 = (((1 - alpha) * a0) + (alpha * a));
t0 = t;
};
}
public function GetXForm(xf:b2XForm, t:Number):void{
var alpha:Number;
var angle:Number;
if ((1 - t0) > Number.MIN_VALUE){
alpha = ((t - t0) / (1 - t0));
xf.position.x = (((1 - alpha) * c0.x) + (alpha * c.x));
xf.position.y = (((1 - alpha) * c0.y) + (alpha * c.y));
angle = (((1 - alpha) * a0) + (alpha * a));
xf.R.Set(angle);
} else {
xf.position.SetV(c);
xf.R.Set(a);
};
var tMat:b2Mat22 = xf.R;
xf.position.x = (xf.position.x - ((tMat.col1.x * localCenter.x) + (tMat.col2.x * localCenter.y)));
xf.position.y = (xf.position.y - ((tMat.col1.y * localCenter.x) + (tMat.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 39
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var y:Number;
public var x:Number;
public function b2Vec2(x_:Number=0, y_:Number=0):void{
super();
x = x_;
y = y_;
}
public function Add(v:b2Vec2):void{
x = (x + v.x);
y = (y + v.y);
}
public function Set(x_:Number=0, y_:Number=0):void{
x = x_;
y = y_;
}
public function Multiply(a:Number):void{
x = (x * a);
y = (y * a);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function MulM(A:b2Mat22):void{
var tX:Number = x;
x = ((A.col1.x * tX) + (A.col2.x * y));
y = ((A.col1.y * tX) + (A.col2.y * y));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function MinV(b:b2Vec2):void{
x = ((x < b.x)) ? x : b.x;
y = ((y < b.y)) ? y : b.y;
}
public function Normalize():Number{
var length:Number = Math.sqrt(((x * x) + (y * y)));
if (length < Number.MIN_VALUE){
return (0);
};
var invLength:Number = (1 / length);
x = (x * invLength);
y = (y * invLength);
return (length);
}
public function CrossVF(s:Number):void{
var tX:Number = x;
x = (s * y);
y = (-(s) * tX);
}
public function MaxV(b:b2Vec2):void{
x = ((x > b.x)) ? x : b.x;
y = ((y > b.y)) ? y : b.y;
}
public function SetV(v:b2Vec2):void{
x = v.x;
y = v.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossFV(s:Number):void{
var tX:Number = x;
x = (-(s) * y);
y = (s * tX);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Subtract(v:b2Vec2):void{
x = (x - v.x);
y = (y - v.y);
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(A:b2Mat22):void{
var tX:Number = b2Math.b2Dot(this, A.col1);
y = b2Math.b2Dot(this, A.col2);
x = tX;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public static function Make(x_:Number, y_:Number):b2Vec2{
return (new b2Vec2(x_, y_));
}
}
}//package Box2D.Common.Math
Section 40
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var position:b2Vec2;
public var R:b2Mat22;
public function b2XForm(pos:b2Vec2=null, r:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (pos){
position.SetV(pos);
R.SetM(r);
};
}
public function Initialize(pos:b2Vec2, r:b2Mat22):void{
position.SetV(pos);
R.SetM(r);
}
public function Set(x:b2XForm):void{
position.SetV(x.position);
R.SetM(x.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 41
//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(rr:Number, gg:Number, bb:Number){
super();
_r = uint((0xFF * b2Math.b2Clamp(rr, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(gg, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(bb, 0, 1)));
}
public function Set(rr:Number, gg:Number, bb:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(rr, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(gg, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(bb, 0, 1)));
}
public function set b(bb:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(bb, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(rr:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(rr, 0, 1)));
}
public function set g(gg:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(gg, 0, 1)));
}
}
}//package Box2D.Common
Section 42
//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 function b2Settings(){
super();
}
public static function b2Assert(a:Boolean):void{
var nullVec:b2Vec2;
if (!a){
nullVec.x++;
};
}
}
}//package Box2D.Common
Section 43
//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(shape1:b2Shape, shape2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(shape1, shape2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var point:b2ManifoldPoint = m_manifold.points[0];
point.normalImpulse = 0;
point.tangentImpulse = 0;
}
override public function Evaluate(listener:b2ContactListener):void{
var v1:b2Vec2;
var v2:b2Vec2;
var mp0:b2ManifoldPoint;
var mp:b2ManifoldPoint;
var b1:b2Body = m_shape1.m_body;
var b2:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), b1.m_xf, (m_shape2 as b2CircleShape), b2.m_xf);
var cp:b2ContactPoint = s_evalCP;
cp.shape1 = m_shape1;
cp.shape2 = m_shape2;
cp.friction = m_friction;
cp.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
mp = m_manifold.points[0];
if (m0.pointCount == 0){
mp.normalImpulse = 0;
mp.tangentImpulse = 0;
if (listener){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = mp.id._key;
listener.Add(cp);
};
} else {
mp0 = m0.points[0];
mp.normalImpulse = mp0.normalImpulse;
mp.tangentImpulse = mp0.tangentImpulse;
if (listener){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = mp.id._key;
listener.Persist(cp);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (listener))){
mp0 = m0.points[0];
cp.position = b1.GetWorldPoint(mp0.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp0.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp0.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m0.normal);
cp.separation = mp0.separation;
cp.id.key = mp0.id._key;
listener.Remove(cp);
};
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(contact:b2Contact, allocator):void{
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
return (new b2CircleContact(shape1, shape2));
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2ConcaveArcAndCircleContact (Box2D.Dynamics.Contacts.b2ConcaveArcAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ConcaveArcAndCircleContact extends b2PolyAndCircleContact {
private static var s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ConcaveArcAndCircleContact(shape1:b2Shape, shape2:b2Shape){
super(shape1, shape2);
}
override public function Evaluate(listener:b2ContactListener):void{
var i:int;
var v1:b2Vec2;
var v2:b2Vec2;
var mp0:b2ManifoldPoint;
var mp:b2ManifoldPoint;
var found:Boolean;
var idKey:uint;
var j:int;
var b1:b2Body = m_shape1.m_body;
var b2:b2Body = m_shape2.m_body;
m0.Set(m_manifolds[0]);
m_manifoldCount = b2CollideConcaveArcAndCircle(m_manifolds, (m_shape1 as b2ConcaveArcShape), b1.m_xf, (m_shape2 as b2CircleShape), b2.m_xf);
var persisted:Array = [false, false];
var cp:b2ContactPoint = s_evalCP;
cp.shape1 = m_shape1;
cp.shape2 = m_shape2;
cp.friction = m_friction;
cp.restitution = m_restitution;
if (m_manifold.pointCount > 0){
i = 0;
while (i < m_manifold.pointCount) {
mp = m_manifold.points[i];
mp.normalImpulse = 0;
mp.tangentImpulse = 0;
found = false;
idKey = mp.id._key;
j = 0;
while (j < m0.pointCount) {
if (persisted[j] == true){
} else {
mp0 = m0.points[j];
if (mp0.id._key == idKey){
persisted[j] = true;
mp.normalImpulse = mp0.normalImpulse;
mp.tangentImpulse = mp0.tangentImpulse;
found = true;
if (listener != null){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Persist(cp);
};
break;
};
};
j++;
};
if ((((found == false)) && (!((listener == null))))){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Add(cp);
};
i++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (listener == null){
return;
};
i = 0;
while (i < m0.pointCount) {
if (persisted[i]){
} else {
mp0 = m0.points[i];
cp.position = b1.GetWorldPoint(mp0.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp0.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp0.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m0.normal);
cp.separation = mp0.separation;
cp.id.key = mp0.id._key;
listener.Remove(cp);
};
i++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(contact:b2Contact, allocator):void{
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
return (new b2ConcaveArcAndCircleContact(shape1, shape2));
}
public static function b2CollideConcaveArcAndCircle(manifolds:Array, polygon:b2ConcaveArcShape, xf1:b2XForm, circle:b2CircleShape, xf2:b2XForm):Number{
var b2_nullFeature:uint;
var manifold:b2Manifold;
var tPoint:b2ManifoldPoint;
var dX:Number;
var dY:Number;
var tVec:b2Vec2;
var tMat:b2Mat22;
var positionX:Number;
var positionY:Number;
var cX:Number;
var cY:Number;
var dist:Number;
var pX:Number;
var pY:Number;
var s:Number;
var c2X:Number;
var c2Y:Number;
var c2:Number;
var d2:Number;
var d:Number;
var norm:Number;
var u:Number;
var conservative:Boolean;
b2_nullFeature = b2Collision.b2_nullFeature;
manifold = manifolds[0];
var manifoldCount:Number = 0;
manifold.pointCount = 0;
tMat = xf2.R;
tVec = circle.m_localPosition;
cX = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
cY = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
dX = (cX - xf1.position.x);
dY = (cY - xf1.position.y);
tMat = xf1.R;
var cLocalX:Number = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
var cLocalY:Number = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
var normalIndex:int;
var separation:Number = -(Number.MAX_VALUE);
var radius:Number = circle.m_radius;
var i = 1;
while (i < polygon.m_vertexCount) {
dX = (cLocalX - polygon.m_vertices[i].x);
dY = (cLocalY - polygon.m_vertices[i].y);
s = ((polygon.m_normals[i].x * dX) + (polygon.m_normals[i].y * dY));
if (s > radius){
manifoldCount = 0;
return (manifoldCount);
};
if (s > separation){
separation = s;
normalIndex = i;
};
i++;
};
if (((((true) || ((normalIndex == 1)))) || ((normalIndex == (polygon.m_vertexCount - 1))))){
s = ((polygon.m_normals[0].x * (cLocalX - polygon.m_vertices[0].x)) + (polygon.m_normals[0].y * (cLocalY - polygon.m_vertices[0].y)));
c2X = (cLocalX - polygon.m_arcCenter.x);
c2Y = (cLocalY - polygon.m_arcCenter.y);
c2 = Math.sqrt(((c2X * c2X) + (c2Y * c2Y)));
c2X = (c2X / c2);
c2Y = (c2Y / c2);
s = Math.max(s, (polygon.m_radius - c2));
if (s > radius){
manifoldCount = 0;
return (manifoldCount);
};
if (s > separation){
separation = s;
normalIndex = 0;
};
};
if ((((normalIndex == 0)) && ((radius >= polygon.m_radius)))){
if (manifolds.length < 2){
manifolds[1] = new b2Manifold();
manifolds[1].pointCount = 0;
manifolds[1].points[0].normalImpulse = 0;
manifolds[1].points[0].tangentImpulse = 0;
};
manifoldCount = 0;
i = 0;
while (i < 2) {
dX = (polygon.m_vertices[i].x - cLocalX);
dY = (polygon.m_vertices[i].y - cLocalY);
d2 = ((dX * dX) + (dY * dY));
if (d2 < (radius * radius)){
d = Math.sqrt(d2);
manifolds[manifoldCount].pointCount = 1;
tPoint = manifolds[manifoldCount].points[0];
tPoint.id.features.incidentEdge = b2_nullFeature;
tPoint.id.features.incidentVertex = i;
tPoint.id.features.referenceEdge = b2_nullFeature;
tPoint.id.features.flip = 0;
tPoint.separation = (d - radius);
tPoint.normalImpulse = 0;
tPoint.tangentImpulse = 0;
dX = (-(dX) / d);
dY = (-(dY) / d);
manifolds[manifoldCount].normal.x = ((tMat.col1.x * dX) + (tMat.col2.x * dY));
manifolds[manifoldCount].normal.y = ((tMat.col1.y * dX) + (tMat.col2.y * dY));
positionX = (cX - (radius * manifolds[manifoldCount].normal.x));
positionY = (cY - (radius * manifolds[manifoldCount].normal.y));
dX = (positionX - xf1.position.x);
dY = (positionY - xf1.position.y);
tMat = xf1.R;
tPoint.localPoint1.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint1.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = (positionX - xf2.position.x);
dY = (positionY - xf2.position.y);
tMat = xf2.R;
tPoint.localPoint2.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint2.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
manifoldCount++;
};
i++;
};
return (manifoldCount);
};
if (separation < Number.MIN_VALUE){
manifold.pointCount = 1;
manifoldCount = 1;
if (normalIndex == 0){
tMat = xf1.R;
manifold.normal.x = -(((tMat.col1.x * c2X) + (tMat.col2.x * c2Y)));
manifold.normal.y = -(((tMat.col1.y * c2X) + (tMat.col2.y * c2Y)));
} else {
tVec = polygon.m_normals[normalIndex];
tMat = xf1.R;
manifold.normal.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
manifold.normal.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
};
tPoint = manifold.points[0];
tPoint.id.features.incidentEdge = normalIndex;
tPoint.id.features.incidentVertex = b2_nullFeature;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
positionX = (cX - (radius * manifold.normal.x));
positionY = (cY - (radius * manifold.normal.y));
dX = (positionX - xf1.position.x);
dY = (positionY - xf1.position.y);
tMat = xf1.R;
tPoint.localPoint1.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint1.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = (positionX - xf2.position.x);
dY = (positionY - xf2.position.y);
tMat = xf2.R;
tPoint.localPoint2.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint2.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
tPoint.separation = (separation - radius);
return (manifoldCount);
};
var vertIndex1:int = normalIndex;
var vertIndex2:int = (((vertIndex1 + 1) < polygon.m_vertexCount)) ? (vertIndex1 + 1) : 0;
var eX:Number = (polygon.m_vertices[vertIndex2].x - polygon.m_vertices[vertIndex1].x);
var eY:Number = (polygon.m_vertices[vertIndex2].y - polygon.m_vertices[vertIndex1].y);
var length:Number = Math.sqrt(((eX * eX) + (eY * eY)));
eX = (eX / length);
eY = (eY / length);
if (length < Number.MIN_VALUE){
dX = (cLocalX - polygon.m_vertices[vertIndex1].x);
dY = (cLocalY - polygon.m_vertices[vertIndex1].y);
dist = Math.sqrt(((dX * dX) + (dY * dY)));
dX = (dX / dist);
dY = (dY / dist);
if (dist > radius){
manifoldCount = 0;
return (manifoldCount);
};
manifold.pointCount = 1;
manifoldCount = 1;
tMat = xf1.R;
manifold.normal.x = ((tMat.col1.x * dX) + (tMat.col2.x * dY));
manifold.normal.y = ((tMat.col1.y * dX) + (tMat.col2.y * dY));
tPoint = manifold.points[0];
tPoint.id.features.incidentEdge = b2_nullFeature;
tPoint.id.features.incidentVertex = vertIndex1;
tPoint.id.features.referenceEdge = b2_nullFeature;
tPoint.id.features.flip = 0;
positionX = (cX - (radius * manifold.normal.x));
positionY = (cY - (radius * manifold.normal.y));
dX = (positionX - xf1.position.x);
dY = (positionY - xf1.position.y);
tMat = xf1.R;
tPoint.localPoint1.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint1.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = (positionX - xf2.position.x);
dY = (positionY - xf2.position.y);
tMat = xf2.R;
tPoint.localPoint2.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint2.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
tPoint.separation = (dist - radius);
return (manifoldCount);
};
dX = (cLocalX - polygon.m_vertices[vertIndex1].x);
dY = (cLocalY - polygon.m_vertices[vertIndex1].y);
tPoint = manifold.points[0];
tPoint.id.features.incidentEdge = 0;
tPoint.id.features.incidentVertex = 0;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
if (normalIndex == 0){
norm = ((eX * c2X) + (eY * c2Y));
if (((c2X * polygon.m_normals[0].x) + (c2Y * polygon.m_normals[0].y)) > 0){
if (norm < 0){
pX = polygon.m_vertices[vertIndex1].x;
pY = polygon.m_vertices[vertIndex1].y;
tPoint.id.features.incidentVertex = vertIndex1;
tPoint.id.features.incidentEdge = b2_nullFeature;
} else {
pX = polygon.m_vertices[vertIndex2].x;
pY = polygon.m_vertices[vertIndex2].y;
tPoint.id.features.incidentVertex = vertIndex2;
tPoint.id.features.incidentEdge = b2_nullFeature;
};
} else {
if (norm <= -(polygon.m_norm)){
pX = polygon.m_vertices[vertIndex1].x;
pY = polygon.m_vertices[vertIndex1].y;
tPoint.id.features.incidentVertex = vertIndex1;
tPoint.id.features.incidentEdge = b2_nullFeature;
} else {
if (norm >= polygon.m_norm){
pX = polygon.m_vertices[vertIndex2].x;
pY = polygon.m_vertices[vertIndex2].y;
tPoint.id.features.incidentVertex = vertIndex2;
tPoint.id.features.incidentEdge = b2_nullFeature;
} else {
pX = (polygon.m_arcCenter.x + (c2X * polygon.m_radius));
pY = (polygon.m_arcCenter.y + (c2Y * polygon.m_radius));
tPoint.id.features.incidentEdge = vertIndex1;
};
};
};
} else {
u = ((dX * eX) + (dY * eY));
if (u <= 0){
pX = polygon.m_vertices[vertIndex1].x;
pY = polygon.m_vertices[vertIndex1].y;
tPoint.id.features.incidentVertex = vertIndex1;
tPoint.id.features.incidentEdge = b2_nullFeature;
} else {
if (u >= length){
pX = polygon.m_vertices[vertIndex2].x;
pY = polygon.m_vertices[vertIndex2].y;
tPoint.id.features.incidentVertex = vertIndex2;
tPoint.id.features.incidentEdge = b2_nullFeature;
} else {
pX = ((eX * u) + polygon.m_vertices[vertIndex1].x);
pY = ((eY * u) + polygon.m_vertices[vertIndex1].y);
tPoint.id.features.incidentEdge = vertIndex1;
};
};
};
dX = (cLocalX - pX);
dY = (cLocalY - pY);
dist = Math.sqrt(((dX * dX) + (dY * dY)));
dX = (dX / dist);
dY = (dY / dist);
if (dist > radius){
manifoldCount = 0;
return (manifoldCount);
};
manifold.pointCount = 1;
manifoldCount = 1;
tMat = xf1.R;
manifold.normal.x = ((tMat.col1.x * dX) + (tMat.col2.x * dY));
manifold.normal.y = ((tMat.col1.y * dX) + (tMat.col2.y * dY));
positionX = (cX - (radius * manifold.normal.x));
positionY = (cY - (radius * manifold.normal.y));
dX = (positionX - xf1.position.x);
dY = (positionY - xf1.position.y);
tMat = xf1.R;
tPoint.localPoint1.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint1.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = (positionX - xf2.position.x);
dY = (positionY - xf2.position.y);
tMat = xf2.R;
tPoint.localPoint2.x = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
tPoint.localPoint2.y = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
tPoint.separation = (dist - radius);
return (manifoldCount);
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//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(s1:b2Shape=null, s2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(s1)) || (!(s2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((s1.IsSensor()) || (s2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = s1;
m_shape2 = s2;
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(listener:b2ContactListener):void{
var oldCount:int = m_manifoldCount;
Evaluate(listener);
var newCount:int = m_manifoldCount;
var body1:b2Body = m_shape1.m_body;
var body2:b2Body = m_shape2.m_body;
if ((((newCount == 0)) && ((oldCount > 0)))){
body1.WakeUp();
body2.WakeUp();
};
if (((((((body1.IsStatic()) || (body1.IsBullet()))) || (body2.IsStatic()))) || (body2.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(listener:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var j:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
var i:int;
while (i < b2Shape.e_shapeTypeCount) {
s_registers[i] = new Array(b2Shape.e_shapeTypeCount);
j = 0;
while (j < b2Shape.e_shapeTypeCount) {
s_registers[i][j] = new b2ContactRegister();
j++;
};
i++;
};
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);
AddType(b2ConcaveArcAndCircleContact.Create, b2ConcaveArcAndCircleContact.Destroy, b2Shape.e_concaveArcShape, b2Shape.e_circleShape);
AddType(b2PolyAndConcaveArcContact.Create, b2PolyAndConcaveArcContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_concaveArcShape);
AddType(b2StaticEdgeAndCircleContact.Create, b2StaticEdgeAndCircleContact.Destroy, b2Shape.e_staticEdgeShape, b2Shape.e_circleShape);
AddType(b2PolyAndStaticEdgeContact.Create, b2PolyAndStaticEdgeContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_staticEdgeShape);
}
public static function Destroy(contact:b2Contact, allocator):void{
if (contact.m_manifoldCount > 0){
contact.m_shape1.m_body.WakeUp();
contact.m_shape2.m_body.WakeUp();
};
var type1:int = contact.m_shape1.m_type;
var type2:int = contact.m_shape2.m_type;
var reg:b2ContactRegister = s_registers[type1][type2];
var destroyFcn:Function = reg.destroyFcn;
destroyFcn(contact, allocator);
}
public static function AddType(createFcn:Function, destroyFcn:Function, type1:int, type2:int):void{
s_registers[type1][type2].createFcn = createFcn;
s_registers[type1][type2].destroyFcn = destroyFcn;
s_registers[type1][type2].primary = true;
if (type1 != type2){
s_registers[type2][type1].createFcn = createFcn;
s_registers[type2][type1].destroyFcn = destroyFcn;
s_registers[type2][type1].primary = false;
};
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
var c:b2Contact;
var i:int;
var m:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
var type1:int = shape1.m_type;
var type2:int = shape2.m_type;
var reg:b2ContactRegister = s_registers[type1][type2];
var createFcn:Function = reg.createFcn;
if (createFcn != null){
if (reg.primary){
return (createFcn(shape1, shape2, allocator));
};
c = createFcn(shape2, shape1, allocator);
i = 0;
while (i < c.m_manifoldCount) {
m = c.GetManifolds()[i];
m.normal = m.normal.Negative();
i++;
};
return (c);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//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 i:int;
while (i < b2Settings.b2_maxManifoldPoints) {
points[i] = new b2ContactConstraintPoint();
i++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 47
//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 48
//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;
public function b2ContactEdge(){
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 49
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
public function b2ContactRegister(){
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 50
//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 51
//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(step:b2TimeStep, contacts:Array, contactCount:int, allocator){
var contact:b2Contact;
var i:int;
var tVec:b2Vec2;
var tMat:b2Mat22;
var b1:b2Body;
var b2:b2Body;
var manifoldCount:int;
var manifolds:Array;
var friction:Number;
var restitution:Number;
var v1X:Number;
var v1Y:Number;
var v2X:Number;
var v2Y:Number;
var w1:Number;
var w2:Number;
var j:int;
var manifold:b2Manifold;
var normalX:Number;
var normalY:Number;
var c:b2ContactConstraint;
var k:uint;
var cp:b2ManifoldPoint;
var ccp:b2ContactConstraintPoint;
var tX:Number;
var tY:Number;
var r1X:Number;
var r1Y:Number;
var r2X:Number;
var r2Y:Number;
var r1Sqr:Number;
var r2Sqr:Number;
var rn1:Number;
var rn2:Number;
var kNormal:Number;
var kEqualized:Number;
var tangentX:Number;
var tangentY:Number;
var rt1:Number;
var rt2:Number;
var kTangent:Number;
var vRel:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = step.dt;
m_step.inv_dt = step.inv_dt;
m_step.maxIterations = step.maxIterations;
m_allocator = allocator;
m_constraintCount = 0;
i = 0;
while (i < contactCount) {
contact = contacts[i];
m_constraintCount = (m_constraintCount + contact.m_manifoldCount);
i++;
};
i = 0;
while (i < m_constraintCount) {
m_constraints[i] = new b2ContactConstraint();
i++;
};
var count:int;
i = 0;
while (i < contactCount) {
contact = contacts[i];
b1 = contact.m_shape1.m_body;
b2 = contact.m_shape2.m_body;
manifoldCount = contact.m_manifoldCount;
manifolds = contact.GetManifolds();
friction = contact.m_friction;
restitution = contact.m_restitution;
v1X = b1.m_linearVelocity.x;
v1Y = b1.m_linearVelocity.y;
v2X = b2.m_linearVelocity.x;
v2Y = b2.m_linearVelocity.y;
w1 = b1.m_angularVelocity;
w2 = b2.m_angularVelocity;
j = 0;
while (j < manifoldCount) {
manifold = manifolds[j];
normalX = manifold.normal.x;
normalY = manifold.normal.y;
c = m_constraints[count];
c.body1 = b1;
c.body2 = b2;
c.manifold = manifold;
c.normal.x = normalX;
c.normal.y = normalY;
c.pointCount = manifold.pointCount;
c.friction = friction;
c.restitution = restitution;
k = 0;
while (k < c.pointCount) {
cp = manifold.points[k];
ccp = c.points[k];
ccp.normalImpulse = cp.normalImpulse;
ccp.tangentImpulse = cp.tangentImpulse;
ccp.separation = cp.separation;
ccp.positionImpulse = 0;
ccp.localAnchor1.SetV(cp.localPoint1);
ccp.localAnchor2.SetV(cp.localPoint2);
tMat = b1.m_xf.R;
r1X = (cp.localPoint1.x - b1.m_sweep.localCenter.x);
r1Y = (cp.localPoint1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
ccp.r1.Set(r1X, r1Y);
tMat = b2.m_xf.R;
r2X = (cp.localPoint2.x - b2.m_sweep.localCenter.x);
r2Y = (cp.localPoint2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
ccp.r2.Set(r2X, r2Y);
r1Sqr = ((r1X * r1X) + (r1Y * r1Y));
r2Sqr = ((r2X * r2X) + (r2Y * r2Y));
rn1 = ((r1X * normalX) + (r1Y * normalY));
rn2 = ((r2X * normalX) + (r2Y * normalY));
kNormal = (b1.m_invMass + b2.m_invMass);
kNormal = (kNormal + ((b1.m_invI * (r1Sqr - (rn1 * rn1))) + (b2.m_invI * (r2Sqr - (rn2 * rn2)))));
ccp.normalMass = (1 / kNormal);
kEqualized = ((b1.m_mass * b1.m_invMass) + (b2.m_mass * b2.m_invMass));
kEqualized = (kEqualized + (((b1.m_mass * b1.m_invI) * (r1Sqr - (rn1 * rn1))) + ((b2.m_mass * b2.m_invI) * (r2Sqr - (rn2 * rn2)))));
ccp.equalizedMass = (1 / kEqualized);
tangentX = normalY;
tangentY = -(normalX);
rt1 = ((r1X * tangentX) + (r1Y * tangentY));
rt2 = ((r2X * tangentX) + (r2Y * tangentY));
kTangent = (b1.m_invMass + b2.m_invMass);
kTangent = (kTangent + ((b1.m_invI * (r1Sqr - (rt1 * rt1))) + (b2.m_invI * (r2Sqr - (rt2 * rt2)))));
ccp.tangentMass = (1 / kTangent);
ccp.velocityBias = 0;
if (ccp.separation > 0){
ccp.velocityBias = (-60 * ccp.separation);
};
tX = (((v2X + (-(w2) * r2Y)) - v1X) - (-(w1) * r1Y));
tY = (((v2Y + (w2 * r2X)) - v1Y) - (w1 * r1X));
vRel = ((c.normal.x * tX) + (c.normal.y * tY));
if (vRel < -(b2Settings.b2_velocityThreshold)){
ccp.velocityBias = (ccp.velocityBias + (-(c.restitution) * vRel));
};
k++;
};
count++;
j++;
};
i++;
};
}
public function InitVelocityConstraints(step:b2TimeStep):void{
var tVec:b2Vec2;
var tVec2:b2Vec2;
var tMat:b2Mat22;
var c:b2ContactConstraint;
var b1:b2Body;
var b2:b2Body;
var invMass1:Number;
var invI1:Number;
var invMass2:Number;
var invI2:Number;
var normalX:Number;
var normalY:Number;
var tangentX:Number;
var tangentY:Number;
var tX:Number;
var j:int;
var tCount:int;
var ccp:b2ContactConstraintPoint;
var PX:Number;
var PY:Number;
var ccp2:b2ContactConstraintPoint;
var i:int;
while (i < m_constraintCount) {
c = m_constraints[i];
b1 = c.body1;
b2 = c.body2;
invMass1 = b1.m_invMass;
invI1 = b1.m_invI;
invMass2 = b2.m_invMass;
invI2 = b2.m_invI;
normalX = c.normal.x;
normalY = c.normal.y;
tangentX = normalY;
tangentY = -(normalX);
if (step.warmStarting){
tCount = c.pointCount;
j = 0;
while (j < tCount) {
ccp = c.points[j];
ccp.normalImpulse = (ccp.normalImpulse * step.dtRatio);
ccp.tangentImpulse = (ccp.tangentImpulse * step.dtRatio);
PX = ((ccp.normalImpulse * normalX) + (ccp.tangentImpulse * tangentX));
PY = ((ccp.normalImpulse * normalY) + (ccp.tangentImpulse * tangentY));
b1.m_angularVelocity = (b1.m_angularVelocity - (invI1 * ((ccp.r1.x * PY) - (ccp.r1.y * PX))));
b1.m_linearVelocity.x = (b1.m_linearVelocity.x - (invMass1 * PX));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y - (invMass1 * PY));
b2.m_angularVelocity = (b2.m_angularVelocity + (invI2 * ((ccp.r2.x * PY) - (ccp.r2.y * PX))));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (invMass2 * PX));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (invMass2 * PY));
j++;
};
} else {
tCount = c.pointCount;
j = 0;
while (j < tCount) {
ccp2 = c.points[j];
ccp2.normalImpulse = 0;
ccp2.tangentImpulse = 0;
j++;
};
};
i++;
};
}
public function SolvePositionConstraints(baumgarte:Number):Boolean{
var tMat:b2Mat22;
var tVec:b2Vec2;
var c:b2ContactConstraint;
var b1:b2Body;
var b2:b2Body;
var b1_sweep_c:b2Vec2;
var b1_sweep_a:Number;
var b2_sweep_c:b2Vec2;
var b2_sweep_a:Number;
var invMass1:Number;
var invI1:Number;
var invMass2:Number;
var invI2:Number;
var normalX:Number;
var normalY:Number;
var tCount:int;
var j:int;
var ccp:b2ContactConstraintPoint;
var r1X:Number;
var r1Y:Number;
var r2X:Number;
var r2Y:Number;
var tX:Number;
var p1X:Number;
var p1Y:Number;
var p2X:Number;
var p2Y:Number;
var dpX:Number;
var dpY:Number;
var separation:Number;
var C:Number;
var dImpulse:Number;
var impulse0:Number;
var impulseX:Number;
var impulseY:Number;
var minSeparation:Number = 0;
var i:int;
while (i < m_constraintCount) {
c = m_constraints[i];
b1 = c.body1;
b2 = c.body2;
b1_sweep_c = b1.m_sweep.c;
b1_sweep_a = b1.m_sweep.a;
b2_sweep_c = b2.m_sweep.c;
b2_sweep_a = b2.m_sweep.a;
invMass1 = (b1.m_mass * b1.m_invMass);
invI1 = (b1.m_mass * b1.m_invI);
invMass2 = (b2.m_mass * b2.m_invMass);
invI2 = (b2.m_mass * b2.m_invI);
normalX = c.normal.x;
normalY = c.normal.y;
tCount = c.pointCount;
j = 0;
while (j < tCount) {
ccp = c.points[j];
tMat = b1.m_xf.R;
tVec = b1.m_sweep.localCenter;
r1X = (ccp.localAnchor1.x - tVec.x);
r1Y = (ccp.localAnchor1.y - tVec.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
tVec = b2.m_sweep.localCenter;
r2X = (ccp.localAnchor2.x - tVec.x);
r2Y = (ccp.localAnchor2.y - tVec.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
p1X = (b1_sweep_c.x + r1X);
p1Y = (b1_sweep_c.y + r1Y);
p2X = (b2_sweep_c.x + r2X);
p2Y = (b2_sweep_c.y + r2Y);
dpX = (p2X - p1X);
dpY = (p2Y - p1Y);
separation = (((dpX * normalX) + (dpY * normalY)) + ccp.separation);
minSeparation = b2Math.b2Min(minSeparation, separation);
C = (baumgarte * b2Math.b2Clamp((separation + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
dImpulse = (-(ccp.equalizedMass) * C);
impulse0 = ccp.positionImpulse;
ccp.positionImpulse = b2Math.b2Max((impulse0 + dImpulse), 0);
dImpulse = (ccp.positionImpulse - impulse0);
impulseX = (dImpulse * normalX);
impulseY = (dImpulse * normalY);
b1_sweep_c.x = (b1_sweep_c.x - (invMass1 * impulseX));
b1_sweep_c.y = (b1_sweep_c.y - (invMass1 * impulseY));
b1_sweep_a = (b1_sweep_a - (invI1 * ((r1X * impulseY) - (r1Y * impulseX))));
b1.m_sweep.a = b1_sweep_a;
b1.SynchronizeTransform();
b2_sweep_c.x = (b2_sweep_c.x + (invMass2 * impulseX));
b2_sweep_c.y = (b2_sweep_c.y + (invMass2 * impulseY));
b2_sweep_a = (b2_sweep_a + (invI2 * ((r2X * impulseY) - (r2Y * impulseX))));
b2.m_sweep.a = b2_sweep_a;
b2.SynchronizeTransform();
j++;
};
i++;
};
return ((minSeparation >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var j:int;
var ccp:b2ContactConstraintPoint;
var r1X:Number;
var r1Y:Number;
var r2X:Number;
var r2Y:Number;
var dvX:Number;
var dvY:Number;
var vn:Number;
var vt:Number;
var lambda_n:Number;
var lambda_t:Number;
var newImpulse_n:Number;
var newImpulse_t:Number;
var PX:Number;
var PY:Number;
var tMat:b2Mat22;
var tVec:b2Vec2;
var c:b2ContactConstraint;
var b1:b2Body;
var b2:b2Body;
var w1:Number;
var w2:Number;
var v1:b2Vec2;
var v2:b2Vec2;
var invMass1:Number;
var invI1:Number;
var invMass2:Number;
var invI2:Number;
var normalX:Number;
var normalY:Number;
var tangentX:Number;
var tangentY:Number;
var friction:Number;
var tX:Number;
var tCount:int;
var maxFriction:Number;
var i:int;
while (i < m_constraintCount) {
c = m_constraints[i];
b1 = c.body1;
b2 = c.body2;
w1 = b1.m_angularVelocity;
w2 = b2.m_angularVelocity;
v1 = b1.m_linearVelocity;
v2 = b2.m_linearVelocity;
invMass1 = b1.m_invMass;
invI1 = b1.m_invI;
invMass2 = b2.m_invMass;
invI2 = b2.m_invI;
normalX = c.normal.x;
normalY = c.normal.y;
tangentX = normalY;
tangentY = -(normalX);
friction = c.friction;
tCount = c.pointCount;
j = 0;
while (j < tCount) {
ccp = c.points[j];
dvX = (((v2.x + (-(w2) * ccp.r2.y)) - v1.x) - (-(w1) * ccp.r1.y));
dvY = (((v2.y + (w2 * ccp.r2.x)) - v1.y) - (w1 * ccp.r1.x));
vn = ((dvX * normalX) + (dvY * normalY));
lambda_n = (-(ccp.normalMass) * (vn - ccp.velocityBias));
vt = ((dvX * tangentX) + (dvY * tangentY));
lambda_t = (ccp.tangentMass * -(vt));
newImpulse_n = b2Math.b2Max((ccp.normalImpulse + lambda_n), 0);
lambda_n = (newImpulse_n - ccp.normalImpulse);
maxFriction = (friction * ccp.normalImpulse);
newImpulse_t = b2Math.b2Clamp((ccp.tangentImpulse + lambda_t), -(maxFriction), maxFriction);
lambda_t = (newImpulse_t - ccp.tangentImpulse);
PX = ((lambda_n * normalX) + (lambda_t * tangentX));
PY = ((lambda_n * normalY) + (lambda_t * tangentY));
v1.x = (v1.x - (invMass1 * PX));
v1.y = (v1.y - (invMass1 * PY));
w1 = (w1 - (invI1 * ((ccp.r1.x * PY) - (ccp.r1.y * PX))));
v2.x = (v2.x + (invMass2 * PX));
v2.y = (v2.y + (invMass2 * PY));
w2 = (w2 + (invI2 * ((ccp.r2.x * PY) - (ccp.r2.y * PX))));
ccp.normalImpulse = newImpulse_n;
ccp.tangentImpulse = newImpulse_t;
j++;
};
b1.m_angularVelocity = w1;
b2.m_angularVelocity = w2;
i++;
};
}
public function FinalizeVelocityConstraints():void{
var c:b2ContactConstraint;
var m:b2Manifold;
var j:int;
var point1:b2ManifoldPoint;
var point2:b2ContactConstraintPoint;
var i:int;
while (i < m_constraintCount) {
c = m_constraints[i];
m = c.manifold;
j = 0;
while (j < c.pointCount) {
point1 = m.points[j];
point2 = c.points[j];
point1.normalImpulse = point2.normalImpulse;
point1.tangentImpulse = point2.tangentImpulse;
j++;
};
i++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 52
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
public function b2NullContact(){
super();
}
override public function Evaluate(l:b2ContactListener):void{
}
override public function GetManifolds():Array{
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 53
//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 {
public var m_manifolds:Array;
public var m_manifold:b2Manifold;
public var m0:b2Manifold;
public static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(shape1:b2Shape, shape2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(shape1, shape2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
var point:b2ManifoldPoint = m_manifold.points[0];
point.normalImpulse = 0;
point.tangentImpulse = 0;
}
override public function Evaluate(listener:b2ContactListener):void{
var i:int;
var v1:b2Vec2;
var v2:b2Vec2;
var mp0:b2ManifoldPoint;
var mp:b2ManifoldPoint;
var found:Boolean;
var idKey:uint;
var j:int;
var b1:b2Body = m_shape1.m_body;
var b2:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), b1.m_xf, (m_shape2 as b2CircleShape), b2.m_xf);
var persisted:Array = [false, false];
var cp:b2ContactPoint = s_evalCP;
cp.shape1 = m_shape1;
cp.shape2 = m_shape2;
cp.friction = m_friction;
cp.restitution = m_restitution;
if (m_manifold.pointCount > 0){
i = 0;
while (i < m_manifold.pointCount) {
mp = m_manifold.points[i];
mp.normalImpulse = 0;
mp.tangentImpulse = 0;
found = false;
idKey = mp.id._key;
j = 0;
while (j < m0.pointCount) {
if (persisted[j] == true){
} else {
mp0 = m0.points[j];
if (mp0.id._key == idKey){
persisted[j] = true;
mp.normalImpulse = mp0.normalImpulse;
mp.tangentImpulse = mp0.tangentImpulse;
found = true;
if (listener != null){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Persist(cp);
};
break;
};
};
j++;
};
if ((((found == false)) && (!((listener == null))))){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Add(cp);
};
i++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (listener == null){
return;
};
i = 0;
while (i < m0.pointCount) {
if (persisted[i]){
} else {
mp0 = m0.points[i];
cp.position = b1.GetWorldPoint(mp0.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp0.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp0.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m0.normal);
cp.separation = mp0.separation;
cp.id.key = mp0.id._key;
listener.Remove(cp);
};
i++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(contact:b2Contact, allocator):void{
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
return (new b2PolyAndCircleContact(shape1, shape2));
}
}
}//package Box2D.Dynamics.Contacts
Section 54
//b2PolyAndConcaveArcContact (Box2D.Dynamics.Contacts.b2PolyAndConcaveArcContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndConcaveArcContact extends b2PolygonContact {
private var m_arcManifolds:Array;
private var m_arcColl:Boolean;
public function b2PolyAndConcaveArcContact(shape1:b2Shape, shape2:b2Shape):void{
m_arcManifolds = [];
super(shape1, shape2);
}
private function enlargeManifolds(l:Number):void{
var tMani:b2Manifold;
while (m_arcManifolds.length < l) {
tMani = new b2Manifold();
tMani.pointCount = 0;
tMani.points[0].normalImpulse = 0;
tMani.points[0].tangentImpulse = 0;
m_arcManifolds.push(tMani);
};
}
override public function Evaluate(listener:b2ContactListener):void{
var b1:b2Body;
var b2:b2Body;
var i:int;
var j:int;
var tMani:b2Manifold;
var cp:b2ManifoldPoint;
var cp0:b2ManifoldPoint;
var singleKey:Number;
var poly:b2PolygonShape;
var arc:b2ConcaveArcShape;
var localCenter:b2Vec2;
var local0:b2Vec2;
var bool1:Boolean;
var tVec:b2Vec2;
var topVx:b2Vec2;
var d2:Number;
var d:Number;
var s1:Number;
var s2:Number;
var l:Number;
var direction:Number;
var currVx:Number;
var startVx:Number;
var maxS:Number;
var maxEdge:Number;
var local:b2Vec2;
var s:Number;
var arcNormal1:b2Vec2;
var arcNormal2:b2Vec2;
var polyVx:b2Vec2;
var polyNormal:b2Vec2;
var v2x:Number;
var v2y:Number;
var polyVx2:b2Vec2;
var dot1:Number;
var dot2:Number;
var tangent:b2Vec2;
var t1:Number;
var t2:Number;
var t3:Number;
var t4:Number;
var tPoint:b2ManifoldPoint;
var tMat:*;
b1 = m_shape1.m_body;
b2 = m_shape2.m_body;
var b2_nullFeature:uint = b2Collision.b2_nullFeature;
var impulses:Array = [];
if (!m_arcColl){
i = 0;
while (i < m_manifoldCount) {
j = 0;
while (j < m_manifolds[i].pointCount) {
cp0 = m_manifolds[i].points[j];
cp = new b2ManifoldPoint();
impulses[cp0.id.key] = cp;
cp.normalImpulse = cp0.normalImpulse;
cp.tangentImpulse = cp0.tangentImpulse;
j++;
};
i++;
};
if ((((m_manifoldCount == 1)) && ((m_manifolds[0].pointCount == 1)))){
singleKey = m_manifolds[0].points[0].id.key;
} else {
singleKey = -1;
};
} else {
i = 0;
while (i < m_manifoldCount) {
j = 0;
while (j < m_arcManifolds[i].pointCount) {
cp0 = m_arcManifolds[i].points[j];
cp = new b2ManifoldPoint();
impulses[cp0.id.key] = cp;
cp.normalImpulse = cp0.normalImpulse;
cp.tangentImpulse = cp0.tangentImpulse;
j++;
};
i++;
};
if ((((m_manifoldCount == 1)) && ((m_arcManifolds[0].pointCount == 1)))){
singleKey = m_arcManifolds[0].points[0].id.key;
} else {
singleKey = -1;
};
};
super.Evaluate(listener);
var polyManiCount:Number = m_manifoldCount;
if (m_manifoldCount == 0){
return;
};
cp = m_manifolds[0].points[0];
var features:Features = cp.id.features;
var edge:Number = (features.flip) ? features.referenceEdge : features.incidentEdge;
var polySep:Number = -(Number.MAX_VALUE);
if ((((((m_manifoldCount == 1)) && (!((edge == 0))))) && ((cp.separation < 0)))){
polySep = cp.separation;
};
poly = (m_shape1 as b2PolygonShape);
arc = (m_shape2 as b2ConcaveArcShape);
var arcSep:Number = Number.MAX_VALUE;
localCenter = b2Math.b2MulXT(b1.m_xf, b2Math.b2MulX(b2.m_xf, arc.m_arcCenter));
local0 = b2Math.b2MulX(b2.m_xf, arc.m_vertices[0]);
var world0:b2Vec2 = local0.Copy();
local0 = b2Math.b2MulXT(b1.m_xf, local0);
var local1:b2Vec2 = b2Math.b2MulX(b2.m_xf, arc.m_vertices[1]);
var world1:b2Vec2 = local1.Copy();
local1 = b2Math.b2MulXT(b1.m_xf, local1);
var localNorm:b2Vec2 = b2Math.b2MulTMV(b1.m_xf.R, b2Math.b2MulMV(b2.m_xf.R, arc.m_normals[0].Copy()));
var worlds:Array = [world0, world1];
var locals:Array = [local0, local1];
var strictMode:Boolean;
m_manifoldCount = 0;
var autoApprove:Array = [-1, -1];
var arcLimitations:Array = [-1, -1];
if (edge == 0){
i = 0;
while (i < 2) {
maxS = -(Number.MAX_VALUE);
maxEdge = -1;
local = locals[i];
if (i == 0){
arcNormal1 = b2Math.b2MulTMV(b1.m_xf.R, b2Math.b2MulMV(b2.m_xf.R, arc.m_normals[(arc.m_vertexCount - 1)]));
arcNormal2 = b2Math.SubtractVV(localCenter, local);
arcNormal2.Normalize();
} else {
arcNormal2 = b2Math.b2MulTMV(b1.m_xf.R, b2Math.b2MulMV(b2.m_xf.R, arc.m_normals[1]));
arcNormal1 = b2Math.SubtractVV(localCenter, local);
arcNormal1.Normalize();
};
j = 0;
while (j < poly.m_vertexCount) {
polyVx = poly.m_vertices[j];
polyNormal = poly.m_normals[j];
if (((polyNormal.x * arcNormal1.y) - (polyNormal.y * arcNormal1.x)) < 0){
} else {
if (((polyNormal.x * arcNormal2.y) - (polyNormal.y * arcNormal2.x)) > 0){
} else {
v2x = (local.x - polyVx.x);
v2y = (local.y - polyVx.y);
s = ((v2x * polyNormal.x) + (v2y * polyNormal.y));
if (s > 0){
maxEdge = -1;
break;
};
if (s > maxS){
maxS = s;
maxEdge = j;
};
};
};
j++;
};
if (maxEdge != -1){
polyNormal = poly.m_normals[maxEdge];
polyVx = poly.m_vertices[maxEdge];
polyVx2 = poly.m_vertices[(((maxEdge + 1) < poly.m_vertexCount)) ? (maxEdge + 1) : 0];
dot1 = ((polyNormal.x * arcNormal1.x) + (polyNormal.y * arcNormal1.y));
dot2 = ((polyNormal.x * arcNormal2.x) + (polyNormal.y * arcNormal2.y));
if (dot1 < dot2){
tangent = b2Math.b2CrossVF(arcNormal1, 1);
} else {
tangent = b2Math.b2CrossVF(arcNormal2, -1);
};
t1 = (((local.x - polyVx.x) * polyNormal.x) + ((local.y - polyVx.y) * polyNormal.y));
t2 = ((tangent.x * polyNormal.x) + (tangent.y * polyNormal.y));
t3 = (-(t1) / t2);
v2x = (polyVx2.x - polyVx.x);
v2y = (polyVx2.y - polyVx.y);
t4 = ((((local.x + (t3 * tangent.x)) - polyVx.x) * v2x) + (((local.y + (t3 * tangent.y)) - polyVx.y) * v2y));
if ((((t4 < 0)) || ((t4 > ((v2x * v2x) + (v2y * v2y)))))){
maxEdge = -1;
};
};
if (maxEdge != -1){
arcLimitations[i] = maxEdge;
if (i == 0){
s = (((polyVx2.x - local.x) * arcNormal2.x) + ((polyVx2.y - local.y) * arcNormal2.y));
if ((((maxS < s)) && ((s < 0)))){
autoApprove[i] = (((maxEdge + 1) < poly.m_vertexCount)) ? (maxEdge + 1) : 0;
maxEdge = -1;
};
} else {
s = (((polyVx.x - local.x) * arcNormal1.x) + ((polyVx.y - local.y) * arcNormal1.y));
if ((((maxS < s)) && ((s < 0)))){
autoApprove[i] = maxEdge;
maxEdge = -1;
};
};
};
if (maxEdge != -1){
m_manifoldCount++;
enlargeManifolds(m_manifoldCount);
tMani = m_arcManifolds[(m_manifoldCount - 1)];
tMani.pointCount = 1;
tPoint = tMani.points[0];
tPoint.localPoint1.SetV(locals[i]);
tPoint.localPoint2.SetV(arc.m_vertices[i]);
tPoint.id.features.incidentEdge = b2_nullFeature;
tPoint.id.features.incidentVertex = i;
tPoint.id.features.referenceEdge = maxEdge;
tPoint.id.features.flip = 0;
tPoint.separation = maxS;
tPoint.normalImpulse = 0;
tPoint.tangentImpulse = 0;
tMani.normal = b2Math.b2MulMV(b1.m_xf.R, poly.m_normals[maxEdge]);
arcSep = Math.min(arcSep, tPoint.separation);
};
i++;
};
};
if (arcLimitations[1] == -1){
if (arcLimitations[0] == -1){
direction = 1;
startVx = 0;
} else {
direction = (poly.m_vertexCount - 1);
startVx = (((arcLimitations[0] + 1) == poly.m_vertexCount)) ? 0 : (arcLimitations[0] + 1);
};
} else {
direction = 1;
startVx = arcLimitations[1];
};
var foundBlock:Boolean;
currVx = startVx;
do {
bool1 = true;
tVec = poly.m_vertices[currVx];
if (arcLimitations[0] != -1){
l = arcLimitations[0];
topVx = poly.m_vertices[(((l + 1) == poly.m_vertexCount)) ? 0 : (l + 1)];
bool1 = ((bool1) && (((((tVec.x - topVx.x) * poly.m_normals[l].y) - ((tVec.y - topVx.y) * poly.m_normals[l].x)) > 0)));
};
if (arcLimitations[1] != -1){
l = arcLimitations[1];
topVx = poly.m_vertices[l];
bool1 = ((bool1) && (((((tVec.x - topVx.x) * poly.m_normals[l].y) - ((tVec.y - topVx.y) * poly.m_normals[l].x)) < 0)));
};
if (((foundBlock) && (!(bool1)))){
startVx = ((currVx + direction) % poly.m_vertexCount);
};
if (bool1){
foundBlock = true;
};
tVec = new b2Vec2((poly.m_vertices[currVx].x - localCenter.x), (poly.m_vertices[currVx].y - localCenter.y));
d2 = ((tVec.x * tVec.x) + (tVec.y * tVec.y));
d = Math.sqrt(d2);
s1 = (arc.m_radius - d);
s2 = (((poly.m_vertices[currVx].x - local0.x) * localNorm.x) + ((poly.m_vertices[currVx].y - local0.y) * localNorm.y));
s = Math.max(s1, s2);
arcSep = Math.min(arcSep, s);
bool1 = ((bool1) && ((s < 0)));
if (((((bool1) || ((currVx == autoApprove[0])))) || ((currVx == autoApprove[1])))){
m_manifoldCount++;
enlargeManifolds(m_manifoldCount);
tMani = m_arcManifolds[(m_manifoldCount - 1)];
tMani.pointCount = 1;
tPoint = tMani.points[0];
tPoint.id.features.incidentEdge = b2_nullFeature;
tPoint.id.features.incidentVertex = currVx;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
tPoint.normalImpulse = 0;
tPoint.tangentImpulse = 0;
tVec.x = (tVec.x / d);
tVec.y = (tVec.y / d);
tMat = b1.m_xf.R;
tMani.normal.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
tMani.normal.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
tVec = poly.m_vertices[currVx];
tPoint.localPoint1.SetV(tVec);
tPoint.localPoint2.SetV(b2Math.b2MulXT(b2.m_xf, b2Math.b2MulX(b1.m_xf, tVec)));
tPoint.separation = (arc.m_radius - d);
};
currVx = ((currVx + direction) % poly.m_vertexCount);
} while (currVx != startVx);
var arcManiCount:int = m_manifoldCount;
if (polySep > arcSep){
m_arcColl = false;
m_manifoldCount = polyManiCount;
i = 0;
while (i < m_manifoldCount) {
j = 0;
while (j < m_manifolds[i].pointCount) {
cp = m_manifolds[i].points[j];
cp0 = impulses[cp.id.key];
if (cp0){
cp.normalImpulse = cp0.normalImpulse;
cp.tangentImpulse = cp0.tangentImpulse;
};
j++;
};
i++;
};
if (((((!((singleKey == -1))) && ((m_manifoldCount == 1)))) && ((m_manifolds[0].pointCount == 1)))){
cp = m_manifolds[0].points[0];
cp0 = impulses[singleKey];
if (cp0){
cp.normalImpulse = cp0.normalImpulse;
cp.tangentImpulse = cp0.tangentImpulse;
};
};
} else {
m_arcColl = true;
m_manifoldCount = arcManiCount;
i = 0;
while (i < m_manifoldCount) {
j = 0;
while (j < m_arcManifolds[i].pointCount) {
cp = m_arcManifolds[i].points[j];
cp0 = impulses[cp.id.key];
if (cp0){
cp.normalImpulse = cp0.normalImpulse;
cp.tangentImpulse = cp0.tangentImpulse;
};
j++;
};
i++;
};
if (((((!((singleKey == -1))) && ((m_manifoldCount == 1)))) && ((m_arcManifolds[0].pointCount == 1)))){
cp = m_arcManifolds[0].points[0];
cp0 = impulses[singleKey];
if (cp0){
cp.normalImpulse = cp0.normalImpulse;
cp.tangentImpulse = cp0.tangentImpulse;
};
};
};
}
override public function GetManifolds():Array{
if (m_arcColl){
return (m_arcManifolds);
};
return (m_manifolds);
}
public static function Destroy(contact:b2Contact, allocator):void{
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
return (new b2PolyAndConcaveArcContact(shape1, shape2));
}
}
}//package Box2D.Dynamics.Contacts
Section 55
//b2PolyAndStaticEdgeContact (Box2D.Dynamics.Contacts.b2PolyAndStaticEdgeContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndStaticEdgeContact extends b2Contact {
public var m_manifolds:Array;
public var m_manifold:b2Manifold;
public var m0:b2Manifold;
public static const s_evalCP:b2ContactPoint = new b2ContactPoint();
private static const k_slop:Number = 4.94065645841247E-322;
public function b2PolyAndStaticEdgeContact(shape1:b2Shape, shape2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(shape1, shape2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var point:b2ManifoldPoint = m_manifold.points[0];
point.normalImpulse = 0;
point.tangentImpulse = 0;
}
override public function Evaluate(listener:b2ContactListener):void{
var i:int;
var v1:b2Vec2;
var v2:b2Vec2;
var mp0:b2ManifoldPoint;
var mp:b2ManifoldPoint;
var found:Boolean;
var idKey:uint;
var j:int;
var b1:b2Body = m_shape1.m_body;
var b2:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2CollidePolygonAndStaticEdge(m_manifold, (m_shape1 as b2PolygonShape), b1.m_xf, (m_shape2 as b2StaticEdgeShape), b2.m_xf);
var persisted:Array = [false, false];
var cp:b2ContactPoint = s_evalCP;
cp.shape1 = m_shape1;
cp.shape2 = m_shape2;
cp.friction = m_friction;
cp.restitution = m_restitution;
if (m_manifold.pointCount > 0){
i = 0;
while (i < m_manifold.pointCount) {
mp = m_manifold.points[i];
mp.normalImpulse = 0;
mp.tangentImpulse = 0;
found = false;
idKey = mp.id._key;
j = 0;
while (j < m0.pointCount) {
if (persisted[j] == true){
} else {
mp0 = m0.points[j];
if (mp0.id._key == idKey){
persisted[j] = true;
mp.normalImpulse = mp0.normalImpulse;
mp.tangentImpulse = mp0.tangentImpulse;
found = true;
if (listener != null){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Persist(cp);
};
break;
};
};
j++;
};
if ((((found == false)) && (!((listener == null))))){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Add(cp);
};
i++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (listener == null){
return;
};
i = 0;
while (i < m0.pointCount) {
if (persisted[i]){
} else {
mp0 = m0.points[i];
cp.position = b1.GetWorldPoint(mp0.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp0.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp0.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m0.normal);
cp.separation = mp0.separation;
cp.id.key = mp0.id._key;
listener.Remove(cp);
};
i++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function b2CollidePolygonAndStaticEdge(manifold:b2Manifold, polygon:b2PolygonShape, xf1:b2XForm, edge:b2StaticEdgeShape, xf2:b2XForm):void{
var tPoint:b2ManifoldPoint;
var tVec:b2Vec2;
var tVec2:b2Vec2;
var tMat:b2Mat22;
var dX:Number;
var dY:Number;
var separation1:Number;
var separation2:Number;
var separationV1:Boolean;
var separationIndex:int;
var prevEN:Number;
var nextEN:Number;
var enterEN:Number;
var exitEN:Number;
var deepestIndex:int;
var ecx:Number;
var ecy:Number;
var edx:Number;
var edy:Number;
var ed1:Number;
var ed2:Number;
manifold.pointCount = 0;
tMat = xf1.R;
dX = (edge.m_v1.x - xf1.position.x);
dY = (edge.m_v1.y - xf1.position.y);
var v1x:Number = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
var v1y:Number = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = (edge.m_v2.x - xf1.position.x);
dY = (edge.m_v2.y - xf1.position.y);
var v2x:Number = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
var v2y:Number = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
dX = edge.m_normal.x;
dY = edge.m_normal.y;
var enx:Number = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
var eny:Number = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
var separationMax:Number = -(Infinity);
var vertexCount:int = polygon.m_vertexCount;
var vertices:Array = polygon.m_vertices;
var normals:Array = polygon.m_normals;
var enterStartIndex = -1;
var enterEndIndex = -1;
var exitStartIndex = -1;
var exitEndIndex = -1;
var deepestEN:Number = Infinity;
tVec = vertices[(vertexCount - 1)];
dX = (tVec.x - v1x);
dY = (tVec.y - v1y);
prevEN = ((dX * enx) + (dY * eny));
var i:int;
while (i < vertexCount) {
tVec = vertices[i];
tVec2 = normals[i];
dX = (v1x - tVec.x);
dY = (v1y - tVec.y);
separation1 = ((dX * tVec2.x) + (dY * tVec2.y));
dX = (v2x - tVec.x);
dY = (v2y - tVec.y);
separation2 = ((dX * tVec2.x) + (dY * tVec2.y));
if (separation2 < separation1){
if (separation2 > separationMax){
separationMax = separation2;
separationV1 = false;
separationIndex = i;
};
} else {
if (separation1 > separationMax){
separationMax = separation1;
separationV1 = true;
separationIndex = i;
};
};
nextEN = -(((dX * enx) + (dY * eny)));
if ((((nextEN >= 0)) && ((prevEN < 0)))){
exitStartIndex = ((i)==0) ? (vertexCount - 1) : (i - 1);
exitEndIndex = i;
exitEN = prevEN;
} else {
if ((((nextEN < 0)) && ((prevEN >= 0)))){
enterStartIndex = ((i)==0) ? (vertexCount - 1) : (i - 1);
enterEndIndex = i;
enterEN = nextEN;
};
};
if (nextEN < deepestEN){
deepestEN = nextEN;
deepestIndex = i;
};
prevEN = nextEN;
i++;
};
if (enterStartIndex == -1){
return;
};
if (separationMax > 0){
return;
};
if (separationMax > (deepestEN + b2Settings.b2_linearSlop)){
tVec2 = normals[separationIndex];
if (separationV1){
dX = edge.m_cornerDir1.x;
dY = edge.m_cornerDir1.y;
ecx = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
ecy = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
} else {
dX = edge.m_cornerDir2.x;
dY = edge.m_cornerDir2.y;
ecx = -(((dX * tMat.col1.x) + (dY * tMat.col1.y)));
ecy = -(((dX * tMat.col2.x) + (dY * tMat.col2.y)));
};
if (((tVec2.x * ecx) + (tVec2.y * ecy)) >= 0){
return;
};
manifold.pointCount = 1;
manifold.normal.Set(((tMat.col1.x * tVec2.x) + (tMat.col2.x * tVec2.y)), ((tMat.col1.y * tVec2.x) + (tMat.col2.y * tVec2.y)));
tPoint = manifold.points[0];
tPoint.id.features.incidentEdge = separationIndex;
tPoint.id.features.incidentVertex = b2Collision.b2_nullFeature;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
if (separationV1){
tPoint.localPoint1.Set(v1x, v1y);
tPoint.localPoint2.SetV(edge.m_v1);
} else {
tPoint.localPoint1.Set(v2x, v2y);
tPoint.localPoint2.SetV(edge.m_v2);
};
tPoint.separation = separationMax;
} else {
manifold.normal.Set(-(edge.m_normal.x), -(edge.m_normal.y));
tVec = vertices[enterEndIndex];
if (enterEndIndex == exitStartIndex){
manifold.pointCount = 1;
tPoint = manifold.points[0];
tPoint.id.features.incidentEdge = enterEndIndex;
tPoint.id.features.incidentVertex = b2Collision.b2_nullFeature;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
tPoint.localPoint1.SetV(tVec);
tPoint.localPoint2.Set((xf1.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y))), (xf1.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y))));
tPoint.separation = enterEN;
return;
};
manifold.pointCount = 2;
dX = edge.m_direction.x;
dY = edge.m_direction.y;
edx = ((dX * tMat.col1.x) + (dY * tMat.col1.y));
edy = ((dX * tMat.col2.x) + (dY * tMat.col2.y));
ed1 = ((edx * (tVec.x - v1x)) + (edy * (tVec.y - v1y)));
exitEndIndex = ((enterEndIndex)==(vertexCount - 1)) ? 0 : (enterEndIndex + 1);
if (exitEndIndex != exitStartIndex){
exitStartIndex = exitEndIndex;
tVec2 = vertices[exitStartIndex];
dX = (tVec2.x - v1x);
dY = (tVec2.y - v1y);
exitEN = ((enx * dX) + (eny * dY));
ed2 = ((edx * dX) + (edy * dY));
} else {
tVec2 = vertices[exitStartIndex];
ed2 = ((edx * (tVec2.x - v1x)) + (edy * (tVec2.y - v1y)));
};
tPoint = manifold.points[0];
tPoint.id.features.incidentEdge = enterEndIndex;
tPoint.id.features.incidentVertex = b2Collision.b2_nullFeature;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
if (ed1 > edge.m_length){
tPoint.localPoint1.Set(v2x, v2y);
tPoint.localPoint2.SetV(edge.m_v2);
dX = ((edge.m_length - ed2) / (ed1 - ed2));
if ((((dX > (100 * Number.MIN_VALUE))) && ((dX < 1)))){
tPoint.separation = ((exitEN * (1 - dX)) + (enterEN * dX));
} else {
tPoint.separation = enterEN;
};
} else {
tPoint.localPoint1.SetV(tVec);
tPoint.localPoint2.Set((xf1.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y))), (xf1.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y))));
tPoint.separation = enterEN;
};
tPoint = manifold.points[1];
tPoint.id.features.incidentEdge = exitStartIndex;
tPoint.id.features.incidentVertex = b2Collision.b2_nullFeature;
tPoint.id.features.referenceEdge = 0;
tPoint.id.features.flip = 0;
if (ed2 < 0){
tPoint.localPoint1.Set(v1x, v1y);
tPoint.localPoint2.SetV(edge.m_v1);
dX = (-(ed1) / (ed2 - ed1));
if ((((dX > (100 * Number.MIN_VALUE))) && ((dX < 1)))){
tPoint.separation = ((enterEN * (1 - dX)) + (exitEN * dX));
} else {
tPoint.separation = exitEN;
};
} else {
tPoint.localPoint1.SetV(tVec2);
tPoint.localPoint2.Set((xf1.position.x + ((tMat.col1.x * tVec2.x) + (tMat.col2.x * tVec2.y))), (xf1.position.y + ((tMat.col1.y * tVec2.x) + (tMat.col2.y * tVec2.y))));
tPoint.separation = exitEN;
};
return;
};
}
public static function Destroy(contact:b2Contact, allocator):void{
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
return (new b2PolyAndStaticEdgeContact(shape1, shape2));
}
}
}//package Box2D.Dynamics.Contacts
Section 56
//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 {
public var m_manifolds:Array;
public var m0:b2Manifold;
public var m_manifold:b2Manifold;
public static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(shape1:b2Shape, shape2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(shape1, shape2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function Evaluate(listener:b2ContactListener):void{
var v1:b2Vec2;
var v2:b2Vec2;
var mp0:b2ManifoldPoint;
var cp:b2ContactPoint;
var i:int;
var mp:b2ManifoldPoint;
var found:Boolean;
var idKey:uint;
var j:int;
var b1:b2Body = m_shape1.m_body;
var b2:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), b1.m_xf, (m_shape2 as b2PolygonShape), b2.m_xf);
var persisted:Array = [false, false];
cp = s_evalCP;
cp.shape1 = m_shape1;
cp.shape2 = m_shape2;
cp.friction = m_friction;
cp.restitution = m_restitution;
if (m_manifold.pointCount > 0){
i = 0;
while (i < m_manifold.pointCount) {
mp = m_manifold.points[i];
mp.normalImpulse = 0;
mp.tangentImpulse = 0;
found = false;
idKey = mp.id._key;
j = 0;
while (j < m0.pointCount) {
if (persisted[j] == true){
} else {
mp0 = m0.points[j];
if (mp0.id._key == idKey){
persisted[j] = true;
mp.normalImpulse = mp0.normalImpulse;
mp.tangentImpulse = mp0.tangentImpulse;
found = true;
if (listener != null){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Persist(cp);
};
break;
};
};
j++;
};
if ((((found == false)) && (!((listener == null))))){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = idKey;
listener.Add(cp);
};
i++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (listener == null){
return;
};
i = 0;
while (i < m0.pointCount) {
if (persisted[i]){
} else {
mp0 = m0.points[i];
cp.position = b1.GetWorldPoint(mp0.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp0.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp0.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m0.normal);
cp.separation = mp0.separation;
cp.id.key = mp0.id._key;
listener.Remove(cp);
};
i++;
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(contact:b2Contact, allocator):void{
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
return (new b2PolygonContact(shape1, shape2));
}
}
}//package Box2D.Dynamics.Contacts
Section 57
//b2StaticEdgeAndCircleContact (Box2D.Dynamics.Contacts.b2StaticEdgeAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2StaticEdgeAndCircleContact 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 b2StaticEdgeAndCircleContact(shape1:b2Shape, shape2:b2Shape){
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(shape1, shape2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
var point:b2ManifoldPoint = m_manifold.points[0];
point.normalImpulse = 0;
point.tangentImpulse = 0;
}
override public function Evaluate(listener:b2ContactListener):void{
var v1:b2Vec2;
var v2:b2Vec2;
var mp0:b2ManifoldPoint;
var mp:b2ManifoldPoint;
var b1:b2Body = m_shape1.m_body;
var b2:b2Body = m_shape2.m_body;
m0.Set(m_manifold);
b2CollideStaticEdgeAndCircle(m_manifold, (m_shape1 as b2StaticEdgeShape), b1.m_xf, (m_shape2 as b2CircleShape), b2.m_xf);
var cp:b2ContactPoint = s_evalCP;
cp.shape1 = m_shape1;
cp.shape2 = m_shape2;
cp.friction = m_friction;
cp.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
mp = m_manifold.points[0];
if (m0.pointCount == 0){
mp.normalImpulse = 0;
mp.tangentImpulse = 0;
if (listener){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = mp.id._key;
listener.Add(cp);
};
} else {
mp0 = m0.points[0];
mp.normalImpulse = mp0.normalImpulse;
mp.tangentImpulse = mp0.tangentImpulse;
if (listener){
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m_manifold.normal);
cp.separation = mp.separation;
cp.id.key = mp.id._key;
listener.Persist(cp);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (listener))){
mp0 = m0.points[0];
cp.position = b1.GetWorldPoint(mp0.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp0.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp0.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.normal.SetV(m0.normal);
cp.separation = mp0.separation;
cp.id.key = mp0.id._key;
listener.Remove(cp);
};
};
}
override public function GetManifolds():Array{
return (m_manifolds);
}
public static function Destroy(contact:b2Contact, allocator):void{
}
public static function Create(shape1:b2Shape, shape2:b2Shape, allocator):b2Contact{
return (new b2StaticEdgeAndCircleContact(shape1, shape2));
}
public static function b2CollideStaticEdgeAndCircle(manifold:b2Manifold, edge:b2StaticEdgeShape, xf1:b2XForm, circle:b2CircleShape, xf2:b2XForm):void{
var tMat:b2Mat22;
var tVec:b2Vec2;
var circleX:Number;
var circleY:Number;
var dX:Number;
var dY:Number;
var separation:Number;
var tPoint:b2ManifoldPoint;
var dist:Number;
var a:Number;
manifold.pointCount = 0;
tMat = xf2.R;
tVec = circle.m_localPosition;
circleX = (xf2.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
circleY = (xf2.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
var normDist:Number = (((circleX - edge.m_v1.x) * edge.m_normal.x) + ((circleY - edge.m_v1.y) * edge.m_normal.y));
if (normDist < 0){
return;
};
var dirDist:Number = (((circleX - edge.m_v1.x) * edge.m_direction.x) + ((circleY - edge.m_v1.y) * edge.m_direction.y));
if (dirDist <= 0){
dX = (circleX - edge.m_v1.x);
dY = (circleY - edge.m_v1.y);
if (((dX * edge.m_cornerDir1.x) + (dY * edge.m_cornerDir1.y)) < 0){
return;
};
} else {
if (dirDist >= edge.m_length){
dX = (circleX - edge.m_v2.x);
dY = (circleY - edge.m_v2.y);
if (((dX * edge.m_cornerDir2.x) + (dY * edge.m_cornerDir2.y)) > 0){
return;
};
} else {
dX = (normDist * edge.m_normal.x);
dY = (normDist * edge.m_normal.y);
};
};
var distSqr:Number = ((dX * dX) + (dY * dY));
if (distSqr > (circle.m_radius * circle.m_radius)){
return;
};
if (distSqr < Number.MIN_VALUE){
separation = -(circle.m_radius);
manifold.normal.Set(0, 1);
} else {
dist = Math.sqrt(distSqr);
separation = (dist - circle.m_radius);
a = (1 / dist);
manifold.normal.x = (a * dX);
manifold.normal.y = (a * dY);
};
manifold.pointCount = 1;
tPoint = manifold.points[0];
tPoint.id.key = 0;
tPoint.separation = separation;
circleX = (circleX - (circle.m_radius * manifold.normal.x));
circleY = (circleY - (circle.m_radius * manifold.normal.y));
tPoint.localPoint1.x = circleX;
tPoint.localPoint1.y = circleY;
var tX:Number = (circleX - xf2.position.x);
var tY:Number = (circleY - xf2.position.y);
tPoint.localPoint2.x = ((tX * xf2.R.col1.x) + (tY * xf2.R.col1.y));
tPoint.localPoint2.y = ((tX * xf2.R.col2.x) + (tY * xf2.R.col2.y));
}
}
}//package Box2D.Dynamics.Contacts
Section 58
//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(def:b2DistanceJointDef){
var tMat:b2Mat22;
var tX:Number;
var tY:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(def);
m_localAnchor1.SetV(def.localAnchor1);
m_localAnchor2.SetV(def.localAnchor2);
m_length = def.length;
m_frequencyHz = def.frequencyHz;
m_dampingRatio = def.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(step:b2TimeStep):void{
var tMat:b2Mat22;
var tX:Number;
var b1:b2Body;
var b2:b2Body;
var r1X:Number;
var r2X:Number;
var C:Number;
var omega:Number;
var d:Number;
var k:Number;
var PX:Number;
var PY:Number;
m_inv_dt = step.inv_dt;
b1 = m_body1;
b2 = m_body2;
tMat = b1.m_xf.R;
r1X = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
r2X = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
m_u.x = (((b2.m_sweep.c.x + r2X) - b1.m_sweep.c.x) - r1X);
m_u.y = (((b2.m_sweep.c.y + r2Y) - b1.m_sweep.c.y) - r1Y);
var length:Number = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (length > b2Settings.b2_linearSlop){
m_u.Multiply((1 / length));
} else {
m_u.SetZero();
};
var cr1u:Number = ((r1X * m_u.y) - (r1Y * m_u.x));
var cr2u:Number = ((r2X * m_u.y) - (r2Y * m_u.x));
var invMass:Number = (((b1.m_invMass + ((b1.m_invI * cr1u) * cr1u)) + b2.m_invMass) + ((b2.m_invI * cr2u) * cr2u));
m_mass = (1 / invMass);
if (m_frequencyHz > 0){
C = (length - m_length);
omega = ((2 * Math.PI) * m_frequencyHz);
d = (((2 * m_mass) * m_dampingRatio) * omega);
k = ((m_mass * omega) * omega);
m_gamma = (1 / (step.dt * (d + (step.dt * k))));
m_bias = (((C * step.dt) * k) * m_gamma);
m_mass = (1 / (invMass + m_gamma));
};
if (step.warmStarting){
m_impulse = (m_impulse * step.dtRatio);
PX = (m_impulse * m_u.x);
PY = (m_impulse * m_u.y);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x - (b1.m_invMass * PX));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y - (b1.m_invMass * PY));
b1.m_angularVelocity = (b1.m_angularVelocity - (b1.m_invI * ((r1X * PY) - (r1Y * PX))));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (b2.m_invMass * PX));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (b2.m_invMass * PY));
b2.m_angularVelocity = (b2.m_angularVelocity + (b2.m_invI * ((r2X * PY) - (r2Y * PX))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function GetReactionForce():b2Vec2{
var F:b2Vec2 = new b2Vec2();
F.SetV(m_u);
F.Multiply((m_inv_dt * m_impulse));
return (F);
}
override public function SolvePositionConstraints():Boolean{
var tMat:b2Mat22;
if (m_frequencyHz > 0){
return (true);
};
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var dX:Number = (((b2.m_sweep.c.x + r2X) - b1.m_sweep.c.x) - r1X);
var dY:Number = (((b2.m_sweep.c.y + r2Y) - b1.m_sweep.c.y) - r1Y);
var length:Number = Math.sqrt(((dX * dX) + (dY * dY)));
dX = (dX / length);
dY = (dY / length);
var C:Number = (length - m_length);
C = b2Math.b2Clamp(C, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var impulse:Number = (-(m_mass) * C);
m_u.Set(dX, dY);
var PX:Number = (impulse * m_u.x);
var PY:Number = (impulse * m_u.y);
b1.m_sweep.c.x = (b1.m_sweep.c.x - (b1.m_invMass * PX));
b1.m_sweep.c.y = (b1.m_sweep.c.y - (b1.m_invMass * PY));
b1.m_sweep.a = (b1.m_sweep.a - (b1.m_invI * ((r1X * PY) - (r1Y * PX))));
b2.m_sweep.c.x = (b2.m_sweep.c.x + (b2.m_invMass * PX));
b2.m_sweep.c.y = (b2.m_sweep.c.y + (b2.m_invMass * PY));
b2.m_sweep.a = (b2.m_sweep.a + (b2.m_invI * ((r2X * PY) - (r2Y * PX))));
b1.SynchronizeTransform();
b2.SynchronizeTransform();
return ((b2Math.b2Abs(C) < b2Settings.b2_linearSlop));
}
override public function SolveVelocityConstraints(step:b2TimeStep):void{
var tMat:b2Mat22;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var v1X:Number = (b1.m_linearVelocity.x + (-(b1.m_angularVelocity) * r1Y));
var v1Y:Number = (b1.m_linearVelocity.y + (b1.m_angularVelocity * r1X));
var v2X:Number = (b2.m_linearVelocity.x + (-(b2.m_angularVelocity) * r2Y));
var v2Y:Number = (b2.m_linearVelocity.y + (b2.m_angularVelocity * r2X));
var Cdot:Number = ((m_u.x * (v2X - v1X)) + (m_u.y * (v2Y - v1Y)));
var impulse:Number = (-(m_mass) * ((Cdot + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + impulse);
var PX:Number = (impulse * m_u.x);
var PY:Number = (impulse * m_u.y);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x - (b1.m_invMass * PX));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y - (b1.m_invMass * PY));
b1.m_angularVelocity = (b1.m_angularVelocity - (b1.m_invI * ((r1X * PY) - (r1Y * PX))));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (b2.m_invMass * PX));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (b2.m_invMass * PY));
b2.m_angularVelocity = (b2.m_angularVelocity + (b2.m_invI * ((r2X * PY) - (r2Y * PX))));
}
}
}//package Box2D.Dynamics.Joints
Section 59
//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(b1:b2Body, b2:b2Body, anchor1:b2Vec2, anchor2:b2Vec2):void{
body1 = b1;
body2 = b2;
localAnchor1.SetV(body1.GetLocalPoint(anchor1));
localAnchor2.SetV(body2.GetLocalPoint(anchor2));
var dX:Number = (anchor2.x - anchor1.x);
var dY:Number = (anchor2.y - anchor1.y);
length = Math.sqrt(((dX * dX) + (dY * dY)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 60
//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(def:b2GearJointDef){
var coordinate1:Number;
var coordinate2:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(def);
var type1:int = def.joint1.m_type;
var type2:int = def.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = def.joint1.m_body1;
m_body1 = def.joint1.m_body2;
if (type1 == b2Joint.e_revoluteJoint){
m_revolute1 = (def.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
coordinate1 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (def.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
coordinate1 = m_prismatic1.GetJointTranslation();
};
m_ground2 = def.joint2.m_body1;
m_body2 = def.joint2.m_body2;
if (type2 == b2Joint.e_revoluteJoint){
m_revolute2 = (def.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
coordinate2 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (def.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
coordinate2 = m_prismatic2.GetJointTranslation();
};
m_ratio = def.ratio;
m_constant = (coordinate1 + (m_ratio * coordinate2));
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(step:b2TimeStep):void{
var ugX:Number;
var ugY:Number;
var rX:Number;
var rY:Number;
var tMat:b2Mat22;
var tVec:b2Vec2;
var crug:Number;
var tX:Number;
var P:Number;
var g1:b2Body = m_ground1;
var g2:b2Body = m_ground2;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
var K:Number = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
K = (K + b1.m_invI);
} else {
tMat = g1.m_xf.R;
tVec = m_prismatic1.m_localXAxis1;
ugX = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
ugY = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
tMat = b1.m_xf.R;
rX = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
rY = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * rX) + (tMat.col2.x * rY));
rY = ((tMat.col1.y * rX) + (tMat.col2.y * rY));
rX = tX;
crug = ((rX * ugY) - (rY * ugX));
m_J.linear1.Set(-(ugX), -(ugY));
m_J.angular1 = -(crug);
K = (K + (b1.m_invMass + ((b1.m_invI * crug) * crug)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
K = (K + ((m_ratio * m_ratio) * b2.m_invI));
} else {
tMat = g2.m_xf.R;
tVec = m_prismatic2.m_localXAxis1;
ugX = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
ugY = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y));
tMat = b2.m_xf.R;
rX = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
rY = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * rX) + (tMat.col2.x * rY));
rY = ((tMat.col1.y * rX) + (tMat.col2.y * rY));
rX = tX;
crug = ((rX * ugY) - (rY * ugX));
m_J.linear2.Set((-(m_ratio) * ugX), (-(m_ratio) * ugY));
m_J.angular2 = (-(m_ratio) * crug);
K = (K + ((m_ratio * m_ratio) * (b2.m_invMass + ((b2.m_invI * crug) * crug))));
};
m_mass = (1 / K);
if (step.warmStarting){
P = (step.dt * m_force);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + ((b1.m_invMass * P) * m_J.linear1.x));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + ((b1.m_invMass * P) * m_J.linear1.y));
b1.m_angularVelocity = (b1.m_angularVelocity + ((b1.m_invI * P) * m_J.angular1));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + ((b2.m_invMass * P) * m_J.linear2.x));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + ((b2.m_invMass * P) * m_J.linear2.y));
b2.m_angularVelocity = (b2.m_angularVelocity + ((b2.m_invI * P) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var tMat:b2Mat22 = m_body2.m_xf.R;
var rX:Number = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
var rY:Number = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * rX) + (tMat.col2.x * rY));
rY = ((tMat.col1.y * rX) + (tMat.col2.y * rY));
rX = tX;
tX = ((m_force * m_J.angular2) - ((rX * (m_force * m_J.linear2.y)) - (rY * (m_force * m_J.linear2.x))));
return (tX);
}
override public function GetReactionForce():b2Vec2{
var F:b2Vec2 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (F);
}
override public function SolvePositionConstraints():Boolean{
var coordinate1:Number;
var coordinate2:Number;
var linearError:Number = 0;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
if (m_revolute1){
coordinate1 = m_revolute1.GetJointAngle();
} else {
coordinate1 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
coordinate2 = m_revolute2.GetJointAngle();
} else {
coordinate2 = m_prismatic2.GetJointTranslation();
};
var C:Number = (m_constant - (coordinate1 + (m_ratio * coordinate2)));
var impulse:Number = (-(m_mass) * C);
b1.m_sweep.c.x = (b1.m_sweep.c.x + ((b1.m_invMass * impulse) * m_J.linear1.x));
b1.m_sweep.c.y = (b1.m_sweep.c.y + ((b1.m_invMass * impulse) * m_J.linear1.y));
b1.m_sweep.a = (b1.m_sweep.a + ((b1.m_invI * impulse) * m_J.angular1));
b2.m_sweep.c.x = (b2.m_sweep.c.x + ((b2.m_invMass * impulse) * m_J.linear2.x));
b2.m_sweep.c.y = (b2.m_sweep.c.y + ((b2.m_invMass * impulse) * m_J.linear2.y));
b2.m_sweep.a = (b2.m_sweep.a + ((b2.m_invI * impulse) * m_J.angular2));
b1.SynchronizeTransform();
b2.SynchronizeTransform();
return ((linearError < b2Settings.b2_linearSlop));
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(step:b2TimeStep):void{
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
var Cdot:Number = m_J.Compute(b1.m_linearVelocity, b1.m_angularVelocity, b2.m_linearVelocity, b2.m_angularVelocity);
var force:Number = ((-(step.inv_dt) * m_mass) * Cdot);
m_force = (m_force + force);
var P:Number = (step.dt * force);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + ((b1.m_invMass * P) * m_J.linear1.x));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + ((b1.m_invMass * P) * m_J.linear1.y));
b1.m_angularVelocity = (b1.m_angularVelocity + ((b1.m_invI * P) * m_J.angular1));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + ((b2.m_invMass * P) * m_J.linear2.x));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + ((b2.m_invMass * P) * m_J.linear2.y));
b2.m_angularVelocity = (b2.m_angularVelocity + ((b2.m_invI * P) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 61
//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(){
super();
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 62
//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(x1:b2Vec2, a1:Number, x2:b2Vec2, a2:Number):void{
linear1.SetV(x1);
angular1 = a1;
linear2.SetV(x2);
angular2 = a2;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(x1:b2Vec2, a1:Number, x2:b2Vec2, a2:Number):Number{
return ((((((linear1.x * x1.x) + (linear1.y * x1.y)) + (angular1 * a1)) + ((linear2.x * x2.x) + (linear2.y * x2.y))) + (angular2 * a2)));
}
}
}//package Box2D.Dynamics.Joints
Section 63
//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(def:b2JointDef){
m_node1 = new b2JointEdge();
m_node2 = new b2JointEdge();
super();
m_type = def.type;
m_prev = null;
m_next = null;
m_body1 = def.body1;
m_body2 = def.body2;
m_collideConnected = def.collideConnected;
m_islandFlag = false;
m_userData = def.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(step: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(data):void{
m_userData = data;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(step:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(joint:b2Joint, allocator):void{
}
public static function Create(def:b2JointDef, allocator):b2Joint{
var joint:b2Joint;
switch (def.type){
case e_distanceJoint:
joint = new b2DistanceJoint((def as b2DistanceJointDef));
break;
case e_mouseJoint:
joint = new b2MouseJoint((def as b2MouseJointDef));
break;
case e_prismaticJoint:
joint = new b2PrismaticJoint((def as b2PrismaticJointDef));
break;
case e_revoluteJoint:
joint = new b2RevoluteJoint((def as b2RevoluteJointDef));
break;
case e_pulleyJoint:
joint = new b2PulleyJoint((def as b2PulleyJointDef));
break;
case e_gearJoint:
joint = new b2GearJoint((def as b2GearJointDef));
break;
default:
break;
};
return (joint);
}
}
}//package Box2D.Dynamics.Joints
Section 64
//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(){
super();
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 65
//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;
public function b2JointEdge(){
super();
}
}
}//package Box2D.Dynamics.Joints
Section 66
//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(def:b2MouseJointDef){
var tY: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(def);
m_target.SetV(def.target);
var tX:Number = (m_target.x - m_body2.m_xf.position.x);
tY = (m_target.y - m_body2.m_xf.position.y);
var tMat:b2Mat22 = m_body2.m_xf.R;
m_localAnchor.x = ((tX * tMat.col1.x) + (tY * tMat.col1.y));
m_localAnchor.y = ((tX * tMat.col2.x) + (tY * tMat.col2.y));
m_maxForce = def.maxForce;
m_impulse.SetZero();
var mass:Number = m_body2.m_mass;
var omega:Number = ((2 * b2Settings.b2_pi) * def.frequencyHz);
var d:Number = (((2 * mass) * def.dampingRatio) * omega);
var k:Number = ((def.timeStep * mass) * (omega * omega));
m_gamma = (1 / (d + k));
m_beta = (k / (d + k));
}
public function SetTarget(target:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = target;
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function InitVelocityConstraints(step:b2TimeStep):void{
var b:b2Body;
var tMat:b2Mat22;
var rX:Number;
var rY:Number;
var invMass:Number;
var invI:Number;
b = m_body2;
tMat = b.m_xf.R;
rX = (m_localAnchor.x - b.m_sweep.localCenter.x);
rY = (m_localAnchor.y - b.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * rX) + (tMat.col2.x * rY));
rY = ((tMat.col1.y * rX) + (tMat.col2.y * rY));
rX = tX;
invMass = b.m_invMass;
invI = b.m_invI;
K1.col1.x = invMass;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = invMass;
K2.col1.x = ((invI * rY) * rY);
K2.col2.x = ((-(invI) * rX) * rY);
K2.col1.y = ((-(invI) * rX) * rY);
K2.col2.y = ((invI * rX) * rX);
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 = ((b.m_sweep.c.x + rX) - m_target.x);
m_C.y = ((b.m_sweep.c.y + rY) - m_target.y);
b.m_angularVelocity = (b.m_angularVelocity * 0.98);
var PX:Number = (step.dt * m_impulse.x);
var PY:Number = (step.dt * m_impulse.y);
b.m_linearVelocity.x = (b.m_linearVelocity.x + (invMass * PX));
b.m_linearVelocity.y = (b.m_linearVelocity.y + (invMass * PY));
b.m_angularVelocity = (b.m_angularVelocity + (invI * ((rX * PY) - (rY * PX))));
}
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(step:b2TimeStep):void{
var tMat:b2Mat22;
var tX:Number;
var tY:Number;
var b:b2Body = m_body2;
tMat = b.m_xf.R;
var rX:Number = (m_localAnchor.x - b.m_sweep.localCenter.x);
var rY:Number = (m_localAnchor.y - b.m_sweep.localCenter.y);
tX = ((tMat.col1.x * rX) + (tMat.col2.x * rY));
rY = ((tMat.col1.y * rX) + (tMat.col2.y * rY));
rX = tX;
var CdotX:Number = (b.m_linearVelocity.x + (-(b.m_angularVelocity) * rY));
var CdotY:Number = (b.m_linearVelocity.y + (b.m_angularVelocity * rX));
tMat = m_mass;
tX = ((CdotX + ((m_beta * step.inv_dt) * m_C.x)) + ((m_gamma * step.dt) * m_impulse.x));
tY = ((CdotY + ((m_beta * step.inv_dt) * m_C.y)) + ((m_gamma * step.dt) * m_impulse.y));
var forceX:Number = (-(step.inv_dt) * ((tMat.col1.x * tX) + (tMat.col2.x * tY)));
var forceY:Number = (-(step.inv_dt) * ((tMat.col1.y * tX) + (tMat.col2.y * tY)));
var oldForceX:Number = m_impulse.x;
var oldForceY:Number = m_impulse.y;
m_impulse.x = (m_impulse.x + forceX);
m_impulse.y = (m_impulse.y + forceY);
var forceMagnitude:Number = m_impulse.Length();
if (forceMagnitude > m_maxForce){
m_impulse.Multiply((m_maxForce / forceMagnitude));
};
forceX = (m_impulse.x - oldForceX);
forceY = (m_impulse.y - oldForceY);
var PX:Number = (step.dt * forceX);
var PY:Number = (step.dt * forceY);
b.m_linearVelocity.x = (b.m_linearVelocity.x + (b.m_invMass * PX));
b.m_linearVelocity.y = (b.m_linearVelocity.y + (b.m_invMass * PY));
b.m_angularVelocity = (b.m_angularVelocity + (b.m_invI * ((rX * PY) - (rY * PX))));
}
}
}//package Box2D.Dynamics.Joints
Section 67
//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 68
//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(def:b2PrismaticJointDef){
var tMat:b2Mat22;
var tX:Number;
var tY: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(def);
m_localAnchor1.SetV(def.localAnchor1);
m_localAnchor2.SetV(def.localAnchor2);
m_localXAxis1.SetV(def.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = def.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 = def.lowerTranslation;
m_upperTranslation = def.upperTranslation;
m_maxMotorForce = def.maxMotorForce;
m_motorSpeed = def.motorSpeed;
m_enableLimit = def.enableLimit;
m_enableMotor = def.enableMotor;
}
override public function SolveVelocityConstraints(step:b2TimeStep):void{
var invI1:Number;
var oldLimitForce:Number;
var motorCdot:Number;
var motorForce:Number;
var oldMotorForce:Number;
var limitCdot:Number;
var limitForce:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
var invMass1:Number = b1.m_invMass;
var invMass2:Number = b2.m_invMass;
invI1 = b1.m_invI;
var invI2:Number = b2.m_invI;
var linearCdot:Number = m_linearJacobian.Compute(b1.m_linearVelocity, b1.m_angularVelocity, b2.m_linearVelocity, b2.m_angularVelocity);
var force:Number = ((-(step.inv_dt) * m_linearMass) * linearCdot);
m_force = (m_force + force);
var P:Number = (step.dt * force);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + ((invMass1 * P) * m_linearJacobian.linear1.x));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + ((invMass1 * P) * m_linearJacobian.linear1.y));
b1.m_angularVelocity = (b1.m_angularVelocity + ((invI1 * P) * m_linearJacobian.angular1));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + ((invMass2 * P) * m_linearJacobian.linear2.x));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + ((invMass2 * P) * m_linearJacobian.linear2.y));
b2.m_angularVelocity = (b2.m_angularVelocity + ((invI2 * P) * m_linearJacobian.angular2));
var angularCdot:Number = (b2.m_angularVelocity - b1.m_angularVelocity);
var torque:Number = ((-(step.inv_dt) * m_angularMass) * angularCdot);
m_torque = (m_torque + torque);
var L:Number = (step.dt * torque);
b1.m_angularVelocity = (b1.m_angularVelocity - (invI1 * L));
b2.m_angularVelocity = (b2.m_angularVelocity + (invI2 * L));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
motorCdot = (m_motorJacobian.Compute(b1.m_linearVelocity, b1.m_angularVelocity, b2.m_linearVelocity, b2.m_angularVelocity) - m_motorSpeed);
motorForce = ((-(step.inv_dt) * m_motorMass) * motorCdot);
oldMotorForce = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + motorForce), -(m_maxMotorForce), m_maxMotorForce);
motorForce = (m_motorForce - oldMotorForce);
P = (step.dt * motorForce);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + ((invMass1 * P) * m_motorJacobian.linear1.x));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + ((invMass1 * P) * m_motorJacobian.linear1.y));
b1.m_angularVelocity = (b1.m_angularVelocity + ((invI1 * P) * m_motorJacobian.angular1));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + ((invMass2 * P) * m_motorJacobian.linear2.x));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + ((invMass2 * P) * m_motorJacobian.linear2.y));
b2.m_angularVelocity = (b2.m_angularVelocity + ((invI2 * P) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
limitCdot = m_motorJacobian.Compute(b1.m_linearVelocity, b1.m_angularVelocity, b2.m_linearVelocity, b2.m_angularVelocity);
limitForce = ((-(step.inv_dt) * m_motorMass) * limitCdot);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + limitForce);
} else {
if (m_limitState == e_atLowerLimit){
oldLimitForce = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + limitForce), 0);
limitForce = (m_limitForce - oldLimitForce);
} else {
if (m_limitState == e_atUpperLimit){
oldLimitForce = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + limitForce), 0);
limitForce = (m_limitForce - oldLimitForce);
};
};
};
P = (step.dt * limitForce);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + ((invMass1 * P) * m_motorJacobian.linear1.x));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + ((invMass1 * P) * m_motorJacobian.linear1.y));
b1.m_angularVelocity = (b1.m_angularVelocity + ((invI1 * P) * m_motorJacobian.angular1));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + ((invMass2 * P) * m_motorJacobian.linear2.x));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + ((invMass2 * P) * m_motorJacobian.linear2.y));
b2.m_angularVelocity = (b2.m_angularVelocity + ((invI2 * P) * 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(flag:Boolean):void{
m_enableMotor = flag;
}
public function GetJointTranslation():Number{
var tMat:b2Mat22;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
var p1:b2Vec2 = b1.GetWorldPoint(m_localAnchor1);
var p2:b2Vec2 = b2.GetWorldPoint(m_localAnchor2);
var dX:Number = (p2.x - p1.x);
var dY:Number = (p2.y - p1.y);
var axis:b2Vec2 = b1.GetWorldVector(m_localXAxis1);
var translation:Number = ((axis.x * dX) + (axis.y * dY));
return (translation);
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var tMat:b2Mat22 = m_body1.m_xf.R;
var ax1X:Number = (m_limitForce * ((tMat.col1.x * m_localXAxis1.x) + (tMat.col2.x * m_localXAxis1.y)));
var ax1Y:Number = (m_limitForce * ((tMat.col1.y * m_localXAxis1.x) + (tMat.col2.y * m_localXAxis1.y)));
var ay1X:Number = (m_force * ((tMat.col1.x * m_localYAxis1.x) + (tMat.col2.x * m_localYAxis1.y)));
var ay1Y:Number = (m_force * ((tMat.col1.y * m_localYAxis1.x) + (tMat.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * ax1X) + (m_force * ay1X)), ((m_limitForce * ax1Y) + (m_force * ay1Y))));
}
override public function SolvePositionConstraints():Boolean{
var limitC:Number;
var oldLimitImpulse:Number;
var tMat:b2Mat22;
var tX:Number;
var ax1X:Number;
var ax1Y:Number;
var translation:Number;
var limitImpulse:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
var invMass1:Number = b1.m_invMass;
var invMass2:Number = b2.m_invMass;
var invI1:Number = b1.m_invI;
var invI2:Number = b2.m_invI;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var p1X:Number = (b1.m_sweep.c.x + r1X);
var p1Y:Number = (b1.m_sweep.c.y + r1Y);
var p2X:Number = (b2.m_sweep.c.x + r2X);
var p2Y:Number = (b2.m_sweep.c.y + r2Y);
var dX:Number = (p2X - p1X);
var dY:Number = (p2Y - p1Y);
tMat = b1.m_xf.R;
var ay1X:Number = ((tMat.col1.x * m_localYAxis1.x) + (tMat.col2.x * m_localYAxis1.y));
var ay1Y:Number = ((tMat.col1.y * m_localYAxis1.x) + (tMat.col2.y * m_localYAxis1.y));
var linearC:Number = ((ay1X * dX) + (ay1Y * dY));
linearC = b2Math.b2Clamp(linearC, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
var linearImpulse:Number = (-(m_linearMass) * linearC);
b1.m_sweep.c.x = (b1.m_sweep.c.x + ((invMass1 * linearImpulse) * m_linearJacobian.linear1.x));
b1.m_sweep.c.y = (b1.m_sweep.c.y + ((invMass1 * linearImpulse) * m_linearJacobian.linear1.y));
b1.m_sweep.a = (b1.m_sweep.a + ((invI1 * linearImpulse) * m_linearJacobian.angular1));
b2.m_sweep.c.x = (b2.m_sweep.c.x + ((invMass2 * linearImpulse) * m_linearJacobian.linear2.x));
b2.m_sweep.c.y = (b2.m_sweep.c.y + ((invMass2 * linearImpulse) * m_linearJacobian.linear2.y));
b2.m_sweep.a = (b2.m_sweep.a + ((invI2 * linearImpulse) * m_linearJacobian.angular2));
var positionError:Number = b2Math.b2Abs(linearC);
var angularC:Number = ((b2.m_sweep.a - b1.m_sweep.a) - m_refAngle);
angularC = b2Math.b2Clamp(angularC, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
var angularImpulse:Number = (-(m_angularMass) * angularC);
b1.m_sweep.a = (b1.m_sweep.a - (b1.m_invI * angularImpulse));
b2.m_sweep.a = (b2.m_sweep.a + (b2.m_invI * angularImpulse));
b1.SynchronizeTransform();
b2.SynchronizeTransform();
var angularError:Number = b2Math.b2Abs(angularC);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
tMat = b1.m_xf.R;
r1X = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
r1Y = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
r2X = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
r2Y = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
p1X = (b1.m_sweep.c.x + r1X);
p1Y = (b1.m_sweep.c.y + r1Y);
p2X = (b2.m_sweep.c.x + r2X);
p2Y = (b2.m_sweep.c.y + r2Y);
dX = (p2X - p1X);
dY = (p2Y - p1Y);
tMat = b1.m_xf.R;
ax1X = ((tMat.col1.x * m_localXAxis1.x) + (tMat.col2.x * m_localXAxis1.y));
ax1Y = ((tMat.col1.y * m_localXAxis1.x) + (tMat.col2.y * m_localXAxis1.y));
translation = ((ax1X * dX) + (ax1Y * dY));
limitImpulse = 0;
if (m_limitState == e_equalLimits){
limitC = b2Math.b2Clamp(translation, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
limitImpulse = (-(m_motorMass) * limitC);
positionError = b2Math.b2Max(positionError, b2Math.b2Abs(angularC));
} else {
if (m_limitState == e_atLowerLimit){
limitC = (translation - m_lowerTranslation);
positionError = b2Math.b2Max(positionError, -(limitC));
limitC = b2Math.b2Clamp((limitC + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
limitImpulse = (-(m_motorMass) * limitC);
oldLimitImpulse = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + limitImpulse), 0);
limitImpulse = (m_limitPositionImpulse - oldLimitImpulse);
} else {
if (m_limitState == e_atUpperLimit){
limitC = (translation - m_upperTranslation);
positionError = b2Math.b2Max(positionError, limitC);
limitC = b2Math.b2Clamp((limitC - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
limitImpulse = (-(m_motorMass) * limitC);
oldLimitImpulse = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + limitImpulse), 0);
limitImpulse = (m_limitPositionImpulse - oldLimitImpulse);
};
};
};
b1.m_sweep.c.x = (b1.m_sweep.c.x + ((invMass1 * limitImpulse) * m_motorJacobian.linear1.x));
b1.m_sweep.c.y = (b1.m_sweep.c.y + ((invMass1 * limitImpulse) * m_motorJacobian.linear1.y));
b1.m_sweep.a = (b1.m_sweep.a + ((invI1 * limitImpulse) * m_motorJacobian.angular1));
b2.m_sweep.c.x = (b2.m_sweep.c.x + ((invMass2 * limitImpulse) * m_motorJacobian.linear2.x));
b2.m_sweep.c.y = (b2.m_sweep.c.y + ((invMass2 * limitImpulse) * m_motorJacobian.linear2.y));
b2.m_sweep.a = (b2.m_sweep.a + ((invI2 * limitImpulse) * m_motorJacobian.angular2));
b1.SynchronizeTransform();
b2.SynchronizeTransform();
};
return ((((positionError <= b2Settings.b2_linearSlop)) && ((angularError <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(speed:Number):void{
m_motorSpeed = speed;
}
public function GetJointSpeed():Number{
var tMat:b2Mat22;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var p1X:Number = (b1.m_sweep.c.x + r1X);
var p1Y:Number = (b1.m_sweep.c.y + r1Y);
var p2X:Number = (b2.m_sweep.c.x + r2X);
var p2Y:Number = (b2.m_sweep.c.y + r2Y);
var dX:Number = (p2X - p1X);
var dY:Number = (p2Y - p1Y);
var axis:b2Vec2 = b1.GetWorldVector(m_localXAxis1);
var v1:b2Vec2 = b1.m_linearVelocity;
var v2:b2Vec2 = b2.m_linearVelocity;
var w1:Number = b1.m_angularVelocity;
var w2:Number = b2.m_angularVelocity;
var speed:Number = (((dX * (-(w1) * axis.y)) + (dY * (w1 * axis.x))) + ((axis.x * (((v2.x + (-(w2) * r2Y)) - v1.x) - (-(w1) * r1Y))) + (axis.y * (((v2.y + (w2 * r2X)) - v1.y) - (w1 * r1X)))));
return (speed);
}
override public function InitVelocityConstraints(step:b2TimeStep):void{
var tMat:b2Mat22;
var tX:Number;
var ax1X:Number;
var ax1Y:Number;
var dX:Number;
var dY:Number;
var jointTranslation:Number;
var P1X:Number;
var P1Y:Number;
var P2X:Number;
var P2Y:Number;
var L1:Number;
var L2:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var invMass1:Number = b1.m_invMass;
var invMass2:Number = b2.m_invMass;
var invI1:Number = b1.m_invI;
var invI2:Number = b2.m_invI;
tMat = b1.m_xf.R;
var ay1X:Number = ((tMat.col1.x * m_localYAxis1.x) + (tMat.col2.x * m_localYAxis1.y));
var ay1Y:Number = ((tMat.col1.y * m_localYAxis1.x) + (tMat.col2.y * m_localYAxis1.y));
var eX:Number = ((b2.m_sweep.c.x + r2X) - b1.m_sweep.c.x);
var eY:Number = ((b2.m_sweep.c.y + r2Y) - b1.m_sweep.c.y);
m_linearJacobian.linear1.x = -(ay1X);
m_linearJacobian.linear1.y = -(ay1Y);
m_linearJacobian.linear2.x = ay1X;
m_linearJacobian.linear2.y = ay1Y;
m_linearJacobian.angular1 = -(((eX * ay1Y) - (eY * ay1X)));
m_linearJacobian.angular2 = ((r2X * ay1Y) - (r2Y * ay1X));
m_linearMass = (((invMass1 + ((invI1 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + invMass2) + ((invI2 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (invI1 + invI2);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
tMat = b1.m_xf.R;
ax1X = ((tMat.col1.x * m_localXAxis1.x) + (tMat.col2.x * m_localXAxis1.y));
ax1Y = ((tMat.col1.y * m_localXAxis1.x) + (tMat.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(ax1X);
m_motorJacobian.linear1.y = -(ax1Y);
m_motorJacobian.linear2.x = ax1X;
m_motorJacobian.linear2.y = ax1Y;
m_motorJacobian.angular1 = -(((eX * ax1Y) - (eY * ax1X)));
m_motorJacobian.angular2 = ((r2X * ax1Y) - (r2Y * ax1X));
m_motorMass = (((invMass1 + ((invI1 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + invMass2) + ((invI2 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
dX = (eX - r1X);
dY = (eY - r1Y);
jointTranslation = ((ax1X * dX) + (ax1Y * dY));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (jointTranslation <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (jointTranslation >= 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 (step.warmStarting){
P1X = (step.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
P1Y = (step.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
P2X = (step.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
P2Y = (step.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
L1 = (step.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
L2 = (step.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + (invMass1 * P1X));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + (invMass1 * P1Y));
b1.m_angularVelocity = (b1.m_angularVelocity + (invI1 * L1));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (invMass2 * P2X));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (invMass2 * P2Y));
b2.m_angularVelocity = (b2.m_angularVelocity + (invI2 * L2));
} 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(flag:Boolean):void{
m_enableLimit = flag;
}
public function SetMaxMotorForce(force:Number):void{
m_maxMotorForce = force;
}
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(lower:Number, upper:Number):void{
m_lowerTranslation = lower;
m_upperTranslation = upper;
}
}
}//package Box2D.Dynamics.Joints
Section 69
//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(b1:b2Body, b2:b2Body, anchor:b2Vec2, axis:b2Vec2):void{
body1 = b1;
body2 = b2;
localAnchor1 = body1.GetLocalPoint(anchor);
localAnchor2 = body2.GetLocalPoint(anchor);
localAxis1 = body1.GetLocalVector(axis);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 70
//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(def:b2PulleyJointDef){
var tMat:b2Mat22;
var tX:Number;
var tY: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(def);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (def.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (def.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (def.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (def.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(def.localAnchor1);
m_localAnchor2.SetV(def.localAnchor2);
m_ratio = def.ratio;
m_constant = (def.length1 + (m_ratio * def.length2));
m_maxLength1 = b2Math.b2Min(def.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(def.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var a:b2Vec2 = m_ground.m_xf.position.Copy();
a.Add(m_groundAnchor2);
return (a);
}
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 F:b2Vec2 = m_u2.Copy();
F.Multiply(m_force);
return (F);
}
override public function SolvePositionConstraints():Boolean{
var tMat:b2Mat22;
var r1X:Number;
var r1Y:Number;
var r2X:Number;
var r2Y:Number;
var p1X:Number;
var p1Y:Number;
var p2X:Number;
var p2Y:Number;
var length1:Number;
var length2:Number;
var C:Number;
var impulse:Number;
var oldImpulse:Number;
var oldLimitPositionImpulse:Number;
var tX:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
var s1X:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var s1Y:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var s2X:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var s2Y:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var linearError:Number = 0;
if (m_state == e_atUpperLimit){
tMat = b1.m_xf.R;
r1X = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
r1Y = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
r2X = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
r2Y = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
p1X = (b1.m_sweep.c.x + r1X);
p1Y = (b1.m_sweep.c.y + r1Y);
p2X = (b2.m_sweep.c.x + r2X);
p2Y = (b2.m_sweep.c.y + r2Y);
m_u1.Set((p1X - s1X), (p1Y - s1Y));
m_u2.Set((p2X - s2X), (p2Y - s2Y));
length1 = m_u1.Length();
length2 = m_u2.Length();
if (length1 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / length1));
} else {
m_u1.SetZero();
};
if (length2 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / length2));
} else {
m_u2.SetZero();
};
C = ((m_constant - length1) - (m_ratio * length2));
linearError = b2Math.b2Max(linearError, -(C));
C = b2Math.b2Clamp((C + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
impulse = (-(m_pulleyMass) * C);
oldImpulse = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + impulse));
impulse = (m_positionImpulse - oldImpulse);
p1X = (-(impulse) * m_u1.x);
p1Y = (-(impulse) * m_u1.y);
p2X = ((-(m_ratio) * impulse) * m_u2.x);
p2Y = ((-(m_ratio) * impulse) * m_u2.y);
b1.m_sweep.c.x = (b1.m_sweep.c.x + (b1.m_invMass * p1X));
b1.m_sweep.c.y = (b1.m_sweep.c.y + (b1.m_invMass * p1Y));
b1.m_sweep.a = (b1.m_sweep.a + (b1.m_invI * ((r1X * p1Y) - (r1Y * p1X))));
b2.m_sweep.c.x = (b2.m_sweep.c.x + (b2.m_invMass * p2X));
b2.m_sweep.c.y = (b2.m_sweep.c.y + (b2.m_invMass * p2Y));
b2.m_sweep.a = (b2.m_sweep.a + (b2.m_invI * ((r2X * p2Y) - (r2Y * p2X))));
b1.SynchronizeTransform();
b2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
tMat = b1.m_xf.R;
r1X = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
r1Y = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
p1X = (b1.m_sweep.c.x + r1X);
p1Y = (b1.m_sweep.c.y + r1Y);
m_u1.Set((p1X - s1X), (p1Y - s1Y));
length1 = m_u1.Length();
if (length1 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / length1));
m_u1.y = (m_u1.y * (1 / length1));
} else {
m_u1.SetZero();
};
C = (m_maxLength1 - length1);
linearError = b2Math.b2Max(linearError, -(C));
C = b2Math.b2Clamp((C + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
impulse = (-(m_limitMass1) * C);
oldLimitPositionImpulse = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + impulse));
impulse = (m_limitPositionImpulse1 - oldLimitPositionImpulse);
p1X = (-(impulse) * m_u1.x);
p1Y = (-(impulse) * m_u1.y);
b1.m_sweep.c.x = (b1.m_sweep.c.x + (b1.m_invMass * p1X));
b1.m_sweep.c.y = (b1.m_sweep.c.y + (b1.m_invMass * p1Y));
b1.m_sweep.a = (b1.m_sweep.a + (b1.m_invI * ((r1X * p1Y) - (r1Y * p1X))));
b1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
tMat = b2.m_xf.R;
r2X = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
r2Y = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
p2X = (b2.m_sweep.c.x + r2X);
p2Y = (b2.m_sweep.c.y + r2Y);
m_u2.Set((p2X - s2X), (p2Y - s2Y));
length2 = m_u2.Length();
if (length2 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / length2));
m_u2.y = (m_u2.y * (1 / length2));
} else {
m_u2.SetZero();
};
C = (m_maxLength2 - length2);
linearError = b2Math.b2Max(linearError, -(C));
C = b2Math.b2Clamp((C + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
impulse = (-(m_limitMass2) * C);
oldLimitPositionImpulse = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + impulse));
impulse = (m_limitPositionImpulse2 - oldLimitPositionImpulse);
p2X = (-(impulse) * m_u2.x);
p2Y = (-(impulse) * m_u2.y);
b2.m_sweep.c.x = (b2.m_sweep.c.x + (b2.m_invMass * p2X));
b2.m_sweep.c.y = (b2.m_sweep.c.y + (b2.m_invMass * p2Y));
b2.m_sweep.a = (b2.m_sweep.a + (b2.m_invI * ((r2X * p2Y) - (r2Y * p2X))));
b2.SynchronizeTransform();
};
return ((linearError < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(step:b2TimeStep):void{
var tMat:b2Mat22;
var P1X:Number;
var P1Y:Number;
var P2X:Number;
var P2Y:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var p1X:Number = (b1.m_sweep.c.x + r1X);
var p1Y:Number = (b1.m_sweep.c.y + r1Y);
var p2X:Number = (b2.m_sweep.c.x + r2X);
var p2Y:Number = (b2.m_sweep.c.y + r2Y);
var s1X:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var s1Y:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var s2X:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var s2Y:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((p1X - s1X), (p1Y - s1Y));
m_u2.Set((p2X - s2X), (p2Y - s2Y));
var length1:Number = m_u1.Length();
var length2:Number = m_u2.Length();
if (length1 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / length1));
} else {
m_u1.SetZero();
};
if (length2 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / length2));
} else {
m_u2.SetZero();
};
var C:Number = ((m_constant - length1) - (m_ratio * length2));
if (C > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (length1 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (length2 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
var cr1u1:Number = ((r1X * m_u1.y) - (r1Y * m_u1.x));
var cr2u2:Number = ((r2X * m_u2.y) - (r2Y * m_u2.x));
m_limitMass1 = (b1.m_invMass + ((b1.m_invI * cr1u1) * cr1u1));
m_limitMass2 = (b2.m_invMass + ((b2.m_invI * cr2u2) * cr2u2));
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 (step.warmStarting){
P1X = ((step.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
P1Y = ((step.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
P2X = ((step.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
P2Y = ((step.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + (b1.m_invMass * P1X));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + (b1.m_invMass * P1Y));
b1.m_angularVelocity = (b1.m_angularVelocity + (b1.m_invI * ((r1X * P1Y) - (r1Y * P1X))));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (b2.m_invMass * P2X));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (b2.m_invMass * P2Y));
b2.m_angularVelocity = (b2.m_angularVelocity + (b2.m_invI * ((r2X * P2Y) - (r2Y * P2X))));
} 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(step:b2TimeStep):void{
var tMat:b2Mat22;
var r2X:Number;
var v1X:Number;
var v1Y:Number;
var v2X:Number;
var v2Y:Number;
var P1X:Number;
var P1Y:Number;
var P2X:Number;
var P2Y:Number;
var Cdot:Number;
var force:Number;
var oldForce:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
r2X = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
if (m_state == e_atUpperLimit){
v1X = (b1.m_linearVelocity.x + (-(b1.m_angularVelocity) * r1Y));
v1Y = (b1.m_linearVelocity.y + (b1.m_angularVelocity * r1X));
v2X = (b2.m_linearVelocity.x + (-(b2.m_angularVelocity) * r2Y));
v2Y = (b2.m_linearVelocity.y + (b2.m_angularVelocity * r2X));
Cdot = (-(((m_u1.x * v1X) + (m_u1.y * v1Y))) - (m_ratio * ((m_u2.x * v2X) + (m_u2.y * v2Y))));
force = ((-(step.inv_dt) * m_pulleyMass) * Cdot);
oldForce = m_force;
m_force = b2Math.b2Max(0, (m_force + force));
force = (m_force - oldForce);
P1X = ((-(step.dt) * force) * m_u1.x);
P1Y = ((-(step.dt) * force) * m_u1.y);
P2X = (((-(step.dt) * m_ratio) * force) * m_u2.x);
P2Y = (((-(step.dt) * m_ratio) * force) * m_u2.y);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + (b1.m_invMass * P1X));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + (b1.m_invMass * P1Y));
b1.m_angularVelocity = (b1.m_angularVelocity + (b1.m_invI * ((r1X * P1Y) - (r1Y * P1X))));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (b2.m_invMass * P2X));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (b2.m_invMass * P2Y));
b2.m_angularVelocity = (b2.m_angularVelocity + (b2.m_invI * ((r2X * P2Y) - (r2Y * P2X))));
};
if (m_limitState1 == e_atUpperLimit){
v1X = (b1.m_linearVelocity.x + (-(b1.m_angularVelocity) * r1Y));
v1Y = (b1.m_linearVelocity.y + (b1.m_angularVelocity * r1X));
Cdot = -(((m_u1.x * v1X) + (m_u1.y * v1Y)));
force = ((-(step.inv_dt) * m_limitMass1) * Cdot);
oldForce = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + force));
force = (m_limitForce1 - oldForce);
P1X = ((-(step.dt) * force) * m_u1.x);
P1Y = ((-(step.dt) * force) * m_u1.y);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x + (b1.m_invMass * P1X));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y + (b1.m_invMass * P1Y));
b1.m_angularVelocity = (b1.m_angularVelocity + (b1.m_invI * ((r1X * P1Y) - (r1Y * P1X))));
};
if (m_limitState2 == e_atUpperLimit){
v2X = (b2.m_linearVelocity.x + (-(b2.m_angularVelocity) * r2Y));
v2Y = (b2.m_linearVelocity.y + (b2.m_angularVelocity * r2X));
Cdot = -(((m_u2.x * v2X) + (m_u2.y * v2Y)));
force = ((-(step.inv_dt) * m_limitMass2) * Cdot);
oldForce = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + force));
force = (m_limitForce2 - oldForce);
P2X = ((-(step.dt) * force) * m_u2.x);
P2Y = ((-(step.dt) * force) * m_u2.y);
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (b2.m_invMass * P2X));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (b2.m_invMass * P2Y));
b2.m_angularVelocity = (b2.m_angularVelocity + (b2.m_invI * ((r2X * P2Y) - (r2Y * P2X))));
};
}
public function GetLength1():Number{
var p:b2Vec2 = m_body1.GetWorldPoint(m_localAnchor1);
var sX:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x);
var sY:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y);
var dX:Number = (p.x - sX);
var dY:Number = (p.y - sY);
return (Math.sqrt(((dX * dX) + (dY * dY))));
}
public function GetLength2():Number{
var p:b2Vec2 = m_body2.GetWorldPoint(m_localAnchor2);
var sX:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x);
var sY:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y);
var dX:Number = (p.x - sX);
var dY:Number = (p.y - sY);
return (Math.sqrt(((dX * dX) + (dY * dY))));
}
public function GetGroundAnchor1():b2Vec2{
var a:b2Vec2 = m_ground.m_xf.position.Copy();
a.Add(m_groundAnchor1);
return (a);
}
}
}//package Box2D.Dynamics.Joints
Section 71
//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(b1:b2Body, b2:b2Body, ga1:b2Vec2, ga2:b2Vec2, anchor1:b2Vec2, anchor2:b2Vec2, r:Number):void{
body1 = b1;
body2 = b2;
groundAnchor1.SetV(ga1);
groundAnchor2.SetV(ga2);
localAnchor1 = body1.GetLocalPoint(anchor1);
localAnchor2 = body2.GetLocalPoint(anchor2);
var d1X:Number = (anchor1.x - ga1.x);
var d1Y:Number = (anchor1.y - ga1.y);
length1 = Math.sqrt(((d1X * d1X) + (d1Y * d1Y)));
var d2X:Number = (anchor2.x - ga2.x);
var d2Y:Number = (anchor2.y - ga2.y);
length2 = Math.sqrt(((d2X * d2X) + (d2Y * d2Y)));
ratio = r;
var C:Number = (length1 + (ratio * length2));
maxLength1 = (C - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((C - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 72
//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(def: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(def);
m_localAnchor1.SetV(def.localAnchor1);
m_localAnchor2.SetV(def.localAnchor2);
m_referenceAngle = def.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = def.lowerAngle;
m_upperAngle = def.upperAngle;
m_maxMotorTorque = def.maxMotorTorque;
m_motorSpeed = def.motorSpeed;
m_enableLimit = def.enableLimit;
m_enableMotor = def.enableMotor;
}
override public function SolveVelocityConstraints(step:b2TimeStep):void{
var tMat:b2Mat22;
var tX:Number;
var oldLimitForce:Number;
var PY:Number;
var motorCdot:Number;
var motorForce:Number;
var oldMotorForce:Number;
var limitCdot:Number;
var limitForce:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var pivotCdotX:Number = (((b2.m_linearVelocity.x + (-(b2.m_angularVelocity) * r2Y)) - b1.m_linearVelocity.x) - (-(b1.m_angularVelocity) * r1Y));
var pivotCdotY:Number = (((b2.m_linearVelocity.y + (b2.m_angularVelocity * r2X)) - b1.m_linearVelocity.y) - (b1.m_angularVelocity * r1X));
var pivotForceX:Number = (-(step.inv_dt) * ((m_pivotMass.col1.x * pivotCdotX) + (m_pivotMass.col2.x * pivotCdotY)));
var pivotForceY:Number = (-(step.inv_dt) * ((m_pivotMass.col1.y * pivotCdotX) + (m_pivotMass.col2.y * pivotCdotY)));
m_pivotForce.x = (m_pivotForce.x + pivotForceX);
m_pivotForce.y = (m_pivotForce.y + pivotForceY);
var PX:Number = (step.dt * pivotForceX);
PY = (step.dt * pivotForceY);
b1.m_linearVelocity.x = (b1.m_linearVelocity.x - (b1.m_invMass * PX));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y - (b1.m_invMass * PY));
b1.m_angularVelocity = (b1.m_angularVelocity - (b1.m_invI * ((r1X * PY) - (r1Y * PX))));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + (b2.m_invMass * PX));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + (b2.m_invMass * PY));
b2.m_angularVelocity = (b2.m_angularVelocity + (b2.m_invI * ((r2X * PY) - (r2Y * PX))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
motorCdot = ((b2.m_angularVelocity - b1.m_angularVelocity) - m_motorSpeed);
motorForce = ((-(step.inv_dt) * m_motorMass) * motorCdot);
oldMotorForce = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + motorForce), -(m_maxMotorTorque), m_maxMotorTorque);
motorForce = (m_motorForce - oldMotorForce);
b1.m_angularVelocity = (b1.m_angularVelocity - ((b1.m_invI * step.dt) * motorForce));
b2.m_angularVelocity = (b2.m_angularVelocity + ((b2.m_invI * step.dt) * motorForce));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
limitCdot = (b2.m_angularVelocity - b1.m_angularVelocity);
limitForce = ((-(step.inv_dt) * m_motorMass) * limitCdot);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + limitForce);
} else {
if (m_limitState == e_atLowerLimit){
oldLimitForce = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + limitForce), 0);
limitForce = (m_limitForce - oldLimitForce);
} else {
if (m_limitState == e_atUpperLimit){
oldLimitForce = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + limitForce), 0);
limitForce = (m_limitForce - oldLimitForce);
};
};
};
b1.m_angularVelocity = (b1.m_angularVelocity - ((b1.m_invI * step.dt) * limitForce));
b2.m_angularVelocity = (b2.m_angularVelocity + ((b2.m_invI * step.dt) * limitForce));
};
}
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(flag:Boolean):void{
m_enableMotor = flag;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var oldLimitImpulse:Number;
var limitC:Number;
var tMat:b2Mat22;
var angle:Number;
var limitImpulse:Number;
var b1:b2Body = m_body1;
var b2:b2Body = m_body2;
var positionError:Number = 0;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
var r1Y:Number = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
var tX:Number = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var p1X:Number = (b1.m_sweep.c.x + r1X);
var p1Y:Number = (b1.m_sweep.c.y + r1Y);
var p2X:Number = (b2.m_sweep.c.x + r2X);
var p2Y:Number = (b2.m_sweep.c.y + r2Y);
var ptpCX:Number = (p2X - p1X);
var ptpCY:Number = (p2Y - p1Y);
positionError = Math.sqrt(((ptpCX * ptpCX) + (ptpCY * ptpCY)));
var invMass1:Number = b1.m_invMass;
var invMass2:Number = b2.m_invMass;
var invI1:Number = b1.m_invI;
var invI2:Number = b2.m_invI;
K1.col1.x = (invMass1 + invMass2);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (invMass1 + invMass2);
K2.col1.x = ((invI1 * r1Y) * r1Y);
K2.col2.x = ((-(invI1) * r1X) * r1Y);
K2.col1.y = ((-(invI1) * r1X) * r1Y);
K2.col2.y = ((invI1 * r1X) * r1X);
K3.col1.x = ((invI2 * r2Y) * r2Y);
K3.col2.x = ((-(invI2) * r2X) * r2Y);
K3.col1.y = ((-(invI2) * r2X) * r2Y);
K3.col2.y = ((invI2 * r2X) * r2X);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(ptpCX), -(ptpCY));
var impulseX:Number = tImpulse.x;
var impulseY:Number = tImpulse.y;
b1.m_sweep.c.x = (b1.m_sweep.c.x - (b1.m_invMass * impulseX));
b1.m_sweep.c.y = (b1.m_sweep.c.y - (b1.m_invMass * impulseY));
b1.m_sweep.a = (b1.m_sweep.a - (b1.m_invI * ((r1X * impulseY) - (r1Y * impulseX))));
b2.m_sweep.c.x = (b2.m_sweep.c.x + (b2.m_invMass * impulseX));
b2.m_sweep.c.y = (b2.m_sweep.c.y + (b2.m_invMass * impulseY));
b2.m_sweep.a = (b2.m_sweep.a + (b2.m_invI * ((r2X * impulseY) - (r2Y * impulseX))));
b1.SynchronizeTransform();
b2.SynchronizeTransform();
var angularError:Number = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
angle = ((b2.m_sweep.a - b1.m_sweep.a) - m_referenceAngle);
limitImpulse = 0;
if (m_limitState == e_equalLimits){
limitC = b2Math.b2Clamp(angle, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
limitImpulse = (-(m_motorMass) * limitC);
angularError = b2Math.b2Abs(limitC);
} else {
if (m_limitState == e_atLowerLimit){
limitC = (angle - m_lowerAngle);
angularError = b2Math.b2Max(0, -(limitC));
limitC = b2Math.b2Clamp((limitC + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
limitImpulse = (-(m_motorMass) * limitC);
oldLimitImpulse = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + limitImpulse), 0);
limitImpulse = (m_limitPositionImpulse - oldLimitImpulse);
} else {
if (m_limitState == e_atUpperLimit){
limitC = (angle - m_upperAngle);
angularError = b2Math.b2Max(0, limitC);
limitC = b2Math.b2Clamp((limitC - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
limitImpulse = (-(m_motorMass) * limitC);
oldLimitImpulse = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + limitImpulse), 0);
limitImpulse = (m_limitPositionImpulse - oldLimitImpulse);
};
};
};
b1.m_sweep.a = (b1.m_sweep.a - (b1.m_invI * limitImpulse));
b2.m_sweep.a = (b2.m_sweep.a + (b2.m_invI * limitImpulse));
b1.SynchronizeTransform();
b2.SynchronizeTransform();
};
return ((((positionError <= b2Settings.b2_linearSlop)) && ((angularError <= b2Settings.b2_angularSlop))));
}
public function SetMotorSpeed(speed:Number):void{
m_motorSpeed = speed;
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMaxMotorTorque(torque:Number):void{
m_maxMotorTorque = torque;
}
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(step:b2TimeStep):void{
var b1:b2Body;
var b2:b2Body;
var tMat:b2Mat22;
var tX:Number;
var r1Y:Number;
var jointAngle:Number;
b1 = m_body1;
b2 = m_body2;
tMat = b1.m_xf.R;
var r1X:Number = (m_localAnchor1.x - b1.m_sweep.localCenter.x);
r1Y = (m_localAnchor1.y - b1.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r1X) + (tMat.col2.x * r1Y));
r1Y = ((tMat.col1.y * r1X) + (tMat.col2.y * r1Y));
r1X = tX;
tMat = b2.m_xf.R;
var r2X:Number = (m_localAnchor2.x - b2.m_sweep.localCenter.x);
var r2Y:Number = (m_localAnchor2.y - b2.m_sweep.localCenter.y);
tX = ((tMat.col1.x * r2X) + (tMat.col2.x * r2Y));
r2Y = ((tMat.col1.y * r2X) + (tMat.col2.y * r2Y));
r2X = tX;
var invMass1:Number = b1.m_invMass;
var invMass2:Number = b2.m_invMass;
var invI1:Number = b1.m_invI;
var invI2:Number = b2.m_invI;
K1.col1.x = (invMass1 + invMass2);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (invMass1 + invMass2);
K2.col1.x = ((invI1 * r1Y) * r1Y);
K2.col2.x = ((-(invI1) * r1X) * r1Y);
K2.col1.y = ((-(invI1) * r1X) * r1Y);
K2.col2.y = ((invI1 * r1X) * r1X);
K3.col1.x = ((invI2 * r2Y) * r2Y);
K3.col2.x = ((-(invI2) * r2X) * r2Y);
K3.col1.y = ((-(invI2) * r2X) * r2Y);
K3.col2.y = ((invI2 * r2X) * r2X);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (invI1 + invI2));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
jointAngle = ((b2.m_sweep.a - b1.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (jointAngle <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (jointAngle >= 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 (step.warmStarting){
b1.m_linearVelocity.x = (b1.m_linearVelocity.x - ((step.dt * invMass1) * m_pivotForce.x));
b1.m_linearVelocity.y = (b1.m_linearVelocity.y - ((step.dt * invMass1) * m_pivotForce.y));
b1.m_angularVelocity = (b1.m_angularVelocity - ((step.dt * invI1) * ((((r1X * m_pivotForce.y) - (r1Y * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
b2.m_linearVelocity.x = (b2.m_linearVelocity.x + ((step.dt * invMass2) * m_pivotForce.x));
b2.m_linearVelocity.y = (b2.m_linearVelocity.y + ((step.dt * invMass2) * m_pivotForce.y));
b2.m_angularVelocity = (b2.m_angularVelocity + ((step.dt * invI2) * ((((r2X * m_pivotForce.y) - (r2Y * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(flag:Boolean):void{
m_enableLimit = flag;
}
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(lower:Number, upper:Number):void{
m_lowerAngle = lower;
m_upperAngle = upper;
}
}
}//package Box2D.Dynamics.Joints
Section 73
//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(b1:b2Body, b2:b2Body, anchor:b2Vec2):void{
body1 = b1;
body2 = b2;
localAnchor1 = body1.GetLocalPoint(anchor);
localAnchor2 = body2.GetLocalPoint(anchor);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 74
//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(bd:b2BodyDef, world:b2World){
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (bd.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (bd.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (bd.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (bd.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = world;
m_xf.position.SetV(bd.position);
m_xf.R.Set(bd.angle);
m_sweep.localCenter.SetV(bd.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = bd.angle);
var tMat:b2Mat22 = m_xf.R;
var tVec:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
m_sweep.c.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.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 = bd.linearDamping;
m_angularDamping = bd.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 = bd.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = bd.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 = bd.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(worldPoint:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (worldPoint.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (worldPoint.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(v:b2Vec2):void{
m_linearVelocity.SetV(v);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(torque:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + torque);
}
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 tMat:b2Mat22 = m_xf.R;
var tVec:b2Vec2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
m_xf.position.y = (m_sweep.c.y - ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var s:b2Shape;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
var centerX:Number = 0;
var centerY:Number = 0;
var massData:b2MassData = s_massData;
s = m_shapeList;
while (s) {
s.ComputeMass(massData);
m_mass = (m_mass + massData.mass);
centerX = (centerX + (massData.mass * massData.center.x));
centerY = (centerY + (massData.mass * massData.center.y));
m_I = (m_I + massData.I);
s = s.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
centerX = (centerX * m_invMass);
centerY = (centerY * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((centerX * centerX) + (centerY * centerY))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(centerX, centerY);
var tMat:b2Mat22 = m_xf.R;
var tVec:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
m_sweep.c.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.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);
s = m_shapeList;
while (s) {
s.UpdateSweepRadius(m_sweep.localCenter);
s = s.m_next;
};
var oldType:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (oldType != m_type){
s = m_shapeList;
while (s) {
s.RefilterProxy(m_world.m_broadPhase, m_xf);
s = s.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(position:b2Vec2, angle:Number):Boolean{
var s:b2Shape;
var inRange:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(angle);
m_xf.position.SetV(position);
var tMat:b2Mat22 = m_xf.R;
var tVec:b2Vec2 = m_sweep.localCenter;
m_sweep.c.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
m_sweep.c.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.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 = angle);
var freeze:Boolean;
s = m_shapeList;
while (s) {
inRange = s.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (inRange == false){
freeze = true;
break;
};
s = s.m_next;
};
if (freeze == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
s = m_shapeList;
while (s) {
s.DestroyProxy(m_world.m_broadPhase);
s = s.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(worldPoint:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, worldPoint));
}
public function ApplyForce(force:b2Vec2, point:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + force.x);
m_force.y = (m_force.y + force.y);
m_torque = (m_torque + (((point.x - m_sweep.c.x) * force.y) - ((point.y - m_sweep.c.y) * force.x)));
}
public function SynchronizeShapes():Boolean{
var s:b2Shape;
var xf1:b2XForm = s_xf1;
xf1.R.Set(m_sweep.a0);
var tMat:b2Mat22 = xf1.R;
var tVec:b2Vec2 = m_sweep.localCenter;
xf1.position.x = (m_sweep.c0.x - ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
xf1.position.y = (m_sweep.c0.y - ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
var inRange:Boolean;
s = m_shapeList;
while (s) {
inRange = s.Synchronize(m_world.m_broadPhase, xf1, m_xf);
if (inRange == false){
break;
};
s = s.m_next;
};
if (inRange == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
s = m_shapeList;
while (s) {
s.DestroyProxy(m_world.m_broadPhase);
s = s.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function GetLinearVelocityFromLocalPoint(localPoint:b2Vec2):b2Vec2{
var A:b2Mat22 = m_xf.R;
var worldPoint:b2Vec2 = new b2Vec2(((A.col1.x * localPoint.x) + (A.col2.x * localPoint.y)), ((A.col1.y * localPoint.x) + (A.col2.y * localPoint.y)));
worldPoint.x = (worldPoint.x + m_xf.position.x);
worldPoint.y = (worldPoint.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (worldPoint.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (worldPoint.x - m_sweep.c.x)))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function ApplyImpulse(impulse:b2Vec2, point:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * impulse.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * impulse.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((point.x - m_sweep.c.x) * impulse.y) - ((point.y - m_sweep.c.y) * impulse.x))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(omega:Number):void{
m_angularVelocity = omega;
}
public function SetMass(massData:b2MassData):void{
var s:b2Shape;
var tVec:b2Vec2;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(massData.center);
var tMat:b2Mat22 = m_xf.R;
tVec = m_sweep.localCenter;
m_sweep.c.x = ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y));
m_sweep.c.y = ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.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);
s = m_shapeList;
while (s) {
s.UpdateSweepRadius(m_sweep.localCenter);
s = s.m_next;
};
var oldType:int = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (oldType != m_type){
s = m_shapeList;
while (s) {
s.RefilterProxy(m_world.m_broadPhase, m_xf);
s = s.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(localVector:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, localVector));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(t:Number):void{
m_sweep.Advance(t);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(flag:Boolean):void{
if (flag){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(def:b2ShapeDef):b2Shape{
if (m_world.m_lock == true){
return (null);
};
var s:b2Shape = b2Shape.Create(def, m_world.m_blockAllocator);
s.m_next = m_shapeList;
m_shapeList = s;
m_shapeCount++;
s.m_body = this;
s.CreateProxy(m_world.m_broadPhase, m_xf);
s.UpdateSweepRadius(m_sweep.localCenter);
return (s);
}
public function IsConnected(other:b2Body):Boolean{
var jn:b2JointEdge = m_jointList;
while (jn) {
if (jn.other == other){
return ((jn.joint.m_collideConnected == false));
};
jn = jn.next;
};
return (false);
}
public function DestroyShape(s:b2Shape):void{
if (m_world.m_lock == true){
return;
};
s.DestroyProxy(m_world.m_broadPhase);
var node:b2Shape = m_shapeList;
var found:Boolean;
while (node != null) {
if (node == s){
node = s.m_next;
found = true;
break;
};
node = node.m_next;
};
s.m_body = null;
s.m_next = null;
m_shapeCount--;
b2Shape.Destroy(s, 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(flag:Boolean):void{
if (flag){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(data):void{
m_userData = data;
}
public function GetLocalVector(worldVector:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, worldVector));
}
public function GetWorldPoint(localPoint:b2Vec2):b2Vec2{
var A:b2Mat22 = m_xf.R;
var u:b2Vec2 = new b2Vec2(((A.col1.x * localPoint.x) + (A.col2.x * localPoint.y)), ((A.col1.y * localPoint.x) + (A.col2.y * localPoint.y)));
u.x = (u.x + m_xf.position.x);
u.y = (u.y + m_xf.position.y);
return (u);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 75
//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 76
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function b2BoundaryListener(){
super();
}
public function Violation(body:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 77
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function b2ContactFilter(){
super();
}
public function ShouldCollide(shape1:b2Shape, shape2:b2Shape):Boolean{
var filter1:b2FilterData = shape1.GetFilterData();
var filter2:b2FilterData = shape2.GetFilterData();
if ((((filter1.groupIndex == filter2.groupIndex)) && (!((filter1.groupIndex == 0))))){
return ((filter1.groupIndex > 0));
};
var collide:Boolean = ((!(((filter1.maskBits & filter2.categoryBits) == 0))) && (!(((filter1.categoryBits & filter2.maskBits) == 0))));
return (collide);
}
}
}//package Box2D.Dynamics
Section 78
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function b2ContactListener(){
super();
}
public function Add(point:b2ContactPoint):void{
}
public function Remove(point:b2ContactPoint):void{
}
public function Persist(point:b2ContactPoint):void{
}
public function Result(point:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 79
//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(proxyUserData1, proxyUserData2, pairUserData):void{
if (pairUserData == null){
return;
};
var c:b2Contact = (pairUserData as b2Contact);
if (c == m_nullContact){
return;
};
Destroy(c);
}
public function Destroy(c:b2Contact):void{
var b1:b2Body;
var b2:b2Body;
var manifolds:Array;
var cp:b2ContactPoint;
var i:int;
var manifold:b2Manifold;
var j:int;
var mp:b2ManifoldPoint;
var v1:b2Vec2;
var v2:b2Vec2;
var shape1:b2Shape = c.m_shape1;
var shape2:b2Shape = c.m_shape2;
var manifoldCount:int = c.m_manifoldCount;
if ((((manifoldCount > 0)) && (m_world.m_contactListener))){
b1 = shape1.m_body;
b2 = shape2.m_body;
manifolds = c.GetManifolds();
cp = s_evalCP;
cp.shape1 = c.m_shape1;
cp.shape2 = c.m_shape1;
cp.friction = c.m_friction;
cp.restitution = c.m_restitution;
i = 0;
while (i < manifoldCount) {
manifold = manifolds[i];
cp.normal.SetV(manifold.normal);
j = 0;
while (j < manifold.pointCount) {
mp = manifold.points[j];
cp.position = b1.GetWorldPoint(mp.localPoint1);
v1 = b1.GetLinearVelocityFromLocalPoint(mp.localPoint1);
v2 = b2.GetLinearVelocityFromLocalPoint(mp.localPoint2);
cp.velocity.Set((v2.x - v1.x), (v2.y - v1.y));
cp.separation = mp.separation;
cp.id.key = mp.id._key;
m_world.m_contactListener.Remove(cp);
j++;
};
i++;
};
};
if (c.m_prev){
c.m_prev.m_next = c.m_next;
};
if (c.m_next){
c.m_next.m_prev = c.m_prev;
};
if (c == m_world.m_contactList){
m_world.m_contactList = c.m_next;
};
var body1:b2Body = shape1.m_body;
var body2:b2Body = shape2.m_body;
if (c.m_node1.prev){
c.m_node1.prev.next = c.m_node1.next;
};
if (c.m_node1.next){
c.m_node1.next.prev = c.m_node1.prev;
};
if (c.m_node1 == body1.m_contactList){
body1.m_contactList = c.m_node1.next;
};
if (c.m_node2.prev){
c.m_node2.prev.next = c.m_node2.next;
};
if (c.m_node2.next){
c.m_node2.next.prev = c.m_node2.prev;
};
if (c.m_node2 == body2.m_contactList){
body2.m_contactList = c.m_node2.next;
};
b2Contact.Destroy(c, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
override public function PairAdded(proxyUserData1, proxyUserData2){
var shape1:b2Shape = (proxyUserData1 as b2Shape);
var shape2:b2Shape = (proxyUserData2 as b2Shape);
var body1:b2Body = shape1.m_body;
var body2:b2Body = shape2.m_body;
if (((body1.IsStatic()) && (body2.IsStatic()))){
return (m_nullContact);
};
if (shape1.m_body == shape2.m_body){
return (m_nullContact);
};
if (body2.IsConnected(body1)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(shape1, shape2) == false)))){
return (m_nullContact);
};
var c:b2Contact = b2Contact.Create(shape1, shape2, m_world.m_blockAllocator);
if (c == null){
return (m_nullContact);
};
shape1 = c.m_shape1;
shape2 = c.m_shape2;
body1 = shape1.m_body;
body2 = shape2.m_body;
c.m_prev = null;
c.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = c;
};
m_world.m_contactList = c;
c.m_node1.contact = c;
c.m_node1.other = body2;
c.m_node1.prev = null;
c.m_node1.next = body1.m_contactList;
if (body1.m_contactList != null){
body1.m_contactList.prev = c.m_node1;
};
body1.m_contactList = c.m_node1;
c.m_node2.contact = c;
c.m_node2.other = body1;
c.m_node2.prev = null;
c.m_node2.next = body2.m_contactList;
if (body2.m_contactList != null){
body2.m_contactList.prev = c.m_node2;
};
body2.m_contactList = c.m_node2;
m_world.m_contactCount++;
return (c);
}
public function Collide():void{
var body1:b2Body;
var body2:b2Body;
var c:b2Contact = m_world.m_contactList;
while (c) {
body1 = c.m_shape1.m_body;
body2 = c.m_shape2.m_body;
if (((body1.IsSleeping()) && (body2.IsSleeping()))){
} else {
c.Update(m_world.m_contactListener);
};
c = c.m_next;
};
}
}
}//package Box2D.Dynamics
Section 80
//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_lineThickness:Number;// = 1
public var m_drawFlags:uint;
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(){
super();
m_drawFlags = 0;
}
public function DrawPolyline(vertices:Array, vertexCount:int, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
var i = 1;
while (i < vertexCount) {
m_sprite.graphics.lineTo((vertices[i].x * m_drawScale), (vertices[i].y * m_drawScale));
i++;
};
}
public function DrawConcaveArc(vertices:Array, vertexCount:int, center:b2Vec2, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
var s_numSegs:Number = 16;
var dx:Number = (vertices[0].x - center.x);
var dy:Number = (vertices[0].y - center.y);
var theta1:Number = Math.atan2(dy, dx);
var theta2:Number = Math.atan2((vertices[1].y - center.y), (vertices[1].x - center.x));
var r:Number = Math.sqrt(((dx * dx) + (dy * dy)));
while (theta2 > theta1) {
theta2 = (theta2 - (Math.PI * 2));
};
var dtheta:Number = ((theta1 - theta2) / s_numSegs);
var theta:Number = theta1;
while (theta > theta2) {
m_sprite.graphics.lineTo(((center.x + (r * Math.cos(theta))) * m_drawScale), ((center.y + (r * Math.sin(theta))) * m_drawScale));
theta = (theta - dtheta);
};
var i = 1;
while (i < vertexCount) {
m_sprite.graphics.lineTo((vertices[i].x * m_drawScale), (vertices[i].y * m_drawScale));
i++;
};
m_sprite.graphics.lineTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
}
public function DrawSolidConcaveArc(vertices:Array, vertexCount:int, center:b2Vec2, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
m_sprite.graphics.beginFill(color.color, m_fillAlpha);
var s_numSegs:Number = 16;
var dx:Number = (vertices[0].x - center.x);
var dy:Number = (vertices[0].y - center.y);
var theta1:Number = Math.atan2(dy, dx);
var theta2:Number = Math.atan2((vertices[1].y - center.y), (vertices[1].x - center.x));
var r:Number = Math.sqrt(((dx * dx) + (dy * dy)));
while (theta2 > theta1) {
theta2 = (theta2 - (Math.PI * 2));
};
var dtheta:Number = ((theta1 - theta2) / s_numSegs);
var theta:Number = theta1;
while (theta > theta2) {
m_sprite.graphics.lineTo(((center.x + (r * Math.cos(theta))) * m_drawScale), ((center.y + (r * Math.sin(theta))) * m_drawScale));
theta = (theta - dtheta);
};
var i = 1;
while (i < vertexCount) {
m_sprite.graphics.lineTo((vertices[i].x * m_drawScale), (vertices[i].y * m_drawScale));
i++;
};
m_sprite.graphics.lineTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawSolidPolygon(vertices:Array, vertexCount:int, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
m_sprite.graphics.beginFill(color.color, m_fillAlpha);
var i = 1;
while (i < vertexCount) {
m_sprite.graphics.lineTo((vertices[i].x * m_drawScale), (vertices[i].y * m_drawScale));
i++;
};
m_sprite.graphics.lineTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(center:b2Vec2, radius:Number, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.drawCircle((center.x * m_drawScale), (center.y * m_drawScale), (radius * m_drawScale));
}
public function DrawSolidCircle(center:b2Vec2, radius:Number, axis:b2Vec2, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(color.color, m_fillAlpha);
m_sprite.graphics.drawCircle((center.x * m_drawScale), (center.y * m_drawScale), (radius * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((center.x * m_drawScale), (center.y * m_drawScale));
m_sprite.graphics.lineTo(((center.x + (axis.x * radius)) * m_drawScale), ((center.y + (axis.y * radius)) * m_drawScale));
}
public function DrawXForm(xf:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((xf.position.x * m_drawScale), (xf.position.y * m_drawScale));
m_sprite.graphics.lineTo(((xf.position.x + (m_xformScale * xf.R.col1.x)) * m_drawScale), ((xf.position.y + (m_xformScale * xf.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((xf.position.x * m_drawScale), (xf.position.y * m_drawScale));
m_sprite.graphics.lineTo(((xf.position.x + (m_xformScale * xf.R.col2.x)) * m_drawScale), ((xf.position.y + (m_xformScale * xf.R.col2.y)) * m_drawScale));
}
public function ClearFlags(flags:uint):void{
m_drawFlags = (m_drawFlags & ~(flags));
}
public function SetFlags(flags:uint):void{
m_drawFlags = flags;
}
public function DrawCurve(p1:b2Vec2, p2:b2Vec2, center:b2Vec2, color:b2Color):void{
var s_numSegs:Number = 16;
var dx:Number = (p1.x - center.x);
var dy:Number = (p1.y - center.y);
var theta1:Number = Math.atan2(dy, dx);
var theta2:Number = Math.atan2((p2.y - center.y), (p2.x - center.x));
var r:Number = Math.sqrt(((dx * dx) + (dy * dy)));
while (theta2 < theta1) {
theta2 = (theta2 + (Math.PI * 2));
};
var dtheta:Number = ((theta2 - theta1) / s_numSegs);
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo((p1.x * m_drawScale), (p1.y * m_drawScale));
var theta:Number = theta1;
while (theta <= theta2) {
m_sprite.graphics.lineTo(((center.x + (r * Math.cos(theta))) * m_drawScale), ((center.y + (r * Math.sin(theta))) * m_drawScale));
theta = (theta + dtheta);
};
}
public function AppendFlags(flags:uint):void{
m_drawFlags = (m_drawFlags | flags);
}
public function DrawSegment(p1:b2Vec2, p2:b2Vec2, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo((p1.x * m_drawScale), (p1.y * m_drawScale));
m_sprite.graphics.lineTo((p2.x * m_drawScale), (p2.y * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawPolygon(vertices:Array, vertexCount:int, color:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, color.color, m_alpha);
m_sprite.graphics.moveTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
var i = 1;
while (i < vertexCount) {
m_sprite.graphics.lineTo((vertices[i].x * m_drawScale), (vertices[i].y * m_drawScale));
i++;
};
m_sprite.graphics.lineTo((vertices[0].x * m_drawScale), (vertices[0].y * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 81
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function b2DestructionListener(){
super();
}
public function SayGoodbyeShape(shape:b2Shape):void{
}
public function SayGoodbyeJoint(joint:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 82
//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(bodyCapacity:int, contactCapacity:int, jointCapacity:int, allocator, listener:b2ContactListener){
var i:int;
super();
m_bodyCapacity = bodyCapacity;
m_contactCapacity = contactCapacity;
m_jointCapacity = jointCapacity;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = allocator;
m_listener = listener;
m_bodies = new Array(bodyCapacity);
i = 0;
while (i < bodyCapacity) {
m_bodies[i] = null;
i++;
};
m_contacts = new Array(contactCapacity);
i = 0;
while (i < contactCapacity) {
m_contacts[i] = null;
i++;
};
m_joints = new Array(jointCapacity);
i = 0;
while (i < jointCapacity) {
m_joints[i] = null;
i++;
};
m_positionIterationCount = 0;
}
public function AddBody(body:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = body;
}
public function AddJoint(joint:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = joint;
}
public function Report(constraints:Array):void{
var tMat:b2Mat22;
var tVec:b2Vec2;
var c:b2Contact;
var cc:b2ContactConstraint;
var cr:b2ContactResult;
var b1:b2Body;
var manifoldCount:int;
var manifolds:Array;
var j:int;
var manifold:b2Manifold;
var k:int;
var point:b2ManifoldPoint;
var ccp:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
var i:int;
while (i < m_contactCount) {
c = m_contacts[i];
cc = constraints[i];
cr = s_reportCR;
cr.shape1 = c.m_shape1;
cr.shape2 = c.m_shape2;
b1 = cr.shape1.m_body;
manifoldCount = c.m_manifoldCount;
manifolds = c.GetManifolds();
j = 0;
while (j < manifoldCount) {
manifold = manifolds[j];
cr.normal.SetV(manifold.normal);
k = 0;
while (k < manifold.pointCount) {
point = manifold.points[k];
ccp = cc.points[k];
cr.position = b1.GetWorldPoint(point.localPoint1);
cr.normalImpulse = ccp.normalImpulse;
cr.tangentImpulse = ccp.tangentImpulse;
cr.id.key = point.id.key;
m_listener.Result(cr);
k++;
};
j++;
};
i++;
};
}
public function AddContact(contact:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = contact;
}
public function Solve(step:b2TimeStep, gravity:b2Vec2, correctPositions:Boolean, allowSleep:Boolean):void{
var i:int;
var b:b2Body;
var joint:b2Joint;
var j:int;
var contactsOkay:Boolean;
var jointsOkay:Boolean;
var jointOkay:Boolean;
var minSleepTime:Number;
var linTolSqr:Number;
var angTolSqr:Number;
i = 0;
while (i < m_bodyCount) {
b = m_bodies[i];
if (b.IsStatic()){
} else {
b.m_linearVelocity.x = (b.m_linearVelocity.x + (step.dt * (gravity.x + (b.m_invMass * b.m_force.x))));
b.m_linearVelocity.y = (b.m_linearVelocity.y + (step.dt * (gravity.y + (b.m_invMass * b.m_force.y))));
b.m_angularVelocity = (b.m_angularVelocity + ((step.dt * b.m_invI) * b.m_torque));
b.m_force.SetZero();
b.m_torque = 0;
b.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (step.dt * b.m_linearDamping)), 0, 1));
b.m_angularVelocity = (b.m_angularVelocity * b2Math.b2Clamp((1 - (step.dt * b.m_angularDamping)), 0, 1));
if (b.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
b.m_linearVelocity.Normalize();
b.m_linearVelocity.x = (b.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
b.m_linearVelocity.y = (b.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((b.m_angularVelocity * b.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (b.m_angularVelocity < 0){
b.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
b.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
i++;
};
var contactSolver:b2ContactSolver = new b2ContactSolver(step, m_contacts, m_contactCount, m_allocator);
contactSolver.InitVelocityConstraints(step);
i = 0;
while (i < m_jointCount) {
joint = m_joints[i];
joint.InitVelocityConstraints(step);
i++;
};
i = 0;
while (i < step.maxIterations) {
contactSolver.SolveVelocityConstraints();
j = 0;
while (j < m_jointCount) {
joint = m_joints[j];
joint.SolveVelocityConstraints(step);
j++;
};
i++;
};
contactSolver.FinalizeVelocityConstraints();
i = 0;
while (i < m_bodyCount) {
b = m_bodies[i];
if (b.IsStatic()){
} else {
b.m_sweep.c0.SetV(b.m_sweep.c);
b.m_sweep.a0 = b.m_sweep.a;
b.m_sweep.c.x = (b.m_sweep.c.x + (step.dt * b.m_linearVelocity.x));
b.m_sweep.c.y = (b.m_sweep.c.y + (step.dt * b.m_linearVelocity.y));
b.m_sweep.a = (b.m_sweep.a + (step.dt * b.m_angularVelocity));
b.SynchronizeTransform();
};
i++;
};
if (correctPositions){
i = 0;
while (i < m_jointCount) {
joint = m_joints[i];
joint.InitPositionConstraints();
i++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < step.maxIterations) {
contactsOkay = contactSolver.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
jointsOkay = true;
i = 0;
while (i < m_jointCount) {
joint = m_joints[i];
jointOkay = joint.SolvePositionConstraints();
jointsOkay = ((jointsOkay) && (jointOkay));
i++;
};
if (((contactsOkay) && (jointsOkay))){
break;
};
m_positionIterationCount++;
};
};
Report(contactSolver.m_constraints);
if (allowSleep){
minSleepTime = Number.MAX_VALUE;
linTolSqr = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
angTolSqr = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
i = 0;
while (i < m_bodyCount) {
b = m_bodies[i];
if (b.m_invMass == 0){
} else {
if ((b.m_flags & b2Body.e_allowSleepFlag) == 0){
b.m_sleepTime = 0;
minSleepTime = 0;
};
if (((((((b.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((b.m_angularVelocity * b.m_angularVelocity) > angTolSqr)))) || ((b2Math.b2Dot(b.m_linearVelocity, b.m_linearVelocity) > linTolSqr)))){
b.m_sleepTime = 0;
minSleepTime = 0;
} else {
b.m_sleepTime = (b.m_sleepTime + step.dt);
minSleepTime = b2Math.b2Min(minSleepTime, b.m_sleepTime);
};
};
i++;
};
if (minSleepTime >= b2Settings.b2_timeToSleep){
i = 0;
while (i < m_bodyCount) {
b = m_bodies[i];
b.m_flags = (b.m_flags | b2Body.e_sleepFlag);
b.m_linearVelocity.SetZero();
b.m_angularVelocity = 0;
i++;
};
};
};
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(subStep:b2TimeStep):void{
var i:int;
var b:b2Body;
var contactsOkay:Boolean;
var contactSolver:b2ContactSolver = new b2ContactSolver(subStep, m_contacts, m_contactCount, m_allocator);
i = 0;
while (i < subStep.maxIterations) {
contactSolver.SolveVelocityConstraints();
i++;
};
i = 0;
while (i < m_bodyCount) {
b = m_bodies[i];
if (b.IsStatic()){
} else {
b.m_sweep.c0.SetV(b.m_sweep.c);
b.m_sweep.a0 = b.m_sweep.a;
b.m_sweep.c.x = (b.m_sweep.c.x + (subStep.dt * b.m_linearVelocity.x));
b.m_sweep.c.y = (b.m_sweep.c.y + (subStep.dt * b.m_linearVelocity.y));
b.m_sweep.a = (b.m_sweep.a + (subStep.dt * b.m_angularVelocity));
b.SynchronizeTransform();
};
i++;
};
var k_toiBaumgarte:Number = 0.75;
i = 0;
while (i < subStep.maxIterations) {
contactsOkay = contactSolver.SolvePositionConstraints(k_toiBaumgarte);
if (contactsOkay){
break;
};
i++;
};
Report(contactSolver.m_constraints);
}
}
}//package Box2D.Dynamics
Section 83
//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;
public function b2TimeStep(){
super();
}
}
}//package Box2D.Dynamics
Section 84
//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(worldAABB:b2AABB, gravity:b2Vec2, doSleep: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 = doSleep;
m_gravity = gravity;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(worldAABB, m_contactManager);
var bd:b2BodyDef = new b2BodyDef();
m_groundBody = CreateBody(bd);
}
public function DrawJoint(joint:b2Joint):void{
var pulley:b2PulleyJoint;
var s1:b2Vec2;
var s2:b2Vec2;
var b1:b2Body = joint.m_body1;
var b2:b2Body = joint.m_body2;
var xf1:b2XForm = b1.m_xf;
var xf2:b2XForm = b2.m_xf;
var x1:b2Vec2 = xf1.position;
var x2:b2Vec2 = xf2.position;
var p1:b2Vec2 = joint.GetAnchor1();
var p2:b2Vec2 = joint.GetAnchor2();
var color:b2Color = s_jointColor;
switch (joint.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(p1, p2, color);
break;
case b2Joint.e_pulleyJoint:
pulley = (joint as b2PulleyJoint);
s1 = pulley.GetGroundAnchor1();
s2 = pulley.GetGroundAnchor2();
m_debugDraw.DrawSegment(s1, p1, color);
m_debugDraw.DrawSegment(s2, p2, color);
m_debugDraw.DrawSegment(s1, s2, color);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(p1, p2, color);
break;
default:
if (b1 != m_groundBody){
m_debugDraw.DrawSegment(x1, p1, color);
};
m_debugDraw.DrawSegment(p1, p2, color);
if (b2 != m_groundBody){
m_debugDraw.DrawSegment(x2, p2, color);
};
};
}
public function Refilter(shape:b2Shape):void{
shape.RefilterProxy(m_broadPhase, shape.m_body.m_xf);
}
public function SetDebugDraw(debugDraw:b2DebugDraw):void{
m_debugDraw = debugDraw;
}
public function SetContactFilter(filter:b2ContactFilter):void{
m_contactFilter = filter;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var i:int;
var b:b2Body;
var s:b2Shape;
var j:b2Joint;
var bp:b2BroadPhase;
var xf:b2XForm;
var core:Boolean;
var index:uint;
var pair:b2Pair;
var p1:b2Proxy;
var p2:b2Proxy;
var worldLower:b2Vec2;
var worldUpper:b2Vec2;
var p:b2Proxy;
var poly:b2PolygonShape;
var obb:b2OBB;
var h:b2Vec2;
var tMat:b2Mat22;
var tVec:b2Vec2;
var tX:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
var flags:uint = m_debugDraw.GetFlags();
var invQ:b2Vec2 = new b2Vec2();
var x1:b2Vec2 = new b2Vec2();
var x2:b2Vec2 = new b2Vec2();
var color:b2Color = new b2Color(0, 0, 0);
var b1:b2AABB = new b2AABB();
var b2:b2AABB = new b2AABB();
var vs:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((flags & b2DebugDraw.e_shapeBit)){
core = ((flags & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
b = m_bodyList;
while (b) {
xf = b.m_xf;
s = b.GetShapeList();
while (s) {
if (b.IsStatic()){
DrawShape(s, xf, new b2Color(0.5, 0.9, 0.5), core);
} else {
if (b.IsSleeping()){
DrawShape(s, xf, new b2Color(0.5, 0.5, 0.9), core);
} else {
DrawShape(s, xf, new b2Color(0.9, 0.9, 0.9), core);
};
};
s = s.m_next;
};
b = b.m_next;
};
};
if ((flags & b2DebugDraw.e_jointBit)){
j = m_jointList;
while (j) {
DrawJoint(j);
j = j.m_next;
};
};
if ((flags & b2DebugDraw.e_pairBit)){
bp = m_broadPhase;
invQ.Set((1 / bp.m_quantizationFactor.x), (1 / bp.m_quantizationFactor.y));
color.Set(0.9, 0.9, 0.3);
i = 0;
while (i < b2Pair.b2_tableCapacity) {
index = bp.m_pairManager.m_hashTable[i];
while (index != b2Pair.b2_nullPair) {
pair = bp.m_pairManager.m_pairs[index];
p1 = bp.m_proxyPool[pair.proxyId1];
p2 = bp.m_proxyPool[pair.proxyId2];
b1.lowerBound.x = (bp.m_worldAABB.lowerBound.x + (invQ.x * bp.m_bounds[0][p1.lowerBounds[0]].value));
b1.lowerBound.y = (bp.m_worldAABB.lowerBound.y + (invQ.y * bp.m_bounds[1][p1.lowerBounds[1]].value));
b1.upperBound.x = (bp.m_worldAABB.lowerBound.x + (invQ.x * bp.m_bounds[0][p1.upperBounds[0]].value));
b1.upperBound.y = (bp.m_worldAABB.lowerBound.y + (invQ.y * bp.m_bounds[1][p1.upperBounds[1]].value));
b2.lowerBound.x = (bp.m_worldAABB.lowerBound.x + (invQ.x * bp.m_bounds[0][p2.lowerBounds[0]].value));
b2.lowerBound.y = (bp.m_worldAABB.lowerBound.y + (invQ.y * bp.m_bounds[1][p2.lowerBounds[1]].value));
b2.upperBound.x = (bp.m_worldAABB.lowerBound.x + (invQ.x * bp.m_bounds[0][p2.upperBounds[0]].value));
b2.upperBound.y = (bp.m_worldAABB.lowerBound.y + (invQ.y * bp.m_bounds[1][p2.upperBounds[1]].value));
x1.x = (0.5 * (b1.lowerBound.x + b1.upperBound.x));
x1.y = (0.5 * (b1.lowerBound.y + b1.upperBound.y));
x2.x = (0.5 * (b2.lowerBound.x + b2.upperBound.x));
x2.y = (0.5 * (b2.lowerBound.y + b2.upperBound.y));
m_debugDraw.DrawSegment(x1, x2, color);
index = pair.next;
};
i++;
};
};
if ((flags & b2DebugDraw.e_aabbBit)){
bp = m_broadPhase;
worldLower = bp.m_worldAABB.lowerBound;
worldUpper = bp.m_worldAABB.upperBound;
invQ.Set((1 / bp.m_quantizationFactor.x), (1 / bp.m_quantizationFactor.y));
color.Set(0.9, 0.3, 0.9);
i = 0;
while (i < b2Settings.b2_maxProxies) {
p = bp.m_proxyPool[i];
if (p.IsValid() == false){
} else {
b1.lowerBound.x = (worldLower.x + (invQ.x * bp.m_bounds[0][p.lowerBounds[0]].value));
b1.lowerBound.y = (worldLower.y + (invQ.y * bp.m_bounds[1][p.lowerBounds[1]].value));
b1.upperBound.x = (worldLower.x + (invQ.x * bp.m_bounds[0][p.upperBounds[0]].value));
b1.upperBound.y = (worldLower.y + (invQ.y * bp.m_bounds[1][p.upperBounds[1]].value));
vs[0].Set(b1.lowerBound.x, b1.lowerBound.y);
vs[1].Set(b1.upperBound.x, b1.lowerBound.y);
vs[2].Set(b1.upperBound.x, b1.upperBound.y);
vs[3].Set(b1.lowerBound.x, b1.upperBound.y);
m_debugDraw.DrawPolygon(vs, 4, color);
};
i++;
};
vs[0].Set(worldLower.x, worldLower.y);
vs[1].Set(worldUpper.x, worldLower.y);
vs[2].Set(worldUpper.x, worldUpper.y);
vs[3].Set(worldLower.x, worldUpper.y);
m_debugDraw.DrawPolygon(vs, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((flags & b2DebugDraw.e_obbBit)){
color.Set(0.5, 0.3, 0.5);
b = m_bodyList;
while (b) {
xf = b.m_xf;
s = b.GetShapeList();
while (s) {
if (s.m_type != b2Shape.e_polygonShape){
} else {
poly = (s as b2PolygonShape);
obb = poly.GetOBB();
h = obb.extents;
vs[0].Set(-(h.x), -(h.y));
vs[1].Set(h.x, -(h.y));
vs[2].Set(h.x, h.y);
vs[3].Set(-(h.x), h.y);
i = 0;
while (i < 4) {
tMat = obb.R;
tVec = vs[i];
tX = (obb.center.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
vs[i].y = (obb.center.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
vs[i].x = tX;
tMat = xf.R;
tX = (xf.position.x + ((tMat.col1.x * tVec.x) + (tMat.col2.x * tVec.y)));
vs[i].y = (xf.position.y + ((tMat.col1.y * tVec.x) + (tMat.col2.y * tVec.y)));
vs[i].x = tX;
i++;
};
m_debugDraw.DrawPolygon(vs, 4, color);
};
s = s.m_next;
};
b = b.m_next;
};
};
if ((flags & b2DebugDraw.e_centerOfMassBit)){
b = m_bodyList;
while (b) {
xf = s_xf;
xf.R = b.m_xf.R;
xf.position = b.GetWorldCenter();
m_debugDraw.DrawXForm(xf);
b = b.m_next;
};
};
}
public function DestroyBody(b:b2Body):void{
var jn0:b2JointEdge;
var s0:b2Shape;
if (m_lock == true){
return;
};
var jn:b2JointEdge = b.m_jointList;
while (jn) {
jn0 = jn;
jn = jn.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(jn0.joint);
};
DestroyJoint(jn0.joint);
};
var s:b2Shape = b.m_shapeList;
while (s) {
s0 = s;
s = s.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(s0);
};
s0.DestroyProxy(m_broadPhase);
b2Shape.Destroy(s0, m_blockAllocator);
};
if (b.m_prev){
b.m_prev.m_next = b.m_next;
};
if (b.m_next){
b.m_next.m_prev = b.m_prev;
};
if (b == m_bodyList){
m_bodyList = b.m_next;
};
m_bodyCount--;
}
public function SetContinuousPhysics(flag:Boolean):void{
m_continuousPhysics = flag;
}
public function CreateGroundShape(def:b2ShapeDef){
if (m_lock == true){
return (null);
};
switch (def.type){
case b2Shape.e_staticEdgeShape:
return (new b2StaticEdgeChain(def, this));
default:
return (m_groundBody.CreateShape(def));
};
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(shape:b2Shape, xf:b2XForm, color:b2Color, core:Boolean):void{
var circle:b2CircleShape;
var center:b2Vec2;
var radius:Number;
var axis:b2Vec2;
var i:int;
var poly:b2PolygonShape;
var vertexCount:int;
var localVertices:Array;
var vertices:Array;
var localCoreVertices:Array;
var arc:b2ConcaveArcShape;
var edge:b2StaticEdgeShape;
var coreColor:b2Color = s_coreColor;
switch (shape.m_type){
case b2Shape.e_circleShape:
circle = (shape as b2CircleShape);
center = b2Math.b2MulX(xf, circle.m_localPosition);
radius = circle.m_radius;
axis = xf.R.col1;
m_debugDraw.DrawSolidCircle(center, radius, axis, color);
if (core){
m_debugDraw.DrawCircle(center, (radius - b2Settings.b2_toiSlop), coreColor);
};
break;
case b2Shape.e_polygonShape:
poly = (shape as b2PolygonShape);
vertexCount = poly.GetVertexCount();
localVertices = poly.GetVertices();
vertices = new Array(b2Settings.b2_maxPolygonVertices);
i = 0;
while (i < vertexCount) {
vertices[i] = b2Math.b2MulX(xf, localVertices[i]);
i++;
};
m_debugDraw.DrawSolidPolygon(vertices, vertexCount, color);
if (core){
localCoreVertices = poly.GetCoreVertices();
i = 0;
while (i < vertexCount) {
vertices[i] = b2Math.b2MulX(xf, localCoreVertices[i]);
i++;
};
m_debugDraw.DrawPolygon(vertices, vertexCount, coreColor);
};
break;
case b2Shape.e_concaveArcShape:
arc = (shape as b2ConcaveArcShape);
vertexCount = arc.GetVertexCount();
localVertices = arc.GetVertices();
center = b2Math.b2MulX(xf, arc.m_arcCenter);
vertices = new Array(b2Settings.b2_maxPolygonVertices);
i = 0;
while (i < vertexCount) {
vertices[i] = b2Math.b2MulX(xf, localVertices[i]);
i++;
};
m_debugDraw.DrawSolidConcaveArc(vertices, vertexCount, center, color);
if (core){
localCoreVertices = arc.GetCoreVertices();
i = 0;
while (i < vertexCount) {
vertices[i] = b2Math.b2MulX(xf, localCoreVertices[i]);
i++;
};
m_debugDraw.DrawConcaveArc(vertices, vertexCount, center, coreColor);
};
break;
case b2Shape.e_staticEdgeShape:
edge = (shape as b2StaticEdgeShape);
m_debugDraw.DrawSegment(edge.m_v1, edge.m_v2, color);
if (core){
m_debugDraw.DrawSegment(edge.m_coreV1, edge.m_coreV2, coreColor);
};
break;
};
}
public function GetContactCount():int{
return (m_contactCount);
}
public function Solve(step:b2TimeStep):void{
var b:b2Body;
var stackCount:int;
var i:int;
var other:b2Body;
var cn:b2ContactEdge;
var jn:b2JointEdge;
var inRange:Boolean;
m_positionIterationCount = 0;
var island:b2Island = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
b = m_bodyList;
while (b) {
b.m_flags = (b.m_flags & ~(b2Body.e_islandFlag));
b = b.m_next;
};
var c:b2Contact = m_contactList;
while (c) {
c.m_flags = (c.m_flags & ~(b2Contact.e_islandFlag));
c = c.m_next;
};
var j:b2Joint = m_jointList;
while (j) {
j.m_islandFlag = false;
j = j.m_next;
};
var stackSize:int = m_bodyCount;
var stack:Array = new Array(stackSize);
var seed:b2Body = m_bodyList;
while (seed) {
if ((seed.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (seed.IsStatic()){
} else {
island.Clear();
stackCount = 0;
var _temp1 = stackCount;
stackCount = (stackCount + 1);
var _local15 = _temp1;
stack[_local15] = seed;
seed.m_flags = (seed.m_flags | b2Body.e_islandFlag);
while (stackCount > 0) {
--stackCount;
b = stack[stackCount];
island.AddBody(b);
b.m_flags = (b.m_flags & ~(b2Body.e_sleepFlag));
if (b.IsStatic()){
} else {
cn = b.m_contactList;
while (cn) {
if ((cn.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (cn.contact.m_manifoldCount == 0){
} else {
island.AddContact(cn.contact);
cn.contact.m_flags = (cn.contact.m_flags | b2Contact.e_islandFlag);
other = cn.other;
if ((other.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = stackCount;
stackCount = (stackCount + 1);
var _local16 = _temp2;
stack[_local16] = other;
other.m_flags = (other.m_flags | b2Body.e_islandFlag);
};
};
};
cn = cn.next;
};
jn = b.m_jointList;
while (jn) {
if (jn.joint.m_islandFlag == true){
} else {
island.AddJoint(jn.joint);
jn.joint.m_islandFlag = true;
other = jn.other;
if ((other.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = stackCount;
stackCount = (stackCount + 1);
_local16 = _temp3;
stack[_local16] = other;
other.m_flags = (other.m_flags | b2Body.e_islandFlag);
};
};
jn = jn.next;
};
};
};
island.Solve(step, m_gravity, m_positionCorrection, m_allowSleep);
if (island.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = island.m_positionIterationCount;
};
i = 0;
while (i < island.m_bodyCount) {
b = island.m_bodies[i];
if (b.IsStatic()){
b.m_flags = (b.m_flags & ~(b2Body.e_islandFlag));
};
i++;
};
};
};
seed = seed.m_next;
};
b = m_bodyList;
while (b) {
if ((b.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (b.IsStatic()){
} else {
inRange = b.SynchronizeShapes();
if ((((inRange == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(b);
};
};
};
b = b.m_next;
};
m_broadPhase.Commit();
}
public function Query(aabb:b2AABB, shapes:Array, maxCount:int):int{
var results:Array = new Array(maxCount);
var count:int = m_broadPhase.QueryAABB(aabb, results, maxCount);
var i:int;
while (i < count) {
shapes[i] = results[i];
i++;
};
return (count);
}
public function SetGravity(gravity:b2Vec2):void{
m_gravity = gravity;
}
public function SolveTOI(step:b2TimeStep):void{
var b:b2Body;
var s1:b2Shape;
var s2:b2Shape;
var b1:b2Body;
var b2:b2Body;
var cn:b2ContactEdge;
var c:b2Contact;
var minContact:b2Contact;
var minTOI:Number;
var seed:b2Body;
var stackCount:int;
var subStep:b2TimeStep;
var i:int;
var toi:Number;
var t0:Number;
var other:b2Body;
var inRange:Boolean;
var island:b2Island = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
var stackSize:int = m_bodyCount;
var stack:Array = new Array(stackSize);
b = m_bodyList;
while (b) {
b.m_flags = (b.m_flags & ~(b2Body.e_islandFlag));
b.m_sweep.t0 = 0;
b = b.m_next;
};
c = m_contactList;
while (c) {
c.m_flags = (c.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
c = c.m_next;
};
while (true) {
minContact = null;
minTOI = 1;
c = m_contactList;
for (;c;(c = c.m_next)) {
if ((c.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
toi = 1;
if ((c.m_flags & b2Contact.e_toiFlag)){
toi = c.m_toi;
} else {
s1 = c.m_shape1;
s2 = c.m_shape2;
b1 = s1.m_body;
b2 = s2.m_body;
if (((((b1.IsStatic()) || (b1.IsSleeping()))) && (((b2.IsStatic()) || (b2.IsSleeping()))))){
continue;
};
t0 = b1.m_sweep.t0;
if (b1.m_sweep.t0 < b2.m_sweep.t0){
t0 = b2.m_sweep.t0;
b1.m_sweep.Advance(t0);
} else {
if (b2.m_sweep.t0 < b1.m_sweep.t0){
t0 = b1.m_sweep.t0;
b2.m_sweep.Advance(t0);
};
};
toi = b2TimeOfImpact.TimeOfImpact(c.m_shape1, b1.m_sweep, c.m_shape2, b2.m_sweep);
if ((((toi > 0)) && ((toi < 1)))){
toi = (((1 - toi) * t0) + toi);
if (toi > 1){
toi = 1;
};
};
c.m_toi = toi;
c.m_flags = (c.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < toi)) && ((toi < minTOI)))){
minContact = c;
minTOI = toi;
};
};
};
if ((((minContact == null)) || (((1 - (100 * Number.MIN_VALUE)) < minTOI)))){
break;
};
s1 = minContact.m_shape1;
s2 = minContact.m_shape2;
b1 = s1.m_body;
b2 = s2.m_body;
b1.Advance(minTOI);
b2.Advance(minTOI);
minContact.Update(m_contactListener);
minContact.m_flags = (minContact.m_flags & ~(b2Contact.e_toiFlag));
if (minContact.m_manifoldCount == 0){
} else {
seed = b1;
if (seed.IsStatic()){
seed = b2;
};
island.Clear();
stackCount = 0;
var _temp1 = stackCount;
stackCount = (stackCount + 1);
var _local22 = _temp1;
stack[_local22] = seed;
seed.m_flags = (seed.m_flags | b2Body.e_islandFlag);
while (stackCount > 0) {
--stackCount;
b = stack[stackCount];
island.AddBody(b);
b.m_flags = (b.m_flags & ~(b2Body.e_sleepFlag));
if (b.IsStatic()){
} else {
cn = b.m_contactList;
while (cn) {
if (island.m_contactCount == island.m_contactCapacity){
} else {
if ((cn.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (cn.contact.m_manifoldCount == 0){
} else {
island.AddContact(cn.contact);
cn.contact.m_flags = (cn.contact.m_flags | b2Contact.e_islandFlag);
other = cn.other;
if ((other.m_flags & b2Body.e_islandFlag)){
} else {
if (other.IsStatic() == false){
other.Advance(minTOI);
other.WakeUp();
};
var _temp2 = stackCount;
stackCount = (stackCount + 1);
var _local23 = _temp2;
stack[_local23] = other;
other.m_flags = (other.m_flags | b2Body.e_islandFlag);
};
};
};
};
cn = cn.next;
};
};
};
subStep = new b2TimeStep();
subStep.dt = ((1 - minTOI) * step.dt);
subStep.inv_dt = (1 / subStep.dt);
subStep.maxIterations = step.maxIterations;
island.SolveTOI(subStep);
i = 0;
while (i < island.m_bodyCount) {
b = island.m_bodies[i];
b.m_flags = (b.m_flags & ~(b2Body.e_islandFlag));
if ((b.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (b.IsStatic()){
} else {
inRange = b.SynchronizeShapes();
if ((((inRange == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(b);
};
cn = b.m_contactList;
while (cn) {
cn.contact.m_flags = (cn.contact.m_flags & ~(b2Contact.e_toiFlag));
cn = cn.next;
};
};
};
i++;
};
i = 0;
while (i < island.m_contactCount) {
c = island.m_contacts[i];
c.m_flags = (c.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
i++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function Validate():void{
m_broadPhase.Validate();
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function SetWarmStarting(flag:Boolean):void{
m_warmStarting = flag;
}
public function SetPositionCorrection(flag:Boolean):void{
m_positionCorrection = flag;
}
public function CreateJoint(def:b2JointDef):b2Joint{
var b:b2Body;
var s:b2Shape;
var j:b2Joint = b2Joint.Create(def, m_blockAllocator);
j.m_prev = null;
j.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = j;
};
m_jointList = j;
m_jointCount++;
j.m_node1.joint = j;
j.m_node1.other = j.m_body2;
j.m_node1.prev = null;
j.m_node1.next = j.m_body1.m_jointList;
if (j.m_body1.m_jointList){
j.m_body1.m_jointList.prev = j.m_node1;
};
j.m_body1.m_jointList = j.m_node1;
j.m_node2.joint = j;
j.m_node2.other = j.m_body1;
j.m_node2.prev = null;
j.m_node2.next = j.m_body2.m_jointList;
if (j.m_body2.m_jointList){
j.m_body2.m_jointList.prev = j.m_node2;
};
j.m_body2.m_jointList = j.m_node2;
if (def.collideConnected == false){
b = ((def.body1.m_shapeCount < def.body2.m_shapeCount)) ? def.body1 : def.body2;
s = b.m_shapeList;
while (s) {
s.RefilterProxy(m_broadPhase, b.m_xf);
s = s.m_next;
};
};
return (j);
}
public function DestroyJoint(j:b2Joint):void{
var b:b2Body;
var s:b2Shape;
var collideConnected:Boolean = j.m_collideConnected;
if (j.m_prev){
j.m_prev.m_next = j.m_next;
};
if (j.m_next){
j.m_next.m_prev = j.m_prev;
};
if (j == m_jointList){
m_jointList = j.m_next;
};
var body1:b2Body = j.m_body1;
var body2:b2Body = j.m_body2;
body1.WakeUp();
body2.WakeUp();
if (j.m_node1.prev){
j.m_node1.prev.next = j.m_node1.next;
};
if (j.m_node1.next){
j.m_node1.next.prev = j.m_node1.prev;
};
if (j.m_node1 == body1.m_jointList){
body1.m_jointList = j.m_node1.next;
};
j.m_node1.prev = null;
j.m_node1.next = null;
if (j.m_node2.prev){
j.m_node2.prev.next = j.m_node2.next;
};
if (j.m_node2.next){
j.m_node2.next.prev = j.m_node2.prev;
};
if (j.m_node2 == body2.m_jointList){
body2.m_jointList = j.m_node2.next;
};
j.m_node2.prev = null;
j.m_node2.next = null;
b2Joint.Destroy(j, m_blockAllocator);
m_jointCount--;
if (collideConnected == false){
b = ((body1.m_shapeCount < body2.m_shapeCount)) ? body1 : body2;
s = b.m_shapeList;
while (s) {
s.RefilterProxy(m_broadPhase, b.m_xf);
s = s.m_next;
};
};
}
public function SetContactListener(listener:b2ContactListener):void{
m_contactListener = listener;
}
public function CreateBody(def:b2BodyDef):b2Body{
if (m_lock == true){
return (null);
};
var b:b2Body = new b2Body(def, this);
b.m_prev = null;
b.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = b;
};
m_bodyList = b;
m_bodyCount++;
return (b);
}
public function SetBoundaryListener(listener:b2BoundaryListener):void{
m_boundaryListener = listener;
}
public function SetDestructionListener(listener:b2DestructionListener):void{
m_destructionListener = listener;
}
public function Step(dt:Number, iterations:int):void{
m_lock = true;
var step:b2TimeStep = new b2TimeStep();
step.dt = dt;
step.maxIterations = iterations;
if (dt > 0){
step.inv_dt = (1 / dt);
} else {
step.inv_dt = 0;
};
step.dtRatio = (m_inv_dt0 * dt);
step.positionCorrection = m_positionCorrection;
step.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (step.dt > 0){
Solve(step);
};
if (((m_continuousPhysics) && ((step.dt > 0)))){
SolveTOI(step);
};
DrawDebugData();
m_inv_dt0 = step.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 85
//b2SVG (Clases.BasicEngine.b2SVG)
package Clases.BasicEngine {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2SVG {
public function b2SVG(){
super();
}
public static function parseSVG(svg:XML, world:b2World):void{
var chainDef:b2StaticEdgeChainDef;
var path:XML;
var d:String;
var regExp:RegExp;
var args:Array;
var i:int;
var ns:Namespace = svg.namespace("");
var bodyDef:b2BodyDef = new b2BodyDef();
chainDef = new b2StaticEdgeChainDef();
chainDef.friction = 0.5;
chainDef.restitution = 0;
for each (path in svg..ns::path) {
d = path.@d;
regExp = / |,/;
args = d.split(regExp);
if (args[(args.length - 1)] == ""){
args.pop();
};
i = 1;
chainDef.isALoop = false;
chainDef.vertices.length = 0;
while (true) {
if (i == (args.length - 2)){
chainDef.vertices.push(new b2Vec2(args[i], args[(i + 1)]));
break;
} else {
if ((((args[(i + 2)] == "z")) || ((args[(i + 2)] == "Z")))){
chainDef.isALoop = true;
break;
} else {
if (args[(i + 2)] != "L"){
throw (new Error("Unsupported: The SVG Path contains an arc command or move-to command or a relative coordinate."));
};
};
};
chainDef.vertices.push(new b2Vec2((args[i] / world.m_debugDraw.m_drawScale), (args[(i + 1)] / world.m_debugDraw.m_drawScale)));
i = (i + 3);
};
chainDef.vertexCount = chainDef.vertices.length;
chainDef.userData = "terrain";
world.CreateGroundShape(chainDef);
};
}
}
}//package Clases.BasicEngine
Section 86
//PhisicBase (Clases.BasicEngine.PhisicBase)
package Clases.BasicEngine {
import flash.display.*;
import 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 PhisicBase extends Sprite {
protected const gravity:b2Vec2;
protected var m_world:b2World;
protected var m_iterations:Number;// = 45
protected var m_timestep:Number;// = 0.0222222222222222
protected var dbgDraw:b2DebugDraw;
protected var m_dbgSprite:Sprite;
public static const m_phys_scale:Number = 30;
public function PhisicBase(){
gravity = new b2Vec2(0, 4);
dbgDraw = new b2DebugDraw();
super();
var worldAABB:b2AABB = new b2AABB();
worldAABB.lowerBound.Set(-1000, -1000);
worldAABB.upperBound.Set(1000, 1000);
m_world = new b2World(worldAABB, gravity, true);
m_dbgSprite = new Sprite();
SetDebugDraw();
}
private function SetDebugDraw():void{
var dbgDraw:b2DebugDraw;
dbgDraw = new b2DebugDraw();
dbgDraw.m_sprite = m_dbgSprite;
dbgDraw.m_drawScale = m_phys_scale;
dbgDraw.m_fillAlpha = 0.8;
dbgDraw.m_lineThickness = 2;
dbgDraw.m_drawFlags = (1 | 2);
m_world.SetDebugDraw(dbgDraw);
}
public function updateLevel():void{
m_world.Step(m_timestep, m_iterations);
var bb:b2Body = m_world.GetBodyList();
while (bb) {
if ((((bb.GetUserData() is Sprite)) || ((bb.GetUserData() is Bitmap)))){
bb.GetUserData().x = (bb.GetPosition().x * m_phys_scale);
bb.GetUserData().y = (bb.GetPosition().y * m_phys_scale);
bb.GetUserData().rotation = ((bb.GetAngle() * (180 / Math.PI)) % 360);
};
bb = bb.GetNext();
};
}
public function desrtoy():void{
var b:b2Body;
var node:b2Body = m_world.GetBodyList();
while (node) {
b = node;
node = node.GetNext();
m_world.DestroyBody(b);
b = null;
};
}
}
}//package Clases.BasicEngine
Section 87
//BackgroundResources (Clases.BasicScreens.ClassResources.BackgroundResources)
package Clases.BasicScreens.ClassResources {
import flash.display.*;
public class BackgroundResources {
private const edif_back_screen:Class;
private const Nubes_back_screen:Class;
private const edif_screen:Class;
private const Nubes_Level_Selection_Screen:Class;
private const Sun_back_screen:Class;
private const Background_Screen:Class;
public function BackgroundResources(){
Background_Screen = BackgroundResources_Background_Screen;
Nubes_back_screen = BackgroundResources_Nubes_back_screen;
Nubes_Level_Selection_Screen = BackgroundResources_Nubes_Level_Selection_Screen;
Sun_back_screen = BackgroundResources_Sun_back_screen;
edif_back_screen = BackgroundResources_edif_back_screen;
edif_screen = BackgroundResources_edif_screen;
super();
}
public function create_back_nubes_level_Selection():Bitmap{
var skin:Bitmap = (new Nubes_Level_Selection_Screen() as Bitmap);
return (skin);
}
public function create_edif_back():Bitmap{
var skin:Bitmap = (new edif_back_screen() as Bitmap);
return (skin);
}
public function create_background_screen():Bitmap{
var skin:Bitmap = (new Background_Screen() as Bitmap);
return (skin);
}
public function create_back_nubes():Bitmap{
var skin:Bitmap = (new Nubes_back_screen() as Bitmap);
return (skin);
}
public function create_back_sun():Bitmap{
var skin:Bitmap = (new Sun_back_screen() as Bitmap);
return (skin);
}
public function create_edif_front():Bitmap{
var skin:Bitmap = (new edif_screen() as Bitmap);
return (skin);
}
}
}//package Clases.BasicScreens.ClassResources
Section 88
//BackgroundResources_Background_Screen (Clases.BasicScreens.ClassResources.BackgroundResources_Background_Screen)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class BackgroundResources_Background_Screen extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 89
//BackgroundResources_edif_back_screen (Clases.BasicScreens.ClassResources.BackgroundResources_edif_back_screen)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class BackgroundResources_edif_back_screen extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 90
//BackgroundResources_edif_screen (Clases.BasicScreens.ClassResources.BackgroundResources_edif_screen)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class BackgroundResources_edif_screen extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 91
//BackgroundResources_Nubes_back_screen (Clases.BasicScreens.ClassResources.BackgroundResources_Nubes_back_screen)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class BackgroundResources_Nubes_back_screen extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 92
//BackgroundResources_Nubes_Level_Selection_Screen (Clases.BasicScreens.ClassResources.BackgroundResources_Nubes_Level_Selection_Screen)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class BackgroundResources_Nubes_Level_Selection_Screen extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 93
//BackgroundResources_Sun_back_screen (Clases.BasicScreens.ClassResources.BackgroundResources_Sun_back_screen)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class BackgroundResources_Sun_back_screen extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 94
//MainResources (Clases.BasicScreens.ClassResources.MainResources)
package Clases.BasicScreens.ClassResources {
import flash.display.*;
public class MainResources {
private const BackMainLeveScreen:Class;
private const BackMainLeveScreen_Title:Class;
public function MainResources(){
BackMainLeveScreen = MainResources_BackMainLeveScreen;
BackMainLeveScreen_Title = MainResources_BackMainLeveScreen_Title;
super();
}
public function create_Title_Main():Bitmap{
var skin:Bitmap = (new BackMainLeveScreen_Title() as Bitmap);
return (skin);
}
public function createBackMainBitmap():Bitmap{
var skin:Bitmap = (new BackMainLeveScreen() as Bitmap);
return (skin);
}
}
}//package Clases.BasicScreens.ClassResources
Section 95
//MainResources_BackMainLeveScreen (Clases.BasicScreens.ClassResources.MainResources_BackMainLeveScreen)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class MainResources_BackMainLeveScreen extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 96
//MainResources_BackMainLeveScreen_Title (Clases.BasicScreens.ClassResources.MainResources_BackMainLeveScreen_Title)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class MainResources_BackMainLeveScreen_Title extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 97
//OffButtonResources (Clases.BasicScreens.ClassResources.OffButtonResources)
package Clases.BasicScreens.ClassResources {
import flash.display.*;
public class OffButtonResources {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function OffButtonResources(){
UP_bitmap = OffButtonResources_UP_bitmap;
OVER_bitmap = OffButtonResources_OVER_bitmap;
DOWN_bitmap = OffButtonResources_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.BasicScreens.ClassResources
Section 98
//OffButtonResources_DOWN_bitmap (Clases.BasicScreens.ClassResources.OffButtonResources_DOWN_bitmap)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class OffButtonResources_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 99
//OffButtonResources_OVER_bitmap (Clases.BasicScreens.ClassResources.OffButtonResources_OVER_bitmap)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class OffButtonResources_OVER_bitmap extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 100
//OffButtonResources_UP_bitmap (Clases.BasicScreens.ClassResources.OffButtonResources_UP_bitmap)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class OffButtonResources_UP_bitmap extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 101
//OnButtonResources (Clases.BasicScreens.ClassResources.OnButtonResources)
package Clases.BasicScreens.ClassResources {
import flash.display.*;
public class OnButtonResources {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function OnButtonResources(){
UP_bitmap = OnButtonResources_UP_bitmap;
OVER_bitmap = OnButtonResources_OVER_bitmap;
DOWN_bitmap = OnButtonResources_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.BasicScreens.ClassResources
Section 102
//OnButtonResources_DOWN_bitmap (Clases.BasicScreens.ClassResources.OnButtonResources_DOWN_bitmap)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class OnButtonResources_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 103
//OnButtonResources_OVER_bitmap (Clases.BasicScreens.ClassResources.OnButtonResources_OVER_bitmap)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class OnButtonResources_OVER_bitmap extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 104
//OnButtonResources_UP_bitmap (Clases.BasicScreens.ClassResources.OnButtonResources_UP_bitmap)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class OnButtonResources_UP_bitmap extends BitmapAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 105
//ResourceSound (Clases.BasicScreens.ClassResources.ResourceSound)
package Clases.BasicScreens.ClassResources {
import flash.media.*;
public class ResourceSound {
public var SoundLevel_Selection:Class;
public var Twack:Class;
public var SoundMain:Class;
private var mainChannel:SoundChannel;
public var Download_Box:Class;
public var SoundLevel:Class;
private var VOLUME:Number;// = 1
public var Cash_money:Class;
private var levelChannel:SoundChannel;
private var gameChannel:SoundChannel;
private var levelSelectionChannel:SoundChannel;
public function ResourceSound(){
mainChannel = new SoundChannel();
levelSelectionChannel = new SoundChannel();
levelChannel = new SoundChannel();
gameChannel = new SoundChannel();
SoundMain = ResourceSound_SoundMain;
SoundLevel = ResourceSound_SoundLevel;
SoundLevel_Selection = ResourceSound_SoundLevel_Selection;
Cash_money = ResourceSound_Cash_money;
Twack = ResourceSound_Twack;
Download_Box = ResourceSound_Download_Box;
super();
}
public function stop_lvel_selection_music():void{
levelSelectionChannel.stop();
}
public function stopLevelMusic():void{
stop_lvel_selection_music();
mainChannel.stop();
}
public function stopMainMusic():void{
mainChannel.stop();
}
public function playMainMusic():void{
var myTransform:SoundTransform = new SoundTransform();
var smallSound:Sound = (new SoundMain() as Sound);
myTransform.volume = VOLUME;
mainChannel = smallSound.play(0, 999);
mainChannel.soundTransform = myTransform;
}
public function playLevelMusic():void{
var myTransform:SoundTransform = new SoundTransform();
var smallSound:Sound = (new SoundLevel() as Sound);
myTransform.volume = VOLUME;
mainChannel = smallSound.play(0, 999);
mainChannel.soundTransform = myTransform;
}
public function play_cash_money():void{
var myTransform:SoundTransform = new SoundTransform();
var smallSound:Sound = (new Cash_money() as Sound);
myTransform.volume = VOLUME;
mainChannel = smallSound.play();
mainChannel.soundTransform = myTransform;
}
public function playLevel_Selection_Music():void{
var myTransform:SoundTransform = new SoundTransform();
var smallSound:Sound = (new SoundLevel_Selection() as Sound);
myTransform.volume = VOLUME;
levelSelectionChannel = smallSound.play(0, 999);
levelSelectionChannel.soundTransform = myTransform;
}
public function play_twack():void{
var myTransform:SoundTransform = new SoundTransform();
var smallSound:Sound = (new Twack() as Sound);
myTransform.volume = VOLUME;
mainChannel = smallSound.play();
mainChannel.soundTransform = myTransform;
}
public function play_Download_Box():void{
var myTransform:SoundTransform = new SoundTransform();
var smallSound:Sound = (new Download_Box() as Sound);
myTransform.volume = VOLUME;
mainChannel = smallSound.play();
mainChannel.soundTransform = myTransform;
}
}
}//package Clases.BasicScreens.ClassResources
Section 106
//ResourceSound_Cash_money (Clases.BasicScreens.ClassResources.ResourceSound_Cash_money)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class ResourceSound_Cash_money extends SoundAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 107
//ResourceSound_Download_Box (Clases.BasicScreens.ClassResources.ResourceSound_Download_Box)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class ResourceSound_Download_Box extends SoundAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 108
//ResourceSound_SoundLevel (Clases.BasicScreens.ClassResources.ResourceSound_SoundLevel)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class ResourceSound_SoundLevel extends SoundAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 109
//ResourceSound_SoundLevel_Selection (Clases.BasicScreens.ClassResources.ResourceSound_SoundLevel_Selection)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class ResourceSound_SoundLevel_Selection extends SoundAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 110
//ResourceSound_SoundMain (Clases.BasicScreens.ClassResources.ResourceSound_SoundMain)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class ResourceSound_SoundMain extends SoundAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 111
//ResourceSound_Twack (Clases.BasicScreens.ClassResources.ResourceSound_Twack)
package Clases.BasicScreens.ClassResources {
import mx.core.*;
public class ResourceSound_Twack extends SoundAsset {
}
}//package Clases.BasicScreens.ClassResources
Section 112
//BackgroundGame (Clases.BasicScreens.BackgroundGame)
package Clases.BasicScreens {
import flash.display.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import Clases.BasicScreens.ClassResources.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import Clases.Game.SFX.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
import gs.*;
public class BackgroundGame extends Sprite {
private var edif_Back_screen:Sprite;
private var edif_front_screen:Sprite;
private var nubes:Bitmap;
private var normal_back_emiter_2:Emitter2D;
private var normal_back_emiter_1:Emitter2D;
private var music_renderer:DisplayObjectRenderer;
public function BackgroundGame():void{
var edif_Back:Bitmap;
var edif_front:Bitmap;
normal_back_emiter_1 = new Emitter2D();
normal_back_emiter_2 = new Emitter2D();
super();
var recursos:BackgroundResources = new BackgroundResources();
var fondo:Bitmap = recursos.create_background_screen();
addChild(fondo);
var sun:Bitmap = recursos.create_back_sun();
addChild(sun);
sun.x = 425;
sun.y = 100;
nubes = recursos.create_back_nubes();
addChild(nubes);
var last_x = -150;
edif_Back_screen = new Sprite();
var i:int;
while (i < 15) {
edif_Back = recursos.create_edif_back();
edif_Back_screen.addChild(edif_Back);
edif_Back.x = (edif_Back.x + last_x);
edif_Back.y = 230;
last_x = (last_x + edif_Back.width);
i++;
};
addChild(edif_Back_screen);
last_x = -150;
edif_front_screen = new Sprite();
i = 0;
while (i < 10) {
edif_front = recursos.create_edif_front();
edif_front_screen.addChild(edif_front);
edif_front.x = (edif_front.x + last_x);
edif_front.y = 230;
last_x = (last_x + edif_front.width);
i++;
};
addChild(edif_front_screen);
}
public function death_background():void{
normal_back_emiter_1.removeEventListener(EmitterEvent.EMITTER_EMPTY, restart);
normal_back_emiter_2.removeEventListener(EmitterEvent.EMITTER_EMPTY, restart);
TweenMax.to(music_renderer, 1, {alpha:0});
var emitter:Emitter2D = new Emitter2D();
emitter.counter = new Blast(100);
emitter.addInitializer(new ImageClass(Skull));
emitter.addInitializer(new Position(new RectangleZone(-100, -10, -50, 420)));
emitter.addInitializer(new Lifetime(30));
emitter.addInitializer(new ScaleImageInit(0.75, 1));
emitter.addAction(new Age());
emitter.addAction(new Move());
emitter.addAction(new Fade());
emitter.addAction(new GravityWell(25, 200, 200));
emitter.addAction(new GravityWell(25, 75, 75));
emitter.addAction(new GravityWell(25, 325, 325));
emitter.addAction(new GravityWell(25, 75, 660));
emitter.addAction(new GravityWell(25, 660, 75));
emitter.addAction(new GravityWell(25, 660, 400));
emitter.addAction(new BoundingBox(0, 0, 660, 420));
emitter.addEventListener(EmitterEvent.EMITTER_EMPTY, restart, false, 0, true);
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
renderer.addEmitter(emitter);
addChild(renderer);
renderer.addEmitter(emitter);
emitter.start();
}
private function restart(ev:EmitterEvent):void{
Emitter2D(ev.target).start();
}
public function actualizar(x:Number, y:Number):void{
this.x = x;
this.y = y;
nubes.x = (-(x) / 70);
edif_Back_screen.x = (-(x) / 30);
edif_front_screen.x = (-(x) / 5);
nubes.y = (-(y) / 70);
}
public function background_particles(color_init:int, color_fin:int):void{
normal_back_emiter_1.counter = new Blast(50);
normal_back_emiter_1.addInitializer(new ImageClass(WindAlpha));
normal_back_emiter_1.addInitializer(new ColorInit(color_init, color_fin));
normal_back_emiter_1.addInitializer(new Position(new RectangleZone(-100, -50, -50, 420)));
normal_back_emiter_1.addInitializer(new Lifetime(30));
normal_back_emiter_1.addAction(new Age());
normal_back_emiter_1.addAction(new Move());
normal_back_emiter_1.addAction(new Fade());
normal_back_emiter_1.addAction(new GravityWell(25, 200, 200));
normal_back_emiter_1.addAction(new GravityWell(25, 75, 75));
normal_back_emiter_1.addAction(new GravityWell(25, 325, 325));
normal_back_emiter_1.addAction(new GravityWell(25, 75, 660));
normal_back_emiter_1.addAction(new GravityWell(25, 660, 75));
normal_back_emiter_1.addAction(new BoundingBox(0, 0, 660, 420));
normal_back_emiter_1.addEventListener(EmitterEvent.EMITTER_EMPTY, restart, false, 0, true);
music_renderer = new DisplayObjectRenderer();
music_renderer.addEmitter(normal_back_emiter_1);
addChild(music_renderer);
music_renderer.blendMode = BlendMode.HARDLIGHT;
normal_back_emiter_1.start();
normal_back_emiter_2.counter = new Blast(50);
normal_back_emiter_2.addInitializer(new ImageClass(WindBeta));
normal_back_emiter_2.addInitializer(new ColorInit(color_init, color_fin));
normal_back_emiter_2.addInitializer(new Position(new RectangleZone(-100, -50, -50, 420)));
normal_back_emiter_2.addInitializer(new Lifetime(30));
normal_back_emiter_2.addAction(new Age());
normal_back_emiter_2.addAction(new Move());
normal_back_emiter_2.addAction(new Fade());
normal_back_emiter_2.addAction(new GravityWell(25, 200, 200));
normal_back_emiter_2.addAction(new GravityWell(25, 75, 75));
normal_back_emiter_2.addAction(new GravityWell(25, 325, 325));
normal_back_emiter_2.addAction(new GravityWell(25, 75, 660));
normal_back_emiter_2.addAction(new GravityWell(25, 660, 75));
normal_back_emiter_2.addAction(new GravityWell(25, 660, 400));
normal_back_emiter_2.addAction(new BoundingBox(0, 0, 660, 420));
normal_back_emiter_2.addEventListener(EmitterEvent.EMITTER_EMPTY, restart, false, 0, true);
music_renderer.addEmitter(normal_back_emiter_2);
normal_back_emiter_2.start();
}
}
}//package Clases.BasicScreens
Section 113
//BackgroundLevelSelection (Clases.BasicScreens.BackgroundLevelSelection)
package Clases.BasicScreens {
import flash.display.*;
import Clases.BasicScreens.ClassResources.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import gs.*;
public class BackgroundLevelSelection extends Sprite {
private const NUBE_TIMER:int = 500;
private var edif_Back_screen:Sprite;
private var edif_front_screen:Sprite;
private var nubesBack:Sprite;
private var normal_back_emiter_1:Emitter2D;
private var normal_back_emiter_2:Emitter2D;
private var nubes_last_position:int;// = 0
private var music_renderer:DisplayObjectRenderer;
public function BackgroundLevelSelection():void{
var nubes:Bitmap;
var edif_Back:Bitmap;
var edif_front:Bitmap;
normal_back_emiter_1 = new Emitter2D();
normal_back_emiter_2 = new Emitter2D();
nubesBack = new Sprite();
super();
var recursos:BackgroundResources = new BackgroundResources();
var fondo:Bitmap = recursos.create_background_screen();
addChild(fondo);
var sun:Bitmap = recursos.create_back_sun();
addChild(sun);
sun.x = 425;
sun.y = 100;
var last_x = -25;
var aux_x:int;
var i:int;
while (i < 3) {
nubes = recursos.create_back_nubes_level_Selection();
nubesBack.addChild(nubes);
nubes.x = (nubes.x + last_x);
nubes.y = 0;
last_x = (last_x + nubes.width);
aux_x = nubes.width;
i++;
};
nubes_last_position = (last_x - aux_x);
TweenMax.to(nubesBack, NUBE_TIMER, {x:-(nubes_last_position), onComplete:restart_Tween});
addChild(nubesBack);
last_x = -25;
edif_Back_screen = new Sprite();
i = 0;
while (i < 10) {
edif_Back = recursos.create_edif_back();
edif_Back_screen.addChild(edif_Back);
edif_Back.x = (edif_Back.x + last_x);
edif_Back.y = 230;
last_x = (last_x + edif_Back.width);
i++;
};
addChild(edif_Back_screen);
last_x = -25;
edif_front_screen = new Sprite();
i = 0;
while (i < 5) {
edif_front = recursos.create_edif_front();
edif_front_screen.addChild(edif_front);
edif_front.x = (edif_front.x + last_x);
edif_front.y = 240;
last_x = (last_x + edif_front.width);
i++;
};
addChild(edif_front_screen);
}
private function restart_Tween():void{
nubesBack.x = 0;
TweenMax.to(nubesBack, NUBE_TIMER, {x:-(nubes_last_position), onComplete:restart_Tween});
}
}
}//package Clases.BasicScreens
Section 114
//GameOver (Clases.BasicScreens.GameOver)
package Clases.BasicScreens {
import flash.events.*;
import flash.display.*;
import Clases.Text.*;
import Clases.Font.*;
public class GameOver extends Sprite {
private var format:FontResources;
private var vars:Object;
public function GameOver(){
format = new FontResources();
super();
}
public function init(v:Object=null):void{
vars = v;
generateScreen();
}
private function generateScreen():void{
var square:Sprite = new Sprite();
addChild(square);
square.graphics.beginFill(0xFFFF00);
square.graphics.drawRect(0, 0, 660, 420);
square.graphics.endFill();
square.blendMode = BlendMode.ALPHA;
var title:Text = new Text();
title.text = vars.notice;
title.x = 0;
title.y = 120;
title.setTextStyle({width:660, height:250, color:16739436, isBold:true, size:38, customFont:format.getA_Font_For_The_Computer_People_Font()});
title.addTextEfect({color:16766421, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
addChild(title);
var continue_game:Text = new Text();
continue_game.text = "press (space bar) to continue";
continue_game.x = 0;
continue_game.y = 320;
continue_game.setTextStyle({width:660, height:250, color:16739436, isBold:true, size:20, customFont:format.getA_Font_For_The_Computer_People_Font()});
continue_game.addTextEfect({color:16766421, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
addChild(continue_game);
this.addEventListener(KeyboardEvent.KEY_DOWN, checkKeysDownDown);
this.stage.focus = this;
this.stage.stageFocusRect = false;
}
private function checkKeysDownDown(event:KeyboardEvent):void{
if (event.charCode == 32){
if (vars.notice == "Level Complete"){
vars.level_scr.restart_function();
} else {
vars.level_scr.restart_level_function();
};
};
}
}
}//package Clases.BasicScreens
Section 115
//NextLevelScreen (Clases.BasicScreens.NextLevelScreen)
package Clases.BasicScreens {
import flash.events.*;
import flash.display.*;
import Clases.Game.System.*;
import Clases.Text.*;
import Clases.Font.*;
import mochi.as3.*;
public class NextLevelScreen extends Sprite {
private var once:Boolean;// = true
private var format:FontResources;
private var vars:Object;
private var myGUI:GUI;
public function NextLevelScreen(v:Object=null):void{
format = new FontResources();
super();
vars = v;
}
public function generateScreen():void{
var o:Object;
var boardID:String;
var square:Sprite = new Sprite();
addChild(square);
square.graphics.beginFill(0xFFFF00);
square.graphics.drawRect(0, 0, 660, 420);
square.graphics.endFill();
square.blendMode = BlendMode.ALPHA;
var title:Text = new Text();
title.text = "Well Done";
title.x = 0;
title.y = 120;
title.setTextStyle({width:660, height:250, color:16739436, isBold:true, size:38, customFont:format.getA_Font_For_The_Computer_People_Font()});
title.addTextEfect({color:16766421, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
addChild(title);
var continue_game:Text = new Text();
continue_game.text = "press (space bar) to continue";
continue_game.x = 0;
continue_game.y = 320;
continue_game.setTextStyle({width:660, height:250, color:16739436, isBold:true, size:20, customFont:format.getA_Font_For_The_Computer_People_Font()});
continue_game.addTextEfect({color:16766421, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
addChild(continue_game);
this.addEventListener(KeyboardEvent.KEY_DOWN, checkKeysDownDown);
this.stage.focus = this;
this.stage.stageFocusRect = false;
if (Main.last_played_level == 10){
o = {n:[0, 11, 14, 12, 14, 9, 12, 3, 8, 12, 11, 10, 11, 14, 12, 6], f:function (i:Number, s:String):String{
if (s.length == 16){
return (s);
};
return (this.f((i + 1), (s + this.n[i].toString(16))));
}};
boardID = o.f(0, "0bece9c38cbabec6");
MochiScores.showLeaderboard({boardID:boardID, score:Main.total_game_money, onClose:restart_level});
};
}
private function restart_level():void{
vars.level_scr.restart_function();
}
private function checkKeysDownDown(event:KeyboardEvent):void{
trace(("Main.current_level " + Main.current_level));
trace(("Main.last_played_level " + Main.last_played_level));
if (event.charCode == 32){
if (once){
if (Main.last_played_level == Main.current_level){
if (Main.current_level < 10){
Main.current_level++;
};
};
once = false;
};
vars.level_scr.restart_function();
};
}
}
}//package Clases.BasicScreens
Section 116
//PauseGame (Clases.BasicScreens.PauseGame)
package Clases.BasicScreens {
import flash.display.*;
import Clases.Text.*;
import Clases.Button.*;
import Clases.Font.*;
public class PauseGame extends Sprite {
private var instructions:Text;
private var title:Text;
private var saltoButton:GameButtonMoreGamesForYourSite;
private var square:Sprite;
public function PauseGame():void{
title = new Text();
instructions = new Text();
super();
square = new Sprite();
addChild(square);
square.graphics.beginFill(52223);
square.graphics.drawRect(0, 0, 660, 420);
square.graphics.endFill();
square.blendMode = BlendMode.MULTIPLY;
var format:FontResources = new FontResources();
title.text = "Pause";
title.x = 0;
title.y = 25;
title.setTextStyle({width:660, height:250, color:6747135, isBold:true, size:100, customFont:format.getA_Font_For_The_Computer_People_Font()});
title.addTextEfect({color:4836606, alpha:1, blurX:8, blurY:8, strength:15, quality:1});
instructions.text = "press (p) to continue";
instructions.x = 0;
instructions.y = 350;
instructions.setTextStyle({width:660, height:250, color:6747135, isBold:true, size:25, customFont:format.getA_Font_For_The_Computer_People_Font()});
instructions.addTextEfect({color:4836606, alpha:1, blurX:8, blurY:8, strength:15, quality:1});
addScreen();
}
public function addScreen():void{
addChild(square);
addChild(title);
addChild(instructions);
}
}
}//package Clases.BasicScreens
Section 117
//SounOnOf (Clases.BasicScreens.SounOnOf)
package Clases.BasicScreens {
import flash.events.*;
import flash.display.*;
import Clases.Text.*;
import Clases.BasicScreens.ClassResources.*;
import Clases.Button.*;
import Clases.Font.*;
import flash.media.*;
import Clases.Button.ButtonEfects.*;
public class SounOnOf extends Sprite {
private var cliclkOn:GameButton;
private var transformSound:SoundTransform;
private var myCar:Object;
private var texto:Text;
private var cliclkOff:GameButton;
private var colorTextOn:Object;
private var format:FontResources;
private var colorTextOff:Object;
public function SounOnOf():void{
transformSound = new SoundTransform();
format = new FontResources();
super();
cliclkOn = new GameButton({y:0, width:0, height:0, texto:"", size:25, skins:new OnButtonResources(), efect:new ButtonEfectNone()});
cliclkOff = new GameButton({y:0, width:0, height:0, texto:"", size:25, skins:new OffButtonResources(), efect:new ButtonEfectNone()});
if (Main.sounOption){
addChild(cliclkOn);
} else {
addChild(cliclkOff);
};
cliclkOn.addEventListener(MouseEvent.CLICK, removeOnButton, false, 0, true);
cliclkOff.addEventListener(MouseEvent.CLICK, removeOfButton, false, 0, true);
this.x = 636;
this.y = 398;
}
public function set car(a:Object):void{
myCar = a;
}
public function removeOfButton(e:MouseEvent):void{
removeChild(cliclkOff);
addChild(cliclkOn);
transformSound.volume = 1;
Main.sounOption = true;
SoundMixer.soundTransform = transformSound;
cliclkOn.addEventListener(MouseEvent.CLICK, removeOnButton, false, 0, true);
myCar.autoFocus();
}
public function removeOnButton(e:MouseEvent):void{
removeChild(cliclkOn);
addChild(cliclkOff);
Main.sounOption = false;
transformSound.volume = 0;
SoundMixer.soundTransform = transformSound;
cliclkOff.addEventListener(MouseEvent.CLICK, removeOfButton, false, 0, true);
myCar.autoFocus();
}
}
}//package Clases.BasicScreens
Section 118
//ButtonEfectNone (Clases.Button.ButtonEfects.ButtonEfectNone)
package Clases.Button.ButtonEfects {
public class ButtonEfectNone {
private const REVMOVE_EFECT_TIME:Number = 1;
private const ADD_EFECT_TIME:Number = 1;
public function ButtonEfectNone(){
super();
}
public function removeEfect():Object{
return ({});
}
public function addEfect():Object{
return ({});
}
public function addEfectTime():Number{
return (ADD_EFECT_TIME);
}
public function clickefect():void{
}
public function removeEfectTime():Number{
return (REVMOVE_EFECT_TIME);
}
}
}//package Clases.Button.ButtonEfects
Section 119
//ButtonFreGamesForYourSiteResources (Clases.Button.ButtonFreGamesForYourSiteResources)
package Clases.Button {
import flash.display.*;
public class ButtonFreGamesForYourSiteResources {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function ButtonFreGamesForYourSiteResources(){
UP_bitmap = ButtonFreGamesForYourSiteResources_UP_bitmap;
OVER_bitmap = ButtonFreGamesForYourSiteResources_OVER_bitmap;
DOWN_bitmap = ButtonFreGamesForYourSiteResources_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Button
Section 120
//ButtonFreGamesForYourSiteResources_DOWN_bitmap (Clases.Button.ButtonFreGamesForYourSiteResources_DOWN_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonFreGamesForYourSiteResources_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 121
//ButtonFreGamesForYourSiteResources_OVER_bitmap (Clases.Button.ButtonFreGamesForYourSiteResources_OVER_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonFreGamesForYourSiteResources_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 122
//ButtonFreGamesForYourSiteResources_UP_bitmap (Clases.Button.ButtonFreGamesForYourSiteResources_UP_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonFreGamesForYourSiteResources_UP_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 123
//ButtonLevelSelectionLoockedResources (Clases.Button.ButtonLevelSelectionLoockedResources)
package Clases.Button {
import flash.display.*;
public class ButtonLevelSelectionLoockedResources {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function ButtonLevelSelectionLoockedResources(){
UP_bitmap = ButtonLevelSelectionLoockedResources_UP_bitmap;
OVER_bitmap = ButtonLevelSelectionLoockedResources_OVER_bitmap;
DOWN_bitmap = ButtonLevelSelectionLoockedResources_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Button
Section 124
//ButtonLevelSelectionLoockedResources_DOWN_bitmap (Clases.Button.ButtonLevelSelectionLoockedResources_DOWN_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonLevelSelectionLoockedResources_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 125
//ButtonLevelSelectionLoockedResources_OVER_bitmap (Clases.Button.ButtonLevelSelectionLoockedResources_OVER_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonLevelSelectionLoockedResources_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 126
//ButtonLevelSelectionLoockedResources_UP_bitmap (Clases.Button.ButtonLevelSelectionLoockedResources_UP_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonLevelSelectionLoockedResources_UP_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 127
//ButtonMoreGamesResources (Clases.Button.ButtonMoreGamesResources)
package Clases.Button {
import flash.display.*;
public class ButtonMoreGamesResources {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function ButtonMoreGamesResources(){
UP_bitmap = ButtonMoreGamesResources_UP_bitmap;
OVER_bitmap = ButtonMoreGamesResources_OVER_bitmap;
DOWN_bitmap = ButtonMoreGamesResources_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Button
Section 128
//ButtonMoreGamesResources_DOWN_bitmap (Clases.Button.ButtonMoreGamesResources_DOWN_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonMoreGamesResources_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 129
//ButtonMoreGamesResources_OVER_bitmap (Clases.Button.ButtonMoreGamesResources_OVER_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonMoreGamesResources_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 130
//ButtonMoreGamesResources_UP_bitmap (Clases.Button.ButtonMoreGamesResources_UP_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonMoreGamesResources_UP_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 131
//ButtonPlayMainMenuResources (Clases.Button.ButtonPlayMainMenuResources)
package Clases.Button {
import flash.display.*;
public class ButtonPlayMainMenuResources {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function ButtonPlayMainMenuResources(){
UP_bitmap = ButtonPlayMainMenuResources_UP_bitmap;
OVER_bitmap = ButtonPlayMainMenuResources_OVER_bitmap;
DOWN_bitmap = ButtonPlayMainMenuResources_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Button
Section 132
//ButtonPlayMainMenuResources_DOWN_bitmap (Clases.Button.ButtonPlayMainMenuResources_DOWN_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonPlayMainMenuResources_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 133
//ButtonPlayMainMenuResources_OVER_bitmap (Clases.Button.ButtonPlayMainMenuResources_OVER_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonPlayMainMenuResources_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 134
//ButtonPlayMainMenuResources_UP_bitmap (Clases.Button.ButtonPlayMainMenuResources_UP_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonPlayMainMenuResources_UP_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 135
//ButtonPreloaderResources (Clases.Button.ButtonPreloaderResources)
package Clases.Button {
import flash.display.*;
public class ButtonPreloaderResources {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function ButtonPreloaderResources(){
UP_bitmap = ButtonPreloaderResources_UP_bitmap;
OVER_bitmap = ButtonPreloaderResources_OVER_bitmap;
DOWN_bitmap = ButtonPreloaderResources_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Button
Section 136
//ButtonPreloaderResources_DOWN_bitmap (Clases.Button.ButtonPreloaderResources_DOWN_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonPreloaderResources_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 137
//ButtonPreloaderResources_OVER_bitmap (Clases.Button.ButtonPreloaderResources_OVER_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonPreloaderResources_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 138
//ButtonPreloaderResources_UP_bitmap (Clases.Button.ButtonPreloaderResources_UP_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonPreloaderResources_UP_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 139
//ButtonResource (Clases.Button.ButtonResource)
package Clases.Button {
import flash.display.*;
public class ButtonResource {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function ButtonResource(){
UP_bitmap = ButtonResource_UP_bitmap;
DOWN_bitmap = ButtonResource_DOWN_bitmap;
OVER_bitmap = ButtonResource_OVER_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Button
Section 140
//ButtonResource_DOWN_bitmap (Clases.Button.ButtonResource_DOWN_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonResource_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 141
//ButtonResource_OVER_bitmap (Clases.Button.ButtonResource_OVER_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonResource_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 142
//ButtonResource_UP_bitmap (Clases.Button.ButtonResource_UP_bitmap)
package Clases.Button {
import mx.core.*;
public class ButtonResource_UP_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 143
//CustomButton (Clases.Button.CustomButton)
package Clases.Button {
import flash.display.*;
public class CustomButton extends SimpleButton {
public var upSprite:Sprite;
public var downSprite:Sprite;
public var overSprite:Sprite;
public function CustomButton(vars:Object):void{
super();
var bouttonResourcer:ButtonResource = new ButtonResource();
upSprite = new Sprite();
var up:Bitmap = vars.skins.createUpBitmap();
upSprite.addChild(up);
downSprite = new Sprite();
var down:Bitmap = vars.skins.createDownBitmap();
downSprite.addChild(down);
overSprite = new Sprite();
var over:Bitmap = vars.skins.createOverBitmap();
overSprite.addChild(over);
this.upState = upSprite;
this.overState = overSprite;
this.downState = downSprite;
this.hitTestState = upSprite;
}
}
}//package Clases.Button
Section 144
//GameButton (Clases.Button.GameButton)
package Clases.Button {
import flash.events.*;
import gs.*;
import gs.easing.*;
import Clases.Font.*;
import Clases.Text.*;
public class GameButton extends CustomButton {
private var effecto:Object;
public function GameButton(vars:Object){
super(vars);
effecto = vars;
this.addEventListener(MouseEvent.MOUSE_OVER, addEfect);
this.addEventListener(MouseEvent.MOUSE_OUT, removeEfect);
this.addEventListener(MouseEvent.CLICK, addClickEfect);
var format:FontResources = new FontResources();
var textoUp:Text = new Text();
textoUp.text = vars.texto;
if (vars.objectColor){
textoUp.setTextStyle({width:vars.width, height:vars.height, color:vars.objectColor.colorIn, isBold:true, size:vars.size, customFont:format.getA_Font_For_The_Computer_People_Font()});
} else {
textoUp.setTextStyle({width:vars.width, height:vars.height, color:0xFFFFFF, isBold:true, size:vars.size, customFont:format.getA_Font_For_The_Computer_People_Font()});
};
if (vars.objectColor){
textoUp.addTextEfect({color:vars.objectColor.colorOut, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
} else {
textoUp.addTextEfect({color:0xFFFFFF, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
};
textoUp.y = vars.y;
super.upSprite.addChild(textoUp);
var textoOver:Text = new Text();
textoOver.text = vars.texto;
if (vars.objectColor){
textoOver.setTextStyle({width:vars.width, height:vars.height, color:vars.objectColor.colorInOver, isBold:true, size:vars.size, customFont:format.getA_Font_For_The_Computer_People_Font()});
} else {
textoOver.setTextStyle({width:vars.width, height:vars.height, color:0xFFFFFF, isBold:true, size:vars.size, customFont:format.getA_Font_For_The_Computer_People_Font()});
};
if (vars.objectColor){
textoOver.addTextEfect({color:vars.objectColor.colorOutOver, alpha:1, blurX:10, blurY:10, strength:15, quality:1});
} else {
textoOver.addTextEfect({color:0xFFFFFF, alpha:1, blurX:10, blurY:10, strength:15, quality:1});
};
textoOver.y = vars.y;
super.overSprite.addChild(textoOver);
var textoDown:Text = new Text();
textoDown.text = vars.texto;
if (vars.objectColor){
textoDown.setTextStyle({width:vars.width, height:vars.height, color:vars.objectColor.colorInOverDown, isBold:true, size:vars.size, customFont:format.getA_Font_For_The_Computer_People_Font()});
} else {
textoDown.setTextStyle({width:vars.width, height:vars.height, color:0xFFFFFF, isBold:true, size:vars.size, customFont:format.getA_Font_For_The_Computer_People_Font()});
};
if (vars.objectColor){
textoDown.addTextEfect({color:vars.objectColor.colorOutOverDown, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
} else {
textoDown.addTextEfect({color:0xFFFFFF, alpha:1, blurX:5, blurY:5, strength:15, quality:1});
};
textoDown.y = vars.y;
super.downSprite.addChild(textoDown);
}
private function removeEfect(e:MouseEvent):void{
if (effecto.efect){
TweenMax.to(this, effecto.efect.removeEfectTime(), effecto.efect.removeEfect());
};
}
private function addEfect(e:MouseEvent):void{
if (effecto.efect){
TweenMax.to(this, effecto.efect.addEfectTime(), effecto.efect.addEfect());
};
}
public function getText():String{
return (effecto.texto);
}
public function getSkinClass():Object{
return (effecto.skins);
}
private function addClickEfect(e:MouseEvent):void{
if (effecto.efect){
effecto.efect.clickefect();
};
}
}
}//package Clases.Button
Section 145
//GameButtonFreeGames (Clases.Button.GameButtonFreeGames)
package Clases.Button {
import flash.events.*;
import flash.net.*;
import Clases.TrakingCode.*;
import gs.*;
import gs.easing.*;
public class GameButtonFreeGames extends GameButton {
private var googleCode:GoogleTrackingCode;
private var effecto:Object;
public function GameButtonFreeGames(vars:Object){
effecto = vars;
super(vars);
this.addEventListener(MouseEvent.CLICK, saltoAPortal);
if (effecto.padre){
googleCode = new GoogleTrackingCode(effecto.padre, "UA-4982430-8");
};
}
private function saltoAPortal(e:MouseEvent):void{
if (effecto.padre){
googleCode.More_games();
};
var saltoApagina:URLRequest = new URLRequest("http://www.i6.com/freegamesforyoursite.php?utm_source=games&utm_medium=hfleetfgfys");
navigateToURL(saltoApagina, "_blank");
}
}
}//package Clases.Button
Section 146
//GameButtonMoreGamesForYourSite (Clases.Button.GameButtonMoreGamesForYourSite)
package Clases.Button {
import flash.events.*;
import flash.net.*;
import Clases.TrakingCode.*;
import gs.*;
import gs.easing.*;
public class GameButtonMoreGamesForYourSite extends GameButton {
private var googleCode:GoogleTrackingCode;
private var effecto:Object;
public function GameButtonMoreGamesForYourSite(vars:Object){
effecto = vars;
super(vars);
this.addEventListener(MouseEvent.CLICK, saltoAPortal);
trace(effecto.padre);
if (effecto.padre){
googleCode = new GoogleTrackingCode(effecto.padre, "UA-4982430-8");
};
}
private function saltoAPortal(e:MouseEvent):void{
if (effecto.padre){
googleCode.More_games();
};
var saltoApagina:URLRequest = new URLRequest("http://www.i6.com/new-games.php?utm_source=games&utm_medium=hfleetpmg");
navigateToURL(saltoApagina, "_blank");
}
}
}//package Clases.Button
Section 147
//InGameButtonResource (Clases.Button.InGameButtonResource)
package Clases.Button {
import flash.display.*;
public class InGameButtonResource {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function InGameButtonResource(){
UP_bitmap = InGameButtonResource_UP_bitmap;
OVER_bitmap = InGameButtonResource_OVER_bitmap;
DOWN_bitmap = InGameButtonResource_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Button
Section 148
//InGameButtonResource_DOWN_bitmap (Clases.Button.InGameButtonResource_DOWN_bitmap)
package Clases.Button {
import mx.core.*;
public class InGameButtonResource_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 149
//InGameButtonResource_OVER_bitmap (Clases.Button.InGameButtonResource_OVER_bitmap)
package Clases.Button {
import mx.core.*;
public class InGameButtonResource_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 150
//InGameButtonResource_UP_bitmap (Clases.Button.InGameButtonResource_UP_bitmap)
package Clases.Button {
import mx.core.*;
public class InGameButtonResource_UP_bitmap extends BitmapAsset {
}
}//package Clases.Button
Section 151
//FontResources (Clases.Font.FontResources)
package Clases.Font {
import flash.text.*;
public class FontResources {
private var FirstFont:Class;
public function FontResources(){
FirstFont = FontResources_FirstFont;
super();
}
public function getA_Font_For_The_Computer_People_Font():Font{
var customFont:Font = (new FirstFont() as Font);
return (customFont);
}
}
}//package Clases.Font
Section 152
//FontResources_FirstFont (Clases.Font.FontResources_FirstFont)
package Clases.Font {
import mx.core.*;
public class FontResources_FirstFont extends FontAsset {
}
}//package Clases.Font
Section 153
//Camera (Clases.Game.Common.Camera)
package Clases.Game.Common {
import flash.display.*;
import Box2D.Common.Math.*;
import Clases.BasicEngine.*;
public class Camera {
private var game_gui_layer:Sprite;
private var helicopter_position:b2Vec2;
private var camera_position:b2Vec2;
private var master_clip:Sprite;
public function Camera(){
camera_position = new b2Vec2();
super();
}
public function update():void{
master_clip.x = (master_clip.x - ((((helicopter_position.x * PhisicBase.m_phys_scale) - (Main.WIDTH_SIZE / 2)) + master_clip.x) / 25));
master_clip.y = (master_clip.y - ((((helicopter_position.y * PhisicBase.m_phys_scale) - (Main.HEIGHT_SIZE / 2.3)) + master_clip.y) / 25));
game_gui_layer.x = -(master_clip.x);
game_gui_layer.y = -(master_clip.y);
}
public function init(m_c:Sprite, c:Sprite, h:b2Vec2):void{
game_gui_layer = c;
master_clip = m_c;
helicopter_position = h;
}
}
}//package Clases.Game.Common
Section 154
//DrawLimit (Clases.Game.Common.DrawLimit)
package Clases.Game.Common {
import flash.display.*;
import Clases.Game.Levels.*;
import gs.*;
public class DrawLimit extends Sprite {
private var sprite:Sprite;
private var vars:Object;
public function DrawLimit(){
sprite = new Sprite();
super();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function generate():void{
draw_Limit(vars.xml);
}
private function draw_Limit(svg:XML):void{
var loop:Boolean;
var path:XML;
var alpha_to_Zero:Function;
var alpha_to_one:Function;
var d:String;
var regExp:RegExp;
var args:Array;
var i:int;
var svg = svg;
alpha_to_Zero = function ():void{
TweenMax.to(sprite, 0.5, {alpha:0, onComplete:alpha_to_one});
};
alpha_to_one = function ():void{
TweenMax.to(sprite, 0.5, {alpha:1, onComplete:alpha_to_Zero});
};
var ns:Namespace = svg.namespace("");
var xLst:Number = 0;
var yLst:Number = 0;
var path_Bitmap:LevelTerrain = new LevelTerrain();
var bitmap:BitmapData = new BitmapData(path_Bitmap.createTerrainPath().width, path_Bitmap.createTerrainPath().height);
var bmp:Bitmap = path_Bitmap.createTerrainPath();
sprite.graphics.lineStyle(5, 0xFF0000);
for each (path in svg..ns::path) {
d = path.@d;
regExp = / |,/;
args = d.split(regExp);
if (args[(args.length - 1)] == ""){
args.pop();
};
i = 1;
while (true) {
if (i == (args.length - 2)){
throw (new Error("muy corto"));
};
if ((((args[(i + 2)] == "z")) || ((args[(i + 2)] == "Z")))){
loop = true;
break;
} else {
if (args[(i + 2)] != "L"){
throw (new Error("Unsupported: The SVG Path contains an arc command or move-to command or a relative coordinate."));
};
};
if (i < 3){
sprite.graphics.moveTo(args[i], args[(i + 1)]);
} else {
sprite.graphics.lineTo(xLst, yLst);
};
xLst = args[i];
yLst = args[(i + 1)];
i = (i + 3);
};
sprite.graphics.lineTo(xLst, yLst);
sprite.graphics.lineTo(args[1], args[2]);
};
sprite.graphics.endFill();
addChild(sprite);
TweenMax.to(sprite, 0.5, {alpha:0, onComplete:alpha_to_one});
}
}
}//package Clases.Game.Common
Section 155
//DrawObjects (Clases.Game.Common.DrawObjects)
package Clases.Game.Common {
import flash.display.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Clases.Game.Levels.LevelObjects.*;
public class DrawObjects extends Sprite {
private var vars:Object;
private var sprite:Sprite;
private var obj_list:Array;
public function DrawObjects(){
sprite = new Sprite();
obj_list = new Array();
super();
}
public function getListObject():Array{
return (obj_list);
}
public function draw_Objects_on_screen(objects:XML, world:b2World, physic_scale:Number):void{
var item:XML;
var rectList:XMLList;
var bodyDef:b2BodyDef;
var newBody:b2Body;
var lastX:Number;
var lastY:Number;
var initialX:Number;
var initialY:Number;
var rectObject:XML;
var width:Number;
var height:Number;
var x:Number;
var y:Number;
var polygonDef:b2PolygonDef;
var densidad:Number;
var gList:XMLList = objects.g;
for each (item in gList) {
rectList = item.rect;
lastX = 0;
lastY = 0;
for each (rectObject in rectList) {
width = (rectObject.@width / (physic_scale * 2));
height = (rectObject.@height / (physic_scale * 2));
x = (rectObject.@x / physic_scale);
y = (rectObject.@y / physic_scale);
densidad = rectObject.@density;
if (!bodyDef){
bodyDef = new b2BodyDef();
bodyDef.position = new b2Vec2(x, y);
if (rectObject.@id == "Cube With Hook"){
bodyDef.userData = new Cargo_Skin();
bodyDef.userData.addHoock();
} else {
if (rectObject.@id == "Small Platform"){
bodyDef.userData = new SmallPlatform();
} else {
if (rectObject.@id == "Medium Platform"){
bodyDef.userData = new MediumPlatform();
} else {
if (rectObject.@id == "Cube"){
bodyDef.userData = new Cargo_Skin();
} else {
bodyDef.userData = "null";
};
};
};
};
addChild(bodyDef.userData);
bodyDef.angle = 0;
bodyDef.angularDamping = 1;
bodyDef.linearDamping = 0.75;
newBody = world.CreateBody(bodyDef);
if ((bodyDef.userData is Cargo_Skin)){
obj_list.push(newBody);
};
lastX = 0;
lastY = 0;
initialX = x;
initialY = y;
};
lastX = (x - (initialX - width));
lastY = (y - (initialY - height));
polygonDef = new b2PolygonDef();
polygonDef.friction = 1;
polygonDef.restitution = 0;
polygonDef.density = densidad;
polygonDef.filter.groupIndex = 0;
polygonDef.SetAsOrientedBox(width, height, new b2Vec2(lastX, lastY), 0);
newBody.CreateShape(polygonDef);
};
newBody.SetMassFromShapes();
bodyDef = null;
};
}
}
}//package Clases.Game.Common
Section 156
//DrawTerrain (Clases.Game.Common.DrawTerrain)
package Clases.Game.Common {
import flash.display.*;
import Clases.Game.Levels.*;
public class DrawTerrain extends Sprite {
private var sprite:Sprite;
private var vars:Object;
public function DrawTerrain(){
sprite = new Sprite();
super();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function draw_SVG_to_Sprite(svg:XML):void{
var loop:Boolean;
var path:XML;
var d:String;
var regExp:RegExp;
var args:Array;
var i:int;
var ns:Namespace = svg.namespace("");
var xLst:Number = 0;
var yLst:Number = 0;
var path_Bitmap:LevelTerrain = new LevelTerrain();
var bitmap:BitmapData = new BitmapData(path_Bitmap.createTerrainPath().width, path_Bitmap.createTerrainPath().height);
var bmp:Bitmap = path_Bitmap.createTerrainPath();
sprite.graphics.lineStyle(1, 0);
sprite.graphics.beginBitmapFill(bmp.bitmapData);
for each (path in svg..ns::path) {
d = path.@d;
regExp = / |,/;
args = d.split(regExp);
if (args[(args.length - 1)] == ""){
args.pop();
};
i = 1;
while (true) {
if (i == (args.length - 2)){
throw (new Error("muy corto"));
};
if ((((args[(i + 2)] == "z")) || ((args[(i + 2)] == "Z")))){
loop = true;
break;
} else {
if (args[(i + 2)] != "L"){
throw (new Error("Unsupported: The SVG Path contains an arc command or move-to command or a relative coordinate."));
};
};
if (i < 3){
sprite.graphics.moveTo(args[i], args[(i + 1)]);
} else {
sprite.graphics.lineTo(xLst, yLst);
};
xLst = args[i];
yLst = args[(i + 1)];
i = (i + 3);
};
sprite.graphics.lineTo(xLst, yLst);
sprite.graphics.lineTo(args[1], args[2]);
};
sprite.graphics.endFill();
addChild(sprite);
}
private function generate():void{
draw_SVG_to_Sprite(vars.xml);
}
}
}//package Clases.Game.Common
Section 157
//Remover (Clases.Game.Common.Remover)
package Clases.Game.Common {
public class Remover {
public function Remover(){
super();
}
public function removeAllChilds_objects(elemnto:Object):void{
var children:Array = new Array();
var i:int;
while (i < elemnto.numChildren) {
children.push(elemnto.getChildAt(i));
i++;
};
i = 0;
while (i < children.length) {
children[i].parent.removeChild(children[i]);
children[i] = null;
i++;
};
}
public function removeAll(elemnto:Object):void{
var children:Array = new Array();
var i:int;
while (i < elemnto.numChildren) {
children.push(elemnto.getChildAt(i));
i++;
};
i = 0;
while (i < children.length) {
children[i].parent.removeChild(children[i]);
children[i] = null;
elemnto.parent.removeChild(elemnto);
elemnto = null;
i++;
};
}
}
}//package Clases.Game.Common
Section 158
//EndLevelContact (Clases.Game.Levels.Contacts.EndLevelContact)
package Clases.Game.Levels.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
import Clases.Game.Levels.LevelObjects.*;
public class EndLevelContact extends b2ContactListener {
private var theWorld:b2World;
private var once_box_at_time:Boolean;// = true
private var level_eng_object_list:Array;
private var vars:Object;
private var nuecked_object:Array;
private var nuecked_object_whitout_score:Array;
public function EndLevelContact(){
nuecked_object = new Array();
nuecked_object_whitout_score = new Array();
super();
}
public function nukedBody():void{
var b:b2Body;
var b2:b2Body;
for each (b in nuecked_object) {
if ((b.GetUserData() is Cargo_Skin)){
vars.world.DestroyBody(b);
trace("Download Cargo");
b.GetUserData().remove_Box(b, vars.helicopter);
level_eng_object_list.pop();
vars.gui.object_donloaded();
} else {
if ((((b.GetUserData() is SmallPlatform)) || ((b.GetUserData() is MediumPlatform)))){
vars.world.DestroyBody(b);
b.GetUserData().remove();
};
};
};
for each (b2 in nuecked_object_whitout_score) {
if ((((b2.GetUserData() is Cargo_Skin)) && ((b2.GetUserData().hoock_status() == false)))){
vars.world.DestroyBody(b2);
trace("Box on the ground");
b2.GetUserData().remove_bos_from_terrain();
level_eng_object_list.pop();
vars.gui.cant_objecjt_to_goal = level_eng_object_list.length;
};
};
nuecked_object = [];
nuecked_object_whitout_score = [];
once_box_at_time = true;
}
override public function Add(point:b2ContactPoint):void{
if ((((point.shape1.GetUserData() == "Download_Cargo_Zone")) && ((((((point.shape2.GetBody().GetUserData() is Cargo_Skin)) || ((point.shape2.GetBody().GetUserData() is SmallPlatform)))) || ((point.shape2.GetBody().GetUserData() is MediumPlatform)))))){
if (once_box_at_time){
nuecked_object.push(point.shape2.GetBody());
once_box_at_time = false;
};
};
if ((((point.shape2.GetBody().GetUserData() == null)) && ((((point.shape1.GetBody().GetUserData() is Cargo_Skin)) && ((point.shape1.GetBody().GetUserData().hoock_status() == false)))))){
nuecked_object_whitout_score.push(point.shape1.GetBody());
};
}
override public function Remove(point:b2ContactPoint):void{
}
public function addObjectList(a:Array):void{
level_eng_object_list = a;
}
public function init(v:Object):void{
vars = v;
}
override public function Persist(point:b2ContactPoint):void{
if ((((point.shape2.GetUserData() == "helipad")) && ((point.shape1.GetUserData() == "pies")))){
vars.helicopter.add_hull_and_fuel();
};
}
private function removeElement():void{
}
override public function Result(point:b2ContactResult):void{
if ((((point.shape1.GetUserData() == "helice")) || ((point.shape2.GetUserData() == "helice")))){
vars.helicopter.hit(point.normalImpulse);
};
if ((((point.shape1.GetUserData() == "cabina")) || ((point.shape2.GetUserData() == "cabina")))){
vars.helicopter.hit(point.normalImpulse);
};
}
}
}//package Clases.Game.Levels.Contacts
Section 159
//Cargo (Clases.Game.Levels.LevelObjects.Cargo)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import Box2D.Dynamics.*;
import Clases.Text.*;
import Clases.Game.Veicle.*;
import Clases.BasicScreens.ClassResources.*;
import Clases.Font.*;
import Clases.Game.SFX.*;
import gs.*;
public class Cargo extends Sprite {
private var optionsBonus:Object;
private var score_text:Text;
private var hoock:Cargo_Hook;
private var efect:Object;
private var format:FontResources;
private var star_sfx:StarParticleEfects;
private var skin:Bitmap;
private var money_soundn:ResourceSound;
public function Cargo(){
star_sfx = new StarParticleEfects();
money_soundn = new ResourceSound();
format = new FontResources();
optionsBonus = {width:115, height:30, color:0xFFFF00, isBold:true, size:25, customFont:format.getA_Font_For_The_Computer_People_Font(), align:TextFormatAlign.LEFT};
efect = {color:0x828200, alpha:1, blurX:5, blurY:5, strength:15, quality:1};
super();
}
public function remove(score:int, b:b2Body, hely:Helicopter):void{
var addMoney:Function;
var score = score;
var b = b;
var hely = hely;
addMoney = function ():void{
hely.actual_GUI.actualizar_money();
money_soundn.play_cash_money();
};
score_text = new Text();
score_text.text = String(score);
b.GetUserData().globalToLocal(new Point(b.GetUserData().x, b.GetUserData().x));
score_text.setTextStyle(optionsBonus);
score_text.addTextEfect(efect);
hely.actual_GUI.addChild(score_text);
var position:Point = score_text.parent.globalToLocal(b.GetUserData().box().parent.localToGlobal(new Point(b.GetUserData().box().x, b.GetUserData().box().y)));
score_text.x = (position.x + (b.GetUserData().box().width / 2));
score_text.y = (position.y - (b.GetUserData().box().height / 2));
TweenMax.to(score_text, 0.8, {x:580, y:0, alpha:0, onComplete:addMoney});
star_sfx.start_efect();
money_soundn.play_Download_Box();
Main.total_game_money = (Main.total_game_money + score);
}
protected function addEfects(x:Number, y:Number):void{
star_sfx.addParticle_efects(x, y);
addChild(star_sfx);
}
private function call_to_end_function():void{
}
}
}//package Clases.Game.Levels.LevelObjects
Section 160
//Cargo_Hook (Clases.Game.Levels.LevelObjects.Cargo_Hook)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
import gs.*;
public class Cargo_Hook extends Sprite {
public function Cargo_Hook(){
var skin:Bitmap;
var efecto_amarillo:Function;
var efecto_rojo:Function;
super();
efecto_amarillo = function ():void{
TweenMax.to(skin, 1, {colorMatrixFilter:{colorize:16777011, amount:0.5}, onComplete:efecto_rojo});
};
efecto_rojo = function ():void{
TweenMax.to(skin, 1, {colorMatrixFilter:{colorize:0xFF0000, amount:0.5}, onComplete:efecto_amarillo});
};
var recursos:LevelObjectResource = new LevelObjectResource();
skin = recursos.create_cargo_hook_Bitmap();
addChild(skin);
skin.smoothing = true;
TweenMax.to(skin, 1, {colorMatrixFilter:{colorize:0xFF0000, amount:1}, onComplete:efecto_amarillo});
}
}
}//package Clases.Game.Levels.LevelObjects
Section 161
//Cargo_Skin (Clases.Game.Levels.LevelObjects.Cargo_Skin)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
import Box2D.Dynamics.*;
import Clases.Game.Veicle.*;
import gs.*;
public class Cargo_Skin extends Cargo {
private const BOX_VALUE:int = 850;
private var hoock:Cargo_Hook;
private var skin:Bitmap;
public function Cargo_Skin(){
super();
var recursos:LevelObjectResource = new LevelObjectResource();
skin = recursos.create_cargo_Bitmap();
addChild(skin);
skin.x = (skin.x - 4);
skin.y = (skin.y - 4);
skin.smoothing = true;
addEfects(((skin.width / 2) - 15), ((skin.height / 2) - 15));
}
public function remove_Box(b:b2Body, h:Helicopter):void{
TweenMax.to(skin, 1, {alpha:0});
if (hoock){
TweenMax.to(hoock, 1, {alpha:0});
};
remove(BOX_VALUE, b, h);
}
public function hoock_status():Boolean{
if (hoock){
return (true);
};
return (false);
}
public function box():Bitmap{
return (skin);
}
public function remove_bos_from_terrain():void{
TweenMax.to(skin, 1, {alpha:0});
}
public function addHoock():void{
hoock = new Cargo_Hook();
addChild(hoock);
hoock.x = 17;
hoock.y = -45;
}
}
}//package Clases.Game.Levels.LevelObjects
Section 162
//HeliPad (Clases.Game.Levels.LevelObjects.HeliPad)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class HeliPad extends Sprite {
private var building:b2Body;
private var vars:Object;
public function HeliPad(){
super();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function generate():void{
var body:b2Body;
var bodyDef:b2BodyDef;
var boxDef:b2PolygonDef;
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.Object_Position[0], vars.Object_Position[1]);
bodyDef.userData = new HeliPadsSkin();
bodyDef.userData.x = -4000;
bodyDef.userData.y = -4000;
addChild(bodyDef.userData);
building = vars.world.CreateBody(bodyDef);
boxDef = new b2PolygonDef();
boxDef.density = 0;
boxDef.friction = 0.5;
boxDef.restitution = 0.3;
boxDef.SetAsOrientedBox(5, 0.2, new b2Vec2(-0.8, -1), 0);
boxDef.userData = "helipad";
building.CreateShape(boxDef);
boxDef.SetAsOrientedBox(2, 1.5, new b2Vec2(-7.8, -2.3), 0);
boxDef.userData = "Hangar";
building.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1.5, 0.6, new b2Vec2(-7.8, -4.4), 0);
boxDef.userData = "Hangar";
building.CreateShape(boxDef);
building.SetMassFromShapes();
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.Object_Position[0], vars.Object_Position[1]);
bodyDef.userData = new HeliPadsSkin();
bodyDef.userData.x = -4000;
bodyDef.userData.y = -4000;
addChild(bodyDef.userData);
building = vars.world.CreateBody(bodyDef);
boxDef = new b2PolygonDef();
boxDef.density = 0;
boxDef.friction = 0.5;
boxDef.restitution = 0.3;
boxDef.SetAsOrientedBox(5, 1, new b2Vec2(-0.8, -1), 0);
boxDef.userData = "Download_Cargo_Zone";
boxDef.isSensor = true;
building.CreateShape(boxDef);
building.SetMassFromShapes();
}
}
}//package Clases.Game.Levels.LevelObjects
Section 163
//HeliPadsSkin (Clases.Game.Levels.LevelObjects.HeliPadsSkin)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
public class HeliPadsSkin extends Sprite {
public function HeliPadsSkin(){
super();
var recursos:LevelObjectResource = new LevelObjectResource();
var flag:Flag_Animation = new Flag_Animation();
addChild(flag);
flag.x = 135;
flag.y = -53;
var skin:Bitmap = recursos.createHeliPadSkinBitmap();
addChild(skin);
skin.x = (skin.x - ((skin.width / 2) + 82));
skin.y = (skin.y - ((skin.height / 2) + 94));
skin.smoothing = true;
}
}
}//package Clases.Game.Levels.LevelObjects
Section 164
//LevelObjectResource (Clases.Game.Levels.LevelObjects.LevelObjectResource)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
public class LevelObjectResource {
private const Caja_hook_Bitmap:Class;
private const Small_Platform_Bitmap:Class;
private const Medium_Platform_Bitmap:Class;
private const HEliPadSkin_bitmap:Class;
private const Caja_Bitmap:Class;
public function LevelObjectResource(){
HEliPadSkin_bitmap = LevelObjectResource_HEliPadSkin_bitmap;
Caja_Bitmap = LevelObjectResource_Caja_Bitmap;
Caja_hook_Bitmap = LevelObjectResource_Caja_hook_Bitmap;
Small_Platform_Bitmap = LevelObjectResource_Small_Platform_Bitmap;
Medium_Platform_Bitmap = LevelObjectResource_Medium_Platform_Bitmap;
super();
}
public function create_small_platform_Bitmap():Bitmap{
var skin:Bitmap = (new Small_Platform_Bitmap() as Bitmap);
return (skin);
}
public function create_cargo_hook_Bitmap():Bitmap{
var skin:Bitmap = (new Caja_hook_Bitmap() as Bitmap);
return (skin);
}
public function createHeliPadSkinBitmap():Bitmap{
var skin:Bitmap = (new HEliPadSkin_bitmap() as Bitmap);
return (skin);
}
public function create_Medium_platform_Bitmap():Bitmap{
var skin:Bitmap = (new Medium_Platform_Bitmap() as Bitmap);
return (skin);
}
public function create_cargo_Bitmap():Bitmap{
var skin:Bitmap = (new Caja_Bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.Levels.LevelObjects
Section 165
//LevelObjectResource_Caja_Bitmap (Clases.Game.Levels.LevelObjects.LevelObjectResource_Caja_Bitmap)
package Clases.Game.Levels.LevelObjects {
import mx.core.*;
public class LevelObjectResource_Caja_Bitmap extends BitmapAsset {
}
}//package Clases.Game.Levels.LevelObjects
Section 166
//LevelObjectResource_Caja_hook_Bitmap (Clases.Game.Levels.LevelObjects.LevelObjectResource_Caja_hook_Bitmap)
package Clases.Game.Levels.LevelObjects {
import mx.core.*;
public class LevelObjectResource_Caja_hook_Bitmap extends BitmapAsset {
}
}//package Clases.Game.Levels.LevelObjects
Section 167
//LevelObjectResource_HEliPadSkin_bitmap (Clases.Game.Levels.LevelObjects.LevelObjectResource_HEliPadSkin_bitmap)
package Clases.Game.Levels.LevelObjects {
import mx.core.*;
public class LevelObjectResource_HEliPadSkin_bitmap extends BitmapAsset {
}
}//package Clases.Game.Levels.LevelObjects
Section 168
//LevelObjectResource_Medium_Platform_Bitmap (Clases.Game.Levels.LevelObjects.LevelObjectResource_Medium_Platform_Bitmap)
package Clases.Game.Levels.LevelObjects {
import mx.core.*;
public class LevelObjectResource_Medium_Platform_Bitmap extends BitmapAsset {
}
}//package Clases.Game.Levels.LevelObjects
Section 169
//LevelObjectResource_Small_Platform_Bitmap (Clases.Game.Levels.LevelObjects.LevelObjectResource_Small_Platform_Bitmap)
package Clases.Game.Levels.LevelObjects {
import mx.core.*;
public class LevelObjectResource_Small_Platform_Bitmap extends BitmapAsset {
}
}//package Clases.Game.Levels.LevelObjects
Section 170
//MediumPlatform (Clases.Game.Levels.LevelObjects.MediumPlatform)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
import gs.*;
public class MediumPlatform extends Sprite {
private const BOX_VALUE:int = 100;
private var hoock:Cargo_Hook;
private var skin:Bitmap;
public function MediumPlatform(){
super();
var recursos:LevelObjectResource = new LevelObjectResource();
skin = recursos.create_Medium_platform_Bitmap();
addChild(skin);
skin.x = -20;
skin.y = -90;
skin.smoothing = true;
}
public function remove():void{
TweenMax.to(skin, 1, {alpha:0});
}
}
}//package Clases.Game.Levels.LevelObjects
Section 171
//SmallPlatform (Clases.Game.Levels.LevelObjects.SmallPlatform)
package Clases.Game.Levels.LevelObjects {
import flash.display.*;
import gs.*;
public class SmallPlatform extends Sprite {
private const BOX_VALUE:int = 100;
private var hoock:Cargo_Hook;
private var skin:Bitmap;
public function SmallPlatform(){
super();
var recursos:LevelObjectResource = new LevelObjectResource();
skin = recursos.create_small_platform_Bitmap();
addChild(skin);
skin.x = -20;
skin.y = -90;
skin.smoothing = true;
}
public function remove():void{
TweenMax.to(skin, 1, {alpha:0});
}
}
}//package Clases.Game.Levels.LevelObjects
Section 172
//Level (Clases.Game.Levels.Level)
package Clases.Game.Levels {
import flash.events.*;
import Clases.Game.System.*;
import Clases.Game.LevelSelection.*;
import Clases.BasicEngine.*;
import Clases.BasicScreens.*;
import Clases.Game.Levels.Contacts.*;
import Clases.Game.Common.*;
import Clases.Game.Levels.LevelObjects.*;
public class Level extends PhisicBase {
private var nextLevel:NextLevelScreen;
private var level_object_list:Array;
private var gameOver:GameOver;
private var back:BackgroundGame;
private var pausegame:PauseGame;
private var vars:Object;
protected var myGUI:GUI;
private var endLevelContact:EndLevelContact;
private var levleSelection_scr:LevelSelectionScreen;
private var gameCamera:Camera;
public function Level(){
endLevelContact = new EndLevelContact();
myGUI = new GUI();
back = new BackgroundGame();
gameCamera = new Camera();
super();
}
protected function bring_to_Front_the_gui():void{
myGUI.bringToFront();
}
protected function set object_list(a:Array):void{
level_object_list = a;
endLevelContact.addObjectList(level_object_list);
}
protected function generate_objects(c:XML):void{
var drawObjects:DrawObjects = new DrawObjects();
drawObjects.draw_Objects_on_screen(c, m_world, PhisicBase.m_phys_scale);
addChild(drawObjects);
object_list = drawObjects.getListObject();
myGUI.cant_objecjt_to_goal = drawObjects.getListObject().length;
}
private function addContacts():void{
m_world.SetContactListener(endLevelContact);
}
public function init(v:Object=null):void{
vars = v;
generate();
addChild(vars.heli);
vars.heli.generateHelicopter(super.m_world, {H_Position:vars.HeliStartPos, levelStage:vars.level1Stage, mg:myGUI});
vars.heli.autoFocus();
add_Hely_Pad();
endLevelContact.init({helicopter:vars.heli, world:m_world, gui:myGUI});
addContacts();
addChild(myGUI);
myGUI.init({currentVeicle:vars.heli});
myGUI.bringToFront();
gameCamera.init(this, myGUI, vars.heli.cabin);
}
private function actualizar_background():void{
back.actualizar(myGUI.x, myGUI.y);
}
public function set levelSelection(a:LevelSelectionScreen):void{
levleSelection_scr = a;
myGUI.addLevelSelectionScreen(a);
}
public function remove_background_levels():void{
removeEventListener(Event.ENTER_FRAME, actualizar_every_frame);
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
vars.heli.remove_all_childs();
delete vars.heli;
super.desrtoy();
}
private function generate():void{
addEventListener(Event.ENTER_FRAME, actualizar_every_frame, false, 0, true);
}
public function addBackground(color_init:int, color_fin:int):void{
addChild(back);
back.background_particles(color_init, color_fin);
}
private function actualizar_every_frame(e:Event):void{
if (myGUI.fuel_cant_out_limit()){
super.updateLevel();
if (!gameOver){
trace("game over, fuel Out");
gameOver = new GameOver();
myGUI.addChild(gameOver);
gameOver.init({notice:"no more fuel", level_scr:levleSelection_scr});
Main.total_game_money = (Main.total_game_money - 500);
};
} else {
if (myGUI.hull_cant_out_limit()){
super.updateLevel();
if (!gameOver){
vars.heli.remove_it();
back.death_background();
trace("game Over, hely crashed");
gameOver = new GameOver();
myGUI.addChild(gameOver);
gameOver.init({notice:"", level_scr:levleSelection_scr});
Main.total_game_money = (Main.total_game_money - 500);
};
} else {
if (level_object_list.length > 0){
if (vars.heli.theGameIsPaused()){
super.updateLevel();
vars.heli.update();
gameCamera.update();
endLevelContact.nukedBody();
actualizar_background();
if (pausegame){
myGUI.removeChild(pausegame);
pausegame = null;
};
} else {
if (!pausegame){
pausegame = new PauseGame();
myGUI.addChild(pausegame);
};
};
} else {
removeEventListener(Event.ENTER_FRAME, actualizar_every_frame);
nextLevel = new NextLevelScreen({level_scr:levleSelection_scr});
myGUI.addChild(nextLevel);
nextLevel.generateScreen();
trace("next level");
};
};
};
}
protected function add_Hely_Pad():void{
var helipad:HeliPad = new HeliPad();
helipad.init({world:m_world, Object_Position:vars.Helupad_pos});
addChild(helipad);
}
}
}//package Clases.Game.Levels
Section 173
//Level1 (Clases.Game.Levels.Level1)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level1 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level1(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="210mm" height="297mm" id="svg2433" sodipodi:version="0.32" inkscape:version="0.46" sodipodi:docname="Level1.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs id="defs2435">
<inkscape:perspective sodipodi:type="inkscape:persp3d" inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="744.09448 : 526.18109 : 1" inkscape:persp3d-origin="372.04724 : 350.78739 : 1" id="perspective2441"/>
</defs>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.54656364" inkscape:cx="1145.3794" inkscape:cy="769.46429" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1440" inkscape:window-height="853" inkscape:window-x="-4" inkscape:window-y="-4"/>
<metadata id="metadata2438">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 2458.7576,397.18211 L 2460.7061,-398.81787 L 2.7061051,-394.81787 L 4.5534651,397.18211 L 2458.7576,397.18211 z" id="path2380" sodipodi:nodetypes="ccccc"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="344.36218" x="1677" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="302.36218" x="1696" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="3500.0901" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level1Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 3182.0515,394.36218 L 3184,1138.3622 L -534,1142.3622 L -532.15264,394.36218 L 3182.0515,394.36218 z" id="path2380" sodipodi:nodetypes="ccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="210mm" height="297mm" id="svg2433" sodipodi:version="0.32" inkscape:version="0.46" sodipodi:docname="Level1Limits.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 2458.7576,437.18211 L 2460.7061,-398.81787 L 2.7061051,-394.81787 L 4.5534651,437.18211 L 5,436.36218 L 2458.7576,437.18211 z" id="path2380" sodipodi:nodetypes="cccccc"/>
<g id="g2404"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
var removeAll:Remover = new Remover();
removeAll.removeAllChilds_objects(this);
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel1TerrainBitmap();
addChild(surface);
surface.y = 165;
surface.x = -500;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4279208944, 4280344520);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [10, 13.18];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [10, 12.8];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [10, 12.8];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [10, 12.3];
};
var Helipad_position:Array = [10, 13.9];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 174
//Level10 (Clases.Game.Levels.Level10)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level10 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level10(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve10.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:nodetypes="ccsssssscsssscsssssssssssssssccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" id="path2380" d="M -121.01543,286.93118 L 581,286.93118 L 584.93359,299.46728 L 596.90625,332.76415 L 617.17578,380.35466 L 630.50244,407.48905 L 646,435.77168 L 663.70068,464.39415 L 683.63672,492.54807 L 705.84033,519.42506 L 730.34375,544.21671 L 757.1792,566.11464 L 786.37891,584.31046 L 817.9751,597.99577 L 834.68195,602.89436 L 852,606.36218 L 981.79065,625.29222 L 1038.1231,631.59037 L 1088.6084,634.84227 L 1133.1426,634.34667 L 1171.6219,629.40229 L 1188.5585,625.04266 L 1203.9424,619.30788 L 1217.7605,612.11027 L 1230,603.36218 L 1235.1103,595.74735 L 1235.6732,585.57284 L 1232.0698,573.03769 L 1224.6811,558.34095 L 1213.8882,541.68167 L 1200.0722,523.25888 L 1164.8953,481.919 L 1122.199,435.91368 L 1075.0319,386.83529 L 979.48014,285.82877 L 977.4942,281.29039 L 978.43087,275.69715 L 987.42584,261.95865 L 1003.1726,245.83841 L 1022.3786,228.56156 L 1041.7514,211.35322 L 1057.9986,195.43853 L 1067.8277,182.04263 L 1069.3066,176.67207 L 1067.9462,172.39063 L 1058.209,164.06835 L 1042.828,155.8701 L 1022.6728,147.8356 L 998.61352,140.00457 L 942.26166,125.11183 L 880.73122,111.50964 L 769.96987,89.448091 L 734.65659,81.62429 L 725.06128,78.653162 L 722,76.36218 L 724.14618,72.516477 L 728.43506,69.034055 L 742.91797,63.11218 L 764.40283,58.502805 L 791.84375,55.11218 L 860.41016,51.612181 L 940.25,51.862182 L 1022.9961,55.112182 L 1100.2812,60.612183 L 1163.7383,67.612183 L 1205,75.362183 L 1232.748,80.789917 L 1260.4844,82.034058 L 1287.0723,80.161011 L 1311.375,76.237183 L 1348.5781,66.502808 L 1363,61.362183 L 1372.2656,58.237183 L 1382.0371,51.869995 L 1393.625,40.112183 L 1405.8223,21.32312 L 1417.4219,-6.137817 L 1427.2168,-43.911255 L 1434,-93.637817 L 1440.7344,-192.12219 L 1443.7207,-230.9054 L 1448.125,-262.76282 L 1455.2012,-287.72962 L 1460.1331,-297.64002 L 1466.2031,-305.84094 L 1473.5681,-312.33679 L 1482.3848,-317.13196 L 1492.8098,-320.23084 L 1505,-321.63782 L 1528.3359,-323.9718 L 1546.5625,-327.93469 L 1572,-336.01282 L 1581.3672,-337.76087 L 1589.9375,-336.40344 L 1598.7891,-330.75696 L 1609,-319.63782 L 1633.1719,-287.32532 L 1646.4941,-271.61438 L 1660.625,-259.13782 L 1667.99,-254.80091 L 1675.5527,-252.09876 L 1683.3118,-251.30677 L 1691.2656,-252.70032 L 1699.4128,-256.55481 L 1707.752,-263.14563 L 1716.2815,-272.74817 L 1725,-285.63782 L 1736.5286,-301.89783 L 1753.0566,-321.0304 L 1798.5156,-365.52844 L 1856.1855,-414.36243 L 1920.875,-462.76282 L 1954.2297,-485.30994 L 1987.3926,-505.96009 L 2019.7146,-524.11707 L 2050.5469,-539.18469 L 2079.2405,-550.56678 L 2105.1465,-557.66712 L 2127.616,-559.88953 L 2137.3592,-558.9852 L 2146,-556.63782 L 2186.125,-537.38782 L 2234.1719,-516.98157 L 2299,-492.63782 L 2302.8299,-490.54405 L 2305.2554,-487.47165 L 2306.0708,-478.51941 L 2301.801,-466.038 L 2292.8008,-450.2843 L 2279.4251,-431.51523 L 2262.0288,-409.98767 L 2216.5938,-359.68469 L 2159.3345,-301.43054 L 2093.0898,-237.2804 L 1945,-99.51282 L 1795.0352,37.176633 L 1665.9062,156.34655 L 1616.2524,204.22375 L 1580.3242,241.55554 L 1560.9604,266.28674 L 1558.3774,273.28488 L 1559.0158,275.32969 L 1561,276.36218 L 1599.2871,288.09656 L 1665.3594,311.73718 L 1750.1582,342.31531 L 1844.625,374.86218 L 1939.7012,404.40906 L 1984.637,416.50476 L 2026.3281,425.98718 L 2063.6423,432.23523 L 2095.4473,434.62781 L 2120.6106,432.54382 L 2130.3478,429.62903 L 2138,425.36218 L 2152.8154,412.06433 L 2170.7891,392.71374 L 2214.875,339.86218 L 2267.5859,274.82312 L 2326.25,205.61218 L 2356.9795,171.94714 L 2388.1953,140.24499 L 2419.5635,111.50769 L 2450.75,86.737183 L 2481.4209,66.935425 L 2511.2422,53.10437 L 2525.7299,48.740967 L 2539.8799,46.245972 L 2553.6505,45.744629 L 2567,47.362183 L 2579.1902,48.827332 L 2589.5801,47.880249 L 2598.2737,44.663391 L 2605.375,39.319214 L 2610.988,31.990174 L 2615.2168,22.818726 L 2618.1653,11.947327 L 2619.9375,-0.48156747 L 2620.3691,-29.442017 L 2617.3438,-62.922974 L 2611.6934,-99.784791 L 2604.25,-138.88782 L 2587.3125,-219.25891 L 2573.1875,-294.91907 L 2569.2598,-328.13343 L 2568.5312,-356.7511 L 2571.834,-379.63245 L 2575.2571,-388.56586 L 2580,-395.63782 L 2600.3516,-415.50696 L 2619.0625,-427.65344 L 2637.8672,-434.01087 L 2658.5,-436.51282 L 2712.1875,-437.68469 L 2748.7109,-440.2218 L 2794,-446.63782 L 2806.2406,-444.60004 L 2827.89,-437.1045 L 2855.3397,-425.48083 L 2884.9811,-411.05868 L 2913.2054,-395.16767 L 2936.4041,-379.13744 L 2944.9911,-371.48563 L 2950.9685,-364.29763 L 2953.8852,-357.73965 L 2953.2901,-351.97788 L 2947.9139,-344.99853 L 2939.0568,-338.6036 L 2913.1715,-327.06023 L 2844.6192,-305.41239 L 2811.0391,-293.28102 L 2796.4108,-286.44508 L 2783.9809,-278.92673 L 2774.3175,-270.59928 L 2767.9883,-261.33606 L 2765.5613,-251.01039 L 2767.6045,-239.49557 L 2803.5518,-134.25041 L 2839.1889,-19.75294 L 2874.3104,96.172405 L 2908.711,205.7012 L 2942.1856,301.009 L 2958.5115,340.8849 L 2974.5288,374.27139 L 2990.212,400.19041 L 3005.5354,417.66392 L 3013.0541,422.92797 L 3020.4733,425.71386 L 3027.7896,425.89935 L 3035,423.36218 L 3050.1692,416.88763 L 3070.7788,410.9472 L 3125.2133,401.04565 L 3192.0924,394.41137 L 3265.2045,391.79823 L 3338.3382,393.96006 L 3372.9722,397.06718 L 3405.2823,401.65074 L 3434.4922,407.80496 L 3459.8254,415.62409 L 3480.5055,425.20236 L 3495.756,436.63399 L 3506.0685,444.6342 L 3520.0166,451.85717 L 3537.0342,458.28325 L 3556.5551,463.89277 L 3600.8426,472.58356 L 3648.3501,477.77229 L 3694.5485,479.30176 L 3734.909,477.01471 L 3751.4846,474.39086 L 3764.9025,470.75393 L 3774.5963,466.08425 L 3780,460.36218 L 3780.902,453.8435 L 3778.6717,444.68702 L 3765.5447,419.02416 L 3742.0805,384.50069 L 3709.7406,342.24373 L 3624.2796,239.03766 L 3520.8535,118.42274 L 3411.1539,-10.584263 L 3357.6053,-75.417056 L 3306.8728,-138.96658 L 3260.4178,-200.10574 L 3219.7018,-257.70743 L 3186.1863,-310.64457 L 3161.3327,-357.79005 L 3158.2329,-369.25189 L 3159.303,-380.16124 L 3164.0391,-390.46768 L 3171.9375,-400.12076 L 3182.4944,-409.07004 L 3195.206,-417.26511 L 3225.0783,-431.19083 L 3257.5241,-441.49443 L 3288.5132,-447.77245 L 3314.0152,-449.62141 L 3323.4492,-448.7589 L 3330,-446.63782 L 3354.1377,-430.21521 L 3379.5703,-407.92884 L 3406.1396,-380.87586 L 3433.6875,-350.15344 L 3491.0859,-282.08899 L 3550.5,-212.51282 L 3580.5674,-179.90076 L 3610.6641,-150.20227 L 3640.6318,-124.51453 L 3670.3125,-103.93469 L 3699.5479,-89.559937 L 3713.9491,-85.042328 L 3728.1797,-82.487427 L 3742.2198,-82.032379 L 3756.0498,-83.814331 L 3769.6498,-87.970428 L 3783,-94.637817 L 3807.9863,-108.76331 L 3830.2188,-119.51672 L 3849.9199,-127.276 L 3867.3125,-132.41907 L 3882.6191,-135.32385 L 3896.0625,-136.36829 L 3918.25,-134.38782 L 3935.6562,-129.5011 L 3950.0625,-124.73157 L 3963.25,-123.10266 L 3969.9434,-124.41077 L 3977,-127.63782 L 3992.0215,-135.01477 L 4007.3594,-140.15344 L 4036.125,-145.26282 L 4057.5781,-146.05969 L 4066,-145.63782 L 4077,-757.63782 L -121.9951,-753.96769 L -121.01543,286.93118 L -121.01543,286.93118" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="378.36218" x="2082" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="336.36218" x="2101" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="267" x="3322" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="267" x="3277" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="267" x="3232" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="329" x="3226" height="8" width="141" id="Medium Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="317" x="3221" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="316" x="3369" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="247" x="3294" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve10Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs id="defs4">
<inkscape:perspective sodipodi:type="inkscape:persp3d" inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="744.09448 : 526.18109 : 1" inkscape:persp3d-origin="372.04724 : 350.78739 : 1" id="perspective10"/>
</defs>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1" inkscape:cx="4106.3956" inkscape:cy="765.8733" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1440" inkscape:window-height="853" inkscape:window-x="0" inkscape:window-y="20" showguides="true" inkscape:guide-bbox="true"/>
<metadata id="metadata7">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -594,281.36218 L 581,286.36218 L 594,321.36218 L 611,367.36218 L 641,423.36218 L 660,456.36218 L 693,505.36218 L 731,545.36218 L 777,580.36218 L 828,602.36218 L 883,611.36218 L 1010,629.36218 L 1106,636.36218 L 1158,633.36218 L 1204,617.36218 L 1230,603.36218 L 1236,591.36218 L 1233,572.36218 L 1214,539.36218 L 1116,429.36218 L 1026,335.36218 L 988,286.36218 L 983,269.36218 L 997,254.36218 L 1038,212.36218 L 1069,184.36218 L 1074,172.36218 L 1062,160.36218 L 1014,143.36218 L 802,96.362183 L 731,81.362183 L 720,76.362183 L 726,69.362183 L 755,59.362183 L 831,51.362183 L 948,51.362183 L 1110,61.362183 L 1188,71.362183 L 1231,80.362183 L 1267,82.362183 L 1311,76.362183 L 1371,59.362183 L 1394,43.362183 L 1411,13.362183 L 1428,-40.637817 L 1436,-123.63782 L 1445,-244.63782 L 1455,-290.63782 L 1473,-312.63782 L 1494,-322.63782 L 1529,-323.63782 L 1568,-333.63782 L 1583,-338.63782 L 1594,-335.63782 L 1615,-314.63782 L 1642,-276.63782 L 1664,-256.63782 L 1686,-250.63782 L 1700,-256.63782 L 1715,-270.63782 L 1741,-308.63782 L 1782,-349.63782 L 1868,-424.63782 L 1995,-511.63782 L 2063,-546.63782 L 2112,-558.63782 L 2136,-561.63782 L 2158,-551.63782 L 2217,-522.63782 L 2298,-490.63782 L 2303,-478.63782 L 2286,-437.63782 L 2175,-318.63782 L 2048,-194.63782 L 1623,197.36218 L 1564,260.36218 L 1556,273.36218 L 1579,281.36218 L 1863,380.36218 L 2011,422.36218 L 2084,434.36218 L 2117,432.36218 L 2140,424.36218 L 2195,365.36218 L 2329,203.36218 L 2382,143.36218 L 2464,77.362183 L 2522,48.362183 L 2544,44.362183 L 2560,45.362183 L 2583,50.362183 L 2606,42.362183 L 2617,21.362183 L 2624,-13.637817 L 2622,-65.637817 L 2583,-267.63782 L 2572,-351.63782 L 2584,-392.63782 L 2604,-418.63782 L 2632,-434.63782 L 2669,-436.63782 L 2732,-436.63782 L 2797,-447.63782 L 2809,-443.63782 L 2861,-422.63782 L 2937,-380.63782 L 2950,-362.63782 L 2942,-344.63782 L 2913,-325.63782 L 2830,-300.63782 L 2785,-280.63782 L 2765,-256.63782 L 2767,-240.63782 L 2885,131.36218 L 2958,342.36218 L 2988,397.36218 L 3010,422.36218 L 3027,426.36218 L 3046,416.36218 L 3132,400.36218 L 3243,392.36218 L 3367,395.36218 L 3441,410.36218 L 3491,429.36218 L 3503,443.36218 L 3534,457.36218 L 3583,468.36218 L 3659,479.36218 L 3733,476.36218 L 3767,468.36218 L 3778,456.36218 L 3776,441.36218 L 3767,423.36218 L 3696,325.36218 L 3439,23.362183 L 3235,-232.63782 L 3163,-363.63782 L 3162,-391.63782 L 3184,-410.63782 L 3234,-434.63782 L 3292,-449.63782 L 3330,-446.63782 L 3382,-404.63782 L 3470,-309.63782 L 3592,-165.63782 L 3663,-108.63782 L 3704,-84.637817 L 3757,-80.637817 L 3788,-96.637817 L 3841,-124.63782 L 3887,-137.63782 L 3916,-135.63782 L 3960,-122.63782 L 3985,-129.63782 L 4013,-136.63782 L 4428,-145.63782 L 4437,990.36218 L -595,995.36218 L -594,281.36218 z" id="path2381" sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve10Limits.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 4066,-145.63782 L 4077,-757.63782 L -121.9951,-753.96769 L -122,631.36218 L 794,808.36218 L 4086,807.36218 L 4066,-145.63782 z" id="path2380" sodipodi:nodetypes="ccccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel10TerrainBitmap();
addChild(surface);
surface.y = -565;
surface.x = -655;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4286611584, 4293848814);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [6, 9.6];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [6, 9.3];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [6, 9.3];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [6, 8.75];
};
var Helipad_position:Array = [6, 10.35];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 175
//Level2 (Clases.Game.Levels.Level2)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level2 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level2(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="3500.0901" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level2.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 8,416.36218 L 672,416.36218 L 687.15132,437.60028 L 705.33089,460.3031 L 729.90457,487.64415 L 761.59866,518.15439 L 799.0593,548.03776 L 837.52599,572.1916 L 858.23075,582.52941 L 879.84636,591.353 L 901.32223,598.12967 L 923.53712,603.04526 L 946.44503,605.86702 L 970,606.36218 L 1060.2523,605.49761 L 1150.507,606.4631 L 1240.7487,608.25981 L 1330.9783,610.56811 L 1421.1989,613.23829 L 1511.4115,616.18789 L 1601.6162,619.36876 L 1691.8121,622.75612 L 1782,626.36218 L 1804.6969,625.58446 L 1863.5447,622.18187 L 1944.8375,614.53162 L 2025.6195,602.68156 L 2066.5141,594.35317 L 2105.1409,584.29746 L 2146.3485,569.81048 L 2164.2658,561.47352 L 2180,552.36218 L 2216.8753,524.94389 L 2255.7281,490.71287 L 2290.4511,457.01869 L 2324.8916,421.63484 L 2391.6328,350.19779 L 2429.6186,309.91286 L 2460,280.36218 L 2471.8907,271.92 L 2488.8564,262.94133 L 2510.2973,253.78338 L 2535.6133,244.80334 L 2574.1525,233.77597 L 2617.0556,224.52436 L 2658.0635,218.42612 L 2700.4433,215.02415 L 2742.6513,214.89709 L 2784.2435,218.5621 L 2825.9827,227.06683 L 2845.8573,233.31338 L 2864.8843,240.99919 L 2883.6605,250.62849 L 2901.2095,262.00331 L 2917.3748,275.2168 L 2932,290.36218 L 2960.2563,321.89028 L 2990.5564,352.94194 L 3053.6579,410.9495 L 3120.3638,464.77731 L 3190.4194,514.16128 L 3228.5053,537.82612 L 3264.2678,557.63349 L 3307.9834,577.61803 L 3327.0754,584.21886 L 3344,588.36218 L 3368.4662,591.9031 L 3393.5499,593.97878 L 3443.021,594.69558 L 3481.5053,592.86671 L 3512.9717,590.06063 L 3542,586.36218 L 3544,-345.63782 L 6,-343.63782 L 8,416.36218 L 8,416.36218" id="path2380" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2402">
<rect y="560.36218" x="1347" height="45" width="44" id="Cube With Hook" density="0.001"/>
<rect y="518" x="1366" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2512" transform="translate(1354,-394.5)">
<rect y="165.56218" x="2701" height="45" width="44" id="Cube With Hook" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="122.86218" x="2720" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="3500.0901" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level2Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -610,417.36218 L 673,408.36218 L 698,446.36218 L 740,492.36218 L 799,547.36218 L 879,591.36218 L 931,605.36218 L 989,607.36218 L 1162,606.36218 L 1417,614.36218 L 1712,624.36218 L 1789,627.36218 L 1887,620.36218 L 2010,606.36218 L 2076,592.36218 L 2123,579.36218 L 2163,561.36218 L 2184,549.36218 L 2202,537.36218 L 2278,470.36218 L 2432,309.36218 L 2461,278.36218 L 2487,263.36218 L 2540,242.36218 L 2605,226.36218 L 2668,217.36218 L 2719,214.36218 L 2772,217.36218 L 2816,224.36218 L 2850,234.36218 L 2883,250.36218 L 2906,266.36218 L 2930,288.36218 L 2969,331.36218 L 3031,391.36218 L 3103,451.36218 L 3187,512.36218 L 3276,564.36218 L 3321,582.36218 L 3345,589.36218 L 3405,595.36218 L 3475,594.36218 L 3538,594.36218 L 4067,585.36218 L 4067,1129.3622 L -608,1128.3622 L -610,417.36218 z" id="path2400" sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="3500.0901" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level2Limits.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 3540,642.36218 L 3544,-345.63782 L 6,-343.63782 L 8,416.36218 L 672,416.36218 L 804,638.36218 L 3540,642.36218 z" id="path2380" sodipodi:nodetypes="ccccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel2TerrainBitmap();
addChild(surface);
surface.y = 208;
surface.x = -540;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4294967040, 4294934592);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [10, 13.6];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [10, 13.2];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [10, 13.3];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [10, 12.8];
};
var Helipad_position:Array = [10, 14.35];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 176
//Level3 (Clases.Game.Levels.Level3)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level3 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level3(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="3500" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level3.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs id="defs4">
<inkscape:perspective sodipodi:type="inkscape:persp3d" inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="744.09448 : 526.18109 : 1" inkscape:persp3d-origin="372.04724 : 350.78739 : 1" id="perspective10"/>
</defs>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1" inkscape:cx="514.2685" inkscape:cy="680" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1440" inkscape:window-height="853" inkscape:window-x="-4" inkscape:window-y="-4"/>
<metadata id="metadata7">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -3,415.36218 L 602,415.36218 L 668,398.86218 L 734,382.36218 L 756.96769,377.89951 L 808.32998,370.24091 L 851.35154,367.57866 L 869.38815,368.78141 L 883,372.36218 L 901.70312,382.51843 L 915.625,390.61218 L 935.73438,396.83093 L 973,401.36218 L 982.21243,400.98952 L 991.83589,398.63067 L 1012.1139,388.68185 L 1033.4298,372.97071 L 1055.3796,352.9522 L 1088.9785,317.62243 L 1121.6959,280.8076 L 1160.9094,238.76864 L 1178.0439,223.64549 L 1193,214.36218 L 1209.9511,209.15287 L 1230.3571,205.52265 L 1277.9007,198.2491 L 1298.2381,193.62452 L 1318.5758,187.10184 L 1338.4421,178.06443 L 1357.3657,165.89566 L 1371.8519,153.14484 L 1385.1265,137.53247 L 1396.9293,118.71833 L 1407,96.36218 L 1415.554,75.864358 L 1425.0135,57.281669 L 1435.2537,40.700202 L 1446.1495,26.206044 L 1462.4163,9.455207 L 1479.3902,-2.7160365 L 1496.719,-10.065021 L 1514.0508,-12.349081 L 1530.9165,-9.3656914 L 1547.0932,-0.91109066 L 1562.2359,13.25233 L 1576,33.36218 L 1585.6253,52.906943 L 1594.3225,74.66271 L 1609.9699,121.7761 L 1625.3758,169.67645 L 1633.5376,191.49919 L 1642.376,210.82125 L 1649.1549,222.48648 L 1656.5039,232.22624 L 1664.52,239.75717 L 1673.3001,244.79593 L 1682.9411,247.05916 L 1693.5401,246.26352 L 1705.1941,242.12564 L 1718,234.36218 L 1759.5336,206.79668 L 1776.3528,197.85054 L 1790.9954,191.98546 L 1802.0887,189.32655 L 1812.0452,188.7911 L 1821.0807,190.31111 L 1829.4111,193.81855 L 1837.2524,199.24539 L 1844.8203,206.52363 L 1860,226.36218 L 1876.3999,256.03954 L 1893.5326,291.76524 L 1911.6458,325.21523 L 1921.865,340.29484 L 1933.0748,353.42719 L 1947.0516,365.06663 L 1962.7119,372.53858 L 1980.285,374.93858 L 1989.8604,373.95396 L 2000,371.36218 L 2016.7063,367.82509 L 2036.8681,366.73308 L 2059.8621,367.78112 L 2085.0653,370.66418 L 2126.3137,377.89762 L 2169.04,387.60466 L 2251.5969,410.57583 L 2309.9998,429.36869 L 2333,437.36218 L 2358.9347,445.36983 L 2388.4702,452.82917 L 2426.4886,460.32533 L 2472.0432,466.24892 L 2522.3889,468.63228 L 2569.8263,466.28536 L 2593.9126,463.10173 L 2618,458.36218 L 2641.4394,452.00347 L 2662.1545,444.60872 L 2680.4376,436.37893 L 2696.5813,427.51511 L 2716.5911,414.09224 L 2733.662,400.37166 L 2762.4412,374.41214 L 2778.601,361.37826 L 2795.752,351.50767 L 2815.3873,345.82682 L 2839,345.36218 L 2860.0844,349.01317 L 2883.2159,355.73657 L 2933.4975,375.74774 L 3023.6673,418.15852 L 3053.613,431.38087 L 3080.0759,441.10425 L 3101.9177,445.90568 L 3110.7499,446.01598 L 3118,444.36218 L 3146.9688,429.69031 L 3169.75,413.98718 L 3190,396.36218 L 3193.8736,391.31163 L 3205.3277,379.06077 L 3224.1119,363.9608 L 3236.1748,356.70215 L 3249.9763,350.36292 L 3266.1116,345.337 L 3284.0524,342.49709 L 3303.7637,342.45186 L 3325.2105,345.81 L 3341.1943,350.49667 L 3357.995,357.34615 L 3375.6009,366.56561 L 3394,378.36218 L 3431.2676,403.18898 L 3462.0034,421.37411 L 3497.4598,438.65255 L 3520.6023,446.47842 L 3533.1945,448.49915 L 3537,448.36218 L 3540,-758.63782 L -1,-760.63782 L -3,415.36218 L -3,415.36218" id="path2383" sodipodi:nodetypes="ccssscssscscccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g3275">
<rect y="421.61218" x="2500.7063" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect transform="translate(-1317.2939,-385.18006)" y="378.65594" x="2519.7375" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g3275">
<rect y="421.61218" x="2560.7063" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect transform="translate(-1317.2939,-385.18006)" y="378.65594" x="2579.7375" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g3275">
<rect y="421.61218" x="2440.7063" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect transform="translate(-1317.2939,-385.18006)" y="378.65594" x="2459.7375" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="3500" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level3Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 601,415.36218 L 662,400.36218 L 731,384.36218 L 767,375.36218 L 824,368.36218 L 869,368.36218 L 886,373.36218 L 906,385.36218 L 923,394.36218 L 947,398.36218 L 972,400.36218 L 987,401.36218 L 1005,392.36218 L 1028,376.36218 L 1068,341.36218 L 1140,260.36218 L 1174,227.36218 L 1191,216.36218 L 1206,210.36218 L 1232,204.36218 L 1276,198.36218 L 1312,189.36218 L 1334,180.36218 L 1354,168.36218 L 1372,152.36218 L 1389,133.36218 L 1399,116.36218 L 1418,69.362183 L 1435,40.362183 L 1458,12.362183 L 1483,-3.6378174 L 1500,-12.637817 L 1521,-14.637817 L 1540,-7.6378174 L 1560,8.3621826 L 1581,40.362183 L 1597,83.362183 L 1623,163.36218 L 1634,196.36218 L 1646,219.36218 L 1663,238.36218 L 1680,247.36218 L 1690,245.36218 L 1704,242.36218 L 1720,234.36218 L 1747,213.36218 L 1774,200.36218 L 1799,189.36218 L 1816,189.36218 L 1826,191.36218 L 1834,197.36218 L 1847,208.36218 L 1858,223.36218 L 1866,237.36218 L 1878,259.36218 L 1908,319.36218 L 1922,339.36218 L 1935,357.36218 L 1951,367.36218 L 1965,373.36218 L 1985,374.36218 L 2007,370.36218 L 2022,366.36218 L 2039,366.36218 L 2080,369.36218 L 2166,386.36218 L 2227,403.36218 L 2268,416.36218 L 2331,436.36218 L 2396,454.36218 L 2452,463.36218 L 2501,467.36218 L 2534,467.36218 L 2564,469.36218 L 2585,464.36218 L 2624,456.36218 L 2664,444.36218 L 2695,430.36218 L 2743,392.36218 L 2776,364.36218 L 2794,352.36218 L 2818,344.36218 L 2840,344.36218 L 2874,352.36218 L 2927,372.36218 L 3004,409.36218 L 3065,434.36218 L 3093,444.36218 L 3115,446.36218 L 3143,432.36218 L 3173,412.36218 L 3192,395.36218 L 3206,377.36218 L 3232,358.36218 L 3254,348.36218 L 3284,342.36218 L 3315,344.36218 L 3353,353.36218 L 3375,368.36218 L 3408,386.36218 L 3449,413.36218 L 3480,431.36218 L 3508,442.36218 L 3522,446.36218 L 3538,447.36218 L 3891,440.36218 L 3889,826.36218 L -432,825.36218 L -432,415.36218 L 601,415.36218 z" id="path2380" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="3500" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level3Limites.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 3540,-758.63782 L -1,-760.63782 L -3,435.36218 L 2061,430.36218 L 2286,518.36218 L 3539,516.36218 L 3540,-758.63782 z" id="path2383" sodipodi:nodetypes="ccccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel3TerrainBitmap();
addChild(surface);
surface.y = -20;
surface.x = -495;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4294934783, 4289271414);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [10, 13.8];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [10, 13.4];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [10, 13.5];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [10, 13];
};
var Helipad_position:Array = [10, 14.56];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 177
//Level4 (Clases.Game.Levels.Level4)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level4 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level4(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level4.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:nodetypes="ccsscscscsssssssssssssssscccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" id="path2383" d="M -64.571429,438.36218 L 588.57143,438.36218 L 603.26339,437.00281 L 638.28571,431.98718 L 659.1769,427.66882 L 680.05804,421.90906 L 699.23158,414.5321 L 715,405.36218 L 731.90039,392.8739 L 754.57812,377.83093 L 781.49805,363.49109 L 796.06909,357.6029 L 811.125,353.11218 L 826.47388,350.42614 L 841.92383,349.95202 L 857.28296,352.09704 L 872.35938,357.26843 L 886.96118,365.87341 L 900.89648,378.31921 L 913.97339,395.01306 L 926,416.36218 L 937.42261,437.3136 L 948.75586,452.91101 L 959.9104,463.70666 L 970.79688,470.25281 L 981.32593,473.10168 L 991.4082,472.80554 L 1000.9543,469.91662 L 1009.875,464.98718 L 1025.4824,451.2157 L 1037.5156,435.90906 L 1048,418.36218 L 1059.7445,392.16108 L 1089.4019,333.65926 L 1108.3342,301.71813 L 1128.6084,273.00889 L 1138.9219,261.04405 L 1149.1788,251.30057 L 1159.2484,244.24957 L 1169,240.36218 L 1172.8033,240.60592 L 1176.7036,242.93322 L 1184.7383,253.28991 L 1192.9897,270.33508 L 1201.3438,292.97156 L 1217.9023,350.62976 L 1233.5,417.48718 L 1258.1562,543.6903 L 1268,601.36218 L 1270.3421,613.96992 L 1277.7457,645.98282 L 1290.7764,688.6854 L 1299.5787,711.32173 L 1310,733.36218 L 1315.1697,738.34123 L 1324.5767,742.52826 L 1353.5795,748.78606 L 1391.9631,752.65528 L 1434.6818,754.65562 L 1512.9432,755.12847 L 1548,754.36218 L 1601.625,753.23718 L 1658.9531,749.72155 L 1728,742.36218 L 1742.1646,737.97979 L 1755.031,729.26716 L 1766.7172,716.90418 L 1777.3414,701.57077 L 1787.0218,683.94683 L 1795.8765,664.71228 L 1811.5813,624.13093 L 1825.4009,585.26599 L 1838.2805,553.55671 L 1844.6631,542.08521 L 1851.1651,534.44236 L 1857.9047,531.30804 L 1865,533.36218 L 1880.8251,545.90767 L 1898.3916,562.90208 L 1934.7942,603.38525 L 1966.2997,641.10689 L 1985,662.36218 L 2022.125,697.64343 L 2054.4688,727.15515 L 2091.5,758.61218 L 2129.8438,787.53796 L 2148.4531,799.65271 L 2166.125,809.45593 L 2182.4375,816.38806 L 2196.9688,819.88952 L 2209.2969,819.40075 L 2219,814.36218 L 2227.4121,803.33264 L 2236.1406,785.93835 L 2254.5,736.22155 L 2294.5,606.23718 L 2315.9531,542.63366 L 2327.002,514.82434 L 2338.25,491.06531 L 2349.6855,472.39807 L 2361.2969,459.86413 L 2367.1648,456.22262 L 2373.0723,454.505 L 2379.0178,454.84146 L 2385,457.36218 L 2396.6101,462.72937 L 2407.4746,464.48718 L 2417.6448,463.05749 L 2427.1719,458.86218 L 2436.1072,452.32312 L 2444.502,443.86218 L 2459.875,422.86218 L 2486.3906,376.36218 L 2498.3535,357.61218 L 2504.1907,350.83874 L 2510,346.36218 L 2516.0886,344.56823 L 2522.6621,345.36999 L 2529.6194,348.48034 L 2536.8594,353.61218 L 2551.7832,368.79187 L 2566.625,388.61218 L 2580.5762,410.77624 L 2592.8281,432.98718 L 2609,468.36218 L 2618.4219,489.92468 L 2623.7129,497.89343 L 2629.625,503.61218 L 2636.334,506.79968 L 2644.0156,507.17468 L 2652.8457,504.45593 L 2663,498.36218 L 2674.5901,487.5096 L 2687.3981,472.01941 L 2715.3948,435.03147 L 2729.9471,417.48635 L 2744.4442,403.20888 L 2758.5679,394.17539 L 2765.3903,392.24273 L 2772,392.36218 L 2778.745,394.56018 L 2785.128,398.36804 L 2796.9479,409.84656 L 2807.7383,424.86413 L 2817.7778,441.48718 L 2836.7188,471.81531 L 2846.1776,481.6532 L 2851.0259,484.39465 L 2856,485.36218 L 2940.0743,488.66507 L 2988.2711,488.51543 L 3007.4866,486.74252 L 3021,483.36218 L 3038.7007,472.55828 L 3059.4512,455.38808 L 3105.9586,412.06933 L 3129.6442,390.98105 L 3152.2368,373.64701 L 3172.7006,362.59734 L 3181.8106,360.21981 L 3190,360.36218 L 3199.0453,360.02586 L 3207.8297,355.73359 L 3216.3719,347.96413 L 3224.691,337.1962 L 3240.7354,308.57991 L 3256.1142,273.71464 L 3285.4803,200.55685 L 3299.7703,169.92417 L 3306.8832,157.76997 L 3314,148.36218 L 3336.4886,123.49731 L 3357.0174,104.77499 L 3367.7034,98.311366 L 3379.2875,94.096269 L 3392.2321,92.367332 L 3407,93.362183 L 3415.2859,95.706516 L 3425.3391,100.2279 L 3449.6715,114.23214 L 3507.7073,151.09875 L 3537.1062,167.68238 L 3563.8895,178.84707 L 3575.6277,181.41626 L 3585.9048,181.45346 L 3594.4519,178.56624 L 3601,172.36218 L 3613.1173,157.29132 L 3628.0628,143.62814 L 3645.227,132.5718 L 3664.0007,125.32141 L 3683.7742,123.07613 L 3693.8455,124.20512 L 3703.9383,127.03507 L 3713.9763,131.71586 L 3723.8833,138.39738 L 3733.5833,147.22952 L 3743,158.36218 L 3752.2007,166.31726 L 3765.8398,172.3153 L 3783.2231,176.55554 L 3803.6562,179.23718 L 3850.8945,180.72155 L 3902,178.36218 L 3951.418,173.7528 L 3993.5938,168.48718 L 4034,162.36218 L 4033,-565.63782 L -64,-565.63782 L -64.571429,438.36218 L -64.571429,438.36218" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="644.36218" x="1347" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="602.36218" x="1366" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="644.36218" x="1647" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="602.36218" x="1666" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="405" x="2880" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="405" x="2940" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="467.36218" x="2859" height="8" width="141" id="Small Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="455.36218" x="2854" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="454.36218" x="3002" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="385.36218" x="2926" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level4Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -405,438.36218 L 593,438.36218 L 641,431.36218 L 676,423.36218 L 704,413.36218 L 728,397.36218 L 751,380.36218 L 779,364.36218 L 812,352.36218 L 833,348.36218 L 858,351.36218 L 873,356.36218 L 892,368.36218 L 914,392.36218 L 925,413.36218 L 934,434.36218 L 950,454.36218 L 971,470.36218 L 983,473.36218 L 996,471.36218 L 1011,465.36218 L 1026,449.36218 L 1045,425.36218 L 1065,381.36218 L 1111,297.36218 L 1131,271.36218 L 1149,251.36218 L 1166,240.36218 L 1176,240.36218 L 1183,247.36218 L 1196,277.36218 L 1210,326.36218 L 1222,366.36218 L 1235,427.36218 L 1249,499.36218 L 1266,590.36218 L 1271,626.36218 L 1285,674.36218 L 1306,727.36218 L 1315,740.36218 L 1335,745.36218 L 1389,752.36218 L 1439,755.36218 L 1561,754.36218 L 1668,749.36218 L 1729,742.36218 L 1742,738.36218 L 1756,728.36218 L 1770,713.36218 L 1785,688.36218 L 1800,654.36218 L 1832,566.36218 L 1842,545.36218 L 1853,532.36218 L 1861,531.36218 L 1870,537.36218 L 1910,575.36218 L 1944,613.36218 L 1971,646.36218 L 1983,661.36218 L 2047,720.36218 L 2090,757.36218 L 2139,794.36218 L 2182,818.36218 L 2207,820.36218 L 2222,813.36218 L 2238,782.36218 L 2255,731.36218 L 2313,551.36218 L 2339,487.36218 L 2356,462.36218 L 2369,455.36218 L 2382,453.36218 L 2390,459.36218 L 2403,463.36218 L 2415,463.36218 L 2427,460.36218 L 2441,448.36218 L 2460,425.36218 L 2487,374.36218 L 2504,351.36218 L 2514,344.36218 L 2525,344.36218 L 2541,357.36218 L 2572,397.36218 L 2594,436.36218 L 2604,458.36218 L 2616,485.36218 L 2625,501.36218 L 2638,508.36218 L 2650,505.36218 L 2667,497.36218 L 2681,479.36218 L 2716,433.36218 L 2748,398.36218 L 2763,392.36218 L 2772,392.36218 L 2784,396.36218 L 2797,410.36218 L 2813,433.36218 L 2833,466.36218 L 2847,482.36218 L 2855,484.36218 L 2885,486.36218 L 2983,489.36218 L 3012,485.36218 L 3032,478.36218 L 3068,448.36218 L 3128,392.36218 L 3161,367.36218 L 3177,360.36218 L 3196,360.36218 L 3210,355.36218 L 3222,340.36218 L 3238,316.36218 L 3284,205.36218 L 3300,170.36218 L 3310,152.36218 L 3344,115.36218 L 3368,97.362183 L 3390,91.362183 L 3408,92.362183 L 3427,101.36218 L 3537,169.36218 L 3566,179.36218 L 3581,181.36218 L 3596,178.36218 L 3603,168.36218 L 3621,148.36218 L 3645,132.36218 L 3670,122.36218 L 3696,123.36218 L 3716,133.36218 L 3729,141.36218 L 3745,158.36218 L 3752,167.36218 L 3765,171.36218 L 3801,179.36218 L 3858,181.36218 L 3946,175.36218 L 4037,161.36218 L 4576,102.36218 L 4618,1136.3622 L 2911,1134.3622 L 2022,1274.3622 L 1042,1135.3622 L -406,1133.3622 L -405,438.36218 z" id="path2380" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Level4Limit.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 4033,-565.63782 L -64,-565.63782 L -64.571429,478.36218 L 584.57143,479.36218 L 1156,803.36218 L 1959,873.36218 L 4032,873.36218 L 4033,-565.63782 z" id="path2383" sodipodi:nodetypes="cccccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel4TerrainBitmap();
addChild(surface);
surface.y = 85;
surface.x = -578;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4294929516, 4290838528);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [7.8, 14.5];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [7.8, 14.15];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [7.8, 14.25];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [7.8, 13.7];
};
var Helipad_position:Array = [7.8, 15.32];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 178
//Level5 (Clases.Game.Levels.Level5)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level5 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level5(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve5.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:nodetypes="ccccssscsssscsssssssscccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" id="path2380" d="M -78,421.36218 L 644,421.36218 L 659.85275,413.24145 L 675.71524,402.50437 L 707.49935,375.1732 L 771.51346,311.02771 L 803.86309,282.18182 L 820.14971,270.30868 L 836.52084,260.79945 L 852.98396,254.15216 L 869.54654,250.86483 L 886.21606,251.4355 L 903,256.36218 L 913.03687,261.99768 L 923.20117,271.39929 L 933.38599,283.99719 L 943.48438,299.22156 L 962.99414,335.27038 L 980.875,374.98718 L 1008.3281,447.19031 L 1019,479.36218 L 1076,616.36218 L 1086.124,635.94782 L 1101.5591,661.60224 L 1121.2749,690.92168 L 1144.2409,721.50235 L 1169.4269,750.94051 L 1195.8023,776.83237 L 1222.3368,796.77419 L 1235.3417,803.76265 L 1248,808.36218 L 1263.2756,810.04952 L 1284.5735,809.04908 L 1342.0645,800.86012 L 1494.4221,772.8567 L 1576.6001,760.54325 L 1616.4133,756.44945 L 1654.3186,754.35601 L 1689.523,754.73175 L 1721.2333,758.04548 L 1748.6567,764.76602 L 1760.5129,769.55035 L 1771,775.36218 L 1791.7244,786.56408 L 1816.9824,796.58679 L 1845.9641,805.49328 L 1877.8594,813.34655 L 1947.1504,826.14538 L 2018.375,835.48718 L 2085.0527,841.87585 L 2140.7031,845.8153 L 2193,848.36218 L 2306.8125,837.59655 L 2562.75,810.98718 L 2703.9375,794.4071 L 2832.5625,777.0653 L 2932.5938,760.0282 L 2966.877,751.95715 L 2988,744.36218 L 2994.5387,739.73003 L 3001.2974,732.72071 L 3015.4546,712.24745 L 3030.4306,684.29611 L 3046.1845,650.22039 L 3079.8622,569.1107 L 3116.16,479.74807 L 3154.7502,392.9622 L 3174.8027,353.91984 L 3195.3054,319.5828 L 3216.2175,291.3048 L 3226.8142,279.86098 L 3237.4979,270.43956 L 3248.2634,263.20976 L 3259.1057,258.34078 L 3270.0196,256.00185 L 3281,256.36218 L 3343.1704,265.17513 L 3399.0773,270.76709 L 3448.9866,273.33455 L 3493.1641,273.07399 L 3531.8754,270.18192 L 3565.3863,264.85483 L 3593.9627,257.2892 L 3617.8703,247.68152 L 3637.3748,236.22829 L 3652.742,223.12601 L 3664.2377,208.57115 L 3672.1277,192.76022 L 3676.6777,175.8897 L 3678.1534,158.15608 L 3676.8208,139.75587 L 3672.9454,120.88554 L 3666.7931,101.74159 L 3658.6297,82.520512 L 3637.3324,44.632939 L 3611.1797,8.7947496 L 3582.2978,-23.422124 L 3552.8127,-50.445749 L 3524.8506,-70.704194 L 3512.1051,-77.805246 L 3500.5377,-82.625528 L 3490.4141,-84.968549 L 3482,-84.637817 L 3467.5835,-84.845409 L 3446.9843,-89.954002 L 3390.4488,-111.00675 L 3318.8165,-140.06119 L 3279.3461,-155.17189 L 3238.5101,-169.38243 L 3197.1112,-181.72595 L 3155.9524,-191.23559 L 3115.8365,-196.94449 L 3077.5663,-197.8858 L 3059.3742,-196.26646 L 3041.9447,-193.09264 L 3025.378,-188.2435 L 3009.7745,-181.59817 L 2995.2347,-173.03579 L 2981.8587,-162.43551 L 2969.747,-149.67648 L 2959,-134.63782 L 2913.6699,-64.94446 L 2860.7344,11.159056 L 2748.875,163.23718 L 2657.0781,282.87781 L 2619,331.36218 L 2604.8438,343.98718 L 2588.9414,356.46374 L 2568.75,370.11218 L 2545.4648,382.72937 L 2520.2812,392.11218 L 2507.3511,394.90222 L 2494.3945,396.05749 L 2481.561,395.30261 L 2469,392.36218 L 2430.877,383.38366 L 2370.2656,372.65906 L 2207.125,344.23718 L 2117.3691,325.67273 L 2030.6719,303.62781 L 1990.4661,291.16467 L 1953.4199,277.66882 L 1920.3318,263.08606 L 1892,247.36218 L 1838.7956,211.55983 L 1783.6117,170.72732 L 1728.9672,126.85151 L 1677.3811,81.91923 L 1631.3724,37.917317 L 1593.46,-3.167388 L 1578.3271,-21.9949 L 1566.1629,-39.348046 L 1557.2822,-54.97847 L 1552,-68.637817 L 1550.8279,-76.056366 L 1551.3772,-82.95105 L 1553.5587,-89.342926 L 1557.2832,-95.253052 L 1569.0046,-105.71228 L 1585.8281,-114.49719 L 1607.0403,-121.77625 L 1631.9277,-127.7179 L 1689.875,-136.26282 L 1753.9629,-141.47962 L 1818.4844,-144.71594 L 1877.7324,-147.31946 L 1926,-150.63782 L 1936.562,-152.65458 L 1948.741,-156.63956 L 1977.5305,-170.00066 L 2011.5297,-189.69404 L 2049.9,-214.69267 L 2136.3989,-276.49744 L 2230.3176,-347.19853 L 2324.9466,-418.57954 L 2413.5764,-482.42404 L 2453.5448,-508.95247 L 2489.4974,-530.51561 L 2520.5953,-546.08641 L 2546,-554.63782 L 2575.5336,-558.41621 L 2615.093,-559.82818 L 2663.1164,-559.17644 L 2718.042,-556.7637 L 2842.3521,-547.86604 L 2975.5286,-535.55684 L 3218.5009,-510.39047 L 3303.307,-502.3766 L 3347,-500.63782 L 3358.4458,-499.49646 L 3376.1289,-494.60071 L 3427.0312,-475.96594 L 3568.75,-420.26282 L 3646.8633,-392.87415 L 3684.9546,-381.41297 L 3721.3438,-372.24719 L 3755.2368,-365.98181 L 3785.8398,-363.2218 L 3812.3589,-364.57215 L 3823.8388,-366.97776 L 3834,-370.63782 L 3870.1401,-389.72762 L 3903.141,-411.19569 L 3961.7093,-453.45881 L 3988.2688,-470.34992 L 4013.673,-481.81144 L 4026.0969,-484.89611 L 4038.4181,-485.89139 L 4050.6984,-484.5533 L 4063,-480.63782 L 4077.2903,-475.86267 L 4096.041,-471.63977 L 4143.9531,-464.71594 L 4200.7949,-459.5968 L 4260.625,-456.01282 L 4365.4844,-452.37219 L 4411,-451.63782 L 4407,-1177.6378 L -65,-1168.6378 L -78,421.36218 L -78,421.36218" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="811" x="2165" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="769" x="2184" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="182" x="3482" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="182" x="3422" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="244" x="3401" height="8" width="141" id="Small Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="232" x="3396" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="231" x="3544" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="162" x="3468" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="-587" x="3328" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="-587" x="3268" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="-525" x="3247" height="8" width="141" id="Small Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-537" x="3242" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-538" x="3390" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-607" x="3314" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve5Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -501,422.36218 L 644,421.36218 L 667,410.36218 L 708,377.36218 L 765,318.36218 L 803,282.36218 L 848,253.36218 L 874,252.36218 L 907,256.36218 L 935,283.36218 L 968,345.36218 L 1017,469.36218 L 1045,540.36218 L 1074,611.36218 L 1104,667.36218 L 1149,729.36218 L 1195,775.36218 L 1221,799.36218 L 1251,810.36218 L 1290,809.36218 L 1389,791.36218 L 1517,768.36218 L 1639,753.36218 L 1708,756.36218 L 1741,760.36218 L 1773,776.36218 L 1807,792.36218 L 1896,818.36218 L 2041,837.36218 L 2197,848.36218 L 2711,793.36218 L 2893,767.36218 L 2988,746.36218 L 3008,722.36218 L 3029,687.36218 L 3071,593.36218 L 3150,402.36218 L 3193,321.36218 L 3223,280.36218 L 3262,256.36218 L 3279,253.36218 L 3323,258.36218 L 3426,268.36218 L 3516,268.36218 L 3603,251.36218 L 3645,231.36218 L 3666,200.36218 L 3675,173.36218 L 3671,132.36218 L 3658,83.362183 L 3614,19.362183 L 3543,-48.637817 L 3510,-69.637817 L 3474,-83.637817 L 3368,-118.63782 L 3257,-164.63782 L 3136,-195.63782 L 3075,-197.63782 L 3043,-192.63782 L 2967,-140.63782 L 2760,150.36218 L 2626,322.36218 L 2599,348.36218 L 2560,375.36218 L 2528,390.36218 L 2504,395.36218 L 2482,396.36218 L 2450,386.36218 L 2176,338.36218 L 2056,309.36218 L 1993,292.36218 L 1922,263.36218 L 1874,235.36218 L 1730,129.36218 L 1640,47.362183 L 1573,-37.637817 L 1562,-65.637817 L 1561,-83.637817 L 1567,-103.63782 L 1587,-113.63782 L 1621,-125.63782 L 1672,-133.63782 L 1738,-140.63782 L 1855,-145.63782 L 1927,-150.63782 L 1953,-157.63782 L 1994,-179.63782 L 2079,-234.63782 L 2234,-351.63782 L 2362,-446.63782 L 2470,-519.63782 L 2534,-551.63782 L 2578,-559.63782 L 2627,-559.63782 L 2723,-557.63782 L 2902,-543.63782 L 3308,-501.63782 L 3333,-499.63782 L 3357,-501.63782 L 3389,-490.63782 L 3487,-452.63782 L 3609,-404.63782 L 3703,-375.63782 L 3773,-363.63782 L 3809,-363.63782 L 3831,-370.63782 L 3861,-385.63782 L 3904,-411.63782 L 3965,-454.63782 L 3984,-468.63782 L 4014,-481.63782 L 4037,-486.63782 L 4053,-484.63782 L 4074,-475.63782 L 4094,-470.63782 L 4129,-464.63782 L 4760,-446.63782 L 4745,1181.3622 L -501,1190.3622 L -501,422.36218 z" id="path2384" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve5Limite.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 4407,-1177.6378 L -65,-1168.6378 L -79,510.36218 L 649,507.36218 L 1215,902.36218 L 4416,904.36218 L 4407,-1177.6378 z" id="path2380" sodipodi:nodetypes="ccccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel5TerrainBitmap();
addChild(surface);
surface.y = -585;
surface.x = -585;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4278222848, 68539118896);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [7.5, 13.9];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [7.5, 13.5];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [7.5, 13.5];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [7.5, 13];
};
var Helipad_position:Array = [7.5, 14.63];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 179
//Level6 (Clases.Game.Levels.Level6)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level6 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level6(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve6.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" id="path2384" d="M -47,293.86218 L 622,291.86218 L 671,328.36218 L 715.5,370.36218 L 738,399.36218 L 747.5,407.86218 L 769.5,416.36218 L 807.5,418.86218 L 863.5,415.36218 L 927,404.36218 L 1002,384.36218 L 1076,359.86218 L 1125,338.86218 L 1149.5,325.36218 L 1166,311.86218 L 1172.5,301.36218 L 1170.5,275.86218 L 1162,194.86218 L 1160.5,158.86218 L 1162.5,119.36218 L 1168,94.362183 L 1175.5,75.862183 L 1190,60.362183 L 1209,53.362183 L 1220,52.862183 L 1339.5,53.862183 L 1436.5,55.362183 L 1506,59.362183 L 1539,63.362183 L 1575.5,67.862183 L 1612.5,72.362183 L 1705,84.862183 L 1741.5,90.862183 L 1777,99.362183 L 1806,107.86218 L 1835.5,119.36218 L 1849,126.86218 L 1864,135.86218 L 1874,142.36218 L 1902,155.86218 L 1932.5,167.36218 L 1983.5,184.36218 L 2018,195.36218 L 2061,210.86218 L 2104.5,229.36218 L 2132,244.36218 L 2154.5,260.86218 L 2163,268.36218 L 2172.5,277.36218 L 2181,288.36218 L 2200,307.86218 L 2219.5,324.86218 L 2243.5,340.86218 L 2275,356.36218 L 2297,364.36218 L 2323.5,372.36218 L 2349,376.86218 L 2468.5,380.36218 L 2626.5,382.36218 L 2705,381.36218 L 2754,379.36218 L 2790.5,376.36218 L 2809.5,372.36218 L 2813,368.86218 L 2816.5,360.86218 L 2830,337.86218 L 2853,306.86218 L 2879.5,277.86218 L 2905,255.86218 L 2929.5,238.86218 L 2952,228.36218 L 2976.5,221.36218 L 2997.5,221.86218 L 3045,227.36218 L 3117.5,236.86218 L 3201.5,243.86218 L 3271.5,245.86218 L 3302.5,244.36218 L 3324,243.36218 L 3352,237.86218 L 3369.5,232.86218 L 3383.5,225.36218 L 3393,217.86218 L 3400,208.36218 L 3406,191.86218 L 3409.5,174.36218 L 3411.5,155.36218 L 3409,95.862183 L 3407,50.862183 L 3408,25.862183 L 3413.5,3.8621826 L 3421.5,-8.6378174 L 3434,-15.137817 L 3456,-15.137817 L 3498,-14.637817 L 3573.5,-11.137817 L 3615,-8.6378174 L 3676,-9.1378174 L 3716,-10.637817 L 3763.5,-15.637817 L 3801,-24.137817 L 3818.5,-29.637817 L 3841.5,-43.637817 L 3853.5,-53.137817 L 3864,-68.637817 L 3887,-148.63782 L 3901,-210.13782 L 3906,-238.13782 L 3906.5,-260.63782 L 3904,-286.13782 L 3896,-308.13782 L 3880,-326.63782 L 3865,-338.13782 L 3841,-347.63782 L 3812,-352.63782 L 3626,-360.13782 L 3390.5,-368.13782 L 3290.5,-367.63782 L 3245.5,-364.63782 L 3193.5,-359.13782 L 3159.5,-349.13782 L 3140.5,-337.63782 L 3128.5,-317.63782 L 3103,-262.13782 L 3091.5,-235.63782 L 3073,-206.63782 L 3050.5,-178.63782 L 3036.5,-166.13782 L 3018.5,-154.13782 L 2991.5,-139.63782 L 2969.5,-131.13782 L 2944,-124.13782 L 2918.5,-120.63782 L 2881,-117.63782 L 2834,-119.63782 L 2811,-121.63782 L 2770,-126.63782 L 2676.5,-141.63782 L 2579.5,-160.63782 L 2489.5,-176.63782 L 2470,-178.63782 L 2437,-176.63782 L 2400.5,-166.13782 L 2315,-130.13782 L 2246.5,-99.137817 L 2222,-90.637817 L 2205,-85.137817 L 2187,-80.637817 L 2170,-79.137817 L 2154,-78.137817 L 2134.5,-80.137817 L 2104.5,-85.637817 L 2072,-97.637817 L 2041,-112.63782 L 2006,-131.13782 L 1951.5,-163.13782 L 1882,-204.63782 L 1838,-227.13782 L 1804.5,-239.13782 L 1777,-246.13782 L 1743.5,-250.13782 L 1718,-246.63782 L 1695.5,-244.13782 L 1671,-241.13782 L 1639,-241.63782 L 1600.5,-243.13782 L 1476.5,-255.13782 L 1323,-274.63782 L 1236.5,-284.13782 L 1169.5,-288.63782 L 1129.5,-289.13782 L 1104,-285.13782 L 1092.5,-277.13782 L 1090.5,-267.63782 L 1083,-256.13782 L 1063.5,-241.13782 L 1028,-222.63782 L 1006,-212.13782 L 970,-200.63782 L 938,-192.13782 L 902.5,-184.63782 L 872,-181.63782 L 855.5,-180.63782 L 828.5,-182.63782 L 806.5,-187.13782 L 787,-197.13782 L 779.5,-207.13782 L 775,-220.63782 L 774,-235.13782 L 764,-267.13782 L 727,-352.13782 L 705.5,-407.63782 L 696.5,-444.13782 L 695.5,-470.13782 L 702.5,-492.63782 L 715.5,-506.13782 L 735,-516.63782 L 761.5,-522.13782 L 801.5,-521.63782 L 1044,-482.13782 L 1436,-429.13782 L 1600.5,-412.13782 L 1727.5,-395.63782 L 1798.5,-384.63782 L 1887,-366.13782 L 1964,-343.63782 L 2012,-321.63782 L 2022.5,-311.13782 L 2037.5,-301.63782 L 2061.5,-296.63782 L 2087,-298.13782 L 2132,-310.13782 L 2227,-342.63782 L 2299,-356.63782 L 2333,-361.13782 L 2379.5,-360.13782 L 2434,-349.63782 L 2493,-337.13782 L 2557,-331.13782 L 2629.5,-333.63782 L 2695.5,-342.63782 L 2772,-361.13782 L 2828,-380.13782 L 2875.5,-400.13782 L 2920,-425.13782 L 2961.5,-455.13782 L 2999,-472.63782 L 3043.5,-481.13782 L 3086,-484.63782 L 3196,-482.63782 L 3349,-476.13782 L 3465.5,-465.63782 L 3608.5,-463.13782 L 3686.5,-460.13782 L 3790.5,-457.63782 L 3983.7203,-453.95584 L 3982.5,-564.63782 L 3971.5,-805.13782 L -47.5,-803.13782 L -47,293.86218 L -47,293.86218" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="162" x="3282" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="162" x="3222" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="224" x="3201" height="8" width="141" id="Small Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="212" x="3196" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="211" x="3344" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="142" x="3268" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="-84" x="3687" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="-84" x="3627" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="-22" x="3606" height="8" width="141" id="Small Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-34" x="3601" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-35" x="3749" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-107" x="3674" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="-556" x="3281" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="-556" x="3221" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="-494" x="3200" height="8" width="141" id="Small Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-506" x="3195" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-507" x="3343" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="-579" x="3268" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve6Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -507,289.36218 L 624,291.36218 L 664,322.36218 L 690,346.36218 L 723,378.36218 L 735,393.36218 L 742,404.36218 L 763,414.36218 L 792,417.36218 L 834,419.36218 L 904,408.36218 L 980,389.36218 L 1045,371.36218 L 1112,345.36218 L 1148,326.36218 L 1163,314.36218 L 1173,298.36218 L 1163,200.36218 L 1161,154.36218 L 1164,108.36218 L 1174,79.362183 L 1189,60.362183 L 1212,52.362183 L 1258,53.362183 L 1395,53.362183 L 1506,57.362183 L 1548,63.362183 L 1625,74.362183 L 1715,86.362183 L 1780,100.36218 L 1821,113.36218 L 1850,128.36218 L 1883,147.36218 L 1954,174.36218 L 2071,215.36218 L 2110,232.36218 L 2153,260.36218 L 2177,283.36218 L 2206,312.36218 L 2233,333.36218 L 2270,355.36218 L 2316,370.36218 L 2347,377.36218 L 2375,376.36218 L 2543,381.36218 L 2711,381.36218 L 2798,375.36218 L 2813,370.36218 L 2823,347.36218 L 2860,298.36218 L 2899,260.36218 L 2937,234.36218 L 2977,221.36218 L 3005,221.36218 L 3120,236.36218 L 3202,243.36218 L 3288,246.36218 L 3351,239.36218 L 3385,224.36218 L 3402,206.36218 L 3411,176.36218 L 3408,74.362183 L 3409,24.362183 L 3415,-0.63781738 L 3425,-13.637817 L 3447,-15.637817 L 3490,-15.637817 L 3551,-13.637817 L 3593,-9.6378174 L 3658,-7.6378174 L 3737,-11.637817 L 3785,-19.637817 L 3826,-32.637817 L 3849,-49.637817 L 3865,-68.637817 L 3873,-107.63782 L 3901,-201.63782 L 3906,-237.63782 L 3906,-265.63782 L 3898,-305.63782 L 3886,-331.63782 L 3865,-344.63782 L 3817,-352.63782 L 3429,-367.63782 L 3305,-368.63782 L 3204,-361.63782 L 3167,-352.63782 L 3142,-338.63782 L 3121,-304.63782 L 3089,-232.63782 L 3059,-186.63782 L 3023,-155.63782 L 2981,-133.63782 L 2940,-123.63782 L 2867,-115.63782 L 2734,-132.63782 L 2536,-168.63782 L 2477,-177.63782 L 2444,-178.63782 L 2374,-158.63782 L 2290,-118.63782 L 2221,-88.637817 L 2170,-76.637817 L 2132,-80.637817 L 2097,-86.637817 L 2046,-109.63782 L 1911,-186.63782 L 1853,-221.63782 L 1797,-242.63782 L 1760,-248.63782 L 1720,-247.63782 L 1687,-240.63782 L 1623,-242.63782 L 1524,-249.63782 L 1400,-264.63782 L 1220,-284.63782 L 1144,-289.63782 L 1109,-286.63782 L 1095,-279.63782 L 1091,-264.63782 L 1076,-248.63782 L 1038,-227.63782 L 970,-200.63782 L 917,-187.63782 L 886,-181.63782 L 838,-180.63782 L 815,-184.63782 L 795,-192.63782 L 783,-203.63782 L 776,-213.63782 L 775,-234.63782 L 766,-259.63782 L 752,-299.63782 L 714,-389.63782 L 706,-410.63782 L 695,-461.63782 L 699,-493.63782 L 733,-514.63782 L 769,-523.63782 L 801,-521.63782 L 843,-516.63782 L 1085,-475.63782 L 1425,-430.63782 L 1714,-398.63782 L 1824,-378.63782 L 1891,-365.63782 L 1944,-351.63782 L 1995,-331.63782 L 2016,-316.63782 L 2035,-302.63782 L 2064,-296.63782 L 2100,-300.63782 L 2178,-325.63782 L 2247,-346.63782 L 2306,-358.63782 L 2355,-360.63782 L 2406,-356.63782 L 2453,-344.63782 L 2499,-335.63782 L 2560,-330.63782 L 2661,-336.63782 L 2739,-351.63782 L 2810,-372.63782 L 2883,-402.63782 L 2927,-429.63782 L 2960,-454.63782 L 2994,-470.63782 L 3034,-480.63782 L 3088,-485.63782 L 3262,-477.63782 L 3532,-460.63782 L 3638,-454.63782 L 3697,-453.63782 L 3755,-452.63782 L 3815,-456.63782 L 3848,-464.63782 L 4565,-431.63782 L 4568,826.36218 L -510,826.36218 L -507,289.36218 z" id="path2381" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve6Limite.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -48,-801.63782 L 3976.5,-803.13782 L 3983.5,-569.13782 L 3977.5,186.36218 L 2821,498.86218 L -47.5,498.36218 L -48,-801.63782 z" id="path2420" sodipodi:nodetypes="ccccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel6TerrainBitmap();
addChild(surface);
surface.y = -530;
surface.x = -545;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4279208944, 4280344520);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [10, 9.6];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [10, 9.2];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [10, 9.3];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [10, 8.7];
};
var Helipad_position:Array = [10, 10.38];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 180
//Level7 (Clases.Game.Levels.Level7)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level7 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level7(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve7.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:nodetypes="ccsssssssssssssssssssscccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" id="path2380" d="M -19,289.36218 L 487,289.36218 L 531.5,304.50281 L 578.33594,317.04773 L 633.75,327.23718 L 662.84277,330.11926 L 691.88281,330.81726 L 720.1377,328.79944 L 746.875,323.53406 L 771.3623,314.48938 L 792.86719,301.13366 L 802.27234,292.673 L 810.65723,282.93518 L 817.9303,271.85373 L 824,259.36218 L 834.37125,236.10035 L 843.83182,218.80134 L 852.52698,206.88239 L 860.60196,199.76073 L 868.20203,196.8536 L 875.47243,197.57822 L 882.55841,201.35183 L 889.60523,207.59166 L 904.16238,225.13891 L 920.30588,245.55784 L 939.19775,264.18631 L 950.03745,271.3722 L 962,276.36218 L 970.46391,280.27214 L 976.91839,286.19792 L 981.64506,293.87083 L 984.92554,303.0222 L 988.27445,324.68566 L 989.21811,349.03891 L 990.0095,373.93256 L 992.90162,397.21725 L 995.83951,407.58454 L 1000.1475,416.74358 L 1006.1071,424.42568 L 1014,430.36218 L 1038.1504,441.12781 L 1079.8906,456.29968 L 1133.6543,472.69031 L 1193.875,487.11218 L 1224.6672,492.58874 L 1254.9863,496.37781 L 1284.1365,498.08093 L 1311.4219,497.29968 L 1336.1467,493.63562 L 1357.6152,486.69031 L 1375.1316,476.06531 L 1382.1903,469.24841 L 1388,461.36218 L 1407.174,433.03829 L 1424.5519,414.1892 L 1441.7927,402.74877 L 1460.5551,396.65089 L 1482.4982,393.82942 L 1509.2808,392.21823 L 1542.5617,389.75119 L 1584,384.36218 L 1602.7569,379.47474 L 1618.0509,371.82513 L 1630.2916,361.80737 L 1639.8888,349.81551 L 1647.2521,336.24357 L 1652.7914,321.48561 L 1660.0367,289.98772 L 1664.9024,258.47414 L 1670.6663,230.09717 L 1674.9094,218.06999 L 1680.6062,208.00908 L 1688.1665,200.30846 L 1698,195.36218 L 1711.218,192.76667 L 1720.4886,194.09721 L 1727.4865,198.40442 L 1733.8863,204.73892 L 1741.3628,212.15132 L 1751.5908,219.69226 L 1766.245,226.41234 L 1787,231.36218 L 1812.7752,234.35907 L 1840.4971,235.78902 L 1868.8852,235.56095 L 1896.6589,233.58376 L 1922.5378,229.76637 L 1945.2412,224.0177 L 1963.4888,216.24667 L 1976,206.36218 L 1982.9959,195.06003 L 1988.4058,180.69231 L 1995.4987,147.49253 L 2002,96.362183 L 2005.4688,89.727417 L 2012.6875,82.471558 L 2023.375,75.567261 L 2037.25,69.987183 L 2054.0312,66.70398 L 2073.4375,66.690308 L 2095.1875,70.918824 L 2119,80.362183 L 2141.0608,90.213503 L 2158.405,95.37921 L 2172.025,96.401922 L 2182.9133,93.824258 L 2192.0625,88.188833 L 2200.465,80.038268 L 2219,58.362183 L 2229.4123,50.232092 L 2240.851,46.612585 L 2252.869,46.034811 L 2265.0192,47.02992 L 2276.8545,48.129063 L 2287.9279,47.863388 L 2297.7921,44.764044 L 2306,37.362183 L 2313.6711,30.577492 L 2322.908,28.100384 L 2333.2962,28.62131 L 2344.4213,30.830719 L 2367.2239,35.076786 L 2378.0725,34.494343 L 2388,30.362183 L 2416.5469,10.393433 L 2436.1113,-1.3135983 L 2457.375,-10.887817 L 2478.9668,-15.868286 L 2489.4573,-15.866821 L 2499.5156,-13.794067 L 2508.9705,-9.3424068 L 2517.6504,-2.2042233 L 2525.384,7.928101 L 2532,21.362183 L 2537.0548,37.964172 L 2540.4212,57.141901 L 2543.3013,101.70515 L 2542.1369,205.02676 L 2542.9417,257.70739 L 2544.7516,282.97316 L 2547.904,307.01608 L 2552.702,329.4563 L 2559.4486,349.91397 L 2568.4469,368.00921 L 2580,383.36218 L 2589.8129,392.29003 L 2603.1431,402.02825 L 2638.2049,422.9137 L 2680.8841,443.9744 L 2726.8796,463.16623 L 2771.8902,478.44505 L 2811.6146,487.76674 L 2828.1503,489.55486 L 2841.7516,489.08716 L 2851.8807,486.1081 L 2858,480.36218 L 2863.1262,469.03344 L 2867.4638,455.92136 L 2875.0275,425.84186 L 2883.2001,393.11315 L 2894.4901,360.72467 L 2902.0882,345.59222 L 2911.4064,331.66588 L 2922.7583,319.31932 L 2936.4576,308.92623 L 2952.8178,300.86029 L 2972.1526,295.49518 L 2994.7754,293.20458 L 3021,294.36218 L 3042.5289,299.16079 L 3058.437,307.94989 L 3069.394,320.19443 L 3076.0696,335.35933 L 3079.1335,352.90953 L 3079.2555,372.30996 L 3077.1051,393.02555 L 3073.3522,414.52124 L 3063.7174,457.71264 L 3055.7087,497.60362 L 3053.9884,514.97379 L 3054.6837,529.91365 L 3058.4644,541.88813 L 3066,550.36218 L 3092.6133,566.01648 L 3130.5938,583.90905 L 3176.7773,600.93445 L 3201.9565,608.15149 L 3228,613.98718 L 3254.5122,618.05334 L 3281.0977,619.96179 L 3307.3608,619.32434 L 3332.9062,615.7528 L 3357.3384,608.85901 L 3380.2617,598.25476 L 3401.2808,583.55188 L 3420,564.36218 L 3451.7145,526.85596 L 3478.4052,500.02834 L 3490.4746,490.35701 L 3502.0176,483.04093 L 3513.2774,477.97528 L 3524.4972,475.05529 L 3535.9203,474.17613 L 3547.7897,475.23301 L 3573.8406,482.73567 L 3604.5955,496.72487 L 3642,516.36218 L 3661.9045,524.93152 L 3684.8457,531.29187 L 3710.2273,535.67175 L 3737.4531,538.29968 L 3795.0527,539.21374 L 3852.875,535.86218 L 3906.1504,530.07312 L 3950.1094,523.67468 L 3991,516.36218 L 4005,-451.63782 L -22,-452.63782 L -19,289.36218 L -19,289.36218" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="147" x="1909" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="147" x="1849" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="209" x="1828" height="8" width="141" id="Small Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="197" x="1823" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="196" x="1971" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="127" x="1896" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="434" x="3355" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="434" x="3310" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="434" x="3265" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="496" x="3259" height="8" width="141" id="Medium Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="484" x="3254" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="483" x="3402" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="414" x="3327" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve7Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -399,288.36218 L 489,288.36218 L 521,301.36218 L 593,320.36218 L 645,328.36218 L 688,331.36218 L 734,326.36218 L 763,318.36218 L 791,302.36218 L 810,285.36218 L 823,261.36218 L 838,229.36218 L 850,209.36218 L 862,199.36218 L 872,195.36218 L 886,200.36218 L 900,218.36218 L 914,236.36218 L 928,253.36218 L 944,268.36218 L 962,276.36218 L 976,282.36218 L 985,297.36218 L 989,323.36218 L 989,372.36218 L 995,403.36218 L 1002,420.36218 L 1011,429.36218 L 1088,460.36218 L 1198,488.36218 L 1267,497.36218 L 1313,497.36218 L 1349,490.36218 L 1378,475.36218 L 1393,452.36218 L 1418,419.36218 L 1444,402.36218 L 1463,394.36218 L 1556,388.36218 L 1586,384.36218 L 1611,377.36218 L 1633,360.36218 L 1642,345.36218 L 1658,306.36218 L 1671,228.36218 L 1679,209.36218 L 1693,198.36218 L 1710,190.36218 L 1722,194.36218 L 1727,199.36218 L 1742,216.36218 L 1769,228.36218 L 1797,232.36218 L 1857,236.36218 L 1911,232.36218 L 1958,222.36218 L 1976,207.36218 L 1987,188.36218 L 1997,145.36218 L 2002,97.362183 L 2008,86.362183 L 2031,71.362183 L 2062,66.362183 L 2087,66.362183 L 2116,78.362183 L 2143,90.362183 L 2166,95.362183 L 2180,95.362183 L 2195,87.362183 L 2223,55.362183 L 2240,46.362183 L 2261,46.362183 L 2283,49.362183 L 2300,44.362183 L 2310,33.362183 L 2322,26.362183 L 2340,28.362183 L 2358,33.362183 L 2373,35.362183 L 2387,32.362183 L 2415,11.362183 L 2450,-8.6378174 L 2479,-16.637817 L 2504,-12.637817 L 2520,-0.63781738 L 2536,32.362183 L 2543,76.362183 L 2542,209.36218 L 2543,276.36218 L 2550,312.36218 L 2556,335.36218 L 2564,360.36218 L 2579,381.36218 L 2604,404.36218 L 2658,435.36218 L 2701,454.36218 L 2770,477.36218 L 2814,489.36218 L 2845,488.36218 L 2858,482.36218 L 2867,457.36218 L 2888,373.36218 L 2908,335.36218 L 2933,311.36218 L 2963,297.36218 L 3004,291.36218 L 3036,297.36218 L 3061,312.36218 L 3074,328.36218 L 3073,367.36218 L 3068,407.36218 L 3057,464.36218 L 3050,494.36218 L 3048,522.36218 L 3057,542.36218 L 3072,555.36218 L 3134,586.36218 L 3211,610.36218 L 3278,620.36218 L 3322,617.36218 L 3369,604.36218 L 3400,585.36218 L 3440,542.36218 L 3463,514.36218 L 3498,485.36218 L 3525,475.36218 L 3548,474.36218 L 3588,488.36218 L 3628,508.36218 L 3670,529.36218 L 3733,538.36218 L 3821,539.36218 L 3946,525.36218 L 3977,516.36218 L 4440,465.36218 L 4443,1046.3622 L -402,1053.3622 L -399,288.36218 z" id="path2381" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve7Limira.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 4005,-451.63782 L -22,-452.63782 L -20,371.36218 L 1349,715.36218 L 3999,721.36218 L 4005,-451.63782 z" id="path2380" sodipodi:nodetypes="cccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel7TerrainBitmap();
addChild(surface);
surface.y = -23;
surface.x = -530;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4288924313, 4282807100);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [9, 9.55];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [9, 9.2];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [9, 9.3];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [9, 8.8];
};
var Helipad_position:Array = [9, 10.4];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 181
//Level8 (Clases.Game.Levels.Level8)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level8 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level8(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve8.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:nodetypes="cccsssssscscscssssssssscscssssssssssccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" id="path2380" d="M -1,289.36218 L 510,289.36218 L 537,355.36218 L 541.96875,368.65906 L 548.70703,381.88757 L 558.75,396.48718 L 572.44922,410.19616 L 580.77979,416.00989 L 590.15625,420.75281 L 600.62256,424.14221 L 612.22266,425.89538 L 625.00049,425.72961 L 639,423.36218 L 667.87305,415.23913 L 695.79688,406.19031 L 722.47852,397.82116 L 747.625,391.73718 L 770.94336,389.54382 L 781.82544,390.40783 L 792.14062,392.84656 L 801.85229,397.06067 L 810.92383,403.25085 L 819.3186,411.6178 L 827,422.36218 L 835.45972,432.27307 L 846.02148,438.22741 L 858.39673,440.55774 L 872.29688,439.59656 L 887.43335,435.67639 L 903.51758,429.12976 L 920.26099,420.28918 L 937.375,409.48718 L 971.56055,383.32898 L 1003.7656,353.31531 L 1031.6816,322.10632 L 1053,292.36218 L 1060.1448,276.51768 L 1065.1744,256.63501 L 1068.4806,233.4304 L 1070.4556,207.6201 L 1071.9795,151.04735 L 1072.8823,92.646641 L 1076.2997,38.147878 L 1079.9314,14.152317 L 1085.3678,-6.7190482 L 1093.0009,-23.749981 L 1103.2226,-36.224245 L 1109.4267,-40.528801 L 1116.425,-43.425602 L 1124.2664,-44.825117 L 1133,-44.637817 L 1148.8941,-44.217446 L 1162.6327,-46.438222 L 1174.4879,-50.897982 L 1184.7317,-57.194562 L 1193.6363,-64.925798 L 1201.4736,-73.689526 L 1215.0346,-92.705804 L 1227.5914,-111.02608 L 1234.1733,-118.91981 L 1241.3202,-125.43305 L 1249.3043,-130.16364 L 1258.3976,-132.7094 L 1268.8722,-132.66818 L 1281,-129.63782 L 1291.1423,-128.24793 L 1300.6387,-131.12805 L 1309.593,-137.60291 L 1318.1094,-146.99719 L 1334.2441,-171.8429 L 1349.875,-200.26282 L 1365.834,-226.85462 L 1374.1965,-237.77674 L 1382.9531,-246.21594 L 1392.2078,-251.49695 L 1402.0645,-252.94446 L 1412.6272,-249.88318 L 1424,-241.63782 L 1435.6287,-226.03015 L 1446.8574,-202.18274 L 1457.6379,-171.37146 L 1467.9219,-134.87219 L 1486.8066,-49.913211 L 1503.125,42.48718 L 1516.4902,132.12195 L 1526.5156,208.78405 L 1535,282.36218 L 1540.875,313.20593 L 1549.5547,344.27234 L 1563.25,379.11218 L 1572.2568,396.38708 L 1582.8516,412.73327 L 1595.1455,427.52673 L 1609.25,440.14343 L 1625.2764,449.95935 L 1643.3359,456.35046 L 1663.54,458.69275 L 1686,456.36218 L 1708.2017,449.48327 L 1727.6758,438.97156 L 1744.6011,425.38952 L 1759.1562,409.29968 L 1771.52,391.26452 L 1781.8711,371.84656 L 1790.3882,351.60827 L 1797.25,331.11218 L 1806.7227,291.59656 L 1811.7188,257.79968 L 1814,225.36218 L 1812,154.78405 L 1811.4688,82.504758 L 1813,-0.26282 L 1817.9062,-82.889773 L 1822.0352,-120.82898 L 1827.5,-154.74719 L 1834.4648,-183.3158 L 1843.0938,-205.20618 L 1848.0835,-213.23184 L 1853.5508,-219.08972 L 1859.5161,-222.61374 L 1866,-223.63782 L 1889.4648,-223.97962 L 1906.5312,-226.74719 L 1918.207,-231.17884 L 1925.5,-236.51282 L 1929.418,-241.98743 L 1930.9688,-246.84094 L 1931,-251.63782 L 1932.2812,-260.16907 L 1937.5,-277.13782 L 1942.2305,-284.74329 L 1948.7188,-289.60657 L 1957.2227,-290.11048 L 1968,-284.63782 L 1970.9883,-280.47832 L 1973.9595,-272.66405 L 1979.8873,-247.05658 L 1991.9439,-162.82357 L 2018.9336,82.53352 L 2035.0511,212.12547 L 2044.0246,271.75214 L 2053.7066,325.30494 L 2064.1711,370.8131 L 2075.4922,406.30586 L 2081.497,419.68061 L 2087.7438,429.81248 L 2094.2417,436.45511 L 2101,439.36218 L 2113.1352,439.35335 L 2122.7557,435.90734 L 2130.1841,429.51988 L 2135.7429,420.68667 L 2139.7545,409.90344 L 2142.5413,397.66591 L 2145.731,370.81081 L 2147.8918,344.08714 L 2151.6037,321.46064 L 2154.8474,312.92313 L 2159.4464,306.89707 L 2165.7231,303.87818 L 2174,304.36218 L 2181.9182,305.18225 L 2189.5332,303.6571 L 2196.823,299.99621 L 2203.7656,294.40906 L 2216.5215,278.29382 L 2227.625,256.98718 L 2236.9004,232.16491 L 2244.1719,205.5028 L 2249.2637,178.67663 L 2252,153.36218 L 2254.5312,127.89538 L 2259.5,101.50281 L 2267.4688,77.196167 L 2272.7539,66.766235 L 2279,57.987183 L 2286.2773,51.235474 L 2294.6562,46.887573 L 2304.207,45.319947 L 2315,46.909058 L 2327.1055,52.031372 L 2340.5938,61.063355 L 2355.5352,74.38147 L 2372,92.362183 L 2380.2642,100.43243 L 2387.8401,104.40076 L 2394.7777,104.55975 L 2401.127,101.20203 L 2406.9379,94.620177 L 2412.2605,85.106811 L 2421.6406,58.455931 L 2429.6672,23.590208 L 2436.7402,-17.149538 L 2449.625,-106.88782 L 2463.4941,-192.03235 L 2471.7976,-227.02991 L 2481.5469,-253.85657 L 2487.0887,-263.47431 L 2493.1418,-270.17151 L 2499.7564,-273.65558 L 2506.9824,-273.63391 L 2514.8698,-269.81391 L 2523.4685,-261.90296 L 2532.8286,-249.60846 L 2543,-232.63782 L 2552.9103,-212.46954 L 2561.5097,-190.86771 L 2575.1135,-143.9065 L 2584.4854,-92.840355 L 2590.2997,-38.755443 L 2593.2307,17.262069 L 2593.9526,74.126011 L 2591.4659,186.04852 L 2588.2335,288.32273 L 2588.0232,333.12631 L 2589.6492,372.25931 L 2593.7856,404.63556 L 2601.1067,429.16891 L 2606.1723,438.15506 L 2612.2868,444.77317 L 2619.5346,448.88747 L 2628,450.36218 L 2642.2756,448.22326 L 2653.8926,441.87585 L 2663.2859,431.98645 L 2670.8906,419.22156 L 2677.1418,404.24768 L 2682.4746,387.73132 L 2692.125,352.73718 L 2703.3223,319.57116 L 2710.5886,305.33996 L 2719.5469,293.56531 L 2730.6321,284.91369 L 2744.2793,280.05163 L 2760.9236,279.64563 L 2781,284.36218 L 2800.5391,293.14306 L 2815.6835,304.22017 L 2827.0363,317.19522 L 2835.2005,331.66992 L 2840.7794,347.24599 L 2844.376,363.52513 L 2848.0348,396.59949 L 2851.0017,427.70668 L 2853.7335,441.52687 L 2858.1016,453.6604 L 2864.7092,463.70899 L 2874.1594,471.27434 L 2887.0553,475.95817 L 2904,477.36218 L 2922.7334,475.83093 L 2939.9609,472.19031 L 2955.7236,466.74499 L 2970.0625,459.79968 L 2983.0186,451.65906 L 2994.6328,442.62781 L 3014,423.11218 L 3028.4922,403.69031 L 3038.4375,386.79968 L 3046,370.36218 L 3053.612,340.19117 L 3072.8819,274.65616 L 3085.2171,240.33559 L 3098.4609,211.22415 L 3105.2146,200.08542 L 3111.9448,192.00523 L 3118.5677,187.56901 L 3125,187.36218 L 3130.7415,190.18567 L 3135.6348,194.38757 L 3143.1406,206.0653 L 3148.0449,220.67273 L 3150.875,236.48718 L 3152.4219,264.84656 L 3152,277.36218 L 3153.4362,286.97904 L 3158.0798,308.50714 L 3161.7615,320.30549 L 3166.4336,330.96276 L 3172.1588,339.10598 L 3179,343.36218 L 3193.1191,345.83679 L 3205.5156,345.72156 L 3216.248,342.95788 L 3225.375,337.48718 L 3232.9551,329.25085 L 3239.0469,318.19031 L 3243.709,304.24695 L 3247,287.36218 L 3247.8467,249.2576 L 3246.5821,178.92791 L 3245.3017,87.732727 L 3246.1008,-12.968286 L 3247.9349,-63.333593 L 3251.0748,-111.81549 L 3255.7822,-156.99403 L 3262.319,-197.44924 L 3270.9473,-231.76119 L 3281.929,-258.5099 L 3288.3842,-268.60431 L 3295.5259,-276.27543 L 3303.3869,-281.34577 L 3312,-283.63782 L 3327.957,-285.8324 L 3340.1406,-288.96009 L 3349.0195,-292.89929 L 3355.0625,-297.52844 L 3358.7383,-302.72595 L 3360.5156,-308.37024 L 3360.25,-320.51282 L 3358.0156,-332.98352 L 3357.5625,-344.80969 L 3359.1758,-350.17713 L 3362.6406,-355.01868 L 3368.4258,-359.21277 L 3377,-362.63782 L 3385.8894,-364.50965 L 3392.5215,-364.29993 L 3397.217,-362.27088 L 3400.2969,-358.68469 L 3402.8926,-347.88977 L 3402.875,-334.01282 L 3402.8105,-319.15149 L 3405.2656,-305.40344 L 3408.24,-299.60242 L 3412.8066,-294.86634 L 3419.2864,-291.4574 L 3428,-289.63782 L 3436.7407,-287.61927 L 3443.3164,-283.61438 L 3448.0698,-277.88684 L 3451.3438,-270.70032 L 3454.8242,-253.00501 L 3456.5,-232.63782 L 3459.1133,-211.70813 L 3461.6284,-201.69153 L 3465.4062,-192.32532 L 3470.7896,-183.87317 L 3478.1211,-176.59876 L 3487.7437,-170.76575 L 3500,-166.63782 L 3506.4222,-163.8021 L 3512.0378,-158.58875 L 3516.9016,-151.15726 L 3521.0684,-141.66712 L 3527.5295,-117.14881 L 3531.8594,-86.309695 L 3534.4958,-50.425662 L 3535.877,-10.772586 L 3536.625,74.73718 L 3537.6074,160.01257 L 3539.2815,199.37268 L 3542.3281,234.84655 L 3547.1853,265.15832 L 3554.291,289.0321 L 3558.8239,298.15603 L 3564.0833,305.19201 L 3570.1237,309.98056 L 3577,312.36218 L 3606.8438,315.7157 L 3637.25,316.69031 L 3667.2812,315.1571 L 3696,310.98718 L 3722.4688,304.05163 L 3745.75,294.22156 L 3764.9062,281.36804 L 3772.6445,273.76721 L 3779,265.36218 L 3785.6123,257.43725 L 3794.0205,251.14037 L 3803.956,246.25087 L 3815.1505,242.54811 L 3840.2431,237.82016 L 3867.1514,235.19131 L 3893.7282,232.89632 L 3917.8265,229.16996 L 3928.2754,226.21837 L 3937.2995,222.24699 L 3944.6305,217.03514 L 3950,210.36218 L 3953.7102,197.89782 L 3956.3379,176.45984 L 3959.0781,112.39343 L 3959.625,-60.38782 L 3960.3613,-146.18079 L 3963.3594,-216.29407 L 3966.1643,-241.88928 L 3970.084,-259.26673 L 3972.5191,-264.42609 L 3975.3015,-266.99378 L 3978.4542,-266.79071 L 3982,-263.63782 L 3991.0815,-254.1698 L 4001.6367,-246.29993 L 4013.3813,-239.89197 L 4026.0312,-234.80969 L 4052.9102,-228.07727 L 4080,-225.01282 L 4105.0273,-224.52649 L 4125.7188,-225.52844 L 4145,-227.63782 L 4145,-890.63782 L -1,-888.63782 L -1,289.36218 L -1,289.36218" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="417" x="1651" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="375" x="1670" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="434" x="2906" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="392" x="2925" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="227" x="3697" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="227" x="3652" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="227" x="3607" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="289" x="3601" height="8" width="141" id="Medium Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="277" x="3596" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="276" x="3744" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="207" x="3669" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve8Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M -402,291.36218 L 510,289.36218 L 533,341.36218 L 547,381.36218 L 562,400.36218 L 579,416.36218 L 605,425.36218 L 633,424.36218 L 680,412.36218 L 729,395.36218 L 774,389.36218 L 802,396.36218 L 821,412.36218 L 831,427.36218 L 843,437.36218 L 861,441.36218 L 889,436.36218 L 931,412.36218 L 992,363.36218 L 1042,308.36218 L 1061,279.36218 L 1071,239.36218 L 1080,82.362183 L 1085,13.362183 L 1093,-25.637817 L 1114,-44.637817 L 1147,-43.637817 L 1177,-49.637817 L 1201,-72.637817 L 1234,-118.63782 L 1249,-131.63782 L 1268,-133.63782 L 1286,-127.63782 L 1297,-128.63782 L 1315,-142.63782 L 1354,-208.63782 L 1377,-241.63782 L 1398,-252.63782 L 1413,-251.63782 L 1431,-232.63782 L 1454,-179.63782 L 1471,-114.63782 L 1503,47.362183 L 1522,180.36218 L 1533,262.36218 L 1536,296.36218 L 1546,332.36218 L 1556,363.36218 L 1574,394.36218 L 1593,426.36218 L 1617,444.36218 L 1642,456.36218 L 1675,458.36218 L 1711,449.36218 L 1741,430.36218 L 1771,396.36218 L 1799,329.36218 L 1810,266.36218 L 1815,229.36218 L 1814,48.362183 L 1819,-85.637817 L 1829,-167.63782 L 1843,-206.63782 L 1859,-223.63782 L 1878,-223.63782 L 1907,-225.63782 L 1928,-238.63782 L 1930,-248.63782 L 1933,-265.63782 L 1942,-285.63782 L 1955,-290.63782 L 1968,-285.63782 L 1978,-264.63782 L 1995,-123.63782 L 2023,140.36218 L 2053,332.36218 L 2073,402.36218 L 2086,427.36218 L 2100,440.36218 L 2119,438.36218 L 2128,431.36218 L 2137,421.36218 L 2145,382.36218 L 2148,338.36218 L 2156,309.36218 L 2166,303.36218 L 2181,304.36218 L 2199,299.36218 L 2218,275.36218 L 2240,226.36218 L 2251,168.36218 L 2255,119.36218 L 2265,76.362183 L 2282,55.362183 L 2300,43.362183 L 2311,44.362183 L 2336,54.362183 L 2357,75.362183 L 2373,92.362183 L 2382,102.36218 L 2393,103.36218 L 2406,98.362183 L 2417,76.362183 L 2436,8.3621826 L 2456,-131.63782 L 2472,-216.63782 L 2483,-254.63782 L 2493,-271.63782 L 2507,-275.63782 L 2520,-268.63782 L 2545,-230.63782 L 2566,-183.63782 L 2580,-84.637817 L 2587,59.362183 L 2588,291.36218 L 2591,383.36218 L 2600,428.36218 L 2618,449.36218 L 2635,452.36218 L 2655,442.36218 L 2670,424.36218 L 2685,380.36218 L 2700,323.36218 L 2721,290.36218 L 2748,278.36218 L 2770,282.36218 L 2804,294.36218 L 2829,318.36218 L 2843,348.36218 L 2848,388.36218 L 2851,423.36218 L 2858,454.36218 L 2869,468.36218 L 2899,479.36218 L 2943,471.36218 L 2985,449.36218 L 3023,414.36218 L 3047,370.36218 L 3071,279.36218 L 3092,219.36218 L 3107,194.36218 L 3124,185.36218 L 3141,198.36218 L 3151,230.36218 L 3151,277.36218 L 3163,326.36218 L 3174,341.36218 L 3199,346.36218 L 3220,342.36218 L 3233,328.36218 L 3244,306.36218 L 3248,278.36218 L 3250,-38.637817 L 3254,-132.63782 L 3266,-212.63782 L 3281,-260.63782 L 3304,-282.63782 L 3322,-286.63782 L 3337,-288.63782 L 3354,-295.63782 L 3360,-306.63782 L 3362,-320.63782 L 3363,-341.63782 L 3364,-353.63782 L 3372,-360.63782 L 3384,-364.63782 L 3394,-364.63782 L 3402,-357.63782 L 3402,-340.63782 L 3403,-314.63782 L 3411,-295.63782 L 3421,-291.63782 L 3446,-284.63782 L 3455,-264.63782 L 3461,-202.63782 L 3469,-186.63782 L 3485,-171.63782 L 3509,-163.63782 L 3520,-147.63782 L 3533,-88.637817 L 3536,107.36218 L 3543,244.36218 L 3552,283.36218 L 3564,306.36218 L 3575,311.36218 L 3621,317.36218 L 3681,313.36218 L 3728,303.36218 L 3766,282.36218 L 3785,259.36218 L 3805,245.36218 L 3829,238.36218 L 3889,233.36218 L 3934,225.36218 L 3947,214.36218 L 3953,203.36218 L 3960,186.36218 L 3967,-231.63782 L 3970,-258.63782 L 3976,-266.63782 L 3983,-264.63782 L 3994,-252.63782 L 4020,-237.63782 L 4065,-230.63782 L 4149,-226.63782 L 4568,-227.63782 L 4565,793.36218 L -402,791.36218 L -402,291.36218 z" id="path2381" sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve8Limits.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 4151,-890.63782 L -1,-888.63782 L -1,588.36218 L 4151,587.36218 L 4151,-890.63782 z" id="path2380" sodipodi:nodetypes="ccccc"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel8TerrainBitmap();
addChild(surface);
surface.y = -370;
surface.x = -510;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4281291087, 4286233757);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [10, 9.7];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [10, 9];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [10, 9.7];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [10, 8.75];
};
var Helipad_position:Array = [10, 10.4];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 182
//Level9 (Clases.Game.Levels.Level9)
package Clases.Game.Levels {
import flash.display.*;
import Clases.Game.Veicle.*;
import Clases.BasicEngine.*;
import Clases.Game.Common.*;
public class Level9 extends Level {
private var svg:XML;
private var vars:Object;
private var svgTerrain:XML;
private var level_objects:XML;
private var svgLimits:XML;
public function Level9(){
svg = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve9.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:nodetypes="ccsssssssssssssscsssssssssssssssssssssssccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" id="path2381" d="M -5,289.36218 L 507,289.36218 L 547.83682,343.51176 L 579.66017,387.96796 L 602,423.36218 L 616.54688,451.34656 L 626.76758,468.45007 L 638.875,485.23718 L 652.81055,499.91491 L 668.51562,510.69031 L 677.01343,514.05432 L 685.93164,515.77038 L 695.26294,515.61438 L 705,513.36218 L 715.24609,507.22058 L 726.07812,496.10437 L 737.44922,480.85144 L 749.3125,462.29968 L 800.75,371.86218 L 828.20312,328.63562 L 842.19922,310.453 L 856.3125,295.67468 L 870.49609,285.13855 L 884.70312,279.68249 L 891.80078,279.12134 L 898.88672,280.14441 L 905.95508,282.85644 L 913,287.36218 L 939.32439,305.2937 L 962.29075,316.32384 L 982.26391,321.55591 L 999.60867,322.09326 L 1014.6899,319.03923 L 1027.8723,313.49715 L 1050,299.36218 L 1055.3813,292.69616 L 1059.3477,281.75281 L 1064.2188,249.61218 L 1070,162.36218 L 1075.6445,117.56531 L 1080.1909,97.12976 L 1086.2812,78.862183 L 1094.2114,63.407105 L 1104.2773,51.409058 L 1116.7749,43.512574 L 1132,40.362183 L 1146.8759,38.245726 L 1158.4189,33.26491 L 1167.0646,25.785069 L 1173.2487,16.171534 L 1177.4067,4.7896383 L 1179.9741,-7.9952846 L 1182.0798,-36.312882 L 1183.0506,-65.858597 L 1186.3711,-93.709766 L 1190.0014,-106.08656 L 1195.526,-116.94373 L 1203.3803,-125.91592 L 1214,-132.63782 L 1238.0884,-145.45431 L 1257.553,-160.16042 L 1273.0681,-177.14114 L 1285.308,-196.78143 L 1294.9468,-219.46627 L 1302.659,-245.58063 L 1309.1186,-275.50949 L 1315,-309.63782 L 1319.6738,-350.62415 L 1322.3906,-396.40344 L 1326.125,-489.26282 L 1329.2285,-529.80384 L 1334.5469,-562.05969 L 1338.3625,-574.05896 L 1343.123,-582.76087 L 1348.9587,-587.75672 L 1356,-588.63782 L 1359.6069,-586.87074 L 1362.7583,-582.97253 L 1367.8048,-569.32596 L 1371.3597,-548.78452 L 1373.6432,-522.43465 L 1375.2763,-456.65531 L 1374.4652,-380.67937 L 1372.9709,-303.19823 L 1372.5546,-232.90331 L 1374.9772,-178.48604 L 1377.8035,-159.94758 L 1382,-148.63782 L 1385.4651,-137.41871 L 1386.7759,-118.4094 L 1384.6782,-61.658222 L 1379.1935,12.339551 L 1373.8086,94.307775 L 1372.0101,174.9703 L 1373.5453,211.91313 L 1377.2847,245.05097 L 1383.664,273.22432 L 1393.1191,295.27365 L 1399.1363,303.63946 L 1406.0858,310.03944 L 1414.0222,314.32866 L 1423,316.36218 L 1433.2218,316.04175 L 1442.8994,313.30652 L 1452.0511,308.3081 L 1460.6953,301.19812 L 1468.8502,292.12817 L 1476.5342,281.24988 L 1490.5625,254.67468 L 1502.9268,222.68542 L 1513.7734,186.49499 L 1523.249,147.31628 L 1531.5,106.36218 L 1544.9141,23.979368 L 1555.1875,-50.95032 L 1563.4922,-108.72376 L 1567.2725,-128.14466 L 1571,-139.63782 L 1579.3258,-153.98819 L 1590.2879,-169.64175 L 1603.3253,-184.37899 L 1617.8767,-195.98042 L 1625.5449,-199.91161 L 1633.3811,-202.22653 L 1641.3153,-202.64773 L 1649.2772,-200.8978 L 1657.1968,-196.69927 L 1665.0039,-189.77473 L 1672.6283,-179.84672 L 1680,-166.63782 L 1684.3628,-153.15286 L 1686.841,-135.57834 L 1687.7318,-90.442813 L 1685.8486,-35.79562 L 1684.3681,23.798865 L 1686.4665,83.776264 L 1689.8505,112.48219 L 1695.3203,139.5722 L 1703.2732,164.47575 L 1714.106,186.6223 L 1728.216,205.44129 L 1746,220.36218 L 1760.5776,232.35461 L 1772.4805,247.39538 L 1781.7759,265.01721 L 1788.5312,284.75281 L 1792.814,306.13489 L 1794.6914,328.69616 L 1794.231,351.96936 L 1791.5,375.48718 L 1786.5659,398.78235 L 1779.4961,421.38757 L 1770.3579,442.83557 L 1759.2188,462.65906 L 1746.146,480.39074 L 1731.207,495.56335 L 1714.4692,507.70959 L 1696,516.36218 L 1645.6309,530.47937 L 1576.9219,545.29968 L 1497.5957,560.02624 L 1415.375,573.86218 L 1273.1406,595.67468 L 1212,604.36218 L 1162.8415,616.41917 L 1113.195,631.28154 L 1057.3273,651.84749 L 1029.5192,664.22579 L 1003.1062,677.97778 L 979.07179,693.08603 L 958.39945,709.53315 L 942.07262,727.30174 L 931.0748,746.37437 L 927.88159,756.39427 L 926.38943,766.73365 L 926.72126,777.39035 L 929,788.36218 L 948.3125,863.90906 L 957.19531,900.45789 L 966.5,933.73719 L 976.92969,961.90711 L 982.78613,973.5011 L 989.1875,983.12781 L 996.22168,990.55726 L 1003.9766,995.55945 L 1012.54,997.90442 L 1022,997.36218 L 1043.7044,989.5681 L 1069.1652,975.63962 L 1131.9405,936.60201 L 1169.5475,915.10417 L 1211.4956,894.69449 L 1257.931,877.17861 L 1282.8772,870.07011 L 1309,864.36218 L 1404.5724,843.81095 L 1492.4432,824.8089 L 1531.6873,819.00678 L 1566.8423,817.3335 L 1582.661,818.43491 L 1597.187,821.03624 L 1610.33,825.29336 L 1622,831.36218 L 1636.8534,843.08287 L 1648.3635,855.99383 L 1665.5528,882.37991 L 1673.3314,894.35171 L 1681.9656,904.50713 L 1692.5052,912.09451 L 1706,916.36218 L 1715.3361,915.31744 L 1723.9693,909.65867 L 1732.087,900.09911 L 1739.8768,887.35195 L 1755.2222,855.14768 L 1771.5048,818.75156 L 1790.2244,783.86926 L 1800.9667,768.77883 L 1812.8804,756.20648 L 1826.1532,746.86543 L 1840.9725,741.46889 L 1857.5256,740.73007 L 1876,745.36218 L 1903.6172,757.41491 L 1927.0625,769.59655 L 1965,789.98718 L 1981.2734,796.01648 L 1996.9375,797.8153 L 2012.8828,794.29382 L 2030,784.36218 L 2046.3583,770.62888 L 2060.6301,755.90159 L 2090.097,720.30061 L 2132.7654,671.23041 L 2163.5391,639.6666 L 2203,602.36218 L 2221.5023,582.61132 L 2235.3971,561.75482 L 2245.2664,540.01175 L 2251.6919,517.60122 L 2255.2557,494.74231 L 2256.5395,471.65412 L 2254.5951,425.66628 L 2250.5138,381.39042 L 2248.9508,340.57929 L 2250.5683,322.02073 L 2254.5611,304.98563 L 2261.511,289.69308 L 2272,276.36218 L 2283.1209,262.11753 L 2290.2609,245.89361 L 2294.023,228.08047 L 2295.0105,209.06816 L 2293.8266,189.24672 L 2291.0744,169.0062 L 2283.278,128.82812 L 2276.4469,91.654292 L 2274.9013,75.169096 L 2275.4065,60.605108 L 2278.5658,48.352375 L 2284.9824,38.800945 L 2295.2594,32.340865 L 2310,29.362183 L 2327.0739,29.156177 L 2343.3862,30.678512 L 2358.8856,33.764713 L 2373.5207,38.250309 L 2399.9919,50.761795 L 2422.3884,66.897186 L 2440.299,85.340702 L 2453.312,104.77656 L 2461.0161,123.88898 L 2463,141.36218 L 2448.4688,263.50281 L 2437.2305,375.48523 L 2428.5,501.23718 L 2426.2837,564.54895 L 2426.1445,625.62976 L 2428.5659,682.5885 L 2434.0312,733.53405 L 2443.0239,776.57531 L 2448.9941,794.54086 L 2456.0273,809.82116 L 2464.1841,822.17984 L 2473.5249,831.38049 L 2484.11,837.18673 L 2496,839.36218 L 2550.9121,839.28015 L 2613.1719,837.39343 L 2747.875,831.86218 L 2814.3887,830.04577 L 2876.3906,830.08093 L 2930.916,832.88171 L 2954.4485,835.60486 L 2975,839.36218 L 3007.1504,848.98523 L 3029.7031,859.90905 L 3045.4355,871.0907 L 3057.125,881.48718 L 3067.5488,890.05554 L 3079.4844,895.7528 L 3095.709,897.53601 L 3119,894.36218 L 3170.0925,888.86179 L 3259.0405,884.16443 L 3497.5246,876.0015 L 3728.4965,867.51892 L 3808.054,862.42197 L 3833.0562,859.53083 L 3846,856.36218 L 3868.9531,841.72546 L 3900.0625,817.45593 L 3934.4531,786.01452 L 3967.25,749.86218 L 3981.5273,730.78845 L 3993.5781,711.45984 L 4002.793,692.18396 L 4008.5625,673.26843 L 4010.2773,655.02087 L 4007.3281,637.7489 L 3999.1055,621.76013 L 3985,607.36218 L 3969.5361,594.31994 L 3957.2422,582.24304 L 3939.75,561.28405 L 3927.6953,545.08288 L 3916.25,534.23718 L 3909.2471,531.0094 L 3900.5859,529.3446 L 3889.6631,529.3175 L 3875.875,531.0028 L 3837.2891,539.80945 L 3780,556.36218 L 3741.8328,565.32434 L 3696.4277,571.76257 L 3645.0549,575.94201 L 3588.9844,578.1278 L 3529.4861,578.58508 L 3467.8301,577.57898 L 3343.125,572.23718 L 3225.0293,564.22351 L 3123.7031,555.65905 L 3012,545.36218 L 3002.2048,547.36449 L 2989.4941,553.24803 L 2957.7478,571.15619 L 2939.9227,580.42946 L 2921.6034,588.08131 L 2903.3951,592.73608 L 2885.9033,593.01809 L 2870.5859,589.94297 L 2863.2385,586.97623 L 2856.3448,582.40709 L 2850.0895,575.74833 L 2844.6571,566.51273 L 2840.2324,554.21309 L 2837,538.36218 L 2827.3262,486.43249 L 2816.6094,443.73718 L 2807.5566,408.91687 L 2802.875,380.61218 L 2803.0193,368.47839 L 2805.2715,357.46374 L 2809.97,347.39831 L 2817.4531,338.11218 L 2828.0593,329.43542 L 2842.127,321.19812 L 2859.9944,313.23034 L 2882,305.36218 L 2903.9119,295.28845 L 2921.6855,281.35046 L 2935.9407,264.34802 L 2947.2969,245.08093 L 2956.3738,224.349 L 2963.791,202.95202 L 2976.125,161.36218 L 2982.281,142.76892 L 2989.2559,126.70984 L 2997.6692,113.98474 L 3008.1406,105.39343 L 3014.3418,102.89789 L 3021.2898,101.73572 L 3037.7363,103.8114 L 3058.0999,112.42029 L 3083,128.36218 L 3110.2756,146.90686 L 3137.377,162.9071 L 3164.3406,176.53723 L 3191.2031,187.97155 L 3218.0012,197.3844 L 3244.7715,204.95007 L 3271.5505,210.84289 L 3298.375,215.23718 L 3352.3066,220.22741 L 3406.8594,221.3153 L 3462.3262,219.89538 L 3519,217.36218 L 3660.7344,213.78405 L 3823.375,212.73718 L 4013,213.36218 L 4009,-995.63782 L 1526,-995.63782 L -6,-994.63782 L -5,289.36218 L -5,289.36218" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g>
</svg>
;
level_objects = <objects>
<g id="g2461">
<rect y="906.36218" x="1030" height="44" width="43" id="Cube With Hook" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="864.36218" x="1041" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="788" x="3623" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="788" x="3578" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="788" x="3533" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="850" x="3527" height="8" width="141" id="Medium Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="838" x="3522" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="837" x="3670" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="768" x="3595" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="132" x="3454" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="132" x="3409" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2461">
<rect y="132" x="3364" height="44" width="43" id="Cube" density="0.001" style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
<g id="g2391">
<rect y="194" x="3358" height="8" width="141" id="Medium Platform" density="0.001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="182" x="3353" height="20" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="181" x="3501" height="22" width="5" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
<rect y="112" x="3426" height="6" width="7" id="Manija" density="0.0001" style="opacity:1;fill:#c7c100;fill-opacity:0.7676768;fill-rule:nonzero;stroke:#ffe44a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"/>
</g>
</objects>
;
svgTerrain = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve9Terrain.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 508,290.36218 L 548,344.36218 L 591,404.36218 L 609,434.36218 L 628,470.36218 L 648,494.36218 L 670,510.36218 L 686,515.36218 L 707,513.36218 L 722,500.36218 L 754,458.36218 L 802,370.36218 L 836,320.36218 L 855,297.36218 L 874,282.36218 L 890,278.36218 L 906,281.36218 L 931,300.36218 L 965,318.36218 L 999,322.36218 L 1025,315.36218 L 1056,296.36218 L 1061,273.36218 L 1071,134.36218 L 1078,103.36218 L 1093,65.362183 L 1109,48.362183 L 1125,39.362183 L 1146,37.362183 L 1162,31.362183 L 1176,12.362183 L 1181,-16.637817 L 1185,-84.637817 L 1194,-114.63782 L 1207,-131.63782 L 1237,-145.63782 L 1265,-166.63782 L 1289,-202.63782 L 1304,-246.63782 L 1319,-332.63782 L 1325,-459.63782 L 1331,-540.63782 L 1336,-564.63782 L 1345,-585.63782 L 1349,-589.63782 L 1360,-589.63782 L 1365,-578.63782 L 1369,-564.63782 L 1374,-539.63782 L 1376,-497.63782 L 1381,-236.63782 L 1384,-182.63782 L 1387,-160.63782 L 1392,-143.63782 L 1393,-130.63782 L 1375,134.36218 L 1373,168.36218 L 1378,250.36218 L 1395,285.36218 L 1408,308.36218 L 1423,314.36218 L 1440,315.36218 L 1460,309.36218 L 1475,293.36218 L 1491,266.36218 L 1513,209.36218 L 1547,26.362183 L 1558,-61.637817 L 1569,-131.63782 L 1582,-155.63782 L 1602,-185.63782 L 1629,-200.63782 L 1650,-200.63782 L 1662,-192.63782 L 1677,-169.63782 L 1679,-141.63782 L 1682,-74.637817 L 1686,44.362183 L 1691,123.36218 L 1709,178.36218 L 1736,209.36218 L 1766,231.36218 L 1787,260.36218 L 1793,299.36218 L 1793,347.36218 L 1784,406.36218 L 1760,455.36218 L 1740,481.36218 L 1718,500.36218 L 1702,510.36218 L 1588,544.36218 L 1453,569.36218 L 1324,587.36218 L 1214,602.36218 L 1114,630.36218 L 1024,666.36218 L 982,692.36218 L 955,709.36218 L 928,747.36218 L 927,776.36218 L 956,890.36218 L 972,948.36218 L 990,985.36218 L 1010,999.36218 L 1029,997.36218 L 1078,971.36218 L 1170,913.36218 L 1247,881.36218 L 1307,864.36218 L 1483,827.36218 L 1548,817.36218 L 1595,821.36218 L 1621,829.36218 L 1647,850.36218 L 1665,882.36218 L 1682,904.36218 L 1701,914.36218 L 1712,914.36218 L 1730,903.36218 L 1755,854.36218 L 1787,789.36218 L 1818,751.36218 L 1841,739.36218 L 1867,742.36218 L 1894,751.36218 L 1952,782.36218 L 1985,796.36218 L 2010,797.36218 L 2040,778.36218 L 2092,716.36218 L 2147,656.36218 L 2194,611.36218 L 2227,579.36218 L 2251,528.36218 L 2256,484.36218 L 2254,409.36218 L 2249,345.36218 L 2254,302.36218 L 2271,277.36218 L 2286,255.36218 L 2293,239.36218 L 2295,197.36218 L 2286,132.36218 L 2275,86.362183 L 2279,49.362183 L 2290,33.362183 L 2309,27.362183 L 2346,30.362183 L 2390,43.362183 L 2435,72.362183 L 2456,102.36218 L 2438,353.36218 L 2425,573.36218 L 2429,694.36218 L 2435,733.36218 L 2445,783.36218 L 2464,822.36218 L 2484,837.36218 L 2600,839.36218 L 2826,828.36218 L 2924,832.36218 L 2980,840.36218 L 3023,856.36218 L 3052,877.36218 L 3072,893.36218 L 3095,896.36218 L 3146,889.36218 L 3732,867.36218 L 3838,859.36218 L 3879,834.36218 L 3951,770.36218 L 3990,719.36218 L 4008,675.36218 L 4012,652.36218 L 4007,631.36218 L 3996,615.36218 L 3955,581.36218 L 3933,551.36218 L 3916,531.36218 L 3896,527.36218 L 3836,538.36218 L 3758,561.36218 L 3694,571.36218 L 3613,577.36218 L 3406,574.36218 L 3210,564.36218 L 3012,546.36218 L 2981,558.36218 L 2946,585.36218 L 2911,597.36218 L 2886,592.36218 L 2865,578.36218 L 2852,564.36218 L 2836,522.36218 L 2817,442.36218 L 2802,381.36218 L 2803,379.36218 L 2805,357.36218 L 2818,335.36218 L 2854,312.36218 L 2902,300.36218 L 2926,279.36218 L 2947,249.36218 L 2964,201.36218 L 2982,145.36218 L 2993,119.36218 L 3008,106.36218 L 3022,101.36218 L 3049,107.36218 L 3096,136.36218 L 3145,167.36218 L 3223,199.36218 L 3309,217.36218 L 3400,221.36218 L 3595,215.36218 L 4337,214.36218 L 4332,1364.3622 L -481,1367.3622 L -497,289.36218 L 508,290.36218 z" id="path2380" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"/>
</g>
</svg>
;
svgLimits = <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="4000" height="1052.3622" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docname="Leve9Limits.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
<g inkscape:label="Capa 1" inkscape:groupmode="layer" id="layer1">
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 4013,194.36218 L 4009,-995.63782 L 1526,-995.63782 L -6,-994.63782 L -7,997.36218 L 821,1198.3622 L 4008,1198.3622 L 4052,670.36218 L 4013,194.36218 z" id="path2381" sodipodi:nodetypes="ccccccsss"/>
</g>
</svg>
;
super();
}
public function destoy_level():void{
remove_background_levels();
}
private function generateGround():void{
var resoruces:LevelTerrain = new LevelTerrain();
var drawTerrain:DrawTerrain = new DrawTerrain();
var drawLimits:DrawLimit = new DrawLimit();
drawLimits.init({xml:svgLimits});
addChild(drawLimits);
drawTerrain.init({xml:svgTerrain});
addChild(drawTerrain);
var surface:Bitmap = resoruces.createLevel9TerrainBitmap();
addChild(surface);
surface.y = -595;
surface.x = -520;
surface.smoothing = true;
}
private function generate_Phisic():void{
b2SVG.parseSVG(svg, m_world);
}
override public function init(v:Object=null):void{
vars = v;
addBackground(4282384448, 4293623027);
generate_Phisic();
generateGround();
var positiosVeicle:Array = new Array();
if ((vars.helicopter is SmallHelicopter)){
positiosVeicle = [10, 9.6];
};
if ((vars.helicopter is MediumHelicopter)){
positiosVeicle = [10, 9.3];
};
if ((vars.helicopter is BigHelicopter)){
positiosVeicle = [10, 9.3];
};
if ((vars.helicopter is ChinookHelicopter)){
positiosVeicle = [10, 8.9];
};
var Helipad_position:Array = [10, 10.4];
super.init({HeliStartPos:positiosVeicle, Helupad_pos:Helipad_position, heli:vars.helicopter, level1Stage:vars.levelSelectionStage});
generate_objects(level_objects);
super.myGUI.addCompas(Helipad_position[0], Helipad_position[1]);
bring_to_Front_the_gui();
}
}
}//package Clases.Game.Levels
Section 183
//LevelTerrain (Clases.Game.Levels.LevelTerrain)
package Clases.Game.Levels {
import flash.display.*;
public class LevelTerrain {
private var Level10_PNG:Class;
private var Terrain_path:Class;
private var Level1_PNG:Class;
private var Level2_PNG:Class;
private var Level3_PNG:Class;
private var Level5_PNG:Class;
private var Level6_PNG:Class;
private var Level7_PNG:Class;
private var Level9_PNG:Class;
private var Level4_PNG:Class;
private var Level8_PNG:Class;
public function LevelTerrain(){
Level1_PNG = LevelTerrain_Level1_PNG;
Level2_PNG = LevelTerrain_Level2_PNG;
Level3_PNG = LevelTerrain_Level3_PNG;
Level4_PNG = LevelTerrain_Level4_PNG;
Level5_PNG = LevelTerrain_Level5_PNG;
Level6_PNG = LevelTerrain_Level6_PNG;
Level7_PNG = LevelTerrain_Level7_PNG;
Level8_PNG = LevelTerrain_Level8_PNG;
Level9_PNG = LevelTerrain_Level9_PNG;
Level10_PNG = LevelTerrain_Level10_PNG;
Terrain_path = LevelTerrain_Terrain_path;
super();
}
public function createLevel8TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level8_PNG() as Bitmap);
return (skin);
}
public function createLevel6TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level6_PNG() as Bitmap);
return (skin);
}
public function createLevel2TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level2_PNG() as Bitmap);
return (skin);
}
public function createTerrainPath():Bitmap{
var skin:Bitmap = (new Terrain_path() as Bitmap);
return (skin);
}
public function createLevel4TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level4_PNG() as Bitmap);
return (skin);
}
public function createLevel9TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level9_PNG() as Bitmap);
return (skin);
}
public function createLevel7TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level7_PNG() as Bitmap);
return (skin);
}
public function createLevel5TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level5_PNG() as Bitmap);
return (skin);
}
public function createLevel3TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level3_PNG() as Bitmap);
return (skin);
}
public function createLevel1TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level1_PNG() as Bitmap);
return (skin);
}
public function createLevel10TerrainBitmap():Bitmap{
var skin:Bitmap = (new Level10_PNG() as Bitmap);
return (skin);
}
}
}//package Clases.Game.Levels
Section 184
//LevelTerrain_Level1_PNG (Clases.Game.Levels.LevelTerrain_Level1_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level1_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 185
//LevelTerrain_Level10_PNG (Clases.Game.Levels.LevelTerrain_Level10_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level10_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 186
//LevelTerrain_Level2_PNG (Clases.Game.Levels.LevelTerrain_Level2_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level2_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 187
//LevelTerrain_Level3_PNG (Clases.Game.Levels.LevelTerrain_Level3_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level3_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 188
//LevelTerrain_Level4_PNG (Clases.Game.Levels.LevelTerrain_Level4_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level4_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 189
//LevelTerrain_Level5_PNG (Clases.Game.Levels.LevelTerrain_Level5_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level5_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 190
//LevelTerrain_Level6_PNG (Clases.Game.Levels.LevelTerrain_Level6_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level6_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 191
//LevelTerrain_Level7_PNG (Clases.Game.Levels.LevelTerrain_Level7_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level7_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 192
//LevelTerrain_Level8_PNG (Clases.Game.Levels.LevelTerrain_Level8_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level8_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 193
//LevelTerrain_Level9_PNG (Clases.Game.Levels.LevelTerrain_Level9_PNG)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Level9_PNG extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 194
//LevelTerrain_Terrain_path (Clases.Game.Levels.LevelTerrain_Terrain_path)
package Clases.Game.Levels {
import mx.core.*;
public class LevelTerrain_Terrain_path extends BitmapAsset {
}
}//package Clases.Game.Levels
Section 195
//LevelSelectionButtonSkin (Clases.Game.LevelSelection.LevelSelectionButtonSkin)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionButtonSkin {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionButtonSkin(){
UP_bitmap = LevelSelectionButtonSkin_UP_bitmap;
DOWN_bitmap = LevelSelectionButtonSkin_DOWN_bitmap;
OVER_bitmap = LevelSelectionButtonSkin_OVER_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 196
//LevelSelectionButtonSkin_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionButtonSkin_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionButtonSkin_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 197
//LevelSelectionButtonSkin_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionButtonSkin_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionButtonSkin_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 198
//LevelSelectionButtonSkin_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionButtonSkin_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionButtonSkin_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 199
//LevelSelectionFirstHeli (Clases.Game.LevelSelection.LevelSelectionFirstHeli)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionFirstHeli {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionFirstHeli(){
UP_bitmap = LevelSelectionFirstHeli_UP_bitmap;
OVER_bitmap = LevelSelectionFirstHeli_OVER_bitmap;
DOWN_bitmap = LevelSelectionFirstHeli_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 200
//LevelSelectionFirstHeli_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionFirstHeli_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFirstHeli_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 201
//LevelSelectionFirstHeli_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionFirstHeli_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFirstHeli_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 202
//LevelSelectionFirstHeli_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionFirstHeli_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFirstHeli_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 203
//LevelSelectionFourthHeli (Clases.Game.LevelSelection.LevelSelectionFourthHeli)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionFourthHeli {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionFourthHeli(){
UP_bitmap = LevelSelectionFourthHeli_UP_bitmap;
OVER_bitmap = LevelSelectionFourthHeli_OVER_bitmap;
DOWN_bitmap = LevelSelectionFourthHeli_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 204
//LevelSelectionFourthHeli_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionFourthHeli_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFourthHeli_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 205
//LevelSelectionFourthHeli_NotSolded (Clases.Game.LevelSelection.LevelSelectionFourthHeli_NotSolded)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionFourthHeli_NotSolded {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionFourthHeli_NotSolded(){
UP_bitmap = LevelSelectionFourthHeli_NotSolded_UP_bitmap;
OVER_bitmap = LevelSelectionFourthHeli_NotSolded_OVER_bitmap;
DOWN_bitmap = LevelSelectionFourthHeli_NotSolded_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 206
//LevelSelectionFourthHeli_NotSolded_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionFourthHeli_NotSolded_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFourthHeli_NotSolded_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 207
//LevelSelectionFourthHeli_NotSolded_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionFourthHeli_NotSolded_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFourthHeli_NotSolded_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 208
//LevelSelectionFourthHeli_NotSolded_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionFourthHeli_NotSolded_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFourthHeli_NotSolded_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 209
//LevelSelectionFourthHeli_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionFourthHeli_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFourthHeli_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 210
//LevelSelectionFourthHeli_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionFourthHeli_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionFourthHeli_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 211
//LevelSelectionScreen (Clases.Game.LevelSelection.LevelSelectionScreen)
package Clases.Game.LevelSelection {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import Clases.Text.*;
import Clases.Game.Veicle.*;
import Clases.BasicScreens.ClassResources.*;
import Clases.Button.*;
import flash.net.*;
import Clases.Font.*;
import Clases.BasicScreens.*;
import Clases.Game.Levels.*;
import Clases.Game.Common.*;
import gs.*;
import gs.easing.*;
public class LevelSelectionScreen extends Sprite {
private var money:Text;
private var focused_object:String;
private var sound_plater:ResourceSound;
private var efect_money:Object;
private var last_level:Object;
private var optionsBonus_money:Object;
private var vars:Object;
private var last_object_selected:Array;
private var format:FontResources;
private var heliSelected:Object;
private var local_data:SharedObject;
private static var ventas:Array;
public function LevelSelectionScreen(){
money = new Text();
format = new FontResources();
optionsBonus_money = {width:125, height:30, color:0xFFFFFF, isBold:true, size:25, customFont:format.getA_Font_For_The_Computer_People_Font(), align:TextFormatAlign.LEFT};
efect_money = {color:0, alpha:1, blurX:5, blurY:5, strength:15, quality:1};
last_object_selected = new Array();
local_data = SharedObject.getLocal("user_data_Transport_game_v12");
sound_plater = new ResourceSound();
super();
}
private function startLevel9(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level9 = new Level9();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 9;
}
public function restart_function():void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
last_level.destoy_level();
sound_plater.stopLevelMusic();
generate();
}
private function startLevel7(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level7 = new Level7();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 7;
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function go_back(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stop_lvel_selection_music();
vars.main.generate_main();
}
private function startLevel10(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level10 = new Level10();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 10;
}
public function restart_level_function():void{
var level1:Level1;
var level2:Level2;
var level3:Level3;
var level4:Level4;
var level5:Level5;
var level6:Level6;
var level7:Level7;
var level8:Level8;
var level9:Level9;
var level10:Level10;
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
last_level.destoy_level();
if ((last_level is Level1)){
level1 = new Level1();
last_level = level1;
addChild(level1);
level1.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level1.levelSelection = this;
};
if ((last_level is Level2)){
level2 = new Level2();
last_level = level2;
addChild(level2);
level2.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level2.levelSelection = this;
};
if ((last_level is Level3)){
level3 = new Level3();
last_level = level3;
addChild(level3);
level3.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level3.levelSelection = this;
};
if ((last_level is Level4)){
level4 = new Level4();
last_level = level4;
addChild(level4);
level4.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level4.levelSelection = this;
};
if ((last_level is Level5)){
level5 = new Level5();
last_level = level5;
addChild(level5);
level5.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level5.levelSelection = this;
};
if ((last_level is Level6)){
level6 = new Level6();
last_level = level6;
addChild(level6);
level6.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level6.levelSelection = this;
};
if ((last_level is Level7)){
level7 = new Level7();
last_level = level7;
addChild(level7);
level7.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level7.levelSelection = this;
};
if ((last_level is Level8)){
level8 = new Level8();
last_level = level8;
addChild(level8);
level8.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level8.levelSelection = this;
};
if ((last_level is Level9)){
level9 = new Level9();
last_level = level9;
addChild(level9);
level9.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level9.levelSelection = this;
};
if ((last_level is Level10)){
level10 = new Level10();
last_level = level10;
addChild(level10);
level10.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level10.levelSelection = this;
};
}
private function startLevel1(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level1 = new Level1();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 1;
}
private function startLevel2(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level2 = new Level2();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 2;
}
private function startLevel3(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level3 = new Level3();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 3;
}
private function startLevel6(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level6 = new Level6();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 6;
}
private function generate():void{
var X_POS:int;
var Y_Pos:int;
var FIRST_NAME:String;
var SECOND_NAME:String;
var THIRDTH_NAME:String;
var FOURTH_NAME:String;
var FIRST_HELICOPTER:int;
var SECON_HELICOPTER:int;
var THIRDTH_HELICOPTER:int;
var square:Shape;
var buy_the_helicopter:Function;
var buyButton1:GameButton;
var buyButton2:GameButton;
var buyButton3:GameButton;
var cookies:Function = function ():void{
local_data.data.currentLevel = Main.current_level;
local_data.data.lastPlayedLevel = Main.last_played_level;
local_data.data.gameMoney = Main.total_game_money;
};
var firstButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level1:GameButton = new GameButton({y:12, width:55, height:25, texto:"1", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level1);
level1.x = 48;
level1.y = X_POS;
level1.addEventListener(MouseEvent.CLICK, startLevel1);
Y_Pos = ((level1.x + level1.width) + 2);
};
var secondButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level2:GameButton = new GameButton({y:12, width:55, height:25, texto:"2", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level2);
level2.x = Y_Pos;
level2.y = X_POS;
level2.addEventListener(MouseEvent.CLICK, startLevel2);
Y_Pos = ((level2.x + level2.width) + 2);
};
var thirdButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level3:GameButton = new GameButton({y:12, width:55, height:25, texto:"3", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level3);
level3.x = Y_Pos;
level3.y = X_POS;
level3.addEventListener(MouseEvent.CLICK, startLevel3);
Y_Pos = ((level3.x + level3.width) + 2);
};
var fourthButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level4:GameButton = new GameButton({y:12, width:55, height:25, texto:"4", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level4);
level4.x = Y_Pos;
level4.y = X_POS;
level4.addEventListener(MouseEvent.CLICK, startLevel4);
Y_Pos = ((level4.x + level4.width) + 2);
};
var fifthhButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level5:GameButton = new GameButton({y:12, width:55, height:25, texto:"5", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level5);
level5.x = Y_Pos;
level5.y = X_POS;
level5.addEventListener(MouseEvent.CLICK, startLevel5);
Y_Pos = ((level5.x + level5.width) + 2);
};
var sixthButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level6:GameButton = new GameButton({y:12, width:55, height:25, texto:"6", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level6);
level6.x = Y_Pos;
level6.y = X_POS;
level6.addEventListener(MouseEvent.CLICK, startLevel6);
Y_Pos = ((level6.x + level6.width) + 2);
};
var seventhButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level7:GameButton = new GameButton({y:12, width:55, height:25, texto:"7", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level7);
level7.x = Y_Pos;
level7.y = X_POS;
level7.addEventListener(MouseEvent.CLICK, startLevel7);
Y_Pos = ((level7.x + level7.width) + 2);
};
var eightButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level8:GameButton = new GameButton({y:12, width:55, height:25, texto:"8", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level8);
level8.x = Y_Pos;
level8.y = X_POS;
level8.addEventListener(MouseEvent.CLICK, startLevel8);
Y_Pos = ((level8.x + level8.width) + 2);
};
var ninethButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level9:GameButton = new GameButton({y:12, width:55, height:25, texto:"9", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level9);
level9.x = Y_Pos;
level9.y = X_POS;
level9.addEventListener(MouseEvent.CLICK, startLevel9);
Y_Pos = ((level9.x + level9.width) + 2);
};
var tenButton:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var level10:GameButton = new GameButton({y:12, width:55, height:25, texto:"10", size:20, skins:new LevelSelectionButtonSkin(), objectColor:colors});
addChild(level10);
level10.x = Y_Pos;
level10.y = X_POS;
level10.addEventListener(MouseEvent.CLICK, startLevel10);
};
var locked:Function = function ():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var locked:GameButton = new GameButton({y:17, width:55, height:25, texto:"Locked", size:12, skins:new ButtonLevelSelectionLoockedResources(), objectColor:colors});
addChild(locked);
locked.x = Y_Pos;
locked.y = X_POS;
Y_Pos = ((locked.x + locked.width) + 2);
};
var selectHely1:Function = function (e:MouseEvent):void{
selector(e.currentTarget.getText(), e.target.x);
sound_plater.play_twack();
};
var selectHely2:Function = function (e:MouseEvent):void{
selector(e.currentTarget.getText(), e.target.x);
sound_plater.play_twack();
};
var selectHely3:Function = function (e:MouseEvent):void{
selector(e.currentTarget.getText(), e.target.x);
sound_plater.play_twack();
};
var selectHely4:Function = function (e:MouseEvent):void{
selector(e.currentTarget.getText(), e.target.x);
sound_plater.play_twack();
};
buy_the_helicopter = function (e:MouseEvent):void{
Buyer_function(e.currentTarget.getText(), e.target.x);
};
var Buyer_function:Function = function (e:String, x_position:int):void{
var normalheli:MediumHelicopter;
var bigheli:BigHelicopter;
var cheenoock:ChinookHelicopter;
var money_expended:Text = new Text();
var optionsBonus:Object = {width:125, height:30, color:0xFF0000, isBold:true, size:25, customFont:format.getA_Font_For_The_Computer_People_Font(), align:TextFormatAlign.LEFT};
var efect:Object = {color:0, alpha:1, blurX:5, blurY:5, strength:15, quality:1};
if (e == String(FIRST_HELICOPTER)){
if (Main.total_game_money >= FIRST_HELICOPTER){
sound_plater.play_cash_money();
normalheli = new MediumHelicopter();
heliSelected = normalheli;
buyButton1.removeEventListener(MouseEvent.CLICK, buy_the_helicopter);
removeChild(buyButton1);
last_object_selected[0] = FIRST_HELICOPTER;
last_object_selected[1] = buyButton1.x;
money_expended.text = ("$" + String(-(FIRST_HELICOPTER)));
money_expended.y = 275;
money_expended.x = 550;
money_expended.setTextStyle(optionsBonus);
money_expended.addTextEfect(efect);
addChild(money_expended);
TweenMax.to(money_expended, 2, {alpha:0, y:220, ease:Back.easeOut});
Main.total_game_money = (Main.total_game_money - FIRST_HELICOPTER);
local_data.data.gameMoney = Main.total_game_money;
money.text = ("$" + String(Main.total_game_money));
money.setTextStyle(optionsBonus_money);
money.addTextEfect(efect_money);
TweenMax.to(square, 1, {x:x_position});
TweenMax.to(square, 1, {blurFilter:{blurX:12, remove:true}});
ventas[0] = 1;
local_data.data.helicopters = ventas;
};
};
if (e == String(SECON_HELICOPTER)){
if (Main.total_game_money >= SECON_HELICOPTER){
sound_plater.play_cash_money();
bigheli = new BigHelicopter();
heliSelected = bigheli;
buyButton2.removeEventListener(MouseEvent.CLICK, buy_the_helicopter);
removeChild(buyButton2);
last_object_selected[0] = SECON_HELICOPTER;
last_object_selected[1] = buyButton2.x;
money_expended.text = ("$" + String(-(SECON_HELICOPTER)));
money_expended.y = 275;
money_expended.x = 550;
money_expended.setTextStyle(optionsBonus);
money_expended.addTextEfect(efect);
addChild(money_expended);
TweenMax.to(money_expended, 2, {alpha:0, y:220, ease:Back.easeOut});
Main.total_game_money = (Main.total_game_money - SECON_HELICOPTER);
local_data.data.gameMoney = Main.total_game_money;
money.text = ("$" + String(Main.total_game_money));
money.setTextStyle(optionsBonus_money);
money.addTextEfect(efect_money);
TweenMax.to(square, 1, {x:x_position});
TweenMax.to(square, 1, {blurFilter:{blurX:12, remove:true}});
ventas[1] = 1;
local_data.data.helicopters = ventas;
};
};
if (e == String(THIRDTH_HELICOPTER)){
if (Main.total_game_money >= THIRDTH_HELICOPTER){
sound_plater.play_cash_money();
cheenoock = new ChinookHelicopter();
heliSelected = cheenoock;
buyButton3.removeEventListener(MouseEvent.CLICK, buy_the_helicopter);
removeChild(buyButton3);
last_object_selected[0] = THIRDTH_HELICOPTER;
last_object_selected[1] = buyButton3.x;
money_expended.text = ("$" + String(-(THIRDTH_HELICOPTER)));
money_expended.y = 275;
money_expended.x = 550;
money_expended.setTextStyle(optionsBonus);
money_expended.addTextEfect(efect);
addChild(money_expended);
TweenMax.to(money_expended, 2, {alpha:0, y:220, ease:Back.easeOut});
Main.total_game_money = (Main.total_game_money - THIRDTH_HELICOPTER);
local_data.data.gameMoney = Main.total_game_money;
money.text = ("$" + String(Main.total_game_money));
money.setTextStyle(optionsBonus_money);
money.addTextEfect(efect_money);
TweenMax.to(square, 1, {x:x_position});
TweenMax.to(square, 1, {blurFilter:{blurX:12, remove:true}});
ventas[2] = 1;
local_data.data.helicopters = ventas;
};
};
};
var selector:Function = function (e:String, X_pos:int):void{
var _local3:SmallHelicopter;
var _local4:MediumHelicopter;
var _local5:BigHelicopter;
var _local6:ChinookHelicopter;
last_object_selected[0] = e;
last_object_selected[1] = X_pos;
switch (e){
case FIRST_NAME:
_local3 = new SmallHelicopter();
heliSelected = _local3;
break;
case SECOND_NAME:
_local4 = new MediumHelicopter();
heliSelected = _local4;
break;
case THIRDTH_NAME:
_local5 = new BigHelicopter();
heliSelected = _local5;
break;
case FOURTH_NAME:
_local6 = new ChinookHelicopter();
heliSelected = _local6;
break;
};
TweenMax.to(square, 1, {x:X_pos});
};
var back:BackgroundLevelSelection = new BackgroundLevelSelection();
addChild(back);
if (local_data.data.helicopters){
ventas = local_data.data.helicopters;
} else {
ventas = [0, 0, 0];
local_data.data.helicopters = ventas;
};
money.text = ("$" + String(Main.total_game_money));
money.y = 275;
money.x = 550;
money.setTextStyle(optionsBonus_money);
money.addTextEfect(efect_money);
addChild(money);
sound_plater.playLevel_Selection_Music();
X_POS = 50;
Y_Pos = 48;
switch (Main.current_level){
case 1:
firstButton();
locked();
locked();
locked();
locked();
locked();
locked();
locked();
locked();
locked();
Main.current_level = 1;
cookies();
break;
case 2:
firstButton();
secondButton();
locked();
locked();
locked();
locked();
locked();
locked();
locked();
locked();
Main.current_level = 2;
cookies();
break;
case 3:
firstButton();
secondButton();
thirdButton();
locked();
locked();
locked();
locked();
locked();
locked();
locked();
Main.current_level = 3;
cookies();
break;
case 4:
firstButton();
secondButton();
thirdButton();
fourthButton();
locked();
locked();
locked();
locked();
locked();
locked();
Main.current_level = 4;
cookies();
break;
case 5:
firstButton();
secondButton();
thirdButton();
fourthButton();
fifthhButton();
locked();
locked();
locked();
locked();
locked();
Main.current_level = 5;
cookies();
break;
case 6:
firstButton();
secondButton();
thirdButton();
fourthButton();
fifthhButton();
sixthButton();
locked();
locked();
locked();
locked();
Main.current_level = 6;
cookies();
break;
case 7:
firstButton();
secondButton();
thirdButton();
fourthButton();
fifthhButton();
sixthButton();
seventhButton();
locked();
locked();
locked();
Main.current_level = 7;
cookies();
break;
case 8:
firstButton();
secondButton();
thirdButton();
fourthButton();
fifthhButton();
sixthButton();
seventhButton();
eightButton();
locked();
locked();
Main.current_level = 8;
cookies();
break;
case 9:
firstButton();
secondButton();
thirdButton();
fourthButton();
fifthhButton();
sixthButton();
seventhButton();
eightButton();
ninethButton();
locked();
Main.current_level = 9;
cookies();
break;
case 10:
firstButton();
secondButton();
thirdButton();
fourthButton();
fifthhButton();
sixthButton();
seventhButton();
eightButton();
ninethButton();
tenButton();
Main.current_level = 10;
cookies();
break;
};
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var go_to_menu:GameButton = new GameButton({y:3, width:100, height:25, texto:"Go Back", size:13, skins:new InGameButtonResource(), objectColor:colors});
this.addChild(go_to_menu);
go_to_menu.x = 0;
go_to_menu.y = 0;
go_to_menu.addEventListener(MouseEvent.CLICK, go_back, false, 0, true);
var SEPARACION = 7;
FIRST_NAME = "Thunder";
SECOND_NAME = "Big Mama";
THIRDTH_NAME = "Dolphin";
FOURTH_NAME = "Chinook";
colors = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var hely1:GameButton = new GameButton({y:71, width:150, height:25, texto:FIRST_NAME, size:18, skins:new LevelSelectionFirstHeli(), objectColor:colors});
addChild(hely1);
hely1.x = 9;
hely1.y = 315;
hely1.addEventListener(MouseEvent.CLICK, selectHely1);
var hely2:GameButton = new GameButton({y:71, width:150, height:25, texto:SECOND_NAME, size:18, skins:new LevelSelectionSecondtHeli(), objectColor:colors});
addChild(hely2);
hely2.x = ((hely1.x + hely1.width) + SEPARACION);
hely2.y = hely1.y;
hely2.addEventListener(MouseEvent.CLICK, selectHely2);
var hely3:GameButton = new GameButton({y:71, width:150, height:25, texto:THIRDTH_NAME, size:18, skins:new LevelSelectionThirdthHeli(), objectColor:colors});
addChild(hely3);
hely3.x = ((hely2.x + hely2.width) + SEPARACION);
hely3.y = hely1.y;
hely3.addEventListener(MouseEvent.CLICK, selectHely3);
var hely4:GameButton = new GameButton({y:71, width:150, height:25, texto:FOURTH_NAME, size:18, skins:new LevelSelectionFourthHeli(), objectColor:colors});
addChild(hely4);
hely4.x = ((hely3.x + hely3.width) + SEPARACION);
hely4.y = hely1.y;
hely4.addEventListener(MouseEvent.CLICK, selectHely4);
FIRST_HELICOPTER = 5000;
SECON_HELICOPTER = 10000;
THIRDTH_HELICOPTER = 15000;
colors = {colorIn:0, colorOut:0xE8E800, colorInOver:0, colorOutOver:0xE8E800, colorInOverDown:0xE8E800, colorOutOverDown:0xE8E800};
if (ventas[0] == 0){
buyButton1 = new GameButton({y:71, width:150, height:25, texto:String(FIRST_HELICOPTER), size:18, skins:new LevelSelectionSecondtHeli_NotSolded(), objectColor:colors});
addChild(buyButton1);
buyButton1.x = hely2.x;
buyButton1.y = hely2.y;
buyButton1.addEventListener(MouseEvent.CLICK, buy_the_helicopter);
};
if (ventas[1] == 0){
buyButton2 = new GameButton({y:71, width:150, height:25, texto:String(SECON_HELICOPTER), size:18, skins:new LevelSelectionThirdHeli_NotSolded(), objectColor:colors});
addChild(buyButton2);
buyButton2.x = hely3.x;
buyButton2.y = hely3.y;
buyButton2.addEventListener(MouseEvent.CLICK, buy_the_helicopter);
};
if (ventas[2] == 0){
buyButton3 = new GameButton({y:71, width:150, height:25, texto:String(THIRDTH_HELICOPTER), size:18, skins:new LevelSelectionFourthHeli_NotSolded(), objectColor:colors});
addChild(buyButton3);
buyButton3.x = hely4.x;
buyButton3.y = hely4.y;
buyButton3.addEventListener(MouseEvent.CLICK, buy_the_helicopter);
};
square = new Shape();
addChild(square);
square.graphics.lineStyle(6, 0xFF0000);
square.graphics.drawRect(0, 0, hely1.width, hely1.height);
square.graphics.endFill();
square.x = hely1.x;
square.y = hely1.y;
if (!heliSelected){
heliSelected = new SmallHelicopter();
trace(heliSelected);
last_object_selected[0] = FIRST_NAME;
last_object_selected[1] = hely1.x;
};
selector(last_object_selected[0], last_object_selected[1]);
}
private function startLevel4(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level4 = new Level4();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 4;
}
private function startLevel5(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level5 = new Level5();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 5;
}
private function startLevel8(e:MouseEvent):void{
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
sound_plater.stopLevelMusic();
sound_plater.playLevelMusic();
var level:Level8 = new Level8();
last_level = level;
addChild(level);
level.init({helicopter:heliSelected, levelSelectionStage:vars.stg});
level.levelSelection = this;
Main.last_played_level = 8;
}
}
}//package Clases.Game.LevelSelection
Section 212
//LevelSelectionSecondtHeli (Clases.Game.LevelSelection.LevelSelectionSecondtHeli)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionSecondtHeli {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionSecondtHeli(){
UP_bitmap = LevelSelectionSecondtHeli_UP_bitmap;
OVER_bitmap = LevelSelectionSecondtHeli_OVER_bitmap;
DOWN_bitmap = LevelSelectionSecondtHeli_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 213
//LevelSelectionSecondtHeli_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionSecondtHeli_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionSecondtHeli_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 214
//LevelSelectionSecondtHeli_NotSolded (Clases.Game.LevelSelection.LevelSelectionSecondtHeli_NotSolded)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionSecondtHeli_NotSolded {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionSecondtHeli_NotSolded(){
UP_bitmap = LevelSelectionSecondtHeli_NotSolded_UP_bitmap;
OVER_bitmap = LevelSelectionSecondtHeli_NotSolded_OVER_bitmap;
DOWN_bitmap = LevelSelectionSecondtHeli_NotSolded_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 215
//LevelSelectionSecondtHeli_NotSolded_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionSecondtHeli_NotSolded_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionSecondtHeli_NotSolded_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 216
//LevelSelectionSecondtHeli_NotSolded_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionSecondtHeli_NotSolded_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionSecondtHeli_NotSolded_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 217
//LevelSelectionSecondtHeli_NotSolded_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionSecondtHeli_NotSolded_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionSecondtHeli_NotSolded_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 218
//LevelSelectionSecondtHeli_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionSecondtHeli_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionSecondtHeli_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 219
//LevelSelectionSecondtHeli_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionSecondtHeli_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionSecondtHeli_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 220
//LevelSelectionThirdHeli_NotSolded (Clases.Game.LevelSelection.LevelSelectionThirdHeli_NotSolded)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionThirdHeli_NotSolded {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionThirdHeli_NotSolded(){
UP_bitmap = LevelSelectionThirdHeli_NotSolded_UP_bitmap;
OVER_bitmap = LevelSelectionThirdHeli_NotSolded_OVER_bitmap;
DOWN_bitmap = LevelSelectionThirdHeli_NotSolded_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 221
//LevelSelectionThirdHeli_NotSolded_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionThirdHeli_NotSolded_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionThirdHeli_NotSolded_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 222
//LevelSelectionThirdHeli_NotSolded_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionThirdHeli_NotSolded_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionThirdHeli_NotSolded_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 223
//LevelSelectionThirdHeli_NotSolded_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionThirdHeli_NotSolded_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionThirdHeli_NotSolded_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 224
//LevelSelectionThirdthHeli (Clases.Game.LevelSelection.LevelSelectionThirdthHeli)
package Clases.Game.LevelSelection {
import flash.display.*;
public class LevelSelectionThirdthHeli {
private const UP_bitmap:Class;
private const OVER_bitmap:Class;
private const DOWN_bitmap:Class;
public function LevelSelectionThirdthHeli(){
UP_bitmap = LevelSelectionThirdthHeli_UP_bitmap;
OVER_bitmap = LevelSelectionThirdthHeli_OVER_bitmap;
DOWN_bitmap = LevelSelectionThirdthHeli_DOWN_bitmap;
super();
}
public function createDownBitmap():Bitmap{
var skin:Bitmap = (new DOWN_bitmap() as Bitmap);
return (skin);
}
public function createUpBitmap():Bitmap{
var skin:Bitmap = (new UP_bitmap() as Bitmap);
return (skin);
}
public function createOverBitmap():Bitmap{
var skin:Bitmap = (new OVER_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.LevelSelection
Section 225
//LevelSelectionThirdthHeli_DOWN_bitmap (Clases.Game.LevelSelection.LevelSelectionThirdthHeli_DOWN_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionThirdthHeli_DOWN_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 226
//LevelSelectionThirdthHeli_OVER_bitmap (Clases.Game.LevelSelection.LevelSelectionThirdthHeli_OVER_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionThirdthHeli_OVER_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 227
//LevelSelectionThirdthHeli_UP_bitmap (Clases.Game.LevelSelection.LevelSelectionThirdthHeli_UP_bitmap)
package Clases.Game.LevelSelection {
import mx.core.*;
public class LevelSelectionThirdthHeli_UP_bitmap extends BitmapAsset {
}
}//package Clases.Game.LevelSelection
Section 228
//HelyExplocion (Clases.Game.SFX.HelyExplocion)
package Clases.Game.SFX {
import flash.display.*;
import flash.geom.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class HelyExplocion extends Sprite {
private var emitter:Emitter2D;
public function HelyExplocion():void{
emitter = new Emitter2D();
super();
addParticle_efects();
}
public function start_efect():void{
emitter.start();
}
private function addParticle_efects():void{
emitter.counter = new Blast(75);
emitter.addInitializer(new ImageClass(Skull));
emitter.addInitializer(new Velocity(new DiscZone(new Point(0, 0), 50, 1)));
emitter.addInitializer(new Lifetime(5));
emitter.addInitializer(new ScaleImageInit(0.75, 1.25));
emitter.addAction(new Age());
emitter.addAction(new Move());
emitter.addAction(new Fade());
emitter.addAction(new RotateToDirection());
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
renderer.addEmitter(emitter);
addChild(renderer);
}
}
}//package Clases.Game.SFX
Section 229
//SFXResource (Clases.Game.SFX.SFXResource)
package Clases.Game.SFX {
import flash.display.*;
public class SFXResource {
private const Wind_Beta_bitmap:Class;
private const Wind_Alpa_bitmap:Class;
private const Skull_bitmap:Class;
private const star_bitmap:Class;
public function SFXResource(){
star_bitmap = SFXResource_star_bitmap;
Wind_Alpa_bitmap = SFXResource_Wind_Alpa_bitmap;
Wind_Beta_bitmap = SFXResource_Wind_Beta_bitmap;
Skull_bitmap = SFXResource_Skull_bitmap;
super();
}
public function create_wind_Beta_particle():Bitmap{
var skin:Bitmap = (new Wind_Beta_bitmap() as Bitmap);
return (skin);
}
public function create_skull_particle():Bitmap{
var skin:Bitmap = (new Skull_bitmap() as Bitmap);
return (skin);
}
public function create_star():Bitmap{
var skin:Bitmap = (new star_bitmap() as Bitmap);
return (skin);
}
public function create_wind_Alpha_particle():Bitmap{
var skin:Bitmap = (new Wind_Alpa_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.SFX
Section 230
//SFXResource_Skull_bitmap (Clases.Game.SFX.SFXResource_Skull_bitmap)
package Clases.Game.SFX {
import mx.core.*;
public class SFXResource_Skull_bitmap extends BitmapAsset {
}
}//package Clases.Game.SFX
Section 231
//SFXResource_star_bitmap (Clases.Game.SFX.SFXResource_star_bitmap)
package Clases.Game.SFX {
import mx.core.*;
public class SFXResource_star_bitmap extends BitmapAsset {
}
}//package Clases.Game.SFX
Section 232
//SFXResource_Wind_Alpa_bitmap (Clases.Game.SFX.SFXResource_Wind_Alpa_bitmap)
package Clases.Game.SFX {
import mx.core.*;
public class SFXResource_Wind_Alpa_bitmap extends BitmapAsset {
}
}//package Clases.Game.SFX
Section 233
//SFXResource_Wind_Beta_bitmap (Clases.Game.SFX.SFXResource_Wind_Beta_bitmap)
package Clases.Game.SFX {
import mx.core.*;
public class SFXResource_Wind_Beta_bitmap extends BitmapAsset {
}
}//package Clases.Game.SFX
Section 234
//Skull (Clases.Game.SFX.Skull)
package Clases.Game.SFX {
import flash.display.*;
public class Skull extends Sprite {
public function Skull(){
super();
var recursos:SFXResource = new SFXResource();
var skin:Bitmap = recursos.create_skull_particle();
addChild(skin);
skin.smoothing = true;
}
}
}//package Clases.Game.SFX
Section 235
//Star (Clases.Game.SFX.Star)
package Clases.Game.SFX {
import flash.display.*;
public class Star extends Sprite {
public function Star(){
super();
var recursos:SFXResource = new SFXResource();
var skin:Bitmap = recursos.create_star();
addChild(skin);
skin.smoothing = true;
}
}
}//package Clases.Game.SFX
Section 236
//StarParticleEfects (Clases.Game.SFX.StarParticleEfects)
package Clases.Game.SFX {
import flash.display.*;
import flash.geom.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class StarParticleEfects extends Sprite {
private var emitter:Emitter2D;
public function StarParticleEfects(){
emitter = new Emitter2D();
super();
}
public function start_efect():void{
emitter.start();
}
public function addParticle_efects(x:Number, y:Number):void{
emitter.counter = new Blast(75);
emitter.addInitializer(new ImageClass(Star));
emitter.addInitializer(new Velocity(new DiscZone(new Point(0, 0), 100, 1)));
emitter.addInitializer(new Lifetime(2));
emitter.addInitializer(new ScaleImageInit(0.25, 1));
emitter.addAction(new Age());
emitter.addAction(new Move());
emitter.addAction(new Fade());
emitter.addAction(new ColorChange(268435455, 4292730112));
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
renderer.addEmitter(emitter);
addChild(renderer);
emitter.x = (emitter.x + x);
emitter.y = (emitter.y + y);
}
}
}//package Clases.Game.SFX
Section 237
//WindAlpha (Clases.Game.SFX.WindAlpha)
package Clases.Game.SFX {
import flash.display.*;
public class WindAlpha extends Sprite {
public function WindAlpha(){
super();
var recursos:SFXResource = new SFXResource();
var skin:Bitmap = recursos.create_wind_Alpha_particle();
addChild(skin);
skin.smoothing = true;
}
}
}//package Clases.Game.SFX
Section 238
//WindBeta (Clases.Game.SFX.WindBeta)
package Clases.Game.SFX {
import flash.display.*;
public class WindBeta extends Sprite {
public function WindBeta(){
super();
var recursos:SFXResource = new SFXResource();
var skin:Bitmap = recursos.create_wind_Beta_particle();
addChild(skin);
skin.smoothing = true;
}
}
}//package Clases.Game.SFX
Section 239
//Compass (Clases.Game.System.Compass)
package Clases.Game.System {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import Clases.BasicEngine.*;
public class Compass extends Sprite {
private var torreta:Compass_Sprite;
private var vars:Object;
public function Compass(){
super();
}
public function init(v:Object=null):void{
vars = v;
torreta = new Compass_Sprite();
addChild(torreta);
torreta.x = 150;
torreta.y = 395;
addEventListener(Event.ENTER_FRAME, actualizarTorreta, false, 0, true);
}
private function actualizarTorreta(e:Event):void{
var radiansToDegrees:Number = (180 / Math.PI);
var degreesToRadians:Number = (Math.PI / 180);
var point:Point = new Point(((vars.positionX * PhisicBase.m_phys_scale) + parent.x), ((vars.positionY * PhisicBase.m_phys_scale) + parent.y));
this.localToGlobal(point);
var angle:Number = 0;
angle = Math.atan2((point.y - torreta.y), (point.x - torreta.x));
angle = (angle * radiansToDegrees);
torreta.rotation = (angle - 90);
}
}
}//package Clases.Game.System
Section 240
//Compass_Sprite (Clases.Game.System.Compass_Sprite)
package Clases.Game.System {
import flash.display.*;
public class Compass_Sprite extends Sprite {
private const Arrow_Bitmap:Class;
private var heli:Heli_animation;
private var skin:Bitmap;
public function Compass_Sprite(){
Arrow_Bitmap = Compass_Sprite_Arrow_Bitmap;
super();
skin = (new Arrow_Bitmap() as Bitmap);
addChild(skin);
skin.x = (skin.x - (skin.width / 2));
skin.y = (skin.y - (skin.height / 2));
skin.smoothing = true;
}
}
}//package Clases.Game.System
Section 241
//Compass_Sprite_Arrow_Bitmap (Clases.Game.System.Compass_Sprite_Arrow_Bitmap)
package Clases.Game.System {
import mx.core.*;
public class Compass_Sprite_Arrow_Bitmap extends BitmapAsset {
}
}//package Clases.Game.System
Section 242
//GUI (Clases.Game.System.GUI)
package Clases.Game.System {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import Clases.Game.LevelSelection.*;
import Clases.Text.*;
import Clases.Button.*;
import Clases.Font.*;
import Clases.BasicScreens.*;
public class GUI extends Sprite {
private var money:Text;
private var TOTAL_HULL:Number;
private var time:Text;
private var goal:Text;
private var efect:Object;
private var canto_of_objects:int;// = 0
private var optionsBonus:Object;
private var level_scr:LevelSelectionScreen;
private var energyBar:ProgressBar;
private var vars:Object;
private var TOTAL_FUEL:Number;
private var level_goal:int;// = 0
private var format:FontResources;
private var fuelBar:ProgressBar;
public function GUI(){
time = new Text();
format = new FontResources();
optionsBonus = {width:110, height:20, color:0xFFFFFF, isBold:true, size:15, customFont:format.getA_Font_For_The_Computer_People_Font(), align:TextFormatAlign.LEFT};
efect = {color:0x777777, alpha:1, blurX:5, blurY:5, strength:15, quality:1};
energyBar = new ProgressBar();
fuelBar = new ProgressBar();
money = new Text();
goal = new Text();
super();
}
public function destroy():void{
parent.removeChild(this);
}
public function addLevelSelectionScreen(a:LevelSelectionScreen):void{
level_scr = a;
}
public function fuel_cant_out_limit():Boolean{
if (fuelBar.bar_precent < 5){
return (true);
};
return (false);
}
private function generateGui():void{
var recursos:GUIResource = new GUIResource();
var pauseText:Text = new Text();
pauseText.text = "(P) Pause";
pauseText.y = 400;
pauseText.x = 595;
pauseText.setTextStyle(optionsBonus);
pauseText.addTextEfect(efect);
addChild(pauseText);
money.text = String(Main.total_game_money);
money.y = 3;
money.x = 580;
money.setTextStyle(optionsBonus);
money.addTextEfect(efect);
addChild(money);
goal.text = "Goal";
goal.y = ((money.y + money.height) + 1);
goal.x = money.x;
goal.setTextStyle(optionsBonus);
goal.addTextEfect(efect);
addChild(goal);
var skinsBar:ProgressSkinBar = new ProgressSkinBar();
var fuelIcon:Bitmap = recursos.create_Fuel_Icon();
addChild(fuelIcon);
var hullIcon:Bitmap = recursos.create_Hull_Icon();
addChild(hullIcon);
addChild(energyBar);
energyBar.init({skin:skinsBar.creteSkinForEnergy(), color:0x8000});
energyBar.actualizar(100);
energyBar.y = 8;
energyBar.x = 33;
addChild(fuelBar);
fuelBar.init({skin:skinsBar.creteSkinForFuelBar(), color:14382340});
fuelBar.y = 8;
fuelBar.x = 204;
fuelIcon.x = ((energyBar.x + energyBar.width) + 10);
fuelIcon.y = -3;
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var go_to_menu:GameButton = new GameButton({y:3, width:100, height:25, texto:"Menu", size:13, skins:new InGameButtonResource(), objectColor:colors});
this.addChild(go_to_menu);
go_to_menu.x = 0;
go_to_menu.y = 395;
go_to_menu.addEventListener(MouseEvent.CLICK, function_go_to_menu, false, 0, true);
var buttonSound:SounOnOf = new SounOnOf();
addChild(buttonSound);
buttonSound.x = 628;
buttonSound.y = 379;
buttonSound.car = vars.currentVeicle;
}
public function addCompas(x:Number, y:Number):void{
var compass:Compass = new Compass();
addChild(compass);
compass.init({positionX:x, positionY:y});
}
private function function_go_to_menu(e:MouseEvent):void{
level_scr.restart_function();
}
public function actualize_Fuel_Progress_Bar(fuel:Number):void{
fuelBar.actualizar(((fuel * 100) / TOTAL_FUEL));
}
public function init(v:Object=null):void{
vars = v;
generateGui();
}
public function get monet_text():Text{
return (money);
}
public function addHeliVars(fuelCapacity:Number, HullCapacity:Number):void{
TOTAL_FUEL = fuelCapacity;
TOTAL_HULL = HullCapacity;
}
public function actualize_Hud_Progress_Bar(hull:Number):void{
energyBar.actualizar(((hull * 100) / TOTAL_HULL));
}
public function hull_cant_out_limit():Boolean{
if (energyBar.bar_precent < 5){
return (true);
};
return (false);
}
public function set energyCant(hull:Number):void{
energyBar.actualizar(((hull * 100) / TOTAL_HULL));
}
public function set fuelCant(fuel:Number):void{
fuelBar.actualizar(((fuel * 100) / TOTAL_FUEL));
}
public function actualizar_money():void{
money.text = String(Main.total_game_money);
money.setTextStyle(optionsBonus);
}
public function object_donloaded():void{
canto_of_objects++;
goal.text = ((("Goal " + String(canto_of_objects)) + "/") + String(level_goal));
goal.setTextStyle(optionsBonus);
goal.addTextEfect(efect);
}
public function bringToFront():void{
parent.setChildIndex(this, (parent.numChildren - 1));
}
public function set cant_objecjt_to_goal(a:int):void{
level_goal = a;
goal.text = ((("Goal " + String(canto_of_objects)) + "/") + String(level_goal));
goal.setTextStyle(optionsBonus);
goal.addTextEfect(efect);
}
}
}//package Clases.Game.System
Section 243
//GUIResource (Clases.Game.System.GUIResource)
package Clases.Game.System {
import flash.display.*;
public class GUIResource {
private const Hull_Bitmap:Class;
private const Fuel_Bitmap:Class;
public function GUIResource(){
Hull_Bitmap = GUIResource_Hull_Bitmap;
Fuel_Bitmap = GUIResource_Fuel_Bitmap;
super();
}
public function create_Fuel_Icon():Bitmap{
var skin:Bitmap = (new Fuel_Bitmap() as Bitmap);
return (skin);
}
public function create_Hull_Icon():Bitmap{
var skin:Bitmap = (new Hull_Bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.System
Section 244
//GUIResource_Fuel_Bitmap (Clases.Game.System.GUIResource_Fuel_Bitmap)
package Clases.Game.System {
import mx.core.*;
public class GUIResource_Fuel_Bitmap extends BitmapAsset {
}
}//package Clases.Game.System
Section 245
//GUIResource_Hull_Bitmap (Clases.Game.System.GUIResource_Hull_Bitmap)
package Clases.Game.System {
import mx.core.*;
public class GUIResource_Hull_Bitmap extends BitmapAsset {
}
}//package Clases.Game.System
Section 246
//ProgressBar (Clases.Game.System.ProgressBar)
package Clases.Game.System {
import flash.display.*;
public class ProgressBar extends Sprite {
private const PRELOADER_PRECEMT_START:int = 1;
private const PRELOADER_COLOR:int = 0xFFFFFF;
private var frontSkinPreloader:Bitmap;
private var preloaderInside:Shape;
private var vars:Object;
private var total_precent:Number;
public function ProgressBar(){
super();
}
public function actualizar(percent:Number):void{
if ((percent / 100) <= 1){
preloaderInside.graphics.clear();
preloaderInside.graphics.beginFill(vars.color);
preloaderInside.graphics.drawRoundRect(0, 0, (frontSkinPreloader.width * (percent / 100)), frontSkinPreloader.height, 15, 15);
preloaderInside.graphics.endFill();
};
total_precent = percent;
}
public function get bar_precent():Number{
return (total_precent);
}
private function generate():void{
frontSkinPreloader = vars.skin;
preloaderInside = new Shape();
addChild(preloaderInside);
addChild(frontSkinPreloader);
frontSkinPreloader.smoothing = true;
preloaderInside.graphics.beginFill(vars.color);
preloaderInside.graphics.drawRoundRect(0, 0, frontSkinPreloader.width, frontSkinPreloader.height, 15, 15);
preloaderInside.graphics.endFill();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
}
}//package Clases.Game.System
Section 247
//ProgressSkinBar (Clases.Game.System.ProgressSkinBar)
package Clases.Game.System {
import flash.display.*;
public class ProgressSkinBar {
private const progEnergyBarBitmap:Class;
private const progFuelBarBitmap:Class;
public function ProgressSkinBar(){
progEnergyBarBitmap = ProgressSkinBar_progEnergyBarBitmap;
progFuelBarBitmap = ProgressSkinBar_progFuelBarBitmap;
super();
}
public function creteSkinForFuelBar():Bitmap{
var skin:Bitmap = (new progFuelBarBitmap() as Bitmap);
return (skin);
}
public function creteSkinForEnergy():Bitmap{
var skin:Bitmap = (new progEnergyBarBitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.System
Section 248
//ProgressSkinBar_progEnergyBarBitmap (Clases.Game.System.ProgressSkinBar_progEnergyBarBitmap)
package Clases.Game.System {
import mx.core.*;
public class ProgressSkinBar_progEnergyBarBitmap extends BitmapAsset {
}
}//package Clases.Game.System
Section 249
//ProgressSkinBar_progFuelBarBitmap (Clases.Game.System.ProgressSkinBar_progFuelBarBitmap)
package Clases.Game.System {
import mx.core.*;
public class ProgressSkinBar_progFuelBarBitmap extends BitmapAsset {
}
}//package Clases.Game.System
Section 250
//FirstHoockStyle (Clases.Game.Veicle.RopeStiles.FirstHoockStyle)
package Clases.Game.Veicle.RopeStiles {
import flash.display.*;
public class FirstHoockStyle extends Sprite {
private var recursos:RopeResource;
public function FirstHoockStyle(){
recursos = new RopeResource();
super();
var skin:Bitmap = recursos.rope_first_Style_hoock();
skin.x = (skin.x - ((skin.width / 2) + 6));
skin.y = (skin.y - ((skin.height / 2) - 10));
skin.smoothing = true;
addChild(skin);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 251
//FirstRope (Clases.Game.Veicle.RopeStiles.FirstRope)
package Clases.Game.Veicle.RopeStiles {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class FirstRope extends Rope {
private var style:Object;
private var hook:b2Body;
private var building:b2Body;
private var vars:Object;
public function FirstRope(){
super();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function generate():void{
var dJointDef:b2DistanceJointDef;
var arrBodyList:Array = new Array();
var pos_Init_X:Number = vars.hely.GetWorldCenter().x;
var pos_Init_Y:Number = vars.hely.GetWorldCenter().y;
hook = null;
var i:int;
while (i < 7) {
baseChain(pos_Init_X, pos_Init_Y, vars.world, new RopeFirstStyle(), new FirstHoockStyle(), i);
i++;
};
dJointDef = new b2DistanceJointDef();
dJointDef.Initialize(vars.hely, lastBody, new b2Vec2(vars.hely.GetWorldCenter().x, lastBody.GetWorldCenter().y), lastBody.GetWorldCenter());
dJointDef.dampingRatio = 30;
dJointDef.frequencyHz = 50;
dJointDef.collideConnected = true;
vars.world.CreateJoint(dJointDef);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 252
//FourthRope (Clases.Game.Veicle.RopeStiles.FourthRope)
package Clases.Game.Veicle.RopeStiles {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class FourthRope extends Rope {
private var style:Object;
private var hook:b2Body;
private var building:b2Body;
private var vars:Object;
public function FourthRope(){
super();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function generate():void{
var dJointDef:b2DistanceJointDef;
var arrBodyList:Array = new Array();
var pos_Init_X:Number = vars.hely.GetWorldCenter().x;
var pos_Init_Y:Number = vars.hely.GetWorldCenter().y;
hook = null;
var i:int;
while (i < 7) {
baseChain(pos_Init_X, pos_Init_Y, vars.world, new RopeFourthStyle(), new FirstHoockStyle(), i);
i++;
};
dJointDef = new b2DistanceJointDef();
dJointDef.Initialize(vars.hely, lastBody, new b2Vec2(vars.hely.GetWorldCenter().x, lastBody.GetWorldCenter().y), lastBody.GetWorldCenter());
dJointDef.dampingRatio = 0;
dJointDef.frequencyHz = 10000;
dJointDef.collideConnected = true;
vars.world.CreateJoint(dJointDef);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 253
//Rope (Clases.Game.Veicle.RopeStiles.Rope)
package Clases.Game.Veicle.RopeStiles {
import flash.display.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class Rope extends Sprite {
private var hook:b2Body;
private var vars:Object;
private var style:Object;
private var building:b2Body;
protected var lastBody:b2Body;// = null
public function Rope(){
super();
}
public function baseChain(x:Number, y:Number, w:b2World, style_of_chain:Sprite, style_of_hoock:Sprite, indice:int):void{
var bodyDef:b2BodyDef;
var newBody:b2Body;
var polygonDef:b2PolygonDef;
var dJointDef:b2DistanceJointDef;
bodyDef = new b2BodyDef();
bodyDef.position = new b2Vec2(((x + (indice * 0.5)) - 2.5), y);
bodyDef.angle = 0;
bodyDef.isBullet = true;
bodyDef.linearDamping = 1;
bodyDef.angularDamping = 1;
if (indice == 0){
bodyDef.position = new b2Vec2((x - 2.35), y);
bodyDef.userData = style_of_hoock;
addChild(bodyDef.userData);
newBody = w.CreateBody(bodyDef);
polygonDef = new b2PolygonDef();
polygonDef.friction = 0.2;
polygonDef.restitution = 0;
polygonDef.density = 0.001;
polygonDef.filter.groupIndex = -1;
polygonDef.SetAsOrientedBox(0.3, 0.05, new b2Vec2(-0.2, 0.1), 0);
newBody.CreateShape(polygonDef);
polygonDef.SetAsOrientedBox(0.05, 0.2, new b2Vec2(-0.55, 0.4), 0);
newBody.CreateShape(polygonDef);
polygonDef.SetAsOrientedBox(0.2, 0.05, new b2Vec2(-0.3, 0.6), 0);
newBody.CreateShape(polygonDef);
hook = newBody;
} else {
polygonDef = new b2PolygonDef();
polygonDef.vertexCount = 4;
polygonDef.vertices[0].Set(0.2, -0.05);
polygonDef.vertices[1].Set(0.2, 0.05);
polygonDef.vertices[2].Set(-0.2, 0.05);
polygonDef.vertices[3].Set(-0.2, -0.05);
polygonDef.friction = 0.2;
polygonDef.restitution = 0.4;
polygonDef.density = 0.01;
polygonDef.filter.groupIndex = -1;
bodyDef.userData = style_of_chain;
addChild(bodyDef.userData);
newBody = w.CreateBody(bodyDef);
newBody.CreateShape(polygonDef);
};
newBody.SetMassFromShapes();
if (lastBody){
if (indice == 1){
dJointDef = new b2DistanceJointDef();
dJointDef.Initialize(newBody, lastBody, new b2Vec2((newBody.GetWorldCenter().x - 0.2), newBody.GetWorldCenter().y), new b2Vec2((lastBody.GetWorldCenter().x + 0.5), (lastBody.GetWorldCenter().y - 0.2)));
dJointDef.dampingRatio = 0;
dJointDef.frequencyHz = 0;
w.CreateJoint(dJointDef);
} else {
dJointDef = new b2DistanceJointDef();
dJointDef.Initialize(newBody, lastBody, new b2Vec2((newBody.GetWorldCenter().x - 0.2), newBody.GetWorldCenter().y), new b2Vec2((lastBody.GetWorldCenter().x + 0.2), lastBody.GetWorldCenter().y));
dJointDef.dampingRatio = 0;
dJointDef.frequencyHz = 0;
w.CreateJoint(dJointDef);
};
};
lastBody = newBody;
}
public function get hoock_hely():b2Body{
return (hook);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 254
//RopeFirstStyle (Clases.Game.Veicle.RopeStiles.RopeFirstStyle)
package Clases.Game.Veicle.RopeStiles {
import flash.display.*;
public class RopeFirstStyle extends Sprite {
private var recursos:RopeResource;
public function RopeFirstStyle(){
recursos = new RopeResource();
super();
var skin:Bitmap = recursos.rope_first_Style();
skin.x = (skin.x - (skin.width / 2));
skin.y = (skin.y - (skin.height / 2));
skin.smoothing = true;
addChild(skin);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 255
//RopeFourthStyle (Clases.Game.Veicle.RopeStiles.RopeFourthStyle)
package Clases.Game.Veicle.RopeStiles {
import flash.display.*;
public class RopeFourthStyle extends Sprite {
private var recursos:RopeResource;
public function RopeFourthStyle(){
recursos = new RopeResource();
super();
var skin:Bitmap = recursos.rope_fourth_Style();
skin.x = (skin.x - (skin.width / 2));
skin.y = (skin.y - (skin.height / 2));
skin.smoothing = true;
addChild(skin);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 256
//RopeResource (Clases.Game.Veicle.RopeStiles.RopeResource)
package Clases.Game.Veicle.RopeStiles {
import flash.display.*;
public class RopeResource {
private const Rope_Thirdth_Style:Class;
private const Rope_Hoock_Style1:Class;
private const Rope_Second_Style:Class;
private const Rope_Fourth_Style:Class;
private const Rope_First_Style:Class;
public function RopeResource(){
Rope_First_Style = RopeResource_Rope_First_Style;
Rope_Second_Style = RopeResource_Rope_Second_Style;
Rope_Thirdth_Style = RopeResource_Rope_Thirdth_Style;
Rope_Fourth_Style = RopeResource_Rope_Fourth_Style;
Rope_Hoock_Style1 = RopeResource_Rope_Hoock_Style1;
super();
}
public function rope_fourth_Style():Bitmap{
var skin:Bitmap = (new Rope_Fourth_Style() as Bitmap);
return (skin);
}
public function rope_first_Style_hoock():Bitmap{
var skin:Bitmap = (new Rope_Hoock_Style1() as Bitmap);
return (skin);
}
public function rope_thirdth_Style():Bitmap{
var skin:Bitmap = (new Rope_Thirdth_Style() as Bitmap);
return (skin);
}
public function rope_first_Style():Bitmap{
var skin:Bitmap = (new Rope_First_Style() as Bitmap);
return (skin);
}
public function rope_second_Style():Bitmap{
var skin:Bitmap = (new Rope_Second_Style() as Bitmap);
return (skin);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 257
//RopeResource_Rope_First_Style (Clases.Game.Veicle.RopeStiles.RopeResource_Rope_First_Style)
package Clases.Game.Veicle.RopeStiles {
import mx.core.*;
public class RopeResource_Rope_First_Style extends BitmapAsset {
}
}//package Clases.Game.Veicle.RopeStiles
Section 258
//RopeResource_Rope_Fourth_Style (Clases.Game.Veicle.RopeStiles.RopeResource_Rope_Fourth_Style)
package Clases.Game.Veicle.RopeStiles {
import mx.core.*;
public class RopeResource_Rope_Fourth_Style extends BitmapAsset {
}
}//package Clases.Game.Veicle.RopeStiles
Section 259
//RopeResource_Rope_Hoock_Style1 (Clases.Game.Veicle.RopeStiles.RopeResource_Rope_Hoock_Style1)
package Clases.Game.Veicle.RopeStiles {
import mx.core.*;
public class RopeResource_Rope_Hoock_Style1 extends BitmapAsset {
}
}//package Clases.Game.Veicle.RopeStiles
Section 260
//RopeResource_Rope_Second_Style (Clases.Game.Veicle.RopeStiles.RopeResource_Rope_Second_Style)
package Clases.Game.Veicle.RopeStiles {
import mx.core.*;
public class RopeResource_Rope_Second_Style extends BitmapAsset {
}
}//package Clases.Game.Veicle.RopeStiles
Section 261
//RopeResource_Rope_Thirdth_Style (Clases.Game.Veicle.RopeStiles.RopeResource_Rope_Thirdth_Style)
package Clases.Game.Veicle.RopeStiles {
import mx.core.*;
public class RopeResource_Rope_Thirdth_Style extends BitmapAsset {
}
}//package Clases.Game.Veicle.RopeStiles
Section 262
//RopeSecondStyle (Clases.Game.Veicle.RopeStiles.RopeSecondStyle)
package Clases.Game.Veicle.RopeStiles {
import flash.display.*;
public class RopeSecondStyle extends Sprite {
private var recursos:RopeResource;
public function RopeSecondStyle(){
recursos = new RopeResource();
super();
var skin:Bitmap = recursos.rope_second_Style();
skin.x = (skin.x - (skin.width / 2));
skin.y = (skin.y - (skin.height / 2));
skin.smoothing = true;
addChild(skin);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 263
//RopeThirdthStyle (Clases.Game.Veicle.RopeStiles.RopeThirdthStyle)
package Clases.Game.Veicle.RopeStiles {
import flash.display.*;
public class RopeThirdthStyle extends Sprite {
private var recursos:RopeResource;
public function RopeThirdthStyle(){
recursos = new RopeResource();
super();
var skin:Bitmap = recursos.rope_thirdth_Style();
skin.x = (skin.x - (skin.width / 2));
skin.y = (skin.y - (skin.height / 2));
skin.smoothing = true;
addChild(skin);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 264
//SecondtRope (Clases.Game.Veicle.RopeStiles.SecondtRope)
package Clases.Game.Veicle.RopeStiles {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class SecondtRope extends Rope {
private var style:Object;
private var hook:b2Body;
private var building:b2Body;
private var vars:Object;
public function SecondtRope(){
super();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function generate():void{
var dJointDef:b2DistanceJointDef;
var arrBodyList:Array = new Array();
var pos_Init_X:Number = vars.hely.GetWorldCenter().x;
var pos_Init_Y:Number = vars.hely.GetWorldCenter().y;
hook = null;
var i:int;
while (i < 7) {
baseChain(pos_Init_X, pos_Init_Y, vars.world, new RopeSecondStyle(), new FirstHoockStyle(), i);
i++;
};
dJointDef = new b2DistanceJointDef();
dJointDef.Initialize(vars.hely, lastBody, new b2Vec2(vars.hely.GetWorldCenter().x, lastBody.GetWorldCenter().y), lastBody.GetWorldCenter());
dJointDef.dampingRatio = 0;
dJointDef.frequencyHz = 10000;
dJointDef.collideConnected = true;
vars.world.CreateJoint(dJointDef);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 265
//ThirdthRope (Clases.Game.Veicle.RopeStiles.ThirdthRope)
package Clases.Game.Veicle.RopeStiles {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
public class ThirdthRope extends Rope {
private var style:Object;
private var hook:b2Body;
private var building:b2Body;
private var vars:Object;
public function ThirdthRope(){
super();
}
public function init(v:Object=null):void{
vars = v;
generate();
}
private function generate():void{
var dJointDef:b2DistanceJointDef;
var arrBodyList:Array = new Array();
var pos_Init_X:Number = vars.hely.GetWorldCenter().x;
var pos_Init_Y:Number = vars.hely.GetWorldCenter().y;
hook = null;
var i:int;
while (i < 7) {
baseChain(pos_Init_X, pos_Init_Y, vars.world, new RopeThirdthStyle(), new FirstHoockStyle(), i);
i++;
};
dJointDef = new b2DistanceJointDef();
dJointDef.Initialize(vars.hely, lastBody, new b2Vec2(vars.hely.GetWorldCenter().x, lastBody.GetWorldCenter().y), lastBody.GetWorldCenter());
dJointDef.dampingRatio = 0;
dJointDef.frequencyHz = 10000;
dJointDef.collideConnected = true;
vars.world.CreateJoint(dJointDef);
}
}
}//package Clases.Game.Veicle.RopeStiles
Section 266
//BigHeliCabin (Clases.Game.Veicle.BigHeliCabin)
package Clases.Game.Veicle {
import flash.display.*;
import Clases.Game.SFX.*;
import gs.*;
public class BigHeliCabin extends Sprite {
private var heli:Heli_animation;
private var skin:Bitmap;
public function BigHeliCabin(){
super();
var recursos:HelicopterResource = new HelicopterResource();
heli = new Heli_animation();
skin = recursos.createBigHeliBitmap();
addChild(skin);
skin.x = (skin.x - ((skin.width / 2) + 25));
skin.y = (skin.y - ((skin.height / 2) + 40));
skin.smoothing = true;
heli.scaleX = 1.4;
addChild(heli);
heli.y = -73;
heli.x = -8;
}
public function explode_it():void{
var remove_cabin:Function;
remove_cabin = function ():void{
removeChild(heli);
removeChild(skin);
};
var explocion:HelyExplocion = new HelyExplocion();
addChild(explocion);
explocion.x = heli.x;
explocion.y = heli.y;
explocion.start_efect();
TweenMax.to(skin, 1, {alpha:0});
TweenMax.to(heli, 1, {alpha:0, onComplete:remove_cabin});
}
}
}//package Clases.Game.Veicle
Section 267
//BigHelicopter (Clases.Game.Veicle.BigHelicopter)
package Clases.Game.Veicle {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
import Clases.Game.Veicle.RopeStiles.*;
import Clases.Game.Common.*;
public class BigHelicopter extends Helicopter {
private const HULL_CAPACITY:int = 35;
private const FUEL_CAPACITY:int = 80000;
private var axle1:b2Body;
private var spring1:b2PrismaticJoint;
private var spring2:b2PrismaticJoint;
private var myWorld:b2World;
private var axle2:b2Body;
private var auxCabin:BigHeliCabin;
private var hull:Number;// = 35
private var helysounds:Hely_Sound;
private var motor1:b2RevoluteJoint;
private var motor2:b2RevoluteJoint;
private var cart:b2Body;
private var ENGINE_POWER:Number;// = 10
private var rope:ThirdthRope;
private var vars:Object;
private var wheel1:b2Body;
private var wheel2:b2Body;
private var fuel:int;// = 80000
public function BigHelicopter(){
helysounds = new Hely_Sound();
super();
}
public function remove_all_childs():void{
helysounds.stop_sound();
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
}
public function generateHelicopter(world:b2World, v:Object=null):void{
var body:b2Body;
var bodyDef:b2BodyDef;
var boxDef:b2PolygonDef;
var circleDef:b2CircleDef;
var revoluteJointDef:b2RevoluteJointDef;
var prismaticJointDef:b2PrismaticJointDef;
myWorld = world;
ENGINE_POWER = 0;
vars = v;
helysounds.play_thirdth_hely_sound();
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.H_Position[0], vars.H_Position[1]);
bodyDef.userData = new BigHeliCabin();
bodyDef.userData.x = -4000;
bodyDef.userData.y = -4000;
auxCabin = bodyDef.userData;
bodyDef.linearDamping = 0.5;
bodyDef.angularDamping = 1;
cart = world.CreateBody(bodyDef);
boxDef = new b2PolygonDef();
boxDef.density = 0.4;
boxDef.friction = 0.5;
boxDef.restitution = 0.3;
boxDef.SetAsOrientedBox(2.4, 0.1, new b2Vec2(-0.8, -1), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1, 0.25, new b2Vec2(0, -1.35), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.71, 0.15, new b2Vec2(-0.2, -1.75), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.31, 0.2, new b2Vec2(-0.1, -2.1), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.35, 0.2, new b2Vec2(-1.95, -0.5), (-(Math.PI) / 2));
boxDef.userData = "pies";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.35, 0.2, new b2Vec2(0.48, -0.5), (-(Math.PI) / 2));
boxDef.userData = "pies";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.45, 0.15, new b2Vec2(-2.9, -1.5), 1.2);
boxDef.userData = "cola";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(2.9, 0.05, new b2Vec2(-0.1, -2.4), 0);
boxDef.userData = "helice";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
cart.SetMassFromShapes();
boxDef.density = 0.001;
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.H_Position[0], vars.H_Position[1]);
vars.fuel = fuel;
vars.FUEL_CAPACITY = FUEL_CAPACITY;
vars.hull = hull;
vars.HULL_CAPACITY = HULL_CAPACITY;
super.generate_parent(vars, {hely:cart, gameStage:vars.levelStage, myGui:vars.mg});
rope = new ThirdthRope();
addChild(rope);
rope.init({world:world, hely:cart});
addChild(auxCabin);
}
public function remove_it():void{
helysounds.stop_sound();
auxCabin.explode_it();
myWorld.DestroyBody(cart);
}
public function update():void{
var energiConsumition:Number = 0;
var motorForceVector:b2Vec2 = cart.GetXForm().R.col2.Copy();
if (ENGINE_POWER < 0){
ENGINE_POWER = (ENGINE_POWER + 0.3);
};
if (ENGINE_POWER < -10){
ENGINE_POWER = (ENGINE_POWER + 2);
};
if (ENGINE_POWER > 0){
ENGINE_POWER = (ENGINE_POWER - 0.3);
};
if (ENGINE_POWER > 10){
ENGINE_POWER = (ENGINE_POWER - 2);
};
if (fuel >= 0){
ENGINE_POWER = (ENGINE_POWER + (super.arriba) ? -2 : (abajo) ? 0.1 : 0);
motorForceVector.Multiply(ENGINE_POWER);
cart.ApplyForce(motorForceVector, cart.GetWorldCenter());
cart.ApplyTorque((izquierda) ? -3 : (derecha) ? 3 : 0);
updateFuelConsumition(ENGINE_POWER);
};
}
public function get cabin():b2Vec2{
return (cart.GetWorldCenter());
}
}
}//package Clases.Game.Veicle
Section 268
//ChenookHeliCabin (Clases.Game.Veicle.ChenookHeliCabin)
package Clases.Game.Veicle {
import flash.display.*;
import Clases.Game.SFX.*;
import gs.*;
public class ChenookHeliCabin extends Sprite {
private var heli:Heli_animation;
private var heli_2:Heli_animation;
private var skin:Bitmap;
public function ChenookHeliCabin(){
super();
var recursos:HelicopterResource = new HelicopterResource();
skin = recursos.createCheenokHeliBitmap();
heli = new Heli_animation();
heli_2 = new Heli_animation();
addChild(skin);
skin.x = (skin.x - ((skin.width / 2) + 4));
skin.y = (skin.y - ((skin.height / 2) + 40));
skin.smoothing = true;
addChild(heli);
heli.scaleX = 0.8;
heli.y = -85;
heli.x = -50;
addChild(heli_2);
heli_2.scaleX = 0.8;
heli_2.y = -75;
heli_2.x = 25;
}
public function explode_it():void{
var remove_cabin:Function;
remove_cabin = function ():void{
removeChild(heli);
removeChild(skin);
removeChild(heli_2);
};
var explocion:HelyExplocion = new HelyExplocion();
addChild(explocion);
explocion.x = heli.x;
explocion.y = heli.y;
explocion.start_efect();
TweenMax.to(skin, 1, {alpha:0});
TweenMax.to(heli, 1, {alpha:0});
TweenMax.to(heli_2, 1, {alpha:0, onComplete:remove_cabin});
}
}
}//package Clases.Game.Veicle
Section 269
//ChinookHelicopter (Clases.Game.Veicle.ChinookHelicopter)
package Clases.Game.Veicle {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
import Clases.Game.Veicle.RopeStiles.*;
import Clases.Game.Common.*;
public class ChinookHelicopter extends Helicopter {
private const HULL_CAPACITY:int = 55;
private const FUEL_CAPACITY:int = 120000;
private var axle1:b2Body;
private var spring1:b2PrismaticJoint;
private var spring2:b2PrismaticJoint;
private var myWorld:b2World;
private var axle2:b2Body;
private var auxCabin:ChenookHeliCabin;
private var hull:Number;// = 55
private var helysounds:Hely_Sound;
private var motor1:b2RevoluteJoint;
private var motor2:b2RevoluteJoint;
private var cart:b2Body;
private var ENGINE_POWER:Number;// = 0
private var rope:FourthRope;
private var vars:Object;
private var wheel1:b2Body;
private var wheel2:b2Body;
private var fuel:int;// = 120000
public function ChinookHelicopter(){
helysounds = new Hely_Sound();
super();
}
public function remove_all_childs():void{
helysounds.stop_sound();
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
}
public function generateHelicopter(world:b2World, v:Object=null):void{
var body:b2Body;
var bodyDef:b2BodyDef;
var boxDef:b2PolygonDef;
var circleDef:b2CircleDef;
var revoluteJointDef:b2RevoluteJointDef;
var prismaticJointDef:b2PrismaticJointDef;
myWorld = world;
ENGINE_POWER = 0;
vars = v;
helysounds.play_fourth_hely_sound();
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.H_Position[0], vars.H_Position[1]);
bodyDef.userData = new ChenookHeliCabin();
bodyDef.userData.x = -4000;
bodyDef.userData.y = -4000;
auxCabin = bodyDef.userData;
bodyDef.linearDamping = 0.5;
bodyDef.angularDamping = 1;
cart = world.CreateBody(bodyDef);
boxDef = new b2PolygonDef();
boxDef.density = 0.5;
boxDef.friction = 0.5;
boxDef.restitution = 0.3;
boxDef.SetAsOrientedBox(1.7, 0.3, new b2Vec2(-0.2, -0.7), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1.6, 0.3, new b2Vec2(-0.4, -1.3), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.4, 0.2, new b2Vec2(-1.4, -1.8), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.4, 0.2, new b2Vec2(0.9, -1.8), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.1, 0.2, new b2Vec2(0.9, -2.2), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.1, 0.4, new b2Vec2(-1.65, -2.45), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.4, 0.2, new b2Vec2(-1.4, 0), (-(Math.PI) / 2));
boxDef.userData = "pies";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.4, 0.2, new b2Vec2(0.75, 0), (Math.PI / 2));
boxDef.userData = "pies";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1.7, 0.05, new b2Vec2(-1.55, -2.8), 0);
boxDef.userData = "helice";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1.7, 0.05, new b2Vec2(0.85, -2.5), 0);
boxDef.userData = "helice";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
cart.SetMassFromShapes();
boxDef.density = 0.001;
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.H_Position[0], vars.H_Position[1]);
vars.fuel = fuel;
vars.FUEL_CAPACITY = FUEL_CAPACITY;
vars.hull = hull;
vars.HULL_CAPACITY = HULL_CAPACITY;
super.generate_parent(vars, {hely:cart, gameStage:vars.levelStage, myGui:vars.mg});
rope = new FourthRope();
addChild(rope);
rope.init({world:world, hely:cart});
addChild(auxCabin);
}
public function remove_it():void{
helysounds.stop_sound();
auxCabin.explode_it();
myWorld.DestroyBody(cart);
}
public function update():void{
var energiConsumition:Number = 0;
var motorForceVector:b2Vec2 = cart.GetXForm().R.col2.Copy();
if (ENGINE_POWER < 0){
ENGINE_POWER = (ENGINE_POWER + 0.3);
};
if (ENGINE_POWER < -15){
ENGINE_POWER = (ENGINE_POWER + 2);
};
if (ENGINE_POWER > 0){
ENGINE_POWER = (ENGINE_POWER - 0.3);
};
if (ENGINE_POWER > -15){
ENGINE_POWER = (ENGINE_POWER - 2);
};
if (fuel >= 0){
ENGINE_POWER = (ENGINE_POWER + (super.arriba) ? -2 : (abajo) ? 0.1 : 0);
motorForceVector.Multiply(ENGINE_POWER);
cart.ApplyForce(motorForceVector, cart.GetWorldCenter());
cart.ApplyTorque((izquierda) ? -5 : (derecha) ? 5 : 0);
updateFuelConsumition(ENGINE_POWER);
};
}
public function get cabin():b2Vec2{
return (cart.GetWorldCenter());
}
}
}//package Clases.Game.Veicle
Section 270
//Helicopter (Clases.Game.Veicle.Helicopter)
package Clases.Game.Veicle {
import flash.events.*;
import flash.display.*;
import Box2D.Dynamics.*;
import Clases.Game.System.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
import Clases.BasicEngine.*;
public class Helicopter extends Sprite {
private var vars_bis:Object;
private var auxCabin:Sprite;
protected var shot_rope:Boolean;// = false
private var cart:b2Body;
private var FUEL_CAPACITY:int;
protected var abajo:Boolean;// = false
protected var derecha:Boolean;// = false
private var vars:Object;
private var fuel:int;
private var wheel2:b2Body;
private var wheel1:b2Body;
private var axle1:b2Body;
private var axle2:b2Body;
private var movieClipLevel:PhisicBase;
private var box:b2Body;
private var hull:int;
private var upgrades:Array;
protected var izquierda:Boolean;// = false
protected var arriba:Boolean;// = false
private var HULL_CAPACITY:int;
private var auxWheel:Sprite;
public var isPaused:Boolean;// = true
private var auxTriler:Sprite;
public function Helicopter(){
super();
}
public function get ropeStatus():Boolean{
return (shot_rope);
}
public function set cargo_box(a:b2Body):void{
box = a;
}
public function hit(a:Number):void{
hull = (hull - a);
vars_bis.myGui.energyCant = hull;
}
private function checkKeysDownUp(event:KeyboardEvent):void{
if (event.keyCode == 40){
abajo = false;
};
if (event.keyCode == 38){
arriba = false;
};
if (event.keyCode == 39){
derecha = false;
};
if (event.keyCode == 37){
izquierda = false;
};
if (event.keyCode == 32){
shot_rope = false;
};
if (event.keyCode == 87){
arriba = false;
};
if (event.keyCode == 83){
abajo = false;
};
if (event.keyCode == 68){
derecha = false;
};
if (event.keyCode == 65){
izquierda = false;
};
}
public function theGameIsPaused():Boolean{
return (isPaused);
}
private function checkKeysDownDown(event:KeyboardEvent):void{
var jj:b2JointEdge;
if (event.keyCode == 40){
abajo = true;
};
if (event.keyCode == 38){
arriba = true;
};
if (event.keyCode == 39){
derecha = true;
};
if (event.keyCode == 37){
izquierda = true;
};
if (event.keyCode == 32){
if (box){
jj = box.GetJointList();
while (jj) {
vars_bis.my_world.DestroyJoint(jj.joint);
jj = jj.next;
};
box = null;
} else {
shot_rope = true;
};
};
if (event.keyCode == 87){
arriba = true;
};
if (event.keyCode == 83){
abajo = true;
};
if (event.keyCode == 68){
derecha = true;
};
if (event.keyCode == 65){
izquierda = true;
};
if (event.keyCode == 80){
if (!isPaused){
isPaused = true;
} else {
isPaused = false;
};
};
}
public function add_hull_and_fuel():void{
if ((((fuel < FUEL_CAPACITY)) && ((Main.total_game_money > 0)))){
fuel = (fuel + 50);
Main.total_game_money--;
vars_bis.myGui.actualizar_money();
vars_bis.myGui.fuelCant = fuel;
};
if (hull < HULL_CAPACITY){
hull = (hull + 1);
vars_bis.myGui.energyCant = hull;
};
}
public function generate_parent(v:Object, v2:Object):void{
vars = v;
vars_bis = v2;
vars_bis.gameStage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeysDownDown);
vars_bis.gameStage.addEventListener(KeyboardEvent.KEY_UP, checkKeysDownUp);
vars_bis.gameStage.focus = this;
vars_bis.gameStage.stageFocusRect = false;
fuel = vars.fuel;
FUEL_CAPACITY = vars.FUEL_CAPACITY;
hull = vars.hull;
HULL_CAPACITY = vars.HULL_CAPACITY;
vars_bis.myGui.addHeliVars(FUEL_CAPACITY, HULL_CAPACITY);
}
public function autoFocus():void{
vars_bis.gameStage.focus = this;
vars_bis.gameStage.stageFocusRect = false;
}
public function get actual_GUI():GUI{
return (vars_bis.myGui);
}
public function set ropeStatus_var(a:Boolean):void{
shot_rope = a;
}
public function updateFuelConsumition(engineForce:Number):void{
var energiConsumition:Number;
energiConsumition = (engineForce * (arriba) ? -1 : (abajo) ? 1 : 0);
energiConsumition = (energiConsumition - Math.abs(((engineForce / 10) * (izquierda) ? -1 : (derecha) ? 1 : 0)));
fuel = (fuel - Math.abs(energiConsumition));
vars_bis.myGui.actualize_Fuel_Progress_Bar(fuel);
}
}
}//package Clases.Game.Veicle
Section 271
//HelicopterResource (Clases.Game.Veicle.HelicopterResource)
package Clases.Game.Veicle {
import flash.display.*;
public class HelicopterResource {
private const Medium_Heli_bitmap:Class;
private const Big_Heli_bitmap:Class;
private const Cheenook_Heli_bitmap:Class;
private const Small_Heli_bitmap:Class;
public function HelicopterResource(){
Small_Heli_bitmap = HelicopterResource_Small_Heli_bitmap;
Medium_Heli_bitmap = HelicopterResource_Medium_Heli_bitmap;
Big_Heli_bitmap = HelicopterResource_Big_Heli_bitmap;
Cheenook_Heli_bitmap = HelicopterResource_Cheenook_Heli_bitmap;
super();
}
public function createBigHeliBitmap():Bitmap{
var skin:Bitmap = (new Big_Heli_bitmap() as Bitmap);
return (skin);
}
public function createCheenokHeliBitmap():Bitmap{
var skin:Bitmap = (new Cheenook_Heli_bitmap() as Bitmap);
return (skin);
}
public function createMediumHeliBitmap():Bitmap{
var skin:Bitmap = (new Medium_Heli_bitmap() as Bitmap);
return (skin);
}
public function createSmallHeliBitmap():Bitmap{
var skin:Bitmap = (new Small_Heli_bitmap() as Bitmap);
return (skin);
}
}
}//package Clases.Game.Veicle
Section 272
//HelicopterResource_Big_Heli_bitmap (Clases.Game.Veicle.HelicopterResource_Big_Heli_bitmap)
package Clases.Game.Veicle {
import mx.core.*;
public class HelicopterResource_Big_Heli_bitmap extends BitmapAsset {
}
}//package Clases.Game.Veicle
Section 273
//HelicopterResource_Cheenook_Heli_bitmap (Clases.Game.Veicle.HelicopterResource_Cheenook_Heli_bitmap)
package Clases.Game.Veicle {
import mx.core.*;
public class HelicopterResource_Cheenook_Heli_bitmap extends BitmapAsset {
}
}//package Clases.Game.Veicle
Section 274
//HelicopterResource_Medium_Heli_bitmap (Clases.Game.Veicle.HelicopterResource_Medium_Heli_bitmap)
package Clases.Game.Veicle {
import mx.core.*;
public class HelicopterResource_Medium_Heli_bitmap extends BitmapAsset {
}
}//package Clases.Game.Veicle
Section 275
//HelicopterResource_Small_Heli_bitmap (Clases.Game.Veicle.HelicopterResource_Small_Heli_bitmap)
package Clases.Game.Veicle {
import mx.core.*;
public class HelicopterResource_Small_Heli_bitmap extends BitmapAsset {
}
}//package Clases.Game.Veicle
Section 276
//MediumHeliCabin (Clases.Game.Veicle.MediumHeliCabin)
package Clases.Game.Veicle {
import flash.display.*;
import Clases.Game.SFX.*;
import gs.*;
public class MediumHeliCabin extends Sprite {
private var heli:Heli_animation;
private var skin:Bitmap;
public function MediumHeliCabin(){
super();
var recursos:HelicopterResource = new HelicopterResource();
heli = new Heli_animation();
skin = recursos.createMediumHeliBitmap();
addChild(skin);
skin.x = (skin.x - ((skin.width / 2) + 21));
skin.y = (skin.y - ((skin.height / 2) + 40));
skin.smoothing = true;
heli.scaleX = 1.2;
addChild(heli);
heli.y = -70;
heli.x = -8;
}
public function explode_it():void{
var remove_cabin:Function;
remove_cabin = function ():void{
removeChild(heli);
removeChild(skin);
};
var explocion:HelyExplocion = new HelyExplocion();
addChild(explocion);
explocion.x = heli.x;
explocion.y = heli.y;
explocion.start_efect();
TweenMax.to(skin, 1, {alpha:0});
TweenMax.to(heli, 1, {alpha:0, onComplete:remove_cabin});
}
}
}//package Clases.Game.Veicle
Section 277
//MediumHelicopter (Clases.Game.Veicle.MediumHelicopter)
package Clases.Game.Veicle {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
import Clases.Game.Veicle.RopeStiles.*;
import Clases.Game.Common.*;
public class MediumHelicopter extends Helicopter {
private const HULL_CAPACITY:int = 30;
private const FUEL_CAPACITY:int = 35000;
private var axle1:b2Body;
private var spring1:b2PrismaticJoint;
private var spring2:b2PrismaticJoint;
private var myWorld:b2World;
private var axle2:b2Body;
private var auxCabin:MediumHeliCabin;
private var hull:Number;// = 30
private var helysounds:Hely_Sound;
private var motor1:b2RevoluteJoint;
private var motor2:b2RevoluteJoint;
private var cart:b2Body;
private var ENGINE_POWER:Number;// = 0
private var rope:SecondtRope;
private var vars:Object;
private var wheel1:b2Body;
private var wheel2:b2Body;
private var fuel:int;// = 35000
public function MediumHelicopter(){
helysounds = new Hely_Sound();
super();
}
public function remove_all_childs():void{
helysounds.stop_sound();
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
}
public function generateHelicopter(world:b2World, v:Object=null):void{
var body:b2Body;
var bodyDef:b2BodyDef;
var boxDef:b2PolygonDef;
var circleDef:b2CircleDef;
var revoluteJointDef:b2RevoluteJointDef;
var prismaticJointDef:b2PrismaticJointDef;
myWorld = world;
vars = v;
helysounds.play_second_hely_sound();
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.H_Position[0], vars.H_Position[1]);
bodyDef.userData = new MediumHeliCabin();
bodyDef.userData.x = -4000;
bodyDef.userData.y = -4000;
auxCabin = bodyDef.userData;
bodyDef.linearDamping = 0.5;
bodyDef.angularDamping = 1;
cart = world.CreateBody(bodyDef);
boxDef = new b2PolygonDef();
boxDef.density = 0.3;
boxDef.friction = 0.5;
boxDef.restitution = 0.3;
boxDef.SetAsOrientedBox(0.9, 0.45, new b2Vec2(0.05, -0.9), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.4, 0.2, new b2Vec2(-0.41, -1.6), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.9, 0.1, new b2Vec2(-1.5, -1.3), 0.1);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.9, 0.1, new b2Vec2(-1.5, -1.3), 0.1);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.1, 0.4, new b2Vec2(-2.5, -1.7), -0.2);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1.15, 0.05, new b2Vec2(0, -0.15), 0);
boxDef.userData = "pies";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(2.4, 0.05, new b2Vec2(-0.3, -2.35), 0);
boxDef.userData = "helice";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
cart.SetMassFromShapes();
boxDef.density = 0.001;
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.H_Position[0], vars.H_Position[1]);
vars.fuel = fuel;
vars.FUEL_CAPACITY = FUEL_CAPACITY;
vars.hull = hull;
vars.HULL_CAPACITY = HULL_CAPACITY;
super.generate_parent(vars, {hely:cart, gameStage:vars.levelStage, myGui:vars.mg});
rope = new SecondtRope();
addChild(rope);
rope.init({world:world, hely:cart});
addChild(auxCabin);
}
public function remove_it():void{
helysounds.stop_sound();
auxCabin.explode_it();
myWorld.DestroyBody(cart);
}
public function update():void{
var energiConsumition:Number = 0;
var motorForceVector:b2Vec2 = cart.GetXForm().R.col2.Copy();
if (ENGINE_POWER < 0){
ENGINE_POWER = (ENGINE_POWER + 0.1);
};
if (ENGINE_POWER < -5){
ENGINE_POWER = (ENGINE_POWER + 1);
};
if (ENGINE_POWER > 0){
ENGINE_POWER = (ENGINE_POWER - 0.1);
};
if (ENGINE_POWER > 5){
ENGINE_POWER = (ENGINE_POWER - 1);
};
if (fuel >= 0){
ENGINE_POWER = (ENGINE_POWER + (super.arriba) ? -1 : (abajo) ? 0.1 : 0);
motorForceVector.Multiply(ENGINE_POWER);
cart.ApplyForce(motorForceVector, cart.GetWorldCenter());
cart.ApplyTorque((izquierda) ? -1.5 : (derecha) ? 1.5 : 0);
updateFuelConsumition(ENGINE_POWER);
};
}
public function get cabin():b2Vec2{
return (cart.GetWorldCenter());
}
}
}//package Clases.Game.Veicle
Section 278
//SmallHeliCabin (Clases.Game.Veicle.SmallHeliCabin)
package Clases.Game.Veicle {
import flash.display.*;
import Clases.Game.SFX.*;
import gs.*;
public class SmallHeliCabin extends Sprite {
private var heli:Heli_animation;
private var skin:Bitmap;
public function SmallHeliCabin(){
super();
var recursos:HelicopterResource = new HelicopterResource();
heli = new Heli_animation();
skin = recursos.createSmallHeliBitmap();
addChild(skin);
skin.x = (skin.x - ((skin.width / 2) + 20));
skin.y = (skin.y - ((skin.height / 2) + 40));
skin.smoothing = true;
addChild(heli);
heli.y = -64;
heli.x = -8;
}
public function explode_it():void{
var remove_cabin:Function;
remove_cabin = function ():void{
removeChild(heli);
removeChild(skin);
};
var explocion:HelyExplocion = new HelyExplocion();
addChild(explocion);
explocion.x = heli.x;
explocion.y = heli.y;
explocion.start_efect();
TweenMax.to(skin, 1, {alpha:0});
TweenMax.to(heli, 1, {alpha:0, onComplete:remove_cabin});
}
}
}//package Clases.Game.Veicle
Section 279
//SmallHelicopter (Clases.Game.Veicle.SmallHelicopter)
package Clases.Game.Veicle {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
import Clases.Game.Veicle.RopeStiles.*;
import Clases.Game.Common.*;
public class SmallHelicopter extends Helicopter {
private const HULL_CAPACITY:int = 11;
private const FUEL_CAPACITY:int = 5500;
private var axle1:b2Body;
private var spring1:b2PrismaticJoint;
private var spring2:b2PrismaticJoint;
private var myWorld:b2World;
private var axle2:b2Body;
private var auxCabin:SmallHeliCabin;
private var hull:Number;// = 11
private var helysounds:Hely_Sound;
private var motor1:b2RevoluteJoint;
private var motor2:b2RevoluteJoint;
private var cart:b2Body;
private var ENGINE_POWER:Number;// = 1
private var rope:FirstRope;
private var vars:Object;
private var wheel1:b2Body;
private var wheel2:b2Body;
private var fuel:int;// = 5500
public function SmallHelicopter(){
helysounds = new Hely_Sound();
super();
}
public function remove_all_childs():void{
helysounds.stop_sound();
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
}
public function generateHelicopter(world:b2World, v:Object=null):void{
var body:b2Body;
var bodyDef:b2BodyDef;
var boxDef:b2PolygonDef;
var circleDef:b2CircleDef;
var revoluteJointDef:b2RevoluteJointDef;
var prismaticJointDef:b2PrismaticJointDef;
myWorld = world;
ENGINE_POWER = -1;
vars = v;
helysounds.play_fist_hely_sound();
bodyDef = new b2BodyDef();
bodyDef.position.Set(vars.H_Position[0], vars.H_Position[1]);
bodyDef.userData = new SmallHeliCabin();
bodyDef.userData.x = -4000;
bodyDef.userData.y = -4000;
auxCabin = bodyDef.userData;
bodyDef.linearDamping = 0.5;
bodyDef.angularDamping = 1;
cart = world.CreateBody(bodyDef);
boxDef = new b2PolygonDef();
boxDef.density = 0.1;
boxDef.friction = 0.5;
boxDef.restitution = 0.3;
boxDef.SetAsOrientedBox(0.7, 0.31, new b2Vec2(-0.22, -1.2), 0);
boxDef.filter.groupIndex = -1;
boxDef.userData = "cabina";
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.4, 0.1, new b2Vec2(-0.22, -1.6), 0);
boxDef.filter.groupIndex = -1;
boxDef.userData = "cabina";
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1.9, 0.1, new b2Vec2(-0.23, -2.1), 0);
boxDef.filter.groupIndex = -1;
boxDef.userData = "helice";
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.5, 0.1, new b2Vec2(-1.5, -1), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(0.1, 0.4, new b2Vec2(-2, -1.2), 0);
boxDef.userData = "cabina";
boxDef.filter.groupIndex = -1;
cart.CreateShape(boxDef);
boxDef.SetAsOrientedBox(1, 0.051, new b2Vec2(-0.22, -0.5), 0);
boxDef.filter.groupIndex = -1;
boxDef.userData = "pies";
cart.CreateShape(boxDef);
cart.SetMassFromShapes();
boxDef.density = 0.001;
vars.fuel = fuel;
vars.FUEL_CAPACITY = FUEL_CAPACITY;
vars.hull = hull;
vars.HULL_CAPACITY = HULL_CAPACITY;
super.generate_parent(vars, {hely:cart, gameStage:vars.levelStage, myGui:vars.mg, my_world:world});
rope = new FirstRope();
addChild(rope);
rope.init({world:world, hely:cart});
addChild(auxCabin);
}
public function remove_it():void{
helysounds.stop_sound();
auxCabin.explode_it();
myWorld.DestroyBody(cart);
}
public function update():void{
var motorForceVector:b2Vec2 = cart.GetXForm().R.col2.Copy();
if (ENGINE_POWER < 0){
ENGINE_POWER = (ENGINE_POWER + 0.05);
};
if (ENGINE_POWER < -1.5){
ENGINE_POWER = (ENGINE_POWER + 1);
};
if (ENGINE_POWER > 0){
ENGINE_POWER = (ENGINE_POWER - 0.05);
};
if (ENGINE_POWER > 1.5){
ENGINE_POWER = (ENGINE_POWER - 1);
};
if (fuel >= 0){
ENGINE_POWER = (ENGINE_POWER + (super.arriba) ? -0.75 : (abajo) ? 0.75 : 0);
motorForceVector.Multiply(ENGINE_POWER);
cart.ApplyForce(motorForceVector, cart.GetWorldCenter());
cart.ApplyTorque((izquierda) ? -0.7 : (derecha) ? 0.7 : 0);
updateFuelConsumition(ENGINE_POWER);
};
}
public function get cabin():b2Vec2{
return (cart.GetWorldCenter());
}
}
}//package Clases.Game.Veicle
Section 280
//Text (Clases.Text.Text)
package Clases.Text {
import gs.*;
import flash.text.*;
import gs.easing.*;
public class Text extends TextField {
private var textStyle:TextFormat;
public function Text(){
textStyle = new TextFormat();
super();
this.text = "Texto";
this.selectable = false;
this.width = 250;
this.height = 25;
}
public function setTextStyle(vars:Object):void{
textStyle.size = vars.size;
textStyle.color = vars.color;
textStyle.font = vars.customFont.fontName;
textStyle.bold = vars.isBold;
if (!vars.align){
textStyle.align = TextFormatAlign.CENTER;
} else {
textStyle.align = vars.align;
};
this.setTextFormat(textStyle);
this.width = vars.width;
this.height = vars.height;
this.embedFonts = true;
}
public function addTextEfect(efecto:Object):void{
TweenMax.to(this, 0.01, {glowFilter:efecto});
}
}
}//package Clases.Text
Section 281
//GoogleTrackingCode (Clases.TrakingCode.GoogleTrackingCode)
package Clases.TrakingCode {
import flash.display.*;
import com.google.analytics.core.*;
import com.google.analytics.*;
public class GoogleTrackingCode {
private var tracker:AnalyticsTracker;
public function GoogleTrackingCode(swf:Sprite, code:String){
super();
tracker = new GATracker(swf, code, TrackerMode.AS3, false);
}
public function Preloader_click():void{
tracker.trackPageview("/Preloader_Click");
}
public function mainPageTraking():void{
tracker.trackPageview("/Game_Plays");
}
public function More_games():void{
tracker.trackPageview("/Clicked_More_Games_Button");
}
}
}//package Clases.TrakingCode
Section 282
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function isEmpty():Boolean{
return (_empty);
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 283
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
public function CampaignKey(){
super();
}
}
}//package com.google.analytics.campaign
Section 284
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey;
var _local3:Variables;
var _local4:String;
_local2 = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
_local3 = new Variables(_arg1);
_local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local3:CampaignInfo;
var _local4:CampaignTracker;
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
var _local8:CampaignTracker;
var _local9:int;
_local3 = new CampaignInfo();
_local5 = false;
_local6 = false;
_local7 = 0;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker;
var _local3:CampaignTracker;
var _local4:CampaignKey;
var _local5:Variables;
_local2 = getOrganicCampaign();
_local3 = new CampaignTracker();
_local4 = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
_local5 = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local2:URL;
var _local3:String;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
_local2 = new URL(_referrer);
_local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker;
_local1 = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local2:URL;
var _local3:String;
var _local4:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
_local2 = new URL(_referrer);
_local3 = _local2.hostName;
_local4 = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL;
_local3 = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 285
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(id:String="", source:String="", clickId:String="", name:String="", medium:String="", term:String="", content:String=""){
super();
this.id = id;
this.source = source;
this.clickId = clickId;
this.name = name;
this.medium = medium;
this.term = term;
this.content = content;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var data:Array = [];
_addIfNotEmpty(data, "utmcsr=", source);
_addIfNotEmpty(data, "utmccn=", name);
_addIfNotEmpty(data, "utmcmd=", medium);
_addIfNotEmpty(data, "utmctr=", term);
_addIfNotEmpty(data, "utmcct=", content);
_addIfNotEmpty(data, "utmcid=", id);
_addIfNotEmpty(data, "utmgclid=", clickId);
return (data.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(arr:Array, field:String, value:String):void{
if (value != ""){
value = value.split("+").join("%20");
value = value.split(" ").join("%20");
arr.push((field + value));
};
}
public function fromTrackerString(tracker:String):void{
var data:String = tracker.split(CampaignManager.trackingDelimiter).join("&");
var vars:Variables = new Variables(data);
if (vars.hasOwnProperty("utmcid")){
this.id = vars["utmcid"];
};
if (vars.hasOwnProperty("utmcsr")){
this.source = vars["utmcsr"];
};
if (vars.hasOwnProperty("utmccn")){
this.name = vars["utmccn"];
};
if (vars.hasOwnProperty("utmcmd")){
this.medium = vars["utmcmd"];
};
if (vars.hasOwnProperty("utmctr")){
this.term = vars["utmctr"];
};
if (vars.hasOwnProperty("utmcct")){
this.content = vars["utmcct"];
};
if (vars.hasOwnProperty("utmgclid")){
this.clickId = vars["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 286
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 287
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _OBJ:Object;
private var _utma:UTMA;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(config:Configuration, debug:DebugConfiguration, volatile:Boolean=false, data:Object=null){
var saveSO:Boolean;
var prop:String;
super();
_config = config;
_debug = debug;
UTMB.defaultTimespan = _config.sessionTimeout;
UTMZ.defaultTimespan = _config.conversionTimeout;
if (!volatile){
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
saveSO = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
saveSO = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
saveSO = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
saveSO = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
saveSO = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
saveSO = true;
};
};
if (saveSO){
save();
};
} else {
_OBJ = new Object();
if (data){
for (prop in data) {
_OBJ[prop] = data[prop];
};
};
};
_volatile = volatile;
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
flushStatus = _SO.flush();
//unresolved jump
var _slot1 = e;
_debug.warning("Error...Could not write SharedObject to disk");
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function generateCookiesHash():Number{
var value:String = "";
value = (value + utma.valueOf());
value = (value + utmb.valueOf());
value = (value + utmc.valueOf());
value = (value + utmz.valueOf());
value = (value + utmv.valueOf());
return (Utils.generateHash(value));
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _onFlushStatus(event:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (event.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(timestamp:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + timestamp) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = timestamp;
};
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(name:String, value):void{
if (isVolatile()){
_OBJ[name] = value;
} else {
_SO.data[name] = value;
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 288
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
public class DocumentInfo {
private var _config:Configuration;
private var _utmr:String;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
private var _pageURL:String;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String;
var _local3:String;
_local2 = _info.locationPath;
_local3 = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function get utmhid():String{
return (String(_generateHitId()));
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 289
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(mode:DomainNameMode=null, name:String="", debug:DebugConfiguration=null){
super();
_debug = debug;
if (mode == null){
mode = DomainNameMode.auto;
};
_mode = mode;
if (mode == DomainNameMode.custom){
this.name = name;
} else {
_name = name;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(value:DomainNameMode):void{
_mode = value;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(value:String):void{
if (((!((value.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + value), VisualDebugMode.geek);
};
_name = value;
}
}
}//package com.google.analytics.core
Section 290
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 291
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.utils.*;
import com.google.analytics.data.*;
public class EventInfo {
private var _isEventHit:Boolean;
private var _ext10:X10;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 292
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 293
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 294
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.utils.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(config:Configuration, debug:DebugConfiguration, buffer:Buffer, info:Environment){
super();
_config = config;
_debug = debug;
_buffer = buffer;
_info = info;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(event:IOErrorEvent):void{
var url:String = _lastRequest.url;
var id:String = String((_requests.length - 1));
var msg = (("Gif Request #" + id) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (url.indexOf("?") > -1){
url = url.split("?")[0];
};
url = _shortenURL(url);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
msg = (msg + ((" \"" + url) + "\" does not exists or is unreachable"));
};
_debug.failure(msg);
} else {
_debug.warning(msg);
};
_removeListeners(event.target);
}
public function send(account:String, variables:Variables=null, force:Boolean=false, rateLimit:Boolean=false):void{
var localPath:String;
var localImage:URLRequest;
var remoteImage:URLRequest;
_utmac = account;
if (!variables){
variables = new Variables();
};
variables.URIencode = false;
variables.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
variables.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (force))){
if (rateLimit){
updateToken();
};
if (((((force) || (!(rateLimit)))) || ((_buffer.utmb.token >= 1)))){
if (((!(force)) && (rateLimit))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
variables.utmwv = utmwv;
variables.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
variables.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
variables.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
localPath = _info.locationSWFPath;
if (localPath.lastIndexOf("/") > 0){
localPath = localPath.substring(0, localPath.lastIndexOf("/"));
};
localImage = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
localImage.url = _config.localGIFpath;
} else {
localImage.url = (localPath + _config.localGIFpath);
};
localImage.url = (localImage.url + ("?" + variables.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(localImage);
} else {
sendRequest(localImage);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
remoteImage = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
remoteImage.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
remoteImage.url = _config.remoteGIFpath;
} else {
remoteImage.url = _config.remoteGIFpath;
};
};
variables.utmac = utmac;
variables.utmcc = encodeURIComponent(utmcc);
remoteImage.url = (remoteImage.url + ("?" + variables.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(remoteImage);
} else {
sendRequest(remoteImage);
};
};
};
};
}
public function onSecurityError(event:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(event.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var cookies:Array = [];
if (_buffer.hasUTMA()){
cookies.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
cookies.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
cookies.push((_buffer.utmv.toURLString() + ";"));
};
return (cookies.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(request:URLRequest):void{
var request = request;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
loader.load(request, context);
//unresolved jump
var _slot1 = e;
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
}
private function _removeListeners(target:Object):void{
target.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
target.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var tokenDelta:Number;
var timestamp:Number = new Date().getTime();
tokenDelta = ((timestamp - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + tokenDelta), VisualDebugMode.geek);
};
if (tokenDelta >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + tokenDelta)), _config.bucketCapacity);
_buffer.utmb.lastTime = timestamp;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(url:String):String{
var paths:Array;
if (url.length > 60){
paths = url.split("/");
while (url.length > 60) {
paths.shift();
url = ("../" + paths.join("/"));
};
};
return (url);
}
private function _debugSend(request:URLRequest):void{
var _local3:String;
var data:String = "";
switch (_debug.mode){
case VisualDebugMode.geek:
data = ((("Gif Request #" + _alertcount) + ":\n") + request.url);
break;
case VisualDebugMode.advanced:
_local3 = request.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
data = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
data = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(data, request, this);
_alertcount++;
}
public function onComplete(event:Event):void{
var id:String = event.target.loader.name;
_requests[id].complete();
var msg = (("Gif Request #" + id) + " sent");
var url:String = _requests[id].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (url.indexOf("?") > -1){
url = url.split("?")[0];
};
url = _shortenURL(url);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
msg = (msg + ((" to \"" + url) + "\""));
};
_debug.success(msg);
} else {
_debug.info(msg);
};
_removeListeners(event.target);
}
}
}//package com.google.analytics.core
Section 295
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.utils.*;
public class IdleTimer {
private var _loop:Timer;
private var _stage:Stage;
private var _lastMove:int;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _inactivity:Number;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number;
var _local6:Number;
var _local7:Number;
super();
_local5 = _arg1.idleLoop;
_local6 = _arg1.idleTimeout;
_local7 = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int;
_local2 = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 296
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String;
_local3 = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function get count():int{
return (_sources.length);
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer;
_local3 = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 297
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function get keyword():String{
return (_keyword);
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function get engine():String{
return (_engine);
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 298
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var request:URLRequest;
public var end:int;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function toString():String{
var _local1:Array;
_local1 = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function complete():void{
end = getTimer();
}
}
}//package com.google.analytics.core
Section 299
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 300
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(tracker:GoogleAnalyticsAPI=null){
super();
this.tracker = tracker;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var o:Object;
var name:String;
var args:Array;
var l:int;
var i:int;
if (tracker == null){
return;
};
if (size() > 0){
l = _ar.length;
while (i < l) {
o = _ar.shift();
name = (o.name as String);
args = (o.args as Array);
if (((!((name == null))) && ((name in tracker)))){
(tracker[name] as Function).apply(tracker, args);
};
i++;
};
};
}
public function enqueue(name:String, ... _args):Boolean{
if (name == null){
return (false);
};
_ar.push({name:name, args:_args});
return (true);
}
public function link(targetUrl:String, useHash:Boolean=false):void{
enqueue("link", targetUrl, useHash);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
enqueue("addOrganic", newOrganicEngine, newOrganicKeyword);
}
public function setAllowLinker(enable:Boolean):void{
enqueue("setAllowLinker", enable);
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
enqueue("trackEvent", category, action, label, value);
return (true);
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(pageURL:String=""):void{
enqueue("trackPageview", pageURL);
}
public function setClientInfo(enable:Boolean):void{
enqueue("setClientInfo", enable);
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
enqueue("linkByPost", formObject, useHash);
}
public function setCookieTimeout(newDefaultTimeout:int):void{
enqueue("setCookieTimeout", newDefaultTimeout);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(enable:Boolean):void{
enqueue("setDetectFlash", enable);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(newCampNameKey:String):void{
enqueue("setCampNameKey", newCampNameKey);
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
enqueue("addItem", item, sku, name, category, price, quantity);
}
public function createEventTracker(objName:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function setVar(newVal:String):void{
enqueue("setVar", newVal);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setDomainName(newDomainName:String):void{
enqueue("setDomainName", newDomainName);
}
public function setCampSourceKey(newCampSrcKey:String):void{
enqueue("setCampSourceKey", newCampSrcKey);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):Object{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
return (null);
}
public function setCampContentKey(newCampContentKey:String):void{
enqueue("setCampContentKey", newCampContentKey);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(enable:Boolean):void{
enqueue("setAllowAnchor", enable);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(newLocalGifPath:String):void{
enqueue("setLocalGifPath", newLocalGifPath);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(newCookiePath:String):void{
enqueue("setCookiePath", newCookiePath);
}
public function setSampleRate(newRate:Number):void{
enqueue("setSampleRate", newRate);
}
public function setDetectTitle(enable:Boolean):void{
enqueue("setDetectTitle", enable);
}
public function setAllowHash(enable:Boolean):void{
enqueue("setAllowHash", enable);
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
enqueue("addIgnoredOrganic", newIgnoredOrganicKeyword);
}
public function setCampNOKey(newCampNOKey:String):void{
enqueue("setCampNOKey", newCampNOKey);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(newPath:String):void{
enqueue("cookiePathCopy", newPath);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(enable:Boolean):void{
enqueue("setCampaignTrack", enable);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(newCampTermKey:String):void{
enqueue("setCampTermKey", newCampTermKey);
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
enqueue("addIgnoredRef", newIgnoredReferrer);
}
public function setCampMediumKey(newCampMedKey:String):void{
enqueue("setCampMediumKey", newCampMedKey);
}
public function setSessionTimeout(newTimeout:int):void{
enqueue("setSessionTimeout", newTimeout);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 301
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 302
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local3:Array;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
_local3 = [" ", "\n", "\r", "\t"];
_local4 = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 1;
_local3 = 0;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp;
_local2 = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 303
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/data;Cookie.as:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/data;Cookie.as:Date):void;
function set expiration(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/data;Cookie.as:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 304
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(domainHash:Number=NaN, sessionId:Number=NaN, firstTime:Number=NaN, lastTime:Number=NaN, currentTime:Number=NaN, sessionCount:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = domainHash;
this.sessionId = sessionId;
this.firstTime = firstTime;
this.lastTime = lastTime;
this.currentTime = currentTime;
this.sessionCount = sessionCount;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(value:Number):void{
_lastTime = value;
update();
}
public function set currentTime(value:Number):void{
_currentTime = value;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set sessionId(value:Number):void{
_sessionId = value;
update();
}
public function set sessionCount(value:Number):void{
_sessionCount = value;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(value:Number):void{
_firstTime = value;
update();
}
}
}//package com.google.analytics.data
Section 305
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(domainHash:Number=NaN, trackCount:Number=NaN, token:Number=NaN, lastTime:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = domainHash;
this.trackCount = trackCount;
this.token = token;
this.lastTime = lastTime;
}
public function set token(value:Number):void{
_token = value;
update();
}
public function set trackCount(value:Number):void{
_trackCount = value;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set lastTime(value:Number):void{
_lastTime = value;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 306
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
}
}//package com.google.analytics.data
Section 307
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
private var _timespan:Number;
protected var fields:Array;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local1:int;
var _local2:String;
var _local3:int;
_local1 = 0;
_local3 = 0;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int;
var _local4:int;
_local3 = fields.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date;
var _local2:Number;
_local1 = new Date();
_local2 = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function reset():void{
var _local1:String;
var _local2:int;
_local2 = 0;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function valueOf():String{
var _local1:Array;
var _local2:String;
var _local3:*;
var _local4:int;
_local1 = [];
_local4 = 0;
while (_local4 < fields.length) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local4++;
};
return (("" + _local1.join(".")));
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function toSharedObject():Object{
var _local1:Object;
var _local2:String;
var _local3:*;
var _local4:int;
_local1 = {};
_local4 = 0;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local2:Array;
var _local3:String;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:String;
_local2 = [];
_local5 = fields.length;
_local6 = 0;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
_local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 308
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(hash:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = hash;
}
public function set hash(value:Number):void{
_hash = value;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 309
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(domainHash:Number=NaN, value:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = domainHash;
this.value = value;
}
override public function toURLString():String{
return (((inURL + "=") + encodeURI(valueOf())));
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set value(value:String):void{
_value = value;
update();
}
}
}//package com.google.analytics.data
Section 310
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(domainHash:Number=NaN, campaignCreation:Number=NaN, campaignSessions:Number=NaN, responseCount:Number=NaN, campaignTracking:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = domainHash;
this.campaignCreation = campaignCreation;
this.campaignSessions = campaignSessions;
this.responseCount = responseCount;
this.campaignTracking = campaignTracking;
}
public function set responseCount(value:Number):void{
_responseCount = value;
update();
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set campaignCreation(value:Number):void{
_campaignCreation = value;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(value:Number):void{
_campaignSessions = value;
update();
}
public function set campaignTracking(value:String):void{
_campaignTracking = value;
update();
}
}
}//package com.google.analytics.data
Section 311
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _projectData:Object;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _minimum:int;
private var _value:String;// = "v"
public function X10(){
_key = "k";
_value = "v";
_set = [_key, _value];
_delimBegin = "(";
_delimEnd = ")";
_delimSet = "*";
_delimNumValue = "!";
_escapeChar = "'";
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function hasData():Boolean{
return ((_hasData > 0));
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local2:Array;
var _local3:String;
var _local4:int;
_local2 = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local2:Array;
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
_local2 = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local1:Array;
var _local2:String;
_local1 = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:*;
_local3 = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _renderProject(_arg1:Object):String{
var _local2:String;
var _local3:Boolean;
var _local4:int;
var _local5:Array;
var _local6:int;
_local2 = "";
_local3 = false;
_local6 = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local2:String;
var _local3:int;
var _local4:String;
var _local5:String;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 312
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.text.*;
import flash.net.*;
public class _Style {
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var alertColor:uint;
public var infoColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
public var failureColor:uint;
private var _defaultSheet:String;
public var warningColor:uint;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 313
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var actionOnNextLine:Boolean;// = true
public var autoClose:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
var _local8:int;
autoClose = true;
actionOnNextLine = true;
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
_local8 = 0;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
_local2 = 0;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function spaces(_arg1:int):String{
var _local2:String;
var _local3:String;
var _local4:int;
_local2 = "";
_local3 = " ";
_local4 = 0;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
private function _defineActions():void{
var _local1:String;
var _local2:Array;
var _local3:AlertAction;
var _local4:int;
_local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
_local2 = [];
_local4 = 0;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 314
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var name:String;
public var activator:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 315
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 316
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint;
_local7 = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 317
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint = 0;
public function Debug(color:uint=0, alignement:Align=null, stickToEdge:Boolean=false){
if (alignement == null){
alignement = Align.bottom;
};
super("", "uiLabel", color, alignement, stickToEdge);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(message:String):void{
write(message, true);
}
private function _getLinesToDisplay(direction:int=0):Array{
var lines:Array;
var start:uint;
var end:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + direction);
} else {
if ((((_linediff > 0)) && ((direction < 0)))){
_linediff = (_linediff + direction);
};
};
start = ((_lines.length - maxLines) + _linediff);
end = (start + maxLines);
lines = _lines.slice(start, end);
} else {
lines = _lines;
};
return (lines);
}
private function onKey(event:KeyboardEvent=null):void{
var lines:Array;
switch (event.keyCode){
case Keyboard.DOWN:
lines = _getLinesToDisplay(1);
break;
case Keyboard.UP:
lines = _getLinesToDisplay(-1);
break;
default:
lines = null;
};
if (lines == null){
return;
};
text = lines.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
} else {
};
return (!NULL!);
}
public function write(message:String, bold:Boolean=false):void{
var inputLines:Array;
if (message.indexOf("") > -1){
inputLines = message.split("\n");
} else {
inputLines = [message];
};
var pre:String = "";
var post:String = "";
if (bold){
pre = "<b>";
post = "</b>";
};
var i:int;
while (i < inputLines.length) {
_lines.push(((pre + inputLines[i]) + post));
i++;
};
var lines:Array = _getLinesToDisplay();
text = lines.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 318
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import flash.ui.*;
import com.google.analytics.core.*;
import flash.net.*;
import flash.utils.*;
public class DebugConfiguration {
public var showHideKey:Number;
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
showHideKey = Keyboard.SPACE;
destroyKey = Keyboard.BACKSPACE;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(value:Boolean):void{
_verbose = value;
}
public function set mode(value):void{
if ((value is String)){
switch (value){
case "geek":
value = VisualDebugMode.geek;
break;
case "advanced":
value = VisualDebugMode.advanced;
break;
case "basic":
default:
value = VisualDebugMode.basic;
};
};
_mode = value;
}
public function success(message:String):void{
if (layout){
layout.createSuccessAlert(message);
};
if (traceOutput){
trace((("[+] " + message) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(message:String, mode:VisualDebugMode=null):void{
if (_filter(mode)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(message);
};
if (traceOutput){
trace((("## " + message) + " ##"));
};
}
private function _filter(mode:VisualDebugMode=null):Boolean{
return (((mode) && ((int(mode) >= int(this.mode)))));
}
public function failure(message:String):void{
if (layout){
layout.createFailureAlert(message);
};
if (traceOutput){
trace((("[-] " + message) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(value:Boolean):void{
_active = value;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(message:String):void{
var msgs:Array;
var j:int;
var messages:Array = [];
var pre0:String = "";
var pre1:String = "";
if (this.mode == VisualDebugMode.geek){
pre0 = (getTimer() + " - ");
pre1 = (new Array(pre0.length).join(" ") + " ");
};
if (message.indexOf("\n") > -1){
msgs = message.split("\n");
j = 0;
while (j < msgs.length) {
if (msgs[j] == ""){
} else {
if (j == 0){
messages.push((pre0 + msgs[j]));
} else {
messages.push((pre1 + msgs[j]));
};
};
j++;
};
} else {
messages.push((pre0 + message));
};
var len:int = messages.length;
var i:int;
while (i < len) {
trace(messages[i]);
i++;
};
}
public function alert(message:String):void{
if (layout){
layout.createAlert(message);
};
if (traceOutput){
trace((("!! " + message) + " !!"));
};
}
public function info(message:String, mode:VisualDebugMode=null):void{
if (_filter(mode)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(message);
};
if (traceOutput){
trace(message);
};
}
public function alertGifRequest(message:String, request:URLRequest, ref:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(message, request, ref);
};
if (traceOutput){
trace(((">> " + message) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 319
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align;
var _local5:Boolean;
var _local6:Boolean;
_local4 = Align.bottomLeft;
_local5 = true;
_local6 = false;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 320
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 321
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
public interface ILayout {
function createWarning(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function createAlert(_arg1:String):void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 322
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 323
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(text:String="", tag:String="uiLabel", color:uint=0, alignement:Align=null, stickToEdge:Boolean=false){
super();
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = text;
_tag = tag;
if (alignement == null){
alignement = Align.none;
};
this.alignement = alignement;
this.stickToEdge = stickToEdge;
if (color == 0){
color = Style.backgroundColor;
};
_color = color;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var g:Graphics = _background.graphics;
g.clear();
g.beginFill(_color);
var W:uint = _textField.width;
var H:uint = _textField.height;
if (forcedWidth > 0){
W = forcedWidth;
};
Background.drawRounded(this, g, W, H);
g.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(value:String, newtag:String=""):void{
if (value == ""){
return;
};
if (newtag == ""){
newtag = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + newtag) + "\">") + value) + "</span>"));
_text = (_text + value);
_draw();
resize();
}
public function set text(value:String):void{
if (value == ""){
value = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + value) + "</span>");
_text = value;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(value:String):void{
_tag = value;
text = "";
}
public function onLink(event:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 324
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(debug:DebugConfiguration, display:DisplayObject){
super();
_display = display;
_debug = debug;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(event:KeyboardEvent=null):void{
switch (event.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(message:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(message);
return;
};
message = _filterMaxChars(message);
_hasWarning = true;
var w:Warning = new Warning(message, _debug.warningTimeout);
addToPanel("analytics", w);
w.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(message);
};
}
public function bringToFront(visual:DisplayObject):void{
_display.stage.setChildIndex(visual, (_display.stage.numChildren - 1));
}
public function createFailureAlert(message:String):void{
var actionClose:AlertAction;
if (_debug.verbose){
message = _filterMaxChars(message);
actionClose = new AlertAction("Close", "close", "close");
} else {
actionClose = new AlertAction("X", "close", "close");
};
var fa:Alert = new FailureAlert(_debug, message, [actionClose]);
addToPanel("analytics", fa);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.writeBold(message);
};
}
public function init():void{
var spaces = 10;
var W:uint = (_display.stage.stageWidth - (spaces * 2));
var H:uint = (_display.stage.stageHeight - (spaces * 2));
var mp:Panel = new Panel("analytics", W, H);
mp.alignement = Align.top;
mp.stickToEdge = false;
mp.title = ("Google Analytics v" + GATracker.version);
_mainPanel = mp;
addToStage(mp);
bringToFront(mp);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(name:String, visual:DisplayObject):void{
var panel:Panel;
var d:DisplayObject = _display.stage.getChildByName(name);
if (d){
panel = (d as Panel);
panel.addData(visual);
} else {
trace((("panel \"" + name) + "\" not found"));
};
}
private function _clearInfo(event:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(message:String, maxCharPerLine:int=0):String{
var line:String;
var CRLF:String = "\n";
var output:Array = [];
var lines:Array = message.split(CRLF);
if (maxCharPerLine == 0){
maxCharPerLine = _maxCharPerLine;
};
var i:int;
while (i < lines.length) {
line = lines[i];
while (line.length > maxCharPerLine) {
output.push(line.substr(0, maxCharPerLine));
line = line.substring(maxCharPerLine);
};
output.push(line);
i++;
};
return (output.join(CRLF));
}
private function _clearGRAlert(event:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(message:String):void{
var actionClose:AlertAction;
if (_debug.verbose){
message = _filterMaxChars(message);
actionClose = new AlertAction("Close", "close", "close");
} else {
actionClose = new AlertAction("X", "close", "close");
};
var sa:Alert = new SuccessAlert(_debug, message, [actionClose]);
addToPanel("analytics", sa);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.writeBold(message);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(message:String):void{
message = _filterMaxChars(message);
var a:Alert = new Alert(message, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", a);
if (_hasDebug){
visualDebug.writeBold(message);
};
}
public function createInfo(message:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(message);
return;
};
message = _filterMaxChars(message);
_hasInfo = true;
var i:Info = new Info(message, _debug.infoTimeout);
addToPanel("analytics", i);
i.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(message);
};
}
public function createGIFRequestAlert(message:String, request:URLRequest, ref:GIFRequest):void{
var message = message;
var request = request;
var ref = ref;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(visual:DisplayObject):void{
_display.stage.addChild(visual);
}
private function _clearWarning(event:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(name:String, width:uint, height:uint):void{
var p:Panel = new Panel(name, width, height);
p.alignement = Align.center;
p.stickToEdge = false;
addToStage(p);
bringToFront(p);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 325
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var bottom:int;
public var top:int;
public var right:int;
public var left:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 326
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(name:String, width:uint, height:uint, backgroundColor:uint=0, borderColor:uint=0, baseAlpha:Number=0.3, alignement:Align=null, stickToEdge:Boolean=false){
super();
_name = name;
this.name = name;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = width;
forcedHeight = height;
this.baseAlpha = baseAlpha;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = width;
_data.forcedHeight = height;
_data.mouseEnabled = false;
_title = new Label(name, "uiLabel", 0xFFFFFF, Align.topLeft, stickToEdge);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (alignement == null){
alignement = Align.none;
};
this.alignement = alignement;
this.stickToEdge = stickToEdge;
if (backgroundColor == 0){
backgroundColor = Style.backgroundColor;
};
_backgroundColor = backgroundColor;
if (borderColor == 0){
borderColor = Style.borderColor;
};
_borderColor = borderColor;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(event:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(value:Boolean):void{
_stickToEdge = value;
_title.stickToEdge = value;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var W:uint;
var H:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
W = forcedWidth;
H = forcedHeight;
} else {
W = _title.width;
H = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = W;
forcedHeight = H;
};
var g0:Graphics = _background.graphics;
g0.clear();
g0.beginFill(_backgroundColor);
Background.drawRounded(this, g0, W, H);
g0.endFill();
var g01:Graphics = _data.graphics;
g01.clear();
g01.beginFill(_backgroundColor, 0);
Background.drawRounded(this, g01, W, H);
g01.endFill();
var g1:Graphics = _border.graphics;
g1.clear();
g1.lineStyle(0.1, _borderColor);
Background.drawRounded(this, g1, W, H);
g1.endFill();
var g2:Graphics = _mask.graphics;
g2.clear();
g2.beginFill(_backgroundColor);
Background.drawRounded(this, g2, (W + 1), (H + 1));
g2.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(child:DisplayObject):void{
_data.addChild(child);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(value:String):void{
_title.text = value;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 327
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 328
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align;
var _local5:Boolean;
var _local6:Boolean;
_local4 = Align.bottomLeft;
_local5 = true;
_local6 = false;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 329
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class UISprite extends Sprite {
private var _forcedHeight:uint;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
_local2 = 0;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
protected function layout():void{
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
protected function onResize(_arg1:Event):void{
resize();
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
}
}//package com.google.analytics.debug
Section 330
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 331
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 332
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 333
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
_gaGlobalVerified = false;
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
}
}//package com.google.analytics.external
Section 334
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _protocol:String;
private var _host:String;
private var _location:String;
private var _pathname:String;
private var _title:String;
private var _characterSet:String;
private var _search:String;
private var _language:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function cacheProperties():void{
var _local1:Object;
if (!isAvailable()){
return;
};
_local1 = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
var _local1:String;
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
_local1 = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get language():String{
var _local1:String;
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
_local1 = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
}
}//package com.google.analytics.external
Section 335
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.system.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_notAvailableWarning = true;
super();
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean;
_local1 = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 336
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String;
_local1 = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version;
_local1 = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
var _local2:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
_local2 = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local1:Protocols;
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
_local1 = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
_local2 = _dom.protocol;
_local3 = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String;
_local1 = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
ga_internal function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String;
_local1 = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String;
var _local2:String;
_local1 = _dom.language;
_local2 = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String;
_local1 = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String;
_local1 = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 337
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 338
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
public function Timespan(){
super();
}
}
}//package com.google.analytics.utils
Section 339
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(url:String=""){
super();
_url = url.toLowerCase();
}
public function get domain():String{
var parts:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
parts = hostName.split(".");
switch (parts.length){
case 2:
return (hostName);
case 3:
if (parts[1] == "co"){
return (hostName);
};
parts.shift();
return (parts.join("."));
case 4:
parts.shift();
return (parts.join("."));
};
};
return ("");
}
public function get path():String{
var _path:String = _url;
if (_path.indexOf("://") > -1){
_path = _path.split("://")[1];
};
if (_path.indexOf(hostName) == 0){
_path = _path.substr(hostName.length);
};
if (_path.indexOf("?") > -1){
_path = _path.split("?")[0];
};
if (_path.charAt(0) != "/"){
_path = ("/" + _path);
};
return (_path);
}
public function get protocol():Protocols{
var proto:String = _url.split("://")[0];
switch (proto){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var hostname:String = _url;
if (hostname.indexOf("://") > -1){
hostname = hostname.split("://")[1];
};
if (hostname.indexOf("/") > -1){
hostname = hostname.split("/")[0];
};
if (hostname.indexOf("?") > -1){
hostname = hostname.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (hostname);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _search:String = _url;
if (_search.indexOf("://") > -1){
_search = _search.split("://")[1];
};
if (_search.indexOf(hostName) == 0){
_search = _search.substr(hostName.length);
};
if (_search.indexOf("?") > -1){
_search = _search.split("?")[1];
} else {
_search = "";
};
return (_search);
}
}
}//package com.google.analytics.utils
Section 340
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _version:Version;
private var _localInfo:Environment;
private var _applicationProduct:String;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get applicationProductToken():String{
var _local1:String;
_local1 = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function get vendorProductToken():String{
var _local1:String;
_local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array;
_local1 = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 341
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(source:String=null, pre:Array=null, post:Array=null){
pre = [];
post = [];
super();
if (source){
decode(source);
};
if (pre){
this.pre = pre;
};
if (post){
this.post = post;
};
}
private function _join(vars:Variables):void{
var prop:String;
if (!vars){
return;
};
for (prop in vars) {
this[prop] = vars[prop];
};
}
public function join(... _args):void{
var l:int = _args.length;
var i:int;
while (i < l) {
if (!(_args[i] is Variables)){
} else {
_join(_args[i]);
};
i++;
};
}
public function toString():String{
var value:String;
var p:String;
var component:String;
var i:int;
var j:int;
var priority:String;
var last:String;
var data:Array = [];
for (p in this) {
value = this[p];
if (URIencode){
value = encodeURI(value);
};
data.push(((p + "=") + value));
};
if (sort){
data.sort();
};
if (pre.length > 0){
pre.reverse();
i = 0;
while (i < pre.length) {
priority = pre[i];
j = 0;
while (j < data.length) {
component = data[j];
if (component.indexOf(priority) == 0){
data.unshift(data.splice(j, 1)[0]);
};
j++;
};
i++;
};
pre.reverse();
};
if (post.length > 0){
i = 0;
while (i < post.length) {
last = post[i];
j = 0;
while (j < data.length) {
component = data[j];
if (component.indexOf(last) == 0){
data.push(data.splice(j, 1)[0]);
};
j++;
};
i++;
};
};
return (data.join("&"));
}
public function decode(source:String):void{
var data:Array;
var prop:String;
var name:String;
var value:String;
var tmp:Array;
if (source == ""){
return;
};
if (source.indexOf("&") > -1){
data = source.split("&");
} else {
data = [source];
};
var i:int;
while (i < data.length) {
prop = data[i];
if (prop.indexOf("=") > -1){
tmp = prop.split("=");
name = tmp[0];
value = decodeURI(tmp[1]);
this[name] = value;
};
i++;
};
}
public function toURLVariables():URLVariables{
var p:String;
var urlvars:URLVariables = new URLVariables();
for (p in this) {
urlvars[p] = this[p];
};
return (urlvars);
}
}
}//package com.google.analytics.utils
Section 342
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _revision:uint;
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _minor:uint;
private var _major:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
_maxMajor = 15;
_maxMinor = 15;
_maxBuild = 0xFF;
_maxRevision = 0xFFFF;
_separator = ".";
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
private function getFields():int{
var _local1:int;
_local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local3:Version;
var _local4:Array;
_local3 = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version;
_local2 = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 343
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(account:String, debug:DebugConfiguration, jsproxy:JavascriptProxy){
var msg0:String;
var msg1:String;
var msg2:String;
super();
_account = account;
_debug = debug;
_proxy = jsproxy;
if (!_checkGAJS()){
msg0 = "";
msg0 = (msg0 + "ga.js not found, be sure to check if\n");
msg0 = (msg0 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
msg0 = (msg0 + "is included in the HTML.");
_debug.warning(msg0);
throw (new Error(msg0));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
msg1 = "";
msg1 = (msg1 + "The Google Analytics tracking code was not found on the container page\n");
msg1 = (msg1 + "we create it");
_debug.info(msg1, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(account)){
_createTrackingObject(account);
} else {
if (_checkTrackingObject(account)){
_linkTrackingObject(account);
} else {
msg2 = "";
msg2 = (msg2 + (("JS Object \"" + account) + "\" doesn't exist in DOM\n"));
msg2 = (msg2 + "Bridge object not created.");
_debug.warning(msg2);
throw (new Error(msg2));
};
};
}
public function link(targetUrl:String, useHash:Boolean=false):void{
_debug.info((((("link( " + targetUrl) + ", ") + useHash) + " )"));
_call("_link", targetUrl, useHash);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
_debug.info((("addOrganic( " + [newOrganicEngine, newOrganicKeyword].join(", ")) + " )"));
_call("_addOrganic", newOrganicEngine);
}
public function setAllowLinker(enable:Boolean):void{
_debug.info((("setAllowLinker( " + enable) + " )"));
_call("_setAllowLinker", enable);
}
private function _linkTrackingObject(path:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, path);
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
var param = 2;
if (((label) && (!((label == ""))))){
param = 3;
};
if ((((param == 3)) && (!(isNaN(value))))){
param = 4;
};
switch (param){
case 4:
_debug.info((("trackEvent( " + [category, action, label, value].join(", ")) + " )"));
return (_call("_trackEvent", category, action, label, value));
case 3:
_debug.info((("trackEvent( " + [category, action, label].join(", ")) + " )"));
return (_call("_trackEvent", category, action, label));
case 2:
default:
_debug.info((("trackEvent( " + [category, action].join(", ")) + " )"));
return (_call("_trackEvent", category, action));
};
}
public function setClientInfo(enable:Boolean):void{
_debug.info((("setClientInfo( " + enable) + " )"));
_call("_setClientInfo", enable);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_debug.info((("setCookieTimeout( " + newDefaultTimeout) + " )"));
_call("_setCookieTimeout", newDefaultTimeout);
}
public function trackPageview(pageURL:String=""):void{
_debug.info((("trackPageview( " + pageURL) + " )"));
_call("_trackPageview", pageURL);
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _checkValidTrackingObject(account:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, account));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_debug.warning((((("linkByPost( " + formObject) + ", ") + useHash) + " ) not implemented"));
}
private function _call(functionName:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + functionName));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(account:String):Boolean{
var hasObj:Boolean = _proxy.hasProperty(account);
var isTracker:Boolean = _proxy.hasProperty((account + "._getAccount"));
return (((hasObj) && (isTracker)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(newCampNameKey:String):void{
_debug.info((("setCampNameKey( " + newCampNameKey) + " )"));
_call("_setCampNameKey", newCampNameKey);
}
public function setDetectFlash(enable:Boolean):void{
_debug.info((("setDetectFlash( " + enable) + " )"));
_call("_setDetectFlash", enable);
}
public function createEventTracker(objName:String):EventTracker{
_debug.info((("createEventTracker( " + objName) + " )"));
return (new EventTracker(objName, this));
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
_debug.info((("addItem( " + [item, sku, name, category, price, quantity].join(", ")) + " )"));
_call("_addItem", item, sku, name, category, price, quantity);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(newVal:String):void{
_debug.info((("setVar( " + newVal) + " )"));
_call("_setVar", newVal);
}
public function setDomainName(newDomainName:String):void{
_debug.info((("setDomainName( " + newDomainName) + " )"));
_call("_setDomainName", newDomainName);
}
public function hasTrackingAccount(account:String):Boolean{
if (Utils.validateAccount(account)){
return (_checkValidTrackingObject(account));
};
return (_checkTrackingObject(account));
}
public function setCampSourceKey(newCampSrcKey:String):void{
_debug.info((("setCampSourceKey( " + newCampSrcKey) + " )"));
_call("_setCampSourceKey", newCampSrcKey);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):Object{
_debug.info((("addTrans( " + [orderId, affiliation, total, tax, shipping, city, state, country].join(", ")) + " )"));
_call("_addTrans", orderId, affiliation, total, tax, shipping, city, state, country);
return (null);
}
public function setCampContentKey(newCampContentKey:String):void{
_debug.info((("setCampContentKey( " + newCampContentKey) + " )"));
_call("_setCampContentKey", newCampContentKey);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(enable:Boolean):void{
_debug.info((("setAllowAnchor( " + enable) + " )"));
_call("_setAllowAnchor", enable);
}
public function setLocalGifPath(newLocalGifPath:String):void{
_debug.info((("setLocalGifPath( " + newLocalGifPath) + " )"));
_call("_setLocalGifPath", newLocalGifPath);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(newCookiePath:String):void{
_debug.info((("setCookiePath( " + newCookiePath) + " )"));
_call("_setCookiePath", newCookiePath);
}
public function setSampleRate(newRate:Number):void{
_debug.info((("setSampleRate( " + newRate) + " )"));
_call("_setSampleRate", newRate);
}
public function setAllowHash(enable:Boolean):void{
_debug.info((("setAllowHash( " + enable) + " )"));
_call("_setAllowHash", enable);
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
_debug.info((("addIgnoredOrganic( " + newIgnoredOrganicKeyword) + " )"));
_call("_addIgnoredOrganic", newIgnoredOrganicKeyword);
}
public function setCampNOKey(newCampNOKey:String):void{
_debug.info((("setCampNOKey( " + newCampNOKey) + " )"));
_call("_setCampNOKey", newCampNOKey);
}
public function cookiePathCopy(newPath:String):void{
_debug.info((("cookiePathCopy( " + newPath) + " )"));
_call("_cookiePathCopy", newPath);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(enable:Boolean):void{
_debug.info((("setDetectTitle( " + enable) + " )"));
_call("_setDetectTitle", enable);
}
private function _createTrackingObject(account:String):void{
_proxy.call(_createTrackingObject_js, account);
}
public function setCampaignTrack(enable:Boolean):void{
_debug.info((("setCampaignTrack( " + enable) + " )"));
_call("_setCampaignTrack", enable);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(newCampTermKey:String):void{
_debug.info((("setCampTermKey( " + newCampTermKey) + " )"));
_call("_setCampTermKey", newCampTermKey);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(newCampMedKey:String):void{
_debug.info((("setCampMediumKey( " + newCampMedKey) + " )"));
_call("_setCampMediumKey", newCampMedKey);
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
_debug.info((("addIgnoredRef( " + newIgnoredReferrer) + " )"));
_call("_addIgnoredRef", newIgnoredReferrer);
}
public function setSessionTimeout(newTimeout:int):void{
_debug.info((("setSessionTimeout( " + newTimeout) + " )"));
_call("_setSessionTimeout", newTimeout);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 344
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
public var hasSiteOverlay:Boolean;// = false
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
private var _trackingLimitPerSession:int;// = 500
private var _domain:Domain;
public var allowAnchor:Boolean;// = false
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_version = "4.3as";
_sampleRate = 1;
_trackingLimitPerSession = 500;
_organic = new Organic();
googleCsePath = "cse";
googleSearchParam = "q";
google = "google";
_cookieName = "analytics";
allowDomainHash = true;
allowAnchor = false;
allowLinker = false;
hasSiteOverlay = false;
tokenRate = 0.2;
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
idleLoop = 30;
idleTimeout = 60;
maxOutboundLinkExamined = 1000;
tokenCliff = 10;
bucketCapacity = 10;
detectClientInfo = true;
detectFlash = true;
detectTitle = true;
campaignKey = new CampaignKey();
campaignTracking = true;
isTrackOutboundSubdomains = false;
serverMode = ServerOperationMode.remote;
localGIFpath = "/__utm.gif";
remoteGIFpath = "http://www.google-analytics.com/__utm.gif";
secureRemoteGIFpath = "https://ssl.google-analytics.com/__utm.gif";
cookiePath = "/";
transactionFieldDelim = "|";
domainName = "";
allowLocalTracking = true;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function get cookieName():String{
return (_cookieName);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 345
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function getServiceMode():ServerOperationMode;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setCampNameKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addIgnoredOrganic(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function setAllowLinker(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function getClientInfo():Boolean;
function getDetectFlash():Boolean;
function setCampaignTrack(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function createEventTracker(void:String):EventTracker;
function setCookieTimeout(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:int):void;
function setAllowAnchor(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String=""):void;
function setLocalGifPath(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function getVersion():String;
function getLocalGifPath():String;
function setVar(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addIgnoredRef(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setClientInfo(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function setCookiePath(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setSampleRate(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Number):void;
function setSessionTimeout(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:int):void;
function setRemoteServerMode():void;
function clearIgnoredRef():void;
function setDomainName(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setDetectTitle(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function setAllowHash(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setLocalRemoteServerMode():void;
function cookiePathCopy(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 346
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.data.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _account:String;
public function Tracker(account:String, config:Configuration, debug:DebugConfiguration, info:Environment, buffer:Buffer, gifRequest:GIFRequest, adSense:AdSenseGlobals){
var msg:String;
super();
_account = account;
_config = config;
_debug = debug;
_info = info;
_buffer = buffer;
_gifRequest = gifRequest;
_adSense = adSense;
if (!Utils.validateAccount(account)){
msg = (("Account \"" + account) + "\" is not valid.");
_debug.warning(msg);
throw (new Error(msg));
};
_initData();
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
_debug.info((("addOrganic( " + [newOrganicEngine, newOrganicKeyword].join(", ")) + " )"));
_config.organic.addSource(newOrganicEngine, newOrganicKeyword);
}
public function setAllowLinker(enable:Boolean):void{
_config.allowLinker = enable;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
var success:Boolean;
var params = 2;
if (((!((category == ""))) && (!((action == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, category);
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, action);
if (((label) && (!((label == ""))))){
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, label);
params = 3;
if (!isNaN(value)){
success = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, value);
params = 4;
};
};
if (success){
_debug.info(((("valid event tracking call\ncategory: " + category) + "\naction: ") + action), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + category) + "\naction: ") + action), VisualDebugMode.geek);
success = false;
};
switch (params){
case 4:
_debug.info((("trackEvent( " + [category, action, label, value].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [category, action, label].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [category, action].join(", ")) + " )"));
};
return (success);
}
public function trackPageview(pageURL:String=""):void{
_debug.info((("trackPageview( " + pageURL) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(pageURL);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + pageURL) + " ) failed"));
};
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_config.conversionTimeout = newDefaultTimeout;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
_debug.warning("trackTrans() not implemented");
}
public function setClientInfo(enable:Boolean):void{
_config.detectClientInfo = enable;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_debug.warning((("linkByPost( " + [formObject, useHash].join(", ")) + " ) not implemented"));
}
private function _initData():void{
var data0:String;
var data:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
data0 = "";
data0 = (data0 + "_initData 0");
data0 = (data0 + ("\ndomain name: " + _config.domainName));
data0 = (data0 + ("\ndomain hash: " + _domainHash));
data0 = (data0 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(data0, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
data = "";
data = (data + "_initData (misc)");
data = (data + ("\nflash version: " + _info.flashVersion.toString(4)));
data = (data + ("\nprotocol: " + _info.protocol));
data = (data + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
data = (data + ("\nlanguage: " + _info.language));
data = (data + ("\ndomain hash: " + _getDomainHash()));
data = (data + ("\nuser-agent: " + _info.userAgent));
_debug.info(data, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(opt_xObj:X10=null):void{
var searchVariables:Variables;
var eventInfo:EventInfo;
var eventvars:Variables;
var generalvars:Variables;
_initData();
if (_takeSample()){
searchVariables = new Variables();
searchVariables.URIencode = true;
eventInfo = new EventInfo(true, _x10Module, opt_xObj);
eventvars = eventInfo.toVariables();
generalvars = _renderMetricsSearchVariables();
searchVariables.join(eventvars, generalvars);
_gifRequest.send(_account, searchVariables, false, true);
};
}
public function setDetectFlash(enable:Boolean):void{
_config.detectFlash = enable;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(newCampNameKey:String):void{
_config.campaignKey.UCCN = newCampNameKey;
var msg = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCCN]"));
} else {
_debug.info(msg);
};
}
private function _formatReferrer():String{
var domainName:String;
var ref:URL;
var dom:URL;
var referrer:String = _info.referrer;
if ((((referrer == "")) || ((referrer == "localhost")))){
referrer = "-";
} else {
domainName = _info.domainName;
ref = new URL(referrer);
dom = new URL(("http://" + domainName));
if (ref.hostName == domainName){
return ("-");
};
if (dom.domain == ref.domain){
if (dom.subDomain != ref.subDomain){
referrer = "0";
};
};
if ((((referrer.charAt(0) == "[")) && (referrer.charAt((referrer.length - 1))))){
referrer = "-";
};
};
_debug.info(("formated referrer: " + referrer), VisualDebugMode.advanced);
return (referrer);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(objName:String):EventTracker{
_debug.info((("createEventTracker( " + objName) + " )"));
return (new EventTracker(objName, this));
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
_debug.warning((("addItem( " + [item, sku, name, category, price, quantity].join(", ")) + " ) not implemented"));
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(newVal:String):void{
var variables:Variables;
if (((!((newVal == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = newVal;
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + newVal) + " )"));
if (_takeSample()){
variables = new Variables();
variables.utmt = "var";
_gifRequest.send(_account, variables);
};
} else {
_debug.warning((("setVar \"" + newVal) + "\" is ignored"));
};
}
public function setDomainName(newDomainName:String):void{
if (newDomainName == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (newDomainName == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = newDomainName;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var domainName:String;
if (_config.domain.mode == DomainNameMode.auto){
domainName = _info.domainName;
if (domainName.substring(0, 4) == "www."){
domainName = domainName.substring(4);
};
_config.domain.name = domainName;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):Object{
_debug.warning((("addTrans( " + [orderId, affiliation, total, tax, shipping, city, state, country].join(", ")) + " ) not implemented"));
return (null);
}
private function _renderMetricsSearchVariables(pageURL:String=""):Variables{
var campvars:Variables;
var variables:Variables = new Variables();
variables.URIencode = true;
var docInfo:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, pageURL, _adSense);
_debug.info(("docInfo: " + docInfo.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
campvars = _campaignInfo.toVariables();
};
var browservars:Variables = _browserInfo.toVariables();
variables.join(docInfo.toVariables(), browservars, campvars);
return (variables);
}
public function setCampContentKey(newCampContentKey:String):void{
_config.campaignKey.UCCT = newCampContentKey;
var msg = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCCT]"));
} else {
_debug.info(msg);
};
}
private function _handleCookie():void{
var data0:String;
var data1:String;
var vid:Array;
var data2:String;
if (_config.allowLinker){
};
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
data0 = "";
data0 = (data0 + "AdSense sid found\n");
data0 = (data0 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(data0, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
data1 = "";
data1 = (data1 + "AdSense sid found (new visitor)\n");
data1 = (data1 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(data1, VisualDebugMode.geek);
};
};
if (_adSense.vid){
vid = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(vid[0]);
_buffer.utma.firstTime = Number(vid[1]);
if (_debug.verbose){
data2 = "";
data2 = (data2 + "AdSense vid found (new visitor)\n");
data2 = (data2 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(vid[0])) + ")\n"));
data2 = (data2 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(vid[1])) + ")"));
_debug.info(data2, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(newCampSrcKey:String):void{
_config.campaignKey.UCSR = newCampSrcKey;
var msg = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCSR]"));
} else {
_debug.info(msg);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(newLocalGifPath:String):void{
_config.localGIFpath = newLocalGifPath;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(enable:Boolean):void{
_config.allowAnchor = enable;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var domainName:String = _config.domainName;
var g0 = (domainName.indexOf("www.google.") < 0);
var g1 = (domainName.indexOf(".google.") < 0);
var g2 = (domainName.indexOf("google.") < 0);
var g4 = (domainName.indexOf("google.org") > -1);
return (((((((((g0) || (g1))) || (g2))) || (!((_config.cookiePath == "/"))))) || (g4)));
}
public function setSampleRate(newRate:Number):void{
if (newRate < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = newRate;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(newCookiePath:String):void{
_config.cookiePath = newCookiePath;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(enable:Boolean):void{
_config.allowDomainHash = enable;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var hash:String = "";
hash = (hash + _info.appName);
hash = (hash + _info.appVersion);
hash = (hash + _info.language);
hash = (hash + _info.platform);
hash = (hash + _info.userAgent.toString());
hash = (hash + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
hash = (hash + _info.referrer);
return (Utils.generateHash(hash));
}
public function setCampNOKey(newCampNOKey:String):void{
_config.campaignKey.UCNO = newCampNOKey;
var msg = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCNO]"));
} else {
_debug.info(msg);
};
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
_debug.info((("addIgnoredOrganic( " + newIgnoredOrganicKeyword) + " )"));
_config.organic.addIgnoredKeyword(newIgnoredOrganicKeyword);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(newPath:String):void{
_debug.warning((("cookiePathCopy( " + newPath) + " ) not implemented"));
}
public function setDetectTitle(enable:Boolean):void{
_config.detectTitle = enable;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(newCampTermKey:String):void{
_config.campaignKey.UCTR = newCampTermKey;
var msg = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCTR]"));
} else {
_debug.info(msg);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(pageURL:String=""):void{
var searchVariables:Variables;
var x10vars:Variables;
var generalvars:Variables;
var eventInfo:EventInfo;
if (_takeSample()){
searchVariables = new Variables();
searchVariables.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
eventInfo = new EventInfo(false, _x10Module);
x10vars = eventInfo.toVariables();
};
generalvars = _renderMetricsSearchVariables(pageURL);
searchVariables.join(x10vars, generalvars);
_gifRequest.send(_account, searchVariables);
};
}
public function setCampaignTrack(enable:Boolean):void{
_config.campaignTracking = enable;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
_debug.info((("addIgnoredRef( " + newIgnoredReferrer) + " )"));
_config.organic.addIgnoredReferral(newIgnoredReferrer);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(newCampMedKey:String):void{
_config.campaignKey.UCMD = newCampMedKey;
var msg = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCMD]"));
} else {
_debug.info(msg);
};
}
private function _getUniqueSessionId():Number{
var sessionID:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + sessionID), VisualDebugMode.geek);
return (sessionID);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(newTimeout:int):void{
_config.sessionTimeout = newTimeout;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(targetUrl:String, useHash:Boolean=false):void{
_debug.warning((("link( " + [targetUrl, useHash].join(", ")) + " ) not implemented"));
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 347
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set config(_arg1:Configuration):void;
function isReady():Boolean;
function get mode():String;
function set debug(_arg1:DebugConfiguration):void;
function get account():String;
function set mode(_arg1:String):void;
function get config():Configuration;
function get debug():DebugConfiguration;
function set account(_arg1:String):void;
function get visualDebug():Boolean;
function set visualDebug(_arg1:Boolean):void;
}
}//package com.google.analytics
Section 348
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
public function API(){
super();
}
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 349
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_ready = false;
super();
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
return (_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function isReady():Boolean{
return (_ready);
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
var _local2:TrackerCache;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
_local2 = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense));
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 350
//JUIComponent (com.jumpeye.core.JUIComponent)
package com.jumpeye.core {
import flash.events.*;
import flash.utils.*;
import mx.flash.*;
public dynamic class JUIComponent extends UIMovieClip {
protected var callLaterMethods:Dictionary;
protected var invalidHash:Object;
protected var invalidateFlag:Boolean;// = false
public static var inCallLaterPhase:Boolean = false;
public function JUIComponent(){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
invalidHash = {};
callLaterMethods = new Dictionary();
configUI();
invalidate("all");
}
public function validateNow():void{
invalidate("all", false);
draw();
}
protected function draw():void{
this.graphics.clear();
validate();
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash["all"]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function drawNow():void{
draw();
}
public function callLater(_arg1:Function, _arg2:Array=null):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function configUI():void{
if (numChildren > 0){
removeChildAt(0);
};
this.graphics.beginFill(0, 0);
this.graphics.drawRect(0, 0, 1, 1);
stop();
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
var _local2:Dictionary = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
protected function validate():void{
invalidHash = {};
}
}
}//package com.jumpeye.core
Section 351
//FLASHEFFEvents (com.jumpeye.Events.FLASHEFFEvents)
package com.jumpeye.Events {
import flash.events.*;
public dynamic class FLASHEFFEvents extends Event {
public static const ROLL_OUT:String = "onRollOut";
public static const INIT:String = "init";
public static const TRANSITION_END:String = "onTransitionEnd";
public static const MOUSE_UP:String = "onMouseUp";
public static const ROLL_OVER:String = "onRollOver";
public static const TRANSITION_START:String = "onTransitionStart";
public static const COMPLETE:String = "complete";
public static const DOUBLE_CLICK:String = "onDoubleClick";
public static const MOUSE_DOWN:String = "onMouseDown";
public function FLASHEFFEvents(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("FLASHEFFEvents", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new FLASHEFFEvents(type, bubbles, cancelable));
}
}
}//package com.jumpeye.Events
Section 352
//FEBColorMatrixFilterPlugin (com.jumpeye.flashEff2.buttonEffect.FEBColorMatrixFilterPlugin)
package com.jumpeye.flashEff2.buttonEffect {
import flash.display.*;
import com.jumpeye.transitions.plugins.*;
public class FEBColorMatrixFilterPlugin extends Sprite {
public function FEBColorMatrixFilterPlugin(){
TweenPlugin.activate([ColorMatrixFilterPlugin]);
}
}
}//package com.jumpeye.flashEff2.buttonEffect
Section 353
//FEBCustomTintPlugin (com.jumpeye.flashEff2.buttonEffect.FEBCustomTintPlugin)
package com.jumpeye.flashEff2.buttonEffect {
import flash.display.*;
import com.jumpeye.transitions.plugins.*;
public class FEBCustomTintPlugin extends Sprite {
public function FEBCustomTintPlugin(){
TweenPlugin.activate([CustomTintPlugin]);
}
}
}//package com.jumpeye.flashEff2.buttonEffect
Section 354
//FEBFilterPlugins (com.jumpeye.flashEff2.buttonEffect.FEBFilterPlugins)
package com.jumpeye.flashEff2.buttonEffect {
import flash.display.*;
import com.jumpeye.transitions.plugins.*;
public class FEBFilterPlugins extends Sprite {
public function FEBFilterPlugins(){
TweenPlugin.activate([BlurFilterPlugin, BevelFilterPlugin, GlowFilterPlugin, DropShadowFilterPlugin]);
}
}
}//package com.jumpeye.flashEff2.buttonEffect
Section 355
//IFlashEffButtonEffect (com.jumpeye.flashEff2.core.interfaces.IFlashEffButtonEffect)
package com.jumpeye.flashEff2.core.interfaces {
import flash.display.*;
import flash.utils.*;
public class IFlashEffButtonEffect extends IFlashEffPattern {
protected var _tweenDuration:Number;// = 0.3
protected var _tweenType:String;// = "Linear"
protected var _target:DisplayObject;
protected var _easeType:String;// = "easeOut"
public function get tweenDuration():Number{
return (this._tweenDuration);
}
public function set target(_arg1:DisplayObject):void{
this._target = _arg1;
}
public function buttonRollOver():void{
}
public function remove():void{
}
public function get tweenType():String{
return (this._tweenType);
}
public function get easeType():String{
return (this._easeType);
}
public function set tweenType(_arg1:String):void{
this._tweenType = _arg1;
}
public function apply():void{
}
public function buttonPress():void{
}
protected function get easeFunc():Function{
var easeFunc:*;
try {
easeFunc = (getDefinitionByName(("com.jumpeye.transitions.easing." + this._tweenType)) as Class);
return (easeFunc[this._easeType]);
} catch(e:ReferenceError) {
throw ((("FlashEff2 WARNING: The selected ease function is not in the Library ! Please drag the " + this.tweenType) + "Ease from the Components panel over the Library panel."));
return (null);
};
return (null);
}
public function set easeType(_arg1:String):void{
this._easeType = _arg1;
}
public function get target():DisplayObject{
return (this._target);
}
public function buttonRelease():void{
}
public function set tweenDuration(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
this._tweenDuration = _arg1;
}
public function buttonRollOut():void{
}
}
}//package com.jumpeye.flashEff2.core.interfaces
Section 356
//IFlashEffCommand (com.jumpeye.flashEff2.core.interfaces.IFlashEffCommand)
package com.jumpeye.flashEff2.core.interfaces {
import flash.display.*;
public class IFlashEffCommand extends IFlashEffPattern {
protected var _target:DisplayObject;
private var _commandEventType:String;
public function get target():DisplayObject{
return (_target);
}
public function set target(_arg1:DisplayObject):void{
_target = _arg1;
}
public function get commandEventType():String{
return (this._commandEventType);
}
public function set commandEventType(_arg1:String):void{
_commandEventType = _arg1;
}
public function run():void{
}
}
}//package com.jumpeye.flashEff2.core.interfaces
Section 357
//IFlashEffFilter (com.jumpeye.flashEff2.core.interfaces.IFlashEffFilter)
package com.jumpeye.flashEff2.core.interfaces {
import flash.display.*;
public class IFlashEffFilter extends IFlashEffPattern {
protected var _target:Sprite;
public function get target():Sprite{
return (_target);
}
public function set target(_arg1:Sprite):void{
_target = _arg1;
}
public function remove():void{
}
public function apply():void{
}
}
}//package com.jumpeye.flashEff2.core.interfaces
Section 358
//IFlashEffPattern (com.jumpeye.flashEff2.core.interfaces.IFlashEffPattern)
package com.jumpeye.flashEff2.core.interfaces {
import com.jumpeye.core.*;
import flash.display.*;
public class IFlashEffPattern extends Sprite {
protected var _component:JUIComponent;
public function IFlashEffPattern(){
if (this.numChildren > 0){
this.removeChildAt(0);
};
scaleX = (scaleY = 0);
visible = false;
}
public function set component(_arg1:JUIComponent):void{
this._component = _arg1;
}
public function get component():JUIComponent{
return (this._component);
}
}
}//package com.jumpeye.flashEff2.core.interfaces
Section 359
//IFlashEffSymbol (com.jumpeye.flashEff2.core.interfaces.IFlashEffSymbol)
package com.jumpeye.flashEff2.core.interfaces {
import flash.display.*;
public class IFlashEffSymbol extends IFlashEffSymbolText {
protected var _target:DisplayObject;
public function get target():DisplayObject{
return (_target);
}
public function set target(_arg1:DisplayObject):void{
_target = _arg1;
}
}
}//package com.jumpeye.flashEff2.core.interfaces
Section 360
//IFlashEffSymbolText (com.jumpeye.flashEff2.core.interfaces.IFlashEffSymbolText)
package com.jumpeye.flashEff2.core.interfaces {
import flash.utils.*;
public class IFlashEffSymbolText extends IFlashEffPattern {
protected var _tweenDuration:Number;// = 1.7
protected var _tweenType:String;// = "Strong"
protected var _easeType:String;// = "easeInOut"
public function hide():void{
}
public function remove():void{
}
public function get tweenType():String{
return (this._tweenType);
}
public function get easeType():String{
return (this._easeType);
}
public function set tweenType(_arg1:String):void{
this._tweenType = _arg1;
}
public function set easeType(_arg1:String):void{
this._easeType = _arg1;
}
public function get easeFunc():Function{
var easeFunc:*;
try {
easeFunc = (getDefinitionByName(("com.jumpeye.transitions.easing." + this.tweenType)) as Class);
return (easeFunc[this.easeType]);
} catch(e:ReferenceError) {
throw ((("FlashEff2 WARNING: The selected ease function is not in the Library ! Please drag the " + this.tweenType) + "Ease from the Components panel over the Library panel."));
return (null);
};
return (null);
}
public function show():void{
}
public function set tweenDuration(_arg1:Number):void{
if (_arg1 < 0.001){
_arg1 = 0.001;
};
this._tweenDuration = _arg1;
}
public function get tweenDuration():Number{
return (this._tweenDuration);
}
}
}//package com.jumpeye.flashEff2.core.interfaces
Section 361
//IFlashEffText (com.jumpeye.flashEff2.core.interfaces.IFlashEffText)
package com.jumpeye.flashEff2.core.interfaces {
import flash.text.*;
public class IFlashEffText extends IFlashEffSymbolText {
protected var _partialBlurAmount:Number;// = 0
protected var _partialStart:Number;// = 50
protected var _partialGroup:String;// = "letters"
protected var _partialPercent:Number;// = 100
protected var _selectedStrings:Array;
protected var _target:TextField;
public function get partialPercent():Number{
return (this._partialPercent);
}
public function get partialBlurAmount():Number{
return (this._partialBlurAmount);
}
public function set partialPercent(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
} else {
if (_arg1 > 100){
_arg1 = 100;
};
};
this._partialPercent = _arg1;
}
public function set partialStart(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
} else {
if (_arg1 > 100){
_arg1 = 100;
};
};
this._partialStart = _arg1;
}
public function set selectedStrings(_arg1:Array):void{
this._selectedStrings = _arg1;
}
public function get target():TextField{
return (this._target);
}
public function set partialBlurAmount(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
this._partialBlurAmount = _arg1;
}
public function get partialStart():Number{
return (this._partialStart);
}
public function set target(_arg1:TextField):void{
this._target = _arg1;
}
public function get selectedStrings():Array{
return (this._selectedStrings);
}
public function set partialGroup(_arg1:String):void{
this._partialGroup = _arg1;
}
public function get partialGroup():String{
return (this._partialGroup);
}
}
}//package com.jumpeye.flashEff2.core.interfaces
Section 362
//JFESP1 (com.jumpeye.flashEff2.presets.JFESP1)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP1 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = _local7;
_local7++;
};
_local6++;
};
_local8 = _arg3;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 363
//JFESP10 (com.jumpeye.flashEff2.presets.JFESP10)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP10 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = ((((_arg3 + _arg2) - _local6) - _local7) - 2);
_local7++;
};
_local6++;
};
_local8 = ((_local6 + _local7) - 1);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 364
//JFESP11 (com.jumpeye.flashEff2.presets.JFESP11)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP11 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = (((_arg2 + _local7) - _local6) - 1);
_local7++;
};
_local6++;
};
_local8 = ((_local6 + _local7) - 1);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 365
//JFESP12 (com.jumpeye.flashEff2.presets.JFESP12)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP12 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = (((_arg3 - _local7) + _local6) - 1);
_local7++;
};
_local6++;
};
_local8 = ((_local6 + _local7) - 1);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 366
//JFESP13 (com.jumpeye.flashEff2.presets.JFESP13)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP13 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local9) {
_local7 = _local6;
while (_local7 < (_arg3 - _local6)) {
_arg4[_local6][_local7] = _local6;
_arg4[((_arg2 - _local6) - 1)][_local7] = _local6;
_local7++;
};
if (_local6 <= uint((_arg3 / 2))){
_local7 = (_local6 + 1);
while (_local7 < ((_arg2 - _local6) - 1)) {
_arg4[_local7][_local6] = _local6;
_arg4[_local7][((_arg3 - _local6) - 1)] = _local6;
_local7++;
};
};
_local6++;
};
_local8 = _local9;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 367
//JFESP14 (com.jumpeye.flashEff2.presets.JFESP14)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP14 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg2 / 2));
var _local10:uint = Math.min(_local9, (_arg3 / 2));
_local6 = 0;
while (_local6 < _local9) {
_local7 = _local6;
while (_local7 < (_arg3 - _local6)) {
_arg4[_local6][_local7] = (_local10 - _local6);
_arg4[((_arg2 - _local6) - 1)][_local7] = (_local10 - _local6);
_local7++;
};
if (_local6 <= uint((_arg3 / 2))){
_local7 = (_local6 + 1);
while (_local7 < ((_arg2 - _local6) - 1)) {
_arg4[_local7][_local6] = (_local10 - _local6);
_arg4[_local7][((_arg3 - _local6) - 1)] = (_local10 - _local6);
_local7++;
};
};
_local6++;
};
_local8 = (_local9 + 1);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 368
//JFESP15 (com.jumpeye.flashEff2.presets.JFESP15)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP15 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:int;
var _local10:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local10) {
if (_local6 <= ((_arg3 - _local6) - 1)){
_local7 = _local6;
while (_local7 <= ((_arg2 - _local6) - 2)) {
_local9++;
_arg4[_local7][_local6] = _local9;
_local7++;
};
};
_local7 = _local6;
while (_local7 <= ((_arg3 - _local6) - 1)) {
_local9++;
_arg4[((_arg2 - _local6) - 1)][_local7] = _local9;
_local7++;
};
if (((_arg3 - _local6) - 1) > _local6){
_local7 = ((_arg2 - _local6) - 2);
while (_local7 > _local6) {
_local9++;
_arg4[_local7][((_arg3 - _local6) - 1)] = _local9;
_local7--;
};
};
if (_local6 < ((_arg2 - _local6) - 1)){
_local7 = ((_arg3 - _local6) - 1);
while (_local7 > _local6) {
_local9++;
_arg4[_local6][_local7] = _local9;
_local7--;
};
};
_local6++;
};
_local8 = _local9;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 369
//JFESP16 (com.jumpeye.flashEff2.presets.JFESP16)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP16 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:* = (_arg3 * _arg2);
_local8 = _local9;
var _local10:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local10) {
if (_local6 <= ((_arg3 - _local6) - 1)){
_local7 = _local6;
while (_local7 <= ((_arg2 - _local6) - 2)) {
_local9--;
_arg4[_local7][_local6] = _local9;
_local7++;
};
};
_local7 = _local6;
while (_local7 <= ((_arg3 - _local6) - 1)) {
_local9--;
_arg4[((_arg2 - _local6) - 1)][_local7] = _local9;
_local7++;
};
if (((_arg3 - _local6) - 1) > _local6){
_local7 = ((_arg2 - _local6) - 2);
while (_local7 > _local6) {
_local9--;
_arg4[_local7][((_arg3 - _local6) - 1)] = _local9;
_local7--;
};
};
if (_local6 < ((_arg2 - _local6) - 1)){
_local7 = ((_arg3 - _local6) - 1);
while (_local7 > _local6) {
_local9--;
_arg4[_local6][_local7] = _local9;
_local7--;
};
};
_local6++;
};
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 370
//JFESP17 (com.jumpeye.flashEff2.presets.JFESP17)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP17 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = 0;
var _local10:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local10) {
if (((_arg2 - _local6) - 1) >= _local6){
_local7 = _local6;
while (_local7 <= ((_arg3 - _local6) - 1)) {
_local9++;
_arg4[_local6][_local7] = _local9;
_local7++;
};
};
if (((_arg3 - _local6) - 1) >= _local6){
_local7 = (_local6 + 1);
while (_local7 < ((_arg2 - _local6) - 1)) {
_local9++;
_arg4[_local7][((_arg3 - _local6) - 1)] = _local9;
_local7++;
};
};
if (_local6 < ((_arg3 - _local6) - 1)){
if (((_arg2 - _local6) - 1) > _local6){
_local7 = (_arg3 - _local6);
while (_local7 > _local6) {
_local9++;
_arg4[((_arg2 - _local6) - 1)][(_local7 - 1)] = _local9;
_local7--;
};
};
};
if (_local6 < ((_arg3 - _local6) - 1)){
_local7 = ((_arg2 - _local6) - 2);
while (_local7 > _local6) {
_local9++;
_arg4[_local7][_local6] = _local9;
_local7--;
};
};
_local6++;
};
_local8 = _local9;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 371
//JFESP18 (com.jumpeye.flashEff2.presets.JFESP18)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP18 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = (_arg3 * _arg2);
_local8 = _local9;
var _local10:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local10) {
if (((_arg2 - _local6) - 1) >= _local6){
_local7 = _local6;
while (_local7 <= ((_arg3 - _local6) - 1)) {
_local9--;
_arg4[_local6][_local7] = _local9;
_local7++;
};
};
if (((_arg3 - _local6) - 1) >= _local6){
_local7 = (_local6 + 1);
while (_local7 < ((_arg2 - _local6) - 1)) {
_local9--;
_arg4[_local7][((_arg3 - _local6) - 1)] = _local9;
_local7++;
};
};
if (_local6 < ((_arg3 - _local6) - 1)){
if (((_arg2 - _local6) - 1) > _local6){
_local7 = (_arg3 - _local6);
while (_local7 > _local6) {
_local9--;
_arg4[((_arg2 - _local6) - 1)][(_local7 - 1)] = _local9;
_local7--;
};
};
};
if (_local6 < ((_arg3 - _local6) - 1)){
_local7 = ((_arg2 - _local6) - 2);
while (_local7 > _local6) {
_local9--;
_arg4[_local7][_local6] = _local9;
_local7--;
};
};
_local6++;
};
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 372
//JFESP19 (com.jumpeye.flashEff2.presets.JFESP19)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP19 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = uint(((Math.random() * _arg3) * _arg2));
_local8 = Math.max(_local8, _arg4[_local6][_local7]);
_local7++;
};
_local6++;
};
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 373
//JFESP2 (com.jumpeye.flashEff2.presets.JFESP2)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP2 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = (_arg3 - _local7);
_local7++;
};
_local6++;
};
_local8 = _arg3;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 374
//JFESP20 (com.jumpeye.flashEff2.presets.JFESP20)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP20 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = ((_local6 + _local7) % 2);
_local7++;
};
_local6++;
};
_local8 = 2;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 375
//JFESP3 (com.jumpeye.flashEff2.presets.JFESP3)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP3 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = _local6;
_local7++;
};
_local6++;
};
_local8 = _arg2;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 376
//JFESP4 (com.jumpeye.flashEff2.presets.JFESP4)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP4 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = (_arg2 - _local6);
_local7++;
};
_local6++;
};
_local8 = _arg2;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 377
//JFESP5 (com.jumpeye.flashEff2.presets.JFESP5)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP5 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _local9) {
_arg4[_local6][_local7] = (_local9 - _local7);
_arg4[_local6][((_arg3 - _local7) - 1)] = (_local9 - _local7);
_local7++;
};
_local6++;
};
_local8 = (_local9 + 1);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 378
//JFESP6 (com.jumpeye.flashEff2.presets.JFESP6)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP6 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _local9) {
_arg4[_local6][_local7] = _local7;
_arg4[_local6][((_arg3 - _local7) - 1)] = _local7;
_local7++;
};
_local6++;
};
_local8 = _local9;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 379
//JFESP7 (com.jumpeye.flashEff2.presets.JFESP7)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP7 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local9) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = _local6;
_arg4[((_arg2 - _local6) - 1)][_local7] = _local6;
_local7++;
};
_local6++;
};
_local8 = _local9;
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 380
//JFESP8 (com.jumpeye.flashEff2.presets.JFESP8)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP8 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
var _local9:Number = (Math.ceil((_arg2 / 2)) - 1);
_local6 = 0;
while (_local6 <= _local9) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = (_local9 - _local6);
_arg4[((_arg2 - _local6) - 1)][_local7] = (_local9 - _local6);
_local7++;
};
_local6++;
};
_local8 = (_local9 + 1);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 381
//JFESP9 (com.jumpeye.flashEff2.presets.JFESP9)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESP9 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = (_local6 + _local7);
_local7++;
};
_local6++;
};
_local8 = ((_local6 + _local7) - 1);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 382
//JFESPM2 (com.jumpeye.flashEff2.presets.JFESPM2)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESPM2 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = ((_local6 * (_arg3 - 1)) + (_arg3 - _local7));
_local7++;
};
_local6++;
};
_local8 = (_arg2 * _arg3);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 383
//JFESPM3 (com.jumpeye.flashEff2.presets.JFESPM3)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESPM3 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = ((_local7 * (_arg2 - 1)) + _local6);
_local7++;
};
_local6++;
};
_local8 = (_arg2 * _arg3);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 384
//JFESPM4 (com.jumpeye.flashEff2.presets.JFESPM4)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESPM4 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local8:Number = 0;
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _arg3) {
_arg4[_local6][_local7] = ((_local7 * (_arg2 - 1)) + (_arg2 - _local6));
_local7++;
};
_local6++;
};
_local8 = (_arg2 * _arg3);
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 385
//JFESPM5 (com.jumpeye.flashEff2.presets.JFESPM5)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESPM5 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local10:Number;
var _local8:Number = 0;
var _local9:uint = Math.ceil((_arg3 / 2));
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _local9) {
_local10 = ((Math.ceil((_local6 * _local9)) + (_local9 - _local7)) - 1);
_arg4[_local6][_local7] = _local10;
_arg4[_local6][((_arg3 - _local7) - 1)] = _local10;
_local8 = Math.max(_local8, _local10);
_local7++;
};
_local6++;
};
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 386
//JFESPM6 (com.jumpeye.flashEff2.presets.JFESPM6)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESPM6 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local10:Number;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg3 / 2));
_local6 = 0;
while (_local6 < _arg2) {
_local7 = 0;
while (_local7 < _local9) {
_local10 = (Math.ceil((_local6 * _local9)) + _local7);
_arg4[_local6][_local7] = _local10;
_arg4[_local6][((_arg3 - _local7) - 1)] = _local10;
_local8 = Math.max(_local10, _local8);
_local7++;
};
_local6++;
};
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 387
//JFESPM7 (com.jumpeye.flashEff2.presets.JFESPM7)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESPM7 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local10:Number;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local9) {
_local7 = 0;
while (_local7 < _arg3) {
_local10 = Math.ceil(((_local7 * _local9) + _local6));
_arg4[_local6][_local7] = _local10;
_arg4[((_arg2 - _local6) - 1)][_local7] = _local10;
_local8 = Math.max(_local10, _local8);
_local7++;
};
_local6++;
};
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 388
//JFESPM8 (com.jumpeye.flashEff2.presets.JFESPM8)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFESPM8 extends Sprite {
public static function fep(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var _local6:*;
var _local7:uint;
var _local10:Number;
var _local8:Number = 0;
var _local9:Number = Math.ceil((_arg2 / 2));
_local6 = 0;
while (_local6 < _local9) {
_local7 = 0;
while (_local7 < _arg3) {
_local10 = ((Math.ceil((_local7 * _local9)) + (_local9 - _local6)) - 1);
_arg4[_local6][_local7] = _local10;
_arg4[((_arg2 - _local6) - 1)][_local7] = _local10;
_local8 = Math.max(_local10, _local8);
_local7++;
};
_local6++;
};
if (_arg5 != null){
_arg5.MAX = _local8;
};
return (_arg4);
}
}
}//package com.jumpeye.flashEff2.presets
Section 389
//JFETP10 (com.jumpeye.flashEff2.presets.JFETP10)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP10 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local8:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local8 = Math.ceil((_local6 / 2));
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local8) {
_local4[_local2][_local3] = _local3;
_local4[_local2][((_local6 - _local3) - 1)] = _local3;
_local3++;
};
_local7 = Math.max(_local7, _local8);
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 390
//JFETP11 (com.jumpeye.flashEff2.presets.JFETP11)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP11 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local8:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local8 = Math.ceil((_local6 / 2));
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local8) {
_local4[_local2][_local3] = ((_local8 - _local3) - 1);
_local4[_local2][((_local6 - _local3) - 1)] = ((_local8 - _local3) - 1);
_local3++;
};
_local7 = Math.max(_local7, _local8);
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 391
//JFETP12 (com.jumpeye.flashEff2.presets.JFETP12)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP12 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local8:Number;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local8 = Math.ceil((_local6 / 2));
_local3 = 0;
while (_local3 < _local8) {
_local4[_local2][_local3] = _local7;
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local4[_local2][((_local6 - _local3) - 1)] = _temp1;
_local3++;
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 392
//JFETP13 (com.jumpeye.flashEff2.presets.JFETP13)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP13 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local8:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = (_local5 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local8 = Math.ceil((_local6 / 2));
_local3 = 0;
while (_local3 < _local8) {
_local4[_local2][_local3] = _local7;
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local4[_local2][((_local6 - _local3) - 1)] = _temp1;
_local3++;
};
_local2--;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 393
//JFETP14 (com.jumpeye.flashEff2.presets.JFETP14)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP14 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local8:int;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local8 = Math.ceil((_local6 / 2));
_local3 = (_local8 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = _local7;
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local4[_local2][((_local6 - _local3) - 1)] = _temp1;
_local3--;
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 394
//JFETP15 (com.jumpeye.flashEff2.presets.JFETP15)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP15 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local8:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = (_local5 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local8 = Math.ceil((_local6 / 2));
_local3 = (_local8 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = _local7;
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local4[_local2][((_local6 - _local3) - 1)] = _temp1;
_local3--;
};
_local2--;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 395
//JFETP16 (com.jumpeye.flashEff2.presets.JFETP16)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP16 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
var _local8:uint = Math.ceil((_local5 / 2));
_local2 = 0;
while (_local2 < _local8) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local4[((_local5 - _local2) - 1)] = [];
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = (_local2 + (_local3 * _local8));
_local7 = Math.max(_local7, (_local2 + (_local3 * _local8)));
_local3++;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = 0;
while (_local3 < _local6) {
_local4[((_local5 - _local2) - 1)][_local3] = (_local2 + (_local3 * _local8));
_local7 = Math.max(_local7, (_local2 + (_local3 * _local8)));
_local3++;
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 396
//JFETP17 (com.jumpeye.flashEff2.presets.JFETP17)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP17 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint = Math.ceil((_local5 / 2));
var _local8:uint;
_local2 = 0;
while (_local2 < _local7) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local4[((_local5 - _local2) - 1)] = [];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = (_local2 + (((_local6 - _local3) - 1) * _local7));
_local8 = Math.max(_local8, (_local2 + (((_local6 - _local3) - 1) * _local7)));
_local3--;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[((_local5 - _local2) - 1)][_local3] = (_local2 + (((_local6 - _local3) - 1) * _local7));
_local8 = Math.max(_local8, (_local2 + (((_local6 - _local3) - 1) * _local7)));
_local3--;
};
_local2++;
};
return ({maxItems:_local8, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 397
//JFETP18 (com.jumpeye.flashEff2.presets.JFETP18)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP18 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint = Math.ceil((_local5 / 2));
var _local8:uint;
_local2 = (_local7 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local4[((_local5 - _local2) - 1)] = [];
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = (((_local7 - _local2) - 1) + (_local3 * _local7));
_local8 = Math.max(_local8, (((_local7 - _local2) - 1) + (_local3 * _local7)));
_local3++;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = 0;
while (_local3 < _local6) {
_local4[((_local5 - _local2) - 1)][_local3] = (((_local7 - _local2) - 1) + (_local3 * _local7));
_local8 = Math.max(_local8, (((_local7 - _local2) - 1) + (_local3 * _local7)));
_local3++;
};
_local2--;
};
return ({maxItems:_local8, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 398
//JFETP19 (com.jumpeye.flashEff2.presets.JFETP19)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP19 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
var _local8:uint = Math.ceil((_local5 / 2));
_local2 = (_local8 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local4[((_local5 - _local2) - 1)] = [];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = (((_local8 - _local2) - 1) + (((_local6 - _local3) - 1) * _local8));
_local7 = Math.max(_local7, (((_local8 - _local2) - 1) + (((_local6 - _local3) - 1) * _local8)));
_local3--;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[((_local5 - _local2) - 1)][_local3] = (((_local8 - _local2) - 1) + (((_local6 - _local3) - 1) * _local8));
_local7 = Math.max(_local7, (((_local8 - _local2) - 1) + (((_local6 - _local3) - 1) * _local8)));
_local3--;
};
_local2--;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 399
//JFETP2 (com.jumpeye.flashEff2.presets.JFETP2)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP2 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = (_local6 - 1);
while (_local3 > -1) {
_local4[_local2][_local3] = _local7;
_local7++;
_local3--;
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 400
//JFETP20 (com.jumpeye.flashEff2.presets.JFETP20)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP20 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:* = -1;
var _local8:uint = Math.ceil((_local5 / 2));
_local2 = 0;
while (_local2 < _local8) {
_local4[_local2] = [];
if ((_local8 + _local2) < _local5){
_local4[(_local8 + _local2)] = [];
};
_local2++;
};
_local2 = 0;
while (_local2 < _local8) {
_local6 = _arg1[_local2].length;
if (((_local5 - _local2) - 1) >= _local2){
_local3 = _local2;
while (_local3 <= ((_local6 - _local2) - 1)) {
if (isNaN(_local4[_local2][_local3])){
_local7++;
_local4[_local2][_local3] = _local7;
};
_local3++;
};
};
_local6 = _arg1[_local2].length;
_local3 = _local2;
while (_local3 < ((_local5 - _local2) - 1)) {
_local6 = _arg1[_local3].length;
if (((_local6 - _local2) - 1) > _local2){
if (isNaN(_local4[_local3][((_local6 - _local2) - 1)])){
_local7++;
_local4[_local3][((_local6 - _local2) - 1)] = _local7;
};
};
_local3++;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
if (((_local5 - _local2) - 1) > _local2){
_local3 = (_local6 - _local2);
while (_local3 > _local2) {
if (isNaN(_local4[((_local5 - _local2) - 1)][(_local3 - 1)])){
_local7++;
_local4[((_local5 - _local2) - 1)][(_local3 - 1)] = _local7;
};
_local3--;
};
};
_local3 = ((_local5 - _local2) - 2);
while (_local3 > _local2) {
_local6 = _arg1[_local3].length;
if (_local2 < _local6){
if (isNaN(_local4[_local3][_local2])){
_local7++;
_local4[_local3][_local2] = _local7;
};
};
_local3--;
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 401
//JFETP21 (com.jumpeye.flashEff2.presets.JFETP21)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP21 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
var _local8:uint = Math.ceil((_local5 / 2));
_local2 = 0;
while (_local2 < _local5) {
_local4[_local2] = [];
_local7 = (_local7 + _arg1[_local2].length);
_local2++;
};
var _local9:uint = _local7;
_local2 = 0;
while (_local2 < _local8) {
_local6 = _arg1[_local2].length;
_local3 = _local2;
while (_local3 <= ((_local5 - _local2) - 2)) {
_local6 = _arg1[_local3].length;
if (_local2 < _local6){
if (isNaN(_local4[_local3][_local2])){
_local7--;
_local4[_local3][_local2] = _local7;
};
};
_local3++;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = _local2;
while (_local3 <= ((_local6 - _local2) - 1)) {
_local6 = _arg1[((_local5 - _local2) - 1)].length;
if (isNaN(_local4[((_local5 - _local2) - 1)][_local3])){
_local7--;
_local4[((_local5 - _local2) - 1)][_local3] = _local7;
};
_local3++;
};
_local3 = ((_local5 - _local2) - 2);
while (_local3 > _local2) {
_local6 = _arg1[_local3].length;
if (((_local6 - _local2) - 1) > _local2){
if (isNaN(_local4[_local3][((_local6 - _local2) - 1)])){
_local7--;
_local4[_local3][((_local6 - _local2) - 1)] = _local7;
};
};
_local3--;
};
_local6 = _arg1[_local2].length;
if (_local2 < ((_local5 - _local2) - 1)){
_local3 = ((_local6 - _local2) - 1);
while (_local3 > _local2) {
if (isNaN(_local4[_local2][_local3])){
_local7--;
_local4[_local2][_local3] = _local7;
};
_local3--;
};
};
_local2++;
};
return ({maxItems:_local9, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 402
//JFETP22 (com.jumpeye.flashEff2.presets.JFETP22)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP22 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7 = -1;
var _local8:uint = Math.ceil((_local5 / 2));
_local2 = 0;
while (_local2 < _local8) {
_local4[_local2] = [];
if ((_local8 + _local2) < _local5){
_local4[(_local8 + _local2)] = [];
};
_local2++;
};
_local2 = 0;
while (_local2 < _local8) {
_local3 = _local2;
while (_local3 <= ((_local5 - _local2) - 2)) {
_local6 = _arg1[_local3].length;
if ((_local2 <= ((_local6 - _local2) - 1))){
if (isNaN(_local4[_local3][_local2])){
_local7++;
_local4[_local3][_local2] = _local7;
};
};
_local3++;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = _local2;
while (_local3 <= ((_local6 - _local2) - 1)) {
_local6 = _arg1[((_local5 - _local2) - 1)].length;
if (isNaN(_local4[((_local5 - _local2) - 1)][_local3])){
_local7++;
_local4[((_local5 - _local2) - 1)][_local3] = _local7;
};
_local3++;
};
_local3 = ((_local5 - _local2) - 2);
while (_local3 > _local2) {
_local6 = _arg1[_local3].length;
if (((_local6 - _local2) - 1) > _local2){
if (isNaN(_local4[_local3][((_local6 - _local2) - 1)])){
_local7++;
_local4[_local3][((_local6 - _local2) - 1)] = _local7;
};
};
_local3--;
};
_local6 = _arg1[_local2].length;
if (_local2 < ((_local5 - _local2) - 1)){
_local3 = ((_local6 - _local2) - 1);
while (_local3 > _local2) {
if (isNaN(_local4[_local2][_local3])){
_local7++;
_local4[_local2][_local3] = _local7;
};
_local3--;
};
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 403
//JFETP23 (com.jumpeye.flashEff2.presets.JFETP23)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP23 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7 = -1;
var _local8:uint = Math.ceil((_local5 / 2));
_local2 = 0;
while (_local2 < _local5) {
_local4[_local2] = [];
_local7 = (_local7 + _arg1[_local2].length);
_local2++;
};
var _local9:int = _local7;
_local2 = 0;
while (_local2 < _local8) {
_local6 = _arg1[_local2].length;
if (((_local5 - _local2) - 1) >= _local2){
_local3 = _local2;
while (_local3 <= ((_local6 - _local2) - 1)) {
if (isNaN(_local4[_local2][_local3])){
_local7--;
_local4[_local2][_local3] = _local7;
};
_local3++;
};
};
_local6 = _arg1[_local2].length;
_local3 = _local2;
while (_local3 < ((_local5 - _local2) - 1)) {
_local6 = _arg1[_local3].length;
if (((_local6 - _local2) - 1) >= _local2){
if (isNaN(_local4[_local3][((_local6 - _local2) - 1)])){
_local7--;
_local4[_local3][((_local6 - _local2) - 1)] = _local7;
};
};
_local3++;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
if (_local2 <= ((_local6 - _local2) - 1)){
if (((_local5 - _local2) - 1) > _local2){
_local3 = (_local6 - _local2);
while (_local3 > _local2) {
if (isNaN(_local4[((_local5 - _local2) - 1)][(_local3 - 1)])){
_local7--;
_local4[((_local5 - _local2) - 1)][(_local3 - 1)] = _local7;
};
_local3--;
};
};
};
_local3 = ((_local5 - _local2) - 2);
while (_local3 > _local2) {
_local6 = _arg1[_local3].length;
if (_local2 < _local6){
if (isNaN(_local4[_local3][_local2])){
_local7--;
_local4[_local3][_local2] = _local7;
};
};
_local3--;
};
_local2++;
};
return ({maxItems:_local9, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 404
//JFETP24 (com.jumpeye.flashEff2.presets.JFETP24)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP24 extends Sprite {
public static function jtpFill(_arg1, _arg2, _arg3:Array):Array{
var _local4:Number = _arg3[_arg1][_arg2];
if (((isNaN(_arg3[(_arg1 - 1)][_arg2])) || ((_arg3[(_arg1 - 1)][_arg2] > (_local4 + 1))))){
_arg3[(_arg1 - 1)][_arg2] = (_local4 + 1);
jtpFill((_arg1 - 1), _arg2, _arg3);
};
if (((isNaN(_arg3[(_arg1 + 1)][_arg2])) || ((_arg3[(_arg1 + 1)][_arg2] > (_local4 + 1))))){
_arg3[(_arg1 + 1)][_arg2] = (_local4 + 1);
jtpFill((_arg1 + 1), _arg2, _arg3);
};
if (((isNaN(_arg3[_arg1][(_arg2 - 1)])) || ((_arg3[_arg1][(_arg2 - 1)] > (_local4 + 1))))){
_arg3[_arg1][(_arg2 - 1)] = (_local4 + 1);
jtpFill(_arg1, (_arg2 - 1), _arg3);
};
if (((isNaN(_arg3[_arg1][(_arg2 + 1)])) || ((_arg3[_arg1][(_arg2 + 1)] > (_local4 + 1))))){
_arg3[_arg1][(_arg2 + 1)] = (_local4 + 1);
jtpFill(_arg1, (_arg2 + 1), _arg3);
};
return (_arg3);
}
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local14:Number;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
var _local8:Number = Math.ceil((_local5 / 2));
var _local9:Array = [];
var _local10:Number = 0;
var _local11:int;
_local2 = 0;
while (_local2 < _local5) {
_local4[_local2] = [];
_local9[_local2] = [];
_local14 = _arg1[_local2].length;
_local7 = (_local7 + _local14);
_local10 = Math.max(_local10, _local14);
_local2++;
};
_local9[_local5] = [];
_local9[(_local5 + 1)] = [];
var _local12:Number = Math.ceil((_local10 / 2));
_local2 = 0;
while (_local2 <= (_local5 + 1)) {
_local9[_local2][0] = -1;
_local9[_local2][(_local10 + 1)] = -1;
_local2++;
};
_local2 = 0;
while (_local2 <= (_local10 + 1)) {
_local9[0][_local2] = -1;
_local9[(_local5 + 1)][_local2] = -1;
_local2++;
};
_local9[_local8][_local12] = 0;
jtpFill(_local8, _local12, _local9);
_local11 = 0;
var _local13:Number = Math.max(_local9[1][1], _local9[1][_local10]);
_local13 = Math.max(_local13, _local9[_local5][1]);
_local13 = Math.max(_local13, _local9[_local5][_local10]);
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = (_local13 - _local9[(_local2 + 1)][(_local3 + 1)]);
_local11 = Math.max(_local11, _local4[_local2][_local3]);
_local3++;
};
_local2++;
};
return ({maxItems:_local11, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 405
//JFETP25 (com.jumpeye.flashEff2.presets.JFETP25)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP25 extends Sprite {
public static function jtpFill(_arg1, _arg2, _arg3:Array):Array{
var _local4:Number = _arg3[_arg1][_arg2];
if (((isNaN(_arg3[(_arg1 - 1)][_arg2])) || ((_arg3[(_arg1 - 1)][_arg2] > (_local4 + 1))))){
_arg3[(_arg1 - 1)][_arg2] = (_local4 + 1);
jtpFill((_arg1 - 1), _arg2, _arg3);
};
if (((isNaN(_arg3[(_arg1 + 1)][_arg2])) || ((_arg3[(_arg1 + 1)][_arg2] > (_local4 + 1))))){
_arg3[(_arg1 + 1)][_arg2] = (_local4 + 1);
jtpFill((_arg1 + 1), _arg2, _arg3);
};
if (((isNaN(_arg3[_arg1][(_arg2 - 1)])) || ((_arg3[_arg1][(_arg2 - 1)] > (_local4 + 1))))){
_arg3[_arg1][(_arg2 - 1)] = (_local4 + 1);
jtpFill(_arg1, (_arg2 - 1), _arg3);
};
if (((isNaN(_arg3[_arg1][(_arg2 + 1)])) || ((_arg3[_arg1][(_arg2 + 1)] > (_local4 + 1))))){
_arg3[_arg1][(_arg2 + 1)] = (_local4 + 1);
jtpFill(_arg1, (_arg2 + 1), _arg3);
};
return (_arg3);
}
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local13:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:Number = Math.ceil((_local5 / 2));
var _local8:Array = [];
var _local9:Number = 0;
var _local10:int;
var _local11:int;
_local2 = 0;
while (_local2 < _local5) {
_local4[_local2] = [];
_local8[_local2] = [];
_local13 = _arg1[_local2].length;
_local10 = (_local10 + _local13);
_local9 = Math.max(_local9, _local13);
_local2++;
};
_local8[_local5] = [];
_local8[(_local5 + 1)] = [];
var _local12:uint = Math.ceil((_local9 / 2));
_local2 = 0;
while (_local2 <= (_local5 + 1)) {
_local8[_local2][0] = -1;
_local8[_local2][(_local9 + 1)] = -1;
_local2++;
};
_local2 = 0;
while (_local2 <= (_local9 + 1)) {
_local8[0][_local2] = -1;
_local8[(_local5 + 1)][_local2] = -1;
_local2++;
};
_local8[_local7][_local12] = 0;
jtpFill(_local7, _local12, _local8);
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = _local8[(_local2 + 1)][(_local3 + 1)];
_local11 = Math.max(_local11, _local4[_local2][_local3]);
_local3++;
};
_local2++;
};
return ({maxItems:_local11, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 406
//JFETP26 (com.jumpeye.flashEff2.presets.JFETP26)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP26 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = _local2;
_local3++;
};
_local7 = (_local7 + _local6);
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 407
//JFETP27 (com.jumpeye.flashEff2.presets.JFETP27)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP27 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = ((_local5 - _local2) - 1);
_local3++;
};
_local7 = (_local7 + _local6);
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 408
//JFETP28 (com.jumpeye.flashEff2.presets.JFETP28)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP28 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = (Math.random() * _local5);
_local3++;
};
_local7 = (_local7 + _local6);
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 409
//JFETP29 (com.jumpeye.flashEff2.presets.JFETP29)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP29 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:Number = Math.ceil((_local5 / 2));
var _local8:uint;
_local2 = 0;
while (_local2 < _local7) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local4[((_local5 - _local2) - 1)] = [];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = _local2;
_local8 = Math.max(_local8, (_local2 + 1));
_local3--;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[((_local5 - _local2) - 1)][_local3] = _local2;
_local8 = Math.max(_local8, (_local2 + 1));
_local3--;
};
_local2++;
};
return ({maxItems:_local8, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 410
//JFETP3 (com.jumpeye.flashEff2.presets.JFETP3)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = (_local5 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local6) {
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local4[_local2][_local3] = _temp1;
_local3++;
};
_local2--;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 411
//JFETP30 (com.jumpeye.flashEff2.presets.JFETP30)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP30 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:Number = Math.ceil((_local5 / 2));
var _local8:uint;
_local2 = 0;
while (_local2 < _local7) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local4[((_local5 - _local2) - 1)] = [];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = ((_local7 - _local2) - 1);
_local8 = Math.max(_local8, (_local7 - _local2));
_local3--;
};
_local6 = _arg1[((_local5 - _local2) - 1)].length;
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[((_local5 - _local2) - 1)][_local3] = ((_local7 - _local2) - 1);
_local8 = Math.max(_local8, (_local7 - _local2));
_local3--;
};
_local2++;
};
return ({maxItems:_local8, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 412
//JFETP3D10 (com.jumpeye.flashEff2.presets.JFETP3D10)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D10 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (textOwnerClip.width + textOwnerClip.height);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((-(_arg1) - _arg2));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 413
//JFETP3D11 (com.jumpeye.flashEff2.presets.JFETP3D11)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D11 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (textOwnerClip.width + textOwnerClip.height);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return (-(((textOwnerClip.width - _arg1) + _arg2)));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 414
//JFETP3D12 (com.jumpeye.flashEff2.presets.JFETP3D12)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D12 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (textOwnerClip.width + textOwnerClip.height);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return (-(((textOwnerClip.height - _arg2) + _arg1)));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 415
//JFETP3D13 (com.jumpeye.flashEff2.presets.JFETP3D13)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D13 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (textOwnerClip.width + textOwnerClip.height);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return (-(((propOwner.teorecticSpace + _arg1) + _arg2)));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 416
//JFETP3D14 (com.jumpeye.flashEff2.presets.JFETP3D14)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D14 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.width;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((-(Math.random()) * propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 417
//JFETP3D15 (com.jumpeye.flashEff2.presets.JFETP3D15)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D15 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (Math.sqrt(((textOwnerClip.width * textOwnerClip.width) + (textOwnerClip.height * textOwnerClip.height))) / 2);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
var _local6:Number = (_arg1 - _arg3);
var _local7:Number = (_arg2 - _arg4);
return (-(Math.sqrt(Math.abs((((propOwner.teorecticSpace * propOwner.teorecticSpace) - (_local6 * _local6)) - (_local7 * _local7))))));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 418
//JFETP3D16 (com.jumpeye.flashEff2.presets.JFETP3D16)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D16 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (Math.sqrt(((textOwnerClip.width * textOwnerClip.width) + (textOwnerClip.height * textOwnerClip.height))) / 2);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
var _local6:Number = (_arg1 - _arg3);
var _local7:Number = (_arg2 - _arg4);
return ((Math.sqrt(Math.abs((((propOwner.teorecticSpace * propOwner.teorecticSpace) - (_local6 * _local6)) - (_local7 * _local7)))) - propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 419
//JFETP3D17 (com.jumpeye.flashEff2.presets.JFETP3D17)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D17 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.height;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((_arg2 - propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 420
//JFETP3D18 (com.jumpeye.flashEff2.presets.JFETP3D18)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D18 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.height;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return (-(_arg2));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 421
//JFETP3D19 (com.jumpeye.flashEff2.presets.JFETP3D19)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D19 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.width;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((-(Math.random()) * propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 422
//JFETP3D2 (com.jumpeye.flashEff2.presets.JFETP3D2)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D2 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (Math.sqrt(((textOwnerClip.width * textOwnerClip.width) + (textOwnerClip.height * textOwnerClip.height))) / 2);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
var _local6:Number = (_arg1 - _arg3);
var _local7:Number = (_arg2 - _arg4);
return (-(Math.sqrt(Math.abs((((propOwner.teorecticSpace * propOwner.teorecticSpace) - (_local6 * _local6)) - (_local7 * _local7))))));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 423
//JFETP3D3 (com.jumpeye.flashEff2.presets.JFETP3D3)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D3 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (Math.sqrt(((textOwnerClip.width * textOwnerClip.width) + (textOwnerClip.height * textOwnerClip.height))) / 2);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
var _local6:Number = (_arg1 - _arg3);
var _local7:Number = (_arg2 - _arg4);
return ((Math.sqrt(Math.abs((((propOwner.teorecticSpace * propOwner.teorecticSpace) - (_local6 * _local6)) - (_local7 * _local7)))) - propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 424
//JFETP3D4 (com.jumpeye.flashEff2.presets.JFETP3D4)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D4 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (textOwnerClip.width / 2);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
var _local6:Number = (_arg1 - _arg3);
var _local7:Number = (_arg2 - _arg4);
var _local8:Number = propOwner.teorecticSpace;
return ((Math.sqrt(((_local8 * _local8) - (_local6 * _local6))) - propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 425
//JFETP3D5 (com.jumpeye.flashEff2.presets.JFETP3D5)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D5 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = (textOwnerClip.width / 2);
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
var _local6:Number = (_arg1 - _arg3);
var _local7:Number = (_arg2 - _arg4);
var _local8:Number = propOwner.teorecticSpace;
return (-(Math.sqrt(((_local8 * _local8) - (_local6 * _local6)))));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 426
//JFETP3D6 (com.jumpeye.flashEff2.presets.JFETP3D6)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D6 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.width;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return (-(_arg1));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 427
//JFETP3D7 (com.jumpeye.flashEff2.presets.JFETP3D7)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D7 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.width;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((_arg1 - propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 428
//JFETP3D8 (com.jumpeye.flashEff2.presets.JFETP3D8)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D8 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.height;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((_arg2 - propOwner.teorecticSpace));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 429
//JFETP3D9 (com.jumpeye.flashEff2.presets.JFETP3D9)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP3D9 extends Sprite {
public static function fep(_arg1:Object, _arg2:Sprite):void{
var propOwner = _arg1;
var textOwnerClip = _arg2;
propOwner.teorecticSpace = textOwnerClip.height;
propOwner.getZPosition = function (_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return (-(_arg2));
};
}
}
}//package com.jumpeye.flashEff2.presets
Section 430
//JFETP4 (com.jumpeye.flashEff2.presets.JFETP4)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP4 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = (_local5 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = (_local6 - 1);
while (_local3 > -1) {
var _temp1 = _local7;
_local7 = (_local7 + 1);
_local4[_local2][_local3] = _temp1;
_local3--;
};
_local2--;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 431
//JFETP5 (com.jumpeye.flashEff2.presets.JFETP5)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP5 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = (_local2 + _local3);
_local7 = Math.max(_local7, (_local2 + _local3));
_local3++;
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 432
//JFETP6 (com.jumpeye.flashEff2.presets.JFETP6)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP6 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = ((_local2 + _local6) - _local3);
_local7 = Math.max(_local7, ((_local2 + _local6) - _local3));
_local3--;
};
_local2++;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 433
//JFETP7 (com.jumpeye.flashEff2.presets.JFETP7)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP7 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = (_local5 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local6) {
_local4[_local2][_local3] = ((_local5 - _local2) + _local3);
_local7 = Math.max(_local7, ((_local5 - _local2) + _local3));
_local3++;
};
_local2--;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 434
//JFETP8 (com.jumpeye.flashEff2.presets.JFETP8)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP8 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:uint;
_local2 = (_local5 - 1);
while (_local2 >= 0) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = (((_local5 - _local2) + _local6) - _local3);
_local7 = Math.max(_local7, (((_local5 - _local2) + _local6) - _local3));
_local3--;
};
_local2--;
};
return ({maxItems:_local7, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 435
//JFETP9 (com.jumpeye.flashEff2.presets.JFETP9)
package com.jumpeye.flashEff2.presets {
import flash.display.*;
public class JFETP9 extends Sprite {
public static function fep(_arg1:Array):Object{
var _local2:*;
var _local3:int;
var _local6:uint;
var _local8:uint;
var _local9:Number;
var _local10:*;
var _local4:Array = [];
var _local5:uint = _arg1.length;
var _local7:Array = [];
_local2 = 0;
while (_local2 < _local5) {
_local6 = _arg1[_local2].length;
_local4[_local2] = [];
_local3 = 0;
while (_local3 < _local6) {
_local7.push({i:_local2, j:_local3, id:_local7.length});
_local3++;
};
_local2++;
};
_local8 = _local7.length;
while (_local7.length != 0) {
_local9 = _local7.length;
_local10 = Math.floor((Math.random() * _local9));
_local4[_local7[_local10].i][_local7[_local10].j] = (_local9 - 1);
_local7.splice(_local10, 1);
};
return ({maxItems:_local8, timeMatrix:_local4});
}
}
}//package com.jumpeye.flashEff2.presets
Section 436
//FESRoundedSquareScale (com.jumpeye.flashEff2.symbol.squareEffect.FESRoundedSquareScale)
package com.jumpeye.flashEff2.symbol.squareEffect {
import com.jumpeye.Events.*;
import com.jumpeye.core.*;
import flash.display.*;
import flash.geom.*;
import com.jumpeye.flashEff2.core.interfaces.*;
import com.jumpeye.transitions.*;
import flash.utils.*;
public class FESRoundedSquareScale extends IFlashEffSymbol {
protected var col:Number;// = 0
protected var tweensFinished:Number;// = 0
private var _delay:Number;// = 100
protected var maskObjects:Object;
private var _squareHeight:Number;// = 35
protected var lin:Number;// = 0
protected var finalSquareWidth:Number;// = 40
private var _groupDuration:Number;// = 1.2
public var forceSquareDimension:Boolean;// = false
private var maskClip:Sprite;
private var _squareWidth:Number;// = 35
protected var targetBounds:Rectangle;
protected var timeMatrix:Array;
private var _cornerRadius:Number;// = 25
protected var finalSquareHeight:Number;// = 40
private var _preset:Number;// = 9
public function FESRoundedSquareScale(_arg1:JUIComponent=null){
this.component = _arg1;
this.init();
}
public function set preset(_arg1:Number):void{
this._preset = _arg1;
}
override public function hide():void{
if (this.component != null){
this.startTransition(false);
};
}
override public function remove():void{
var _local1:*;
var _local2:*;
var _local3:Object;
if (this.maskClip != null){
if (this.maskClip.parent != null){
this.maskClip.parent.removeChild(this.maskClip);
};
this.maskClip = null;
this.target.mask = null;
};
if (this.maskObjects != null){
_local1 = 0;
while (_local1 < this.lin) {
_local2 = 0;
while (_local2 < this.col) {
_local3 = this.maskObjects[((("clip" + _local1) + "_") + _local2)];
clearInterval(_local3.interval);
TweenLite.killTweensOf(_local3.clip, false);
_local2++;
};
_local1++;
};
};
this.maskObjects = null;
this.timeMatrix = null;
}
public function set cornerRadius(_arg1:Number):void{
if (_arg1 < 0.001){
_arg1 = 0.001;
};
this._cornerRadius = _arg1;
}
public function set squareWidth(_arg1:Number){
if (_arg1 < 1){
_arg1 = 1;
};
this._squareWidth = _arg1;
this.finalSquareWidth = _arg1;
}
public function set squareHeight(_arg1:Number){
if (_arg1 < 1){
_arg1 = 1;
};
this._squareHeight = _arg1;
this.finalSquareHeight = _arg1;
}
protected function drawSquares(_arg1:Sprite, _arg2:uint):void{
var _local4:uint;
var _local5:*;
this.timeMatrix = [];
this.maskObjects = {};
var _local3:uint;
while (_local3 < this.lin) {
this.timeMatrix[_local3] = [];
_local4 = 0;
while (_local4 < this.col) {
this.timeMatrix[_local3][_local4] = 0;
_local5 = new Sprite();
_local5.name = ((("clip" + _local3) + "_") + _local4);
this.maskObjects[((("clip" + _local3) + "_") + _local4)] = {clip:_local5};
_local5.x = (((this.targetBounds.x * this.target.scaleX) + (_local4 * this.finalSquareWidth)) + (this.finalSquareWidth / 2));
_local5.y = (((this.targetBounds.y * this.target.scaleY) + (_local3 * this.finalSquareHeight)) + (this.finalSquareHeight / 2));
this.createRectangle(_local5, this.finalSquareWidth, this.finalSquareHeight);
_arg1.addChild(_local5);
_local5.scaleX = (_local5.scaleY = _arg2);
_local4++;
};
_local3++;
};
}
protected function createRectangle(_arg1:Sprite, _arg2:Number, _arg3:Number):void{
var aux:*;
var _w:*;
var _h:*;
var clip = _arg1;
var _wid = _arg2;
var _hei = _arg3;
var _local5 = clip.graphics;
with (_local5) {
beginFill(0xFF0000, 100);
lineStyle(1, 0xFF0000, 10);
_w = (-((_wid + 1)) / 2);
_h = (-((_hei + 1)) / 2);
drawRoundRect(Math.ceil((_w - (this.cornerRadius / 2))), Math.ceil((_h - (this.cornerRadius / 2))), Math.ceil((_wid + this.cornerRadius)), Math.ceil((_hei + this.cornerRadius)), this.cornerRadius);
endFill();
};
}
public function get cornerRadius():Number{
return (this._cornerRadius);
}
public function get squareHeight():Number{
return (this._squareHeight);
}
public function get squareWidth():Number{
return (this._squareWidth);
}
public function set groupDuration(_arg1:Number):void{
if (_arg1 < 0.001){
_arg1 = 0.001;
};
this._groupDuration = _arg1;
}
protected function startTransition(_arg1:Boolean):void{
var _local4:*;
var _local5:uint;
var _local7:Number;
var _local8:Object;
if (this.squareHeight > this.target.height){
this.squareHeight = this.target.height;
};
if (this.squareWidth > this.target.width){
this.squareWidth = this.target.width;
};
this.targetBounds = this.target.getBounds(this.target);
if (this.squareHeight > this.targetBounds.height){
this.finalSquareHeight = this.targetBounds.height;
};
if (this.squareWidth > this.targetBounds.width){
this.finalSquareWidth = this.targetBounds.width;
};
this.lin = Math.floor(((this.targetBounds.height / this.finalSquareHeight) * this.target.scaleY));
this.col = Math.floor(((this.targetBounds.width / this.finalSquareWidth) * this.target.scaleX));
if (forceSquareDimension == false){
if ((lin * col) > 1600){
this.lin = Math.min(this.lin, 40);
this.col = Math.min(this.col, 40);
};
};
this.finalSquareHeight = ((this.targetBounds.height / this.lin) * this.target.scaleY);
this.finalSquareWidth = ((this.targetBounds.width / this.col) * this.target.scaleX);
var _local2:Number = 1;
var _local3:Number = 0;
if (_arg1 == true){
_local2 = 0;
_local3 = 1;
};
maskClip = new Sprite();
maskClip.name = "maskClip";
maskClip.x = this.target.x;
maskClip.y = this.target.y;
maskClip.rotation = this.target.rotation;
maskClip.visible = false;
this.component.targetOwner.addChild(maskClip);
this.target.mask = maskClip;
drawSquares(maskClip, _local2);
this.tweensFinished = 0;
var _local6:Object = {};
JFESquarePresets.getPresetsArray(this.preset, this.lin, this.col, this.timeMatrix, _local6);
if (_local6.MAX > 2){
_local7 = Math.max(((this.tweenDuration - this.groupDuration) / (_local6.MAX - 1)), 0);
} else {
_local7 = Math.max((this.tweenDuration - this.groupDuration), 0);
};
_local4 = 0;
while (_local4 < this.lin) {
_local5 = 0;
while (_local5 < this.col) {
_local8 = this.maskObjects[((("clip" + _local4) + "_") + _local5)];
TweenLite.to(_local8.clip, this.groupDuration, {scaleX:_local3, scaleY:_local3, delay:(this.timeMatrix[_local4][_local5] * _local7), ease:this.easeFunc, onComplete:motionFinish});
_local5++;
};
_local4++;
};
this.component.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_START));
}
protected function motionFinish():void{
tweensFinished++;
if (tweensFinished == (this.lin * this.col)){
this.component.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_END));
};
}
protected function init():void{
_tweenDuration = 1.8;
_tweenType = "Strong";
_easeType = "easeInOut";
}
public function get groupDuration():Number{
return (this._groupDuration);
}
public function get preset():Number{
return (this._preset);
}
override public function show():void{
if (this.component != null){
this.startTransition(true);
};
}
}
}//package com.jumpeye.flashEff2.symbol.squareEffect
Section 437
//JFESquarePresets (com.jumpeye.flashEff2.symbol.squareEffect.JFESquarePresets)
package com.jumpeye.flashEff2.symbol.squareEffect {
import flash.utils.*;
public dynamic class JFESquarePresets {
public function JFESquarePresets():void{
}
public static function getPresetsArray(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var i:*;
var j:uint;
var presetClass:Class;
var presetFunc:*;
var preset = _arg1;
var lin = _arg2;
var col = _arg3;
var matrix = _arg4;
var timeLineSquares = _arg5;
var max:Number = 0;
try {
presetClass = (getDefinitionByName(("com.jumpeye.flashEff2.presets.JFESP" + preset)) as Class);
presetFunc = presetClass["fep"];
if (presetFunc != null){
return (presetFunc(preset, lin, col, matrix, timeLineSquares));
};
} catch(e:Error) {
if (preset > 1){
trace((("FLASHEFF2 WARNING: The selected preset is not in the Library ! Please drag the JFESP" + preset) + " from the Components panel over the Library panel."));
};
i = 0;
while (i < lin) {
j = 0;
while (j < col) {
matrix[i][j] = j;
j = (j + 1);
};
i = (i + 1);
};
max = col;
};
if (timeLineSquares != null){
timeLineSquares.MAX = max;
};
return (matrix);
}
public static function getModifiedPresetsArray(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array, _arg5:Object=null):Array{
var i:*;
var j:uint;
var presetClass:Class;
var presetFunc:*;
var preset = _arg1;
var lin = _arg2;
var col = _arg3;
var matrix = _arg4;
var timeLineSquares = _arg5;
var max:Number = 0;
if (preset > 8){
return (JFESquarePresets.getPresetsArray(preset, lin, col, matrix, timeLineSquares));
};
try {
presetClass = (getDefinitionByName(("com.jumpeye.flashEff2.presets.JFESPM" + preset)) as Class);
presetFunc = presetClass["fep"];
if (presetFunc != null){
return (presetFunc(preset, lin, col, matrix, timeLineSquares));
};
} catch(e:Error) {
if (preset > 1){
trace((("FLASHEFF2 WARNING: The selected preset is not in the Library ! Please drag the JFESPM" + preset) + " from the Components panel over the Library panel."));
};
i = 0;
while (i < lin) {
j = 0;
while (j < col) {
matrix[i][j] = ((i * (col - 1)) + j);
j = (j + 1);
};
i = (i + 1);
};
max = (col * lin);
};
if (timeLineSquares != null){
timeLineSquares.MAX = max;
};
return (matrix);
}
}
}//package com.jumpeye.flashEff2.symbol.squareEffect
Section 438
//FeTDefaultFade (com.jumpeye.flashEff2.text.defaultFade.FeTDefaultFade)
package com.jumpeye.flashEff2.text.defaultFade {
import flash.events.*;
import com.jumpeye.Events.*;
import com.jumpeye.core.*;
import com.jumpeye.flashEff2.core.interfaces.*;
import flash.utils.*;
import flash.filters.*;
public class FeTDefaultFade extends IFlashEffSymbol {
private var _partialStart:Number;// = 50
private var _partialBlurAmount:Number;// = 0
protected var delay:Number;
protected var finishPos:uint;
protected var time:Number;// = 0
protected var startPos:uint;
protected var duration:Number;// = 1
protected var tweenTimer:Timer;
protected var change:int;
protected var isTimer:Boolean;// = false
public function FeTDefaultFade(_arg1:JUIComponent=null){
this.component = _arg1;
_easeType = "easeOut";
_tweenType = "Quadratic";
}
override public function remove():void{
if (this.tweenTimer != null){
this.tweenTimer.removeEventListener(TimerEvent.TIMER, timerHandler);
};
if (this.component != null){
this.component.removeEventListener(Event.ENTER_FRAME, enterFrame);
};
this.tweenTimer = null;
if (this.target != null){
this.target.filters = [];
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.time = (this.time + this.delay);
if (this.time > this.duration){
this.time = this.duration;
this.tweenTimer.removeEventListener(TimerEvent.TIMER, timerHandler);
this.isTimer = false;
};
}
public function set partialStart(_arg1:Number):void{
this._partialStart = _arg1;
}
public function get partialBlurAmount():Number{
return (this._partialBlurAmount);
}
protected function startTransition(_arg1:Boolean=true):void{
startPos = 1;
finishPos = 0;
if (_arg1 == true){
startPos = 0;
finishPos = 1;
};
this.change = (finishPos - startPos);
this.target.alpha = startPos;
this.duration = ((this.tweenDuration * (1 - (this.partialStart / 100))) * 1000);
if (duration <= 0){
duration = 1;
};
this.delay = 30;
if (duration > (this.delay / 2)){
this.tweenTimer = new Timer(delay);
this.tweenTimer.addEventListener(TimerEvent.TIMER, timerHandler);
this.time = 0;
this.isTimer = true;
this.tweenTimer.start();
this.component.addEventListener(Event.ENTER_FRAME, enterFrame);
} else {
this.time = this.duration;
this.enterFrame();
};
}
public function set partialBlurAmount(_arg1:Number):void{
this._partialBlurAmount = _arg1;
}
public function get partialStart():Number{
return (this._partialStart);
}
override public function hide():void{
if (this.target != null){
this.startTransition(false);
};
}
protected function enterFrame(_arg1:Event=null):void{
var _local6:FLASHEFFEvents;
var _local2:Number = (((this.change * this.time) / this.duration) + this.startPos);
this.target.alpha = _local2;
var _local3:Number = (this.partialBlurAmount * (1 - _local2));
var _local4:BitmapFilter = new BlurFilter(_local3, _local3, 2);
var _local5:Array = new Array();
_local5.push(_local4);
this.target.filters = _local5;
if (this.isTimer == false){
this.remove();
_local6 = new FLASHEFFEvents("defaultPatternFinish");
this.component.dispatchEvent(_local6);
};
}
protected function motionFinish(_arg1:Event):void{
}
override public function show():void{
if (this.target != null){
this.startTransition(true);
};
}
}
}//package com.jumpeye.flashEff2.text.defaultFade
Section 439
//FeChar (com.jumpeye.flashEff2.text.FeChar)
package com.jumpeye.flashEff2.text {
import flash.display.*;
import flash.text.*;
public dynamic class FeChar extends Sprite {
private var _id:Number;
private var _textField:TextField;
private var _properties:Object;
private var _bottomPosition:Number;
private var _htmlText:String;// = ""
private var _type:String;// = "FeChar"
public function FeChar(_arg1:Number, _arg2:Number, _arg3:Object){
init();
this.text = ((_arg3.text) || (""));
this.id = _arg3.id;
this.x = _arg1;
this.y = _arg2;
this.properties = _arg3;
this.textField.embedFonts = true;
}
public function get textField():TextField{
return (_textField);
}
private function init(){
this.textField = new TextField();
this.textField.autoSize = TextFieldAutoSize.LEFT;
this.textField.selectable = false;
this.addChild(this.textField);
}
public function set text(_arg1:String):void{
this.textField.text = _arg1;
_htmlText = _arg1;
}
public function get id():Number{
return (this._id);
}
private function renewPositions(){
this.y = ((this.y + this.bottomPosition) - this.textField.getLineMetrics(0).ascent);
}
public function set textField(_arg1:TextField):void{
_textField = _arg1;
}
public function set bottomPosition(_arg1:Number):void{
_bottomPosition = _arg1;
}
public function applyTextFormat(_arg1:TextFormat):void{
_arg1.leading = 0;
_arg1.leftMargin = 0;
_arg1.rightMargin = 0;
_arg1.letterSpacing = 0;
_arg1.indent = 0;
_arg1.blockIndent = 0;
_arg1.align = "left";
this.textField.setTextFormat(_arg1);
if (this.textField.getTextFormat().italic == true){
this.textField.autoSize = TextFieldAutoSize.LEFT;
this.textField.width = (this.textField.width + (this.textField.height * 0.2125));
this.textField.autoSize = TextFieldAutoSize.NONE;
};
this.renewPositions();
}
public function get text():String{
return (this.textField.text);
}
public function set htmlText(_arg1:String):void{
trace(_arg1);
this.textField.htmlText = _arg1;
_htmlText = _arg1;
}
public function get properties():Object{
return (this._properties);
}
public function get bottomPosition():Number{
return (_bottomPosition);
}
public function set properties(_arg1:Object):void{
this._properties = _arg1;
}
public function set id(_arg1:Number):void{
this._id = _arg1;
}
public function get htmlText():String{
return (_htmlText);
}
public function get type():String{
return (this._type);
}
}
}//package com.jumpeye.flashEff2.text
Section 440
//FeGroup (com.jumpeye.flashEff2.text.FeGroup)
package com.jumpeye.flashEff2.text {
import flash.utils.*;
public dynamic class FeGroup extends FeTable {
private var _type:String;// = "FeGroup"
private var _id:Number;
private var _text:String;
private var _properties:Object;
public function FeGroup(_arg1:Number, _arg2:Number, _arg3:Object){
init();
this.x = ((_arg1) || (0));
this.y = ((_arg2) || (0));
this.text = _arg3.text;
this.id = _arg3.id;
this.properties = _arg3;
}
public function set properties(_arg1:Object):void{
this._properties = _arg1;
}
public function set text(_arg1:String):void{
this._text = _arg1;
}
public function get text():String{
return (this._text);
}
override public function set childs(_arg1:Array):void{
var className:String;
var classInstance:Class;
var child:*;
var arg = _arg1;
var len:uint = arg.length;
var i:uint;
while (i < len) {
className = arg[i].type;
try {
classInstance = (getDefinitionByName(("com.jumpeye.flashEff2.text." + className)) as Class);
child = new classInstance(arg[i].x, arg[i].y, arg[i]);
this.addChild(child);
this._childs.push(arg);
} catch(e) {
throw (e);
};
i = (i + 1);
};
}
private function init(){
}
public function get properties():Object{
return (this._properties);
}
public function set id(_arg1:Number):void{
this._id = _arg1;
}
override public function get childs():Array{
return (super.childs);
}
override public function get type():String{
return (this._type);
}
public function get id():Number{
return (this._id);
}
}
}//package com.jumpeye.flashEff2.text
Section 441
//FeTable (com.jumpeye.flashEff2.text.FeTable)
package com.jumpeye.flashEff2.text {
import flash.display.*;
import flash.utils.*;
public class FeTable extends Sprite {
private var tempChar:FeChar;
private var tempGroup:FeGroup;
private var _type:String;// = "FeTable"
protected var _childs:Array;
public function FeTable(){
init();
_childs = [];
}
public function cleanMe():void{
var _local2:*;
var _local1:* = 0;
while (_local1 < this._childs.length) {
_local2 = this._childs[_local1];
if (_local2.type != "FeChar"){
_local2.cleanMe();
};
if (_local2.numChildren == 0){
this.removeChildAtIndex(_local1);
} else {
_local1++;
};
};
}
public function pushChild(_arg1:Object):Object{
var classInstance:Class;
var child:*;
var arg = _arg1;
var className:String = arg.type;
try {
classInstance = (getDefinitionByName(("com.jumpeye.flashEff2.text." + className)) as Class);
child = new classInstance(arg.x, arg.y, arg);
this.addChild(child);
this._childs.push(child);
} catch(e) {
throw (e);
};
return (child);
}
public function removeChildAtIndex(_arg1:uint):Object{
this.removeChildAt(_arg1);
return (this._childs.splice(_arg1, 1)[0]);
}
public function set childs(_arg1:Array):void{
var _local2:uint = _arg1.length;
this._childs = [];
var _local3:uint;
while (_local3 < _local2) {
this.pushChild(_arg1[_local3]);
_local3++;
};
}
private function init(){
}
public function get childs():Array{
return (_childs);
}
public function get type():String{
return (this._type);
}
public function removeChilds():void{
var _local1:uint = this._childs.length;
var _local2:uint;
while (_local2 < _local1) {
if (this._childs[_local2].type == "FeGroup"){
this._childs[_local2].removeChilds();
};
this.removeChild(this._childs[_local2]);
_local2++;
};
this._childs = [];
}
}
}//package com.jumpeye.flashEff2.text
Section 442
//Back (com.jumpeye.transitions.easing.Back)
package com.jumpeye.transitions.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 443
//Bounce (com.jumpeye.transitions.easing.Bounce)
package com.jumpeye.transitions.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 444
//Circular (com.jumpeye.transitions.easing.Circular)
package com.jumpeye.transitions.easing {
public class Circular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 445
//Cubic (com.jumpeye.transitions.easing.Cubic)
package com.jumpeye.transitions.easing {
public class Cubic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 446
//Elastic (com.jumpeye.transitions.easing.Elastic)
package com.jumpeye.transitions.easing {
public class Elastic {
private static const _2PI:Number = (Math.PI * 2);
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 447
//Exponential (com.jumpeye.transitions.easing.Exponential)
package com.jumpeye.transitions.easing {
public class Exponential {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 448
//Linear (com.jumpeye.transitions.easing.Linear)
package com.jumpeye.transitions.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.jumpeye.transitions.easing
Section 449
//Quadratic (com.jumpeye.transitions.easing.Quadratic)
package com.jumpeye.transitions.easing {
public class Quadratic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 450
//Quartic (com.jumpeye.transitions.easing.Quartic)
package com.jumpeye.transitions.easing {
public class Quartic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 451
//Quintic (com.jumpeye.transitions.easing.Quintic)
package com.jumpeye.transitions.easing {
public class Quintic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 452
//Sine (com.jumpeye.transitions.easing.Sine)
package com.jumpeye.transitions.easing {
public class Sine {
private static const _HALF_PI:Number = (Math.PI / 2);
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * _HALF_PI))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * _HALF_PI))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 453
//Strong (com.jumpeye.transitions.easing.Strong)
package com.jumpeye.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.jumpeye.transitions.easing
Section 454
//BevelFilterPlugin (com.jumpeye.transitions.plugins.BevelFilterPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package com.jumpeye.transitions.plugins
Section 455
//BlurFilterPlugin (com.jumpeye.transitions.plugins.BlurFilterPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package com.jumpeye.transitions.plugins
Section 456
//ColorMatrixFilterPlugin (com.jumpeye.transitions.plugins.ColorMatrixFilterPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.01;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = ColorMatrixFilter;
var _local4:Object = _arg2;
initFilter({}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
var _local5:Array = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
}
}//package com.jumpeye.transitions.plugins
Section 457
//CustomTintPlugin (com.jumpeye.transitions.plugins.CustomTintPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import flash.geom.*;
import com.jumpeye.transitions.*;
import fl.motion.*;
import flash.filters.*;
import com.jumpeye.transitions.utils.tween.*;
public class CustomTintPlugin extends TweenPlugin {
protected var _color:Color;
protected var _matrixTween:EndArrayPlugin;
protected var _matrix:Array;
protected var _target:DisplayObject;
protected var _tintMultiplier:Number;// = 0
public static const VERSION:Number = 1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function CustomTintPlugin(){
this.propName = "customTint";
this.overwriteProps = ["customTint"];
}
public function init(_arg1:DisplayObject, _arg2:Color):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_color[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_color, _local4, _color[_local4], (_arg2[_local4] - _color[_local4]), "customTint", true);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:Object = _arg2;
var _local5:Color = new Color();
var _local6:ColorTransform = (_arg1 as DisplayObject).transform.colorTransform;
_color = new Color(_local6.redMultiplier, _local6.greenMultiplier, _local6.blueMultiplier, _local6.alphaMultiplier, _local6.redOffset, _local6.greenOffset, _local6.blueOffset, _local6.alphaOffset);
var _local7:Number = _local4.amount;
if (isNaN(_local7)){
_local7 = 1;
};
_local5.setTint(((_local4.tintColor) || (_color.tintColor)), _local7);
init((_arg1 as DisplayObject), _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.transform.colorTransform = _color;
}
}
}//package com.jumpeye.transitions.plugins
Section 458
//DropShadowFilterPlugin (com.jumpeye.transitions.plugins.DropShadowFilterPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject));
return (true);
}
}
}//package com.jumpeye.transitions.plugins
Section 459
//EndArrayPlugin (com.jumpeye.transitions.plugins.EndArrayPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
import com.jumpeye.transitions.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
}
}//package com.jumpeye.transitions.plugins
Section 460
//FilterPlugin (com.jumpeye.transitions.plugins.FilterPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
import flash.filters.*;
import com.jumpeye.transitions.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local3:Array = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var _local7:Object = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package com.jumpeye.transitions.plugins
Section 461
//GlowFilterPlugin (com.jumpeye.transitions.plugins.GlowFilterPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package com.jumpeye.transitions.plugins
Section 462
//HexColorsPlugin (com.jumpeye.transitions.plugins.HexColorsPlugin)
package com.jumpeye.transitions.plugins {
import flash.display.*;
import com.jumpeye.transitions.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package com.jumpeye.transitions.plugins
Section 463
//TweenPlugin (com.jumpeye.transitions.plugins.TweenPlugin)
package com.jumpeye.transitions.plugins {
import com.jumpeye.transitions.*;
import com.jumpeye.transitions.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package com.jumpeye.transitions.plugins
Section 464
//ArrayTweenInfo (com.jumpeye.transitions.utils.tween.ArrayTweenInfo)
package com.jumpeye.transitions.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package com.jumpeye.transitions.utils.tween
Section 465
//TweenInfo (com.jumpeye.transitions.utils.tween.TweenInfo)
package com.jumpeye.transitions.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package com.jumpeye.transitions.utils.tween
Section 466
//TweenLite (com.jumpeye.transitions.TweenLite)
package com.jumpeye.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import com.jumpeye.transitions.utils.tween.*;
import com.jumpeye.transitions.plugins.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.09;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_tlInitted){
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && ((this.target is TweenLite)))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.jumpeye.transitions
Section 467
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintColor:Number;// = 0
private var _tintMultiplier:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
private function deriveTintColor():uint{
var _local1:Number = (1 / this.tintMultiplier);
var _local2:uint = Math.round((this.redOffset * _local1));
var _local3:uint = Math.round((this.greenOffset * _local1));
var _local4:uint = Math.round((this.blueOffset * _local1));
var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function set brightness(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
var _local2:Number = (1 - Math.abs(_arg1));
var _local3:Number = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
private function parseXML(_arg1:XML=null):Color{
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
var _local2:XML = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function setTint(_arg1:uint, _arg2:Number):void{
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number = (1 - _arg3);
var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 468
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public function Back(){
super();
}
public static function easeOut(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{
t = ((t / d) - 1);
return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b));
}
public static function easeIn(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{
t = (t / d);
return (((((c * t) * t) * (((s + 1) * t) - s)) + b));
}
public static function easeInOut(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{
t = (t / (d / 2));
if (t < 1){
s = (s * 1.525);
return ((((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b));
};
t = (t - 2);
s = (s * 1.525);
return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b));
}
}
}//package gs.easing
Section 469
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent($type:String, $info:Object=null, $bubbles:Boolean=false, $cancelable:Boolean=false){
super($type, $bubbles, $cancelable);
this.info = $info;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 470
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
super();
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function killProps($lookup:Object):void{
super.killProps($lookup);
_tweenVisible = !(Boolean(("visible" in $lookup)));
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_tween = $tween;
_visible = Boolean(!(($value == 0)));
_tweenVisible = true;
addTween($target, "alpha", $target.alpha, $value, "alpha");
return (true);
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 471
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import flash.filters.*;
import gs.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
super();
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = BevelFilter;
initFilter($value, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, (($value.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 472
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps($lookup:Object):void{
var p:String;
for (p in _beziers) {
if ((p in $lookup)){
delete _beziers[p];
};
};
super.killProps($lookup);
}
protected function init($tween:TweenLite, $beziers:Array, $through:Boolean):void{
var i:int;
var p:String;
_target = $tween.target;
if ($tween.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if (($tween.exposedVars.orientToBezier is Array)){
_orientData = $tween.exposedVars.orientToBezier;
_orient = true;
};
};
var props:Object = {};
i = 0;
while (i < $beziers.length) {
for (p in $beziers[i]) {
if (props[p] == undefined){
props[p] = [$tween.target[p]];
};
if (typeof($beziers[i][p]) == "number"){
props[p].push($beziers[i][p]);
} else {
props[p].push(($tween.target[p] + Number($beziers[i][p])));
};
};
i++;
};
for (p in props) {
this.overwriteProps[this.overwriteProps.length] = p;
if ($tween.exposedVars[p] != undefined){
if (typeof($tween.exposedVars[p]) == "number"){
props[p].push($tween.exposedVars[p]);
} else {
props[p].push(($tween.target[p] + Number($tween.exposedVars[p])));
};
delete $tween.exposedVars[p];
i = ($tween.tweens.length - 1);
while (i > -1) {
if ($tween.tweens[i].name == p){
$tween.tweens.splice(i, 1);
};
i--;
};
};
};
_beziers = parseBeziers(props, $through);
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($value is Array)){
return (false);
};
init($tween, ($value as Array), false);
return (true);
}
override public function set changeFactor($n:Number):void{
var i:int;
var p:String;
var b:Object;
var t:Number;
var segments:uint;
var val:Number;
var neg:int;
var oldTarget:Object;
var oldRound:Boolean;
var dx:Number;
var dy:Number;
var cotb:Array;
var toAdd:Number;
if ($n == 1){
for (p in _beziers) {
i = (_beziers[p].length - 1);
_target[p] = _beziers[p][i][2];
};
} else {
for (p in _beziers) {
segments = _beziers[p].length;
if ($n < 0){
i = 0;
} else {
if ($n >= 1){
i = (segments - 1);
} else {
i = int((segments * $n));
};
};
t = (($n - (i * (1 / segments))) * segments);
b = _beziers[p][i];
if (this.round){
val = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
neg = ((val)<0) ? -1 : 1;
_target[p] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
} else {
_target[p] = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
};
};
};
if (_orient){
oldTarget = _target;
oldRound = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = ($n + 0.01);
_target = oldTarget;
this.round = oldRound;
_orient = true;
i = 0;
while (i < _orientData.length) {
cotb = _orientData[i];
toAdd = ((cotb[3]) || (0));
dx = (_future[cotb[0]] - _target[cotb[0]]);
dy = (_future[cotb[1]] - _target[cotb[1]]);
_target[cotb[2]] = ((Math.atan2(dy, dx) * _RAD2DEG) + toAdd);
i++;
};
};
}
public static function parseBeziers($props:Object, $through:Boolean=false):Object{
var i:int;
var a:Array;
var b:Object;
var p:String;
var all:Object = {};
if ($through){
for (p in $props) {
a = $props[p];
b = [];
all[p] = b;
if (a.length > 2){
b[b.length] = [a[0], (a[1] - ((a[2] - a[0]) / 4)), a[1]];
i = 1;
while (i < (a.length - 1)) {
b[b.length] = [a[i], (a[i] + (a[i] - b[(i - 1)][1])), a[(i + 1)]];
i++;
};
} else {
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
} else {
for (p in $props) {
a = $props[p];
b = [];
all[p] = b;
if (a.length > 3){
b[b.length] = [a[0], a[1], ((a[1] + a[2]) / 2)];
i = 2;
while (i < (a.length - 2)) {
b[b.length] = [b[(i - 2)][2], a[i], ((a[i] + a[(i + 1)]) / 2)];
i++;
};
b[b.length] = [b[(b.length - 1)][2], a[(a.length - 2)], a[(a.length - 1)]];
} else {
if (a.length == 3){
b[b.length] = [a[0], a[1], a[2]];
} else {
if (a.length == 2){
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
};
};
};
return (all);
}
}
}//package gs.plugins
Section 473
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
super();
this.propName = "bezierThrough";
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($value is Array)){
return (false);
};
init($tween, ($value as Array), true);
return (true);
}
}
}//package gs.plugins
Section 474
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import flash.filters.*;
import gs.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
super();
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = BlurFilter;
initFilter($value, new BlurFilter(0, 0, (($value.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 475
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import flash.filters.*;
import gs.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.1;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
super();
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = ColorMatrixFilter;
var cmf:Object = $value;
initFilter({remove:$value.remove, index:$value.index, addFilter:$value.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
var endMatrix:Array = [];
if (((!((cmf.matrix == null))) && ((cmf.matrix is Array)))){
endMatrix = cmf.matrix;
} else {
if (cmf.relative == true){
endMatrix = _matrix.slice();
} else {
endMatrix = _idMatrix.slice();
};
endMatrix = setBrightness(endMatrix, cmf.brightness);
endMatrix = setContrast(endMatrix, cmf.contrast);
endMatrix = setHue(endMatrix, cmf.hue);
endMatrix = setSaturation(endMatrix, cmf.saturation);
endMatrix = setThreshold(endMatrix, cmf.threshold);
if (!isNaN(cmf.colorize)){
endMatrix = colorize(endMatrix, cmf.colorize, cmf.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, endMatrix);
return (true);
}
override public function set changeFactor($n:Number):void{
_matrixTween.changeFactor = $n;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = $n;
}
public static function setSaturation($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
var inv:Number = (1 - $n);
var r:Number = (inv * _lumR);
var g:Number = (inv * _lumG);
var b:Number = (inv * _lumB);
var temp:Array = [(r + $n), g, b, 0, 0, r, (g + $n), b, 0, 0, r, g, (b + $n), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function setHue($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
$n = ($n * (Math.PI / 180));
var c:Number = Math.cos($n);
var s:Number = Math.sin($n);
var temp:Array = [((_lumR + (c * (1 - _lumR))) + (s * -(_lumR))), ((_lumG + (c * -(_lumG))) + (s * -(_lumG))), ((_lumB + (c * -(_lumB))) + (s * (1 - _lumB))), 0, 0, ((_lumR + (c * -(_lumR))) + (s * 0.143)), ((_lumG + (c * (1 - _lumG))) + (s * 0.14)), ((_lumB + (c * -(_lumB))) + (s * -0.283)), 0, 0, ((_lumR + (c * -(_lumR))) + (s * -((1 - _lumR)))), ((_lumG + (c * -(_lumG))) + (s * _lumG)), ((_lumB + (c * (1 - _lumB))) + (s * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(temp, $m));
}
public static function setThreshold($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
var temp:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function applyMatrix($m:Array, $m2:Array):Array{
var y:int;
var x:int;
if (((!(($m is Array))) || (!(($m2 is Array))))){
return ($m2);
};
var temp:Array = [];
var i:int;
var z:int;
y = 0;
while (y < 4) {
x = 0;
while (x < 5) {
if (x == 4){
z = $m[(i + 4)];
} else {
z = 0;
};
temp[(i + x)] = ((((($m[i] * $m2[x]) + ($m[(i + 1)] * $m2[(x + 5)])) + ($m[(i + 2)] * $m2[(x + 10)])) + ($m[(i + 3)] * $m2[(x + 15)])) + z);
x++;
};
i = (i + 5);
y++;
};
return (temp);
}
public static function colorize($m:Array, $color:Number, $amount:Number=1):Array{
if (isNaN($color)){
return ($m);
};
if (isNaN($amount)){
$amount = 1;
};
var r:Number = ((($color >> 16) & 0xFF) / 0xFF);
var g:Number = ((($color >> 8) & 0xFF) / 0xFF);
var b:Number = (($color & 0xFF) / 0xFF);
var inv:Number = (1 - $amount);
var temp:Array = [(inv + (($amount * r) * _lumR)), (($amount * r) * _lumG), (($amount * r) * _lumB), 0, 0, (($amount * g) * _lumR), (inv + (($amount * g) * _lumG)), (($amount * g) * _lumB), 0, 0, (($amount * b) * _lumR), (($amount * b) * _lumG), (inv + (($amount * b) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function setBrightness($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
$n = (($n * 100) - 100);
return (applyMatrix([1, 0, 0, 0, $n, 0, 1, 0, 0, $n, 0, 0, 1, 0, $n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], $m));
}
public static function setContrast($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
$n = ($n + 0.01);
var temp:Array = [$n, 0, 0, 0, (128 * (1 - $n)), 0, $n, 0, 0, (128 * (1 - $n)), 0, 0, $n, 0, (128 * (1 - $n)), 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
}
}//package gs.plugins
Section 476
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import flash.filters.*;
import gs.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
super();
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = DropShadowFilter;
initFilter($value, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, (($value.quality) || (2)), $value.inner, $value.knockout, $value.hideObject));
return (true);
}
}
}//package gs.plugins
Section 477
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init($start:Array, $end:Array):void{
_a = $start;
var i:int = ($end.length - 1);
while (i > -1) {
if (((!(($start[i] == $end[i]))) && (!(($start[i] == null))))){
_info[_info.length] = new ArrayTweenInfo(i, _a[i], ($end[i] - _a[i]));
};
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((!(($target is Array))) || (!(($value is Array))))){
return (false);
};
init(($target as Array), $value);
return (true);
}
override public function set changeFactor($n:Number):void{
var i:int;
var ti:ArrayTweenInfo;
var val:Number;
var neg:int;
if (this.round){
i = (_info.length - 1);
while (i > -1) {
ti = _info[i];
val = (ti.start + (ti.change * $n));
neg = ((val)<0) ? -1 : 1;
_a[ti.index] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
i--;
};
} else {
i = (_info.length - 1);
while (i > -1) {
ti = _info[i];
_a[ti.index] = (ti.start + (ti.change * $n));
i--;
};
};
}
}
}//package gs.plugins
Section 478
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import flash.filters.*;
import gs.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function FilterPlugin(){
super();
}
public function onCompleteTween():void{
var i:int;
var filters:Array;
if (_remove){
filters = _target.filters;
if (!(filters[_index] is _type)){
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
filters.splice(i, 1);
break;
};
i--;
};
} else {
filters.splice(_index, 1);
};
_target.filters = filters;
};
}
protected function initFilter($props:Object, $default:BitmapFilter):void{
var p:String;
var i:int;
var colorTween:HexColorsPlugin;
var filters:Array = _target.filters;
_index = -1;
if ($props.index != null){
_index = $props.index;
} else {
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
_index = i;
break;
};
i--;
};
};
if ((((((_index == -1)) || ((filters[_index] == null)))) || (($props.addFilter == true)))){
_index = (($props.index)!=null) ? $props.index : filters.length;
filters[_index] = $default;
_target.filters = filters;
};
_filter = filters[_index];
_remove = Boolean(($props.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var props:Object = (($props.isTV)==true) ? $props.exposedVars : $props;
for (p in props) {
if (((((((((!((p in _filter))) || ((_filter[p] == props[p])))) || ((p == "remove")))) || ((p == "index")))) || ((p == "addFilter")))){
} else {
if ((((((p == "color")) || ((p == "highlightColor")))) || ((p == "shadowColor")))){
colorTween = new HexColorsPlugin();
colorTween.initColor(_filter, p, _filter[p], props[p]);
_tweens[_tweens.length] = new TweenInfo(colorTween, "changeFactor", 0, 1, p, false);
} else {
if ((((((((p == "quality")) || ((p == "inner")))) || ((p == "knockout")))) || ((p == "hideObject")))){
_filter[p] = props[p];
} else {
addTween(_filter, p, _filter[p], props[p], p);
};
};
};
};
}
override public function set changeFactor($n:Number):void{
var i:int;
var ti:TweenInfo;
var filters:Array = _target.filters;
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
ti.target[ti.property] = (ti.start + (ti.change * $n));
i--;
};
if (!(filters[_index] is _type)){
_index = (filters.length - 1);
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
_index = i;
break;
};
i--;
};
};
filters[_index] = _filter;
_target.filters = filters;
}
}
}//package gs.plugins
Section 479
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
super();
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((!(($target is MovieClip))) || (isNaN($value)))){
return (false);
};
_target = ($target as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, $value, "frame");
return (true);
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 480
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import flash.filters.*;
import gs.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
super();
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = GlowFilter;
initFilter($value, new GlowFilter(0xFFFFFF, 0, 0, 0, (($value.strength) || (1)), (($value.quality) || (2)), $value.inner, $value.knockout));
return (true);
}
}
}//package gs.plugins
Section 481
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
super();
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps($lookup:Object):void{
var i:int = (_colors.length - 1);
while (i > -1) {
if ($lookup[_colors[i][1]] != undefined){
_colors.splice(i, 1);
};
i--;
};
super.killProps($lookup);
}
public function initColor($target:Object, $propName:String, $start:uint, $end:uint):void{
var r:Number;
var g:Number;
var b:Number;
if ($start != $end){
r = ($start >> 16);
g = (($start >> 8) & 0xFF);
b = ($start & 0xFF);
_colors[_colors.length] = [$target, $propName, r, (($end >> 16) - r), g, ((($end >> 8) & 0xFF) - g), b, (($end & 0xFF) - b)];
this.overwriteProps[this.overwriteProps.length] = $propName;
};
}
override public function set changeFactor($n:Number):void{
var i:int;
var a:Array;
i = (_colors.length - 1);
while (i > -1) {
a = _colors[i];
a[0][a[1]] = ((((a[2] + ($n * a[3])) << 16) | ((a[4] + ($n * a[5])) << 8)) | (a[6] + ($n * a[7])));
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var p:String;
for (p in $value) {
initColor($target, p, uint($target[p]), uint($value[p]));
};
return (true);
}
}
}//package gs.plugins
Section 482
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
super();
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 483
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
super();
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add($object:Object, $propName:String, $start:Number, $change:Number):void{
addTween($object, $propName, $start, ($start + $change), $propName);
this.overwriteProps[this.overwriteProps.length] = $propName;
}
}
}//package gs.plugins
Section 484
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
super();
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var p:String;
if (typeof($value) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (p in $value) {
initRotation($target, p, $target[p], $value[p]);
};
return (true);
}
public function initRotation($target:Object, $propName:String, $start:Number, $end:Number):void{
var dif:Number = (($end - $start) % 360);
if (dif != (dif % 180)){
dif = ((dif)<0) ? (dif + 360) : (dif - 360);
};
addTween($target, $propName, $start, ($start + dif), $propName);
this.overwriteProps[this.overwriteProps.length] = $propName;
}
}
}//package gs.plugins
Section 485
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
super();
this.propName = "tint";
this.overwriteProps = ["tint"];
}
public function init($target:DisplayObject, $end:ColorTransform):void{
var i:int;
var p:String;
_target = $target;
_ct = _target.transform.colorTransform;
i = (_props.length - 1);
while (i > -1) {
p = _props[i];
if (_ct[p] != $end[p]){
_tweens[_tweens.length] = new TweenInfo(_ct, p, _ct[p], ($end[p] - _ct[p]), "tint", false);
};
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($target is DisplayObject)){
return (false);
};
var end:ColorTransform = new ColorTransform();
if (((!(($value == null))) && (!(($tween.exposedVars.removeTint == true))))){
end.color = uint($value);
};
_ignoreAlpha = true;
init(($target as DisplayObject), end);
return (true);
}
override public function set changeFactor($n:Number):void{
var ct:ColorTransform;
updateTweens($n);
if (_ignoreAlpha){
ct = _target.transform.colorTransform;
_ct.alphaMultiplier = ct.alphaMultiplier;
_ct.alphaOffset = ct.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
}
}//package gs.plugins
Section 486
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens($changeFactor:Number):void{
var i:int;
var ti:TweenInfo;
var val:Number;
var neg:int;
if (this.round){
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
val = (ti.start + (ti.change * $changeFactor));
neg = ((val)<0) ? -1 : 1;
ti.target[ti.property] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
i--;
};
} else {
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
ti.target[ti.property] = (ti.start + (ti.change * $changeFactor));
i--;
};
};
}
public function set changeFactor($n:Number):void{
updateTweens($n);
_changeFactor = $n;
}
protected function addTween($object:Object, $propName:String, $start:Number, $end, $overwriteProp:String=null):void{
var change:Number;
if ($end != null){
change = ((typeof($end))=="number") ? ($end - $start) : Number($end);
if (change != 0){
_tweens[_tweens.length] = new TweenInfo($object, $propName, $start, change, (($overwriteProp) || ($propName)), false);
};
};
}
public function killProps($lookup:Object):void{
var i:int;
i = (this.overwriteProps.length - 1);
while (i > -1) {
if ((this.overwriteProps[i] in $lookup)){
this.overwriteProps.splice(i, 1);
};
i--;
};
i = (_tweens.length - 1);
while (i > -1) {
if ((_tweens[i].name in $lookup)){
_tweens.splice(i, 1);
};
i--;
};
}
public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
addTween($target, this.propName, $target[this.propName], $value, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate($plugins:Array):Boolean{
var i:int;
var instance:Object;
i = ($plugins.length - 1);
while (i > -1) {
instance = new ($plugins[i]);
TweenLite.plugins[instance.propName] = $plugins[i];
i--;
};
return (true);
}
}
}//package gs.plugins
Section 487
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
super();
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_tween = $tween;
_visible = Boolean($value);
return (true);
}
override public function set changeFactor($n:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 488
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
super();
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((isNaN($value)) || (!($target.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = $target;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, $value, "volume");
return (true);
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 489
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo($index:uint, $start:Number, $change:Number){
super();
this.index = $index;
this.start = $start;
this.change = $change;
}
}
}//package gs.utils.tween
Section 490
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo($target:Object, $property:String, $start:Number, $change:Number, $name:String, $isPlugin:Boolean){
super();
this.target = $target;
this.property = $property;
this.start = $start;
this.change = $change;
this.name = $name;
this.isPlugin = $isPlugin;
}
}
}//package gs.utils.tween
Section 491
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import gs.utils.tween.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public function OverwriteManager(){
super();
}
public static function killVars($killVars:Object, $vars:Object, $tweens:Array):void{
var i:int;
var p:String;
var ti:TweenInfo;
i = ($tweens.length - 1);
while (i > -1) {
ti = $tweens[i];
if ((ti.name in $killVars)){
$tweens.splice(i, 1);
} else {
if (((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))){
ti.target.killProps($killVars);
if (ti.target.overwriteProps.length == 0){
$tweens.splice(i, 1);
};
};
};
i--;
};
for (p in $killVars) {
delete $vars[p];
};
}
public static function manageOverwrites($tween:TweenLite, $targetTweens:Array):void{
var i:int;
var tween:TweenLite;
var tweens:Array;
var v:Object;
var j:int;
var ti:TweenInfo;
var overwriteProps:Array;
var vars:Object = $tween.vars;
var m:int = ((vars.overwrite)==undefined) ? mode : int(vars.overwrite);
if ((((m < 2)) || (($targetTweens == null)))){
return;
};
var startTime:Number = $tween.startTime;
var a:Array = [];
var index = -1;
i = ($targetTweens.length - 1);
while (i > -1) {
tween = $targetTweens[i];
if (tween == $tween){
index = i;
} else {
if ((((((i < index)) && ((tween.startTime <= startTime)))) && (((tween.startTime + ((tween.duration * 1000) / tween.combinedTimeScale)) > startTime)))){
a[a.length] = tween;
};
};
i--;
};
if ((((a.length == 0)) || (($tween.tweens.length == 0)))){
return;
};
if (m == AUTO){
tweens = $tween.tweens;
v = {};
i = (tweens.length - 1);
while (i > -1) {
ti = tweens[i];
if (ti.isPlugin){
if (ti.name == "_MULTIPLE_"){
overwriteProps = ti.target.overwriteProps;
j = (overwriteProps.length - 1);
while (j > -1) {
v[overwriteProps[j]] = true;
j--;
};
} else {
v[ti.name] = true;
};
v[ti.target.propName] = true;
} else {
v[ti.name] = true;
};
i--;
};
i = (a.length - 1);
while (i > -1) {
killVars(v, a[i].exposedVars, a[i].tweens);
i--;
};
} else {
i = (a.length - 1);
while (i > -1) {
a[i].enabled = false;
i--;
};
};
}
public static function init($mode:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = $mode;
enabled = true;
return (mode);
}
}
}//package gs
Section 492
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.plugins.*;
import gs.utils.tween.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite($target:Object, $duration:Number, $vars:Object){
super();
if ($target == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = $vars;
this.duration = (($duration) || (0.001));
this.delay = (($vars.delay) || (0));
this.combinedTimeScale = (($vars.timeScale) || (1));
this.active = Boolean(((($duration == 0)) && ((this.delay == 0))));
this.target = $target;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var mode:int = (((($vars.overwrite == undefined)) || (((!(overwriteManager.enabled)) && (($vars.overwrite > 1)))))) ? overwriteManager.mode : int($vars.overwrite);
if (((!(($target in masterList))) || ((mode == 1)))){
masterList[$target] = [this];
} else {
masterList[$target].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled($b:Boolean):void{
var a:Array;
var found:Boolean;
var i:int;
if ($b){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
a = masterList[this.target];
i = (a.length - 1);
while (i > -1) {
if (a[i] == this){
found = true;
break;
};
i--;
};
if (!found){
a[a.length] = this;
};
};
};
this.gc = ($b) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render($t:uint):void{
var factor:Number;
var ti:TweenInfo;
var i:int;
var time:Number = (($t - this.startTime) * 0.001);
if (time >= this.duration){
time = this.duration;
factor = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
factor = this.ease(time, 0, 1, this.duration);
};
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.target[ti.property] = (ti.start + (factor * ti.change));
i--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var p:String;
var i:int;
var plugin:*;
var ti:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (p in this.exposedVars) {
if ((p in _reservedProps)){
} else {
if ((p in plugins)){
plugin = new (plugins[p]);
if (plugin.onInitTween(this.target, this.exposedVars[p], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, p, this.target[p], ((typeof(this.exposedVars[p]))=="number") ? (this.exposedVars[p] - this.target[p]) : Number(this.exposedVars[p]), p, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(plugin, "changeFactor", 0, 1, ((plugin.overwriteProps.length)==1) ? plugin.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, p, this.target[p], ((typeof(this.exposedVars[p]))=="number") ? (this.exposedVars[p] - this.target[p]) : Number(this.exposedVars[p]), p, false);
};
};
};
if (this.vars.runBackwards == true){
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.start = (ti.start + ti.change);
ti.change = -(ti.change);
i--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars($vars:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars($vars, this.exposedVars, this.tweens);
};
}
public function complete($skipRender:Boolean=false):void{
var i:int;
if (!$skipRender){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
i = (this.tweens.length - 1);
while (i > -1) {
if (((this.tweens[i].isPlugin) && (!((this.tweens[i].target.onComplete == null))))){
this.tweens[i].target.onComplete();
};
i--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll($e:Event=null):void{
var a:Array;
var i:int;
var tween:TweenLite;
var time:uint = (currentTime = getTimer());
var ml:Dictionary = masterList;
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
tween = a[i];
if (tween.active){
tween.render(time);
} else {
if (tween.gc){
a.splice(i, 1);
} else {
if (time >= tween.startTime){
tween.activate();
tween.render(time);
};
};
};
i--;
};
};
}
public static function removeTween($tween:TweenLite, $clear:Boolean=true):void{
if ($tween != null){
if ($clear){
$tween.clear();
};
$tween.enabled = false;
};
}
public static function killTweensOf($target:Object=null, $complete:Boolean=false):void{
var a:Array;
var i:int;
var tween:TweenLite;
if (((!(($target == null))) && (($target in masterList)))){
a = masterList[$target];
i = (a.length - 1);
while (i > -1) {
tween = a[i];
if ((($complete) && (!(tween.gc)))){
tween.complete(false);
};
tween.clear();
i--;
};
delete masterList[$target];
};
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenLite{
$vars.runBackwards = true;
return (new TweenLite($target, $duration, $vars));
}
public static function easeOut($t:Number, $b:Number, $c:Number, $d:Number):Number{
$t = ($t / $d);
return ((((-($c) * $t) * ($t - 2)) + $b));
}
protected static function killGarbage($e:TimerEvent):void{
var tgt:Object;
var ml:Dictionary = masterList;
for (tgt in ml) {
if (ml[tgt].length == 0){
delete ml[tgt];
};
};
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null):TweenLite{
return (new TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, overwrite:0}));
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenLite{
return (new TweenLite($target, $duration, $vars));
}
}
}//package gs
Section 493
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.plugins.*;
import gs.utils.tween.*;
import gs.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.12;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax($target:Object, $duration:Number, $vars:Object){
super($target, $duration, $vars);
if (TweenLite.version < 10.092){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if (((($duration == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.vars.startAt == null))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
}
public function dispatchEvent($e:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent($e));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed($b:Boolean):void{
if (this.reversed != $b){
reverse();
};
}
public function get progress():Number{
var t:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var p:Number = (((((t - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (p > 1){
return (1);
};
if (p < 0){
return (0);
};
return (p);
}
override public function set enabled($b:Boolean):void{
if (!$b){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = $b;
if ($b){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination($property:String, $value, $adjustStartValues:Boolean=true):void{
var i:int;
var ti:TweenInfo;
var varsOld:Object;
var exposedVarsOld:Object;
var tweensOld:Array;
var hadPlugins:Boolean;
var addedTweens:Array;
var killVars:Object;
var p:Number = this.progress;
if (this.initted){
if (!$adjustStartValues){
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
if (ti.name == $property){
ti.target[ti.property] = ti.start;
};
i--;
};
};
varsOld = this.vars;
exposedVarsOld = this.exposedVars;
tweensOld = this.tweens;
hadPlugins = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[$property] = $value;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((varsOld.ease is Function)))){
this.ease = varsOld.ease;
};
if ((($adjustStartValues) && (!((p == 0))))){
adjustStartValues();
};
addedTweens = this.tweens;
this.vars = varsOld;
this.exposedVars = exposedVarsOld;
this.tweens = tweensOld;
killVars = {};
killVars[$property] = true;
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
if (ti.name == $property){
this.tweens.splice(i, 1);
} else {
if (((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))){
ti.target.killProps(killVars);
if (ti.target.overwriteProps.length == 0){
this.tweens.splice(i, 1);
};
};
};
i--;
};
this.tweens = this.tweens.concat(addedTweens);
_hasPlugins = Boolean(((hadPlugins) || (_hasPlugins)));
};
this.vars[$property] = (this.exposedVars[$property] = $value);
}
override public function initTweenVals():void{
var i:int;
var j:int;
var prop:String;
var multiProps:String;
var rp:Array;
var plugin:Object;
var ti:TweenInfo;
if (((!((this.vars.startAt == null))) && (!((this.delay == 0))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
rp = this.exposedVars.roundProps;
i = (rp.length - 1);
while (i > -1) {
prop = rp[i];
j = (this.tweens.length - 1);
while (j > -1) {
ti = this.tweens[j];
if (ti.name == prop){
if (ti.isPlugin){
ti.target.round = true;
} else {
if (plugin == null){
plugin = new TweenLite.plugins.roundProps();
plugin.add(ti.target, prop, ti.start, ti.change);
_hasPlugins = true;
this.tweens[j] = new TweenInfo(plugin, "changeFactor", 0, 1, prop, true);
} else {
plugin.add(ti.target, prop, ti.start, ti.change);
this.tweens.splice(j, 1);
};
};
} else {
if (((((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))) && (!(ti.target.round)))){
multiProps = ((" " + ti.target.overwriteProps.join(" ")) + " ");
if (multiProps.indexOf(((" " + prop) + " ")) != -1){
ti.target.round = true;
};
};
};
j--;
};
i--;
};
};
}
public function restart($includeDelay:Boolean=false):void{
if ($includeDelay){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function removeEventListener($type:String, $listener:Function, $useCapture:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener($type, $listener, $useCapture);
};
}
public function addEventListener($type:String, $listener:Function, $useCapture:Boolean=false, $priority:int=0, $useWeakReference:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if (((($type == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener($type, $listener, $useCapture, $priority, $useWeakReference);
}
protected function adjustStartValues():void{
var factor:Number;
var inv:Number;
var endValue:Number;
var ti:TweenInfo;
var i:int;
var p:Number = this.progress;
if (p != 0){
factor = this.ease(p, 0, 1, 1);
inv = (1 / (1 - factor));
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
endValue = (ti.start + ti.change);
if (ti.isPlugin){
ti.change = ((endValue - factor) * inv);
} else {
ti.change = ((endValue - ti.target[ti.property]) * inv);
};
ti.start = (endValue - ti.change);
i--;
};
};
}
override public function render($t:uint):void{
var factor:Number;
var ti:TweenInfo;
var i:int;
var time:Number = ((($t - this.startTime) * 0.001) * this.combinedTimeScale);
if (time >= this.duration){
time = this.duration;
factor = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
factor = this.ease(time, 0, 1, this.duration);
};
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.target[ti.property] = (ti.start + (factor * ti.change));
i--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
protected function initDispatcher():void{
var v:Object;
var p:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
v = {};
for (p in this.vars) {
v[p] = this.vars[p];
};
this.vars = v;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function willTrigger($type:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger($type));
}
public function get repeatCount():Number{
return (_repeatCount);
}
public function reverse($adjustDuration:Boolean=true, $forcePlay:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var p:Number = this.progress;
if ((($adjustDuration) && ((p > 0)))){
this.startTime = (currentTime - ((((1 - p) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if ($forcePlay != false){
if (p < 1){
resume();
} else {
restart();
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set paused($b:Boolean):void{
if ($b){
pause();
} else {
resume();
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function set repeatCount($n:Number):void{
_repeatCount = $n;
}
public function reverseEase($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.ease(($d - $t), $b, $c, $d));
}
public function killProperties($names:Array):void{
var i:int;
var v:Object = {};
i = ($names.length - 1);
while (i > -1) {
v[$names[i]] = true;
i--;
};
killVars(v);
}
public function set progress($n:Number):void{
this.startTime = (currentTime - ((this.duration * $n) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function hasEventListener($type:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener($type));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete($skipRender:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = ($skipRender) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete($skipRender);
}
public function set timeScale($n:Number):void{
if ($n < 1E-5){
$n = (_timeScale = 1E-5);
} else {
_timeScale = $n;
$n = ($n * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / $n))) - (this.delay * (1000 / $n)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / $n)));
};
this.combinedTimeScale = $n;
}
public function invalidate($adjustStartValues:Boolean=true):void{
var p:Number;
if (this.initted){
p = this.progress;
if (((!($adjustStartValues)) && (!((p == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (p != 0){
if ($adjustStartValues){
adjustStartValues();
} else {
this.progress = p;
};
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale($n:Number):void{
setGlobalTimeScale($n);
}
public static function pauseAll($tweens:Boolean=true, $delayedCalls:Boolean=false):void{
changePause(true, $tweens, $delayedCalls);
}
public static function killAllDelayedCalls($complete:Boolean=false):void{
killAll($complete, false, true);
}
public static function setGlobalTimeScale($scale:Number):void{
var i:int;
var a:Array;
if ($scale < 1E-5){
$scale = 1E-5;
};
var ml:Dictionary = masterList;
_globalTimeScale = $scale;
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
if ((a[i] is TweenMax)){
a[i].timeScale = (a[i].timeScale * 1);
};
i--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf($target:Object):Array{
var tween:TweenLite;
var i:int;
var a:Array = masterList[$target];
var toReturn:Array = [];
if (a != null){
i = (a.length - 1);
while (i > -1) {
if (!a[i].gc){
toReturn[toReturn.length] = a[i];
};
i--;
};
};
for each (tween in _pausedTweens) {
if (tween.target == $target){
toReturn[toReturn.length] = tween;
};
};
return (toReturn);
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null, $persist:Boolean=false):TweenMax{
return (new TweenMax($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, persist:$persist, overwrite:0}));
}
public static function isTweening($target:Object):Boolean{
var a:Array = getTweensOf($target);
var i:int = (a.length - 1);
while (i > -1) {
if (((((a[i].active) || ((a[i].startTime == currentTime)))) && (!(a[i].gc)))){
return (true);
};
i--;
};
return (false);
}
public static function changePause($pause:Boolean, $tweens:Boolean=true, $delayedCalls:Boolean=false):void{
var isDC:Boolean;
var a:Array = getAllTweens();
var i:int = (a.length - 1);
while (i > -1) {
isDC = (a[i].target == a[i].vars.onComplete);
if ((((a[i] is TweenMax)) && ((((isDC == $delayedCalls)) || (!((isDC == $tweens))))))){
a[i].paused = $pause;
};
i--;
};
}
public static function killAllTweens($complete:Boolean=false):void{
killAll($complete, true, false);
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenMax{
$vars.runBackwards = true;
return (new TweenMax($target, $duration, $vars));
}
public static function killAll($complete:Boolean=false, $tweens:Boolean=true, $delayedCalls:Boolean=true):void{
var isDC:Boolean;
var i:int;
var a:Array = getAllTweens();
i = (a.length - 1);
while (i > -1) {
isDC = (a[i].target == a[i].vars.onComplete);
if ((((isDC == $delayedCalls)) || (!((isDC == $tweens))))){
if ($complete){
a[i].complete(false);
a[i].clear();
} else {
TweenLite.removeTween(a[i], true);
};
};
i--;
};
}
public static function getAllTweens():Array{
var a:Array;
var i:int;
var tween:TweenLite;
var ml:Dictionary = masterList;
var toReturn:Array = [];
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
if (!a[i].gc){
toReturn[toReturn.length] = a[i];
};
i--;
};
};
for each (tween in _pausedTweens) {
toReturn[toReturn.length] = tween;
};
return (toReturn);
}
public static function resumeAll($tweens:Boolean=true, $delayedCalls:Boolean=false):void{
changePause(false, $tweens, $delayedCalls);
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenMax{
return (new TweenMax($target, $duration, $vars));
}
}
}//package gs
Section 494
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public function MochiCoins(){
super();
}
public static function triggerEvent(eventType:String, args:Object):void{
MochiSocial.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
MochiSocial.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
MochiSocial.addEventListener(eventType, delegate);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(options:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 495
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function reencode():void{
var newEncode:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function set value(v:Number):void{
setValue(v);
}
public function toString():String{
var s:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 496
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 497
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public function MochiEvents(){
super();
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function trackEvent(tag:String, value=null):void{
MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function setNotifications(clip:MovieClip, style:Object):void{
var s:Object;
var args:Object = {};
for (s in style) {
args[s] = style[s];
};
args.clip = clip;
MochiServices.send("events_setNotifications", args, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(tag:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
}
}//package mochi.as3
Section 498
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
super();
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(event:Object):void{
if (!this[(event.id + KEY_SALT)]){
this[(event.id + KEY_SALT)] = 0;
};
if (!this[event.id]){
this[event.id] = 0;
};
this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count);
this[event.id] = (this[event.id] + event.count);
if (event.privateProperties.consumable){
if (!this[event.privateProperties.tag]){
this[event.privateProperties.tag] = 0;
};
this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[name]){
return (MochiDigits(_consumableProperties[name]).value);
};
return (undefined);
}
private function loggedIn(args:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[name] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{
return (((index)>=_names.length) ? 0 : (index + 1));
}
private function putConsumableBag(userData:MochiUserData):void{
_syncPending = false;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var d:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(value is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value});
return;
};
if (_consumableProperties[name]){
d = MochiDigits(_consumableProperties[name]);
if (d.value == value){
return;
};
d.value = value;
} else {
_names.push(name);
_consumableProperties[name] = new MochiDigits(value);
};
_syncID++;
}
private function itemOwned(event:Object):void{
_storeSync[event.id] = {properties:event.properties, count:event.count};
}
private function sync(e:Event=null):void{
var key:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var output:Object = {};
for (key in _consumableProperties) {
output[key] = MochiDigits(_consumableProperties[key]).value;
};
MochiUserData.put(CONSUMER_KEY, output, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{
return (_names[(index - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{
if (!_consumableProperties[name]){
return (false);
};
_names.splice(_names.indexOf(name), 1);
delete _consumableProperties[name];
return (true);
}
private function getConsumableBag(userData:MochiUserData):void{
var key:String;
var unsynced:Number;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (userData.data){
for (key in userData.data) {
_names.push(key);
_consumableProperties[key] = new MochiDigits(userData.data[key]);
};
};
for (key in _storeSync) {
unsynced = _storeSync[key].count;
if (_consumableProperties[(key + KEY_SALT)]){
unsynced = (unsynced - _consumableProperties[key]);
};
if (unsynced == 0){
} else {
newItems({id:key, count:unsynced, properties:_storeSync[key].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(args:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
}
}//package mochi.as3
Section 499
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public function MochiScores(){
super();
}
public static function showLeaderboard(options:Object=null):void{
var n:Number;
var options = options;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
public static function scoresArrayToObjects(scores:Object):Object{
var i:Number;
var j:Number;
var o:Object;
var row_obj:Object;
var item:String;
var param:String;
var so:Object = {};
for (item in scores) {
if (typeof(scores[item]) == "object"){
if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
};
so[item].push(row_obj);
j++;
};
} else {
so[item] = {};
for (param in scores[item]) {
so[item][param] = scores[item][param];
};
};
} else {
so[item] = scores[item];
};
};
return (so);
}
public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{
score = Number(score);
if (isNaN(score)){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((score == Number.NEGATIVE_INFINITY)) || ((score == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(score) != score){
trace((("WARNING: Submitted score '" + String(score)) + "' will be truncated"));
};
score = Number(score);
};
};
MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
public static function onClose(args:Object=null):void{
if (((((args) && ((args.error == true)))) && (onErrorHandler))){
if (args.errorCode == null){
args.errorCode = "IOError";
};
onErrorHandler(args.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(boardID:String):void{
MochiServices.warnID(boardID, true);
MochiScores.boardID = boardID;
MochiServices.send("scores_setBoardID", {boardID:boardID});
}
}
}//package mochi.as3
Section 500
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var methodName:String;
var pkg = pkg;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _callbacks[cb];
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_nextCallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var b:int;
var loader:Loader;
var avm1_bytecode:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var header:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var footer:Array = [0, 64, 0, 0, 0];
var mc:MovieClip = new MovieClip();
var lc:LocalConnection = new LocalConnection();
var lc_name:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
var ba:ByteArray = new ByteArray();
var cpool:ByteArray = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
var actionLength:uint = ((avm1_bytecode.length + cpool.length) + 4);
var fileLength:uint = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
var rect:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.8 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(bid:String, leaderboard:Boolean):void{
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var i:Number = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
request = _queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _callbacks[request.callbackID];
};
delete _callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String = pkg.target;
var event:String = pkg.event;
switch (target){
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "sync":
servicesSync.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
var opts:Object = {};
if (clip.stage){
options = clip.stage.loaderInfo.parameters.mochiad_options;
} else {
options = clip.loaderInfo.parameters.mochiad_options;
};
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (container != null){
if ((container is DisplayObjectContainer)){
_container = container;
};
};
if (doAdd){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader;
var clip = clip;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (ev:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
var servicesURL:String = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var req:URLRequest = new URLRequest(servicesURL);
var vars:URLVariables = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function updateCopy(args:Object):void{
MochiServices.send("coins_updateCopy", args, null, null);
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 501
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public function MochiSocial(){
super();
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("coins_saveUserProperties", properties);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:options});
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_user_info = args;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 502
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
super();
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
if (_syncContainer[name] == value){
return;
};
var n:String = name.toString();
_syncContainer[n] = value;
MochiServices.send("sync_propUpdate", {name:n, value:value});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
return (_syncContainer[name]);
}
public function triggerEvent(eventType:String, args:Object):void{
switch (eventType){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[args.name] = args.value;
break;
};
}
}
}//package mochi.as3
Section 503
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(key:String="", callback:Function=null){
super();
this.key = key;
this.callback = callback;
}
public function serialize(obj):ByteArray{
var arr:ByteArray = new ByteArray();
arr.objectEncoding = ObjectEncoding.AMF3;
arr.writeObject(obj);
arr.compress();
return (arr);
}
public function errorHandler(event:IOErrorEvent):void{
data = null;
error = event;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function putEvent(obj):void{
request("put", serialize(obj));
}
public function deserialize(arr:ByteArray){
arr.objectEncoding = ObjectEncoding.AMF3;
arr.uncompress();
return (arr.readObject());
}
public function securityErrorHandler(event:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
callback(this);
//unresolved jump
var _slot1 = e;
trace(("[MochiUserData] exception during callback: " + _slot1));
}
public function request(_operation:String, _data:ByteArray):void{
var _operation = _operation;
var _data = _data;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.load(req);
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString())));
}
public function completeHandler(event:Event):void{
var event = event;
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString())));
return;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(key:String, callback:Function):void{
var userData:MochiUserData = new MochiUserData(key, callback);
userData.getEvent();
}
public static function put(key:String, obj, callback:Function):void{
var userData:MochiUserData = new MochiUserData(key, callback);
userData.putEvent(obj);
}
}
}//package mochi.as3
Section 504
//IAutomationObject (mx.automation.IAutomationObject)
package mx.automation {
import flash.events.*;
public interface IAutomationObject {
function createAutomationIDPart(:IAutomationObject):Object;
function get automationName():String;
function get showInAutomationHierarchy():Boolean;
function set automationName(C:\autobuild\galaga\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:String):void;
function getAutomationChildAt(delegate:int):IAutomationObject;
function get automationDelegate():Object;
function get automationTabularData():Object;
function resolveAutomationIDPart(Object:Object):Array;
function replayAutomatableEvent(void:Event):Boolean;
function set automationDelegate(C:\autobuild\galaga\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Object):void;
function get automationValue():Array;
function get numAutomationChildren():int;
function set showInAutomationHierarchy(C:\autobuild\galaga\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Boolean):void;
}
}//package mx.automation
Section 505
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.4.0.9271";
public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
super(bitmapData, pixelSnapping, smoothing);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
}
}//package mx.core
Section 506
//ComponentDescriptor (mx.core.ComponentDescriptor)
package mx.core {
public class ComponentDescriptor {
public var events:Object;
public var type:Class;
public var document:Object;
private var _properties:Object;
public var propertiesFactory:Function;
public var id:String;
mx_internal static const VERSION:String = "3.4.0.9271";
public function ComponentDescriptor(descriptorProperties:Object){
var p:String;
super();
for (p in descriptorProperties) {
this[p] = descriptorProperties[p];
};
}
public function toString():String{
return (("ComponentDescriptor_" + id));
}
public function invalidateProperties():void{
_properties = null;
}
public function get properties():Object{
var cd:Array;
var n:int;
var i:int;
if (_properties){
return (_properties);
};
if (propertiesFactory != null){
_properties = propertiesFactory.call(document);
};
if (_properties){
cd = _properties.childDescriptors;
if (cd){
n = cd.length;
i = 0;
while (i < n) {
cd[i].document = document;
i++;
};
};
} else {
_properties = {};
};
return (_properties);
}
}
}//package mx.core
Section 507
//DragSource (mx.core.DragSource)
package mx.core {
public class DragSource {
private var formatHandlers:Object;
private var dataHolder:Object;
private var _formats:Array;
mx_internal static const VERSION:String = "3.4.0.9271";
public function DragSource(){
dataHolder = {};
formatHandlers = {};
_formats = [];
super();
}
public function hasFormat(format:String):Boolean{
var n:int = _formats.length;
var i:int;
while (i < n) {
if (_formats[i] == format){
return (true);
};
i++;
};
return (false);
}
public function addData(data:Object, format:String):void{
_formats.push(format);
dataHolder[format] = data;
}
public function dataForFormat(format:String):Object{
var data:Object = dataHolder[format];
if (data){
return (data);
};
if (formatHandlers[format]){
return (formatHandlers[format]());
};
return (null);
}
public function addHandler(handler:Function, format:String):void{
_formats.push(format);
formatHandlers[format] = handler;
}
public function get formats():Array{
return (_formats);
}
}
}//package mx.core
Section 508
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.4.0.9271";
public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
var bitmapData = bitmapData;
var pixelSnapping = pixelSnapping;
var smoothing = smoothing;
super(bitmapData, pixelSnapping, smoothing);
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 509
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.4.0.9271";
public function FontAsset(){
super();
}
}
}//package mx.core
Section 510
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 511
//IChildList (mx.core.IChildList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public interface IChildList {
function get numChildren():int;
function removeChild(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function getChildByName(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject;
function removeChildAt(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function getChildIndex(:DisplayObject):int;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function getObjectsUnderPoint(child:Point):Array;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function getChildAt(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function addChild(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function contains(flash.display:DisplayObject):Boolean;
}
}//package mx.core
Section 512
//IConstraintClient (mx.core.IConstraintClient)
package mx.core {
public interface IConstraintClient {
function setConstraintValue(_arg1:String, _arg2):void;
function getConstraintValue(*:String);
}
}//package mx.core
Section 513
//IDeferredInstantiationUIComponent (mx.core.IDeferredInstantiationUIComponent)
package mx.core {
public interface IDeferredInstantiationUIComponent extends IUIComponent {
function set cacheHeuristic(:Boolean):void;
function createReferenceOnParentDocument(:IFlexDisplayObject):void;
function get cachePolicy():String;
function set id(:String):void;
function registerEffects(:Array):void;
function executeBindings(:Boolean=false):void;
function get id():String;
function deleteReferenceOnParentDocument(:IFlexDisplayObject):void;
function set descriptor(:UIComponentDescriptor):void;
function get descriptor():UIComponentDescriptor;
}
}//package mx.core
Section 514
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 515
//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(void:Point):Point;
function get name():String;
function set width(flash.display:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(flash.display:String):void;
function set scaleX(flash.display:Number):void;
function set scaleY(flash.display:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(flash.display:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(void:Point):Point;
function get height():Number;
function set blendMode(flash.display:String):void;
function get parent():DisplayObjectContainer;
function getBounds(String:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(flash.display:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(flash.display:Number):void;
function set accessibilityProperties(flash.display:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(flash.display: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(flash.display:Number):void;
function set mask(flash.display:DisplayObject):void;
function getRect(String:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(flash.display:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean;
function set opaqueBackground(flash.display:Object):void;
function set visible(flash.display:Boolean):void;
function get mask():DisplayObject;
function set x(flash.display:Number):void;
function set y(flash.display:Number):void;
function get transform():Transform;
function set filters(flash.display:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(flash.display:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 516
//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 517
//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 518
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get isDocument():Boolean;
function set repeaters(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function initializeRepeaterArrays(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 519
//IStateClient (mx.core.IStateClient)
package mx.core {
public interface IStateClient {
function get currentState():String;
function set currentState(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IStateClient.as:String):void;
}
}//package mx.core
Section 520
//ISWFBridgeGroup (mx.core.ISWFBridgeGroup)
package mx.core {
import flash.events.*;
public interface ISWFBridgeGroup {
function getChildBridgeProvider(mx.core:ISWFBridgeGroup/mx.core:ISWFBridgeGroup:parentBridge/get:IEventDispatcher):ISWFBridgeProvider;
function removeChildBridge(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function get parentBridge():IEventDispatcher;
function addChildBridge(_arg1:IEventDispatcher, _arg2:ISWFBridgeProvider):void;
function set parentBridge(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function containsBridge(IEventDispatcher:IEventDispatcher):Boolean;
function getChildBridges():Array;
}
}//package mx.core
Section 521
//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 522
//IToolTip (mx.core.IToolTip)
package mx.core {
import flash.geom.*;
public interface IToolTip extends IUIComponent {
function set text(mx.core:IToolTip/mx.core:IToolTip:screen/get:String):void;
function get screen():Rectangle;
function get text():String;
}
}//package mx.core
Section 523
//IUIComponent (mx.core.IUIComponent)
package mx.core {
import flash.display.*;
import mx.managers.*;
public interface IUIComponent extends IFlexDisplayObject {
function set focusPane(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Sprite):void;
function get enabled():Boolean;
function set enabled(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function set isPopUp(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get: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(Number: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(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get minHeight():Number;
function set percentWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get document():Object;
function get focusPane():Sprite;
function getExplicitOrMeasuredHeight():Number;
function set tweeningProperties(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Array):void;
function set explicitWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set measuredMinHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get explicitMinWidth():Number;
function get tweeningProperties():Array;
function get maxHeight():Number;
function set owner(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function set includeInLayout(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function setVisible(_arg1:Boolean, _arg2:Boolean=false):void;
function parentChanged(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function get explicitWidth():Number;
function get measuredMinHeight():Number;
function set measuredMinWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set explicitHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get includeInLayout():Boolean;
function get measuredMinWidth():Number;
function get explicitHeight():Number;
function set systemManager(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:ISystemManager):void;
function set document(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Object):void;
function get systemManager():ISystemManager;
}
}//package mx.core
Section 524
//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 525
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.4.0.9271";
public function SoundAsset(){
super();
}
}
}//package mx.core
Section 526
//UIComponentDescriptor (mx.core.UIComponentDescriptor)
package mx.core {
public class UIComponentDescriptor extends ComponentDescriptor {
mx_internal var instanceIndices:Array;
public var stylesFactory:Function;
public var effects:Array;
mx_internal var repeaters:Array;
mx_internal var repeaterIndices:Array;
mx_internal static const VERSION:String = "3.4.0.9271";
public function UIComponentDescriptor(descriptorProperties:Object){
super(descriptorProperties);
}
override public function toString():String{
return (("UIComponentDescriptor_" + id));
}
}
}//package mx.core
Section 527
//DragEvent (mx.events.DragEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class DragEvent extends MouseEvent {
public var draggedItem:Object;
public var action:String;
public var dragInitiator:IUIComponent;
public var dragSource:DragSource;
public static const DRAG_DROP:String = "dragDrop";
public static const DRAG_COMPLETE:String = "dragComplete";
public static const DRAG_EXIT:String = "dragExit";
public static const DRAG_ENTER:String = "dragEnter";
public static const DRAG_START:String = "dragStart";
mx_internal static const VERSION:String = "3.4.0.9271";
public static const DRAG_OVER:String = "dragOver";
public function DragEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=true, dragInitiator:IUIComponent=null, dragSource:DragSource=null, action:String=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false){
super(type, bubbles, cancelable);
this.dragInitiator = dragInitiator;
this.dragSource = dragSource;
this.action = action;
this.ctrlKey = ctrlKey;
this.altKey = altKey;
this.shiftKey = shiftKey;
}
override public function clone():Event{
var cloneEvent:DragEvent = new DragEvent(type, bubbles, cancelable, dragInitiator, dragSource, action, ctrlKey, altKey, shiftKey);
cloneEvent.relatedObject = this.relatedObject;
cloneEvent.localX = this.localX;
cloneEvent.localY = this.localY;
return (cloneEvent);
}
}
}//package mx.events
Section 528
//FlexEvent (mx.events.FlexEvent)
package mx.events {
import flash.events.*;
public class FlexEvent extends Event {
public static const ADD:String = "add";
public static const TRANSFORM_CHANGE:String = "transformChange";
public static const ENTER_FRAME:String = "flexEventEnterFrame";
public static const INIT_COMPLETE:String = "initComplete";
public static const REMOVE:String = "remove";
public static const BUTTON_DOWN:String = "buttonDown";
public static const EXIT_STATE:String = "exitState";
public static const CREATION_COMPLETE:String = "creationComplete";
public static const REPEAT:String = "repeat";
public static const LOADING:String = "loading";
public static const RENDER:String = "flexEventRender";
public static const REPEAT_START:String = "repeatStart";
public static const INITIALIZE:String = "initialize";
public static const ENTER_STATE:String = "enterState";
public static const URL_CHANGED:String = "urlChanged";
public static const REPEAT_END:String = "repeatEnd";
mx_internal static const VERSION:String = "3.4.0.9271";
public static const HIDE:String = "hide";
public static const ENTER:String = "enter";
public static const PRELOADER_DONE:String = "preloaderDone";
public static const CURSOR_UPDATE:String = "cursorUpdate";
public static const PREINITIALIZE:String = "preinitialize";
public static const INVALID:String = "invalid";
public static const IDLE:String = "idle";
public static const VALID:String = "valid";
public static const DATA_CHANGE:String = "dataChange";
public static const APPLICATION_COMPLETE:String = "applicationComplete";
public static const VALUE_COMMIT:String = "valueCommit";
public static const UPDATE_COMPLETE:String = "updateComplete";
public static const INIT_PROGRESS:String = "initProgress";
public static const SHOW:String = "show";
public function FlexEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
return (new FlexEvent(type, bubbles, cancelable));
}
}
}//package mx.events
Section 529
//FlexMouseEvent (mx.events.FlexMouseEvent)
package mx.events {
import flash.events.*;
import flash.display.*;
public class FlexMouseEvent extends MouseEvent {
public static const MOUSE_DOWN_OUTSIDE:String = "mouseDownOutside";
public static const MOUSE_WHEEL_OUTSIDE:String = "mouseWheelOutside";
mx_internal static const VERSION:String = "3.4.0.9271";
public function FlexMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, localX:Number=0, localY:Number=0, relatedObject:InteractiveObject=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false, delta:int=0){
super(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta);
}
override public function clone():Event{
return (new FlexMouseEvent(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta));
}
}
}//package mx.events
Section 530
//MoveEvent (mx.events.MoveEvent)
package mx.events {
import flash.events.*;
public class MoveEvent extends Event {
public var oldX:Number;
public var oldY:Number;
mx_internal static const VERSION:String = "3.4.0.9271";
public static const MOVE:String = "move";
public function MoveEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldX:Number=NaN, oldY:Number=NaN){
super(type, bubbles, cancelable);
this.oldX = oldX;
this.oldY = oldY;
}
override public function clone():Event{
return (new MoveEvent(type, bubbles, cancelable, oldX, oldY));
}
}
}//package mx.events
Section 531
//PropertyChangeEvent (mx.events.PropertyChangeEvent)
package mx.events {
import flash.events.*;
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.4.0.9271";
public static const PROPERTY_CHANGE:String = "propertyChange";
public function PropertyChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, kind:String=null, property:Object=null, oldValue:Object=null, newValue:Object=null, source:Object=null){
super(type, bubbles, cancelable);
this.kind = kind;
this.property = property;
this.oldValue = oldValue;
this.newValue = newValue;
this.source = source;
}
override public function clone():Event{
return (new PropertyChangeEvent(type, bubbles, cancelable, kind, property, oldValue, newValue, source));
}
public static function createUpdateEvent(source:Object, property:Object, oldValue:Object, newValue:Object):PropertyChangeEvent{
var event:PropertyChangeEvent = new PropertyChangeEvent(PROPERTY_CHANGE);
event.kind = PropertyChangeEventKind.UPDATE;
event.oldValue = oldValue;
event.newValue = newValue;
event.source = source;
event.property = property;
return (event);
}
}
}//package mx.events
Section 532
//PropertyChangeEventKind (mx.events.PropertyChangeEventKind)
package mx.events {
public final class PropertyChangeEventKind {
mx_internal static const VERSION:String = "3.4.0.9271";
public static const UPDATE:String = "update";
public static const DELETE:String = "delete";
public function PropertyChangeEventKind(){
super();
}
}
}//package mx.events
Section 533
//ResizeEvent (mx.events.ResizeEvent)
package mx.events {
import flash.events.*;
public class ResizeEvent extends Event {
public var oldHeight:Number;
public var oldWidth:Number;
mx_internal static const VERSION:String = "3.4.0.9271";
public static const RESIZE:String = "resize";
public function ResizeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldWidth:Number=NaN, oldHeight:Number=NaN){
super(type, bubbles, cancelable);
this.oldWidth = oldWidth;
this.oldHeight = oldHeight;
}
override public function clone():Event{
return (new ResizeEvent(type, bubbles, cancelable, oldWidth, oldHeight));
}
}
}//package mx.events
Section 534
//StateChangeEvent (mx.events.StateChangeEvent)
package mx.events {
import flash.events.*;
public class StateChangeEvent extends Event {
public var newState:String;
public var oldState:String;
public static const CURRENT_STATE_CHANGING:String = "currentStateChanging";
public static const CURRENT_STATE_CHANGE:String = "currentStateChange";
mx_internal static const VERSION:String = "3.4.0.9271";
public function StateChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldState:String=null, newState:String=null){
super(type, bubbles, cancelable);
this.oldState = oldState;
this.newState = newState;
}
override public function clone():Event{
return (new StateChangeEvent(type, bubbles, cancelable, oldState, newState));
}
}
}//package mx.events
Section 535
//ToolTipEvent (mx.events.ToolTipEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ToolTipEvent extends Event {
public var toolTip:IToolTip;
public static const TOOL_TIP_SHOWN:String = "toolTipShown";
public static const TOOL_TIP_CREATE:String = "toolTipCreate";
public static const TOOL_TIP_SHOW:String = "toolTipShow";
public static const TOOL_TIP_HIDE:String = "toolTipHide";
public static const TOOL_TIP_END:String = "toolTipEnd";
mx_internal static const VERSION:String = "3.4.0.9271";
public static const TOOL_TIP_START:String = "toolTipStart";
public function ToolTipEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, toolTip:IToolTip=null){
super(type, bubbles, cancelable);
this.toolTip = toolTip;
}
override public function clone():Event{
return (new ToolTipEvent(type, bubbles, cancelable, toolTip));
}
}
}//package mx.events
Section 536
//UIMovieClip (mx.flash.UIMovieClip)
package mx.flash {
import flash.events.*;
import flash.display.*;
import mx.managers.*;
import mx.core.*;
import mx.automation.*;
import flash.geom.*;
import mx.events.*;
import flash.system.*;
import flash.ui.*;
public dynamic class UIMovieClip extends MovieClip implements IDeferredInstantiationUIComponent, IToolTipManagerClient, IStateClient, IFocusManagerComponent, IConstraintClient, IAutomationObject {
private var _explicitWidth:Number;
private var reverseDirectionFocus:Boolean;// = false
private var oldHeight:Number;
protected var _height:Number;
private var _automationName:String;// = null
private var _automationDelegate:IAutomationObject;
private var _currentState:String;
private var _document:Object;
private var _systemManager:ISystemManager;
private var _isPopUp:Boolean;// = false
private var focusableObjects:Array;
private var _percentWidth:Number;
private var _top;
private var _explicitHeight:Number;
private var explicitSizeChanged:Boolean;// = false
private var _measuredWidth:Number;
private var _toolTip:String;
public var boundingBoxName:String;// = "boundingBox"
protected var _width:Number;
private var _tweeningProperties:Array;
protected var initialized:Boolean;// = false
private var _focusPane:Sprite;
private var _left;
private var transitionEndState:String;
private var focusListenersAdded:Boolean;// = false
private var stateMap:Object;
private var _showInAutomationHierarchy:Boolean;// = true
private var _descriptor:UIComponentDescriptor;
private var oldX:Number;
private var oldY:Number;
private var _right;
private var validateMeasuredSizeFlag:Boolean;// = true
private var _focusEnabled:Boolean;// = true
protected var trackSizeChanges:Boolean;// = true
private var _includeInLayout:Boolean;// = true
private var _explicitMinWidth:Number;
private var _bottom;
private var _explicitMaxHeight:Number;
private var explicitTabEnabledChanged:Boolean;// = false
private var transitionStartFrame:Number;
private var _explicitMaxWidth:Number;
private var _measuredMinHeight:Number;// = 0
private var _verticalCenter;
private var _baseline;
private var transitionDirection:Number;// = 0
private var _measuredHeight:Number;
private var _owner:DisplayObjectContainer;
private var _id:String;
private var transitionEndFrame:Number;
private var _parent:DisplayObjectContainer;
private var _explicitMinHeight:Number;
private var _percentHeight:Number;
private var _measuredMinWidth:Number;// = 0
private var oldWidth:Number;
private var _horizontalCenter;
public function UIMovieClip(){
focusableObjects = [];
super();
addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 0, true);
addEventListener(FocusEvent.FOCUS_IN, focusInHandler, false, 0, true);
addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
}
public function get left(){
return (_left);
}
public function set left(value):void{
var oldValue:Object = this.left;
if (oldValue !== value){
this._3317767left = value;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "left", oldValue, value));
};
}
protected function enterFrameHandler(event:Event):void{
var currentBounds:Rectangle;
var newFrame:Number;
if (explicitSizeChanged){
explicitSizeChanged = false;
setActualSize(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
};
if (isNaN(oldX)){
oldX = x;
};
if (isNaN(oldY)){
oldY = y;
};
if (((!((x == oldX))) || (!((y == oldY))))){
dispatchMoveEvent();
};
if (trackSizeChanges){
currentBounds = bounds;
currentBounds.width = (currentBounds.width * scaleX);
currentBounds.height = (currentBounds.height * scaleY);
if (isNaN(oldWidth)){
oldWidth = (_width = currentBounds.width);
};
if (isNaN(oldHeight)){
oldHeight = (_height = currentBounds.height);
};
if (((sizeChanged(currentBounds.width, oldWidth)) || (sizeChanged(currentBounds.height, oldHeight)))){
_width = currentBounds.width;
_height = currentBounds.height;
validateMeasuredSizeFlag = true;
notifySizeChanged();
dispatchResizeEvent();
} else {
if (((sizeChanged(width, oldWidth)) || (sizeChanged(height, oldHeight)))){
dispatchResizeEvent();
};
};
};
if (((((currentLabel) && ((currentLabel.indexOf(":") < 0)))) && (!((currentLabel == _currentState))))){
_currentState = currentLabel;
};
if (transitionDirection != 0){
newFrame = (currentFrame + transitionDirection);
if ((((((transitionDirection > 0)) && ((newFrame >= transitionEndFrame)))) || ((((transitionDirection < 0)) && ((newFrame <= transitionEndFrame)))))){
gotoAndStop(stateMap[transitionEndState].frame);
transitionDirection = 0;
} else {
gotoAndStop(newFrame);
};
};
}
public function get minHeight():Number{
if (!isNaN(explicitMinHeight)){
return (explicitMinHeight);
};
return (measuredMinHeight);
}
public function getExplicitOrMeasuredHeight():Number{
var mHeight:Number;
if (isNaN(explicitHeight)){
mHeight = measuredHeight;
if (((!(isNaN(explicitMinHeight))) && ((mHeight < explicitMinHeight)))){
mHeight = explicitMinHeight;
};
if (((!(isNaN(explicitMaxHeight))) && ((mHeight > explicitMaxHeight)))){
mHeight = explicitMaxHeight;
};
return (mHeight);
};
return (explicitHeight);
}
public function get right(){
return (_right);
}
private function validateMeasuredSize():void{
if (validateMeasuredSizeFlag){
validateMeasuredSizeFlag = false;
_measuredWidth = bounds.width;
_measuredHeight = bounds.height;
};
}
public function get tweeningProperties():Array{
return (_tweeningProperties);
}
public function get bottom(){
return (_bottom);
}
public function set explicitMaxWidth(value:Number):void{
_explicitMaxWidth = value;
}
public function set minHeight(value:Number):void{
explicitMinHeight = value;
}
public function set right(value):void{
var oldValue:Object = this.right;
if (oldValue !== value){
this._108511772right = value;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "right", oldValue, value));
};
}
private function keyFocusChangeHandler(event:FocusEvent):void{
if (event.keyCode == Keyboard.TAB){
if (stage.focus == focusableObjects[(event.shiftKey) ? 0 : (focusableObjects.length - 1)]){
removeFocusEventListeners();
} else {
event.stopImmediatePropagation();
};
};
}
public function get automationName():String{
if (_automationName){
return (_automationName);
};
if (automationDelegate){
return (automationDelegate.automationName);
};
return ("");
}
public function get baseline(){
return (_baseline);
}
private function set _1383228885bottom(value):void{
if (value != _bottom){
_bottom = value;
notifySizeChanged();
};
}
public function get explicitMinHeight():Number{
return (_explicitMinHeight);
}
private function keyFocusChangeCaptureHandler(event:FocusEvent):void{
reverseDirectionFocus = event.shiftKey;
}
public function set bottom(value):void{
var oldValue:Object = this.bottom;
if (oldValue !== value){
this._1383228885bottom = value;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "bottom", oldValue, value));
};
}
public function set id(value:String):void{
_id = value;
}
public function set tweeningProperties(value:Array):void{
_tweeningProperties = value;
}
override public function set height(value:Number):void{
explicitHeight = value;
}
public function get focusPane():Sprite{
return (_focusPane);
}
protected function notifySizeChanged():void{
if (((parent) && ((parent is IInvalidating)))){
IInvalidating(parent).invalidateSize();
IInvalidating(parent).invalidateDisplayList();
};
}
public function get numAutomationChildren():int{
if (automationDelegate){
return (automationDelegate.numAutomationChildren);
};
return (0);
}
protected function focusInHandler(event:FocusEvent):void{
if (!focusListenersAdded){
addFocusEventListeners();
};
}
public function set document(value:Object):void{
_document = value;
}
public function getExplicitOrMeasuredWidth():Number{
var mWidth:Number;
if (isNaN(explicitWidth)){
mWidth = measuredWidth;
if (((!(isNaN(explicitMinWidth))) && ((mWidth < explicitMinWidth)))){
mWidth = explicitMinWidth;
};
if (((!(isNaN(explicitMaxWidth))) && ((mWidth > explicitMaxWidth)))){
mWidth = explicitMaxWidth;
};
return (mWidth);
};
return (explicitWidth);
}
private function set _3317767left(value):void{
if (value != _left){
_left = value;
notifySizeChanged();
};
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function get showInAutomationHierarchy():Boolean{
return (_showInAutomationHierarchy);
}
public function get systemManager():ISystemManager{
var r:DisplayObject;
var o:DisplayObjectContainer;
var ui:IUIComponent;
if (!_systemManager){
r = root;
if (r){
_systemManager = (r as ISystemManager);
} else {
o = parent;
while (o) {
ui = (o as IUIComponent);
if (ui){
_systemManager = ui.systemManager;
break;
};
o = o.parent;
};
};
};
return (_systemManager);
}
public function get percentWidth():Number{
return (_percentWidth);
}
public function set automationName(value:String):void{
_automationName = value;
}
public function set explicitMinHeight(value:Number):void{
_explicitMinHeight = value;
notifySizeChanged();
}
public function get baselinePosition():Number{
return (0);
}
public function set baseline(value):void{
var oldValue:Object = this.baseline;
if (oldValue !== value){
this._1720785339baseline = value;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "baseline", oldValue, value));
};
}
public function set focusEnabled(value:Boolean):void{
_focusEnabled = value;
}
public function get currentState():String{
return (_currentState);
}
public function get minWidth():Number{
if (!isNaN(explicitMinWidth)){
return (explicitMinWidth);
};
return (measuredMinWidth);
}
public function get measuredWidth():Number{
validateMeasuredSize();
return (_measuredWidth);
}
public function get mouseFocusEnabled():Boolean{
return (false);
}
public function get automationValue():Array{
if (automationDelegate){
return (automationDelegate.automationValue);
};
return ([]);
}
private function set _115029top(value):void{
if (value != _top){
_top = value;
notifySizeChanged();
};
}
override public function get parent():DisplayObjectContainer{
return ((_parent) ? _parent : super.parent);
}
public function get owner():DisplayObjectContainer{
return ((_owner) ? _owner : parent);
}
protected function get bounds():Rectangle{
if (((((((boundingBoxName) && (!((boundingBoxName == ""))))) && ((boundingBoxName in this)))) && (this[boundingBoxName]))){
return (this[boundingBoxName].getBounds(this));
};
return (getBounds(this));
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
if (((sizeChanged(_width, newWidth)) || (sizeChanged(_height, newHeight)))){
dispatchResizeEvent();
};
_width = newWidth;
_height = newHeight;
super.scaleX = (newWidth / measuredWidth);
super.scaleY = (newHeight / measuredHeight);
}
public function parentChanged(p:DisplayObjectContainer):void{
if (!p){
_parent = null;
} else {
if ((((p is IUIComponent)) || ((p is ISystemManager)))){
_parent = p;
} else {
_parent = p.parent;
};
};
}
public function createAutomationIDPart(child:IAutomationObject):Object{
if (automationDelegate){
return (automationDelegate.createAutomationIDPart(child));
};
return (null);
}
public function getAutomationChildAt(index:int):IAutomationObject{
if (automationDelegate){
return (automationDelegate.getAutomationChildAt(index));
};
return (null);
}
private function removeFocusEventListeners():void{
stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
stage.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
focusListenersAdded = false;
}
public function set focusPane(value:Sprite):void{
_focusPane = value;
}
public function get maxWidth():Number{
return ((isNaN(explicitMaxWidth)) ? 10000 : explicitMaxWidth);
}
public function setConstraintValue(constraintName:String, value):void{
this[constraintName] = value;
}
public function set verticalCenter(value):void{
var oldValue:Object = this.verticalCenter;
if (oldValue !== value){
this._926273685verticalCenter = value;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "verticalCenter", oldValue, value));
};
}
public function set top(value):void{
var oldValue:Object = this.top;
if (oldValue !== value){
this._115029top = value;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "top", oldValue, value));
};
}
public function set descriptor(value:UIComponentDescriptor):void{
_descriptor = value;
}
override public function set visible(value:Boolean):void{
setVisible(value);
}
public function set measuredMinWidth(value:Number):void{
_measuredMinWidth = value;
}
public function set includeInLayout(value:Boolean):void{
_includeInLayout = value;
}
public function set explicitHeight(value:Number):void{
_explicitHeight = value;
explicitSizeChanged = true;
notifySizeChanged();
}
public function get explicitMinWidth():Number{
return (_explicitMinWidth);
}
public function set showInAutomationHierarchy(value:Boolean):void{
_showInAutomationHierarchy = value;
}
public function set systemManager(value:ISystemManager):void{
_systemManager = value;
}
public function registerEffects(effects:Array):void{
}
public function set percentWidth(value:Number):void{
_percentWidth = value;
notifySizeChanged();
}
private function creationCompleteHandler(event:Event):void{
removeEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
if (systemManager){
systemManager.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeCaptureHandler, true, 0, true);
} else {
if (((parentDocument) && (parentDocument.systemManager))){
parentDocument.systemManager.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeCaptureHandler, true, 0, true);
};
};
}
public function get id():String{
return (_id);
}
private function set _926273685verticalCenter(value):void{
if (value != _verticalCenter){
_verticalCenter = value;
notifySizeChanged();
};
}
public function get explicitMaxWidth():Number{
return (_explicitMaxWidth);
}
public function executeBindings(recurse:Boolean=false):void{
var bindingsHost:Object = (((descriptor) && (descriptor.document))) ? descriptor.document : parentDocument;
var mgr:* = ApplicationDomain.currentDomain.getDefinition("mx.binding.BindingManager");
if (mgr != null){
mgr.executeBindings(bindingsHost, id, this);
};
}
public function set minWidth(value:Number):void{
explicitMinWidth = value;
}
override public function get height():Number{
if (!isNaN(_height)){
return (_height);
};
return (super.height);
}
public function set currentState(value:String):void{
var frameName:String;
var startFrame:Number;
var endFrame:Number;
var event:StateChangeEvent;
if (value == _currentState){
return;
};
if (!stateMap){
buildStateMap();
};
if (stateMap[value]){
frameName = (((_currentState + "-") + value) + ":start");
if (stateMap[frameName]){
startFrame = stateMap[frameName].frame;
endFrame = stateMap[(((_currentState + "-") + value) + ":end")].frame;
};
if (isNaN(startFrame)){
frameName = (((value + "-") + _currentState) + ":end");
if (stateMap[frameName]){
startFrame = stateMap[frameName].frame;
endFrame = stateMap[(((value + "-") + _currentState) + ":start")].frame;
};
};
if (isNaN(startFrame)){
frameName = (("*-" + value) + ":start");
if (stateMap[frameName]){
startFrame = stateMap[frameName].frame;
endFrame = stateMap[(("*-" + value) + ":end")].frame;
};
};
if (isNaN(startFrame)){
frameName = (value + "-*:end");
if (stateMap[frameName]){
startFrame = stateMap[frameName].frame;
endFrame = stateMap[(value + "-*:start")].frame;
};
};
if (isNaN(startFrame)){
frameName = (_currentState + "-*:start");
if (stateMap[frameName]){
startFrame = stateMap[frameName].frame;
endFrame = stateMap[(_currentState + "-*:end")].frame;
};
};
if (isNaN(startFrame)){
frameName = (("*-" + _currentState) + ":end");
if (stateMap[frameName]){
startFrame = stateMap[frameName].frame;
endFrame = stateMap[(("*-" + _currentState) + ":start")].frame;
};
};
if (isNaN(startFrame)){
frameName = "*-*:start";
if (stateMap[frameName]){
startFrame = stateMap[frameName].frame;
endFrame = stateMap["*-*:end"].frame;
};
};
if (((isNaN(startFrame)) && ((value in stateMap)))){
startFrame = stateMap[value].frame;
};
if (isNaN(startFrame)){
return;
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGING);
event.oldState = _currentState;
event.newState = value;
dispatchEvent(event);
if (isNaN(endFrame)){
gotoAndStop(startFrame);
transitionDirection = 0;
} else {
if ((((currentFrame < Math.min(startFrame, endFrame))) || ((currentFrame > Math.max(startFrame, endFrame))))){
gotoAndStop(startFrame);
} else {
startFrame = currentFrame;
};
transitionStartFrame = startFrame;
transitionEndFrame = endFrame;
transitionDirection = ((endFrame)>startFrame) ? 1 : -1;
transitionEndState = value;
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGE);
event.oldState = _currentState;
event.newState = value;
dispatchEvent(event);
_currentState = value;
};
}
public function set horizontalCenter(value):void{
var oldValue:Object = this.horizontalCenter;
if (oldValue !== value){
this._2016110183horizontalCenter = value;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "horizontalCenter", oldValue, value));
};
}
public function get document():Object{
return (_document);
}
private function focusOutHandler(event:FocusEvent):void{
if (focusableObjects.indexOf(event.relatedObject) == -1){
removeFocusEventListeners();
};
}
public function replayAutomatableEvent(event:Event):Boolean{
if (automationDelegate){
return (automationDelegate.replayAutomatableEvent(event));
};
return (false);
}
public function get focusEnabled():Boolean{
return (((_focusEnabled) && ((focusableObjects.length > 0))));
}
private function set _108511772right(value):void{
if (value != _right){
_right = value;
notifySizeChanged();
};
}
public function get top(){
return (_top);
}
public function set maxHeight(value:Number):void{
explicitMaxHeight = value;
}
public function set cacheHeuristic(value:Boolean):void{
}
private function set _1720785339baseline(value):void{
if (value != _baseline){
_baseline = value;
notifySizeChanged();
};
}
private function addFocusEventListeners():void{
stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 1, true);
stage.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, false, 0, true);
focusListenersAdded = true;
}
public function getConstraintValue(constraintName:String){
return (this[constraintName]);
}
public function set owner(value:DisplayObjectContainer):void{
_owner = value;
}
protected function findFocusCandidates(obj:DisplayObjectContainer):void{
var child:InteractiveObject;
var i:int;
while (i < obj.numChildren) {
child = (obj.getChildAt(i) as InteractiveObject);
if (((child) && (child.tabEnabled))){
focusableObjects.push(child);
if (!explicitTabEnabledChanged){
tabEnabled = true;
};
};
if ((child is DisplayObjectContainer)){
findFocusCandidates(DisplayObjectContainer(child));
};
i++;
};
}
public function get verticalCenter(){
return (_verticalCenter);
}
public function get cachePolicy():String{
return ("");
}
private function set _2016110183horizontalCenter(value):void{
if (value != _horizontalCenter){
_horizontalCenter = value;
notifySizeChanged();
};
}
public function get descriptor():UIComponentDescriptor{
return (_descriptor);
}
public function createReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
if (((id) && (!((id == ""))))){
parentDocument[id] = this;
};
}
public function get includeInLayout():Boolean{
return (_includeInLayout);
}
public function set automationDelegate(value:Object):void{
_automationDelegate = (value as IAutomationObject);
}
public function get measuredMinWidth():Number{
return (_measuredMinWidth);
}
protected function sizeChanged(oldValue:Number, newValue:Number):Boolean{
return ((Math.abs((oldValue - newValue)) > 1));
}
public function set isPopUp(value:Boolean):void{
_isPopUp = value;
}
public function get measuredHeight():Number{
validateMeasuredSize();
return (_measuredHeight);
}
public function initialize():void{
var child:IUIComponent;
initialized = true;
dispatchEvent(new FlexEvent(FlexEvent.PREINITIALIZE));
if (((((((boundingBoxName) && (!((boundingBoxName == ""))))) && ((boundingBoxName in this)))) && (this[boundingBoxName]))){
this[boundingBoxName].visible = false;
};
if (explicitSizeChanged){
explicitSizeChanged = false;
setActualSize(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
};
findFocusCandidates(this);
var i:int;
while (i < numChildren) {
child = (getChildAt(i) as IUIComponent);
if (child){
child.initialize();
};
i++;
};
dispatchEvent(new FlexEvent(FlexEvent.INITIALIZE));
dispatchEvent(new FlexEvent(FlexEvent.CREATION_COMPLETE));
}
public function resolveAutomationIDPart(criteria:Object):Array{
if (automationDelegate){
return (automationDelegate.resolveAutomationIDPart(criteria));
};
return ([]);
}
public function setFocus():void{
stage.focus = focusableObjects[(reverseDirectionFocus) ? (focusableObjects.length - 1) : 0];
addFocusEventListeners();
}
public function set percentHeight(value:Number):void{
_percentHeight = value;
notifySizeChanged();
}
public function get horizontalCenter(){
return (_horizontalCenter);
}
override public function set width(value:Number):void{
explicitWidth = value;
}
public function set maxWidth(value:Number):void{
explicitMaxWidth = value;
}
private function buildStateMap():void{
var labels:Array = currentLabels;
stateMap = {};
var i:int;
while (i < labels.length) {
stateMap[labels[i].name] = labels[i];
i++;
};
}
protected function dispatchResizeEvent():void{
var resizeEvent:ResizeEvent = new ResizeEvent(ResizeEvent.RESIZE);
resizeEvent.oldWidth = oldWidth;
resizeEvent.oldHeight = oldHeight;
dispatchEvent(resizeEvent);
oldWidth = width;
oldHeight = height;
}
public function deleteReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
if (((id) && (!((id == ""))))){
parentDocument[id] = null;
};
}
public function owns(displayObject:DisplayObject):Boolean{
while (((displayObject) && (!((displayObject == this))))) {
if ((displayObject is IUIComponent)){
displayObject = IUIComponent(displayObject).owner;
} else {
displayObject = displayObject.parent;
};
};
return ((displayObject == this));
}
public function set explicitMaxHeight(value:Number):void{
_explicitMaxHeight = value;
notifySizeChanged();
}
public function setVisible(value:Boolean, noEvent:Boolean=false):void{
super.visible = value;
if (!noEvent){
dispatchEvent(new FlexEvent((value) ? FlexEvent.SHOW : FlexEvent.HIDE));
};
}
public function get maxHeight():Number{
return ((isNaN(explicitMaxHeight)) ? 10000 : explicitMaxHeight);
}
public function get automationDelegate():Object{
return (_automationDelegate);
}
public function set explicitMinWidth(value:Number):void{
_explicitMinWidth = value;
notifySizeChanged();
}
public function get isPopUp():Boolean{
return (_isPopUp);
}
public function get percentHeight():Number{
return (_percentHeight);
}
override public function get width():Number{
if (!isNaN(_width)){
return (_width);
};
return (super.width);
}
public function get explicitMaxHeight():Number{
return (_explicitMaxHeight);
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
if (((!((x == oldX))) || (!((y == oldY))))){
dispatchMoveEvent();
};
}
public function get toolTip():String{
return (_toolTip);
}
public function get parentDocument():Object{
var p:IUIComponent;
var sm:ISystemManager;
if (document == this){
p = (parent as IUIComponent);
if (p){
return (p.document);
};
sm = (parent as ISystemManager);
if (sm){
return (sm.document);
};
return (null);
//unresolved jump
};
return (document);
}
override public function set tabEnabled(value:Boolean):void{
super.tabEnabled = value;
explicitTabEnabledChanged = true;
}
public function set toolTip(value:String):void{
var toolTipManager:* = ApplicationDomain.currentDomain.getDefinition("mx.managers.ToolTipManager");
var oldValue:String = _toolTip;
_toolTip = value;
if (toolTipManager){
var _local4 = toolTipManager;
_local4.mx_internal::registerToolTip(this, oldValue, value);
};
}
public function set explicitWidth(value:Number):void{
_explicitWidth = value;
explicitSizeChanged = true;
notifySizeChanged();
}
private function dispatchMoveEvent():void{
var moveEvent:MoveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = oldX;
moveEvent.oldY = oldY;
dispatchEvent(moveEvent);
oldX = x;
oldY = y;
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function get measuredMinHeight():Number{
return (_measuredMinHeight);
}
public function drawFocus(isFocused:Boolean):void{
}
public function set measuredMinHeight(value:Number):void{
_measuredMinHeight = value;
}
override public function get tabEnabled():Boolean{
return (super.tabEnabled);
}
public function get automationTabularData():Object{
if (automationDelegate){
return (automationDelegate.automationTabularData);
};
return (null);
}
}
}//package mx.flash
Section 537
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import flash.events.*;
import flash.display.*;
import mx.core.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void;
function set focusPane(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void;
function set showFocusIndicator(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function moveFocus(_arg1:String, _arg2:DisplayObject=null):void;
function addSWFBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function removeSWFBridge(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IEventDispatcher):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(value:InteractiveObject):IFocusManagerComponent;
function get nextTabIndex():int;
function get defaultButton():IButton;
function get showFocusIndicator():Boolean;
function setFocus(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 538
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.managers {
public interface IFocusManagerComponent {
function set focusEnabled(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function drawFocus(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as: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 539
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.events.*;
import flash.display.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IFocusManagerContainer.as:IFocusManager):void;
function get focusManager():IFocusManager;
function get systemManager():ISystemManager;
function contains(mx.managers:DisplayObject):Boolean;
}
}//package mx.managers
Section 540
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import flash.events.*;
import flash.display.*;
import mx.core.*;
import flash.geom.*;
import flash.text.*;
public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory {
function set focusPane(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Sprite):void;
function get toolTipChildren():IChildList;
function useSWFBridge():Boolean;
function isFontFaceEmbedded(flash.display:TextFormat):Boolean;
function deployMouseShields(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get: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(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get: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(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IEventDispatcher):void;
function isDisplayObjectInABridgedApplication(flash.display:DisplayObject):Boolean;
function get popUpChildren():IChildList;
function get screen():Rectangle;
function removeChildFromSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function getDefinitionByName(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;ISystemManager.as:String):Object;
function activate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function deactivate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get cursorChildren():IChildList;
function set document(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Object):void;
function get embeddedFontList():Object;
function set numModalWindows(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:int):void;
function isTopLevel():Boolean;
function isTopLevelRoot():Boolean;
function get numModalWindows():int;
function addFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get stage():Stage;
function getVisibleApplicationRect(value:Rectangle=null):Rectangle;
}
}//package mx.managers
Section 541
//IToolTipManagerClient (mx.managers.IToolTipManagerClient)
package mx.managers {
import mx.core.*;
public interface IToolTipManagerClient extends IFlexDisplayObject {
function get toolTip():String;
function set toolTip(C:\autobuild\galaga\frameworks\projects\framework\src;mx\managers;IToolTipManagerClient.as:String):void;
}
}//package mx.managers
Section 542
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import flash.utils.*;
import mx.core.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.4.0.9271";
private static var counter:int = 0;
public function NameUtil(){
super();
}
public static function displayObjectToString(displayObject:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = displayObject;
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;
};
//unresolved jump
var _slot1 = e;
return (result);
}
public static function createUniqueName(object:Object):String{
if (!object){
return (null);
};
var name:String = getQualifiedClassName(object);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
var charCode:int = name.charCodeAt((name.length - 1));
if ((((charCode >= 48)) && ((charCode <= 57)))){
name = (name + "_");
};
return ((name + counter++));
}
}
}//package mx.utils
Section 543
//Action (org.flintparticles.common.actions.Action)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.behaviours.*;
public interface Action extends Behaviour {
function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void;
}
}//package org.flintparticles.common.actions
Section 544
//ActionBase (org.flintparticles.common.actions.ActionBase)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class ActionBase implements Action {
protected var _priority:int;// = 0
public function ActionBase(){
super();
}
public function set priority(value:int):void{
_priority = value;
}
public function update(emitter:Emitter, particle:Particle, time:Number):void{
}
public function removedFromEmitter(emitter:Emitter):void{
}
public function addedToEmitter(emitter:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.actions
Section 545
//Age (org.flintparticles.common.actions.Age)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.energyEasing.*;
public class Age extends ActionBase {
private var _easing:Function;
public function Age(easing:Function=null){
super();
if (easing == null){
_easing = Linear.easeNone;
} else {
_easing = easing;
};
}
public function set easing(value:Function):void{
_easing = value;
}
override public function update(emitter:Emitter, particle:Particle, time:Number):void{
particle.age = (particle.age + time);
if (particle.age >= particle.lifetime){
particle.energy = 0;
particle.isDead = true;
} else {
particle.energy = _easing(particle.age, particle.lifetime);
};
}
public function get easing():Function{
return (_easing);
}
}
}//package org.flintparticles.common.actions
Section 546
//ColorChange (org.flintparticles.common.actions.ColorChange)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ColorChange extends ActionBase {
private var _startColor:uint;
private var _endColor:uint;
public function ColorChange(startColor:uint=0xFFFFFF, endColor:uint=0xFFFFFF){
super();
_startColor = startColor;
_endColor = endColor;
}
public function get startColor():uint{
return (_startColor);
}
public function set startColor(value:uint):void{
_startColor = value;
}
public function get endColor():uint{
return (_endColor);
}
override public function update(emitter:Emitter, particle:Particle, time:Number):void{
particle.color = interpolateColors(_startColor, _endColor, particle.energy);
}
public function set endColor(value:uint):void{
_endColor = value;
}
}
}//package org.flintparticles.common.actions
Section 547
//Fade (org.flintparticles.common.actions.Fade)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Fade extends ActionBase {
private var _endAlpha:Number;
private var _diffAlpha:Number;
public function Fade(startAlpha:Number=1, endAlpha:Number=0){
super();
priority = -5;
_diffAlpha = (startAlpha - endAlpha);
_endAlpha = endAlpha;
}
public function get endAlpha():Number{
return (_endAlpha);
}
public function set endAlpha(value:Number):void{
_diffAlpha = ((_endAlpha + _diffAlpha) - value);
_endAlpha = value;
}
public function set startAlpha(value:Number):void{
_diffAlpha = (value - _endAlpha);
}
override public function update(emitter:Emitter, particle:Particle, time:Number):void{
var alpha:Number = (_endAlpha + (_diffAlpha * particle.energy));
particle.color = ((particle.color & 0xFFFFFF) | (Math.round((alpha * 0xFF)) << 24));
}
public function get startAlpha():Number{
return ((_endAlpha + _diffAlpha));
}
}
}//package org.flintparticles.common.actions
Section 548
//Activity (org.flintparticles.common.activities.Activity)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.behaviours.*;
public interface Activity extends Behaviour {
function initialize(:Emitter):void;
function update(_arg1:Emitter, _arg2:Number):void;
}
}//package org.flintparticles.common.activities
Section 549
//Behaviour (org.flintparticles.common.behaviours.Behaviour)
package org.flintparticles.common.behaviours {
import org.flintparticles.common.emitters.*;
public interface Behaviour {
function set priority(/Users/richard/Documents/FDT_Workspace/Flint Particles/src;org/flintparticles/common/behaviours;Behaviour.as:int):void;
function addedToEmitter(/Users/richard/Documents/FDT_Workspace/Flint Particles/src;org/flintparticles/common/behaviours;Behaviour.as:Emitter):void;
function get priority():int;
function removedFromEmitter(/Users/richard/Documents/FDT_Workspace/Flint Particles/src;org/flintparticles/common/behaviours;Behaviour.as:Emitter):void;
}
}//package org.flintparticles.common.behaviours
Section 550
//BehaviourArrayUtils (org.flintparticles.common.behaviours.BehaviourArrayUtils)
package org.flintparticles.common.behaviours {
public class BehaviourArrayUtils {
public function BehaviourArrayUtils(){
super();
}
public static function add(array:Array, item:Behaviour):uint{
var len:uint = array.length;
var i:uint;
while (i < len) {
if (Behaviour(array[i]).priority < item.priority){
break;
};
i++;
};
array.splice(i, 0, item);
return ((len + 1));
}
public static function remove(array:Array, item:Behaviour):Boolean{
var index:int = array.indexOf(item);
if (index != -1){
array.splice(index, 1);
return (true);
};
return (false);
}
public static function removeAt(array:Array, index:uint):Behaviour{
var temp:Behaviour = (array[index] as Behaviour);
array.splice(index, 1);
return (temp);
}
public static function containsType(array:Array, type:Class):Boolean{
var len:uint = array.length;
var i:uint;
while (i < len) {
if ((array[i] is type)){
return (true);
};
i++;
};
return (false);
}
public static function sortArray(array:Array):void{
array.sortOn("priority", Array.NUMERIC);
}
public static function clear(array:Array):void{
array.length = 0;
}
public static function contains(array:Array, item:Behaviour):Boolean{
return (!((array.indexOf(item) == -1)));
}
}
}//package org.flintparticles.common.behaviours
Section 551
//Blast (org.flintparticles.common.counters.Blast)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Blast implements Counter {
private var _done:Boolean;// = false
private var _startCount:uint;
public function Blast(startCount:uint=0){
super();
_startCount = startCount;
}
public function updateEmitter(emitter:Emitter, time:Number):uint{
return (0);
}
public function startEmitter(emitter:Emitter):uint{
emitter.dispatchCounterComplete();
return (_startCount);
}
public function resume():void{
}
public function stop():void{
}
public function get startCount():Number{
return (_startCount);
}
public function get complete():Boolean{
return (_done);
}
public function set startCount(value:Number):void{
_startCount = value;
}
}
}//package org.flintparticles.common.counters
Section 552
//Counter (org.flintparticles.common.counters.Counter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public interface Counter {
function stop():void;
function updateEmitter(_arg1:Emitter, _arg2:Number):uint;
function get complete():Boolean;
function startEmitter(:Emitter):uint;
function resume():void;
}
}//package org.flintparticles.common.counters
Section 553
//ZeroCounter (org.flintparticles.common.counters.ZeroCounter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class ZeroCounter implements Counter {
public function ZeroCounter(){
super();
}
public function get complete():Boolean{
return (true);
}
public function stop():void{
}
public function updateEmitter(emitter:Emitter, time:Number):uint{
return (0);
}
public function startEmitter(emitter:Emitter):uint{
return (0);
}
public function resume():void{
}
}
}//package org.flintparticles.common.counters
Section 554
//Emitter (org.flintparticles.common.emitters.Emitter)
package org.flintparticles.common.emitters {
import flash.events.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.behaviours.*;
import org.flintparticles.common.utils.*;
public class Emitter extends EventDispatcher {
protected var _running:Boolean;// = false
protected var _activities:Array;
protected var _particles:Array;
protected var _initializers:Array;
protected var _dispatchCounterComplete:Boolean;// = false
protected var _counter:Counter;
protected var _started:Boolean;// = false
protected var _actions:Array;
protected var _useInternalTick:Boolean;// = true
protected var _particleFactory:ParticleFactory;
protected var _fixedFrameTime:Number;// = 0
protected var _maximumFrameTime:Number;// = 0.1
public function Emitter(){
super();
_particles = new Array();
_actions = new Array();
_initializers = new Array();
_activities = new Array();
_counter = new ZeroCounter();
}
public function addInitializer(initializer:Initializer):void{
BehaviourArrayUtils.add(_initializers, initializer);
initializer.addedToEmitter(this);
}
public function stop():void{
if (_useInternalTick){
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
_started = false;
killAllParticles();
}
public function pause():void{
_running = false;
}
public function killAllParticles():void{
var len:int = _particles.length;
var i:int;
while (i < len) {
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _particles[i]));
_particleFactory.disposeParticle(_particles[i]);
i++;
};
_particles.length = 0;
}
public function runAhead(time:Number, frameRate:Number=10):void{
var maxTime:Number = _maximumFrameTime;
var step:Number = (1 / frameRate);
_maximumFrameTime = step;
while (time > 0) {
time = (time - step);
update(step);
};
_maximumFrameTime = maxTime;
}
public function set fixedFrameTime(value:Number):void{
_fixedFrameTime = value;
}
public function get maximumFrameTime():Number{
return (_maximumFrameTime);
}
public function set particles(value:Array):void{
killAllParticles();
addExistingParticles(value, false);
}
public function get useInternalTick():Boolean{
return (_useInternalTick);
}
public function set initializers(value:Array):void{
var initializer:Initializer;
for each (initializer in _initializers) {
initializer.removedFromEmitter(this);
};
_initializers = value.slice();
BehaviourArrayUtils.sortArray(_initializers);
for each (initializer in value) {
initializer.addedToEmitter(this);
};
}
public function get particleFactory():ParticleFactory{
return (_particleFactory);
}
private function updateEventListener(ev:UpdateEvent):void{
if (_fixedFrameTime){
update(_fixedFrameTime);
} else {
update(ev.time);
};
}
protected function createParticle():Particle{
var particle:Particle = _particleFactory.createParticle();
var len:int = _initializers.length;
initParticle(particle);
var i:int;
while (i < len) {
Initializer(_initializers[i]).initialize(this, particle);
i++;
};
_particles.push(particle);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_CREATED, particle));
return (particle);
}
public function get particles():Array{
return (_particles);
}
protected function sortParticles():void{
}
public function removeActivity(activity:Activity):void{
if (BehaviourArrayUtils.remove(_activities, activity)){
activity.removedFromEmitter(this);
};
}
public function set maximumFrameTime(value:Number):void{
_maximumFrameTime = value;
}
protected function initParticle(particle:Particle):void{
}
public function addAction(action:Action):void{
BehaviourArrayUtils.add(_actions, action);
action.addedToEmitter(this);
}
public function hasInitializerOfType(initializerClass:Class):Boolean{
return (BehaviourArrayUtils.containsType(_initializers, initializerClass));
}
public function removeInitializer(initializer:Initializer):void{
if (BehaviourArrayUtils.remove(_initializers, initializer)){
initializer.removedFromEmitter(this);
};
}
public function get running():Boolean{
return (_running);
}
public function hasActionOfType(actionClass:Class):Boolean{
return (BehaviourArrayUtils.containsType(_actions, actionClass));
}
public function get fixedFrameTime():Number{
return (_fixedFrameTime);
}
public function set particleFactory(value:ParticleFactory):void{
_particleFactory = value;
}
public function set useInternalTick(value:Boolean):void{
if (_useInternalTick != value){
_useInternalTick = value;
if (_started){
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
} else {
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
};
};
}
public function resume():void{
_running = true;
}
public function addActivity(activity:Activity):void{
BehaviourArrayUtils.add(_activities, activity);
activity.addedToEmitter(this);
}
public function get initializers():Array{
return (_initializers);
}
public function addExistingParticles(particles:Array, applyInitializers:Boolean=false):void{
var i:int;
var len2:int;
var j:int;
var len:int = particles.length;
if (applyInitializers){
len2 = _initializers.length;
j = 0;
while (j < len2) {
i = 0;
while (i < len) {
Initializer(_initializers[j]).initialize(this, particles[i]);
i++;
};
j++;
};
};
i = 0;
while (i < len) {
_particles.push(particles[i]);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_ADDED, particles[i]));
i++;
};
}
public function hasActivityOfType(activityClass:Class):Boolean{
return (BehaviourArrayUtils.containsType(_activities, activityClass));
}
public function set activities(value:Array):void{
var activity:Activity;
for each (activity in _activities) {
activity.removedFromEmitter(this);
};
_activities = value.slice();
BehaviourArrayUtils.sortArray(_activities);
for each (activity in _activities) {
activity.addedToEmitter(this);
};
}
public function hasInitializer(initializer:Initializer):Boolean{
return (BehaviourArrayUtils.contains(_initializers, initializer));
}
public function removeAction(action:Action):void{
if (BehaviourArrayUtils.remove(_actions, action)){
action.removedFromEmitter(this);
};
}
public function hasActivity(activity:Activity):Boolean{
return (BehaviourArrayUtils.contains(_activities, activity));
}
public function get activities():Array{
return (_activities);
}
public function hasAction(action:Action):Boolean{
return (BehaviourArrayUtils.contains(_actions, action));
}
public function start():void{
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
};
_started = true;
_running = true;
var len:int = _activities.length;
var i:int;
while (i < len) {
Activity(_activities[i]).initialize(this);
i++;
};
len = _counter.startEmitter(this);
i = 0;
while (i < len) {
createParticle();
i++;
};
}
public function update(time:Number):void{
var i:int;
var particle:Particle;
var action:Action;
var len2:int;
var j:int;
if (!_running){
return;
};
if (time > _maximumFrameTime){
time = _maximumFrameTime;
};
var len:int = _counter.updateEmitter(this, time);
i = 0;
while (i < len) {
createParticle();
i++;
};
sortParticles();
len = _activities.length;
i = 0;
while (i < len) {
Activity(_activities[i]).update(this, time);
i++;
};
if (_particles.length > 0){
len = _actions.length;
len2 = _particles.length;
j = 0;
while (j < len) {
action = _actions[j];
i = 0;
while (i < len2) {
particle = _particles[i];
action.update(this, particle, time);
i++;
};
j++;
};
i = len2;
while (i--) {
particle = _particles[i];
if (particle.isDead){
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, particle));
_particleFactory.disposeParticle(particle);
_particles.splice(i, 1);
};
};
} else {
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_EMPTY));
};
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_UPDATED));
if (_dispatchCounterComplete){
_dispatchCounterComplete = false;
dispatchEvent(new EmitterEvent(EmitterEvent.COUNTER_COMPLETE));
};
}
public function set counter(value:Counter):void{
_counter = value;
if (running){
_counter.startEmitter(this);
};
}
public function set actions(value:Array):void{
var action:Action;
for each (action in _actions) {
action.removedFromEmitter(this);
};
_actions = value.slice();
BehaviourArrayUtils.sortArray(_actions);
for each (action in value) {
action.addedToEmitter(this);
};
}
public function dispatchCounterComplete():void{
_dispatchCounterComplete = true;
}
public function get counter():Counter{
return (_counter);
}
public function get actions():Array{
return (_actions);
}
}
}//package org.flintparticles.common.emitters
Section 555
//Linear (org.flintparticles.common.energyEasing.Linear)
package org.flintparticles.common.energyEasing {
public class Linear {
public function Linear(){
super();
}
public static function easeOut(age:Number, lifetime:Number):Number{
return ((1 - (age / lifetime)));
}
public static function easeIn(age:Number, lifetime:Number):Number{
return ((1 - (age / lifetime)));
}
public static function easeInOut(age:Number, lifetime:Number):Number{
return ((1 - (age / lifetime)));
}
public static function easeNone(age:Number, lifetime:Number):Number{
return ((1 - (age / lifetime)));
}
}
}//package org.flintparticles.common.energyEasing
Section 556
//EmitterEvent (org.flintparticles.common.events.EmitterEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class EmitterEvent extends Event {
public static var COUNTER_COMPLETE:String = "counterComplete";
public static var EMITTER_UPDATED:String = "emitterUpdated";
public static var EMITTER_EMPTY:String = "emitterEmpty";
public function EmitterEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
}
}//package org.flintparticles.common.events
Section 557
//ParticleEvent (org.flintparticles.common.events.ParticleEvent)
package org.flintparticles.common.events {
import flash.events.*;
import org.flintparticles.common.particles.*;
public class ParticleEvent extends Event {
public var particle:Particle;
public var otherObject;
public static var PARTICLES_COLLISION:String = "particlesCollision";
public static var PARTICLE_ADDED:String = "particleAdded";
public static var PARTICLE_DEAD:String = "particleDead";
public static var PARTICLE_CREATED:String = "particleCreated";
public function ParticleEvent(type:String, particle:Particle=null, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
this.particle = particle;
}
override public function clone():Event{
var e:ParticleEvent = new ParticleEvent(type, particle, bubbles, cancelable);
e.otherObject = otherObject;
return (e);
}
}
}//package org.flintparticles.common.events
Section 558
//UpdateEvent (org.flintparticles.common.events.UpdateEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class UpdateEvent extends Event {
public var time:Number;
public static var UPDATE:String = "update";
public function UpdateEvent(type:String, time:Number=NaN, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
this.time = time;
}
override public function clone():Event{
return (new UpdateEvent(type, time, bubbles, cancelable));
}
}
}//package org.flintparticles.common.events
Section 559
//ColorInit (org.flintparticles.common.initializers.ColorInit)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ColorInit extends InitializerBase {
private var _max:uint;
private var _min:uint;
public function ColorInit(color1:uint=0xFFFFFF, color2:uint=0xFFFFFF){
super();
_min = color1;
_max = color2;
}
public function set minColor(value:uint):void{
_min = value;
}
public function get color():uint{
return (((_min == _max)) ? _min : interpolateColors(_max, _min, 0.5));
}
public function set color(value:uint):void{
_max = (_min = value);
}
override public function initialize(emitter:Emitter, particle:Particle):void{
if (_max == _min){
particle.color = _min;
} else {
particle.color = interpolateColors(_min, _max, Math.random());
};
}
public function get minColor():uint{
return (_min);
}
public function set maxColor(value:uint):void{
_max = value;
}
public function get maxColor():uint{
return (_max);
}
}
}//package org.flintparticles.common.initializers
Section 560
//ImageClass (org.flintparticles.common.initializers.ImageClass)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ImageClass extends InitializerBase {
private var _parameters:Array;
private var _imageClass:Class;
public function ImageClass(imageClass:Class=null, ... _args){
super();
_imageClass = imageClass;
_parameters = _args;
}
override public function initialize(emitter:Emitter, particle:Particle):void{
particle.image = construct(_imageClass, _parameters);
}
public function get parameters():Array{
return (_parameters);
}
public function set parameters(value:Array):void{
_parameters = value;
}
public function set imageClass(value:Class):void{
_imageClass = value;
}
public function get imageClass():Class{
return (_imageClass);
}
}
}//package org.flintparticles.common.initializers
Section 561
//Initializer (org.flintparticles.common.initializers.Initializer)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.behaviours.*;
public interface Initializer extends Behaviour {
function initialize(_arg1:Emitter, _arg2:Particle):void;
}
}//package org.flintparticles.common.initializers
Section 562
//InitializerBase (org.flintparticles.common.initializers.InitializerBase)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class InitializerBase implements Initializer {
protected var _priority:int;// = 0
public function InitializerBase(){
super();
}
public function set priority(value:int):void{
_priority = value;
}
public function initialize(emitter:Emitter, particle:Particle):void{
}
public function removedFromEmitter(emitter:Emitter):void{
}
public function addedToEmitter(emitter:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.initializers
Section 563
//Lifetime (org.flintparticles.common.initializers.Lifetime)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Lifetime extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function Lifetime(minLifetime:Number=1.79769313486232E308, maxLifetime:Number=NaN){
super();
_max = maxLifetime;
_min = minLifetime;
}
public function get lifetime():Number{
return (((_min == _max)) ? _min : ((_max + _min) * 0.5));
}
public function get maxLifetime():Number{
return (_max);
}
override public function initialize(emitter:Emitter, particle:Particle):void{
if (isNaN(_max)){
particle.lifetime = _min;
} else {
particle.lifetime = (_min + (Math.random() * (_max - _min)));
};
}
public function set lifetime(value:Number):void{
_max = (_min = value);
}
public function set minLifetime(value:Number):void{
_min = value;
}
public function set maxLifetime(value:Number):void{
_max = value;
}
public function get minLifetime():Number{
return (_min);
}
}
}//package org.flintparticles.common.initializers
Section 564
//ScaleImageInit (org.flintparticles.common.initializers.ScaleImageInit)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class ScaleImageInit extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function ScaleImageInit(minScale:Number=1, maxScale:Number=NaN){
super();
_min = minScale;
if (isNaN(maxScale)){
_max = _min;
} else {
_max = maxScale;
};
}
public function get scale():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
public function set maxScale(value:Number):void{
_max = value;
}
public function get maxScale():Number{
return (_max);
}
public function set minScale(value:Number):void{
_min = value;
}
public function set scale(value:Number):void{
_max = (_min = value);
}
override public function initialize(emitter:Emitter, particle:Particle):void{
if (_max == _min){
particle.scale = _min;
} else {
particle.scale = (_min + (Math.random() * (_max - _min)));
};
}
public function get minScale():Number{
return (_min);
}
}
}//package org.flintparticles.common.initializers
Section 565
//Particle (org.flintparticles.common.particles.Particle)
package org.flintparticles.common.particles {
import flash.geom.*;
import flash.utils.*;
public class Particle {
public var energy:Number;// = 1
public var lifetime:Number;// = 0
public var scale:Number;// = 1
public var image;// = null
public var color:uint;// = 4294967295
public var collisionRadius:Number;// = 1
private var _colorTransform:ColorTransform;// = null
private var _previousColor:uint;
public var isDead:Boolean;// = false
public var mass:Number;// = 1
private var _dictionary:Dictionary;// = null
public var age:Number;// = 0
public function Particle(){
super();
}
public function get dictionary():Dictionary{
if (_dictionary == null){
_dictionary = new Dictionary(true);
};
return (_dictionary);
}
public function get colorTransform():ColorTransform{
if (((!(_colorTransform)) || (!((_previousColor == color))))){
_colorTransform = new ColorTransform((((color >>> 16) & 0xFF) / 0xFF), (((color >>> 8) & 0xFF) / 0xFF), ((color & 0xFF) / 0xFF), (((color >>> 24) & 0xFF) / 0xFF), 0, 0, 0, 0);
_previousColor = color;
};
return (_colorTransform);
}
protected function cloneInto(p:Particle):Particle{
var key:Object;
p.color = color;
p.scale = scale;
p.mass = mass;
p.collisionRadius = collisionRadius;
p.lifetime = lifetime;
p.age = age;
p.energy = energy;
p.isDead = isDead;
p.image = image;
if (_dictionary){
p._dictionary = new Dictionary(true);
for (key in _dictionary) {
p._dictionary[key] = _dictionary[key];
};
};
return (p);
}
public function get alpha():Number{
return ((((color & 4278190080) >>> 24) / 0xFF));
}
public function initialize():void{
color = 4294967295;
scale = 1;
mass = 1;
collisionRadius = 1;
lifetime = 0;
age = 0;
energy = 1;
isDead = false;
image = null;
_dictionary = null;
_colorTransform = null;
}
public function clone(factory:ParticleFactory=null):Particle{
var p:Particle;
if (factory){
p = factory.createParticle();
} else {
p = new Particle();
};
return (cloneInto(p));
}
}
}//package org.flintparticles.common.particles
Section 566
//ParticleFactory (org.flintparticles.common.particles.ParticleFactory)
package org.flintparticles.common.particles {
public interface ParticleFactory {
function clearAllParticles():void;
function createParticle():Particle;
function disposeParticle(/Users/richard/Documents/FDT_Workspace/Flint Particles/src;org/flintparticles/common/particles;ParticleFactory.as:Particle):void;
}
}//package org.flintparticles.common.particles
Section 567
//Renderer (org.flintparticles.common.renderers.Renderer)
package org.flintparticles.common.renderers {
import org.flintparticles.common.emitters.*;
public interface Renderer {
function removeEmitter(:Emitter):void;
function addEmitter(:Emitter):void;
}
}//package org.flintparticles.common.renderers
Section 568
//SpriteRendererBase (org.flintparticles.common.renderers.SpriteRendererBase)
package org.flintparticles.common.renderers {
import flash.events.*;
import flash.display.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.particles.*;
public class SpriteRendererBase extends Sprite implements Renderer {
protected var _emitters:Array;
public function SpriteRendererBase(){
super();
_emitters = new Array();
mouseEnabled = false;
mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
}
private function particleAdded(ev:ParticleEvent):void{
addParticle(ev.particle);
if (stage){
stage.invalidate();
};
}
public function set emitters(value:Array):void{
var e:Emitter;
for each (e in _emitters) {
removeEmitter(e);
};
for each (e in value) {
addEmitter(e);
};
}
private function addedToStage(ev:Event):void{
if (stage){
stage.invalidate();
};
}
public function get emitters():Array{
return (_emitters);
}
protected function addParticle(particle:Particle):void{
}
protected function updateParticles(ev:Event):void{
var particles:Array = new Array();
var i:int;
while (i < _emitters.length) {
particles = particles.concat(Emitter(_emitters[i]).particles);
i++;
};
renderParticles(particles);
}
protected function emitterUpdated(ev:EmitterEvent):void{
if (stage){
stage.invalidate();
};
}
public function removeEmitter(emitter:Emitter):void{
var p:Particle;
var i:int;
while (i < _emitters.length) {
if (_emitters[i] == emitter){
_emitters.splice(i, 1);
emitter.removeEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated);
emitter.removeEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded);
emitter.removeEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded);
emitter.removeEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved);
for each (p in emitter.particles) {
removeParticle(p);
};
if (_emitters.length == 0){
removeEventListener(Event.RENDER, updateParticles);
renderParticles([]);
} else {
if (stage){
stage.invalidate();
};
};
return;
};
i++;
};
}
protected function renderParticles(particles:Array):void{
}
protected function removeParticle(particle:Particle):void{
}
private function particleRemoved(ev:ParticleEvent):void{
removeParticle(ev.particle);
if (stage){
stage.invalidate();
};
}
public function addEmitter(emitter:Emitter):void{
var p:Particle;
_emitters.push(emitter);
if (stage){
stage.invalidate();
};
emitter.addEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated, false, 0, true);
emitter.addEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded, false, 0, true);
emitter.addEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded, false, 0, true);
emitter.addEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved, false, 0, true);
for each (p in emitter.particles) {
addParticle(p);
};
if (_emitters.length == 1){
addEventListener(Event.RENDER, updateParticles, false, 0, true);
};
}
}
}//package org.flintparticles.common.renderers
Section 569
//construct (org.flintparticles.common.utils.construct)
package org.flintparticles.common.utils {
public function construct(type:Class, parameters:Array){
switch (parameters.length){
case 0:
return (new (type));
case 1:
return (new type(parameters[0]));
case 2:
return (new type(parameters[0], parameters[1]));
case 3:
return (new type(parameters[0], parameters[1], parameters[2]));
case 4:
return (new type(parameters[0], parameters[1], parameters[2], parameters[3]));
case 5:
return (new type(parameters[0], parameters[1], parameters[2], parameters[3], parameters[4]));
case 6:
return (new type(parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]));
case 7:
return (new type(parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6]));
case 8:
return (new type(parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7]));
case 9:
return (new type(parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8]));
case 10:
return (new type(parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8], parameters[9]));
default:
return (null);
};
}
}//package org.flintparticles.common.utils
Section 570
//FrameUpdater (org.flintparticles.common.utils.FrameUpdater)
package org.flintparticles.common.utils {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import org.flintparticles.common.events.*;
public class FrameUpdater extends EventDispatcher {
private var _shape:Shape;
private var _running:Boolean;// = false
private var _time:Number;
private static var _instance:FrameUpdater;
public function FrameUpdater(){
super();
_shape = new Shape();
}
private function startTimer():void{
_shape.addEventListener(Event.ENTER_FRAME, frameUpdate, false, 0, true);
_time = getTimer();
_running = true;
}
private function stopTimer():void{
_shape.removeEventListener(Event.ENTER_FRAME, frameUpdate);
_running = false;
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
super.removeEventListener(type, listener, useCapture);
if (((_running) && (!(hasEventListener(UpdateEvent.UPDATE))))){
stopTimer();
};
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, weakReference:Boolean=false):void{
super.addEventListener(type, listener, useCapture, priority, weakReference);
if (((!(_running)) && (hasEventListener(UpdateEvent.UPDATE)))){
startTimer();
};
}
private function frameUpdate(ev:Event):void{
var oldTime:int = _time;
_time = getTimer();
var frameTime:Number = ((_time - oldTime) * 0.001);
dispatchEvent(new UpdateEvent(UpdateEvent.UPDATE, frameTime));
}
public static function get instance():FrameUpdater{
if (_instance == null){
_instance = new (FrameUpdater);
};
return (_instance);
}
}
}//package org.flintparticles.common.utils
Section 571
//interpolateColors (org.flintparticles.common.utils.interpolateColors)
package org.flintparticles.common.utils {
public function interpolateColors(color1:uint, color2:uint, ratio:Number):uint{
var inv:Number = (1 - ratio);
var red:uint = Math.round(((((color1 >>> 16) & 0xFF) * ratio) + (((color2 >>> 16) & 0xFF) * inv)));
var green:uint = Math.round(((((color1 >>> 8) & 0xFF) * ratio) + (((color2 >>> 8) & 0xFF) * inv)));
var blue:uint = Math.round((((color1 & 0xFF) * ratio) + ((color2 & 0xFF) * inv)));
var alpha:uint = Math.round(((((color1 >>> 24) & 0xFF) * ratio) + (((color2 >>> 24) & 0xFF) * inv)));
return (((((alpha << 24) | (red << 16)) | (green << 8)) | blue));
}
}//package org.flintparticles.common.utils
Section 572
//Maths (org.flintparticles.common.utils.Maths)
package org.flintparticles.common.utils {
public class Maths {
private static const DEGTORAD:Number = (Math.PI / 180);
private static const RADTODEG:Number = (180 / Math.PI);
public function Maths(){
super();
}
public static function asRadians(degrees:Number):Number{
return ((degrees * DEGTORAD));
}
public static function asDegrees(radians:Number):Number{
return ((radians * RADTODEG));
}
}
}//package org.flintparticles.common.utils
Section 573
//BoundingBox (org.flintparticles.twoD.actions.BoundingBox)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class BoundingBox extends ActionBase {
private var _left:Number;
private var _bounce:Number;
private var _bottom:Number;
private var _top:Number;
private var _right:Number;
public function BoundingBox(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0, bounce:Number=1){
super();
priority = -20;
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
this.bounce = bounce;
}
public function get right():Number{
return (_right);
}
public function set bottom(value:Number):void{
_bottom = value;
}
public function get bounce():Number{
return (_bounce);
}
override public function update(emitter:Emitter, particle:Particle, time:Number):void{
var position:Number;
var p:Particle2D = Particle2D(particle);
var radius:Number = particle.collisionRadius;
if ((((p.velX > 0)) && (((p.x + radius) >= _right)))){
p.velX = (-(p.velX) * _bounce);
p.x = (p.x + (2 * (_right - position)));
} else {
if ((((p.velX < 0)) && (((p.x - radius) <= _left)))){
p.velX = (-(p.velX) * _bounce);
p.x = (p.x + (2 * (_left - position)));
};
};
if ((((p.velY > 0)) && (((p.y + radius) >= _bottom)))){
p.velY = (-(p.velY) * _bounce);
p.y = (p.y + (2 * (_bottom - position)));
} else {
if ((((p.velY < 0)) && (((p.y - radius) <= _top)))){
p.velY = (-(p.velY) * _bounce);
p.y = (p.y + (2 * (_top - position)));
};
};
}
public function get bottom():Number{
return (_bottom);
}
public function set bounce(value:Number):void{
_bounce = value;
}
public function set top(value:Number):void{
_top = value;
}
public function set left(value:Number):void{
_left = value;
}
public function set right(value:Number):void{
_right = value;
}
public function get top():Number{
return (_top);
}
public function get left():Number{
return (_left);
}
}
}//package org.flintparticles.twoD.actions
Section 574
//GravityWell (org.flintparticles.twoD.actions.GravityWell)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class GravityWell extends ActionBase {
private var lp:Particle2D;
private var _power:Number;
private var ly:Number;
private var lx:Number;
private var _gravityConst:Number;// = 10000
private var _epsilonSq:Number;
private var ldSq:Number;
private var ld:Number;
private var _x:Number;
private var _y:Number;
private var lfactor:Number;
public function GravityWell(power:Number=0, x:Number=0, y:Number=0, epsilon:Number=100){
super();
this.power = power;
this.x = x;
this.y = y;
this.epsilon = epsilon;
}
public function get y():Number{
return (_y);
}
public function set y(value:Number):void{
_y = value;
}
public function get power():Number{
return ((_power / _gravityConst));
}
override public function update(emitter:Emitter, particle:Particle, time:Number):void{
if (particle.mass == 0){
return;
};
lp = Particle2D(particle);
lx = (_x - lp.x);
ly = (_y - lp.y);
ldSq = ((lx * lx) + (ly * ly));
if (ldSq == 0){
return;
};
ld = Math.sqrt(ldSq);
if (ldSq < _epsilonSq){
ldSq = _epsilonSq;
};
lfactor = ((_power * time) / (ldSq * ld));
lp.velX = (lp.velX + (lx * lfactor));
lp.velY = (lp.velY + (ly * lfactor));
}
public function set power(value:Number):void{
_power = (value * _gravityConst);
}
public function set epsilon(value:Number):void{
_epsilonSq = (value * value);
}
public function get epsilon():Number{
return (Math.sqrt(_epsilonSq));
}
public function set x(value:Number):void{
_x = value;
}
public function get x():Number{
return (_x);
}
}
}//package org.flintparticles.twoD.actions
Section 575
//Move (org.flintparticles.twoD.actions.Move)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Move extends ActionBase {
public function Move(){
super();
priority = -10;
}
override public function update(emitter:Emitter, particle:Particle, time:Number):void{
var p:Particle2D = Particle2D(particle);
p.previousX = p.x;
p.previousY = p.y;
p.x = (p.x + (p.velX * time));
p.y = (p.y + (p.velY * time));
}
}
}//package org.flintparticles.twoD.actions
Section 576
//RotateToDirection (org.flintparticles.twoD.actions.RotateToDirection)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class RotateToDirection extends ActionBase {
public function RotateToDirection(){
super();
}
override public function update(emitter:Emitter, particle:Particle, time:Number):void{
var p:Particle2D = Particle2D(particle);
p.rotation = Math.atan2(p.velY, p.velX);
}
}
}//package org.flintparticles.twoD.actions
Section 577
//Emitter2D (org.flintparticles.twoD.emitters.Emitter2D)
package org.flintparticles.twoD.emitters {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
import org.flintparticles.twoD.particles.*;
public class Emitter2D extends Emitter {
protected var _y:Number;// = 0
public var spaceSort:Boolean;// = false
public var spaceSortedX:Array;
protected var _x:Number;// = 0
protected var _rotation:Number;// = 0
protected static var _creator:ParticleCreator2D = new ParticleCreator2D();
public function Emitter2D(){
super();
_particleFactory = _creator;
}
public function get y():Number{
return (_y);
}
override protected function initParticle(particle:Particle):void{
var p:Particle2D = Particle2D(particle);
p.x = _x;
p.y = _y;
p.previousX = _x;
p.previousY = _y;
p.rotation = _rotation;
}
override protected function sortParticles():void{
var len:int;
var i:int;
if (spaceSort){
spaceSortedX = _particles.sortOn("x", (Array.NUMERIC | Array.RETURNINDEXEDARRAY));
len = _particles.length;
i = 0;
while (i < len) {
Particle2D(_particles[spaceSortedX[i]]).sortID = i;
i++;
};
};
}
public function set x(value:Number):void{
_x = value;
}
public function set rotRadians(value:Number):void{
_rotation = value;
}
public function get x():Number{
return (_x);
}
public function get rotRadians():Number{
return (_rotation);
}
public function set rotation(value:Number):void{
_rotation = Maths.asRadians(value);
}
public function get rotation():Number{
return (Maths.asDegrees(_rotation));
}
public function set y(value:Number):void{
_y = value;
}
public static function get defaultParticleFactory():ParticleFactory{
return (_creator);
}
}
}//package org.flintparticles.twoD.emitters
Section 578
//Position (org.flintparticles.twoD.initializers.Position)
package org.flintparticles.twoD.initializers {
import flash.geom.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.twoD.particles.*;
public class Position extends InitializerBase {
private var _zone:Zone2D;
public function Position(zone:Zone2D=null){
super();
this.zone = zone;
}
override public function initialize(emitter:Emitter, particle:Particle):void{
var p:Particle2D;
var sin:Number;
var cos:Number;
p = Particle2D(particle);
var loc:Point = _zone.getLocation();
if (p.rotation == 0){
p.x = (p.x + loc.x);
p.y = (p.y + loc.y);
} else {
sin = Math.sin(p.rotation);
cos = Math.cos(p.rotation);
p.x = (p.x + ((cos * loc.x) - (sin * loc.y)));
p.y = (p.y + ((cos * loc.y) + (sin * loc.x)));
};
p.previousX = p.x;
p.previousY = p.y;
}
public function set zone(value:Zone2D):void{
_zone = value;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 579
//Velocity (org.flintparticles.twoD.initializers.Velocity)
package org.flintparticles.twoD.initializers {
import flash.geom.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.twoD.particles.*;
public class Velocity extends InitializerBase {
private var _zone:Zone2D;
public function Velocity(zone:Zone2D=null){
super();
this.zone = zone;
}
override public function initialize(emitter:Emitter, particle:Particle):void{
var sin:Number;
var cos:Number;
var p:Particle2D = Particle2D(particle);
var loc:Point = _zone.getLocation();
if (p.rotation == 0){
p.velX = loc.x;
p.velY = loc.y;
} else {
sin = Math.sin(p.rotation);
cos = Math.cos(p.rotation);
p.velX = ((cos * loc.x) - (sin * loc.y));
p.velY = ((cos * loc.y) + (sin * loc.x));
};
}
public function set zone(value:Zone2D):void{
_zone = value;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 580
//Particle2D (org.flintparticles.twoD.particles.Particle2D)
package org.flintparticles.twoD.particles {
import flash.geom.*;
import org.flintparticles.common.particles.*;
public class Particle2D extends Particle {
public var y:Number;// = 0
public var previousX:Number;// = 0
public var previousY:Number;// = 0
private var _previousRadius:Number;
public var angVelocity:Number;// = 0
public var velX:Number;// = 0
public var velY:Number;// = 0
private var _previousMass:Number;
public var x:Number;// = 0
public var sortID:int;// = -1
private var _inertia:Number;
public var rotation:Number;// = 0
public function Particle2D(){
super();
}
override public function clone(factory:ParticleFactory=null):Particle{
var p:Particle2D;
if (factory){
p = (factory.createParticle() as Particle2D);
} else {
p = new Particle2D();
};
cloneInto(p);
p.x = x;
p.y = y;
p.velX = velX;
p.velY = velY;
p.rotation = rotation;
p.angVelocity = angVelocity;
return (p);
}
override public function initialize():void{
super.initialize();
x = 0;
y = 0;
previousX = 0;
previousY = 0;
velX = 0;
velY = 0;
rotation = 0;
angVelocity = 0;
sortID = -1;
}
public function get matrixTransform():Matrix{
var cos:Number = (scale * Math.cos(rotation));
var sin:Number = (scale * Math.sin(rotation));
return (new Matrix(cos, sin, -(sin), cos, x, y));
}
public function get inertia():Number{
if (((!((mass == _previousMass))) || (!((collisionRadius == _previousRadius))))){
_inertia = (((mass * collisionRadius) * collisionRadius) * 0.5);
_previousMass = mass;
_previousRadius = collisionRadius;
};
return (_inertia);
}
}
}//package org.flintparticles.twoD.particles
Section 581
//ParticleCreator2D (org.flintparticles.twoD.particles.ParticleCreator2D)
package org.flintparticles.twoD.particles {
import org.flintparticles.common.particles.*;
public class ParticleCreator2D implements ParticleFactory {
private var _particles:Array;
public function ParticleCreator2D(){
super();
_particles = new Array();
}
public function clearAllParticles():void{
_particles = new Array();
}
public function disposeParticle(particle:Particle):void{
if ((particle is Particle2D)){
particle.initialize();
_particles.push(particle);
};
}
public function createParticle():Particle{
if (_particles.length){
return (_particles.pop());
};
return (new Particle2D());
}
}
}//package org.flintparticles.twoD.particles
Section 582
//DisplayObjectRenderer (org.flintparticles.twoD.renderers.DisplayObjectRenderer)
package org.flintparticles.twoD.renderers {
import flash.display.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.renderers.*;
import org.flintparticles.twoD.particles.*;
public class DisplayObjectRenderer extends SpriteRendererBase {
public function DisplayObjectRenderer(){
super();
}
override protected function removeParticle(particle:Particle):void{
removeChild(particle.image);
}
override protected function addParticle(particle:Particle):void{
var p:Particle2D = (particle as Particle2D);
addChildAt(p.image, 0);
var img:DisplayObject = p.image;
img.transform.colorTransform = p.colorTransform;
img.transform.matrix = p.matrixTransform;
}
override protected function renderParticles(particles:Array):void{
var particle:Particle2D;
var img:DisplayObject;
var len:int = particles.length;
var i:int;
while (i < len) {
particle = particles[i];
img = particle.image;
img.transform.colorTransform = particle.colorTransform;
img.transform.matrix = particle.matrixTransform;
i++;
};
}
}
}//package org.flintparticles.twoD.renderers
Section 583
//DiscZone (org.flintparticles.twoD.zones.DiscZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class DiscZone implements Zone2D {
private var _innerRadius:Number;
private var _innerSq:Number;
private var _outerRadius:Number;
private var _center:Point;
private var _outerSq:Number;
private static const TWOPI:Number = 6.28318530717959;
public function DiscZone(center:Point=null, outerRadius:Number=0, innerRadius:Number=0){
super();
if (outerRadius < innerRadius){
throw (new Error((((("The outerRadius (" + outerRadius) + ") can't be smaller than the innerRadius (") + innerRadius) + ") in your DiscZone. N.B. the outerRadius is the second argument in the constructor and the innerRadius is the third argument.")));
};
if (center == null){
_center = new Point(0, 0);
} else {
_center = center;
};
_innerRadius = innerRadius;
_outerRadius = outerRadius;
_innerSq = (_innerRadius * _innerRadius);
_outerSq = (_outerRadius * _outerRadius);
}
public function getArea():Number{
return ((Math.PI * (_outerSq - _innerSq)));
}
public function set centerX(value:Number):void{
_center.x = value;
}
public function set centerY(value:Number):void{
_center.y = value;
}
public function get innerRadius():Number{
return (_innerRadius);
}
public function set innerRadius(value:Number):void{
_innerRadius = value;
_innerSq = (_innerRadius * _innerRadius);
}
public function get center():Point{
return (_center);
}
public function set outerRadius(value:Number):void{
_outerRadius = value;
_outerSq = (_outerRadius * _outerRadius);
}
public function get centerX():Number{
return (_center.x);
}
public function get centerY():Number{
return (_center.y);
}
public function contains(x:Number, y:Number):Boolean{
x = (x - _center.x);
y = (y - _center.y);
var distSq:Number = ((x * x) + (y * y));
return ((((distSq <= _outerSq)) && ((distSq >= _innerSq))));
}
public function getLocation():Point{
var rand:Number = Math.random();
var point:Point = Point.polar((_innerRadius + ((1 - (rand * rand)) * (_outerRadius - _innerRadius))), (Math.random() * TWOPI));
point.x = (point.x + _center.x);
point.y = (point.y + _center.y);
return (point);
}
public function get outerRadius():Number{
return (_outerRadius);
}
public function set center(value:Point):void{
_center = value;
}
}
}//package org.flintparticles.twoD.zones
Section 584
//RectangleZone (org.flintparticles.twoD.zones.RectangleZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class RectangleZone implements Zone2D {
private var _height:Number;
private var _width:Number;
private var _bottom:Number;
private var _right:Number;
private var _top:Number;
private var _left:Number;
public function RectangleZone(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0){
super();
_left = left;
_top = top;
_right = right;
_bottom = bottom;
_width = (right - left);
_height = (bottom - top);
}
public function getArea():Number{
return ((_width * _height));
}
public function get top():Number{
return (_top);
}
public function set bottom(value:Number):void{
_bottom = value;
if (((!(isNaN(_top))) && (!(isNaN(_bottom))))){
_height = (bottom - top);
};
}
public function get right():Number{
return (_right);
}
public function set left(value:Number):void{
_left = value;
if (((!(isNaN(_right))) && (!(isNaN(_left))))){
_width = (right - left);
};
}
public function get left():Number{
return (_left);
}
public function set top(value:Number):void{
_top = value;
if (((!(isNaN(_top))) && (!(isNaN(_bottom))))){
_height = (bottom - top);
};
}
public function contains(x:Number, y:Number):Boolean{
return ((((((((x >= _left)) && ((x <= _right)))) && ((y >= _top)))) && ((y <= _bottom))));
}
public function get bottom():Number{
return (_bottom);
}
public function set right(value:Number):void{
_right = value;
if (((!(isNaN(_right))) && (!(isNaN(_left))))){
_width = (right - left);
};
}
public function getLocation():Point{
return (new Point((_left + (Math.random() * _width)), (_top + (Math.random() * _height))));
}
}
}//package org.flintparticles.twoD.zones
Section 585
//Zone2D (org.flintparticles.twoD.zones.Zone2D)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public interface Zone2D {
function getArea():Number;
function getLocation():Point;
function contains(_arg1:Number, _arg2:Number):Boolean;
}
}//package org.flintparticles.twoD.zones
Section 586
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends Sprite {
}
}//package
Section 587
//First_Hely (First_Hely)
package {
import flash.media.*;
public dynamic class First_Hely extends Sound {
}
}//package
Section 588
//Flag_Animation (Flag_Animation)
package {
import flash.display.*;
public dynamic class Flag_Animation extends MovieClip {
}
}//package
Section 589
//FlashEff2 (FlashEff2)
package {
import flash.events.*;
import com.jumpeye.Events.*;
import com.jumpeye.core.*;
import flash.display.*;
import flash.geom.*;
import com.jumpeye.flashEff2.core.interfaces.*;
import flash.text.*;
import com.jumpeye.flashEff2.text.*;
import flash.utils.*;
import flash.net.*;
import com.jumpeye.flashEff2.text.defaultFade.*;
public dynamic class FlashEff2 extends JUIComponent {
private var _hideTransitionName:String;
protected var tepA:IFlashEffCommand;
protected var tepF:IFlashEffFilter;
protected var tepS:FeTDefaultFade;
protected var _initialTargetTransform:Transform;
protected var isButtonEffectApplyed:Boolean;// = false
private var _useSwapInsteadHide:Boolean;// = false
protected var transitionType:String;// = "show"
protected var hitAreaClip:Sprite;
private var _isTargetVisibleAtEnd:Boolean;// = false
private var _firstLevelOwner:Sprite;
private var _showTransitionStartCommands:Array;
private var _ideDataHolder:String;// = ""
private var _drawAfterFilters:Boolean;// = true
protected var showTimer:Timer;
private var _hideTransitionEndCommands:Array;
private var _highestOwner:Sprite;
private var _hideTransitionStartCommands:Array;
private var _textField:TextField;
protected var nextTarget:DisplayObject;
private var _showTransitionName:String;
protected var swapPattern:IFlashEffSymbolText;
protected var lastTransitionPattern:IFlashEffSymbolText;
protected var eventsDispatched:Number;// = 0
private var _swapTransitionName:String;
private var _swapTarget:DisplayObject;
private var __showDelay:Number;// = 0
protected var swapFlashEff2:FlashEff2;
private var _partialTable:FeTable;
private var _absWords:Array;
private var _target:DisplayObject;
private var __partialPattern:String;// = "com.jumpeye.flashEff2.text.defaultFade.FeTDefaultFade"
private var __hideAutoPlay:Boolean;// = true
protected var partialPattern:IFlashEffSymbol;
protected var maxEndEvents:Number;// = 0
private var __targetInstanceName:String;// = ""
protected var forceHide:Boolean;// = false
protected var bDBTO:Sprite;
private var _buttonOwner:Sprite;
protected var _partialTextOwnerClip:Sprite;
protected var _buttonEffectName:String;
protected var isDragOut:Boolean;// = false
private var __xmlPath:String;// = ""
private var _rollOutCommands:Array;
private var _absCustom:Array;
private var _rollOverCommands:Array;
private var _absLines:Array;
protected var setNewTarget:Boolean;// = false
private var __swapTargetVisibility:Boolean;// = false
protected var filterAsoc:Array;
private var _doubleClickCommands:Array;
private var _textTable:FeTable;
protected var hideTimer:Timer;
protected var _isTransitioning:Boolean;// = false
private var __xmlString:String;// = ""
protected var _buttonEffect:IFlashEffButtonEffect;
private var __swapType:String;// = "hideAndShow"
protected var _xml:XML;
protected var aDBTO:Sprite;
private var _isMouseTriggered:Boolean;// = true
protected var buttonTarget:Sprite;
protected var _cTT:String;// = ""
protected var partialInterval:Number;
private var _releaseCommands:Array;
private var _showTransitionEndCommands:Array;
private var _absMatrix:Array;
private var __targetVisibility:Boolean;// = true
private var __showAutoPlay:Boolean;// = true
private var __hideDelay:Number;// = 2
private var _useHandCursor:Boolean;// = false
private var forceAutoPlay;// = null
private var _clearAfterHide:Boolean;// = true
protected var aDBT:Sprite;
private var __swapTargetInstanceName:String;// = ""
protected var firstInDepth:Sprite;
private var __swapDelay:Number;// = 0
protected var showPattern:IFlashEffSymbolText;
private var _filterList:Array;
protected var drawCalled:Boolean;// = false
private var _targetOwner:MovieClip;
private var _absChars:Array;
private var _pressCommands:Array;
protected var hidePattern:IFlashEffSymbolText;
protected var tTS:Sprite;
protected var bDBT:Sprite;
protected var _textOwnerClip:Sprite;
public static const SWAP_TYPE_SHOW = "show";
public static const SWAP_TYPE_HIDE_AND_SHOW = "hideAndShow";
public static const SWAP_TYPE_HIDE = "hide";
private static var targetPaths:Array;
protected static var REMOVED_FROM_FLASHEFF:Boolean = false;
protected static var eventTypeAsoc:Array = [];
public function FlashEff2(){
init();
}
protected function wordsSplit(_arg1:String, _arg2:uint):Array{
var _local9:Rectangle;
var _local10:Boolean;
var _local11:uint;
var _local12:*;
var _local3:Array = _arg1.split(" ");
var _local4:Array = [];
var _local5:uint = _local3.length;
var _local6:uint;
var _local7:uint;
var _local8:* = 0;
while (_local8 < _local5) {
_local9 = this.textField.getCharBoundaries(((_arg2 + _local6) + _local8));
_local10 = false;
if (_local9 == null){
_local10 = true;
_local11 = _local3[_local8].length;
if (_local11 > 0){
_local12 = 0;
while (_local12 < _local11) {
_local9 = this.textField.getCharBoundaries((((_arg2 + _local6) + _local8) + _local12));
if (_local9 != null){
_local10 = false;
break;
};
_local12++;
};
};
};
if (_local10 == false){
_local4[_local7] = {id:((_arg2 + _local8) + _local6), bounds:_local9, text:_local3[_local8]};
_local6 = (_local6 + String(_local4[_local7].text).length);
_local7++;
} else {
_local6 = (_local6 + _local3[_local8].length);
};
_local8++;
};
return (_local4);
}
public function set partialPatternName(_arg1:String):void{
var patternReference:Class;
var arg = _arg1;
if (arg != ""){
try {
patternReference = (getDefinitionByName(arg) as Class);
} catch(e:ReferenceError) {
throw ((("FLASHEFF2 ERROR: The Pattern:" + arg) + " is unavailable."));
};
};
if (patternReference != null){
this.partialPattern = new patternReference(this);
this.partialPattern.target = this._partialTextOwnerClip;
};
__partialPattern = arg;
}
public function get swapTransitionName():String{
return (_swapTransitionName);
}
public function set swapTarget(_arg1:DisplayObject):void{
if (_arg1 != null){
this._swapTarget = _arg1;
_arg1.visible = this.swapTargetVisibility;
this._swapTransitionName = _arg1.name;
} else {
this._swapTarget = null;
this._swapTransitionName = "";
};
}
public function set xmlString(_arg1:String):void{
var _local2:XML;
if (_arg1 != ""){
this.__xmlString = _arg1;
_local2 = new XML(_arg1);
setProperties(_local2);
};
}
public function get currentTransitionType():String{
return (this._cTT);
}
public function set isMouseTriggered(_arg1:Boolean):void{
this._isMouseTriggered = _arg1;
}
public function removeButtonEffect():void{
if (this.buttonEffect != null){
this.buttonEffect.remove();
};
this.highestOwner.mouseChildren = true;
this.removeButtonEvents();
this.isButtonEffectApplyed = false;
}
public function removeAllCommands():void{
var _local1:*;
for (_local1 in FlashEff2.eventTypeAsoc) {
this.removeAllCommandsByEventType(_local1);
};
}
public function removeCommand(_arg1:IFlashEffCommand):void{
var _local2:*;
var _local3:Array;
var _local4:uint;
for (_local2 in FlashEff2.eventTypeAsoc) {
_local3 = this[(("_" + _local2) + "Commands")];
if (_local3 != null){
_local4 = 0;
while (_local4 < _local3.length) {
if (_local3[_local4] == _arg1){
_local3.splice(_local4, 1);
};
_local4++;
};
if (FlashEff2.eventTypeAsoc[_local2] != ""){
this.setCommands(_local2);
};
};
};
}
public function buttonPress():void{
pressButtonHandler(null, true);
}
public function get showTransition():IFlashEffSymbolText{
return (this.showPattern);
}
protected function pressButtonHandler(_arg1:MouseEvent=null, _arg2:Boolean=false):void{
this.isDragOut = true;
if ((((_arg2 == true)) || ((this.isMouseTriggered == true)))){
if (this._isTransitioning == false){
if (this.buttonEffect != null){
this.buttonEffect.buttonPress();
};
};
};
if (_arg1 != null){
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.MOUSE_DOWN));
};
}
public function get filterList():Array{
return (this._filterList);
}
protected function runCommands(_arg1:Array):void{
var _local2:Number;
var _local3:*;
if (_arg1 != null){
_local2 = _arg1.length;
_local3 = 0;
while (_local3 < _local2) {
IFlashEffCommand(_arg1[_local3]).run();
_local3++;
};
};
}
public function get hideTransition():IFlashEffSymbolText{
return (this.hidePattern);
}
public function buttonRollOver():void{
rollOverButtonHandler(null, true);
}
protected function customSplit(_arg1:String, _arg2:uint, _arg3):Array{
var _local9:String;
var _local10:Rectangle;
var _local11:Boolean;
var _local12:uint;
var _local13:*;
var _local4:Array = [];
var _local5:uint = _arg3.length;
var _local6:uint;
var _local7:uint;
var _local8:* = 0;
while (_local8 < _local5) {
_local9 = this.textField.text.substr((_arg2 + _local6), _arg3[_local8]);
_local10 = this.textField.getCharBoundaries((_arg2 + _local6));
_local11 = false;
if (_local10 == null){
_local11 = true;
_local12 = _local9.length;
if (_local12 > 0){
_local13 = 0;
while (_local13 < _local12) {
_local10 = this.textField.getCharBoundaries(((_arg2 + _local6) + _local13));
if (_local10 != null){
_local11 = false;
break;
};
_local13++;
};
};
};
if (_local11 == false){
_local4[_local7] = {id:(_arg2 + _local6), bounds:_local10, text:_local9};
_local6 = (_local6 + _arg3[_local8]);
_local7++;
} else {
_local6 = (_local6 + _arg3[_local8]);
};
_local8++;
};
return (_local4);
}
protected function rollOverButtonHandler(_arg1:MouseEvent=null, _arg2:Boolean=false):void{
if ((((_arg2 == true)) || ((this.isMouseTriggered == true)))){
if (this._isTransitioning == false){
if (this.buttonEffect != null){
this.buttonEffect.buttonRollOver();
};
};
};
if (_arg1 != null){
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.ROLL_OVER));
};
}
public function addFilterByName(_arg1:String, _arg2:Object=null):IFlashEffFilter{
var filterReference:Class;
var i:*;
var filterName = _arg1;
var initObj = _arg2;
try {
filterReference = (getDefinitionByName(filterName) as Class);
} catch(e:ReferenceError) {
trace((("FLASHEFF2 ERROR: The filter pattern '" + filterName) + "' is missing from library."));
return (null);
};
var filter:IFlashEffFilter = IFlashEffFilter(new filterReference(this));
if (initObj != null){
for (i in initObj) {
filter[i] = initObj[i];
};
};
this.addFilter(filter);
return (filter);
}
public function setXML(_arg1):void{
this.setProperties(_arg1);
}
public function get firstLevelOwner():Sprite{
return (this._firstLevelOwner);
}
override public function dispatchEvent(_arg1:Event):Boolean{
var _local3:FLASHEFFEvents;
var _local4:Boolean;
var _local5:Point;
var _local6:DisplayObject;
var _local7:Timer;
var _local8:DisplayObject;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Boolean;
var _local12:*;
var _local2:Boolean;
if ((((_arg1.type == FLASHEFFEvents.TRANSITION_END)) || ((_arg1.type == "defaultPatternFinish")))){
(_arg1 as FLASHEFFEvents).currentTransitionType = this.currentTransitionType;
eventsDispatched++;
if (eventsDispatched == maxEndEvents){
this.runCommands(this[(("_" + this.currentTransitionType) + "TransitionEndCommands")]);
if (isTargetVisibleAtEnd == true){
if (this.transitionType == "show"){
this.target.visible = true;
};
this._textOwnerClip.visible = false;
this._partialTextOwnerClip.visible = false;
};
_local2 = true;
_isTransitioning = false;
if (this.transitionType == "show"){
if (isButtonEffectApplyed == true){
_local5 = new Point(this.mouseX, this.mouseY);
_local5 = this.localToGlobal(_local5);
if (this.highestOwner.hitTestPoint(_local5.x, _local5.y, true)){
this.rollOverButtonHandler(null, true);
};
};
};
_local3 = new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_END);
_local3.currentTransitionType = this.currentTransitionType;
_local4 = false;
if (this.transitionType == "show"){
if (this.hidePattern != null){
if ((((((this.hideAutoPlay == true)) && (!((this.forceAutoPlay == false))))) || ((this.forceAutoPlay == true)))){
this.hideTimer.reset();
this.hideTimer.start();
this.forceAutoPlay = null;
this.hideTimer.addEventListener(TimerEvent.TIMER, this.hideCaller);
};
};
} else {
if (this.setNewTarget == true){
this.hideTimer.stop();
this.showTimer.stop();
_local6 = this.target;
this.target = this.nextTarget;
if (_local6 != null){
_local6.visible = false;
};
this.setNewTarget = false;
this.nextTarget = null;
_local4 = super.dispatchEvent(_local3);
_local7 = new Timer(this.showDelay, 1);
if (this.showDelay > 0){
_local7.start();
_local7.addEventListener(TimerEvent.TIMER, this.showCallerWeak);
} else {
this.show(false);
};
return (_local4);
};
if (this._cTT == "swap"){
_local8 = this.target;
this.removeSwapFlashEff2();
this.target = this.swapTarget;
this.target.visible = true;
this.swapTarget = null;
_local8.visible = this.targetVisibility;
_local9 = this.hideAutoPlay;
_local10 = this.showAutoPlay;
_local11 = this.targetVisibility;
this.__hideAutoPlay = false;
this.__showAutoPlay = false;
this.targetVisibility = true;
this.invalidate();
this.drawNow();
this.__hideAutoPlay = _local9;
this.__showAutoPlay = _local10;
this.targetVisibility = _local11;
this.target.visible = true;
} else {
if (this._cTT == "hide"){
if (this._clearAfterHide == true){
this.removeEffect(true);
this.removeButtonEvents();
for (_local12 in this.filterList) {
IFlashEffFilter(this.filterList[_local12]).remove();
};
};
};
};
};
_local4 = super.dispatchEvent(_local3);
return (_local4);
} else {
_local2 = false;
};
} else {
if (_arg1.type == FLASHEFFEvents.TRANSITION_START){
this.runCommands(this[(("_" + this.currentTransitionType) + "TransitionStartCommands")]);
(_arg1 as FLASHEFFEvents).currentTransitionType = this.currentTransitionType;
};
};
if (_local2 == true){
return (super.dispatchEvent(_arg1));
};
return (true);
}
public function set showTransition(_arg1:IFlashEffSymbolText):void{
if (_arg1 != null){
if (this.showPattern != null){
this.showPattern.remove();
};
this.showPattern = _arg1;
this._showTransitionName = String(getQualifiedClassName(_arg1)).replace("::", ".");
};
}
public function set filterList(_arg1:Array):void{
var _local2:*;
this.removeAllFilters();
if (_arg1 != null){
for (_local2 in _arg1) {
this.addFilter(_arg1[_local2]);
};
};
}
public function getFilter(_arg1:String):IFlashEffFilter{
var _local2:*;
for (_local2 in this.filterList) {
if (String(getQualifiedClassName(this.filterList[_local2])).replace("::", ".") == _arg1){
return (this.filterList[_local2]);
};
};
return (null);
}
public function get highestOwner():Sprite{
return (this._highestOwner);
}
public function set swapTargetVisibility(_arg1:Boolean):void{
__swapTargetVisibility = _arg1;
if (this.swapTarget != null){
this.swapTarget.visible = _arg1;
};
}
protected function setButtonEvents():void{
this.highestOwner.addEventListener(MouseEvent.ROLL_OVER, this.rollOverButtonHandler);
this.highestOwner.addEventListener(MouseEvent.ROLL_OUT, this.rollOutButtonHandler);
this.highestOwner.addEventListener(MouseEvent.MOUSE_DOWN, this.pressButtonHandler);
this.highestOwner.addEventListener(MouseEvent.MOUSE_UP, this.releaseButtonHandler);
isButtonEffectApplyed = true;
}
public function buttonRelease():void{
releaseButtonHandler(null, true);
}
public function get ideDataHolder():String{
return (this._ideDataHolder);
}
protected function showCallerWeak(_arg1:TimerEvent):void{
this.show(false);
}
public function get absCustom():Array{
return (this._absCustom.concat());
}
protected function removeSwapFlashEff2(){
if (this.swapFlashEff2 != null){
this.swapFlashEff2.removeAll();
this.removeChild(this.swapFlashEff2);
this.swapFlashEff2.removeEventListener(FLASHEFFEvents.TRANSITION_END, dispatchEvent);
this.swapFlashEff2.removeEventListener(FLASHEFFEvents.DOUBLE_CLICK, dispatchEvent);
this.swapFlashEff2.removeEventListener(FLASHEFFEvents.MOUSE_DOWN, dispatchEvent);
this.swapFlashEff2.removeEventListener(FLASHEFFEvents.MOUSE_UP, dispatchEvent);
this.swapFlashEff2.removeEventListener(FLASHEFFEvents.ROLL_OUT, dispatchEvent);
this.swapFlashEff2.removeEventListener(FLASHEFFEvents.ROLL_OVER, dispatchEvent);
this.swapFlashEff2 = null;
};
}
public function set ideDataHolder(_arg1:String){
this._ideDataHolder = _arg1;
}
public function get commands():Array{
return (this._rollOverCommands.concat(this._rollOutCommands, this._pressCommands, this._releaseCommands, this._doubleClickCommands, this._showTransitionStartCommands, this._showTransitionEndCommands, this._hideTransitionStartCommands, this._hideTransitionEndCommands));
}
public function removeCommandByName(_arg1:String):void{
var _local2:*;
var _local3:Array;
var _local4:uint;
for (_local2 in FlashEff2.eventTypeAsoc) {
_local3 = this[(("_" + _local2) + "Commands")];
if (_local3 != null){
_local4 = 0;
while (_local4 < _local3.length) {
if (String(getQualifiedClassName(_local3[_local4])).replace("::", ".") == _arg1){
_local3.splice(_local4, 1);
};
_local4++;
};
if (FlashEff2.eventTypeAsoc[_local2] != ""){
this.setCommands(_local2);
};
};
};
}
public function removeAll():void{
this.removeEffect(true, this.showPattern);
this.removeEffect(true, this.hidePattern);
this.removeSwapFlashEff2();
this.removeAllCommands();
this.removeAllFilters();
this.removeButtonEffect();
this.buttonEffect = null;
this._buttonEffectName = "";
this.removeShowTransition();
this.removeHideTransition();
this.showTimer.stop();
this.hideTimer.stop();
this.showTimer.removeEventListener(TimerEvent.TIMER, this.showCaller);
this.hideTimer.removeEventListener(TimerEvent.TIMER, this.hideCaller);
if (this.target != null){
this.target.visible = true;
this.resetChildDisplayList(this.target);
this.hitAreaClip.width = (this.hitAreaClip.height = 0);
};
}
public function get showDelay():Number{
return (__showDelay);
}
public function get buttonEffectName():String{
return (this._buttonEffectName);
}
public function set swapTransition(_arg1:IFlashEffSymbolText):void{
if (_arg1 != null){
if (this.swapPattern != null){
this.swapPattern.remove();
};
this.swapPattern = _arg1;
this._swapTransitionName = String(getQualifiedClassName(_arg1)).replace("::", ".");
};
}
protected function getPath(_arg1:DisplayObject):String{
var _local2:DisplayObject = _arg1.parent;
var _local3:String = _arg1.name;
while (((!((_local2 is Stage))) && (!((_local2 == null))))) {
_local3 = ((_local2.name + ".") + _local3);
_local2 = _local2.parent;
};
return (_local3);
}
public function getShowPattern():IFlashEffSymbolText{
return (this.showPattern);
}
protected function pressCommandHandler(_arg1:MouseEvent):void{
this.runCommands(this._pressCommands);
}
public function set hideTransition(_arg1:IFlashEffSymbolText):void{
if (_arg1 != null){
if (this.hidePattern != null){
this.hidePattern.remove();
};
this.hidePattern = _arg1;
this._hideTransitionName = String(getQualifiedClassName(_arg1)).replace("::", ".");
};
}
public function set isTargetVisibleAtEnd(_arg1:Boolean):void{
this._isTargetVisibleAtEnd = _arg1;
}
public function get absChars():Array{
return (this._absChars.concat());
}
function setDrawTime():void{
if ((((this.showAutoPlay == true)) || ((this.hideAutoPlay == true)))){
if ((this.target is DisplayObject)){
if (this.target.stage == null){
this.target.addEventListener(Event.ADDED_TO_STAGE, this.targetOnAdd);
} else {
if (drawCalled == false){
drawCalled = true;
targetOnAdd(new Event(Event.ADDED_TO_STAGE));
};
};
};
};
}
public function getHidePattern():IFlashEffSymbolText{
return (this.hidePattern);
}
public function get textTable():FeTable{
return (this._textTable);
}
protected function callDraw(_arg1:Event):void{
this.draw();
}
public function get buttonOwner():Sprite{
return (this._buttonOwner);
}
public function set hideTransitionName(_arg1:String):void{
var patternClass:Class;
var arg = _arg1;
if (arg != ""){
try {
patternClass = (getDefinitionByName(arg) as Class);
if (this.hidePattern != null){
this.hidePattern.remove();
};
this.hidePattern = new patternClass(this);
} catch(e:ReferenceError) {
throw ((("FLASHEFF2 ERROR: The pattern '" + arg) + "' is missing from library."));
};
this._hideTransitionName = arg;
};
}
public function set hideDelay(_arg1:Number):void{
if (isNaN(_arg1)){
_arg1 = 2;
} else {
if (_arg1 < 0){
_arg1 = 0;
};
};
this.__hideDelay = _arg1;
if (_arg1 < 1E-6){
_arg1 = 1E-6;
};
this.hideTimer.delay = (_arg1 * 1000);
}
public function get isFree():Boolean{
return (false);
}
public function get absMatrix():Array{
return (this._absMatrix.concat());
}
public function set buttonEffect(_arg1:IFlashEffButtonEffect):void{
if (this.buttonEffect != null){
this.buttonEffect.remove();
};
if (_arg1 != null){
this.setButtonEvents();
this._buttonEffect = _arg1;
this._buttonEffect.target = this.buttonTarget;
this._buttonEffect.component = this;
this._buttonEffect.apply();
this._buttonEffectName = String(getQualifiedClassName(_arg1).replace("::", "."));
} else {
this.removeButtonEvents();
this._buttonEffect = null;
};
}
public function removeAllFilters():void{
var _local1:*;
var _local2:Boolean;
if (this.filterList != null){
_local1 = 0;
while (_local1 < this.filterList.length) {
_local2 = this.removeFilter(this.filterList[_local1]);
_local1 = (_local1 - Number(_local2));
_local1++;
};
};
this.filterAsoc = [];
}
public function set swapType(_arg1:String):void{
if ((((((_arg1 == FlashEff2.SWAP_TYPE_HIDE)) || ((_arg1 == FlashEff2.SWAP_TYPE_SHOW)))) || ((_arg1 == FlashEff2.SWAP_TYPE_HIDE_AND_SHOW)))){
this.__swapType = _arg1;
};
}
public function get xmlPath():String{
return (__xmlPath);
}
protected function rollOverCommandHandler(_arg1:MouseEvent):void{
this.runCommands(this._rollOverCommands);
}
public function getXML():XML{
return (_xml);
}
protected function setProp(_arg1:XMLList, _arg2:Object):void{
var child:XML;
var propType:String;
var propValue:String;
var propName:String;
var arg = _arg1;
var refObj = _arg2;
if (refObj != null){
for each (child in arg.children()) {
propType = child.type;
propValue = child.value;
propName = child.name().localName;
try {
switch (propType){
case "String":
refObj[propName] = String(propValue);
break;
case "Number":
refObj[propName] = Number(String(propValue));
break;
case "uint":
refObj[propName] = uint(String(propValue));
break;
case "int":
refObj[propName] = int(String(propValue));
break;
case "Boolean":
refObj[propName] = (String(propValue) == "true");
break;
case "Array":
refObj[propName] = String(propValue).split(",");
break;
case "XML":
refObj[propName] = XML(String(propValue));
break;
};
} catch(e:Error) {
trace(((((("FLASHEFF2 ERROR: While trying to set the " + propName) + " on ") + refObj) + ",this error came:") + e.message));
};
};
};
}
protected function getCommandsNumber():Number{
var _local2:*;
var _local1:Number = 0;
for (_local2 in FlashEff2.eventTypeAsoc) {
_local1 = (_local1 + this[(("_" + _local2) + "Commands")].length);
};
return (_local1);
}
protected function showCaller(_arg1:TimerEvent):void{
this.show();
}
public function set clearAfterHide(_arg1:Boolean):void{
_clearAfterHide = _arg1;
}
public function get hideAutoPlay():Boolean{
return (__hideAutoPlay);
}
public function get partialTable():FeTable{
return (this._partialTable);
}
protected function releaseButtonHandler(_arg1:MouseEvent=null, _arg2:Boolean=false):void{
if (this.isDragOut == true){
if ((((_arg2 == true)) || ((this.isMouseTriggered == true)))){
if (this._isTransitioning == false){
if (this.buttonEffect != null){
this.buttonEffect.buttonRelease();
};
};
};
};
if (_arg1 != null){
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.MOUSE_UP));
};
}
protected function removedFromStage(_arg1:Event):void{
if (FlashEff2.REMOVED_FROM_FLASHEFF == false){
this.removeEffect(true);
this.removeAllCommands();
this.removeAllFilters();
this.removeButtonEffect();
};
}
public function get initialTargetTransform():Transform{
return (this._initialTargetTransform);
}
public function show(_arg1=null):void{
this.forceAutoPlay = _arg1;
this.showTimer.stop();
this.hideTimer.stop();
this.transitionType = "show";
this.transitionEffect(this.transitionType);
}
public function removeAllCommandsByEventType(_arg1:String):void{
var _local2:Array = this[(("_" + _arg1) + "Commands")];
if (_local2 != null){
if (_local2.length > 0){
this[(("_" + _arg1) + "Commands")] = [];
if (FlashEff2.eventTypeAsoc[_arg1] != ""){
this.setCommands(_arg1);
};
};
};
}
public function get isMouseTriggered():Boolean{
return (_isMouseTriggered);
}
public function set targetVisibility(_arg1:Boolean):void{
__targetVisibility = _arg1;
}
public function get xmlString():String{
return (__xmlString);
}
public function get swapTarget():DisplayObject{
return (this._swapTarget);
}
protected function init():void{
this._targetOwner = new MovieClip();
this._firstLevelOwner = new Sprite();
this._highestOwner = new Sprite();
this.bDBTO = new Sprite();
this.bDBT = new Sprite();
this.aDBT = new Sprite();
this.aDBTO = new Sprite();
this.aDBT.addChild(this.firstLevelOwner);
this.aDBTO.addChild(this.aDBT);
this.highestOwner.addChild(this.aDBTO);
this.addChild(this.highestOwner);
this.bDBT.addChild(this.targetOwner);
this.bDBTO.addChild(bDBT);
this.firstLevelOwner.addChild(this.bDBTO);
this.buttonTarget = this.aDBT;
this.firstInDepth = this.bDBTO;
this.hitAreaClip = new Sprite();
this.addChild(this.hitAreaClip);
this.highestOwner.hitArea = this.hitAreaClip;
this.hitAreaClip.mouseEnabled = false;
this.hitAreaClip.visible = false;
this.hitAreaClip.graphics.beginFill(0);
this.hitAreaClip.graphics.drawRect(0, 0, 1, 1);
this.hitAreaClip.graphics.endFill();
this.hitAreaClip.height = 0;
this.hitAreaClip.width = 0;
this._textOwnerClip = new Sprite();
this._partialTextOwnerClip = new Sprite();
this.targetOwner.addChild(this._textOwnerClip);
this.targetOwner.addChild(this._partialTextOwnerClip);
this._textTable = new FeTable();
this._partialTable = new FeTable();
this._textOwnerClip.addChild(DisplayObject(this.textTable));
this._partialTextOwnerClip.addChild(DisplayObject(this.partialTable));
tTS = new Sprite();
this._buttonOwner = new Sprite();
this.aDBTO.addChild(this.buttonOwner);
this.resetArrays();
this._filterList = [];
this._rollOverCommands = [];
this._rollOutCommands = [];
this._pressCommands = [];
this._releaseCommands = [];
this._doubleClickCommands = [];
this._showTransitionStartCommands = [];
this._showTransitionEndCommands = [];
this._hideTransitionStartCommands = [];
this._hideTransitionEndCommands = [];
this.filterAsoc = [];
if (FlashEff2.targetPaths == null){
FlashEff2.targetPaths = [];
};
this.showTimer = new Timer((this.showDelay * 1000), 1);
this.hideTimer = new Timer((this.hideDelay * 1000), 1);
this.partialPatternName = this.__partialPattern;
this.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStage);
}
protected function setCommands(_arg1:String):void{
var eventType = _arg1;
try {
if (((!((this[(("_" + eventType) + "Commands")] == null))) && ((this[(("_" + eventType) + "Commands")].length > 0)))){
this.highestOwner.addEventListener(MouseEvent[FlashEff2.eventTypeAsoc[eventType]], this[(eventType + "CommandHandler")]);
} else {
this.highestOwner.removeEventListener(MouseEvent[FlashEff2.eventTypeAsoc[eventType]], this[(eventType + "CommandHandler")]);
};
} catch(e:Error) {
trace("FLASHEFF2 ERROR: Unknown eventType. Available events are: rollOver, rollOut, press, release, doubleClick, showTransitionStart, showTransitionEnd, hideTransitionStart and hideTransitionEnd.");
};
if (this.highestOwner.hasEventListener("doubleClick")){
this.highestOwner.doubleClickEnabled = true;
this.highestOwner.mouseChildren = false;
} else {
this.highestOwner.doubleClickEnabled = false;
this.highestOwner.mouseChildren = true;
};
}
public function set showDelay(_arg1:Number):void{
if (isNaN(_arg1)){
_arg1 = 0;
} else {
if (_arg1 <= 0){
_arg1 = 0;
};
};
this.__showDelay = _arg1;
if (_arg1 < 1E-6){
_arg1 = 1E-6;
};
this.showTimer.delay = (_arg1 * 1000);
}
public function set useSwapInsteadHide(_arg1:Boolean):void{
this._useSwapInsteadHide = _arg1;
}
override public function set useHandCursor(_arg1:Boolean):void{
var arg = _arg1;
this._useHandCursor = arg;
this.highestOwner.buttonMode = arg;
this.highestOwner.useHandCursor = arg;
try {
this.target["mouseEnabled"] = !(arg);
} catch(e:Error) {
};
}
public function set target(_arg1:DisplayObject):void{
var point:Point;
var bounds:Rectangle;
var arg = _arg1;
if (this._target != null){
if (this.showPattern != null){
try {
this.showPattern.remove();
this.showPattern["target"] = null;
} catch(e:Error) {
};
};
if (this.hidePattern != null){
try {
this.hidePattern.remove();
this.hidePattern["target"] = null;
} catch(e:Error) {
};
};
this._target.visible = true;
this.resetChildDisplayList(this._target);
};
if (arg != null){
if (arg.parent != null){
resetChildDisplayList(arg);
this._target = arg;
if (this._targetInstanceName == ""){
this.invalidate();
this.setDrawTime();
};
this.__targetInstanceName = arg.name;
point = new Point(0, 0);
bounds = arg.getBounds(arg);
if ((arg is TextField)){
point.x = bounds.x;
point.y = bounds.y;
this._textField = TextField(arg);
this.textField.visible = false;
this._partialTextOwnerClip.scaleX = (this._textOwnerClip.scaleX = this.textField.scaleX);
this._partialTextOwnerClip.scaleY = (this._textOwnerClip.scaleY = this.textField.scaleY);
};
this.hitAreaClip.width = (bounds.width * this.target.scaleX);
this.hitAreaClip.height = (bounds.height * this.target.scaleY);
this.hitAreaClip.x = ((bounds.x * target.scaleX) - point.x);
this.hitAreaClip.y = ((bounds.y * target.scaleY) - point.y);
point = arg.localToGlobal(point);
point = this.parent.globalToLocal(point);
FlashEff2.targetPaths[this.getPath(arg)] = {target:arg, displayList:target.parent, x:arg.x, y:arg.y, rotation:arg.rotation};
FlashEff2.REMOVED_FROM_FLASHEFF = true;
this.targetOwner.addChild(arg);
FlashEff2.REMOVED_FROM_FLASHEFF = false;
this.x = (this.x + (point.x - this.x));
this.y = (this.y + (point.y - this.y));
this.rotation = this.target.rotation;
this.target.x = 0;
this.target.y = 0;
this.target.rotation = 0;
tTS.transform = arg.transform;
this._initialTargetTransform = tTS.transform;
} else {
trace("FLASHEFF2 ERROR: Please add the target to the display list, before setting the _targetInstanceName|target property on FlashEff2.");
};
} else {
trace("FLASHEFF2 ERROR: Target must be a non-null DisplayObject.");
};
}
public function set _targetInstanceName(_arg1:String):void{
var scope:DisplayObjectContainer;
var paths:Array;
var targName:String;
var i:*;
var newTarget:DisplayObject;
var strPath:String;
var existObj:Object;
var arg = _arg1;
if (arg != ""){
if ((this.parent is DisplayObject)){
scope = this.parent;
paths = arg.split(".");
targName = paths.pop();
try {
i = 0;
while (i < paths.length) {
scope = (scope[paths[i]] as DisplayObjectContainer);
i = (i + 1);
};
} catch(e:Error) {
trace("FLASHEFF2 ERROR: The _targetInstanceName path is invalid.");
return;
};
if (scope != null){
newTarget = scope.getChildByName(targName);
if (newTarget == null){
strPath = this.getPath(scope);
existObj = FlashEff2.targetPaths[((strPath + ".") + arg)];
if (existObj != null){
newTarget = existObj.target;
};
};
this.target = newTarget;
};
} else {
trace("FLASHEFF2 ERROR: Please add the component to the display list, before setting the _targetInstanceName property.");
};
this.__targetInstanceName = arg;
};
}
protected function startPartialEffect():void{
if (this.partialPattern != null){
try {
this.partialPattern["partialBlurAmount"] = IFlashEffText(this.lastTransitionPattern).partialBlurAmount;
this.partialPattern["partialStart"] = IFlashEffText(this.lastTransitionPattern).partialStart;
this.partialPattern.tweenDuration = this.lastTransitionPattern.tweenDuration;
this.partialPattern.tweenType = this.lastTransitionPattern.tweenType;
this.partialPattern.easeType = this.lastTransitionPattern.easeType;
} catch(e:Error) {
trace("FLASHEFF2 ERROR: an error ocured when trying to set partialBlurAmount, partialStart, tweenDuration,tweenType and easeType on the partialPattern.");
};
var _local2 = this.partialPattern;
_local2[this.transitionType]();
};
clearInterval(this.partialInterval);
}
protected function targetOnAdd(_arg1:Event):void{
if ((this.target.parent is MovieClip)){
if (MovieClip(this.target.parent).currentFrame <= 1){
this.target.visible = false;
};
};
this.target.removeEventListener(Event.ADDED_TO_STAGE, this.targetOnAdd);
this.target.stage.invalidate();
this.firstLevelOwner.addEventListener(Event.RENDER, callDraw);
}
public function removeFilter(_arg1:IFlashEffFilter):Boolean{
var _local2:*;
var _local3:uint;
if (_arg1 != null){
_arg1.remove();
for (_local2 in this.filterList) {
if (this.filterList[_local2] == _arg1){
if (_arg1.target == this.firstInDepth){
this.firstInDepth = this.filterAsoc[_arg1.target.name];
};
if (this.filterList.length > (_local2 + 1)){
this.filterAsoc[this.filterList[(_local2 + 1)].target.name] = this.filterAsoc[_arg1.target.name];
};
this.filterList.splice(_local2, 1);
_local3 = 0;
while (_local2 < _arg1.target.numChildren) {
_arg1.target.parent.addChild(_arg1.target.getChildAt(_local3));
_local3++;
};
_arg1.target.parent.removeChild(_arg1.target);
return (true);
};
};
};
return (false);
}
public function setProperties(_arg1):void{
var child:XML;
var command:IFlashEffCommand;
var filter:IFlashEffFilter;
var me:FlashEff2;
var urlLdr:URLLoader;
var xmlArg = _arg1;
if ((xmlArg is XML)){
this.invalidate();
this._xml = (xmlArg as XML);
this.removeEffect(true);
this.removeAllCommands();
this.removeAllFilters();
this.removeButtonEffect();
if (xmlArg.params.children().length() > 0){
this.setProp(xmlArg.params, this);
};
for each (child in xmlArg.patterns.children()) {
switch (String(child.type)){
case "command":
command = this.addCommandByName(String(child.name), String(child.event));
this.setProp(child.params, command);
break;
case "showCommand":
command = this.addCommandByName(String(child.name), String(child.event));
this.setProp(child.params, command);
break;
case "hideCommand":
command = this.addCommandByName(String(child.name), String(child.event));
this.setProp(child.params, command);
break;
case "filter":
filter = this.addFilterByName(String(child.name));
this.setProp(child.params, filter);
break;
case "buttonEffect":
this.buttonEffectName = String(child.name);
this.setProp(child.params, this.buttonEffect);
break;
case "hide":
this.hideTransitionName = String(child.name);
this.setProp(child.params, this.hidePattern);
break;
case "show":
this.showTransitionName = String(child.name);
this.setProp(child.params, this.showPattern);
break;
case "swap":
this.swapTransitionName = String(child.name);
this.setProp(child.params, this.swapPattern);
break;
};
};
drawCalled = false;
this.setDrawTime();
} else {
me = this;
urlLdr = new URLLoader();
urlLdr.dataFormat = "text";
urlLdr.addEventListener(Event.COMPLETE, function (_arg1:Event){
var _local2:FLASHEFFEvents = new FLASHEFFEvents(FLASHEFFEvents.COMPLETE);
_local2.data = urlLdr.data;
me.dispatchEvent(_local2);
var _local3:XML = XML(urlLdr.data);
if (String(_local3.params.xmlPath.value) == xmlArg){
_local3.params.xmlPath.value = "";
};
me.setProperties(_local3);
});
urlLdr.addEventListener("ioError", function (_arg1:Event){
trace("FLASHEFF2 ERROR: There was an IO_ERROR problem loading the xml. Please check the xmlPath.");
me.dispatchEvent(_arg1);
});
urlLdr.load(new URLRequest(xmlArg));
};
}
public function get swapTargetVisibility():Boolean{
return (__swapTargetVisibility);
}
protected function resetChildDisplayList(_arg1:DisplayObject):void{
var _local3:*;
var _local4:Object;
var _local2:Array = FlashEff2.targetPaths;
for (_local3 in _local2) {
_local4 = _local2[_local3];
if (_local4 != null){
if (_local4.target == _arg1){
if (_local4.displayList.getChildByName(_arg1.name) == null){
_local4.displayList.addChild(_arg1);
_arg1.x = _local4.x;
_arg1.y = _local4.y;
_arg1.rotation = _local4.rotation;
};
FlashEff2.targetPaths[_local3] = null;
return;
};
};
};
}
public function removeEffect(_arg1:Boolean=false, _arg2:IFlashEffSymbolText=null):void{
if (_arg2 == null){
_arg2 = this.lastTransitionPattern;
};
if (_arg2 != null){
_arg2.remove();
};
if (this.partialPattern != null){
this.partialPattern.remove();
};
if (this.textTable != null){
this.textTable.removeChilds();
};
if (this.partialTable != null){
this.partialTable.removeChilds();
};
if (_arg1 == false){
if (_isTransitioning == true){
eventsDispatched = 0;
maxEndEvents = 1;
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_END));
};
};
if (target != null){
this.target.visible = _isTargetVisibleAtEnd;
};
this.maxEndEvents = 0;
}
public function set buttonEffectName(_arg1:String):void{
var btnEff:Class;
var arg = _arg1;
if (arg != ""){
try {
btnEff = (getDefinitionByName(arg) as Class);
this.buttonEffect = IFlashEffButtonEffect(new btnEff(this));
} catch(e:Error) {
};
this._buttonEffectName = arg;
};
}
public function set showAutoPlay(_arg1:Boolean):void{
__showAutoPlay = _arg1;
this.invalidate();
setDrawTime();
}
public function getFilterAt(_arg1:uint):IFlashEffFilter{
if (_arg1 < this.filterList.length){
return (this.filterList[_arg1]);
};
return (null);
}
override protected function draw():void{
var _local1:Boolean;
var _local2:*;
var _local3:Timer;
if (this.isInvalid("all")){
if (this.target != null){
_local1 = false;
if (((!((this.showPattern == null))) && ((this.showAutoPlay == true)))){
this.transitionType = "show";
_local1 = true;
} else {
if (this.hidePattern != null){
if (this.hideAutoPlay == true){
_local1 = true;
this.transitionType = "hide";
};
};
};
if (this.target.parent != this.targetOwner){
if ((((((_local1 == true)) || ((this.filterList.length > 0)))) || ((this.getCommandsNumber() > 0)))){
this.target = this.target;
};
};
this.target.visible = this.targetVisibility;
if (_local1){
_local3 = this[(this.transitionType + "Timer")];
if (this[(this.transitionType + "Delay")] > 0){
_local3.reset();
_local3.start();
_local3.addEventListener(TimerEvent.TIMER, this[(this.transitionType + "Caller")]);
if (this.transitionType == "show"){
if (this.target != null){
this.target.visible = false;
};
};
} else {
this.transitionEffect(this.transitionType);
};
};
for (_local2 in this.filterList) {
IFlashEffFilter(this.filterList[_local2]).remove();
IFlashEffFilter(this.filterList[_local2]).apply();
};
};
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.INIT));
super.draw();
};
}
public function get swapTransition():IFlashEffSymbolText{
return (this.swapPattern);
}
public function hide():void{
this.showTimer.stop();
this.hideTimer.stop();
this.transitionType = "hide";
this.transitionEffect(this.transitionType);
}
public function get isTargetVisibleAtEnd():Boolean{
return (_isTargetVisibleAtEnd);
}
public function transitionEffect(_arg1:String="show"):void{
var i:*;
var transt = _arg1;
if (this.isInvalid("all")){
for (i in this.filterList) {
IFlashEffFilter(this.filterList[i]).remove();
IFlashEffFilter(this.filterList[i]).apply();
};
};
this.validate();
this.removeEffect(true);
this.maxEndEvents = 1;
this._cTT = transt;
if (this.target != null){
if (this.targetOwner.getChildByName(this.target.name) != this.target){
this.target = this.target;
};
try {
eventsDispatched = 0;
this.lastTransitionPattern = this[(transt + "Pattern")];
if (transt == "hide"){
if (this.useSwapInsteadHide == true){
if (this.forceHide == false){
if (this.swapTarget != null){
this._cTT = "swap";
switch (this.swapType){
case FlashEff2.SWAP_TYPE_HIDE:
this.addSwapFlashEff2(0);
break;
case FlashEff2.SWAP_TYPE_SHOW:
this.addSwapFlashEff2(this.numChildren);
break;
default:
this.addSwapFlashEff2(0);
break;
};
this.swapFlashEff2.target = this.swapTarget;
this.swapFlashEff2.showDelay = ((this.swapDelay) || (0.0001));
if (this.swapType != FlashEff2.SWAP_TYPE_HIDE){
if (this.swapPattern != null){
this.swapFlashEff2.showTransition = this.swapPattern;
} else {
this.swapFlashEff2.showTransition = (this.clonePattern(this.showPattern) as IFlashEffSymbolText);
};
if (this.swapType == FlashEff2.SWAP_TYPE_SHOW){
this.target.visible = true;
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.TRANSITION_START));
return;
} else {
this.maxEndEvents = 2;
};
} else {
this.swapTarget.visible = true;
};
} else {
trace("FLASHEFF2 ERROR: The swapTarget property is null, a hide transition will be applied.");
};
};
};
};
if (this.lastTransitionPattern != null){
if (this.target.parent != this.targetOwner){
this.target = this.target;
};
this.target.visible = true;
this.lastTransitionPattern.component = this;
try {
this.lastTransitionPattern["target"] = this.target;
} catch(e:TypeError) {
trace("FLASHEFF2 ERROR: You have placed a text pattern over a symbol. Please use a symbol pattern instead!");
return;
};
_isTransitioning = true;
var _local3 = this.lastTransitionPattern;
_local3[transt]();
} else {
trace((("FLASHEFF2 WARNING: The " + transt) + "Transition pattern is null. The transition will not be applied."));
};
} catch(e:ReferenceError) {
throw (("FLASHEFF2 ERROR: " + e));
};
} else {
trace("FLASHEFF2 WARNING: Please set the target or _targetInstanceName property before applying an effect.");
};
this.forceHide = false;
}
public function get absWords():Array{
return (this._absWords.concat());
}
public function changeTarget(_arg1:DisplayObject):void{
var _local2:Timer;
this.nextTarget = _arg1;
if (this.target != null){
this.setNewTarget = true;
_local2 = this.hideTimer;
this.forceHide = true;
if (this.hideDelay > 0){
_local2.reset();
_local2.start();
_local2.addEventListener(TimerEvent.TIMER, this.hideCaller);
} else {
this.hide();
};
} else {
this.target = _arg1;
this.show(false);
};
}
protected function linesSplit():Array{
var _local7:*;
var _local8:String;
var _local9:Boolean;
var _local10:uint;
var _local11:*;
var _local1:Array = [];
var _local2:Array = [];
var _local3:uint = this.textField.numLines;
var _local4:uint;
var _local5:Number = 0;
var _local6:uint;
while (_local6 < _local3) {
_local7 = this.textField.getCharBoundaries(_local4);
_local8 = this.textField.getLineText(_local6);
_local9 = false;
if (_local7 == null){
_local9 = true;
_local10 = _local8.length;
if (_local10 > 0){
_local11 = 0;
while (_local11 < _local10) {
_local7 = this.textField.getCharBoundaries((_local4 + _local11));
if (_local7 != null){
_local9 = false;
break;
};
_local11++;
};
};
};
if (_local9 == false){
_local2[(_local6 - _local5)] = {id:_local4, bounds:_local7, lineId:_local6, text:_local8};
_local4 = (_local4 + String(_local8).length);
} else {
_local5++;
_local4 = (_local4 + _local8.length);
};
_local6++;
};
return (_local2);
}
public function set swapDelay(_arg1:Number):void{
this.__swapDelay = _arg1;
}
public function get hideDelay():Number{
return (__hideDelay);
}
protected function resetArrays():void{
_absChars = [];
_absWords = [];
_absLines = [];
_absMatrix = [];
_absCustom = [];
}
public function addCommand(_arg1:IFlashEffCommand, _arg2:String):IFlashEffCommand{
var command = _arg1;
var eventType = _arg2;
if (command != null){
try {
this[(("_" + eventType) + "Commands")].push(command);
command.component = this;
command.target = this.target;
command.commandEventType = eventType;
if (FlashEff2.eventTypeAsoc[eventType] != ""){
this.setCommands(eventType);
};
} catch(e:Error) {
trace("FLASHEFF2 ERROR: Unknown eventType. Available events are: rollOver, rollOut, press, release, doubleClick, showTransitionStart, showTransitionEnd, hideTransitionStart and hideTransitionEnd.");
};
};
return (command);
}
protected function charSplit(_arg1:String, _arg2:uint):Array{
var _local8:Rectangle;
var _local3:Array = String(_arg1).split("");
var _local4:Array = [];
var _local5:uint = _local3.length;
var _local6:uint;
var _local7:uint;
while (_local7 < _local5) {
_local8 = this.textField.getCharBoundaries((_arg2 + _local7));
if (_local3[_local7] != " "){
if (!isNaN(String(_local3[_local7]).charCodeAt(0))){
if (_local8 != null){
_local4[(_local7 - _local6)] = {id:(_arg2 + _local7), bounds:_local8, text:_local3[_local7]};
} else {
_local6++;
};
};
} else {
_local6++;
};
_local7++;
};
return (_local4);
}
protected function releaseCommandHandler(_arg1:MouseEvent):void{
this.runCommands(this._releaseCommands);
}
public function get hideTransitionName():String{
return (this._hideTransitionName);
}
protected function clonePattern(_arg1:Object):Object{
var _local2:XML;
var _local3:XMLList;
var _local4:String;
var _local5:Class;
var _local6:*;
var _local7:Number;
var _local8:*;
var _local9:XML;
var _local10:String;
if (_arg1 != null){
_local2 = describeType(_arg1);
_local3 = _local2.elements("accessor");
_local4 = String(_local2.@name);
_local5 = (getDefinitionByName(_local4) as Class);
_local6 = new (_local5);
_local7 = _local3.length();
_local8 = 0;
while (_local8 < _local7) {
_local9 = _local3[_local8];
if (_local9.@declaredBy == _local4){
if (_local9.@access == "readwrite"){
_local10 = _local9.@name;
_local6[_local10] = _arg1[_local10];
};
};
_local8++;
};
return (_local6);
};
return (null);
}
protected function hideCaller(_arg1:TimerEvent):void{
this.hide();
}
protected function rollOutCommandHandler(_arg1:MouseEvent):void{
this.runCommands(this._rollOutCommands);
}
public function get clearAfterHide():Boolean{
return (_clearAfterHide);
}
public function addFilter(_arg1:IFlashEffFilter):void{
var _local2:DisplayObject;
var _local3:Boolean;
if (_arg1 != null){
_local2 = this.firstInDepth;
this.firstInDepth = new Sprite();
this.firstLevelOwner.addChild(this.firstInDepth);
this.firstInDepth.addChild(_local2);
_arg1.component = this;
_arg1.target = this.firstInDepth;
this.filterAsoc[_arg1.target.name] = _local2;
if (!this.isInvalid("all")){
_local3 = this.target.visible;
this.target.visible = true;
_arg1.apply();
this.target.visible = _local3;
};
this.filterList.push(_arg1);
};
}
public function get swapType():String{
return (this.__swapType);
}
public function get targetVisibility():Boolean{
return (__targetVisibility);
}
public function set isFree(_arg1:Boolean):void{
}
public function get buttonEffect():IFlashEffButtonEffect{
return (this._buttonEffect);
}
protected function addSwapFlashEff2(_arg1:uint=0){
var _local2:*;
if (this.swapFlashEff2 != null){
this.removeSwapFlashEff2();
};
this.swapFlashEff2 = new FlashEff2();
this.swapFlashEff2.addEventListener(FLASHEFFEvents.TRANSITION_END, dispatchEvent);
this.swapFlashEff2.addEventListener(FLASHEFFEvents.DOUBLE_CLICK, dispatchEvent);
this.swapFlashEff2.addEventListener(FLASHEFFEvents.MOUSE_DOWN, dispatchEvent);
this.swapFlashEff2.addEventListener(FLASHEFFEvents.MOUSE_UP, dispatchEvent);
this.swapFlashEff2.addEventListener(FLASHEFFEvents.ROLL_OUT, dispatchEvent);
this.swapFlashEff2.addEventListener(FLASHEFFEvents.ROLL_OVER, dispatchEvent);
this.addChildAt(this.swapFlashEff2, _arg1);
for (_local2 in this.filterList) {
this.swapFlashEff2.addFilter((this.clonePattern(this.filterList[_local2]) as IFlashEffFilter));
};
for (_local2 in this.commands) {
this.swapFlashEff2.addCommand((this.clonePattern(this.commands[_local2]) as IFlashEffCommand), (this.commands[_local2] as IFlashEffCommand).commandEventType);
};
}
public function addCommandByName(_arg1:String, _arg2:String, _arg3:Object=null):IFlashEffCommand{
var commandRef:Class;
var command:IFlashEffCommand;
var i:*;
var commandName = _arg1;
var eventType = _arg2;
var initObj = _arg3;
try {
commandRef = (getDefinitionByName(commandName) as Class);
command = IFlashEffCommand(new commandRef(this));
if (initObj != null){
for (i in initObj) {
command[i] = initObj[i];
};
};
} catch(e:ReferenceError) {
trace((("FLASHEFF2 ERROR: The command pattern '" + commandName) + "' is missing from library."));
return (null);
};
return (this.addCommand(command, eventType));
}
protected function removeButtonEvents():void{
this.highestOwner.removeEventListener(MouseEvent.ROLL_OVER, this.rollOverButtonHandler);
this.highestOwner.removeEventListener(MouseEvent.ROLL_OUT, this.rollOutButtonHandler);
this.highestOwner.removeEventListener(MouseEvent.MOUSE_DOWN, this.pressButtonHandler);
this.highestOwner.removeEventListener(MouseEvent.MOUSE_UP, this.releaseButtonHandler);
isButtonEffectApplyed = false;
}
public function get target():DisplayObject{
return (this._target);
}
public function swap(_arg1:DisplayObject=null, _arg2:String=""):void{
if (_arg1 != null){
this.swapTarget = _arg1;
};
if (_arg2 != ""){
this.swapType = _arg2;
};
this.useSwapInsteadHide = true;
this.hide();
}
protected function doubleClickCommandHandler(_arg1:MouseEvent):void{
this.runCommands(this._doubleClickCommands);
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.DOUBLE_CLICK));
}
public function get _targetInstanceName():String{
return (this.__targetInstanceName);
}
public function get useSwapInsteadHide():Boolean{
return (this._useSwapInsteadHide);
}
override public function get useHandCursor():Boolean{
return (_useHandCursor);
}
public function get targetOwner():MovieClip{
return (this._targetOwner);
}
public function get absLines():Array{
return (this._absLines.concat());
}
protected function rollOutButtonHandler(_arg1:MouseEvent=null, _arg2:Boolean=false):void{
if ((((_arg2 == true)) || ((this.isMouseTriggered == true)))){
if (this._isTransitioning == false){
if (this.buttonEffect != null){
this.buttonEffect.buttonRollOut();
};
};
};
this.isDragOut = false;
if (_arg1 != null){
this.dispatchEvent(new FLASHEFFEvents(FLASHEFFEvents.ROLL_OUT));
};
}
public function get showAutoPlay():Boolean{
return (__showAutoPlay);
}
public function get swapDelay():Number{
return (this.__swapDelay);
}
public function get isTransitioning():Boolean{
return (this._isTransitioning);
}
public function set xmlPath(_arg1:String):void{
if (_arg1 != ""){
this.__xmlPath = _arg1;
setProperties(this.__xmlPath);
};
}
public function set showTransitionName(_arg1:String):void{
var patternClass:Class;
var arg = _arg1;
if (arg != ""){
try {
patternClass = (getDefinitionByName(arg) as Class);
if (this.showPattern != null){
this.showPattern.remove();
};
this.showPattern = IFlashEffSymbolText(new patternClass(this));
} catch(e:ReferenceError) {
throw ((("FLASHEFF2 ERROR: The pattern '" + arg) + "' is missing from library."));
};
this._showTransitionName = arg;
};
}
public function drawTextTable(_arg1:String, _arg2:String, _arg3:Number, _arg4:Array, _arg5:Number, _arg6:Number, _arg7:Array=null):Boolean{
var _local9:Array;
var _local10:Array;
var _local11:Array;
var _local14:*;
var _local15:*;
var _local16:uint;
var _local19:uint;
var _local28:Number;
var _local29:Object;
var _local30:*;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
this.textTable.removeChilds();
this.partialTable.removeChilds();
this.resetArrays();
var _local8:Object = this.textTable;
var _local12:Boolean;
var _local13:Boolean;
var _local17:uint = 1;
var _local18:uint = 1;
var _local20:uint;
var _local21:String = _arg1;
var _local22:String = _arg1;
_local10 = this.linesSplit();
_local17 = _local10.length;
var _local23:Array = [];
var _local24:Array = [];
if (_arg2 == "lines"){
this.filterArray(_local10, _arg2, _arg3, _arg4);
};
_local14 = 0;
while (_local14 < _local17) {
if (_local22 == "custom"){
_local9 = (_local10[_local14].childs = this.customSplit(_local10[_local14].text, _local10[_local14].id, _arg7[_local10[_local14].lineId]));
_arg1 = "words";
_local21 = _arg1;
} else {
_local9 = (_local10[_local14].childs = this.wordsSplit(_local10[_local14].text, _local10[_local14].id));
};
_local10[_local14].owner = this.textTable;
_local18 = _local9.length;
_local15 = 0;
while (_local15 < _local18) {
_local23.push(_local9[_local15]);
_local9[_local15].passed = _local10[_local14].passed;
_local9[_local15].owner = this.textTable;
_local11 = (_local9[_local15].childs = this.charSplit(_local9[_local15].text, _local9[_local15].id));
_local19 = _local11.length;
_local16 = 0;
while (_local16 < _local19) {
_local11[_local16].passed = _local9[_local15].passed;
_local24.push(_local11[_local16]);
_local16++;
};
_local15++;
};
_local14++;
};
if ((((_arg3 < 100)) || ((_arg2 == "selectedStrings")))){
if (_arg2 == "words"){
this.filterArray(_local23, _arg2, _arg3, _arg4);
} else {
if ((((_arg2 == "letters")) || ((_arg2 == "selectedStrings")))){
this.filterArray(_local24, _arg2, _arg3, _arg4);
};
};
_local28 = (_arg5 * 10);
if (this.transitionType == "hide"){
_local28 = 0;
this._partialTextOwnerClip.alpha = 1;
} else {
this._partialTextOwnerClip.alpha = 0;
};
clearInterval(this.partialInterval);
this.partialInterval = setInterval(this.startPartialEffect, (_local28 * ((this.lastTransitionPattern.tweenDuration) || (0))));
maxEndEvents++;
};
switch (_arg1.toLocaleLowerCase()){
case "lines":
_local17 = _local10.length;
_local8 = this.textTable;
_local15 = 0;
while (_local15 < _local17) {
_local29 = _local8;
if (_local10[_local15].passed == false){
_local29 = this.partialTable;
};
_local30 = _local29.pushChild({type:"FeGroup", x:_local10[_local15].bounds.x, y:_local10[_local15].bounds.y, text:_local10[_local15].text, bounds:_local10[_local15].bounds, id:_local10[_local15].id});
_local10[_local15].owner = _local30;
_absLines.push(_local30);
_local15++;
};
_arg1 = "words";
case "words":
_local17 = _local10.length;
_local14 = 0;
while (_local14 < _local17) {
_local31 = _local10[_local14].owner.x;
_local32 = _local10[_local14].owner.y;
_local8 = _local10[_local14].owner;
_local9 = _local10[_local14].childs;
_local18 = _local9.length;
_local15 = 0;
while (_local15 < _local18) {
_local29 = _local8;
_local33 = _local31;
_local34 = _local32;
if ((((_local9[_local15].passed == false)) && ((((_local21 == "words")) || ((_arg2 == "words")))))){
_local29 = this.partialTable;
_local33 = 0;
_local34 = 0;
} else {
if (_local9[_local15].passed == false){
_local33 = 0;
_local34 = 0;
};
};
_local30 = _local29.pushChild({type:"FeGroup", x:(_local9[_local15].bounds.x - _local33), y:(_local9[_local15].bounds.y - _local34), text:_local9[_local15].text, bounds:_local9[_local15].bounds, id:_local9[_local15].id});
_local9[_local15].owner = _local30;
_absWords.push(_local30);
if (_local22 == "custom"){
_absCustom.push(_local30);
};
_local15++;
};
_local14++;
};
_arg1 = "chars";
case "chars":
_local14 = 0;
while (_local14 < _local17) {
_local9 = _local10[_local14].childs;
_local18 = _local9.length;
_local15 = 0;
while (_local15 < _local18) {
_local11 = _local9[_local15].childs;
_local8 = _local9[_local15].owner;
_local31 = (_local8.x + _local10[_local14].owner.x);
_local32 = (_local8.y + _local10[_local14].owner.y);
_local19 = _local11.length;
_local16 = 0;
while (_local16 < _local19) {
_local29 = _local8;
_local33 = _local31;
_local34 = _local32;
if (_local11[_local16].passed != false){
_local11[_local16].passed = _local9[_local15].passed;
};
if (_local11[_local16].passed == false){
if ((((_local21 == "chars")) || ((((_arg2 == "letters")) || ((_arg2 == "selectedStrings")))))){
_local29 = this.partialTable;
_local33 = 0;
_local34 = 0;
} else {
if (_arg2 == "words"){
_local33 = _local8.x;
_local34 = _local8.y;
};
};
};
_local30 = _local29.pushChild({type:"FeChar", x:((_local11[_local16].bounds.x - 2) - _local33), y:((_local11[_local16].bounds.y - 2) - _local34), text:_local11[_local16].text, bounds:_local11[_local16].bounds, id:_local11[_local16].id});
_local20 = this.textField.getLineIndexOfChar(_local30.id);
_local30.bottomPosition = this.textField.getLineMetrics(_local20).ascent;
_local30.applyTextFormat(this.textField.getTextFormat(_local30.id, (_local30.id + 1)));
_absChars.push(_local30);
_local16++;
};
_local15++;
};
_local14++;
};
break;
};
this.textTable.cleanMe();
var _local25:uint = this.textTable.childs.length;
_local20 = 0;
var _local26:Number = -1;
var _local27:Number = 0;
if (_local25 < 1){
maxEndEvents--;
} else {
_absMatrix[_local20] = [];
};
_local14 = 0;
while (_local14 < _local25) {
_local30 = this.textTable.childs[_local14];
_local20 = this.textField.getLineIndexOfChar(_local30.id);
if (_local20 != _local26){
_local26 = _local20;
_local27 = _absMatrix.push([]);
};
_absMatrix[(_local27 - 1)].push(_local30);
_local14++;
};
_local14 = 0;
while (_local14 < _absMatrix.length) {
if (_absMatrix[_local14].length == 0){
_absMatrix.splice(_local14, 1);
_local14--;
};
_local14++;
};
this._textOwnerClip.visible = true;
DisplayObject(this.textTable).visible = true;
DisplayObject(this._partialTextOwnerClip).visible = true;
this.textField.visible = false;
return (true);
}
protected function filterArray(_arg1:Array, _arg2:String, _arg3:Number, _arg4:Array):void{
var _local6:uint;
var _local7:Array;
var _local8:*;
var _local9:uint;
var _local10:Number;
var _local11:String;
var _local12:Object;
var _local13:int;
var _local14:String;
var _local15:int;
var _local16:int;
var _local17:RegExp;
var _local18:String;
var _local19:uint;
var _local20:*;
var _local5:uint = _arg1.length;
if (_arg2 != "selectedStrings"){
_local6 = _local5;
_local7 = new Array(_local5);
_local8 = 0;
while (_local8 < _local5) {
_local7[_local8] = _local8;
_local8++;
};
while (((_local6 / _local5) * 100) > _arg3) {
_local9 = Math.floor((Math.random() * _local7.length));
_arg1[_local7[_local9]].passed = false;
_local6--;
_local7.splice(_local9, 1);
};
} else {
_local10 = _arg4.length;
_local11 = this.textField.text;
_local12 = {};
_local8 = 0;
while (_local8 < _local5) {
_arg1[_local8].passed = false;
_local12[_arg1[_local8].id] = _local8;
_local8++;
};
_local8 = 0;
while (_local8 < _local10) {
_local13 = 0;
_local14 = _arg4[_local8];
_local15 = _local11.indexOf(_local14, _local13);
_local16 = _local14.length;
_local17 = / /g;
_local18 = _local14.replace(_local17, "");
_local19 = _local18.length;
while (_local15 != -1) {
_local20 = _local15;
while (_local20 < (_local15 + _local16)) {
if (_local12[_local20] != undefined){
_arg1[_local12[_local20]].passed = true;
};
_local20++;
};
_local13 = (_local15 + _local16);
_local15 = _local11.indexOf(_local14, _local13);
};
_local8++;
};
};
}
public function set swapTargetInstanceName(_arg1:String):void{
var scope:DisplayObjectContainer;
var paths:Array;
var targName:String;
var i:*;
var newTarget:DisplayObject;
var strPath:String;
var existObj:Object;
var arg = _arg1;
if (arg != ""){
if ((this.parent is DisplayObject)){
scope = this.parent;
paths = arg.split(".");
targName = paths.pop();
try {
i = 0;
while (i < paths.length) {
scope = (scope[paths[i]] as DisplayObjectContainer);
i = (i + 1);
};
} catch(e:Error) {
trace("FLASHEFF2 ERROR: The swapTargetInstanceName path is invalid.");
return;
};
if (scope != null){
newTarget = scope.getChildByName(targName);
if (newTarget == null){
strPath = this.getPath(scope);
existObj = FlashEff2.targetPaths[((strPath + ".") + arg)];
if (existObj != null){
newTarget = existObj.target;
};
};
this.swapTarget = newTarget;
} else {
trace("FLASHEFF2 ERROR: The swapTargetInstanceName path is invalid.");
};
};
this.__swapTargetInstanceName = arg;
} else {
this.swapTarget = null;
};
}
public function set hideAutoPlay(_arg1:Boolean):void{
__hideAutoPlay = _arg1;
this.invalidate();
setDrawTime();
}
public function get textField():TextField{
return (this._textField);
}
public function removeShowTransition():void{
if (this.showPattern != null){
this.showPattern.remove();
this.showPattern = null;
this._showTransitionName = "";
};
}
public function removeHideTransition():void{
if (this.hidePattern != null){
this.hidePattern.remove();
this.hidePattern = null;
this._hideTransitionName = "";
};
}
public function get showTransitionName():String{
return (this._showTransitionName);
}
public function set drawAfterFilters(_arg1:Boolean):void{
if (_arg1 != this.drawAfterFilters){
if (_arg1 == true){
buttonTarget = this.aDBT;
aDBTO.addChild(this.buttonOwner);
} else {
buttonTarget = this.bDBT;
this.bDBTO.addChild(this.buttonOwner);
};
if (this.buttonEffect != null){
this.buttonEffect.target = this.buttonTarget;
};
};
this._drawAfterFilters = _arg1;
}
public function get swapTargetInstanceName():String{
return (this.__swapTargetInstanceName);
}
public function set swapTransitionName(_arg1:String):void{
var patternClass:Class;
var arg = _arg1;
if (arg != ""){
try {
patternClass = (getDefinitionByName(arg) as Class);
if (this.swapPattern != null){
this.swapPattern.remove();
};
this.swapPattern = new patternClass(this);
} catch(e:ReferenceError) {
throw ((("FLASHEFF2 ERROR: The pattern '" + arg) + "' is missing from library."));
};
this._swapTransitionName = arg;
};
}
public function applyButtonEffect():void{
this.setButtonEvents();
this.isButtonEffectApplyed = true;
this.highestOwner.mouseChildren = false;
}
public function get drawAfterFilters():Boolean{
return (this._drawAfterFilters);
}
public function get textOwnerClip():Sprite{
return (_textOwnerClip);
}
public function get partialPatternName():String{
return (__partialPattern);
}
public function get partialTextOwnerClip():Sprite{
return (_partialTextOwnerClip);
}
public function buttonRollOut():void{
rollOutButtonHandler(null, true);
}
eventTypeAsoc["rollOver"] = "ROLL_OVER";
eventTypeAsoc["rollOut"] = "ROLL_OUT";
eventTypeAsoc["press"] = "MOUSE_DOWN";
eventTypeAsoc["release"] = "MOUSE_UP";
eventTypeAsoc["doubleClick"] = "DOUBLE_CLICK";
eventTypeAsoc["showTransitionStart"] = "";
eventTypeAsoc["showTransitionEnd"] = "";
eventTypeAsoc["hideTransitionStart"] = "";
eventTypeAsoc["hideTransitionEnd"] = "";
}
}//package
Section 590
//FlashEff2Code (FlashEff2Code)
package {
import com.jumpeye.flashEff2.presets.*;
import com.jumpeye.transitions.easing.*;
import com.jumpeye.flashEff2.buttonEffect.*;
public class FlashEff2Code extends FlashEff2 {
public function FlashEff2Code(){
initAssets();
}
protected function initAssets():void{
var _local1:JFESP1;
var _local2:JFESP2;
var _local3:JFESP3;
var _local4:JFESP4;
var _local5:JFESP5;
var _local6:JFESP6;
var _local7:JFESP7;
var _local8:JFESP8;
var _local9:JFESP9;
var _local10:JFESP10;
var _local11:JFESP11;
var _local12:JFESP12;
var _local13:JFESP13;
var _local14:JFESP14;
var _local15:JFESP15;
var _local16:JFESP16;
var _local17:JFESP17;
var _local18:JFESP18;
var _local19:JFESP19;
var _local20:JFESP20;
var _local21:JFESPM2;
var _local22:JFESPM3;
var _local23:JFESPM4;
var _local24:JFESPM5;
var _local25:JFESPM6;
var _local26:JFESPM7;
var _local27:JFESPM8;
var _local28:JFETP2;
var _local29:JFETP3;
var _local30:JFETP4;
var _local31:JFETP5;
var _local32:JFETP6;
var _local33:JFETP7;
var _local34:JFETP8;
var _local35:JFETP9;
var _local36:JFETP10;
var _local37:JFETP11;
var _local38:JFETP12;
var _local39:JFETP13;
var _local40:JFETP14;
var _local41:JFETP15;
var _local42:JFETP16;
var _local43:JFETP17;
var _local44:JFETP18;
var _local45:JFETP19;
var _local46:JFETP20;
var _local47:JFETP21;
var _local48:JFETP22;
var _local49:JFETP23;
var _local50:JFETP24;
var _local51:JFETP25;
var _local52:JFETP26;
var _local53:JFETP27;
var _local54:JFETP28;
var _local55:JFETP29;
var _local56:JFETP30;
var _local57:JFETP3D2;
var _local58:JFETP3D3;
var _local59:JFETP3D4;
var _local60:JFETP3D5;
var _local61:JFETP3D6;
var _local62:JFETP3D7;
var _local63:JFETP3D8;
var _local64:JFETP3D9;
var _local65:JFETP3D10;
var _local66:JFETP3D11;
var _local67:JFETP3D12;
var _local68:JFETP3D13;
var _local69:JFETP3D14;
var _local70:JFETP3D15;
var _local71:JFETP3D16;
var _local72:JFETP3D17;
var _local73:JFETP3D18;
var _local74:JFETP3D19;
var _local75:Back;
var _local76:Bounce;
var _local77:Circular;
var _local78:Cubic;
var _local79:Elastic;
var _local80:Exponential;
var _local81:Linear;
var _local82:Quadratic;
var _local83:Quartic;
var _local84:Quintic;
var _local85:Sine;
var _local86:Strong;
var _local87:FEBColorMatrixFilterPlugin = new FEBColorMatrixFilterPlugin();
var _local88:FEBCustomTintPlugin = new FEBCustomTintPlugin();
var _local89:FEBFilterPlugins = new FEBFilterPlugins();
}
}
}//package
Section 591
//Fourth_Hely (Fourth_Hely)
package {
import flash.media.*;
public dynamic class Fourth_Hely extends Sound {
}
}//package
Section 592
//Front (Front)
package {
import flash.display.*;
public dynamic class Front extends MovieClip {
}
}//package
Section 593
//Heli_animation (Heli_animation)
package {
import flash.display.*;
public dynamic class Heli_animation extends MovieClip {
}
}//package
Section 594
//Hely_Sound (Hely_Sound)
package {
import flash.display.*;
import flash.media.*;
public class Hely_Sound extends Sprite {
private const VOLUME:int = 1;
private var second_hely_sound:Second_Hely;
private var thirdth_hely_sound:Thirdth_Hely;
private var gameChannel:SoundChannel;
private var fist_hely_sound:First_Hely;
private var fourth_hely_sound:Fourth_Hely;
public function Hely_Sound(){
this.fist_hely_sound = new First_Hely();
this.second_hely_sound = new Second_Hely();
this.thirdth_hely_sound = new Thirdth_Hely();
this.fourth_hely_sound = new Fourth_Hely();
this.gameChannel = new SoundChannel();
super();
}
public function play_second_hely_sound(){
var _local1:SoundTransform = new SoundTransform();
_local1.volume = this.VOLUME;
this.gameChannel = this.second_hely_sound.play(0, 999);
this.gameChannel.soundTransform = _local1;
}
public function play_thirdth_hely_sound(){
var _local1:SoundTransform = new SoundTransform();
_local1.volume = this.VOLUME;
this.gameChannel = this.thirdth_hely_sound.play(0, 999);
this.gameChannel.soundTransform = _local1;
}
public function play_fist_hely_sound(){
var _local1:SoundTransform = new SoundTransform();
_local1.volume = this.VOLUME;
this.gameChannel = this.fist_hely_sound.play(0, 999);
this.gameChannel.soundTransform = _local1;
}
public function stop_sound(){
this.gameChannel.stop();
}
public function play_fourth_hely_sound(){
var _local1:SoundTransform = new SoundTransform();
_local1.volume = this.VOLUME;
this.gameChannel = this.fourth_hely_sound.play(0, 999);
this.gameChannel.soundTransform = _local1;
}
}
}//package
Section 595
//I6introsmall (I6introsmall)
package {
import flash.display.*;
public dynamic class I6introsmall extends MovieClip {
}
}//package
Section 596
//Main (Main)
package {
import flash.events.*;
import com.jumpeye.Events.*;
import flash.display.*;
import Clases.Game.LevelSelection.*;
import com.jumpeye.flashEff2.symbol.squareEffect.*;
import Clases.BasicScreens.ClassResources.*;
import Clases.Button.*;
import flash.net.*;
import gs.*;
public class Main extends Sprite {
private var pattern0:FESRoundedSquareScale;
private var musicSouds:ResourceSound;
private var sprite:Sprite;
private var clickAwayAdMC:MovieClip;
private var play:GameButton;
private var local_data:SharedObject;
private var fe:FlashEff2Code;
public static const HEIGHT_SIZE:int = 420;
public static const WIDTH_SIZE:int = 660;
public static var last_played_level:int = 1;
public static var sounOption:Boolean = true;
public static var total_game_money:int;
public static var current_level:int = 1;
public function Main():void{
musicSouds = new ResourceSound();
local_data = SharedObject.getLocal("user_data_Transport_game_v12");
clickAwayAdMC = new MovieClip();
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
public function do_next(e:FLASHEFFEvents):void{
removeChild(fe);
}
private function init(e:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
generate_main();
}
private function start_game(e:MouseEvent):void{
if (local_data.data.currentLevel){
Main.current_level = local_data.data.currentLevel;
Main.last_played_level = local_data.data.lastPlayedLevel;
Main.total_game_money = local_data.data.gameMoney;
} else {
Main.current_level = 1;
Main.last_played_level = 1;
local_data.data.currentLevel = Main.current_level;
local_data.data.lastPlayedLevel = Main.last_played_level;
local_data.data.gameMoney = Main.total_game_money;
};
musicSouds.stopMainMusic();
play.removeEventListener(MouseEvent.CLICK, start_game);
removeChild(clickAwayAdMC);
fe = new FlashEff2Code();
this.addChild(fe);
fe.target = sprite;
pattern0 = new FESRoundedSquareScale();
pattern0.preset = 11;
pattern0.squareWidth = 60;
pattern0.squareHeight = 60;
pattern0.cornerRadius = 20;
pattern0.groupDuration = 1;
pattern0.tweenDuration = 3;
pattern0.tweenType = "Strong";
pattern0.easeType = "easeOut";
pattern0.opaqueBackground = true;
fe.hideTransition = pattern0;
fe.addEventListener(FLASHEFFEvents.TRANSITION_END, do_next);
fe.hideAutoPlay = true;
fe.hide();
var levelSelection:LevelSelectionScreen = new LevelSelectionScreen();
addChild(levelSelection);
levelSelection.init({stg:stage, main:this});
this.setChildIndex(levelSelection, 0);
}
public function generate_main():void{
musicSouds.playMainMusic();
sprite = new Sprite();
addChild(sprite);
var backgroundResources:MainResources = new MainResources();
var background:Bitmap = backgroundResources.createBackMainBitmap();
sprite.addChild(background);
var title:Bitmap = backgroundResources.create_Title_Main();
sprite.addChild(title);
title.y = (title.y - title.height);
TweenMax.to(title, 1, {y:0});
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
play = new GameButton({y:12, width:100, height:25, texto:"", size:20, skins:new ButtonPlayMainMenuResources(), objectColor:colors});
sprite.addChild(play);
play.x = 44;
play.y = 265;
play.addEventListener(MouseEvent.CLICK, start_game, false, 0, true);
var moreGames:GameButtonMoreGamesForYourSite = new GameButtonMoreGamesForYourSite({y:12, width:100, height:25, texto:"", size:20, skins:new ButtonMoreGamesResources(), objectColor:colors});
sprite.addChild(moreGames);
moreGames.x = 29;
moreGames.y = ((play.y + play.height) + 10);
var freegamesforyoursite:GameButtonFreeGames = new GameButtonFreeGames({y:12, width:100, height:25, texto:"", size:20, skins:new ButtonFreGamesForYourSiteResources(), objectColor:colors});
sprite.addChild(freegamesforyoursite);
freegamesforyoursite.x = 25;
freegamesforyoursite.y = ((moreGames.y + moreGames.height) + 10);
clickAwayAdMC.x = 355;
clickAwayAdMC.y = 165;
this.addChild(clickAwayAdMC);
var opts:Object = {id:"596b3d96ab136605", clip:clickAwayAdMC};
total_game_money = 0;
}
}
}//package
Section 597
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var self:MochiBot = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var server:String = "http://core.mochibot.com/my/core.swf";
var lv:URLVariables = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
var url:String = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
var req:URLRequest = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
var loader:Loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package
Section 598
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import gs.*;
import mochi.as3.*;
import flash.net.*;
import flash.utils.*;
import Clases.TrakingCode.*;
import Clases.Button.*;
import gs.easing.*;
import Clases.Game.Common.*;
public class Preloader extends MovieClip {
private var googleCode:GoogleTrackingCode;
private var preLoadBar:ProgBar;
public static var MAIN_CLASS:String = "Main";
public function Preloader(){
preLoadBar = new ProgBar({width:656, height:35, x:0, y:330, borderWidth:3, borderColor:39167, borderShadow:0, round:10, color:0xFFFF00, maxValue:100, showTextField:false, textColor:0});
addEventListener(Event.ENTER_FRAME, checkFrame);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress);
super();
MochiBot.track(this, "08b9c546");
MochiBot.track(this, "ffc077ba");
MochiServices.connect("596b3d96ab136605", this);
MochiEvents.startPlay("GAMEPLAY");
googleCode = new GoogleTrackingCode(this, "UA-4982430-8");
googleCode.mainPageTraking();
var puelogames:PueloGamesCredits = new PueloGamesCredits();
puelogames.init(this);
this.contextMenu = puelogames.getMenuContext();
var preloaderBackground:Background = new Background();
addChild(preloaderBackground);
preloaderBackground.scaleY = 1.1;
var i6Imagen:I6introsmall = new I6introsmall();
addChild(i6Imagen);
i6Imagen.width = 200;
i6Imagen.height = 200;
i6Imagen.x = 200;
i6Imagen.y = 50;
i6Imagen.x = ((i6Imagen.stage.stageWidth / 2) - (i6Imagen.width / 2));
i6Imagen.y = (i6Imagen.stage.y + 10);
var i6Imagen2:I6introsmall = new I6introsmall();
addChild(i6Imagen2);
i6Imagen2.width = 50;
i6Imagen2.height = 50;
i6Imagen2.x = 545;
i6Imagen2.y = 385;
i6Imagen2.x = (i6Imagen2.stage.stageWidth - i6Imagen2.width);
i6Imagen2.y = (i6Imagen2.stage.stageHeight - i6Imagen2.height);
addChild(preLoadBar);
preLoadBar.alpha = 0.2;
preLoadBar.updateValue(0);
var front:Front = new Front();
addChild(front);
front.alpha = 0;
front.addEventListener(MouseEvent.CLICK, jump_to_7lay);
}
private function jump_to_7lay(e:MouseEvent):void{
googleCode.Preloader_click();
var saltoApagina:URLRequest = new URLRequest("http://www.i6.com/new-games.php?utm_source=games&utm_medium=hfleetpr");
navigateToURL(saltoApagina, "_blank");
}
private function checkFrame(e:Event):void{
if (currentFrame == totalFrames){
removeEventListener(Event.ENTER_FRAME, checkFrame);
TweenMax.to(preLoadBar, 4, {x:800, ease:Back.easeIn, onComplete:displayButton});
};
}
private function displayButton():void{
var colors:Object = {colorIn:0xFFFFFF, colorOut:0, colorInOver:0xFFFFFF, colorOutOver:0x676767, colorInOverDown:0x676767, colorOutOverDown:0x676767};
var play:GameButton = new GameButton({y:12, width:100, height:25, texto:"", size:20, skins:new ButtonPreloaderResources(), objectColor:colors});
addChild(play);
play.x = ((play.stage.stageWidth / 2) - (play.width / 2));
play.y = (play.stage.stageHeight - play.height);
play.addEventListener(MouseEvent.CLICK, start_Main, false, 0, true);
}
private function progress(e:ProgressEvent):void{
preLoadBar.updatePercent(((e.bytesLoaded / e.bytesTotal) * 100));
trace((e.bytesLoaded / e.bytesTotal));
}
private function start_Main(e:MouseEvent):void{
stop();
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
var remover:Remover = new Remover();
remover.removeAllChilds_objects(this);
var mainClass:Class = Class(getDefinitionByName(MAIN_CLASS));
var app:Object = new (mainClass);
addChild((app as DisplayObject));
}
}
}//package
Section 599
//ProgBar (ProgBar)
package {
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import flash.text.*;
public class ProgBar extends MovieClip {
protected var _pbTextField:TextField;
protected var _pbInitialX:Number;// = -1
protected var _pbInitialY:Number;// = -1
protected var _pbTextFieldColor:Number;// = 0
protected var _pbBorderColor:Number;// = 6513247
protected var _pb:Sprite;
protected var _pbColor:Number;// = 14015635
protected var _stage:Stage;
protected var _pbHeight:Number;// = 10
protected var _pbBorderShadow:uint;// = 0
protected var _pbMaxValue:Number;// = 300
protected var _pbBorder:Number;// = 6
protected var _pbWidth:Number;// = 200
protected var _pbRound:Number;// = 2
protected var _pbShowTextField:Boolean;// = false
public function ProgBar(_pbObj:Object=null):void{
var _pbObj = _pbObj;
_pb = new Sprite();
super();
try {
_pb = new Sprite();
if (_pbObj != null){
if (((!((_pbObj.width == null))) && (!((_pbObj.width == undefined))))){
_pbWidth = _pbObj.width;
};
if (((!((_pbObj.height == null))) && (!((_pbObj.height == undefined))))){
_pbHeight = _pbObj.height;
};
if (((!((_pbObj.x == null))) && (!((_pbObj.x == undefined))))){
_pbInitialX = _pbObj.x;
};
if (((!((_pbObj.y == null))) && (!((_pbObj.y == undefined))))){
_pbInitialY = _pbObj.y;
};
if (((!((_pbObj.borderWidth == null))) && (!((_pbObj.borderWidth == undefined))))){
_pbBorder = _pbObj.borderWidth;
};
if (((!((_pbObj.color == null))) && (!((_pbObj.color == undefined))))){
_pbColor = _pbObj.color;
};
if (((!((_pbObj.borderColor == null))) && (!((_pbObj.borderColor == undefined))))){
_pbBorderColor = _pbObj.borderColor;
};
if (((!((_pbObj.maxValue == null))) && (!((_pbObj.maxValue == undefined))))){
_pbMaxValue = _pbObj.maxValue;
};
if (((!((_pbObj.round == null))) && (!((_pbObj.round == undefined))))){
_pbRound = _pbObj.round;
};
if (((!((_pbObj.borderShadow == null))) && (!((_pbObj.borderShadow == undefined))))){
_pbBorderShadow = _pbObj.borderShadow;
};
if (((!((_pbObj.showTextField == null))) && (!((_pbObj.showTextField == undefined))))){
_pbShowTextField = _pbObj.showTextField;
};
if (((!((_pbObj.textColor == null))) && (!((_pbObj.textColor == undefined))))){
_pbTextFieldColor = _pbObj.textColor;
};
if (((!((_pbObj.stage == null))) && (!((_pbObj.stage == undefined))))){
_stage = _pbObj.stage;
};
};
drawBorder();
drawProgressBar();
if (_pbShowTextField){
drawTextField();
};
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar Constructor: " + _slot1.toString()));
} finally {
addEventListener(Event.ADDED, create);
};
}
private function drawProgressBar():void{
var _pbBack:Sprite;
_pbBack = new Sprite();
_pbBack.x = _pbBorder;
_pbBack.y = _pbBorder;
_pbBack.graphics.beginFill(0, 0.25);
_pbBack.graphics.lineStyle(1, 0, 0.5);
_pbBack.graphics.drawRect(0, 0, _pbWidth, _pbHeight);
_pbBack.graphics.endFill();
addChild(_pbBack).name = "progress_bar_back";
_pb.x = _pbBorder;
_pb.y = _pbBorder;
_pb.graphics.beginFill(_pbColor, 1);
_pb.graphics.lineStyle(1, _pbColor, 1);
_pb.graphics.drawRect(0, 0, _pbWidth, _pbHeight);
_pb.graphics.endFill();
addChild(_pb).name = "progress_bar";
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar.drawProgressBar(): " + _slot1.toString()));
}
public function remove():void{
if (_pbShowTextField){
_pbTextField.text = "";
};
this.parent.removeChild(this);
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar.remove(): " + _slot1.toString()));
}
private function create(event:Event):void{
var event = event;
if (_stage == null){
_stage = this.stage;
};
if (_pbInitialX == -1){
this.x = ((_stage.stageWidth * 0.5) - (_pbWidth * 0.5));
} else {
this.x = _pbInitialX;
};
if (_pbInitialY == -1){
this.y = ((_stage.stageHeight * 0.5) - (this.height * 0.5));
} else {
this.y = _pbInitialY;
};
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar.create(): " + _slot1.toString()));
}
private function drawBorder():void{
var _Background:Sprite;
var myFilter:BitmapFilter;
var filterArray:Array;
_Background = new Sprite();
_Background.x = 0;
_Background.y = 0;
_Background.graphics.beginFill(_pbBorderColor, 1);
_Background.graphics.lineStyle(1, _pbBorderColor, 1);
_Background.graphics.drawRect(0, 0, (_pbWidth + (_pbBorder * 2)), (_pbHeight + (_pbBorder * 2)));
_Background.graphics.endFill();
myFilter = InnerGlowFilter(_pbBorderShadow);
filterArray = new Array(myFilter);
_Background.filters = filterArray;
addChild(_Background).name = "progress_background";
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar.drawBorder(): " + _slot1.toString()));
}
public function updatePercent(_percent:Number):void{
var _percent = _percent;
if (_pb){
if (_percent < 100){
_pb.width = ((_percent * _pbWidth) / 100);
if (_pbShowTextField){
_pbTextField.text = (Math.floor(_percent) + "%");
};
} else {
_pb.width = _pbWidth;
if (_pbShowTextField){
_pbTextField.text = "";
};
};
} else {
trace("Progress Bar hasn't been created yet...");
};
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar.updatePercent(): " + _slot1.toString()));
}
public function updateValue(_value:Number):void{
var myValue:Number;
var _value = _value;
if (_pb){
myValue = ((_pbWidth * _value) / _pbMaxValue);
if (_value <= _pbMaxValue){
_pb.width = myValue;
if (_pbShowTextField){
_pbTextField.text = (_value + "%");
};
} else {
_pb.width = _pbWidth;
if (_pbShowTextField){
_pbTextField.text = "100%";
};
};
} else {
trace("Progress Bar hasn't been created yet...");
};
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar.updateValue(): " + _slot1.toString()));
}
private function drawTextField():void{
var textFormat:TextFormat;
var pbTextField:TextField;
textFormat = new TextFormat();
textFormat.font = "Arial";
textFormat.color = _pbTextFieldColor;
textFormat.size = ((_pbHeight * 0.5) + 3);
textFormat.bold = true;
textFormat.align = TextFormatAlign.CENTER;
pbTextField = new TextField();
pbTextField.text = "0%";
pbTextField.x = _pb.x;
pbTextField.y = (_pb.y - 2);
pbTextField.width = _pb.width;
pbTextField.height = (_pb.height + 3);
pbTextField.wordWrap = true;
pbTextField.multiline = false;
pbTextField.selectable = false;
pbTextField.condenseWhite = true;
pbTextField.defaultTextFormat = textFormat;
pbTextField.antiAliasType = "advanced";
addChild(pbTextField).name = "progress_text";
_pbTextField = TextField(this.getChildByName("progress_text"));
//unresolved jump
var _slot1 = _err;
trace(("ERROR ON ProgBar.drawTextField(): " + _slot1.toString()));
}
private function InnerGlowFilter(_color:uint):BitmapFilter{
var color:uint = _color;
var alpha:Number = 0.5;
var blurX:Number = 4;
var blurY:Number = 4;
var strength:Number = 1;
var inner:Boolean;
var knockout:Boolean;
var quality:Number = BitmapFilterQuality.HIGH;
return (new GlowFilter(color, alpha, blurX, blurY, strength, quality, inner, knockout));
}
}
}//package
Section 600
//PueloGamesCredits (PueloGamesCredits)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
import flash.net.*;
import Clases.TrakingCode.*;
public class PueloGamesCredits {
private var fm_menu:ContextMenu;
private var copyright:ContextMenuItem;
private var credit:ContextMenuItem;
private var googleCode:GoogleTrackingCode;
public function PueloGamesCredits(){
fm_menu = new ContextMenu();
copyright = new ContextMenuItem("Copyright © Puelo Games");
credit = new ContextMenuItem("www.puelogames.com");
super();
copyright.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_flashmo);
credit.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visit_flashmo);
credit.separatorBefore = false;
fm_menu.hideBuiltInItems();
fm_menu.customItems.push(copyright, credit);
}
public function init(parent:Sprite):void{
googleCode = new GoogleTrackingCode(parent, "UA-4982430-2");
}
public function getMenuContext():ContextMenu{
return (fm_menu);
}
private function visit_flashmo(e:Event):void{
var flashmo_link:URLRequest = new URLRequest("http://www.puelogames.com");
navigateToURL(flashmo_link, "_blank");
}
}
}//package
Section 601
//Second_Hely (Second_Hely)
package {
import flash.media.*;
public dynamic class Second_Hely extends Sound {
}
}//package
Section 602
//Thirdth_Hely (Thirdth_Hely)
package {
import flash.media.*;
public dynamic class Thirdth_Hely extends Sound {
}
}//package