Section 1
//FPS_197 (Bombardment_fla.FPS_197)
package Bombardment_fla {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class FPS_197 extends MovieClip {
public var prevSecondTime:Number;
public var secondTime:Number;
public var tf:TextField;
public var frames:Number;
public var time:Number;
public var frameTime:Number;
public var fps:String;
public var prevFrameTime:Number;
public var iBar:MovieClip;
public function FPS_197(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
prevFrameTime = getTimer();
prevSecondTime = getTimer();
frames = 0;
fps = "...";
}
function frame2(){
stop();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event):void{
time = getTimer();
frameTime = (time - prevFrameTime);
secondTime = (time - prevSecondTime);
if (secondTime >= 1000){
fps = frames.toString();
frames = 0;
prevSecondTime = time;
} else {
frames++;
};
prevFrameTime = time;
tf.text = (((fps + " FPS / ") + frameTime) + " MS");
iBar.scaleX = (iBar.scaleX - ((iBar.scaleX - (frameTime / 10)) / 5));
parent.setChildIndex(this, (parent.numChildren - 1));
}
}
}//package Bombardment_fla
Section 2
//intro_splash_tanoku_336 (Bombardment_fla.intro_splash_tanoku_336)
package Bombardment_fla {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class intro_splash_tanoku_336 extends MovieClip {
public var tar;
public function intro_splash_tanoku_336(){
addFrameScript(200, frame201);
}
function frame201(){
tar = parent;
tar.play();
}
}
}//package Bombardment_fla
Section 3
//introFlash_340 (Bombardment_fla.introFlash_340)
package Bombardment_fla {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class introFlash_340 extends MovieClip {
public function introFlash_340(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package Bombardment_fla
Section 4
//notDoppler_intro_338 (Bombardment_fla.notDoppler_intro_338)
package Bombardment_fla {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class notDoppler_intro_338 extends MovieClip {
public var tar;
public function notDoppler_intro_338(){
addFrameScript(304, frame305);
}
function frame305(){
stop();
tar = parent;
tar.play();
}
}
}//package Bombardment_fla
Section 5
//objetivo_254 (Bombardment_fla.objetivo_254)
package Bombardment_fla {
import flash.display.*;
public dynamic class objetivo_254 extends MovieClip {
public var mirilla:MovieClip;
}
}//package Bombardment_fla
Section 6
//satelite_252 (Bombardment_fla.satelite_252)
package Bombardment_fla {
import flash.display.*;
public dynamic class satelite_252 extends MovieClip {
public var objetivo:MovieClip;
public var area:MovieClip;
public var cuerpo:SimpleButton;
}
}//package Bombardment_fla
Section 7
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2CircleDef extends b2ShapeDef {
public var localPosition:b2Vec2;
public var radius:Number;
public function b2CircleDef(){
localPosition = new b2Vec2(0, 0);
super();
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_radius:Number;
public var m_localPosition:b2Vec2;
public function b2CircleShape(_arg1:b2ShapeDef){
var _local2:b2CircleDef;
m_localPosition = new b2Vec2();
super(_arg1);
_local2 = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg1.R;
_local4 = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg1.R;
_local7 = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
_local8 = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
_local9 = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
_local11 = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
_arg2[0] = 0;
return (e_startsInsideCollide);
};
_local12 = (_arg4.p2.x - _arg4.p1.x);
_local13 = (_arg4.p2.y - _arg4.p1.y);
_local14 = ((_local9 * _local12) + (_local10 * _local13));
_local15 = ((_local12 * _local12) + (_local13 * _local13));
_local16 = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (e_missCollide);
};
_local17 = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (e_hitCollide);
};
return (e_missCollide);
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = _arg2.R;
_local5 = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local6 = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
_local7 = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local8 = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
public function GetRadius():Number{
return (m_radius);
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number;
var _local3:Number;
_local2 = (m_localPosition.x - _arg1.x);
_local3 = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.R;
_local4 = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function b2FilterData(){
categoryBits = 1;
maskBits = 0xFFFF;
groupIndex = 0;
super();
}
public function Copy():b2FilterData{
var _local1:b2FilterData;
_local1 = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 10
//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(){
mass = 0;
center = new b2Vec2(0, 0);
I = 0;
super();
}
}
}//package Box2D.Collision.Shapes
Section 11
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertexCount:int;
public var vertices:Array;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
var _local1:int;
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
_local1 = 0;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 12
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_vertices:Array;
public var m_normals:Array;
private var s_supportVec:b2Vec2;
public var m_obb:b2OBB;
public var m_coreVertices:Array;
public var m_centroid:b2Vec2;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local2:b2PolygonDef;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
_local2 = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
_local4 = _local3;
_local5 = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Number;
_local4 = _arg1.R;
_local5 = (_arg2.x - _arg1.position.x);
_local6 = (_arg2.y - _arg1.position.y);
_local7 = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
_local8 = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
_local9 = 0;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:Number;
var _local21:Number;
_local6 = 0;
_local7 = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
_local12 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local13 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
_local14 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local15 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local18 = -1;
_local19 = 0;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (e_missCollide);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (e_hitCollide);
};
_arg2[0] = 0;
return (e_startsInsideCollide);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = (1 / 3);
_local9 = 0;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:Number;
_local5 = _arg1.R;
_local6 = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
_local7 = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
_local8 = 0;
_local4 = m_coreVertices[0];
_local9 = ((_local4.x * _local6) + (_local4.y * _local7));
_local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB;
var _local5:b2AABB;
_local4 = s_sweptAABB1;
_local5 = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetNormals():Array{
return (m_normals);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
_local3 = 0;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local5 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
_local6 = _local5;
_local4 = m_obb.extents;
_local7 = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
_local8 = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
_local9 = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
_local10 = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = (1 / 3);
_local8 = 0;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
_local5 = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
_local6 = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 13
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class 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_next:b2Shape;
public var m_restitution:Number;
public var m_userData;
public var m_isSensor:Boolean;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_hitCollide:int = 1;
public static const e_missCollide:int = 0;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
public static const e_startsInsideCollide:int = -1;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):int{
return (e_missCollide);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
_local3 = s_resetAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
var _local4:b2AABB;
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
_local4 = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
_local3 = s_proxyAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 14
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2ShapeDef {
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var type:int;
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var friction:Number;// = 0.2
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
userData = null;
friction = 0.2;
restitution = 0;
density = 0;
isSensor = false;
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 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 _local1:Number;
var _local2:Number;
var _local3:Boolean;
_local1 = (upperBound.x - lowerBound.x);
_local2 = (upperBound.y - lowerBound.y);
_local3 = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 16
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var proxyId:uint;
public var stabbingCount:uint;
public var value:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_local2 = value;
_local3 = proxyId;
_local4 = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 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_worldAABB:b2AABB;
public var m_bounds:Array;
public var m_freeProxy:uint;
public var m_quantizationFactor:b2Vec2;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_querySortKeys:Array;
public var m_pairManager:b2PairManager;
public var m_queryResultCount:int;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid:uint = b2Settings.USHRT_MAX;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_querySortKeys = new Array(b2Settings.b2_maxProxies);
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
m_querySortKeys[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
_local4 = (_arg1.upperBound.x - _arg1.lowerBound.x);
_local5 = (_arg1.upperBound.y - _arg1.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local4:Array;
var _local5:Array;
var _local6:uint;
var _local7:uint;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:b2Proxy;
_local4 = new Array();
_local5 = new Array();
ComputeBounds(_local4, _local5, _arg1);
_local8 = [_local6];
_local9 = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
_local10 = 0;
_local11 = 0;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local11:uint;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
_local8 = BinarySearch(_arg5, _arg6, _arg3);
_local9 = BinarySearch(_arg5, _arg6, _arg4);
_local11 = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function AddProxyResult(_arg1:uint, _arg2:b2Proxy, _arg3:Number, _arg4:Function):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:uint;
var _local9:Number;
var _local10:uint;
_local5 = _arg4(_arg2.userData);
if (_local5 < 0){
return;
};
_local6 = 0;
while ((((_local6 < m_queryResultCount)) && ((m_querySortKeys[_local6] < _local5)))) {
_local6++;
};
_local7 = _local5;
_local8 = _arg1;
m_queryResultCount = (m_queryResultCount + 1);
if (m_queryResultCount > _arg3){
m_queryResultCount = _arg3;
};
while (_local6 < m_queryResultCount) {
_local9 = m_querySortKeys[_local6];
_local10 = m_queryResults[_local6];
m_querySortKeys[_local6] = _local7;
m_queryResults[_local6] = _local8;
_local7 = _local9;
_local8 = _local10;
_local6++;
};
}
public function QuerySegment(_arg1:b2Segment, _arg2, _arg3:int, _arg4:Function):int{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:b2Proxy;
var _local19:uint;
var _local20:uint;
var _local21:Array;
var _local22:Array;
var _local23:Boolean;
var _local24:Number;
var _local25:Number;
var _local26:int;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:uint;
_local5 = 1;
_local6 = ((_arg1.p2.x - _arg1.p1.x) * m_quantizationFactor.x);
_local7 = ((_arg1.p2.y - _arg1.p1.y) * m_quantizationFactor.y);
_local8 = ((_local6 < -(Number.MIN_VALUE))) ? -1 : ((_local6 > Number.MIN_VALUE)) ? 1 : 0;
_local9 = ((_local7 < -(Number.MIN_VALUE))) ? -1 : ((_local7 > Number.MIN_VALUE)) ? 1 : 0;
_local10 = (m_quantizationFactor.x * (_arg1.p1.x - m_worldAABB.lowerBound.x));
_local11 = (m_quantizationFactor.y * (_arg1.p1.y - m_worldAABB.lowerBound.y));
_local12 = new Array();
_local13 = new Array();
_local12[0] = (uint(_local10) & (b2Settings.USHRT_MAX - 1));
_local12[1] = (uint(_local11) & (b2Settings.USHRT_MAX - 1));
_local13[0] = (_local12[0] + 1);
_local13[1] = (_local12[1] + 1);
_local14 = new Array();
_local21 = [_local19];
_local22 = [_local20];
Query(_local21, _local22, _local12[0], _local13[0], m_bounds[0], (2 * m_proxyCount), 0);
if (_local8 >= 0){
_local15 = (_local22[0] - 1);
} else {
_local15 = _local21[0];
};
Query(_local21, _local22, _local12[1], _local13[1], m_bounds[1], (2 * m_proxyCount), 1);
if (_local9 >= 0){
_local16 = (_local22[0] - 1);
} else {
_local16 = _local21[0];
};
if (_arg4 != null){
_local27 = 0;
while (_local27 < m_queryResultCount) {
m_querySortKeys[_local27] = _arg4(m_proxyPool[m_queryResults[_local27]].userData);
_local27++;
};
_local27 = 0;
while (_local27 < (m_queryResultCount - 1)) {
_local28 = m_querySortKeys[_local27];
_local29 = m_querySortKeys[(_local27 + 1)];
if (((_local28)<0) ? (_local29 >= 0) : (((_local28 > _local29)) && ((_local29 >= 0)))){
m_querySortKeys[(_local27 + 1)] = _local28;
m_querySortKeys[_local27] = _local29;
_local30 = m_queryResults[(_local27 + 1)];
m_queryResults[(_local27 + 1)] = m_queryResults[_local27];
m_queryResults[_local27] = _local30;
--_local27;
if (_local27 == -1){
_local27 = 1;
};
} else {
_local27++;
};
};
while ((((m_queryResultCount > 0)) && ((m_querySortKeys[(m_queryResultCount - 1)] < 0)))) {
m_queryResultCount--;
};
};
_local23 = true;
if ((((_local15 < 0)) || ((_local15 >= (m_proxyCount * 2))))){
_local23 = false;
};
if ((((_local16 < 0)) || ((_local16 >= (m_proxyCount * 2))))){
_local23 = false;
};
if (_local23){
if (_local8 != 0){
if (_local8 > 0){
_local15++;
if (_local15 == (m_proxyCount * 2)){
_local23 = false;
};
} else {
--_local15;
if (_local15 < 0){
_local23 = false;
};
};
_local24 = ((m_bounds[0][_local15].value - _local10) / _local6);
};
if (_local9 != 0){
if (_local9 > 0){
_local16++;
if (_local16 == (m_proxyCount * 2)){
_local23 = false;
};
} else {
--_local16;
if (_local16 < 0){
_local23 = false;
};
};
_local25 = ((m_bounds[1][_local16].value - _local11) / _local7);
};
};
while (_local23) {
if ((((_local9 == 0)) || (((!((_local8 == 0))) && ((_local24 < _local25)))))){
if (_local24 > _local5){
break;
};
if (((_local8 > 0)) ? m_bounds[0][_local15].IsLower() : m_bounds[0][_local15].IsUpper()){
_local17 = m_bounds[0][_local15].proxyId;
_local18 = m_proxyPool[_local17];
if (_local9 >= 0){
if ((((_local18.lowerBounds[1] <= (_local16 - 1))) && ((_local18.upperBounds[1] >= _local16)))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
} else {
if ((((_local18.lowerBounds[1] <= _local16)) && ((_local18.upperBounds[1] >= (_local16 + 1))))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
};
};
if (((((((!((_arg4 == null))) && ((m_queryResultCount == _arg3)))) && ((m_queryResultCount > 0)))) && ((_local24 > m_querySortKeys[(m_queryResultCount - 1)])))){
break;
};
if (_local8 > 0){
_local15++;
if (_local15 == (m_proxyCount * 2)){
break;
};
} else {
--_local15;
if (_local15 < 0){
break;
};
};
_local24 = ((m_bounds[0][_local15].value - _local10) / _local6);
} else {
if (_local25 > _local5){
break;
};
if (((_local9 > 0)) ? m_bounds[1][_local16].IsLower() : m_bounds[1][_local16].IsUpper()){
_local17 = m_bounds[1][_local16].proxyId;
_local18 = m_proxyPool[_local17];
if (_local8 >= 0){
if ((((_local18.lowerBounds[0] <= (_local15 - 1))) && ((_local18.upperBounds[0] >= _local15)))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
} else {
if ((((_local18.lowerBounds[0] <= _local15)) && ((_local18.upperBounds[0] >= (_local15 + 1))))){
if (_arg4 != null){
AddProxyResult(_local17, _local18, _arg3, _arg4);
} else {
m_queryResults[m_queryResultCount] = _local17;
m_queryResultCount++;
};
};
};
};
if (((((((!((_arg4 == null))) && ((m_queryResultCount == _arg3)))) && ((m_queryResultCount > 0)))) && ((_local25 > m_querySortKeys[(m_queryResultCount - 1)])))){
break;
};
if (_local9 > 0){
_local16++;
if (_local16 == (m_proxyCount * 2)){
break;
};
} else {
--_local16;
if (_local16 < 0){
break;
};
};
_local25 = ((m_bounds[1][_local16].value - _local11) / _local7);
};
};
_local26 = 0;
_local27 = 0;
while ((((_local27 < m_queryResultCount)) && ((_local26 < _arg3)))) {
_local18 = m_proxyPool[m_queryResults[_local27]];
_arg2[_local27] = _local18.userData;
_local27++;
_local26++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local26);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = _arg3.lowerBound.x;
_local5 = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
_local6 = _arg3.upperBound.x;
_local7 = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local5:uint;
var _local6:uint;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
_local5 = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
_local6 = (2 * m_proxyCount);
_local7 = new Array();
_local8 = new Array();
ComputeBounds(_local7, _local8, _arg1);
_local9 = 0;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
_local10 = 0;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local4:b2Proxy;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
_local4 = m_proxyPool[_arg1];
_local5 = (2 * m_proxyCount);
_local6 = 0;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
_local7 = 0;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local5:int;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
_local5 = 0;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local12:uint;
var _local13:b2Proxy;
var _local14:b2BoundValues;
var _local15:b2BoundValues;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
_local12 = (2 * m_proxyCount);
_local13 = m_proxyPool[_arg1];
_local14 = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
_local15 = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:b2Bound;
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 19
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//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 static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local6 = _arg1.m_vertexCount;
_local7 = _arg1.m_vertices;
_local8 = _arg1.m_normals;
_local9 = _arg4.m_vertexCount;
_local10 = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
_local13 = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
_local14 = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
_local15 = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
_local16 = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
_local20 = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local21 = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
_local22 = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local23 = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
_local24 = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.lowerBound;
_local4 = _arg1.upperBound;
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
_local7 = (_local3.x - _local4.x);
_local8 = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local7:int;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:ClipVertex;
var _local21:int;
var _local22:int;
var _local23:Number;
_local7 = _arg2.m_vertexCount;
_local8 = _arg2.m_normals;
_local9 = _arg5.m_vertexCount;
_local10 = _arg5.m_vertices;
_local11 = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
_local14 = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
_local15 = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
_local16 = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
_local21 = _local17;
_local22 = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local7:int;
var _local8:Array;
var _local9:Number;
var _local10:int;
var _local11:Array;
var _local12:Number;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local15:b2XForm;
var _local16:b2XForm;
var _local17:int;
var _local18:uint;
var _local19:Number;
var _local20:Number;
var _local21:Array;
var _local22:int;
var _local23:Array;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:b2Vec2;
var _local28:b2Vec2;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Array;
var _local33:Array;
var _local34:int;
var _local35:int;
var _local36:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
_local7 = 0;
_local8 = [_local7];
_local9 = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
_local10 = 0;
_local11 = [_local10];
_local12 = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
_local15 = new b2XForm();
_local16 = new b2XForm();
_local19 = 0.98;
_local20 = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
_local21 = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
_local22 = _local13.m_vertexCount;
_local23 = _local13.m_vertices;
_local24 = _local23[_local17];
_local25 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
_local26 = b2Math.SubtractVV(_local37, _local25);
_local27 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
_local28 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
_local29 = b2Math.b2Dot(_local28, _local25);
_local30 = -(b2Math.b2Dot(_local27, _local25));
_local31 = b2Math.b2Dot(_local27, _local37);
_local32 = [new ClipVertex(), new ClipVertex()];
_local33 = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
_local35 = 0;
_local36 = 0;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Number;
var _local16:int;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:int;
var _local21:Number;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
_local6 = _arg2.m_vertexCount;
_local7 = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
_local10 = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
_local11 = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
_local12 = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
_local13 = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
_local14 = 0;
_local15 = -(Number.MAX_VALUE);
_local16 = 0;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
_local18 = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
_local19 = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
_local20 = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
_local21 = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
_local10 = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2ManifoldPoint;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
_local8 = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local9 = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
_local10 = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local11 = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local14 = ((_local12 * _local12) + (_local13 * _local13));
_local15 = _arg2.m_radius;
_local16 = _arg4.m_radius;
_local17 = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
_local19 = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
_local20 = (0.5 * (_local8 + _local10));
_local21 = (0.5 * (_local9 + _local11));
_local22 = (_local20 - _arg3.position.x);
_local23 = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:Array;
var _local23:Array;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:b2Vec2;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
_local13 = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
_local14 = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
_local15 = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local16 = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local18 = 0;
_local19 = -(Number.MAX_VALUE);
_local20 = _arg4.m_radius;
_local21 = _arg2.m_vertexCount;
_local22 = _arg2.m_vertices;
_local23 = _arg2.m_normals;
_local24 = 0;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
_local25 = _local18;
_local26 = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
_local27 = _local22[_local26];
_local28 = (_local27.x - _local11.x);
_local29 = (_local27.y - _local11.y);
_local30 = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local31 = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = 0;
};
};
_local7 = (_local15 - _local32);
_local8 = (_local16 - _local33);
_local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local17);
_local8 = (_local8 / _local17);
if (_local17 > _local20){
return;
};
_arg1.pointCount = 1;
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8));
_arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8));
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local17 - _local20);
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 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(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID;
_local1 = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function get key():uint{
return (_key);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
}
}//package Box2D.Collision
Section 22
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2ContactPoint {
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 friction:Number;
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 {
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local4:Number;
var _local5:int;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (100 * Number.MIN_VALUE);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:Number;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
_local8 = s_p1s;
_local9 = s_p2s;
_local10 = s_points;
_local11 = 0;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
_local12 = 0;
_local13 = 20;
_local14 = 0;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - ((_local15 * _local19) + (_local16 * _local20))) <= (0.01 * _local12)){
if (_local11 == 0){
_arg1.SetV(_local17);
_arg2.SetV(_local18);
};
g_GJK_Iterations = _local14;
return (Math.sqrt(_local12));
};
switch (_local11){
case 0:
_local7 = _local8[0];
_local7.SetV(_local17);
_local7 = _local9[0];
_local7.SetV(_local18);
_local7 = _local10[0];
_local7.x = _local19;
_local7.y = _local20;
_arg1.SetV(_local8[0]);
_arg2.SetV(_local9[0]);
_local11++;
break;
case 1:
_local7 = _local8[1];
_local7.SetV(_local17);
_local7 = _local9[1];
_local7.SetV(_local18);
_local7 = _local10[1];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10);
break;
case 2:
_local7 = _local8[2];
_local7.SetV(_local17);
_local7 = _local9[2];
_local7.SetV(_local18);
_local7 = _local10[2];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10);
break;
};
if (_local11 == 3){
g_GJK_Iterations = _local14;
return (0);
};
_local22 = -(Number.MAX_VALUE);
_local23 = 0;
while (_local23 < _local11) {
_local7 = _local10[_local23];
_local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y)));
_local23++;
};
if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){
g_GJK_Iterations = _local14;
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local12 = ((_local15 * _local15) + (_local16 * _local16));
return (Math.sqrt(_local12));
};
_local14++;
};
g_GJK_Iterations = _local13;
return (Math.sqrt(_local12));
}
public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
_local9 = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local10 = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
_local11 = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local12 = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
_local16 = (_arg3.m_radius - b2Settings.b2_toiSlop);
_local17 = (_arg5.m_radius - b2Settings.b2_toiSlop);
_local18 = (_local16 + _local17);
if (_local15 > (_local18 * _local18)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_local20 = (_local19 - _local18);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = (_local11 - (_local17 * _local13));
_arg2.y = (_local12 - (_local17 * _local14));
return (_local20);
};
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
};
_arg1.x = _local9;
_arg1.y = _local10;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
}
public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local14:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
_local14 = _arg4[2];
_local15 = _local6.x;
_local16 = _local6.y;
_local17 = _local7.x;
_local18 = _local7.y;
_local19 = _local8.x;
_local20 = _local8.y;
_local21 = (_local17 - _local15);
_local22 = (_local18 - _local16);
_local23 = (_local19 - _local15);
_local24 = (_local20 - _local16);
_local25 = (_local19 - _local17);
_local26 = (_local20 - _local18);
_local27 = -(((_local15 * _local21) + (_local16 * _local22)));
_local28 = ((_local17 * _local21) + (_local18 * _local22));
_local29 = -(((_local15 * _local23) + (_local16 * _local24)));
_local30 = ((_local19 * _local23) + (_local20 * _local24));
_local31 = -(((_local17 * _local25) + (_local18 * _local26)));
_local32 = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
_local33 = ((_local21 * _local24) - (_local22 * _local23));
_local34 = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
_local36 = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
_local37 = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
_local38 = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
_local39 = (_local36 * _local38);
_local40 = (_local37 * _local38);
_local41 = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:b2Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local9 = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local10 = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
_local11 = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int;
var _local8:int;
_local7 = _arg3.m_type;
_local8 = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
_local12 = -(_local7.x);
_local13 = -(_local7.y);
_local14 = (_local6.x - _local7.x);
_local15 = (_local6.y - _local7.y);
_local16 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 24
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var points:Array;
public var pointCount:int;// = 0
public var normal:b2Vec2;
public function b2Manifold(){
var _local1:int;
pointCount = 0;
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
var _local2:int;
pointCount = _arg1.pointCount;
_local2 = 0;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
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(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 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 userData;// = null
public var proxyId1:uint;
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(){
userData = null;
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 PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
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_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_hashTable:Array;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint;
_local5 = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
_local3 = 0;
_local4 = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local4:uint;
var _local5:uint;
var _local6:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
_local4 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local5 = m_hashTable[_local4];
_local6 = null;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:b2Pair;
var _local5:uint;
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
_local5 = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint;
_local3 = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 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(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3: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 lowerBounds:Array;
public var upperBounds:Array;
public var userData;// = null
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
userData = null;
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 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(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local5 = _arg3.p1;
_local6 = (_arg3.p2.x - _local5.x);
_local7 = (_arg3.p2.y - _local5.y);
_local8 = (p2.x - p1.x);
_local9 = (p2.y - p1.y);
_local10 = _local9;
_local11 = -(_local8);
_local12 = (100 * Number.MIN_VALUE);
_local13 = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_local7) * _local15) + (_local7 * _local14));
if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){
_local16 = (_local16 / _local13);
_local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local18);
_local11 = (_local11 / _local18);
_arg1[0] = _local16;
_arg2.Set(_local10, _local11);
return (true);
};
};
};
return (false);
}
public function ExtendForward(_arg1:b2AABB):void{
var dX:Number;
var dY:Number;
var greaterthan0:*;
var lambda:Number;
var aabb = _arg1;
dX = (p2.x - p1.x);
dY = (p2.y - p1.y);
greaterthan0 = function (_arg1){
return ((_arg1 > 0));
};
lambda = Math.min(((dX > 0)) ? ((aabb.upperBound.x - p1.x) / dX) : ((dX < 0)) ? ((aabb.lowerBound.x - p1.x) / dX) : Number.POSITIVE_INFINITY, ((dY > 0)) ? ((aabb.upperBound.y - p1.y) / dY) : ((dY < 0)) ? ((aabb.lowerBound.y - p1.y) / dY) : Number.POSITIVE_INFINITY);
p2.x = (p1.x + (dX * lambda));
p2.y = (p1.y + (dY * lambda));
}
public function Extend(_arg1:b2AABB):void{
ExtendForward(_arg1);
ExtendBackward(_arg1);
}
public function ExtendBackward(_arg1:b2AABB):void{
var dX:Number;
var dY:Number;
var greaterthan0:*;
var lambda:Number;
var aabb = _arg1;
dX = (-(p2.x) + p1.x);
dY = (-(p2.y) + p1.y);
greaterthan0 = function (_arg1){
return ((_arg1 > 0));
};
lambda = Math.min(((dX > 0)) ? ((aabb.upperBound.x - p2.x) / dX) : ((dX < 0)) ? ((aabb.lowerBound.x - p2.x) / dX) : Number.POSITIVE_INFINITY, ((dY > 0)) ? ((aabb.upperBound.y - p2.y) / dY) : ((dY < 0)) ? ((aabb.lowerBound.y - p2.y) / dY) : Number.POSITIVE_INFINITY);
p1.x = (p2.x + (dX * lambda));
p1.y = (p2.y + (dY * lambda));
}
}
}//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 static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:int;
var _local20:int;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
_local7 = _arg1.m_sweepRadius;
_local8 = _arg3.m_sweepRadius;
_local9 = _arg2.t0;
_local10 = (_arg2.c.x - _arg2.c0.x);
_local11 = (_arg2.c.y - _arg2.c0.y);
_local12 = (_arg4.c.x - _arg4.c0.x);
_local13 = (_arg4.c.y - _arg4.c0.y);
_local14 = (_arg2.a - _arg2.a0);
_local15 = (_arg4.a - _arg4.a0);
_local16 = 0;
_local17 = s_p1;
_local18 = s_p2;
_local19 = 20;
_local20 = 0;
_local21 = 0;
_local22 = 0;
_local23 = 0;
_local24 = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 34
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var v:b2Vec2;
public var id:b2ContactID;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 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 get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 36
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function Set(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = col1.x;
_local3 = col2.x;
_local4 = col1.y;
_local5 = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = col1.x;
_local5 = col2.x;
_local6 = col1.y;
_local7 = col2.y;
_local8 = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 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 static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:*;
_local3 = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22;
_local2 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Mat22;
_local3 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
_local4 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
_local5 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 38
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2Sweep {
public var localCenter:b2Vec2;
public var c:b2Vec2;
public var a:Number;
public var c0:b2Vec2;
public var a0:Number;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
_local3 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 39
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2Vec2 {
public var x:Number;
public var y:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossVF(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function Normalize():Number{
var _local1:Number;
var _local2:Number;
_local1 = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function CrossFV(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 40
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2XForm {
public var R:b2Mat22;
public var position:b2Vec2;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 41
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _g:uint;// = 0
private var _b:uint;// = 0
private var _r:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = 0;
_g = 0;
_b = 0;
super();
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 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 = ((2 / 180) * b2_pi);
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = Math.PI;
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 = ((8 / 180) * b2_pi);
public static const USHRT_MAX:int = 0xFFFF;
public static const b2_maxLinearVelocity:Number = 200;
public static const b2_maxLinearCorrection:Number = 0.2;
public static const b2_toiSlop:Number = 0.04;
public static const b2_maxLinearVelocitySquared:Number = 40000;
public static function b2Assert(_arg1:Boolean):void{
var _local2:b2Vec2;
if (!_arg1){
_local2.x++;
};
}
}
}//package Box2D.Common
Section 43
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:b2ManifoldPoint;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifolds():Array{
return (null);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:int;
var _local4:b2Body;
var _local5:b2Body;
_local2 = m_manifoldCount;
Evaluate(_arg1);
_local3 = m_manifoldCount;
_local4 = m_shape1.m_body;
_local5 = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local1:int;
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
_local1 = 0;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:b2ContactRegister;
var _local6:Function;
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
_local3 = _arg1.m_shape1.m_type;
_local4 = _arg1.m_shape2.m_type;
_local5 = s_registers[_local3][_local4];
_local6 = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local4:int;
var _local5:int;
var _local6:b2ContactRegister;
var _local7:Function;
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
_local4 = _arg1.m_type;
_local5 = _arg2.m_type;
_local6 = s_registers[_local4][_local5];
_local7 = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var normal:b2Vec2;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
var _local1:int;
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//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 equalizedMass:Number;
public var tangentMass: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 47
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var next:b2ContactEdge;
public var other:b2Body;
public var contact:b2Contact;
public var prev:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 48
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 49
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2ContactResult {
public var normal:b2Vec2;
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 50
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local9:int;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
_local9 = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
_local2 = 0;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local19:int;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
_local19 = 0;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
_local1 = 0;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 51
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function GetManifolds():Array{
return (null);
}
override public function Evaluate(_arg1:b2ContactListener):void{
}
}
}//package Box2D.Dynamics.Contacts
Section 52
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local6:b2Body;
var _local7:b2Body;
var _local8:Array;
var _local9:b2ContactPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local6 = m_shape1.m_body;
_local7 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
_local8 = [false, false];
_local9 = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 53
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:int;
var _local9:Array;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
_local9 = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 54
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_mass:Number;
public var m_u:b2Vec2;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz:Number;
public var m_localAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
m_inv_dt = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (m_frequencyHz > 0){
return (true);
};
_local2 = m_body1;
_local3 = m_body2;
_local1 = _local2.m_xf.R;
_local4 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
_local7 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8));
_local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8));
_local7 = _local6;
_local9 = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
_local10 = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
_local11 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
_local12 = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local13 = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
_local14 = (_local13 * m_u.x);
_local15 = (_local13 * m_u.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
m_inv_dt = _arg1.inv_dt;
_local4 = m_body1;
_local5 = m_body2;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
_local10 = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
_local11 = ((_local6 * m_u.y) - (_local7 * m_u.x));
_local12 = ((_local8 * m_u.y) - (_local9 * m_u.x));
_local13 = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = (1 / _local13);
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17))));
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (1 / (_local13 + m_gamma));
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local3 = m_body1;
_local4 = m_body2;
_local2 = _local3.m_xf.R;
_local5 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
_local8 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
_local10 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
_local11 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
_local12 = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
_local13 = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
_local14 = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
_local15 = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
_local16 = (_local15 * m_u.x);
_local17 = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2DistanceJointDef extends b2JointDef {
public var length:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public var localAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public function b2DistanceJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
var _local5:Number;
var _local6:Number;
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
_local5 = (_arg4.x - _arg3.x);
_local6 = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 56
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic1:b2PrismaticJoint;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_ground2:b2Body;
public var m_constant:Number;
public var m_revolute1:b2RevoluteJoint;
public var m_revolute2:b2RevoluteJoint;
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_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
_local2 = _arg1.joint1.m_type;
_local3 = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_force = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = 0;
_local2 = m_body1;
_local3 = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
_local6 = (m_constant - (_local4 + (m_ratio * _local5)));
_local7 = (-(m_mass) * _local6);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((_local1 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local2 = m_ground1;
_local3 = m_ground2;
_local4 = m_body1;
_local5 = m_body2;
_local14 = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear1.Set(-(_local6), -(_local7));
m_J.angular1 = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angular2 = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = (1 / _local14);
if (_arg1.warmStarting){
_local15 = (_arg1.dt * m_force);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = m_body2.m_xf.R;
_local2 = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
_local3 = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
_local4 = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3));
_local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3));
_local2 = _local4;
_local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x))));
return (_local4);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local5 = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
_local6 = (_arg1.dt * _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 57
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2GearJointDef extends b2JointDef {
public var joint2:b2Joint;
public var joint1:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 58
//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 angular2:Number;
public var angular1:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 59
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2Joint {
public var m_islandFlag:Boolean;
public var m_body1:b2Body;
public var m_prev:b2Joint;
public var m_next:b2Joint;
public var m_type:int;
public var m_collideConnected:Boolean;
public var m_node1:b2JointEdge;
public var m_node2:b2JointEdge;
public var m_inv_dt:Number;
public var m_userData;
public var m_body2:b2Body;
public static const e_unknownJoint:int = 0;
public static const e_inactiveLimit:int = 0;
public static const e_atUpperLimit:int = 2;
public static const e_atLowerLimit:int = 1;
public static const e_gearJoint:int = 6;
public static const e_revoluteJoint:int = 1;
public static const e_equalLimits:int = 3;
public static const e_distanceJoint:int = 3;
public static const e_pulleyJoint:int = 4;
public static const e_prismaticJoint:int = 2;
public static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_node1 = new b2JointEdge();
m_node2 = new b2JointEdge();
super();
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_body1 = _arg1.body1;
m_body2 = _arg1.body2;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetType():int{
return (m_type);
}
public function GetBody2():b2Body{
return (m_body2);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetReactionTorque():Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce():b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
_local3 = null;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 60
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2JointDef {
public var collideConnected:Boolean;
public var body1:b2Body;
public var body2:b2Body;
public var userData;
public var type:int;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 61
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var joint:b2Joint;
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
}
}//package Box2D.Dynamics.Joints
Section 62
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
public var m_beta:Number;
public var m_mass:b2Mat22;
public var m_target:b2Vec2;
public var m_impulse:b2Vec2;
public var m_localAnchor:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K:b2Mat22;
public var m_gamma:Number;
public var m_C:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local2:Number;
var _local3:Number;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
_local2 = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
_local4 = m_body2.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
_local5 = m_body2.m_mass;
_local6 = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
_local7 = (((2 * _local5) * _arg1.dampingRatio) * _local6);
_local8 = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local7 = _local2.m_invMass;
_local8 = _local2.m_invI;
K1.col1.x = _local7;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local7;
K2.col1.x = ((_local8 * _local5) * _local5);
K2.col2.x = ((-(_local8) * _local4) * _local5);
K2.col1.y = ((-(_local8) * _local4) * _local5);
K2.col2.y = ((_local8 * _local4) * _local4);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
_local9 = (_arg1.dt * m_impulse.x);
_local10 = (_arg1.dt * m_impulse.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9))));
}
override public function GetReactionTorque():Number{
return (0);
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local6 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
_local8 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
_local9 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x));
_local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y));
_local10 = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
_local11 = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
_local12 = m_impulse.x;
_local13 = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
_local14 = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
_local15 = (_arg1.dt * _local10);
_local16 = (_arg1.dt * _local11);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
}
}
}//package Box2D.Dynamics.Joints
Section 63
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var frequencyHz:Number;
public var dampingRatio:Number;
public var maxForce:Number;
public var target:b2Vec2;
public var timeStep:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 64
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_refAngle:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_torque:Number;
public var m_enableLimit:Boolean;
public var m_motorForce:Number;
public var m_force:Number;
public var m_localYAxis1:b2Vec2;
public var m_motorMass:Number;
public var m_maxMotorForce:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_angularMass:Number;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_upperTranslation:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_linearJacobian:b2Jacobian;
public var m_enableMotor:Boolean;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_localXAxis1.SetV(_arg1.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_linearJacobian.SetZero();
m_linearMass = 0;
m_force = 0;
m_angularMass = 0;
m_torque = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function GetJointTranslation():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:b2Vec2;
var _local9:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = _local1.GetWorldPoint(m_localAnchor1);
_local5 = _local2.GetWorldPoint(m_localAnchor2);
_local6 = (_local5.x - _local4.x);
_local7 = (_local5.y - _local4.y);
_local8 = _local1.GetWorldVector(m_localXAxis1);
_local9 = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.m_xf.R;
_local2 = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
_local3 = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
_local4 = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
_local5 = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5))));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = _local3.m_invMass;
_local6 = _local4.m_invMass;
_local7 = _local3.m_invI;
_local8 = _local4.m_invI;
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local21 = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
_local22 = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
_local23 = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local24 = (-(m_linearMass) * _local23);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2));
_local25 = b2Math.b2Abs(_local23);
_local26 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local27 = (-(m_angularMass) * _local26);
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local28 = b2Math.b2Abs(_local26);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local31 = ((_local29 * _local19) + (_local30 * _local20));
_local32 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local31 - m_lowerTranslation);
_local25 = b2Math.b2Max(_local25, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local31 - m_upperTranslation);
_local25 = b2Math.b2Max(_local25, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local17:b2Vec2;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_xf.R;
_local4 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
_local7 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
_local9 = (_local1.m_sweep.c.x + _local4);
_local10 = (_local1.m_sweep.c.y + _local5);
_local11 = (_local2.m_sweep.c.x + _local7);
_local12 = (_local2.m_sweep.c.y + _local8);
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = _local1.GetWorldVector(m_localXAxis1);
_local16 = _local1.m_linearVelocity;
_local17 = _local2.m_linearVelocity;
_local18 = _local1.m_angularVelocity;
_local19 = _local2.m_angularVelocity;
_local20 = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
_local4 = _local2.m_xf.R;
_local14 = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
_local15 = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
_local16 = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
_local17 = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y);
m_linearJacobian.linear1.x = -(_local14);
m_linearJacobian.linear1.y = -(_local15);
m_linearJacobian.linear2.x = _local14;
m_linearJacobian.linear2.y = _local15;
m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14)));
m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14));
m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
_local4 = _local2.m_xf.R;
_local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y));
_local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local18);
m_motorJacobian.linear1.y = -(_local19);
m_motorJacobian.linear2.x = _local18;
m_motorJacobian.linear2.y = _local19;
m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18)));
m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18));
m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local20 = (_local16 - _local6);
_local21 = (_local17 - _local7);
_local22 = ((_local18 * _local20) + (_local19 * _local21));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local22 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local22 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit == false){
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
_local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
_local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
_local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
_local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
_local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28));
} else {
m_force = 0;
m_torque = 0;
m_limitForce = 0;
m_motorForce = 0;
};
m_limitPositionImpulse = 0;
}
public function GetMotorForce():Number{
return (m_motorForce);
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_invMass;
_local5 = _local3.m_invMass;
_local6 = _local2.m_invI;
_local7 = _local3.m_invI;
_local9 = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local10 = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
_local11 = (_arg1.dt * _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2));
_local12 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local13 = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
_local14 = (_arg1.dt * _local13);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15);
_local17 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce);
_local16 = (m_motorForce - _local17);
_local11 = (_arg1.dt * _local16);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local19);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
};
};
};
_local11 = (_arg1.dt * _local19);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
}
}
}//package Box2D.Dynamics.Joints
Section 65
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PrismaticJointDef extends b2JointDef {
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var maxMotorForce:Number;
public var motorSpeed:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var lowerTranslation:Number;
public function b2PrismaticJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
localAxis1 = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxis1.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
localAxis1 = body1.GetLocalVector(_arg4);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 66
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_limitForce1:Number;
public var m_maxLength1:Number;
public var m_limitState1:int;
public var m_limitState2:int;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_limitPositionImpulse1:Number;
public var m_constant: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_positionImpulse:Number;
public var m_limitMass2:Number;
public var m_limitMass1:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_u2:b2Vec2;
public var m_limitForce2:Number;
public static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_ratio = _arg1.ratio;
m_constant = (_arg1.length1 + (m_ratio * _arg1.length2));
m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local5 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local6 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local7 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local23 = 0;
if (m_state == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_pulleyMass) * _local18);
_local20 = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19));
_local19 = (m_positionImpulse - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.SynchronizeTransform();
_local2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local21 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local21);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local21 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local21);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.SynchronizeTransform();
};
return ((_local23 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
_local10 = (_local2.m_sweep.c.x + _local5);
_local11 = (_local2.m_sweep.c.y + _local6);
_local12 = (_local3.m_sweep.c.x + _local8);
_local13 = (_local3.m_sweep.c.y + _local9);
_local14 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local15 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local16 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local17 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
_local18 = m_u1.Length();
_local19 = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
_local20 = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
_local21 = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
_local22 = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
_local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
_local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
_local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
_local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
public function GetLength2():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body2.GetWorldPoint(m_localAnchor2);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18);
_local20 = m_force;
m_force = b2Math.b2Max(0, (m_force + _local19));
_local19 = (m_force - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x);
_local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18);
_local20 = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19));
_local19 = (m_limitForce1 - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18);
_local20 = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19));
_local19 = (m_limitForce2 - _local20);
_local16 = ((-(_arg1.dt) * _local19) * m_u2.x);
_local17 = ((-(_arg1.dt) * _local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.GetWorldPoint(m_localAnchor1);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 67
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength2:Number;
public var length1:Number;
public var length2:Number;
public var maxLength1:Number;
public var ratio:Number;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public function b2PulleyJointDef(){
groundAnchor1 = new b2Vec2();
groundAnchor2 = new b2Vec2();
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchor1.Set(-1, 1);
groundAnchor2.Set(1, 1);
localAnchor1.Set(-1, 0);
localAnchor2.Set(1, 0);
length1 = 0;
maxLength1 = 0;
length2 = 0;
maxLength2 = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
_local8 = (_arg5.x - _arg3.x);
_local9 = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local10 = (_arg6.x - _arg4.x);
_local11 = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
_local12 = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 68
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_motorForce:Number;
public var m_pivotMass:b2Mat22;
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_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_limitPositionImpulse:Number;
public var m_maxMotorTorque:Number;
public var m_referenceAngle:Number;
public var m_lowerAngle:Number;
public var m_upperAngle:Number;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_pivotForce = new b2Vec2();
m_pivotMass = new b2Mat22();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_referenceAngle = _arg1.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = 0;
_local6 = _local3.m_xf.R;
_local7 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
_local10 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11));
_local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11));
_local10 = _local9;
_local12 = (_local3.m_sweep.c.x + _local7);
_local13 = (_local3.m_sweep.c.y + _local8);
_local14 = (_local4.m_sweep.c.x + _local10);
_local15 = (_local4.m_sweep.c.y + _local11);
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
_local18 = _local3.m_invMass;
_local19 = _local4.m_invMass;
_local20 = _local3.m_invI;
_local21 = _local4.m_invI;
K1.col1.x = (_local18 + _local19);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local18 + _local19);
K2.col1.x = ((_local20 * _local8) * _local8);
K2.col2.x = ((-(_local20) * _local7) * _local8);
K2.col1.y = ((-(_local20) * _local7) * _local8);
K2.col2.y = ((_local20 * _local7) * _local7);
K3.col1.x = ((_local21 * _local11) * _local11);
K3.col2.x = ((-(_local21) * _local10) * _local11);
K3.col1.y = ((-(_local21) * _local10) * _local11);
K3.col2.y = ((_local21 * _local10) * _local10);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
_local22 = tImpulse.x;
_local23 = tImpulse.y;
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local24 = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local24 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local25 - m_lowerAngle);
_local24 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local25 - m_upperAngle);
_local24 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
K1.col1.x = (_local10 + _local11);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local10 + _local11);
K2.col1.x = ((_local12 * _local7) * _local7);
K2.col2.x = ((-(_local12) * _local6) * _local7);
K2.col1.y = ((-(_local12) * _local6) * _local7);
K2.col2.y = ((_local12 * _local6) * _local6);
K3.col1.x = ((_local13 * _local9) * _local9);
K3.col2.x = ((-(_local13) * _local8) * _local9);
K3.col1.y = ((-(_local13) * _local8) * _local9);
K3.col2.y = ((_local13 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
} else {
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local11 = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
_local12 = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
_local13 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
_local14 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12)));
m_pivotForce.x = (m_pivotForce.x + _local13);
m_pivotForce.y = (m_pivotForce.y + _local14);
_local15 = (_arg1.dt * _local13);
_local16 = (_arg1.dt * _local14);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17);
_local19 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque);
_local18 = (m_motorForce - _local19);
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local21);
} else {
if (m_limitState == e_atLowerLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
} else {
if (m_limitState == e_atUpperLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21));
};
}
}
}//package Box2D.Dynamics.Joints
Section 69
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2RevoluteJointDef extends b2JointDef {
public var referenceAngle:Number;
public var upperAngle:Number;
public var lowerAngle:Number;
public var motorSpeed:Number;
public var maxMotorTorque:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public function b2RevoluteJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchor1.Set(0, 0);
localAnchor2.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 70
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
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_xf:b2XForm;
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_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_shapeCount:int;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
var _local3:b2Mat22;
var _local4:b2Vec2;
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
var _local1:b2Mat22;
var _local2:b2Vec2;
m_xf.R.Set(m_sweep.a);
_local1 = m_xf.R;
_local2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
var _local2:Number;
var _local3:Number;
var _local4:b2MassData;
var _local5:b2Mat22;
var _local6:b2Vec2;
var _local7:int;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
_local2 = 0;
_local3 = 0;
_local4 = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
_local5 = m_xf.R;
_local6 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
_local7 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local4:b2Mat22;
var _local5:b2Vec2;
var _local6:Boolean;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
_local4 = m_xf.R;
_local5 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
_local6 = false;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local1:b2XForm;
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:b2Shape;
var _local5:Boolean;
_local1 = s_xf1;
_local1.R.Set(m_sweep.a0);
_local2 = _local1.R;
_local3 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
_local5 = true;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
_local5 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge;
_local2 = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
var _local2:b2Shape;
var _local3:Boolean;
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
_local2 = m_shapeList;
_local3 = false;
while (_local2 != null) {
if (_local2 == _arg1){
_local2 = _arg1.m_next;
_local3 = true;
break;
};
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 71
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2BodyDef {
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var angularDamping:Number;
public var fixedRotation:Boolean;
public var angle:Number;
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 72
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 73
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function RayCollide(_arg1, _arg2:b2Shape):Boolean{
if (!_arg1){
return (true);
};
return (ShouldCollide((_arg1 as b2Shape), _arg2));
}
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData;
var _local4:b2FilterData;
var _local5:Boolean;
_local3 = _arg1.GetFilterData();
_local4 = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
_local5 = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 74
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 75
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Contact;
_local3 = (_arg1 as b2Shape);
_local4 = (_arg2 as b2Shape);
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
_local7 = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
var _local4:b2Contact;
if (_arg3 == null){
return;
};
_local4 = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:int;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
_local2 = _arg1.m_shape1;
_local3 = _arg1.m_shape2;
_local4 = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_shape1;
_local10.friction = _arg1.m_friction;
_local10.restitution = _arg1.m_restitution;
_local11 = 0;
while (_local11 < _local4) {
_local12 = _local9[_local11];
_local10.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local10.position = _local7.GetWorldPoint(_local14.localPoint1);
_local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1);
_local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2);
_local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y));
_local10.separation = _local14.separation;
_local10.id.key = _local14.id._key;
m_world.m_contactListener.Remove(_local10);
_local13++;
};
_local11++;
};
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
_local5 = _local2.m_body;
_local6 = _local3.m_body;
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local5.m_contactList){
_local5.m_contactList = _arg1.m_node1.next;
};
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local6.m_contactList){
_local6.m_contactList = _arg1.m_node2.next;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
public function Collide():void{
var _local1:b2Contact;
var _local2:b2Body;
var _local3:b2Body;
_local1 = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 76
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import flash.display.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_lineThickness:Number;// = 1
public var m_drawFlags:uint;
public var m_sprite:Sprite;
public var m_drawScale:Number;// = 1
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawScale = 1;
m_lineThickness = 1;
m_alpha = 1;
m_fillAlpha = 1;
m_xformScale = 1;
super();
m_drawFlags = 0;
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 77
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
public class b2DestructionListener {
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
}
}//package Box2D.Dynamics
Section 78
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_joints:Array;
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:int;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
_local4 = 0;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local8:b2ContactSolver;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
_local8 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local3:b2ContactSolver;
var _local4:Number;
var _local5:b2Body;
var _local6:Boolean;
_local3 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
_local4 = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 79
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 80
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_raycastSegment:b2Segment;
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_raycastUserData;
public var m_allowSleep:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_raycastNormal:b2Vec2;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_debugDraw:b2DebugDraw;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
var _local4:b2BodyDef;
m_raycastNormal = new b2Vec2();
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
_local4 = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2XForm;
var _local5:b2XForm;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
_local2 = _arg1.m_body1;
_local3 = _arg1.m_body2;
_local4 = _local2.m_xf;
_local5 = _local3.m_xf;
_local6 = _local4.position;
_local7 = _local5.position;
_local8 = _arg1.GetAnchor1();
_local9 = _arg1.GetAnchor2();
_local10 = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local1:uint;
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2XForm;
var _local12:b2AABB;
var _local13:b2AABB;
var _local14:Array;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
_local1 = m_debugDraw.GetFlags();
_local7 = new b2Vec2();
_local8 = new b2Vec2();
_local9 = new b2Vec2();
_local10 = new b2Color(0, 0, 0);
_local12 = new b2AABB();
_local13 = new b2AABB();
_local14 = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15);
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local5 = m_jointList;
while (_local5) {
DrawJoint(_local5);
_local5 = _local5.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local6 = m_broadPhase;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.9, 0.3);
_local2 = 0;
while (_local2 < b2Pair.b2_tableCapacity) {
_local16 = _local6.m_pairManager.m_hashTable[_local2];
while (_local16 != b2Pair.b2_nullPair) {
_local17 = _local6.m_pairManager.m_pairs[_local16];
_local18 = _local6.m_proxyPool[_local17.proxyId1];
_local19 = _local6.m_proxyPool[_local17.proxyId2];
_local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value));
_local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value));
_local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value));
_local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value));
_local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value));
_local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value));
_local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value));
_local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value));
_local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x));
_local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y));
_local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x));
_local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y));
m_debugDraw.DrawSegment(_local8, _local9, _local10);
_local16 = _local17.next;
};
_local2++;
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local6 = m_broadPhase;
_local20 = _local6.m_worldAABB.lowerBound;
_local21 = _local6.m_worldAABB.upperBound;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.3, 0.9);
_local2 = 0;
while (_local2 < b2Settings.b2_maxProxies) {
_local22 = _local6.m_proxyPool[_local2];
if (_local22.IsValid() == false){
} else {
_local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value));
_local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value));
_local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value));
_local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value));
_local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y);
_local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y);
_local14[2].Set(_local12.upperBound.x, _local12.upperBound.y);
_local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local2++;
};
_local14[0].Set(_local20.x, _local20.y);
_local14[1].Set(_local21.x, _local20.y);
_local14[2].Set(_local21.x, _local21.y);
_local14[3].Set(_local20.x, _local21.y);
m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((_local1 & b2DebugDraw.e_obbBit)){
_local10.Set(0.5, 0.3, 0.5);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local4.m_type != b2Shape.e_polygonShape){
} else {
_local23 = (_local4 as b2PolygonShape);
_local24 = _local23.GetOBB();
_local25 = _local24.extents;
_local14[0].Set(-(_local25.x), -(_local25.y));
_local14[1].Set(_local25.x, -(_local25.y));
_local14[2].Set(_local25.x, _local25.y);
_local14[3].Set(-(_local25.x), _local25.y);
_local2 = 0;
while (_local2 < 4) {
_local26 = _local24.R;
_local27 = _local14[_local2];
_local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local26 = _local11.R;
_local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local2++;
};
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawXForm(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local2:b2JointEdge;
var _local3:b2Shape;
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
_local2 = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
_local3 = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local5:b2Color;
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
_local5 = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Island;
var _local4:b2Contact;
var _local5:b2Joint;
var _local6:int;
var _local7:Array;
var _local8:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
_local3 = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
_local4 = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
_local5 = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
_local6 = m_bodyCount;
_local7 = new Array(_local6);
_local8 = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array;
var _local5:int;
var _local6:int;
_local4 = new Array(_arg3);
_local5 = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
_local6 = 0;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function GetContactCount():int{
return (m_contactCount);
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local8:b2Island;
var _local9:int;
var _local10:Array;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
_local8 = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
_local9 = m_bodyCount;
_local10 = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
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(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local2:b2Joint;
var _local3:b2Body;
var _local4:b2Shape;
_local2 = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local2:Boolean;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:b2Shape;
_local2 = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
_local3 = _arg1.m_body1;
_local4 = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function Raycast(_arg1:b2Segment, _arg2:Array, _arg3:int, _arg4:Boolean, _arg5):int{
var _local6:Array;
var _local7:int;
var _local8:int;
_local6 = new Array(_arg3);
m_raycastSegment = _arg1;
m_raycastUserData = _arg5;
if (_arg4){
_local7 = m_broadPhase.QuerySegment(_arg1, _local6, _arg3, RaycastSortKey);
} else {
_local7 = m_broadPhase.QuerySegment(_arg1, _local6, _arg3, RaycastSortKey2);
};
_local8 = 0;
while (_local8 < _local7) {
_arg2[_local8] = _local6[_local8];
_local8++;
};
return (_local7);
}
public function RaycastSortKey2(_arg1:b2Shape){
var _local2:b2Body;
var _local3:b2XForm;
var _local4:Array;
if (((m_contactFilter) && (!(m_contactFilter.RayCollide(m_raycastUserData, _arg1))))){
return (-1);
};
_local2 = _arg1.GetBody();
_local3 = _local2.GetXForm();
_local4 = [0];
if (_arg1.TestSegment(_local3, _local4, m_raycastNormal, m_raycastSegment, 1) != b2Shape.e_hitCollide){
return (-1);
};
return (_local4[0]);
}
public function RaycastOne(_arg1:b2Segment, _arg2:Array, _arg3:b2Vec2, _arg4:Boolean, _arg5):b2Shape{
var _local6:Array;
var _local7:Number;
var _local8:b2Shape;
var _local9:b2XForm;
_local6 = new Array(1);
_local7 = Raycast(_arg1, _local6, 1, _arg4, _arg5);
if (_local7 == 0){
return (null);
};
if (_local7 > 1){
trace(_local7);
};
_local8 = _local6[0];
_local9 = _local8.GetBody().GetXForm();
_local8.TestSegment(_local9, _arg2, _arg3, _arg1, 1);
return (_local8);
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
var _local2:b2Body;
if (m_lock == true){
return (null);
};
_local2 = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function RaycastSortKey(_arg1:b2Shape){
var _local2:b2Body;
var _local3:b2XForm;
var _local4:Array;
if (((m_contactFilter) && (!(m_contactFilter.RayCollide(m_raycastUserData, _arg1))))){
return (-1);
};
_local2 = _arg1.GetBody();
_local3 = _local2.GetXForm();
_local4 = [0];
if (_arg1.TestSegment(_local3, _local4, m_raycastNormal, m_raycastSegment, 1) == b2Shape.e_missCollide){
return (-1);
};
return (_local4[0]);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
var _local3:b2TimeStep;
m_lock = true;
_local3 = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 81
//MusicManager (com.tanoku.sonido.MusicManager)
package com.tanoku.sonido {
import flash.media.*;
import gs.*;
import flash.utils.*;
import flash.net.*;
public class MusicManager {
private var _soundsDict:Dictionary;
private var _sounds:Array;
public var Activo:Boolean;// = true
private static var _instance:MusicManager;
private static var _allowInstance:Boolean;
public function MusicManager(){
Activo = true;
super();
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!MusicManager._allowInstance){
throw (new Error("Error: Use MusicManager.getInstance() instead of the new keyword."));
};
}
public function fadeSound(_arg1:String, _arg2:Number=0, _arg3:Number=1):void{
var _local4:SoundChannel;
_local4 = this._soundsDict[_arg1].channel;
TweenLite.to(_local4, _arg3, {volume:_arg2});
}
public function get sounds():Array{
return (this._sounds);
}
public function Mute():void{
Activo = !(Activo);
if (Activo){
} else {
stopAllSounds();
};
}
public function getSoundDuration(_arg1:String):Number{
return (this._soundsDict[_arg1].sound.length);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object;
var _local4:SoundTransform;
_local3 = this._soundsDict[_arg1];
_local4 = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundVolume(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.soundTransform.volume);
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
var _local4:Object;
var _local5:Sound;
_local3 = 0;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
_local4 = new Object();
_local5 = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public function isSoundPaused(_arg1:String):Boolean{
return (this._soundsDict[_arg1].paused);
}
public function removeAllSounds():void{
var _local1:int;
_local1 = 0;
while (_local1 < this._sounds.length) {
this._sounds[_local1] = null;
_local1++;
};
this._sounds = new Array();
this._soundsDict = new Dictionary(true);
}
public function getSoundPosition(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.position);
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function removeSound(_arg1:String):void{
var _local2:int;
_local2 = 0;
while (_local2 < this._sounds.length) {
if (this._sounds[_local2].name == _arg1){
this._sounds[_local2] = null;
this._sounds.splice(_local2, 1);
};
_local2++;
};
delete this._soundsDict[_arg1];
}
public function muteAllSounds():void{
var _local1:int;
var _local2:String;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function pauseAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.pauseSound(_local3);
};
} else {
this.pauseSound(_local3);
};
_local2++;
};
}
public function playAllSounds(_arg1:Boolean=false):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (this._soundsDict[_local3].pausedByAll){
this._soundsDict[_local3].pausedByAll = false;
this.playSound(_local3);
};
} else {
this.playSound(_local3);
};
_local2++;
};
}
public function addExternalSound(_arg1:String, _arg2:String, _arg3:Number=1000, _arg4:Boolean=false):Boolean{
var _local5:int;
var _local6:Object;
var _local7:Sound;
_local5 = 0;
while (_local5 < this._sounds.length) {
if (this._sounds[_local5].name == _arg2){
return (false);
};
_local5++;
};
_local6 = new Object();
_local7 = new Sound(new URLRequest(_arg1), new SoundLoaderContext(_arg3, _arg4));
_local6.name = _arg2;
_local6.sound = _local7;
_local6.channel = new SoundChannel();
_local6.position = 0;
_local6.paused = true;
_local6.volume = 1;
_local6.startTime = 0;
_local6.loops = 0;
_local6.pausedByAll = false;
this._soundsDict[_arg2] = _local6;
this._sounds.push(_local6);
return (true);
}
public function unmuteAllSounds():void{
var _local1:int;
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = _local3.volume;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function isSoundPausedByAll(_arg1:String):Boolean{
return (this._soundsDict[_arg1].pausedByAll);
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function pauseSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.position = _local2.channel.position;
_local2.channel.stop();
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object;
_local5 = this._soundsDict[_arg1];
_local5.volume = _arg2;
if (Activo){
_local5.volume = _arg2;
} else {
_local5.volume = 0;
};
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_local5.position, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
}
public static function getInstance():MusicManager{
if (MusicManager._instance == null){
MusicManager._allowInstance = true;
MusicManager._instance = new (MusicManager);
MusicManager._allowInstance = false;
};
return (MusicManager._instance);
}
}
}//package com.tanoku.sonido
Section 82
//SoundManager (com.tanoku.sonido.SoundManager)
package com.tanoku.sonido {
import flash.media.*;
import gs.*;
import flash.utils.*;
import flash.net.*;
public class SoundManager {
private var _soundsDict:Dictionary;
private var _sounds:Array;
public var Activo:Boolean;// = true
private static var _instance:SoundManager;
private static var _allowInstance:Boolean;
public function SoundManager(){
Activo = true;
super();
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!SoundManager._allowInstance){
throw (new Error("Error: Use SoundManager.getInstance() instead of the new keyword."));
};
}
public function fadeSound(_arg1:String, _arg2:Number=0, _arg3:Number=1):void{
var _local4:SoundChannel;
_local4 = this._soundsDict[_arg1].channel;
TweenLite.to(_local4, _arg3, {volume:_arg2});
}
public function get sounds():Array{
return (this._sounds);
}
public function Mute():void{
Activo = !(Activo);
if (Activo){
unmuteAllSounds();
} else {
muteAllSounds();
};
}
public function getSoundDuration(_arg1:String):Number{
return (this._soundsDict[_arg1].sound.length);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object;
var _local4:SoundTransform;
_local3 = this._soundsDict[_arg1];
_local4 = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundVolume(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.soundTransform.volume);
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
var _local4:Object;
var _local5:Sound;
_local3 = 0;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
_local4 = new Object();
_local5 = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public function isSoundPaused(_arg1:String):Boolean{
return (this._soundsDict[_arg1].paused);
}
public function removeAllSounds():void{
var _local1:int;
_local1 = 0;
while (_local1 < this._sounds.length) {
this._sounds[_local1] = null;
_local1++;
};
this._sounds = new Array();
this._soundsDict = new Dictionary(true);
}
public function getSoundPosition(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.position);
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function removeSound(_arg1:String):void{
var _local2:int;
_local2 = 0;
while (_local2 < this._sounds.length) {
if (this._sounds[_local2].name == _arg1){
this._sounds[_local2] = null;
this._sounds.splice(_local2, 1);
};
_local2++;
};
delete this._soundsDict[_arg1];
}
public function muteAllSounds():void{
var _local1:int;
var _local2:String;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function pauseAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.pauseSound(_local3);
};
} else {
this.pauseSound(_local3);
};
_local2++;
};
}
public function playAllSounds(_arg1:Boolean=false):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (this._soundsDict[_local3].pausedByAll){
this._soundsDict[_local3].pausedByAll = false;
this.playSound(_local3);
};
} else {
this.playSound(_local3);
};
_local2++;
};
}
public function addExternalSound(_arg1:String, _arg2:String, _arg3:Number=1000, _arg4:Boolean=false):Boolean{
var _local5:int;
var _local6:Object;
var _local7:Sound;
_local5 = 0;
while (_local5 < this._sounds.length) {
if (this._sounds[_local5].name == _arg2){
return (false);
};
_local5++;
};
_local6 = new Object();
_local7 = new Sound(new URLRequest(_arg1), new SoundLoaderContext(_arg3, _arg4));
_local6.name = _arg2;
_local6.sound = _local7;
_local6.channel = new SoundChannel();
_local6.position = 0;
_local6.paused = true;
_local6.volume = 1;
_local6.startTime = 0;
_local6.loops = 0;
_local6.pausedByAll = false;
this._soundsDict[_arg2] = _local6;
this._sounds.push(_local6);
return (true);
}
public function unmuteAllSounds():void{
var _local1:int;
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = 1;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function isSoundPausedByAll(_arg1:String):Boolean{
return (this._soundsDict[_arg1].pausedByAll);
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function pauseSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.position = _local2.channel.position;
_local2.channel.stop();
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object;
_local5 = this._soundsDict[_arg1];
if (Activo){
_local5.volume = _arg2;
} else {
_local5.volume = 0;
};
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_local5.position, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
}
public static function getInstance():SoundManager{
if (SoundManager._instance == null){
SoundManager._allowInstance = true;
SoundManager._instance = new (SoundManager);
SoundManager._allowInstance = false;
};
return (SoundManager._instance);
}
}
}//package com.tanoku.sonido
Section 83
//Coordenadas (com.tanoku.utilidades.Coordenadas)
package com.tanoku.utilidades {
import flash.display.*;
import flash.geom.*;
public class Coordenadas {
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.utilidades
Section 84
//Matematicas (com.tanoku.utilidades.Matematicas)
package com.tanoku.utilidades {
import flash.geom.*;
public class Matematicas {
public static function gradosDesdeRadianes(_arg1:Number):Number{
var _local2:Number;
_local2 = ((180 / Math.PI) * _arg1);
return (_local2);
}
public static function radianesDesdeGrados(_arg1:Number):Number{
var _local2:Number;
_local2 = ((Math.PI / 180) * _arg1);
return (_local2);
}
public static function anguloEntrePuntos(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
return (-(Math.atan2(_local3, _local4)));
}
}
}//package com.tanoku.utilidades
Section 85
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.system.*;
import flash.net.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
var _local2:String;
var _local3:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
_local2 = "http://server.cpmstar.com/adviewas3.swf";
_local3 = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 86
//BaseScrollPane (fl.containers.BaseScrollPane)
package fl.containers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import fl.events.*;
public class BaseScrollPane extends UIComponent {
protected var defaultLineScrollSize:Number;// = 4
protected var _maxHorizontalScrollPosition:Number;// = 0
protected var vScrollBar:Boolean;
protected var disabledOverlay:Shape;
protected var hScrollBar:Boolean;
protected var availableWidth:Number;
protected var _verticalPageScrollSize:Number;// = 0
protected var vOffset:Number;// = 0
protected var _verticalScrollBar:ScrollBar;
protected var useFixedHorizontalScrolling:Boolean;// = false
protected var contentWidth:Number;// = 0
protected var contentHeight:Number;// = 0
protected var _horizontalPageScrollSize:Number;// = 0
protected var background:DisplayObject;
protected var _useBitmpScrolling:Boolean;// = false
protected var contentPadding:Number;// = 0
protected var availableHeight:Number;
protected var _horizontalScrollBar:ScrollBar;
protected var contentScrollRect:Rectangle;
protected var _horizontalScrollPolicy:String;
protected var _verticalScrollPolicy:String;
protected static const SCROLL_BAR_STYLES:Object = {upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {repeatDelay:500, repeatInterval:35, skin:"ScrollPane_upSkin", contentPadding:0, disabledAlpha:0.5};
public function BaseScrollPane(){
contentWidth = 0;
contentHeight = 0;
contentPadding = 0;
vOffset = 0;
_maxHorizontalScrollPosition = 0;
_horizontalPageScrollSize = 0;
_verticalPageScrollSize = 0;
defaultLineScrollSize = 4;
useFixedHorizontalScrolling = false;
_useBitmpScrolling = false;
super();
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize));
setVerticalScrollPosition(_verticalScrollBar.scrollPosition);
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition));
}
public function get verticalScrollPosition():Number{
return (_verticalScrollBar.scrollPosition);
}
protected function drawDisabledOverlay():void{
if (enabled){
if (contains(disabledOverlay)){
removeChild(disabledOverlay);
};
} else {
disabledOverlay.x = (disabledOverlay.y = contentPadding);
disabledOverlay.width = availableWidth;
disabledOverlay.height = availableHeight;
disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number);
addChild(disabledOverlay);
};
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
_verticalScrollBar.scrollPosition = _arg1;
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
}
protected function setContentSize(_arg1:Number, _arg2:Number):void{
if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){
return;
};
contentWidth = _arg1;
contentHeight = _arg2;
invalidate(InvalidationType.SIZE);
}
public function get horizontalScrollPosition():Number{
return (_horizontalScrollBar.scrollPosition);
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
_verticalScrollBar.enabled = _arg1;
_horizontalScrollBar.enabled = _arg1;
super.enabled = _arg1;
}
public function get verticalLineScrollSize():Number{
return (_verticalScrollBar.lineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
protected function calculateAvailableSize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ScrollBar.WIDTH;
_local2 = (contentPadding = Number(getStyleValue("contentPadding")));
_local3 = ((height - (2 * _local2)) - vOffset);
vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3)))));
_local4 = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2));
_local5 = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4);
hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0)))));
if (hScrollBar){
_local3 = (_local3 - _local1);
};
if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){
vScrollBar = true;
_local4 = (_local4 - _local1);
};
availableHeight = (_local3 + vOffset);
availableWidth = _local4;
}
public function get maxVerticalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentHeight - availableHeight)));
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
_horizontalScrollBar.scrollPosition = _arg1;
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
}
public function get horizontalLineScrollSize():Number{
return (_horizontalScrollBar.lineScrollSize);
}
public function set verticalPageScrollSize(_arg1:Number):void{
_verticalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function get useBitmapScrolling():Boolean{
return (_useBitmpScrolling);
}
protected function handleScroll(_arg1:ScrollEvent):void{
if (_arg1.target == _verticalScrollBar){
setVerticalScrollPosition(_arg1.position);
} else {
setHorizontalScrollPosition(_arg1.position);
};
}
public function set verticalLineScrollSize(_arg1:Number):void{
_verticalScrollBar.lineScrollSize = _arg1;
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function set horizontalPageScrollSize(_arg1:Number):void{
_horizontalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){
drawLayout();
};
updateChildren();
super.draw();
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function configUI():void{
var _local1:Graphics;
super.configUI();
contentScrollRect = new Rectangle(0, 0, 85, 85);
_verticalScrollBar = new ScrollBar();
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_verticalScrollBar.visible = false;
_verticalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_verticalScrollBar);
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar = new ScrollBar();
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_horizontalScrollBar.visible = false;
_horizontalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_horizontalScrollBar);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
disabledOverlay = new Shape();
_local1 = disabledOverlay.graphics;
_local1.beginFill(0xFFFFFF);
_local1.drawRect(0, 0, width, height);
_local1.endFill();
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function calculateContentWidth():void{
}
public function get verticalPageScrollSize():Number{
if (isNaN(availableHeight)){
drawNow();
};
return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize);
}
protected function drawLayout():void{
calculateAvailableSize();
calculateContentWidth();
background.width = width;
background.height = height;
if (vScrollBar){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding);
_verticalScrollBar.y = contentPadding;
_verticalScrollBar.height = availableHeight;
} else {
_verticalScrollBar.visible = false;
};
_verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
if (hScrollBar){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.x = contentPadding;
_horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding);
_horizontalScrollBar.width = availableWidth;
} else {
_horizontalScrollBar.visible = false;
};
_horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
drawDisabledOverlay();
}
protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue("skin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function set horizontalLineScrollSize(_arg1:Number):void{
_horizontalScrollBar.lineScrollSize = _arg1;
}
public function get horizontalPageScrollSize():Number{
if (isNaN(availableWidth)){
drawNow();
};
return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize);
}
public function get maxHorizontalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentWidth - availableWidth)));
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function updateChildren():void{
_verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled);
_verticalScrollBar.drawNow();
_horizontalScrollBar.drawNow();
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set useBitmapScrolling(_arg1:Boolean):void{
_useBitmpScrolling = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.containers
Section 87
//UILoader (fl.containers.UILoader)
package fl.containers {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class UILoader extends UIComponent {
protected var loader:Loader;
protected var _autoLoad:Boolean;// = true
protected var _source:Object;
protected var contentClip:Sprite;
protected var _maintainAspectRatio:Boolean;// = true
protected var contentInited:Boolean;// = false
protected var _scaleContent:Boolean;// = true
private static var defaultStyles:Object = {};
public function UILoader(){
_scaleContent = true;
_autoLoad = true;
contentInited = false;
_maintainAspectRatio = true;
super();
}
public function get maintainAspectRatio():Boolean{
return (_maintainAspectRatio);
}
public function set maintainAspectRatio(_arg1:Boolean):void{
_maintainAspectRatio = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get source():Object{
return (_source);
}
protected function _unload(_arg1:Boolean=false):void{
var throwError = _arg1;
if (loader != null){
clearLoadEvents();
contentClip.removeChild(loader);
try {
loader.close();
} catch(e:Error) {
};
try {
loader.unload();
} catch(e) {
if (throwError){
throw (e);
};
};
loader = null;
return;
};
contentInited = false;
if (contentClip.numChildren){
contentClip.removeChildAt(0);
};
}
public function get bytesLoaded():uint{
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesLoaded);
}
public function set source(_arg1:Object):void{
if (_arg1 == ""){
return;
};
_source = _arg1;
_unload();
if (((_autoLoad) && (!((_source == null))))){
load();
};
}
public function set autoLoad(_arg1:Boolean):void{
_autoLoad = _arg1;
if (((((((_autoLoad) && ((loader == null)))) && (!((_source == null))))) && (!((_source == ""))))){
load();
};
}
public function get content():DisplayObject{
if (loader != null){
return (loader.content);
};
if (contentClip.numChildren){
return (contentClip.getChildAt(0));
};
return (null);
}
public function get percentLoaded():Number{
return (((bytesTotal)<=0) ? 0 : ((bytesLoaded / bytesTotal) * 100));
}
protected function handleError(_arg1:Event):void{
passEvent(_arg1);
clearLoadEvents();
loader.contentLoaderInfo.removeEventListener(Event.INIT, handleInit);
}
public function load(_arg1:URLRequest=null, _arg2:LoaderContext=null):void{
var _local3:DisplayObject;
_unload();
if ((((((_arg1 == null)) || ((_arg1.url == null)))) && ((((_source == null)) || ((_source == "")))))){
return;
};
_local3 = getDisplayObjectInstance(source);
if (_local3 != null){
contentClip.addChild(_local3);
contentInited = true;
invalidate(InvalidationType.SIZE);
return;
};
if (_arg1 == null){
_arg1 = new URLRequest(_source.toString());
};
if (_arg2 == null){
_arg2 = new LoaderContext(false, ApplicationDomain.currentDomain);
};
initLoader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleError, false, 0, true);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.OPEN, passEvent, false, 0, true);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, passEvent, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.INIT, handleInit, false, 0, true);
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, passEvent, false, 0, true);
loader.load(_arg1, _arg2);
}
public function unload():void{
_source = null;
_unload(true);
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
public function loadBytes(_arg1:ByteArray, _arg2:LoaderContext=null):void{
var bytes = _arg1;
var context = _arg2;
_unload();
initLoader();
try {
loader.loadBytes(bytes, context);
} catch(error) {
throw (error);
};
}
public function get autoLoad():Boolean{
return (_autoLoad);
}
protected function sizeContent(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local6 = _arg4;
_local7 = _arg5;
if (_maintainAspectRatio){
_local8 = (_arg4 / _arg5);
_local9 = (_arg2 / _arg3);
if (_local8 < _local9){
_local7 = (_local6 / _local9);
} else {
_local6 = (_local7 * _local9);
};
};
_arg1.width = _local6;
_arg1.height = _local7;
_arg1.x = ((_arg4 / 2) - (_local6 / 2));
_arg1.y = ((_arg5 / 2) - (_local7 / 2));
}
protected function initLoader():void{
loader = new Loader();
contentClip.addChild(loader);
}
override protected function draw():void{
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
override protected function configUI():void{
super.configUI();
contentClip = new Sprite();
addChild(contentClip);
}
protected function handleInit(_arg1:Event):void{
loader.contentLoaderInfo.removeEventListener(Event.INIT, handleInit);
contentInited = true;
passEvent(_arg1);
invalidate(InvalidationType.SIZE);
}
protected function handleComplete(_arg1:Event):void{
clearLoadEvents();
passEvent(_arg1);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (((!(_scaleContent)) && ((_width > 0)))){
return;
};
super.setSize(_arg1, _arg2);
}
protected function drawLayout():void{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:LoaderInfo;
if (!contentInited){
return;
};
_local1 = false;
if (loader){
_local6 = loader.contentLoaderInfo;
_local2 = _local6.width;
_local3 = _local6.height;
} else {
_local2 = contentClip.width;
_local3 = contentClip.height;
};
_local4 = _width;
_local5 = _height;
if (!_scaleContent){
_width = contentClip.width;
_height = contentClip.height;
} else {
sizeContent(contentClip, _local2, _local3, _width, _height);
};
if (((!((_local4 == _width))) || (!((_local5 == _height))))){
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, true));
};
}
public function get bytesTotal():uint{
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesTotal);
}
public function set scaleContent(_arg1:Boolean):void{
if (_scaleContent == _arg1){
return;
};
_scaleContent = _arg1;
invalidate(InvalidationType.SIZE);
}
protected function clearLoadEvents():void{
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleError);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError);
loader.contentLoaderInfo.removeEventListener(Event.OPEN, passEvent);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, passEvent);
loader.contentLoaderInfo.removeEventListener(HTTPStatusEvent.HTTP_STATUS, passEvent);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleComplete);
}
public function get scaleContent():Boolean{
return (_scaleContent);
}
public function close():void{
try {
loader.close();
} catch(error) {
throw (error);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.containers
Section 88
//CellRenderer (fl.controls.listClasses.CellRenderer)
package fl.controls.listClasses {
import fl.controls.*;
import flash.events.*;
public class CellRenderer extends LabelButton implements ICellRenderer {
protected var _data:Object;
protected var _listData:ListData;
private static var defaultStyles:Object = {upSkin:"CellRenderer_upSkin", downSkin:"CellRenderer_downSkin", overSkin:"CellRenderer_overSkin", disabledSkin:"CellRenderer_disabledSkin", selectedDisabledSkin:"CellRenderer_selectedDisabledSkin", selectedUpSkin:"CellRenderer_selectedUpSkin", selectedDownSkin:"CellRenderer_selectedDownSkin", selectedOverSkin:"CellRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public function CellRenderer():void{
toggle = true;
focusEnabled = false;
}
override protected function toggleSelected(_arg1:MouseEvent):void{
}
override public function get selected():Boolean{
return (super.selected);
}
public function set listData(_arg1:ListData):void{
_listData = _arg1;
label = _listData.label;
setStyle("icon", _listData.icon);
}
override public function set selected(_arg1:Boolean):void{
super.selected = _arg1;
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get listData():ListData{
return (_listData);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
super.setSize(_arg1, _arg2);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = 0;
if (icon != null){
icon.x = _local1;
icon.y = Math.round(((height - icon.height) >> 1));
_local2 = (icon.width + _local1);
};
if (label.length > 0){
textField.visible = true;
_local3 = Math.max(0, ((width - _local2) - (_local1 * 2)));
textField.width = _local3;
textField.height = (textField.textHeight + 4);
textField.x = (_local2 + _local1);
textField.y = Math.round(((height - textField.height) >> 1));
} else {
textField.visible = false;
};
background.width = width;
background.height = height;
}
public function get data():Object{
return (_data);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.listClasses
Section 89
//ICellRenderer (fl.controls.listClasses.ICellRenderer)
package fl.controls.listClasses {
public interface ICellRenderer {
function setSize(_arg1:Number, _arg2:Number):void;
function get listData():ListData;
function get data():Object;
function setMouseState(_arg1:String):void;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function set data(_arg1:Object):void;
function set selected(_arg1:Boolean):void;
function set listData(_arg1:ListData):void;
function get selected():Boolean;
}
}//package fl.controls.listClasses
Section 90
//ImageCell (fl.controls.listClasses.ImageCell)
package fl.controls.listClasses {
import flash.display.*;
import flash.events.*;
import fl.containers.*;
public class ImageCell extends CellRenderer implements ICellRenderer {
protected var loader:UILoader;
protected var textOverlay:Shape;
private static var defaultStyles:Object = {imagePadding:1, textOverlayAlpha:0.7};
public function ImageCell(){
loader = new UILoader();
loader.addEventListener(IOErrorEvent.IO_ERROR, handleErrorEvent, false, 0, true);
loader.autoLoad = true;
loader.scaleContent = true;
addChild(loader);
}
public function get source():Object{
return (loader.source);
}
public function set source(_arg1:Object):void{
loader.source = _arg1;
}
override public function set listData(_arg1:ListData):void{
var _local2:Object;
_listData = _arg1;
label = _listData.label;
_local2 = (_listData as TileListData).source;
if (source != _local2){
source = _local2;
};
}
override protected function draw():void{
super.draw();
}
override protected function configUI():void{
var _local1:Graphics;
super.configUI();
textOverlay = new Shape();
_local1 = textOverlay.graphics;
_local1.beginFill(0xFFFFFF);
_local1.drawRect(0, 0, 100, 100);
_local1.endFill();
}
override public function get listData():ListData{
return (_listData);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = (getStyleValue("imagePadding") as Number);
loader.move(_local1, _local1);
_local2 = (width - (_local1 * 2));
_local3 = (height - (_local1 * 2));
if (((!((loader.width == _local2))) && (!((loader.height == _local3))))){
loader.setSize(_local2, _local3);
};
loader.drawNow();
if ((((_label == "")) || ((_label == null)))){
if (contains(textField)){
removeChild(textField);
};
if (contains(textOverlay)){
removeChild(textOverlay);
};
} else {
_local4 = (getStyleValue("textPadding") as Number);
textField.width = Math.min((width - (_local4 * 2)), (textField.textWidth + 5));
textField.height = (textField.textHeight + 5);
textField.x = Math.max(_local4, ((width / 2) - (textField.width / 2)));
textField.y = ((height - textField.height) - _local4);
textOverlay.x = _local1;
textOverlay.height = (textField.height + (_local4 * 2));
textOverlay.y = ((height - textOverlay.height) - _local1);
textOverlay.width = (width - (_local1 * 2));
textOverlay.alpha = (getStyleValue("textOverlayAlpha") as Number);
addChild(textOverlay);
addChild(textField);
};
background.width = width;
background.height = height;
}
protected function handleErrorEvent(_arg1:IOErrorEvent):void{
dispatchEvent(_arg1);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, CellRenderer.getStyleDefinition()));
}
}
}//package fl.controls.listClasses
Section 91
//ListData (fl.controls.listClasses.ListData)
package fl.controls.listClasses {
import fl.core.*;
public class ListData {
protected var _index:uint;
protected var _owner:UIComponent;
protected var _label:String;
protected var _icon:Object;// = null
protected var _row:uint;
protected var _column:uint;
public function ListData(_arg1:String, _arg2:Object, _arg3:UIComponent, _arg4:uint, _arg5:uint, _arg6:uint=0){
_icon = null;
super();
_label = _arg1;
_icon = _arg2;
_owner = _arg3;
_index = _arg4;
_row = _arg5;
_column = _arg6;
}
public function get owner():UIComponent{
return (_owner);
}
public function get label():String{
return (_label);
}
public function get row():uint{
return (_row);
}
public function get index():uint{
return (_index);
}
public function get icon():Object{
return (_icon);
}
public function get column():uint{
return (_column);
}
}
}//package fl.controls.listClasses
Section 92
//TileListData (fl.controls.listClasses.TileListData)
package fl.controls.listClasses {
import fl.core.*;
public class TileListData extends ListData {
protected var _source:Object;
public function TileListData(_arg1:String, _arg2:Object, _arg3:Object, _arg4:UIComponent, _arg5:uint, _arg6:uint, _arg7:uint=0){
super(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7);
_source = _arg3;
}
public function get source():Object{
return (_source);
}
}
}//package fl.controls.listClasses
Section 93
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 94
//Button (fl.controls.Button)
package fl.controls {
import fl.core.*;
import flash.display.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 95
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 96
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 97
//NumericStepper (fl.controls.NumericStepper)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class NumericStepper extends UIComponent implements IFocusManagerComponent {
protected var upArrow:BaseButton;
protected var _stepSize:Number;// = 1
protected var downArrow:BaseButton;
protected var _value:Number;// = 1
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var _precision:Number;
protected var inputField:TextInput;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TEXT_INPUT_STYLES:Object = {upSkin:"upSkin", disabledSkin:"disabledSkin", textPadding:"textPadding", textFormat:"textFormat", disabledTextFormat:"disabledTextFormat", embedFonts:"embedFonts"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"NumericStepperDownArrow_disabledSkin", downArrowDownSkin:"NumericStepperDownArrow_downSkin", downArrowOverSkin:"NumericStepperDownArrow_overSkin", downArrowUpSkin:"NumericStepperDownArrow_upSkin", upArrowDisabledSkin:"NumericStepperUpArrow_disabledSkin", upArrowDownSkin:"NumericStepperUpArrow_downSkin", upArrowOverSkin:"NumericStepperUpArrow_overSkin", upArrowUpSkin:"NumericStepperUpArrow_upSkin", upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRect:null, focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35, embedFonts:false};
public function NumericStepper(){
_maximum = 10;
_minimum = 0;
_value = 1;
_stepSize = 1;
super();
setStyles();
stepSize = _stepSize;
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
};
}
public function get minimum():Number{
return (_minimum);
}
public function set imeMode(_arg1:String):void{
inputField.imeMode = _arg1;
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
if (_value < _minimum){
setValue(_minimum, false);
};
}
public function get maximum():Number{
return (_maximum);
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == inputField)) || (super.isOurFocus(_arg1))));
}
public function get nextValue():Number{
var _local1:Number;
_local1 = (_value + _stepSize);
return ((inRange(_local1)) ? _local1 : _value);
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
if (_value > _maximum){
setValue(_maximum, false);
};
}
protected function setValue(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
if (_arg1 == _value){
return;
};
_local3 = _value;
_value = getValidValue(_arg1);
inputField.text = _value.toString();
if (_arg2){
dispatchEvent(new Event(Event.CHANGE, true));
};
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:Number;
if (!enabled){
return;
};
_arg1.stopImmediatePropagation();
_local2 = Number(inputField.text);
switch (_arg1.keyCode){
case Keyboard.END:
setValue(maximum);
break;
case Keyboard.HOME:
setValue(minimum);
break;
case Keyboard.UP:
setValue(nextValue);
break;
case Keyboard.DOWN:
setValue(previousValue);
break;
case Keyboard.ENTER:
setValue(_local2);
break;
};
}
override public function set enabled(_arg1:Boolean):void{
if (_arg1 == enabled){
return;
};
super.enabled = _arg1;
upArrow.enabled = (downArrow.enabled = (inputField.enabled = _arg1));
}
protected function onTextChange(_arg1:Event):void{
_arg1.stopImmediatePropagation();
}
public function get previousValue():Number{
var _local1:Number;
_local1 = (_value - _stepSize);
return ((inRange(_local1)) ? _local1 : _value);
}
protected function getValidValue(_arg1:Number):Number{
var _local2:Number;
if (isNaN(_arg1)){
return (_value);
};
_local2 = Number((_stepSize * Math.round((_arg1 / _stepSize))).toFixed(_precision));
if (_local2 > maximum){
return (maximum);
};
if (_local2 < minimum){
return (minimum);
};
return (_local2);
}
public function set value(_arg1:Number):void{
setValue(_arg1, false);
}
public function get stepSize():Number{
return (_stepSize);
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
public function get imeMode():String{
return (inputField.imeMode);
}
protected function stepperPressHandler(_arg1:ComponentEvent):void{
setValue(Number(inputField.text), false);
switch (_arg1.currentTarget){
case upArrow:
setValue(nextValue);
break;
case downArrow:
setValue(previousValue);
};
inputField.setFocus();
inputField.textField.setSelection(0, 0);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
if (_arg1.eventPhase == 3){
setValue(Number(inputField.text));
};
super.focusOutHandler(_arg1);
}
protected function inRange(_arg1:Number):Boolean{
return ((((_arg1 >= _minimum)) && ((_arg1 <= _maximum))));
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
validate();
}
override protected function configUI():void{
super.configUI();
upArrow = new BaseButton();
copyStylesToChild(upArrow, UP_ARROW_STYLES);
upArrow.autoRepeat = true;
upArrow.setSize(21, 12);
upArrow.focusEnabled = false;
addChild(upArrow);
downArrow = new BaseButton();
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
downArrow.autoRepeat = true;
downArrow.setSize(21, 12);
downArrow.focusEnabled = false;
addChild(downArrow);
inputField = new TextInput();
copyStylesToChild(inputField, TEXT_INPUT_STYLES);
inputField.restrict = "0-9\\-\\.\\,";
inputField.text = _value.toString();
inputField.setSize(21, 24);
inputField.focusTarget = (this as IFocusManagerComponent);
inputField.focusEnabled = false;
inputField.addEventListener(FocusEvent.FOCUS_IN, passEvent);
inputField.addEventListener(FocusEvent.FOCUS_OUT, passEvent);
addChild(inputField);
inputField.addEventListener(Event.CHANGE, onTextChange, false, 0, true);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, stepperPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, stepperPressHandler, false, 0, true);
}
public function get value():Number{
return (_value);
}
protected function inStep(_arg1:Number):Boolean{
return ((((_arg1 - _minimum) % _stepSize) == 0));
}
protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
_local1 = (width - upArrow.width);
_local2 = (height / 2);
inputField.setSize(_local1, height);
upArrow.height = _local2;
downArrow.height = Math.floor(_local2);
downArrow.move(_local1, _local2);
upArrow.move(_local1, 0);
downArrow.drawNow();
upArrow.drawNow();
inputField.drawNow();
}
override public function setFocus():void{
if (stage){
stage.focus = inputField.textField;
};
}
protected function getPrecision():Number{
var _local1:String;
_local1 = _stepSize.toString();
if (_local1.indexOf(".") == -1){
return (0);
};
return (_local1.split(".").pop().length);
}
public function get textField():TextInput{
return (inputField);
}
public function set stepSize(_arg1:Number):void{
_stepSize = _arg1;
_precision = getPrecision();
setValue(_value);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
copyStylesToChild(inputField, TEXT_INPUT_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 98
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 99
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 100
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const OFF:String = "off";
public static const ON:String = "on";
public static const AUTO:String = "auto";
}
}//package fl.controls
Section 101
//SelectableList (fl.controls.SelectableList)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
import fl.containers.*;
import flash.ui.*;
public class SelectableList extends BaseScrollPane implements IFocusManagerComponent {
protected var invalidItems:Dictionary;
protected var renderedItems:Dictionary;
protected var listHolder:Sprite;
protected var _allowMultipleSelection:Boolean;// = false
protected var lastCaretIndex:int;// = -1
protected var _selectedIndices:Array;
protected var availableCellRenderers:Array;
protected var list:Sprite;
protected var caretIndex:int;// = -1
protected var updatedRendererStyles:Object;
protected var preChangeItems:Array;
protected var activeCellRenderers:Array;
protected var rendererStyles:Object;
protected var _verticalScrollPosition:Number;
protected var _dataProvider:DataProvider;
protected var _horizontalScrollPosition:Number;
private var collectionItemImport:SimpleCollectionItem;
protected var _selectable:Boolean;// = true
private static var defaultStyles:Object = {skin:"List_skin", cellRenderer:CellRenderer, contentPadding:null, disabledAlpha:null};
public static var createAccessibilityImplementation:Function;
public function SelectableList(){
_allowMultipleSelection = false;
_selectable = true;
caretIndex = -1;
lastCaretIndex = -1;
super();
activeCellRenderers = [];
availableCellRenderers = [];
invalidItems = new Dictionary(true);
renderedItems = new Dictionary(true);
_selectedIndices = [];
if (dataProvider == null){
dataProvider = new DataProvider();
};
verticalScrollPolicy = ScrollPolicy.AUTO;
rendererStyles = {};
updatedRendererStyles = {};
}
protected function drawList():void{
}
public function set allowMultipleSelection(_arg1:Boolean):void{
if (_arg1 == _allowMultipleSelection){
return;
};
_allowMultipleSelection = _arg1;
if (((!(_arg1)) && ((_selectedIndices.length > 1)))){
_selectedIndices = [_selectedIndices.pop()];
invalidate(InvalidationType.DATA);
};
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (_dataProvider.sortOn(_arg1, _arg2));
}
public function removeItemAt(_arg1:uint):Object{
return (_dataProvider.removeItemAt(_arg1));
}
public function get selectedItem():Object{
return (((_selectedIndices.length)==0) ? null : _dataProvider.getItemAt(selectedIndex));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
};
}
public function get selectable():Boolean{
return (_selectable);
}
public function itemToCellRenderer(_arg1:Object):ICellRenderer{
var _local2:*;
var _local3:ICellRenderer;
if (_arg1 != null){
for (_local2 in activeCellRenderers) {
_local3 = (activeCellRenderers[_local2] as ICellRenderer);
if (_local3.data == _arg1){
return (_local3);
};
};
};
return (null);
}
public function getNextIndexAtLetter(_arg1:String, _arg2:int=-1):int{
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:String;
if (length == 0){
return (-1);
};
_arg1 = _arg1.toUpperCase();
_local3 = (length - 1);
_local4 = 0;
while (_local4 < _local3) {
_local5 = ((_arg2 + 1) + _local4);
if (_local5 > (length - 1)){
_local5 = (_local5 - length);
};
_local6 = getItemAt(_local5);
if (_local6 == null){
break;
};
_local7 = itemToLabel(_local6);
if (_local7 == null){
} else {
if (_local7.charAt(0).toUpperCase() == _arg1){
return (_local5);
};
};
_local4++;
};
return (-1);
}
public function invalidateList():void{
_invalidateList();
invalidate(InvalidationType.DATA);
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
list.mouseChildren = _enabled;
}
public function get selectedIndices():Array{
return (_selectedIndices.concat());
}
public function set selectable(_arg1:Boolean):void{
if (_arg1 == _selectable){
return;
};
if (!_arg1){
selectedIndices = [];
};
_selectable = _arg1;
}
public function itemToLabel(_arg1:Object):String{
return (_arg1["label"]);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
_dataProvider.addItemAt(_arg1, _arg2);
invalidateList();
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (_dataProvider.replaceItemAt(_arg1, _arg2));
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:uint;
_local2 = _arg1.startIndex;
_local3 = _arg1.endIndex;
_local4 = _arg1.changeType;
if (_local4 == DataChangeType.INVALIDATE_ALL){
clearSelection();
invalidateList();
} else {
if (_local4 == DataChangeType.INVALIDATE){
_local5 = 0;
while (_local5 < _arg1.items.length) {
invalidateItem(_arg1.items[_local5]);
_local5++;
};
} else {
if (_local4 == DataChangeType.ADD){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
_selectedIndices[_local5] = (_selectedIndices[_local5] + (_local2 - _local3));
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
if (_selectedIndices[_local5] <= _local3){
delete _selectedIndices[_local5];
} else {
_selectedIndices[_local5] = (_selectedIndices[_local5] - ((_local2 - _local3) + 1));
};
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE_ALL){
clearSelection();
} else {
if (_local4 == DataChangeType.REPLACE){
} else {
selectedItems = preChangeItems;
preChangeItems = null;
};
};
};
};
};
};
invalidate(InvalidationType.DATA);
}
protected function _invalidateList():void{
availableCellRenderers = [];
while (activeCellRenderers.length > 0) {
list.removeChild((activeCellRenderers.pop() as DisplayObject));
};
}
protected function updateRendererStyles():void{
var _local1:Array;
var _local2:uint;
var _local3:uint;
var _local4:String;
_local1 = availableCellRenderers.concat(activeCellRenderers);
_local2 = _local1.length;
_local3 = 0;
while (_local3 < _local2) {
if (_local1[_local3].setStyle == null){
} else {
for (_local4 in updatedRendererStyles) {
_local1[_local3].setStyle(_local4, updatedRendererStyles[_local4]);
};
_local1[_local3].drawNow();
};
_local3++;
};
updatedRendererStyles = {};
}
public function set selectedItem(_arg1:Object):void{
var _local2:int;
_local2 = _dataProvider.getItemIndex(_arg1);
selectedIndex = _local2;
}
public function sortItems(... _args){
return (_dataProvider.sort.apply(_dataProvider, _args));
}
public function removeAll():void{
_dataProvider.removeAll();
}
protected function handleCellRendererChange(_arg1:Event):void{
var _local2:ICellRenderer;
var _local3:uint;
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
_dataProvider.invalidateItemAt(_local3);
}
protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _horizontalScrollPosition){
return;
};
_local3 = (_arg1 - _horizontalScrollPosition);
_horizontalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.HORIZONTAL, _local3, _arg1));
};
}
public function scrollToSelected():void{
scrollToIndex(selectedIndex);
}
public function invalidateItem(_arg1:Object):void{
if (renderedItems[_arg1] == null){
return;
};
invalidItems[_arg1] = true;
invalidate(InvalidationType.DATA);
}
protected function handleCellRendererClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
var _local4:int;
var _local5:int;
var _local6:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
if (((!(dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)))) || (!(_selectable)))){
return;
};
_local4 = selectedIndices.indexOf(_local3);
if (!_allowMultipleSelection){
if (_local4 != -1){
return;
};
_local2.selected = true;
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
} else {
if (_arg1.shiftKey){
_local6 = ((_selectedIndices.length)>0) ? _selectedIndices[0] : _local3;
_selectedIndices = [];
if (_local6 > _local3){
_local5 = _local6;
while (_local5 >= _local3) {
_selectedIndices.push(_local5);
_local5--;
};
} else {
_local5 = _local6;
while (_local5 <= _local3) {
_selectedIndices.push(_local5);
_local5++;
};
};
caretIndex = _local3;
} else {
if (_arg1.ctrlKey){
if (_local4 != -1){
_local2.selected = false;
_selectedIndices.splice(_local4, 1);
} else {
_local2.selected = true;
_selectedIndices.push(_local3);
};
caretIndex = _local3;
} else {
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
};
};
};
dispatchEvent(new Event(Event.CHANGE));
invalidate(InvalidationType.DATA);
}
public function get length():uint{
return (_dataProvider.length);
}
public function get allowMultipleSelection():Boolean{
return (_allowMultipleSelection);
}
protected function onPreChange(_arg1:DataChangeEvent):void{
switch (_arg1.changeType){
case DataChangeType.REMOVE:
case DataChangeType.ADD:
case DataChangeType.INVALIDATE:
case DataChangeType.REMOVE_ALL:
case DataChangeType.REPLACE:
case DataChangeType.INVALIDATE_ALL:
break;
default:
preChangeItems = selectedItems;
break;
};
}
public function getRendererStyle(_arg1:String, _arg2:int=-1):Object{
return (rendererStyles[_arg1]);
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _verticalScrollPosition){
return;
};
_local3 = (_arg1 - _verticalScrollPosition);
_verticalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _local3, _arg1));
};
}
protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
public function set selectedIndices(_arg1:Array):void{
if (!_selectable){
return;
};
_selectedIndices = ((_arg1)==null) ? [] : _arg1.concat();
invalidate(InvalidationType.SELECTED);
}
public function get selectedIndex():int{
return (((_selectedIndices.length)==0) ? -1 : _selectedIndices[(_selectedIndices.length - 1)]);
}
override protected function draw():void{
super.draw();
}
override protected function configUI():void{
super.configUI();
listHolder = new Sprite();
addChild(listHolder);
listHolder.scrollRect = contentScrollRect;
list = new Sprite();
listHolder.addChild(list);
}
public function addItem(_arg1:Object):void{
_dataProvider.addItem(_arg1);
invalidateList();
}
protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:String;
_local2 = (_arg1.target as ICellRenderer);
_local3 = ((_arg1.type)==MouseEvent.ROLL_OVER) ? ListEvent.ITEM_ROLL_OVER : ListEvent.ITEM_ROLL_OUT;
dispatchEvent(new ListEvent(_local3, false, false, _local2.listData.column, _local2.listData.row, _local2.listData.index, _local2.data));
}
public function clearRendererStyle(_arg1:String, _arg2:int=-1):void{
delete rendererStyles[_arg1];
updatedRendererStyles[_arg1] = null;
invalidate(InvalidationType.RENDERER_STYLES);
}
protected function handleCellRendererDoubleClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
dispatchEvent(new ListEvent(ListEvent.ITEM_DOUBLE_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data));
}
public function get rowCount():uint{
return (0);
}
public function isItemSelected(_arg1:Object):Boolean{
return ((selectedItems.indexOf(_arg1) > -1));
}
public function set dataProvider(_arg1:DataProvider):void{
if (_dataProvider != null){
_dataProvider.removeEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange);
_dataProvider.removeEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange);
};
_dataProvider = _arg1;
_dataProvider.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
_dataProvider.addEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange, false, 0, true);
clearSelection();
invalidateList();
}
override protected function drawLayout():void{
super.drawLayout();
contentScrollRect = listHolder.scrollRect;
contentScrollRect.width = availableWidth;
contentScrollRect.height = availableHeight;
listHolder.scrollRect = contentScrollRect;
}
public function getItemAt(_arg1:uint):Object{
return (_dataProvider.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (SelectableList.createAccessibilityImplementation != null){
SelectableList.createAccessibilityImplementation(this);
};
}
public function scrollToIndex(_arg1:int):void{
}
public function removeItem(_arg1:Object):Object{
return (_dataProvider.removeItem(_arg1));
}
public function get dataProvider():DataProvider{
return (_dataProvider);
}
public function set maxHorizontalScrollPosition(_arg1:Number):void{
_maxHorizontalScrollPosition = _arg1;
invalidate(InvalidationType.SIZE);
}
public function setRendererStyle(_arg1:String, _arg2:Object, _arg3:uint=0):void{
if (rendererStyles[_arg1] == _arg2){
return;
};
updatedRendererStyles[_arg1] = _arg2;
rendererStyles[_arg1] = _arg2;
invalidate(InvalidationType.RENDERER_STYLES);
}
public function invalidateItemAt(_arg1:uint):void{
var _local2:Object;
_local2 = _dataProvider.getItemAt(_arg1);
if (_local2 != null){
invalidateItem(_local2);
};
}
public function set selectedItems(_arg1:Array):void{
var _local2:Array;
var _local3:uint;
var _local4:int;
if (_arg1 == null){
selectedIndices = null;
return;
};
_local2 = [];
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _dataProvider.getItemIndex(_arg1[_local3]);
if (_local4 != -1){
_local2.push(_local4);
};
_local3++;
};
selectedIndices = _local2;
}
public function clearSelection():void{
selectedIndex = -1;
}
override public function get maxHorizontalScrollPosition():Number{
return (_maxHorizontalScrollPosition);
}
public function get selectedItems():Array{
var _local1:Array;
var _local2:uint;
_local1 = [];
_local2 = 0;
while (_local2 < _selectedIndices.length) {
_local1.push(_dataProvider.getItemAt(_selectedIndices[_local2]));
_local2++;
};
return (_local1);
}
public function set selectedIndex(_arg1:int):void{
selectedIndices = ((_arg1)==-1) ? null : [_arg1];
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition()));
}
}
}//package fl.controls
Section 102
//TextInput (fl.controls.TextInput)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextInput(){
_editable = true;
_html = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
public function get restrict():String{
return (textField.restrict);
}
public function get textWidth():Number{
return (textField.textWidth);
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():int{
return (textField.length);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (_imeMode);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
public function get text():String{
return (textField.text);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function get htmlText():String{
return (textField.htmlText);
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
override public function setFocus():void{
stage.focus = textField;
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 103
//TileList (fl.controls.TileList)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.data.*;
import fl.managers.*;
import flash.utils.*;
import flash.ui.*;
public class TileList extends SelectableList implements IFocusManagerComponent {
protected var _labelField:String;// = "label"
protected var _scrollPolicy:String;// = "auto"
protected var _labelFunction:Function;
protected var _scrollDirection:String;// = "horizontal"
protected var _iconFunction:Function;
private var collectionItemImport:TileListCollectionItem;
protected var _rowHeight:Number;// = 50
protected var _cellRenderer:Object;
protected var _columnWidth:Number;// = 50
protected var _iconField:String;// = "icon"
protected var _sourceFunction:Function;
protected var __rowCount:uint;// = 0
protected var __columnCount:uint;// = 0
protected var _sourceField:String;// = "source"
protected var oldLength:uint;// = 0
private static var defaultStyles:Object = {cellRenderer:ImageCell, focusRectSkin:null, focusRectPadding:null, skin:"TileList_skin"};
public static var createAccessibilityImplementation:Function;
public function TileList(){
_rowHeight = 50;
_columnWidth = 50;
_scrollDirection = ScrollBarDirection.HORIZONTAL;
_scrollPolicy = ScrollPolicy.AUTO;
oldLength = 0;
_labelField = "label";
_iconField = "icon";
_sourceField = "source";
__rowCount = 0;
__columnCount = 0;
super();
}
public function get iconField():String{
return (_iconField);
}
override protected function drawList():void{
var _local1:uint;
var _local2:uint;
var _local3:Object;
var _local4:ICellRenderer;
var _local5:uint;
var _local6:uint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:Dictionary;
var _local15:Dictionary;
var _local16:uint;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:Boolean;
var _local21:String;
var _local22:Object;
var _local23:Object;
var _local24:Sprite;
var _local25:String;
var _local26:UIComponent;
_local5 = rowCount;
_local6 = columnCount;
_local7 = columnWidth;
_local8 = rowHeight;
_local9 = 0;
_local10 = 0;
listHolder.x = (listHolder.y = contentPadding);
contentScrollRect = listHolder.scrollRect;
contentScrollRect.x = (Math.floor(_horizontalScrollPosition) % _local7);
contentScrollRect.y = (Math.floor(_verticalScrollPosition) % _local8);
listHolder.scrollRect = contentScrollRect;
listHolder.cacheAsBitmap = useBitmapScrolling;
_local13 = [];
if (_scrollDirection == ScrollBarDirection.HORIZONTAL){
_local16 = ((availableWidth / _local7) << 0);
_local17 = Math.max(_local16, Math.ceil((length / _local5)));
_local9 = ((_horizontalScrollPosition / _local7) << 0);
_local6 = Math.max(_local16, Math.min((_local17 - _local9), (_local6 + 1)));
_local12 = 0;
while (_local12 < _local5) {
_local11 = 0;
while (_local11 < _local6) {
_local2 = (((_local12 * _local17) + _local9) + _local11);
if (_local2 >= length){
break;
};
_local13.push(_local2);
_local11++;
};
_local12++;
};
} else {
_local5++;
_local10 = ((_verticalScrollPosition / _local8) << 0);
_local18 = Math.floor((_local10 * _local6));
_local19 = Math.min(length, (_local18 + (_local5 * _local6)));
_local1 = _local18;
while (_local1 < _local19) {
_local13.push(_local1);
_local1++;
};
};
_local14 = (renderedItems = new Dictionary(true));
for each (_local2 in _local13) {
_local14[_dataProvider.getItemAt(_local2)] = true;
};
_local15 = new Dictionary(true);
while (activeCellRenderers.length > 0) {
_local4 = activeCellRenderers.pop();
_local3 = _local4.data;
if ((((_local14[_local3] == null)) || ((invalidItems[_local3] == true)))){
availableCellRenderers.push(_local4);
} else {
_local15[_local3] = _local4;
invalidItems[_local3] = true;
};
list.removeChild((_local4 as DisplayObject));
};
invalidItems = new Dictionary(true);
_local1 = 0;
for each (_local2 in _local13) {
_local11 = (_local1 % _local6);
_local12 = ((_local1 / _local6) << 0);
_local20 = false;
_local3 = _dataProvider.getItemAt(_local2);
if (_local15[_local3] != null){
_local20 = true;
_local4 = _local15[_local3];
delete _local15[_local3];
} else {
if (availableCellRenderers.length > 0){
_local4 = (availableCellRenderers.pop() as ICellRenderer);
} else {
_local4 = (getDisplayObjectInstance(getStyleValue("cellRenderer")) as ICellRenderer);
_local24 = (_local4 as Sprite);
if (_local24 != null){
_local24.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true);
_local24.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true);
_local24.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true);
_local24.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true);
_local24.doubleClickEnabled = true;
_local24.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true);
if (_local24["setStyle"] != null){
for (_local25 in rendererStyles) {
var _local31 = _local24;
_local31["setStyle"](_local25, rendererStyles[_local25]);
};
};
};
};
};
list.addChild((_local4 as Sprite));
activeCellRenderers.push(_local4);
_local4.y = (_local8 * _local12);
_local4.x = (_local7 * _local11);
_local4.setSize(columnWidth, rowHeight);
_local21 = itemToLabel(_local3);
_local22 = null;
if (_iconFunction != null){
_local22 = _iconFunction(_local3);
} else {
if (_iconField != null){
_local22 = _local3[_iconField];
};
};
_local23 = null;
if (_sourceFunction != null){
_local23 = _sourceFunction(_local3);
} else {
if (_sourceField != null){
_local23 = _local3[_sourceField];
};
};
if (!_local20){
_local4.data = _local3;
};
_local4.listData = (new TileListData(_local21, _local22, _local23, this, _local2, (_local10 + _local12), (_local9 + _local11)) as ListData);
_local4.selected = !((_selectedIndices.indexOf(_local2) == -1));
if ((_local4 is UIComponent)){
_local26 = (_local4 as UIComponent);
_local26.drawNow();
};
_local1++;
};
}
public function get columnWidth():Number{
return (_columnWidth);
}
public function set iconField(_arg1:String):void{
if (_arg1 == _iconField){
return;
};
_iconField = _arg1;
invalidate(InvalidationType.DATA);
}
public function set columnWidth(_arg1:Number):void{
if (_columnWidth == _arg1){
return;
};
_columnWidth = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
_arg1.stopPropagation();
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
case Keyboard.END:
case Keyboard.HOME:
if (_scrollDirection == ScrollBarDirection.HORIZONTAL){
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
} else {
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
};
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
default:
_local2 = getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), selectedIndex);
if (_local2 > -1){
selectedIndex = _local2;
scrollToSelected();
};
break;
};
}
override public function get horizontalScrollPolicy():String{
return (null);
}
public function set scrollPolicy(_arg1:String):void{
if (((!(componentInspectorSetting)) && ((_scrollPolicy == _arg1)))){
return;
};
_scrollPolicy = _arg1;
if (direction == ScrollBarDirection.HORIZONTAL){
_horizontalScrollPolicy = _arg1;
_verticalScrollPolicy = ScrollPolicy.OFF;
} else {
_verticalScrollPolicy = _arg1;
_horizontalScrollPolicy = ScrollPolicy.OFF;
};
invalidate(InvalidationType.SIZE);
}
public function set labelField(_arg1:String):void{
if (_arg1 == _labelField){
return;
};
_labelField = _arg1;
invalidate(InvalidationType.DATA);
}
override public function get verticalScrollPolicy():String{
return (null);
}
public function get innerWidth():Number{
var _local1:Number;
drawNow();
_local1 = (getStyleValue("contentPadding") as Number);
return (((width - (_local1 * 2)) - (_verticalScrollBar.visible) ? _verticalScrollBar.width : 0));
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0));
}
public function get sourceFunction():Function{
return (_sourceFunction);
}
override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
var _local4:uint;
var _local5:int;
var _local6:int;
var _local7:*;
_local4 = Math.ceil((Math.max((rowCount * columnCount), length) / rowCount));
switch (_arg1){
case Keyboard.LEFT:
_local5 = Math.max(0, (selectedIndex - 1));
break;
case Keyboard.RIGHT:
_local5 = Math.min((length - 1), (selectedIndex + 1));
break;
case Keyboard.HOME:
_local5 = 0;
break;
case Keyboard.END:
_local5 = (length - 1);
break;
case Keyboard.PAGE_UP:
_local6 = (selectedIndex - (selectedIndex % _local4));
_local5 = Math.max(0, Math.max(_local6, (selectedIndex - columnCount)));
break;
case Keyboard.PAGE_DOWN:
_local7 = (((selectedIndex - (selectedIndex % _local4)) + _local4) - 1);
_local5 = Math.min((length - 1), Math.min(_local7, (selectedIndex + _local4)));
break;
};
doKeySelection(_local5, _arg2, _arg3);
scrollToSelected();
}
override protected function draw():void{
var _local1:Boolean;
if (direction == ScrollBarDirection.VERTICAL){
if (__rowCount > 0){
rowCount = __rowCount;
};
if (__columnCount > 0){
columnCount = __columnCount;
};
} else {
if (__columnCount > 0){
columnCount = __columnCount;
};
if (__rowCount > 0){
rowCount = __rowCount;
};
};
_local1 = !((oldLength == length));
oldLength = length;
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
if (_cellRenderer != getStyleValue("cellRenderer")){
_invalidateList();
_cellRenderer = getStyleValue("cellRenderer");
};
};
if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){
drawLayout();
};
if (isInvalid(InvalidationType.RENDERER_STYLES)){
updateRendererStyles();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){
drawList();
_maxHorizontalScrollPosition = Math.max(0, (contentWidth - availableWidth));
};
updateChildren();
validate();
}
override public function set horizontalScrollPolicy(_arg1:String):void{
}
override protected function configUI():void{
super.configUI();
_horizontalScrollPolicy = scrollPolicy;
_verticalScrollPolicy = ScrollPolicy.OFF;
}
override protected function drawLayout():void{
var _local1:uint;
var _local2:uint;
_horizontalScrollPolicy = ((_scrollDirection)==ScrollBarDirection.HORIZONTAL) ? _scrollPolicy : ScrollPolicy.OFF;
_verticalScrollPolicy = ((_scrollDirection)!=ScrollBarDirection.HORIZONTAL) ? _scrollPolicy : ScrollPolicy.OFF;
if (_scrollDirection == ScrollBarDirection.HORIZONTAL){
_local1 = rowCount;
contentHeight = (_local1 * _rowHeight);
contentWidth = (_columnWidth * Math.ceil((length / _local1)));
} else {
_local2 = columnCount;
contentWidth = (_local2 * _columnWidth);
contentHeight = (_rowHeight * Math.ceil((length / _local2)));
};
super.drawLayout();
}
public function get sourceField():String{
return (_sourceField);
}
override public function get maxHorizontalScrollPosition():Number{
drawNow();
return (_maxHorizontalScrollPosition);
}
public function set labelFunction(_arg1:Function):void{
if (_labelFunction == _arg1){
return;
};
_labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
override public function set verticalScrollPolicy(_arg1:String):void{
}
protected function doKeySelection(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
var _local4:Array;
var _local5:Boolean;
var _local6:uint;
var _local7:int;
_local4 = selectedIndices;
_local5 = false;
if ((((_arg1 < 0)) || ((_arg1 > (length - 1))))){
} else {
if (((((_arg2) && ((_local4.length > 0)))) && (!((_arg1 == _local4[0]))))){
_local6 = _local4[0];
_local4 = [];
if (_arg1 < _local6){
_local7 = _local6;
while (_local7 >= _arg1) {
_local4.push(_local7);
_local7--;
};
} else {
_local7 = _local6;
while (_local7 <= _arg1) {
_local4.push(_local7);
_local7++;
};
};
_local5 = true;
} else {
_local4 = [_arg1];
caretIndex = _arg1;
_local5 = true;
};
};
selectedIndices = _local4;
if (_local5){
dispatchEvent(new Event(Event.CHANGE));
};
invalidate(InvalidationType.DATA);
}
public function set sourceFunction(_arg1:Function):void{
_sourceFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function get scrollPolicy():String{
return (_scrollPolicy);
}
public function get labelField():String{
return (_labelField);
}
override protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:int;
var _local8:int;
_local4 = Math.max(1, ((Math.max(contentHeight, availableHeight) / _rowHeight) << 0));
_local5 = Math.ceil((Math.max((columnCount * rowCount), length) / _local4));
_local6 = Math.ceil((length / _local5));
switch (_arg1){
case Keyboard.UP:
_local7 = (selectedIndex - _local5);
break;
case Keyboard.DOWN:
_local7 = (selectedIndex + _local5);
break;
case Keyboard.HOME:
_local7 = 0;
break;
case Keyboard.END:
_local7 = (length - 1);
break;
case Keyboard.PAGE_DOWN:
_local8 = (selectedIndex + (_local5 * (_local6 - 1)));
if (_local8 >= length){
_local8 = (_local8 - _local5);
};
_local7 = Math.min((length - 1), _local8);
break;
case Keyboard.PAGE_UP:
_local8 = (selectedIndex - (_local5 * (_local6 - 1)));
if (_local8 < 0){
_local8 = (_local8 + _local5);
};
_local7 = Math.max(0, _local8);
break;
};
doKeySelection(_local7, _arg2, _arg3);
scrollToSelected();
}
override public function itemToLabel(_arg1:Object):String{
if (_labelFunction != null){
return (String(_labelFunction(_arg1)));
};
if (_arg1[_labelField] == null){
return ("");
};
return (String(_arg1[_labelField]));
}
public function set rowCount(_arg1:uint):void{
var _local2:Number;
var _local3:*;
if (_arg1 == 0){
return;
};
if (componentInspectorSetting){
__rowCount = _arg1;
return;
};
__rowCount = 0;
_local2 = Number(getStyleValue("contentPadding"));
_local3 = (((((Math.ceil((length / _arg1)) > ((width / columnWidth) >> 0))) && ((_scrollPolicy == ScrollPolicy.AUTO)))) || ((_scrollPolicy == ScrollPolicy.ON)));
height = (((rowHeight * _arg1) + (2 * _local2)) + ((((_scrollDirection == ScrollBarDirection.HORIZONTAL)) && (_local3))) ? ScrollBar.WIDTH : 0);
}
public function set columnCount(_arg1:uint):void{
var _local2:Number;
var _local3:Boolean;
if (_arg1 == 0){
return;
};
if (componentInspectorSetting){
__columnCount = _arg1;
return;
};
__columnCount = 0;
_local2 = Number(getStyleValue("contentPadding"));
_local3 = (((((Math.ceil((length / _arg1)) > ((height / rowHeight) >> 0))) && ((_scrollPolicy == ScrollPolicy.AUTO)))) || ((_scrollPolicy == ScrollPolicy.ON)));
width = (((columnWidth * _arg1) + (2 * _local2)) + ((((_scrollDirection == ScrollBarDirection.VERTICAL)) && (_local3))) ? 15 : 0);
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
invalidate(InvalidationType.SCROLL);
super.setHorizontalScrollPosition(_arg1, true);
}
public function set iconFunction(_arg1:Function):void{
if (_iconFunction == _arg1){
return;
};
_iconFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function get labelFunction():Function{
return (_labelFunction);
}
public function set direction(_arg1:String):void{
if (_scrollDirection == _arg1){
return;
};
_scrollDirection = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get innerHeight():Number{
var _local1:Number;
drawNow();
_local1 = (getStyleValue("contentPadding") as Number);
return (((height - (_local1 * 2)) - (_horizontalScrollBar.visible) ? _horizontalScrollBar.height : 0));
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
invalidate(InvalidationType.SCROLL);
super.setVerticalScrollPosition(_arg1, true);
}
public function set sourceField(_arg1:String):void{
_sourceField = _arg1;
invalidate(InvalidationType.DATA);
}
override public function get rowCount():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
_local1 = Number(getStyleValue("contentPadding"));
_local2 = Math.max(1, (((_width - (2 * _local1)) / _columnWidth) << 0));
_local3 = Math.max(1, (((_height - (2 * _local1)) / _rowHeight) << 0));
if (_scrollDirection == ScrollBarDirection.HORIZONTAL){
if ((((_scrollPolicy == ScrollPolicy.ON)) || ((((_scrollPolicy == ScrollPolicy.AUTO)) && ((length > (_local2 * _local3))))))){
_local3 = Math.max(1, ((((_height - (2 * _local1)) - 15) / _rowHeight) << 0));
};
} else {
_local3 = Math.max(1, Math.ceil(((_height - (2 * _local1)) / _rowHeight)));
};
return (_local3);
}
public function set rowHeight(_arg1:Number):void{
if (_rowHeight == _arg1){
return;
};
_rowHeight = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get columnCount():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
_local1 = Number(getStyleValue("contentPadding"));
_local2 = Math.max(1, (((_width - (2 * _local1)) / _columnWidth) << 0));
_local3 = Math.max(1, (((_height - (2 * _local1)) / _rowHeight) << 0));
if (_scrollDirection != ScrollBarDirection.HORIZONTAL){
if ((((_scrollPolicy == ScrollPolicy.ON)) || ((((_scrollPolicy == ScrollPolicy.AUTO)) && ((length > (_local2 * _local3))))))){
_local2 = Math.max(1, ((((_width - (2 * _local1)) - 15) / _columnWidth) << 0));
};
} else {
_local2 = Math.max(1, Math.ceil(((_width - (2 * _local1)) / _columnWidth)));
};
return (_local2);
}
public function get iconFunction():Function{
return (_iconFunction);
}
override public function set dataProvider(_arg1:DataProvider):void{
super.dataProvider = _arg1;
}
public function get direction():String{
return (_scrollDirection);
}
override public function scrollToIndex(_arg1:int):void{
var _local2:uint;
var _local3:Number;
var _local4:Number;
drawNow();
_local2 = Math.max(1, ((contentWidth / _columnWidth) << 0));
if (_scrollDirection == ScrollBarDirection.VERTICAL){
if (rowHeight > availableHeight){
return;
};
_local3 = (((_arg1 / _local2) >> 0) * rowHeight);
if (_local3 < verticalScrollPosition){
verticalScrollPosition = _local3;
} else {
if (_local3 > ((verticalScrollPosition + availableHeight) - rowHeight)){
verticalScrollPosition = ((_local3 + rowHeight) - availableHeight);
};
};
} else {
if (columnWidth > availableWidth){
return;
};
_local4 = ((_arg1 % _local2) * columnWidth);
if (_local4 < horizontalScrollPosition){
horizontalScrollPosition = _local4;
} else {
if (_local4 > ((horizontalScrollPosition + availableWidth) - columnWidth)){
horizontalScrollPosition = ((_local4 + columnWidth) - availableWidth);
};
};
};
}
override protected function initializeAccessibility():void{
if (TileList.createAccessibilityImplementation != null){
TileList.createAccessibilityImplementation(this);
};
}
public function get rowHeight():Number{
return (_rowHeight);
}
override public function get dataProvider():DataProvider{
return (super.dataProvider);
}
override public function set maxHorizontalScrollPosition(_arg1:Number):void{
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition(), ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 104
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 105
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 106
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 107
//DataProvider (fl.data.DataProvider)
package fl.data {
import flash.events.*;
import fl.events.*;
public class DataProvider extends EventDispatcher {
protected var data:Array;
public function DataProvider(_arg1:Object=null){
if (_arg1 == null){
data = [];
} else {
data = getDataFromObject(_arg1);
};
}
protected function dispatchPreChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.PRE_DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
public function invalidateItemAt(_arg1:int):void{
checkIndex(_arg1, (data.length - 1));
dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _arg1);
}
public function getItemIndex(_arg1:Object):int{
return (data.indexOf(_arg1));
}
protected function getDataFromObject(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:XML;
var _local7:XMLList;
var _local8:XML;
var _local9:XMLList;
var _local10:XML;
var _local11:XMLList;
var _local12:XML;
if ((_arg1 is Array)){
_local3 = (_arg1 as Array);
if (_local3.length > 0){
if ((((_local3[0] is String)) || ((_local3[0] is Number)))){
_local2 = [];
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = {label:String(_local3[_local4]), data:_local3[_local4]};
_local2.push(_local5);
_local4++;
};
return (_local2);
};
};
return (_arg1.concat());
//unresolved jump
};
if ((_arg1 is DataProvider)){
return (_arg1.toArray());
};
if ((_arg1 is XML)){
_local6 = (_arg1 as XML);
_local2 = [];
_local7 = _local6.*;
for each (_local8 in _local7) {
_arg1 = {};
_local9 = _local8.attributes();
for each (_local10 in _local9) {
_arg1[_local10.localName()] = _local10.toString();
};
_local11 = _local8.*;
for each (_local12 in _local11) {
if (_local12.hasSimpleContent()){
_arg1[_local12.localName()] = _local12.toString();
};
};
_local2.push(_arg1);
};
return (_local2);
//unresolved jump
};
throw (new TypeError((("Error: Type Coercion failed: cannot convert " + _arg1) + " to Array or DataProvider.")));
}
public function removeItemAt(_arg1:uint):Object{
var _local2:Array;
checkIndex(_arg1, (data.length - 1));
dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1);
_local2 = data.splice(_arg1, 1);
dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1);
return (_local2[0]);
}
public function addItem(_arg1:Object):void{
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
data.push(_arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
}
public function sortOn(_arg1:Object, _arg2:Object=null){
var _local3:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local3 = data.sortOn(_arg1, _arg2);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local3);
}
public function sort(... _args){
var _local2:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local2 = data.sort.apply(data, _args);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local2);
}
public function addItems(_arg1:Object):void{
addItemsAt(_arg1, data.length);
}
public function concat(_arg1:Object):void{
addItems(_arg1);
}
public function clone():DataProvider{
return (new DataProvider(data));
}
public function toArray():Array{
return (data.concat());
}
public function get length():uint{
return (data.length);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
checkIndex(_arg2, data.length);
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
data.splice(_arg2, 0, _arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
}
public function getItemAt(_arg1:uint):Object{
checkIndex(_arg1, (data.length - 1));
return (data[_arg1]);
}
override public function toString():String{
return ((("DataProvider [" + data.join(" , ")) + "]"));
}
public function invalidateItem(_arg1:Object):void{
var _local2:uint;
_local2 = getItemIndex(_arg1);
if (_local2 == -1){
return;
};
invalidateItemAt(_local2);
}
protected function dispatchChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
protected function checkIndex(_arg1:int, _arg2:int):void{
if ((((_arg1 > _arg2)) || ((_arg1 < 0)))){
throw (new RangeError((((("DataProvider index (" + _arg1) + ") is not in acceptable range (0 - ") + _arg2) + ")")));
};
}
public function addItemsAt(_arg1:Object, _arg2:uint):void{
var _local3:Array;
checkIndex(_arg2, data.length);
_local3 = getDataFromObject(_arg1);
dispatchPreChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
data.splice.apply(data, [_arg2, 0].concat(_local3));
dispatchChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
}
public function replaceItem(_arg1:Object, _arg2:Object):Object{
var _local3:int;
_local3 = getItemIndex(_arg2);
if (_local3 != -1){
return (replaceItemAt(_arg1, _local3));
};
return (null);
}
public function removeItem(_arg1:Object):Object{
var _local2:int;
_local2 = getItemIndex(_arg1);
if (_local2 != -1){
return (removeItemAt(_local2));
};
return (null);
}
public function merge(_arg1:Object):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Object;
_local2 = getDataFromObject(_arg1);
_local3 = _local2.length;
_local4 = data.length;
dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
_local5 = 0;
while (_local5 < _local3) {
_local6 = _local2[_local5];
if (getItemIndex(_local6) == -1){
data.push(_local6);
};
_local5++;
};
if (data.length > _local4){
dispatchChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
} else {
dispatchChangeEvent(DataChangeType.ADD, [], -1, -1);
};
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
var _local3:Array;
checkIndex(_arg2, (data.length - 1));
_local3 = [data[_arg2]];
dispatchPreChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
data[_arg2] = _arg1;
dispatchChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
return (_local3[0]);
}
public function invalidate():void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, DataChangeType.INVALIDATE_ALL, data.concat(), 0, data.length));
}
public function removeAll():void{
var _local1:Array;
_local1 = data.concat();
dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
data = [];
dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
}
}
}//package fl.data
Section 108
//SimpleCollectionItem (fl.data.SimpleCollectionItem)
package fl.data {
public dynamic class SimpleCollectionItem {
public var label:String;
public var data:String;
public function toString():String{
return ((((("[SimpleCollectionItem: " + label) + ",") + data) + "]"));
}
}
}//package fl.data
Section 109
//TileListCollectionItem (fl.data.TileListCollectionItem)
package fl.data {
public dynamic class TileListCollectionItem {
public var label:String;
public var source:String;
public function toString():String{
return ((((("[TileListCollectionItem: " + label) + ",") + source) + "]"));
}
}
}//package fl.data
Section 110
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 111
//DataChangeEvent (fl.events.DataChangeEvent)
package fl.events {
import flash.events.*;
public class DataChangeEvent extends Event {
protected var _items:Array;
protected var _endIndex:uint;
protected var _changeType:String;
protected var _startIndex:uint;
public static const PRE_DATA_CHANGE:String = "preDataChange";
public static const DATA_CHANGE:String = "dataChange";
public function DataChangeEvent(_arg1:String, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{
super(_arg1);
_changeType = _arg2;
_startIndex = _arg4;
_items = _arg3;
_endIndex = ((_arg5)==-1) ? _startIndex : _arg5;
}
public function get changeType():String{
return (_changeType);
}
public function get startIndex():uint{
return (_startIndex);
}
public function get items():Array{
return (_items);
}
override public function clone():Event{
return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex));
}
override public function toString():String{
return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable"));
}
public function get endIndex():uint{
return (_endIndex);
}
}
}//package fl.events
Section 112
//DataChangeType (fl.events.DataChangeType)
package fl.events {
public class DataChangeType {
public static const ADD:String = "add";
public static const REMOVE:String = "remove";
public static const REMOVE_ALL:String = "removeAll";
public static const CHANGE:String = "change";
public static const REPLACE:String = "replace";
public static const INVALIDATE:String = "invalidate";
public static const INVALIDATE_ALL:String = "invalidateAll";
public static const SORT:String = "sort";
}
}//package fl.events
Section 113
//ListEvent (fl.events.ListEvent)
package fl.events {
import flash.events.*;
public class ListEvent extends Event {
protected var _index:int;
protected var _item:Object;
protected var _columnIndex:int;
protected var _rowIndex:int;
public static const ITEM_DOUBLE_CLICK:String = "itemDoubleClick";
public static const ITEM_ROLL_OUT:String = "itemRollOut";
public static const ITEM_ROLL_OVER:String = "itemRollOver";
public static const ITEM_CLICK:String = "itemClick";
public function ListEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:int=-1, _arg7:Object=null){
super(_arg1, _arg2, _arg3);
_rowIndex = _arg5;
_columnIndex = _arg4;
_index = _arg6;
_item = _arg7;
}
public function get rowIndex():Object{
return (_rowIndex);
}
public function get index():int{
return (_index);
}
public function get item():Object{
return (_item);
}
public function get columnIndex():int{
return (_columnIndex);
}
override public function clone():Event{
return (new ListEvent(type, bubbles, cancelable, _columnIndex, _rowIndex));
}
override public function toString():String{
return (formatToString("ListEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "index", "item"));
}
}
}//package fl.events
Section 114
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 115
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 116
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 117
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 118
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 119
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 120
//Circ (gs.easing.Circ)
package gs.easing {
public class Circ {
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 gs.easing
Section 121
//Quint (gs.easing.Quint)
package gs.easing {
public class Quint {
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 gs.easing
Section 122
//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(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 123
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
}
}//package gs.plugins
Section 124
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
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 gs.plugins
Section 125
//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 _beziers:Object;
protected var _target:Object;
protected static const _RAD2DEG:Number = (180 / Math.PI);
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 set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:int;
var _local9:Object;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
var _local13:Array;
var _local14:Number;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_local8 = ((_local7)<0) ? -1 : 1;
_target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7);
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local9 = _target;
_local10 = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = (_arg1 + 0.01);
_target = _local9;
this.round = _local10;
_orient = true;
_local2 = 0;
while (_local2 < _orientData.length) {
_local13 = _orientData[_local2];
_local14 = ((_local13[3]) || (0));
_local11 = (_future[_local13[0]] - _target[_local13[0]]);
_local12 = (_future[_local13[1]] - _target[_local13[1]]);
_target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14);
_local2++;
};
};
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local4:Object;
var _local5:int;
var _local6:String;
_target = _arg1.target;
if (_arg1.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if ((_arg1.exposedVars.orientToBezier is Array)){
_orientData = _arg1.exposedVars.orientToBezier;
_orient = true;
};
};
_local4 = {};
_local5 = 0;
while (_local5 < _arg2.length) {
for (_local6 in _arg2[_local5]) {
if (_local4[_local6] == undefined){
_local4[_local6] = [_arg1.target[_local6]];
};
if (typeof(_arg2[_local5][_local6]) == "number"){
_local4[_local6].push(_arg2[_local5][_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg2[_local5][_local6])));
};
};
_local5++;
};
for (_local6 in _local4) {
this.overwriteProps[this.overwriteProps.length] = _local6;
if (_arg1.exposedVars[_local6] != undefined){
if (typeof(_arg1.exposedVars[_local6]) == "number"){
_local4[_local6].push(_arg1.exposedVars[_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg1.exposedVars[_local6])));
};
delete _arg1.exposedVars[_local6];
_local5 = (_arg1.tweens.length - 1);
while (_local5 > -1) {
if (_arg1.tweens[_local5].name == _local6){
_arg1.tweens.splice(_local5, 1);
};
_local5--;
};
};
};
_beziers = parseBeziers(_local4, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local7 = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package gs.plugins
Section 126
//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(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package gs.plugins
Section 127
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
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 gs.plugins
Section 128
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
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.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(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:Object;
var _local5:Array;
_target = _arg1;
_type = ColorMatrixFilter;
_local4 = _arg2;
initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
_local5 = [];
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{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = (1 - _arg2);
_local4 = (_local3 * _lumR);
_local5 = (_local3 * _lumG);
_local6 = (_local3 * _lumB);
_local7 = [(_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{
var _local3:Number;
var _local4:Number;
var _local5:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
_local3 = Math.cos(_arg2);
_local4 = Math.sin(_arg2);
_local5 = [((_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{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = [(_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 _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
_local3 = [];
_local4 = 0;
_local5 = 0;
_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{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
_local4 = (((_arg2 >> 16) & 0xFF) / 0xFF);
_local5 = (((_arg2 >> 8) & 0xFF) / 0xFF);
_local6 = ((_arg2 & 0xFF) / 0xFF);
_local7 = (1 - _arg3);
_local8 = [(_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{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
_local3 = [_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 gs.plugins
Section 129
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
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 gs.plugins
Section 130
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _info:Array;
protected var _a: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"];
}
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--;
};
};
}
public function init(_arg1:Array, _arg2:Array):void{
var _local3:int;
_a = _arg1;
_local3 = (_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);
}
}
}//package gs.plugins
Section 131
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
protected var _remove:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array;
_local4 = _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;
}
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 _local3:Array;
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local7:Object;
_local3 = _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;
};
_local7 = ((_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);
};
};
};
};
}
}
}//package gs.plugins
Section 132
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
}
}//package gs.plugins
Section 133
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
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 gs.plugins
Section 134
//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(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
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);
}
override public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (_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;
};
}
}
}//package gs.plugins
Section 135
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 136
//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(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 137
//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(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "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 (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]);
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number;
_local5 = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 138
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import flash.geom.*;
import gs.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
protected var _target:DisplayObject;
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(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:ColorTransform;
if (!(_arg1 is DisplayObject)){
return (false);
};
_local4 = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package gs.plugins
Section 139
//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 round:Boolean;
public var onComplete:Function;
public var propName:String;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
_changeFactor = 0;
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 gs.plugins
Section 140
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
}
}//package gs.plugins
Section 141
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import flash.media.*;
import gs.*;
public class VolumePlugin extends TweenPlugin {
protected var _st:SoundTransform;
protected var _target:Object;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
}
}//package gs.plugins
Section 142
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var index:uint;
public var start:Number;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 143
//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(_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 gs.utils.tween
Section 144
//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 static function killVars(_arg1:Object, _arg2:Object, _arg3:Array):void{
var _local4:int;
var _local5:String;
var _local6:TweenInfo;
_local4 = (_arg3.length - 1);
while (_local4 > -1) {
_local6 = _arg3[_local4];
if ((_local6.name in _arg1)){
_arg3.splice(_local4, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_arg1);
if (_local6.target.overwriteProps.length == 0){
_arg3.splice(_local4, 1);
};
};
};
_local4--;
};
for (_local5 in _arg1) {
delete _arg2[_local5];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local3:Object;
var _local4:int;
var _local5:Number;
var _local6:Array;
var _local7:int;
var _local8:TweenLite;
var _local9:int;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
_local3 = _arg1.vars;
_local4 = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
_local5 = _arg1.startTime;
_local6 = [];
_local9 = -1;
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (_local8 == _arg1){
_local9 = _local7;
} else {
if ((((((_local7 < _local9)) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
};
_local7--;
};
if ((((_local6.length == 0)) || ((_arg1.tweens.length == 0)))){
return;
};
if (_local4 == AUTO){
_local10 = _arg1.tweens;
_local11 = {};
_local7 = (_local10.length - 1);
while (_local7 > -1) {
_local13 = _local10[_local7];
if (_local13.isPlugin){
if (_local13.name == "_MULTIPLE_"){
_local14 = _local13.target.overwriteProps;
_local12 = (_local14.length - 1);
while (_local12 > -1) {
_local11[_local14[_local12]] = true;
_local12--;
};
} else {
_local11[_local13.name] = true;
};
_local11[_local13.target.propName] = true;
} else {
_local11[_local13.name] = true;
};
_local7--;
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
killVars(_local11, _local6[_local7].exposedVars, _local6[_local7].tweens);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1: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 = _slot1;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 145
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var started: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 vars:Object;
public var ease:Function;
public var tweens:Array;
public var exposedVars:Object;
public var combinedTimeScale:Number;
public var initTime: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(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == 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 = _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));
_local4 = ((((_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 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 _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = ((_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 get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4: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 (_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 _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
_local2 = (currentTime = getTimer());
_local3 = 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{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = 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 gs
Section 146
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
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(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
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 _slot1)))){
_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 ((((_arg2 == 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 set repeatCount(_arg1:Number):void{
_repeatCount = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
if (!_arg1){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
override public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_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);
};
}
protected function adjustStartValues():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:TweenInfo;
var _local6:int;
_local1 = this.progress;
if (_local1 != 0){
_local2 = this.ease(_local1, 0, 1, 1);
_local3 = (1 / (1 - _local2));
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
_local5 = this.tweens[_local6];
_local4 = (_local5.start + _local5.change);
if (_local5.isPlugin){
_local5.change = ((_local4 - _local2) * _local3);
} else {
_local5.change = ((_local4 - _local5.target[_local5.property]) * _local3);
};
_local5.start = (_local4 - _local5.change);
_local6--;
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
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 get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function killProperties(_arg1:Array):void{
var _local2:Object;
var _local3:int;
_local2 = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
_local2[_arg1[_local3]] = true;
_local3--;
};
killVars(_local2);
}
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];
};
}
override public function complete(_arg1: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 = (_arg1) ? (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(_arg1);
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 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 (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get progress():Number{
var _local1:Number;
var _local2:Number;
_local1 = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
_local2 = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function get repeatCount():Number{
return (_repeatCount);
}
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(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local4:Number;
var _local5:int;
var _local6:TweenInfo;
var _local7:Object;
var _local8:Object;
var _local9:Array;
var _local10:Boolean;
var _local11:Array;
var _local12:Object;
_local4 = this.progress;
if (this.initted){
if (!_arg3){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
_local6.target[_local6.property] = _local6.start;
};
_local5--;
};
};
_local7 = this.vars;
_local8 = this.exposedVars;
_local9 = this.tweens;
_local10 = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
_local11 = this.tweens;
this.vars = _local7;
this.exposedVars = _local8;
this.tweens = _local9;
_local12 = {};
_local12[_arg1] = true;
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
this.tweens.splice(_local5, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_local12);
if (_local6.target.overwriteProps.length == 0){
this.tweens.splice(_local5, 1);
};
};
};
_local5--;
};
this.tweens = this.tweens.concat(_local11);
_hasPlugins = Boolean(((_local10) || (_hasPlugins)));
};
this.vars[_arg1] = (this.exposedVars[_arg1] = _arg2);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
override public function initTweenVals():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7: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))))){
_local5 = this.exposedVars.roundProps;
_local1 = (_local5.length - 1);
while (_local1 > -1) {
_local3 = _local5[_local1];
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local7 = this.tweens[_local2];
if (_local7.name == _local3){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
_hasPlugins = true;
this.tweens[_local2] = new TweenInfo(_local6, "changeFactor", 0, 1, _local3, true);
} else {
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
this.tweens.splice(_local2, 1);
};
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local2--;
};
_local1--;
};
};
}
protected function initDispatcher():void{
var _local1:Object;
var _local2: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 {
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
};
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);
};
};
}
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 progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 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 reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
var _local3:Number;
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
_local3 = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
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(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local2:Dictionary;
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
_local2 = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is _slot1)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:TweenLite;
var _local5:int;
_local2 = masterList[_arg1];
_local3 = [];
if (_local2 != null){
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (!_local2[_local5].gc){
_local3[_local3.length] = _local2[_local5];
};
_local5--;
};
};
for each (_local4 in _pausedTweens) {
if (_local4.target == _arg1){
_local3[_local3.length] = _local4;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array;
var _local3:int;
_local2 = getTweensOf(_arg1);
_local3 = (_local2.length - 1);
while (_local3 > -1) {
if (((((_local2[_local3].active) || ((_local2[_local3].startTime == currentTime)))) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local4:Array;
var _local5:Boolean;
var _local6:int;
_local4 = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is _slot1)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local4:Array;
var _local5:Boolean;
var _local6:int;
_local4 = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function getAllTweens():Array{
var _local1:Dictionary;
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
_local1 = masterList;
_local2 = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 147
//achipopups (achipopups)
package {
import flash.display.*;
public dynamic class achipopups extends MovieClip {
}
}//package
Section 148
//Actor (Actor)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class Actor extends EventDispatcher {
protected var _disfraz:DisplayObject;
protected var _tipoActor:int;
protected var _indice:int;
protected var _cuerpo:b2Body;
public function Actor(_arg1:b2Body, _arg2:DisplayObject){
if (_arg1 != null){
_cuerpo = _arg1;
_cuerpo.SetUserData(this);
} else {
_cuerpo = null;
};
_disfraz = _arg2;
actualizaMiApariencia();
}
public function set tipoActor(_arg1:int):void{
_tipoActor = _arg1;
}
public function explotar():void{
}
protected function limpiarAntesDeBorrar():void{
}
protected function gestionarFueraDeLimites():void{
}
public function get disfraz():DisplayObject{
return (_disfraz);
}
public function set indice(_arg1:int):void{
_indice = _arg1;
}
public function get indice():int{
return (_indice);
}
public function destruir():void{
limpiarAntesDeBorrar();
_disfraz.parent.removeChild(_disfraz);
if (_cuerpo != null){
VariablesGlobales.mundo.DestroyBody(_cuerpo);
};
}
public function get cuerpo():b2Body{
return (_cuerpo);
}
public function get tipoActor():int{
return (_tipoActor);
}
public function afectadoPorExplosion():void{
}
public function set disfraz(_arg1:DisplayObject):void{
_disfraz = _arg1;
}
private function actualizaMiApariencia():void{
if (_cuerpo != null){
_disfraz.x = (_cuerpo.GetPosition().x * VariablesGlobales.RATIO);
_disfraz.y = (_cuerpo.GetPosition().y * VariablesGlobales.RATIO);
_disfraz.rotation = ((_cuerpo.GetAngle() * 180) / Math.PI);
};
}
public function aplicarFuerza(_arg1:b2Vec2, _arg2:b2Vec2):void{
_cuerpo.ApplyForce(_arg1, _arg2);
}
public function actualizaAhora():void{
actualizaMiApariencia();
actualizacionEspecificaHijo();
if (!VariablesGlobales.limitesMundo.containsPoint(new Point(_disfraz.x, _disfraz.y))){
gestionarFueraDeLimites();
};
}
protected function actualizacionEspecificaHijo():void{
}
public function set cuerpo(_arg1:b2Body):void{
_cuerpo = _arg1;
}
}
}//package
Section 149
//Alien (Alien)
package {
import flash.display.*;
public dynamic class Alien extends MovieClip {
}
}//package
Section 150
//AlienActor (AlienActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class AlienActor extends Actor {
private var _vivo:Boolean;// = true
public function AlienActor(_arg1:DisplayObjectContainer, _arg2:Point){
var _local3:Sprite;
var _local4:Object;
var _local5:b2BodyDef;
var _local6:b2Body;
_vivo = true;
_local3 = new Alien();
_local4 = new b2PolygonDef();
_local4.vertexCount = 5;
b2Vec2(_local4.vertices[0]).Set((6 / VariablesGlobales.RATIO), (0 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[1]).Set((24 / VariablesGlobales.RATIO), (0 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[2]).Set((24 / VariablesGlobales.RATIO), (17 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[3]).Set((18 / VariablesGlobales.RATIO), (30 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[4]).Set((10 / VariablesGlobales.RATIO), (30 / VariablesGlobales.RATIO));
_arg1.addChild(_local3);
_local4.density = 10.1;
_local4.friction = 0.1;
_local4.restitution = 0.1;
_local4.userData = this;
_local5 = new b2BodyDef();
_local5.position.Set((_arg2.x / VariablesGlobales.RATIO), (_arg2.y / VariablesGlobales.RATIO));
_local5.isBullet = true;
_local6 = VariablesGlobales.mundo.CreateBody(_local5);
_local6.CreateShape(b2ShapeDef(_local4));
_local6.SetMassFromShapes();
super(_local6, _local3);
}
override public function afectadoPorExplosion():void{
var _local1:AlienExplosion;
if (_vivo){
_local1 = new AlienExplosion(VariablesGlobales.motor.lienzoEfectos, new Point(disfraz.x, disfraz.y), new Point(cuerpo.GetLinearVelocity().x, cuerpo.GetLinearVelocity().y), disfraz.rotation);
VariablesGlobales.motor.alienMuerto();
VariablesGlobales.motor.eliminarActor(this);
_vivo = false;
VariablesGlobales.aliens_muertos_1_tiro = (VariablesGlobales.aliens_muertos_1_tiro + 1);
if (VariablesGlobales.aliens_muertos_1_tiro >= 5){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.MASSACRE, _disfraz.parent.parent);
};
};
super.afectadoPorExplosion();
}
override protected function gestionarFueraDeLimites():void{
if (_vivo){
VariablesGlobales.motor.alienMuerto();
VariablesGlobales.motor.eliminarActor(this);
_vivo = false;
VariablesGlobales.aliens_caidos_1_tiro = (VariablesGlobales.aliens_caidos_1_tiro + 1);
if (VariablesGlobales.aliens_caidos_1_tiro >= 5){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.FREE_FALL, _disfraz.parent.parent);
};
};
super.gestionarFueraDeLimites();
}
}
}//package
Section 151
//AlienBlindado (AlienBlindado)
package {
import flash.display.*;
public dynamic class AlienBlindado extends MovieClip {
}
}//package
Section 152
//AlienBlindadoActor (AlienBlindadoActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class AlienBlindadoActor extends Actor {
private var _vivo:Boolean;// = true
public function AlienBlindadoActor(_arg1:DisplayObjectContainer, _arg2:Point){
var _local3:Sprite;
var _local4:Object;
var _local5:b2BodyDef;
var _local6:b2Body;
_vivo = true;
_local3 = new AlienBlindado();
_local4 = new b2PolygonDef();
_local4.vertexCount = 5;
b2Vec2(_local4.vertices[0]).Set((6 / VariablesGlobales.RATIO), (0 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[1]).Set((24 / VariablesGlobales.RATIO), (0 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[2]).Set((24 / VariablesGlobales.RATIO), (17 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[3]).Set((18 / VariablesGlobales.RATIO), (30 / VariablesGlobales.RATIO));
b2Vec2(_local4.vertices[4]).Set((10 / VariablesGlobales.RATIO), (30 / VariablesGlobales.RATIO));
_arg1.addChild(_local3);
_local4.density = 10.1;
_local4.friction = 0.1;
_local4.restitution = 0.1;
_local4.userData = this;
_local5 = new b2BodyDef();
_local5.position.Set((_arg2.x / VariablesGlobales.RATIO), (_arg2.y / VariablesGlobales.RATIO));
_local5.isBullet = true;
_local6 = VariablesGlobales.mundo.CreateBody(_local5);
_local6.CreateShape(b2ShapeDef(_local4));
_local6.SetMassFromShapes();
super(_local6, _local3);
}
override public function afectadoPorExplosion():void{
if (_vivo){
};
super.afectadoPorExplosion();
}
override protected function gestionarFueraDeLimites():void{
if (_vivo){
VariablesGlobales.motor.alienMuerto();
VariablesGlobales.motor.eliminarActor(this);
_vivo = false;
};
super.gestionarFueraDeLimites();
}
}
}//package
Section 153
//AlienExplosion (AlienExplosion)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import gs.*;
import gs.easing.*;
public class AlienExplosion extends MovieClip {
private var _padre:DisplayObjectContainer;
private var _vidaEnFrames:int;// = 2500
private var _disfraz:MovieClip;
public function AlienExplosion(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Point, _arg4:Number){
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
_vidaEnFrames = 2500;
super();
_padre = _arg1;
_disfraz = new Alien();
_disfraz.x = _arg2.x;
_disfraz.y = _arg2.y;
_disfraz.rotation = _arg4;
_padre.addChild(_disfraz);
_disfraz.stop();
_local5 = ((_arg2.y - (VariablesGlobales.ALTO_PANTALLA / 2)) + (Math.random() * VariablesGlobales.ALTO_PANTALLA));
if ((Math.random() * 100) >= 50){
_local5 = (_local5 + 100);
} else {
_local5 = (_local5 - 100);
};
_local5 = (_arg2.y - 100);
trace(("v: " + _local5));
_local6 = ((_arg2.x - (VariablesGlobales.ANCHO_PANTALLA / 2)) + (Math.random() * VariablesGlobales.ANCHO_PANTALLA));
_local6 = _arg2.x;
if ((Math.random() * 100) >= 50){
_local6 = (_local6 + 200);
} else {
_local6 = (_local6 - 200);
};
trace(("h: " + _local6));
if (_local6 < 0){
_local6 = 100;
};
_local7 = ((Math.random() * 4) + 4);
_local8 = (Math.random() * 180);
if ((Math.random() * 100) >= 50){
_local8 = (_local8 * -1);
};
TweenLite.to(_disfraz, 0.5, {x:_local6, y:_local5, scaleX:_local7, scaleY:_local7, rotation:_local8, ease:Quint.easeOut, onComplete:manejarResbalar});
addEventListener(Event.ENTER_FRAME, manejarNuevoFrame);
_local9 = ((Math.random() * 3) + 1);
VariablesGlobales.SoundMan.playSound(String(("picarcristal" + int(_local9))), 1, 0, 0);
}
private function manejarNuevoFrame(_arg1:Event):void{
}
private function manejarResbalar():void{
var _local1:Number;
var _local2:Number;
_local1 = (_disfraz.y + 800);
_local2 = ((Math.random() * 100) + 1);
_local2 = (_local2 / 100);
_local2 = (1 + _local2);
TweenLite.to(_disfraz, _local2, {y:_local1, ease:Circ.easeIn, onComplete:manejarFinalizar});
_local2 = ((Math.random() * 3) + 1);
VariablesGlobales.SoundMan.playSound(String(("arrastracristal" + int(_local2))), 1, 0, 0);
}
private function manejarFinalizar():void{
_padre.removeChild(_disfraz);
}
}
}//package
Section 154
//arrastracristal1 (arrastracristal1)
package {
import flash.media.*;
public dynamic class arrastracristal1 extends Sound {
}
}//package
Section 155
//arrastracristal2 (arrastracristal2)
package {
import flash.media.*;
public dynamic class arrastracristal2 extends Sound {
}
}//package
Section 156
//arrastracristal3 (arrastracristal3)
package {
import flash.media.*;
public dynamic class arrastracristal3 extends Sound {
}
}//package
Section 157
//avionpasa2 (avionpasa2)
package {
import flash.media.*;
public dynamic class avionpasa2 extends Sound {
}
}//package
Section 158
//avionpasa3 (avionpasa3)
package {
import flash.media.*;
public dynamic class avionpasa3 extends Sound {
}
}//package
Section 159
//bomba_01 (bomba_01)
package {
import flash.display.*;
public dynamic class bomba_01 extends Sprite {
}
}//package
Section 160
//bomba_02 (bomba_02)
package {
import flash.display.*;
public dynamic class bomba_02 extends MovieClip {
}
}//package
Section 161
//bomba_03 (bomba_03)
package {
import flash.display.*;
public dynamic class bomba_03 extends MovieClip {
}
}//package
Section 162
//bomba_04 (bomba_04)
package {
import flash.display.*;
public dynamic class bomba_04 extends MovieClip {
}
}//package
Section 163
//bomba_05 (bomba_05)
package {
import flash.display.*;
public dynamic class bomba_05 extends MovieClip {
}
}//package
Section 164
//bomba_06 (bomba_06)
package {
import flash.display.*;
public dynamic class bomba_06 extends MovieClip {
}
}//package
Section 165
//bomba_07 (bomba_07)
package {
import flash.display.*;
public dynamic class bomba_07 extends MovieClip {
}
}//package
Section 166
//bomba_08 (bomba_08)
package {
import flash.display.*;
public dynamic class bomba_08 extends MovieClip {
}
}//package
Section 167
//bomba1 (bomba1)
package {
import flash.media.*;
public dynamic class bomba1 extends Sound {
}
}//package
Section 168
//bomba2 (bomba2)
package {
import flash.media.*;
public dynamic class bomba2 extends Sound {
}
}//package
Section 169
//bomba3 (bomba3)
package {
import flash.media.*;
public dynamic class bomba3 extends Sound {
}
}//package
Section 170
//BombaBaseActor (BombaBaseActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
import com.tanoku.utilidades.*;
public class BombaBaseActor extends Actor {
private var _radioAccion:Number;// = 0
private var _cayendo:Boolean;// = true
private var _tipo:int;
private var _datosBomba:Array;
private var _silbido:Boolean;// = true
private var _potenciaExplosion:Number;// = 0
private var _armada:Boolean;// = true
private var _tiempoRetardo:Number;// = 150
private var _contadorFrames:Number;
private var _cuentaAtras:Boolean;// = false
private var _inerciaInicial:b2Vec2;
public static const BOMBA_NO_EXPLOSIVA:int = 5;
public static const BOMBA_EXPLOSIVA_ALIEN:int = 3;
public static const BOMBA_ATRACCION:int = 7;
public static const BOMBA_REPULSION:int = 8;
public static const CANTIDAD_BOMBAS_LLUVIAS:int = 10;
public static const BOMBA_EXPLOSIVA_RETARDADA:int = 2;
public static const BOMBA_EXPLOSIVA_LLUVIA:int = 4;
public static const BOMBA_EXPLOSIVA_DIRECTA:int = 1;
public static const BOMBA_EXPLOSIVA_RETARDADA_ELASTICA:int = 6;
public function BombaBaseActor(_arg1:DisplayObjectContainer, _arg2:int, _arg3:Point, _arg4:Point){
var _local5:Sprite;
var _local6:Object;
var _local7:b2BodyDef;
var _local8:b2Body;
var _local9:Point;
_datosBomba = new Array([0, 0], [7, 250, 15], [5, 250, 15], [5, 250, 15], [2, 250, 10], [0, 0, 20], [7, 250, 15], [10, 500, 15], [10, 500, 15]);
_armada = true;
_radioAccion = 0;
_potenciaExplosion = 0;
_cuentaAtras = false;
_tiempoRetardo = 150;
_cayendo = true;
_silbido = true;
_tipo = _arg2;
switch (_tipo){
case BOMBA_EXPLOSIVA_DIRECTA:
_local5 = new bomba_01();
_local6 = new b2PolygonDef();
_local6.vertexCount = 4;
b2Vec2(_local6.vertices[0]).Set((-5 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[1]).Set((5 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[2]).Set((5 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[3]).Set((-5 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
break;
case BOMBA_EXPLOSIVA_RETARDADA:
_local5 = new bomba_02();
_local6 = new b2CircleDef();
_local6.radius = ((15 / 2) / VariablesGlobales.RATIO);
break;
case BOMBA_EXPLOSIVA_ALIEN:
_local5 = new bomba_03();
_local6 = new b2CircleDef();
_local6.radius = ((15 / 2) / VariablesGlobales.RATIO);
break;
case BOMBA_EXPLOSIVA_LLUVIA:
_local5 = new bomba_04();
_local6 = new b2PolygonDef();
_local6.vertexCount = 4;
b2Vec2(_local6.vertices[0]).Set((-2.5 / VariablesGlobales.RATIO), (-7 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[1]).Set((2.5 / VariablesGlobales.RATIO), (-7 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[2]).Set((2.5 / VariablesGlobales.RATIO), (7 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[3]).Set((-2.5 / VariablesGlobales.RATIO), (7 / VariablesGlobales.RATIO));
break;
case BOMBA_NO_EXPLOSIVA:
_local5 = new bomba_05();
_local6 = new b2CircleDef();
_local6.radius = ((15 / 2) / VariablesGlobales.RATIO);
break;
case BOMBA_EXPLOSIVA_RETARDADA_ELASTICA:
_local5 = new bomba_06();
_local6 = new b2CircleDef();
_local6.radius = ((15 / 2) / VariablesGlobales.RATIO);
break;
case BOMBA_ATRACCION:
_local5 = new bomba_07();
_local6 = new b2PolygonDef();
_local6.vertexCount = 4;
b2Vec2(_local6.vertices[0]).Set((-5 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[1]).Set((5 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[2]).Set((5 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[3]).Set((-5 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
break;
case BOMBA_REPULSION:
_local5 = new bomba_08();
_local6 = new b2PolygonDef();
_local6.vertexCount = 4;
b2Vec2(_local6.vertices[0]).Set((-5 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[1]).Set((5 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[2]).Set((5 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
b2Vec2(_local6.vertices[3]).Set((-5 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
break;
default:
trace("error: tipo bomba");
};
_radioAccion = ((_datosBomba[_tipo][0] * VariablesGlobales.LADO_TILE) / VariablesGlobales.RATIO);
_potenciaExplosion = _datosBomba[_tipo][1];
_arg1.addChildAt(_local5, 0);
_local6.density = 10;
_local6.friction = 0.1;
_local6.restitution = 0.1;
_local6.filter.groupIndex = -1;
_local6.userData = this;
if (_tipo == BombaBaseActor.BOMBA_NO_EXPLOSIVA){
_local6.density = 500;
_local6.friction = 1;
};
if (_tipo == BombaBaseActor.BOMBA_EXPLOSIVA_RETARDADA_ELASTICA){
_local6.restitution = 0.75;
};
_local7 = new b2BodyDef();
_local7.position.Set((_arg3.x / VariablesGlobales.RATIO), (_arg3.y / VariablesGlobales.RATIO));
_local7.isBullet = true;
_local7.angle = Matematicas.anguloEntrePuntos(_arg3, _arg4);
trace(_local7.angle);
_local8 = VariablesGlobales.mundo.CreateBody(_local7);
_local8.CreateShape(b2ShapeDef(_local6));
_local8.SetMassFromShapes();
_local9 = new Point(_arg4.x, _arg4.y).subtract(_arg3);
_local9.normalize(Number(_datosBomba[_tipo][2]));
_inerciaInicial = new b2Vec2(_local9.x, _local9.y);
trace(((("origen :" + _arg3.x) + ",") + _arg3.y));
trace(((("destino :" + _arg4.x) + ",") + _arg4.y));
trace(((("inercia :" + _inerciaInicial.x) + ",") + _inerciaInicial.y));
_local8.SetLinearVelocity(_inerciaInicial);
if (_inerciaInicial.x > 0){
_local8.SetAngularVelocity(0.5);
} else {
_local8.SetAngularVelocity(-0.5);
};
VariablesGlobales.SoundMan.stopSound("silbido1");
VariablesGlobales.SoundMan.playSound("silbido1", 1, 0, 1);
VariablesGlobales.numero_rebotes_bomba = 0;
super(_local8, _local5);
}
private function iniciarCuentaAtras():void{
_cuentaAtras = true;
_cayendo = false;
}
private function detonarAhora():void{
VariablesGlobales.mundo.explode(cuerpo.GetShapeList(), cuerpo.GetPosition(), _radioAccion, _potenciaExplosion, _disfraz.parent);
VariablesGlobales.motor.eliminarActor(this);
}
public function get tipo():int{
return (_tipo);
}
override protected function gestionarFueraDeLimites():void{
if (((_cayendo) && (_silbido))){
VariablesGlobales.SoundMan.fadeSound("silbido1", 0, 1);
};
VariablesGlobales.motor.eliminarActor(this);
if (tipo != BOMBA_NO_EXPLOSIVA){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.WHERE_DO_YOU_AIM, disfraz.parent.parent);
};
VariablesGlobales.numero_bombas_fuera_nivel = (VariablesGlobales.numero_bombas_fuera_nivel + 1);
if (VariablesGlobales.numero_bombas_fuera_nivel >= 5){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.WASTE_OF_MONEY, disfraz.parent.parent);
};
super.gestionarFueraDeLimites();
}
override public function explotar():void{
ControlSonido();
if (_armada){
_armada = false;
_cayendo = false;
switch (_tipo){
case BOMBA_EXPLOSIVA_DIRECTA:
detonarAhora();
break;
case BOMBA_EXPLOSIVA_RETARDADA:
iniciarCuentaAtras();
break;
case BOMBA_EXPLOSIVA_ALIEN:
break;
case BOMBA_EXPLOSIVA_LLUVIA:
detonarAhora();
break;
case BOMBA_NO_EXPLOSIVA:
break;
case BOMBA_EXPLOSIVA_RETARDADA_ELASTICA:
iniciarCuentaAtras();
break;
case BOMBA_ATRACCION:
detonarAhora();
break;
case BOMBA_REPULSION:
detonarAhora();
break;
default:
trace("error: tipo bomba");
};
};
super.explotar();
}
public function colisionaContraAlien():void{
if (_tipo == BombaBaseActor.BOMBA_EXPLOSIVA_ALIEN){
detonarAhora();
};
}
public function set tipo(_arg1:int):void{
_tipo = _arg1;
}
override protected function actualizacionEspecificaHijo():void{
var _local1:Number;
if (_cuentaAtras){
_tiempoRetardo = (_tiempoRetardo - 1);
if (_tiempoRetardo <= 0){
detonarAhora();
};
};
if (_tipo == BombaBaseActor.BOMBA_EXPLOSIVA_ALIEN){
if ((((cuerpo.GetLinearVelocity().x == 0)) && ((cuerpo.GetLinearVelocity().y == 0)))){
};
};
if (tipo == BombaBaseActor.BOMBA_NO_EXPLOSIVA){
_local1 = cuerpo.GetLinearVelocity().Copy().Normalize();
if (_local1 < 0.02){
_contadorFrames = (_contadorFrames + 1);
if (_contadorFrames >= _tiempoRetardo){
VariablesGlobales.motor.eliminarActor(this);
};
} else {
_contadorFrames = 0;
};
};
if (!_cayendo){
if (_silbido){
VariablesGlobales.SoundMan.stopSound("silbido1");
_silbido = false;
};
};
super.actualizacionEspecificaHijo();
}
private function ControlSonido():void{
var _local1:int;
_local1 = ((Math.random() * 3) + 1);
switch (_tipo){
case BOMBA_EXPLOSIVA_RETARDADA:
VariablesGlobales.SoundMan.playSound(String(("metal" + _local1)), 0.3, 0, 0);
break;
case BOMBA_EXPLOSIVA_ALIEN:
VariablesGlobales.SoundMan.playSound(String(("metal" + _local1)), 0.3, 0, 0);
break;
case BOMBA_NO_EXPLOSIVA:
VariablesGlobales.SoundMan.playSound(String(("metal" + _local1)), 0.3, 0, 0);
break;
case BOMBA_EXPLOSIVA_RETARDADA_ELASTICA:
if (_local1 == 3){
_local1 = 2;
};
VariablesGlobales.SoundMan.playSound(String(("goma" + _local1)), 0.3, 0, 0);
VariablesGlobales.numero_rebotes_bomba = (VariablesGlobales.numero_rebotes_bomba + 1);
if (VariablesGlobales.numero_rebotes_bomba >= 7){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.BOUNCING, _disfraz.parent.parent);
};
break;
default:
trace("error: tipo bomba sonido");
};
}
}
}//package
Section 171
//bombardero (bombardero)
package {
import flash.display.*;
public dynamic class bombardero extends MovieClip {
}
}//package
Section 172
//BombarderoActor (BombarderoActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class BombarderoActor extends Actor {
private var velocidadCruceroHorizontal:int;// = 50
private var _volviendoBase:Boolean;// = false
private var _direccion:int;// = 1
private var _sonidoAvion:String;// = ""
private var _maniobraEvasiva:Boolean;// = false
private var inerciaInicial:b2Vec2;
private var _armado:Boolean;// = true
private var velocidadCruceroVertical:int;// = 0
private var _posicionInicial:Point;
public function BombarderoActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:int=1){
var _local4:Sprite;
var _local5:Object;
var _local6:b2BodyDef;
var _local7:b2Body;
var _local8:int;
velocidadCruceroHorizontal = 50;
velocidadCruceroVertical = 0;
_armado = true;
_direccion = 1;
_maniobraEvasiva = false;
_volviendoBase = false;
_sonidoAvion = "";
_posicionInicial = _arg2;
_direccion = _arg3;
_local4 = new bombardero();
_local5 = new b2PolygonDef();
_local5.vertexCount = 4;
if (_direccion == 1){
b2Vec2(_local5.vertices[0]).Set((-40 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local5.vertices[1]).Set((-10 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local5.vertices[2]).Set((-30 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
b2Vec2(_local5.vertices[3]).Set((-40 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
} else {
b2Vec2(_local5.vertices[0]).Set((10 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local5.vertices[1]).Set((40 / VariablesGlobales.RATIO), (-15 / VariablesGlobales.RATIO));
b2Vec2(_local5.vertices[2]).Set((40 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
b2Vec2(_local5.vertices[3]).Set((30 / VariablesGlobales.RATIO), (15 / VariablesGlobales.RATIO));
};
velocidadCruceroHorizontal = (velocidadCruceroHorizontal * _direccion);
inerciaInicial = new b2Vec2(velocidadCruceroHorizontal, 0);
_local4.scaleX = _direccion;
_arg1.addChild(_local4);
_local5.density = 1000;
_local5.friction = 0.2;
_local5.restitution = 0;
_local5.isSensor = true;
_local5.userData = this;
_local6 = new b2BodyDef();
_local6.position.Set((_arg2.x / VariablesGlobales.RATIO), (_arg2.y / VariablesGlobales.RATIO));
_local7 = VariablesGlobales.mundo.CreateBody(_local6);
_local7.CreateShape(b2ShapeDef(_local5));
_local7.SetMassFromShapes();
_local7.SetLinearVelocity(inerciaInicial);
_local8 = ((Math.random() * 2) + 2);
_sonidoAvion = String(("avionpasa" + _local8));
VariablesGlobales.SoundMan.playSound(_sonidoAvion, 0.3, 0, 0);
super(_local7, _local4);
}
public function get maniobraEvasiva():Boolean{
return (_maniobraEvasiva);
}
public function set armado(_arg1:Boolean):void{
_armado = _arg1;
}
public function set maniobraEvasiva(_arg1:Boolean):void{
_maniobraEvasiva = _arg1;
}
public function get direccion():int{
return (_direccion);
}
override protected function gestionarFueraDeLimites():void{
VariablesGlobales.motor.bombarderoFueraDeLimites(this);
VariablesGlobales.motor.eliminarActor(this);
super.gestionarFueraDeLimites();
}
public function get armado():Boolean{
return (_armado);
}
public function set direccion(_arg1:int):void{
_direccion = _arg1;
}
override protected function actualizacionEspecificaHijo():void{
var _local1:b2Vec2;
if (cuerpo.GetPosition().y > _posicionInicial.y){
_local1 = new b2Vec2(velocidadCruceroHorizontal, -0.3);
} else {
_local1 = new b2Vec2(velocidadCruceroHorizontal, 0);
};
if (cuerpo.GetAngle() > 0){
cuerpo.SetAngularVelocity(-1);
} else {
if (cuerpo.GetAngle() < 0){
cuerpo.SetAngularVelocity(1);
} else {
cuerpo.SetAngularVelocity(0);
};
};
if (_maniobraEvasiva){
_local1 = new b2Vec2(velocidadCruceroHorizontal, -4);
cuerpo.SetAngularVelocity((-(_direccion) / 10));
if (!_volviendoBase){
_volviendoBase = true;
VariablesGlobales.SoundMan.fadeSound(_sonidoAvion, 0, 1);
};
};
cuerpo.SetLinearVelocity(_local1);
super.actualizacionEspecificaHijo();
}
}
}//package
Section 173
//Bombardment (Bombardment)
package {
import flash.display.*;
import com.tanoku.sonido.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import CPMStar.*;
public class Bombardment extends MovieClip {
var timerCpmStar:Timer;
public var introSponsor:MovieClip;
var ad:DisplayObject;
private var _pantalla:Sprite;
var _mochiads_game_id:String;// = "8c33520980f0c55b"
var CPMStarContentSpotID:String;// = "1225Q7DC20369"
private var _editor:Editor;
public var txt_denegado:TextField;
public function Bombardment(){
_mochiads_game_id = "8c33520980f0c55b";
CPMStarContentSpotID = "1225Q7DC20369";
ad = new AdLoader(CPMStarContentSpotID);
timerCpmStar = new Timer(1000);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function Validar(){
var _local1:String;
var _local2:Array;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
_local1 = "";
_local2 = new Array("tanoku.com");
_local3 = stage.loaderInfo.url;
_local4 = (_local3.indexOf("://") + 3);
_local5 = _local3.indexOf("/", _local4);
_local1 = _local3.substring(_local4, _local5);
_local6 = (_local1.lastIndexOf(".") - 1);
_local7 = (_local1.lastIndexOf(".", _local6) + 1);
_local1 = _local1.substring(_local7, _local1.length);
_local8 = false;
trace((("dominio actual '" + _local1) + "'"));
_local8 = true;
VariablesGlobales.estoyEnSponsor = false;
if (_local1 == VariablesGlobales.WEB_DOMINIO){
VariablesGlobales.editorDisponible = true;
VariablesGlobales.estoyEnSponsor = true;
};
if (_local8){
trace(("allowed " + getTimer()));
mc_preload = new preloader_sc();
this.addChild(mc_preload);
mc_preload.jugar.visible = false;
addEventListener(Event.ENTER_FRAME, preloader);
mc_preload.boton_sponsor.addEventListener(MouseEvent.CLICK, sponsorPreload);
mc_preload.boton_tanoku.addEventListener(MouseEvent.CLICK, tanokuPreload);
if (!VariablesGlobales.estoyEnSponsor){
mc_preload.adBox.addChild(ad);
} else {
mc_preload.adBox.visible = false;
};
this.play();
} else {
trace("denied");
txt_denegado.text = (("access denied \n -" + _local1) + "-");
};
}
function tanokuPreload(_arg1:MouseEvent):void{
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_TANOKU);
}
public function Cargar_Sonidos():void{
VariablesGlobales.MusicMan.addLibrarySound(musica1, "musica1");
VariablesGlobales.MusicMan.addLibrarySound(musica2, "musica2");
VariablesGlobales.SoundMan.addLibrarySound(click, "click");
VariablesGlobales.SoundMan.addLibrarySound(avionpasa2, "avionpasa2");
VariablesGlobales.SoundMan.addLibrarySound(avionpasa3, "avionpasa3");
VariablesGlobales.SoundMan.addLibrarySound(bomba1, "bomba1");
VariablesGlobales.SoundMan.addLibrarySound(bomba2, "bomba2");
VariablesGlobales.SoundMan.addLibrarySound(bomba3, "bomba3");
VariablesGlobales.SoundMan.addLibrarySound(silbido1, "silbido1");
VariablesGlobales.SoundMan.addLibrarySound(picarcristal1, "picarcristal1");
VariablesGlobales.SoundMan.addLibrarySound(picarcristal2, "picarcristal2");
VariablesGlobales.SoundMan.addLibrarySound(picarcristal3, "picarcristal3");
VariablesGlobales.SoundMan.addLibrarySound(hielo1, "hielo1");
VariablesGlobales.SoundMan.addLibrarySound(hielo2, "hielo2");
VariablesGlobales.SoundMan.addLibrarySound(hielo3, "hielo3");
VariablesGlobales.SoundMan.addLibrarySound(metal1, "metal1");
VariablesGlobales.SoundMan.addLibrarySound(metal2, "metal2");
VariablesGlobales.SoundMan.addLibrarySound(metal3, "metal3");
VariablesGlobales.SoundMan.addLibrarySound(goma1, "goma1");
VariablesGlobales.SoundMan.addLibrarySound(goma2, "goma2");
VariablesGlobales.SoundMan.addLibrarySound(arrastracristal1, "arrastracristal1");
VariablesGlobales.SoundMan.addLibrarySound(arrastracristal2, "arrastracristal2");
VariablesGlobales.SoundMan.addLibrarySound(arrastracristal3, "arrastracristal3");
VariablesGlobales.SoundMan.addLibrarySound(logro, "logro");
}
function frame3(){
stop();
Intros();
}
function frame1(){
MochiBot.track(this, "462a249e");
stop();
Validar();
}
function Cargar_Datos():void{
VariablesGlobales.SoundMan = SoundManager.getInstance();
VariablesGlobales.MusicMan = MusicManager.getInstance();
VariablesGlobales.logrosMan = new ManagerLogros();
VariablesGlobales.logrosMan.main_class = this;
VariablesGlobales.savegameMan = new ManagerPartidas();
}
function preloader(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:int;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
_local4 = ((_local3 * 100) / _local2);
trace((_local4 + "%"));
mc_preload.porc.text = (_local4 + "%");
mc_preload.gotoAndStop(_local4);
if (_local3 >= _local2){
if (VariablesGlobales.estoyEnSponsor){
timerCpmStar = new Timer(100, 1);
} else {
timerCpmStar = new Timer(3000, 1);
};
timerCpmStar.start();
timerCpmStar.addEventListener(TimerEvent.TIMER_COMPLETE, finTiempoTimerCPM);
mc_preload.porc.visible = false;
removeEventListener(Event.ENTER_FRAME, preloader);
trace(("loaded " + getTimer()));
};
}
function frame5(){
stop();
Start();
}
public function Preloader(){
trace(("preloading " + getTimer()));
}
function frame2(){
stop();
Preloader();
}
public function cierra_pantalla(_arg1){
if (_arg1){
removeChild(_arg1);
_arg1 = null;
};
}
function sponsorPreload(_arg1:MouseEvent):void{
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SPONSOR);
}
public function abre_pantalla(_arg1){
addChild(_arg1);
_arg1.main_class = this;
}
function frame4(){
stop();
}
public function Start(){
trace("start");
stage.quality = "low";
abre_pantalla(new Principal());
}
function jugarPreload(_arg1:MouseEvent):void{
if (!VariablesGlobales.estoyEnSponsor){
mc_preload.adBox.removeChild(ad);
};
this.removeChild(mc_preload);
mc_preload.jugar.removeEventListener(MouseEvent.CLICK, jugarPreload);
mc_preload.boton_sponsor.removeEventListener(MouseEvent.CLICK, sponsorPreload);
mc_preload.boton_tanoku.removeEventListener(MouseEvent.CLICK, tanokuPreload);
this.play();
}
function finTiempoTimerCPM(_arg1:TimerEvent):void{
trace("fin timer");
mc_preload.jugar.visible = true;
mc_preload.jugar.addEventListener(MouseEvent.CLICK, jugarPreload);
timerCpmStar.removeEventListener(TimerEvent.TIMER_COMPLETE, finTiempoTimerCPM);
}
public function Intros(){
trace("Intros");
introSponsor.addEventListener(MouseEvent.CLICK, sponsorPreload);
Cargar_Datos();
Cargar_Sonidos();
}
function PL_LOADING(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
trace((_local2 + "%"));
if (_local2 == 100){
};
}
}
}//package
Section 174
//BombardmentContactListener (BombardmentContactListener)
package {
import Box2D.Collision.*;
import Box2D.Dynamics.*;
public class BombardmentContactListener extends b2ContactListener {
override public function Add(_arg1:b2ContactPoint):void{
if ((((_arg1.shape1.GetBody().GetUserData() is BombaBaseActor)) && (!((_arg1.shape2.GetBody().GetUserData() is BombarderoActor))))){
BombaBaseActor(_arg1.shape1.GetBody().GetUserData()).explotar();
} else {
if (((!((_arg1.shape1.GetBody().GetUserData() is BombarderoActor))) && ((_arg1.shape2.GetBody().GetUserData() is BombaBaseActor)))){
BombaBaseActor(_arg1.shape2.GetBody().GetUserData()).explotar();
};
};
if ((((_arg1.shape1.GetBody().GetUserData() is BombaBaseActor)) && ((((_arg1.shape2.GetBody().GetUserData() is AlienActor)) || ((_arg1.shape2.GetBody().GetUserData() is AlienBlindadoActor)))))){
BombaBaseActor(_arg1.shape1.GetBody().GetUserData()).colisionaContraAlien();
if ((((_arg1.shape2.GetBody().GetUserData() is AlienBlindadoActor)) && ((BombaBaseActor(_arg1.shape1.GetBody().GetUserData()).tipo == BombaBaseActor.BOMBA_EXPLOSIVA_DIRECTA)))){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.NOT_AFFECT_ME, BombaBaseActor(_arg1.shape1.GetBody().GetUserData()).disfraz.parent.parent);
};
} else {
if ((((((_arg1.shape1.GetBody().GetUserData() is AlienActor)) || ((_arg1.shape1.GetBody().GetUserData() is AlienBlindadoActor)))) && ((_arg1.shape2.GetBody().GetUserData() is BombaBaseActor)))){
BombaBaseActor(_arg1.shape2.GetBody().GetUserData()).colisionaContraAlien();
if ((((_arg1.shape1.GetBody().GetUserData() is AlienBlindadoActor)) && ((BombaBaseActor(_arg1.shape2.GetBody().GetUserData()).tipo == BombaBaseActor.BOMBA_EXPLOSIVA_DIRECTA)))){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.NOT_AFFECT_ME, BombaBaseActor(_arg1.shape2.GetBody().GetUserData()).disfraz.parent.parent);
};
};
};
if ((((_arg1.shape1.GetBody().GetUserData() is PiezaAlienActor)) && ((((_arg1.shape2.GetBody().GetUserData() is AlienActor)) || ((_arg1.shape2.GetBody().GetUserData() is AlienBlindadoActor)))))){
PiezaAlienActor(_arg1.shape1.GetBody().GetUserData()).explotar();
if ((_arg1.shape2.GetBody().GetUserData() is AlienBlindadoActor)){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.NOT_AFFECT_ME_EITHER, PiezaAlienActor(_arg1.shape1.GetBody().GetUserData()).disfraz.parent.parent);
};
} else {
if ((((((_arg1.shape1.GetBody().GetUserData() is AlienActor)) || ((_arg1.shape1.GetBody().GetUserData() is AlienBlindadoActor)))) && ((_arg1.shape2.GetBody().GetUserData() is PiezaAlienActor)))){
PiezaAlienActor(_arg1.shape2.GetBody().GetUserData()).explotar();
if ((_arg1.shape1.GetBody().GetUserData() is AlienBlindadoActor)){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.NOT_AFFECT_ME_EITHER, PiezaAlienActor(_arg1.shape2.GetBody().GetUserData()).disfraz.parent.parent);
};
};
};
super.Add(_arg1);
}
}
}//package
Section 175
//Camara (Camara)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import gs.*;
import gs.easing.*;
public class Camara {
private var _padreMinimapa:DisplayObjectContainer;
private var _miniMapaDatosSprite:Sprite;
private var _padre:DisplayObjectContainer;
private var _miniMapaDatos:Array;
private var _arrastrandoMinicamara:Boolean;// = false
private var _minimapaActivo:Boolean;// = false
private var _limitesCamara:Rectangle;
private var _miniMapaPuntoOrigen:Point;
private var _camara:Sprite;
private var _arrastrando:Boolean;// = false
private var _miniMapa:Sprite;
private var _altoMiniMapa:Number;
private var _miniCamara:Sprite;
private var _anchoMiniMapa:Number;
public static const ESCALA_MINIMAPA:int = 16;
public static var DESPLAZAMIENTO_CAMARA:Number = 25;
public function Camara(){
_arrastrando = false;
_minimapaActivo = false;
_arrastrandoMinicamara = false;
super();
}
public function posicionActual():Point{
var _local1:Point;
_local1 = new Point(_camara.x, _camara.y);
return (_local1);
}
private function manejarLimitesPantalla():void{
if ((_camara.x - (_camara.width / 2)) < _limitesCamara.left){
_camara.x = (_limitesCamara.left + (_camara.width / 2));
} else {
if ((_camara.x + (_camara.width / 2)) > _limitesCamara.right){
_camara.x = (_limitesCamara.right - (_camara.width / 2));
};
};
if ((_camara.y - (_camara.height / 2)) < _limitesCamara.top){
_camara.y = (_limitesCamara.top + (_camara.height / 2));
} else {
if ((_camara.y + (_camara.height / 2)) > _limitesCamara.bottom){
_camara.y = (_limitesCamara.bottom - (_camara.height / 2));
};
};
}
private function manejarMouseOutMinicamara(_arg1:MouseEvent):void{
_miniCamara.stopDrag();
_arrastrandoMinicamara = false;
}
public function crearMinimapa(_arg1:DisplayObjectContainer, _arg2:Number, _arg3:Number, _arg4:Point){
_minimapaActivo = true;
_padreMinimapa = _arg1;
_anchoMiniMapa = _arg2;
_altoMiniMapa = _arg3;
_miniMapaPuntoOrigen = _arg4;
_miniMapa = new Sprite();
_miniMapa.graphics.lineStyle(0, 0, 1, false);
_miniMapa.graphics.beginFill(0, 1);
_miniMapa.graphics.drawRect(_miniMapaPuntoOrigen.x, _miniMapaPuntoOrigen.y, (_anchoMiniMapa / ESCALA_MINIMAPA), (_altoMiniMapa / ESCALA_MINIMAPA));
_padreMinimapa.addChild(_miniMapa);
_miniMapa.addEventListener(MouseEvent.MOUSE_DOWN, manejarMouseDownkMiniMapa);
_miniMapaDatosSprite = new Sprite();
_miniMapaDatosSprite.mouseEnabled = false;
_padreMinimapa.addChild(_miniMapaDatosSprite);
_miniCamara = new Sprite();
_miniCamara.graphics.lineStyle(0, 3322827, 1, false);
_miniCamara.graphics.beginFill(3322827, 0.2);
_miniCamara.graphics.drawRect(_miniMapaPuntoOrigen.x, _miniMapaPuntoOrigen.y, (_camara.width / ESCALA_MINIMAPA), (_camara.height / ESCALA_MINIMAPA));
_miniMapa.addChild(_miniCamara);
_miniCamara.addEventListener(MouseEvent.MOUSE_DOWN, manejarMouseDownMinicamara);
_miniCamara.addEventListener(MouseEvent.MOUSE_UP, manejarMouseUpMinicamara);
_miniCamara.addEventListener(MouseEvent.MOUSE_OUT, manejarMouseOutMinicamara);
}
private function manejarMouseDownkMiniMapa(_arg1:MouseEvent):void{
if (_arrastrandoMinicamara == false){
irA(new Point((_arg1.localX * Camara.ESCALA_MINIMAPA), ((_arg1.localY - (_miniCamara.height / 2)) * Camara.ESCALA_MINIMAPA)));
};
}
private function manejarClickMiniMapa(_arg1:MouseEvent):void{
}
public function get miniMapaDatos():Array{
return (_miniMapaDatos);
}
public function finalizarMinimapa(){
}
private function pintarDatosMinimapa():void{
var _local1:int;
var _local2:int;
if (_minimapaActivo){
_miniMapaDatosSprite.graphics.clear();
_local1 = 0;
while (_local1 < _miniMapaDatos.length) {
_local2 = 0;
while (_local2 < _miniMapaDatos[_local1].length) {
if (_miniMapaDatos[_local1][_local2] != 0){
_miniMapaDatosSprite.graphics.lineStyle(0, 0xFFFFFF, 0, false);
_miniMapaDatosSprite.graphics.beginFill(0xFFFFFF, 1);
_miniMapaDatosSprite.graphics.drawRect((((_local1 * VariablesGlobales.LADO_TILE) / Camara.ESCALA_MINIMAPA) + _miniMapaPuntoOrigen.x), (((_local2 * VariablesGlobales.LADO_TILE) / Camara.ESCALA_MINIMAPA) + _miniMapaPuntoOrigen.y), (VariablesGlobales.LADO_TILE / ESCALA_MINIMAPA), (VariablesGlobales.LADO_TILE / ESCALA_MINIMAPA));
};
_local2++;
};
_local1++;
};
};
}
public function get limitesCamara():Rectangle{
return (_limitesCamara);
}
public function irA(_arg1:Point, _arg2:Number=0.2){
TweenMax.to(_camara, _arg2, {x:_arg1.x, y:_arg1.y});
}
public function set miniMapaDatos(_arg1:Array):void{
_miniMapaDatos = _arg1;
pintarDatosMinimapa();
}
private function manejarControlMinimapa():void{
var _local1:Number;
var _local2:Number;
if (_miniCamara != null){
if (_arrastrandoMinicamara == true){
_local1 = ((_miniCamara.x + (_miniCamara.width / 2)) * Camara.ESCALA_MINIMAPA);
_local2 = ((_miniCamara.y + (_miniCamara.height / 2)) * Camara.ESCALA_MINIMAPA);
irA(new Point(_local1, _local2));
} else {
_miniCamara.x = ((_camara.x / Camara.ESCALA_MINIMAPA) - (_miniCamara.width / 2));
_miniCamara.y = ((_camara.y / Camara.ESCALA_MINIMAPA) - (_miniCamara.height / 2));
};
};
}
public function zoom(_arg1:Number, _arg2:int=1){
if (_arg1 != 0){
TweenMax.to(_camara, _arg2, {width:(VariablesGlobales.ANCHO_PANTALLA * _arg1), height:(VariablesGlobales.ALTO_PANTALLA * _arg1)});
if (_miniCamara != null){
};
};
}
public function set limitesCamara(_arg1:Rectangle):void{
_limitesCamara = _arg1;
}
public function iniciaCamara(_arg1:DisplayObjectContainer, _arg2:Number=0, _arg3:Number=0, _arg4:Point=null){
_padre = _arg1;
_limitesCamara = new Rectangle(0, 0, _arg2, _arg3);
_camara = new VCam_AS3_Interactive();
_camara.width = VariablesGlobales.ANCHO_PANTALLA;
_camara.height = VariablesGlobales.ALTO_PANTALLA;
_padre.addChild(_camara);
}
private function manejarSeguimiento():void{
}
private function manejarMouseUpMinicamara(_arg1:MouseEvent):void{
_miniCamara.stopDrag();
_arrastrandoMinicamara = false;
}
private function manejarMouseDownMinicamara(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Rectangle;
_local2 = -((_miniCamara.width - _miniMapa.width));
_local3 = -((_miniCamara.height - _miniMapa.height));
_local4 = new Rectangle(0, 0, _local2, _local3);
_miniCamara.startDrag(false, _local4);
_arrastrandoMinicamara = true;
}
public function actualizaAhora():void{
manejarSeguimiento();
manejarLimitesPantalla();
manejarControlMinimapa();
}
}
}//package
Section 176
//catalogoBombas (catalogoBombas)
package {
import flash.display.*;
public dynamic class catalogoBombas extends MovieClip {
}
}//package
Section 177
//catalogoFondos (catalogoFondos)
package {
import flash.display.*;
public dynamic class catalogoFondos extends MovieClip {
}
}//package
Section 178
//catalogoTiles (catalogoTiles)
package {
import flash.display.*;
public dynamic class catalogoTiles extends MovieClip {
}
}//package
Section 179
//CellRenderer_disabledSkin (CellRenderer_disabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_disabledSkin extends MovieClip {
}
}//package
Section 180
//CellRenderer_downSkin (CellRenderer_downSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_downSkin extends MovieClip {
}
}//package
Section 181
//CellRenderer_overSkin (CellRenderer_overSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_overSkin extends MovieClip {
}
}//package
Section 182
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip {
}
}//package
Section 183
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDownSkin extends MovieClip {
}
}//package
Section 184
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedOverSkin extends MovieClip {
}
}//package
Section 185
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedUpSkin extends MovieClip {
}
}//package
Section 186
//CellRenderer_upSkin (CellRenderer_upSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_upSkin extends MovieClip {
}
}//package
Section 187
//click (click)
package {
import flash.media.*;
public dynamic class click extends Sound {
}
}//package
Section 188
//Creditos (Creditos)
package {
import flash.display.*;
import flash.events.*;
public class Creditos extends MovieClip {
public var salir:SimpleButton;
public var main_class:MovieClip;
public function Creditos(){
salir.addEventListener(MouseEvent.CLICK, on_button_clicked);
}
public function on_button_clicked(_arg1:MouseEvent){
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "salir":
main_class.cierra_pantalla(this);
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package
Section 189
//DecoracionActor (DecoracionActor)
package {
import flash.display.*;
import flash.geom.*;
public class DecoracionActor extends Actor {
public function DecoracionActor(_arg1:DisplayObjectContainer, _arg2:DisplayObject, _arg3:Point){
_arg2.x = _arg3.x;
_arg2.y = _arg3.y;
_arg1.addChild(_arg2);
super(null, _arg2);
}
}
}//package
Section 190
//dialogosEnJuego (dialogosEnJuego)
package {
import flash.display.*;
public dynamic class dialogosEnJuego extends MovieClip {
public var cerrar_dialogo:SimpleButton;
}
}//package
Section 191
//Editor (Editor)
package {
import fl.controls.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import fl.data.*;
import flash.utils.*;
import flash.system.*;
public class Editor extends EventDispatcher {
private var listaComunes:TileList;
private var posicionActual:Point;
private var _menuCatalogoTiles:menuCatalogoTiles;
private var _padre:DisplayObjectContainer;
private var marcoTile:Sprite;
private var _timerLoading:Timer;
private var cursorTile:MovieClip;
private var _interfaz:DisplayObjectContainer;
private var _tileActualI:int;// = 1
private var _tileActualX:int;// = 0
private var _tileActualY:int;// = 0
private var _borrandoTiles:Boolean;// = false
private var _pintandoTiles:Boolean;// = false
private var _panelErrorEditor:panelErrorEditor;
private var listaDecoracion:TileList;
private var _tileActualMC:MovieClip;
private var _mapaAncho:int;
private var _interfazContenedor:Sprite;
private var _menuCargar:menuCargar;
private var _mapaAlto:int;
private var _panelAyuda:panelAyuda;
private var _menuGuardar:menuGuardar;
private var _panelBorrarTodo:panelBorrarTodo;
private var _bombasDisponibles:Array;
private var _lienzoMatrizVisible:Boolean;// = true
private var numeroBombas:int;
private var _turnosNivel:int;// = 0
private var _posicionPrincesa:Point;
private var marcoTileGoma:Sprite;
private var _lienzo:Sprite;
private var _posicionCamara:Point;
private var _temaNivel:int;// = 1
private var numeroAliens:int;
private var listaSolidos:TileList;
private var _posicionMeta:Point;
private var _juegoContenedor:Sprite;
private var _matriz:Array;
private var _tileLado:int;
private var _matrizGrafica:Array;
private var _panelSubirNivel:panelSubirNivel;
public function Editor(){
_tileLado = VariablesGlobales.LADO_TILE;
_mapaAncho = VariablesGlobales.MAX_ANCHO_TILE;
_mapaAlto = VariablesGlobales.MAX_ALTO_TILE;
_tileActualI = 1;
_tileActualX = 0;
_tileActualY = 0;
_lienzoMatrizVisible = true;
_pintandoTiles = false;
_borrandoTiles = false;
_temaNivel = 1;
_turnosNivel = 0;
_bombasDisponibles = [];
_timerLoading = new Timer(3);
super();
}
public function actualiza(){
_tileActualX = uint((_lienzo.mouseX / _tileLado));
if (_tileActualX > (_mapaAncho - 1)){
_tileActualX = (_mapaAncho - 1);
};
_tileActualY = uint((_lienzo.mouseY / _tileLado));
if (_tileActualY > (_mapaAlto - 1)){
_tileActualY = (_mapaAlto - 1);
};
if ((((_tileActualI > 0)) && (!((_borrandoTiles == true))))){
cursorTile.visible = true;
} else {
cursorTile.visible = false;
};
cursorTile.x = (_tileActualX * _tileLado);
cursorTile.y = (_tileActualY * _tileLado);
marcoTile.x = (_tileActualX * _tileLado);
marcoTile.y = (_tileActualY * _tileLado);
marcoTileGoma.x = (_tileActualX * _tileLado);
marcoTileGoma.y = (_tileActualY * _tileLado);
rellenarTileActual();
}
private function controlarMostrarMatriz():void{
_lienzoMatrizVisible = !(_lienzoMatrizVisible);
if (_lienzoMatrizVisible == true){
_menuCatalogoTiles.boton_matriz2.gotoAndStop(2);
pintarGridEditor();
} else {
_menuCatalogoTiles.boton_matriz2.gotoAndStop(1);
borrarGridEditor();
};
}
private function parsearCadenaNivel(_arg1:String):Boolean{
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:int;
_local2 = _arg1.split(";");
_local3 = _local2[0].split(",");
_mapaAncho = _local3[0];
_mapaAlto = _local3[1];
_temaNivel = _local3[2];
_turnosNivel = _local3[3];
_menuCatalogoTiles.turnos.value = _turnosNivel;
_bombasDisponibles = [false, false, false, false, false, false, false, false];
if (_local3[4] == 1){
_bombasDisponibles[0] = true;
};
if (_local3[5] == 1){
_bombasDisponibles[1] = true;
};
if (_local3[6] == 1){
_bombasDisponibles[2] = true;
};
if (_local3[7] == 1){
_bombasDisponibles[3] = true;
};
if (_local3[8] == 1){
_bombasDisponibles[4] = true;
};
if (_local3[9] == 1){
_bombasDisponibles[5] = true;
};
if (_local3[10] == 1){
_bombasDisponibles[6] = true;
};
if (_local3[11] == 1){
_bombasDisponibles[7] = true;
};
actualizaEstadoBombas();
_local4 = _local2[1].split("|");
_local5 = [];
_matriz = new Array(_mapaAncho);
_local6 = 0;
while (_local6 < _local4.length) {
_local5 = _local4[_local6].split(",");
_matriz[_local6] = new Array(_local5.length);
_local7 = 0;
while (_local7 < _local5.length) {
if (_local5[_local7] == ""){
_local5[_local7] = 0;
};
_matriz[_local6][_local7] = _local5[_local7];
_local7++;
};
_local6++;
};
return (true);
}
private function limpiarSeleccionListas():void{
listaComunes.clearSelection();
listaSolidos.clearSelection();
listaDecoracion.clearSelection();
}
private function borrarContenidoTileActual():void{
_matriz[_tileActualX][_tileActualY] = 0;
if (_matrizGrafica[_tileActualX][_tileActualY] != null){
_lienzo.removeChild(_matrizGrafica[_tileActualX][_tileActualY]);
_matrizGrafica[_tileActualX][_tileActualY] = null;
};
VariablesGlobales.camara.miniMapaDatos = _matriz;
}
private function subirNivel():void{
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_NIVELES);
}
private function iniciaValores():void{
_temaNivel = 1;
_tileActualI = 0;
_pintandoTiles = false;
_borrandoTiles = false;
_posicionMeta = null;
_posicionPrincesa = null;
_posicionCamara = null;
_turnosNivel = 0;
_bombasDisponibles = [true, true, true, true, true, true, true, true];
crearMatriz();
}
private function manejarCambioLista(_arg1:Event):void{
_tileActualI = (_arg1.target.selectedItem.data + 1);
cursorTile.gotoAndStop(_tileActualI);
controlarGomaTiles(false);
limpiarSeleccionListas();
}
public function finalizaEditor(){
eliminarGridEditor();
finalizaMenus();
_padre.removeChild(_juegoContenedor);
_juegoContenedor.removeChild(_lienzo);
_padre.removeChild(_interfazContenedor);
_interfazContenedor.removeChild(_interfaz);
}
private function crearMatriz():void{
var _local1:int;
var _local2:int;
_matriz = new Array(_mapaAncho);
_matrizGrafica = new Array(_mapaAncho);
_local1 = 0;
while (_local1 < _matriz.length) {
_matriz[_local1] = new Array(_mapaAlto);
_matrizGrafica[_local1] = new Array(_mapaAlto);
_local2 = 0;
while (_local2 < _matriz[_local1].length) {
_matriz[_local1][_local2] = 0;
_matrizGrafica[_local1][_local2] = null;
_local2++;
};
_local1++;
};
_posicionMeta = null;
_posicionPrincesa = null;
_posicionCamara = null;
}
private function borrarGridEditor():void{
_lienzo.graphics.clear();
}
private function crearGridEditor():void{
agregarLienzoMouse();
pintarGridEditor();
_lienzoMatrizVisible = true;
if (cursorTile != null){
_lienzo.removeChild(cursorTile);
};
cursorTile = new catalogoTiles();
_lienzo.addChild(cursorTile);
if (marcoTile != null){
_lienzo.removeChild(marcoTile);
};
marcoTile = new Sprite();
marcoTile.graphics.lineStyle(1, 0xFF0000, 1, false);
marcoTile.graphics.drawRect(0, 0, _tileLado, _tileLado);
_lienzo.addChild(marcoTile);
marcoTileGoma = new Sprite();
marcoTileGoma.graphics.lineStyle(2, 0xFF0000, 1, false);
marcoTileGoma.graphics.beginFill(0xFF0000, 0.5);
marcoTileGoma.graphics.drawRect(0, 0, _tileLado, _tileLado);
marcoTileGoma.visible = _borrandoTiles;
_lienzo.addChild(marcoTileGoma);
posicionActual = new Point(0, 0);
_lienzo.addEventListener(MouseEvent.MOUSE_DOWN, manejarMouseDownLienzo);
_lienzo.addEventListener(MouseEvent.MOUSE_UP, manejarMouseUpLienzo);
_lienzo.addEventListener(MouseEvent.CLICK, manejarMouseClickLienzo);
_lienzo.addEventListener(MouseEvent.MOUSE_OUT, manejarMouseOutLienzo);
_pintandoTiles = false;
}
private function manejarMouseDownLienzo(_arg1:MouseEvent):void{
_pintandoTiles = true;
rellenarTileActual();
}
private function mostrarPanelSubirNivel():void{
_panelSubirNivel.subido.visible = false;
_panelSubirNivel.visible = !(_panelSubirNivel.visible);
if (_panelSubirNivel.visible == true){
_panelSubirNivel.cadena_nivel.text = _menuGuardar.nivel_guardar.text;
_panelSubirNivel.nombre_nivel.text = "";
_panelSubirNivel.nombre_autor.text = "";
_panelSubirNivel.comentarios.text = "";
};
}
private function pintarGridEditor():void{
var _local1:int;
_local1 = 0;
_lienzo.graphics.lineStyle(1, 0, 1, false);
_lienzo.graphics.beginFill(0xCCCCCC, 0.1);
_lienzo.graphics.drawRect(0, 0, (_mapaAncho * _tileLado), (_mapaAlto * _tileLado));
_local1 = 1;
while (_local1 <= _mapaAlto) {
_lienzo.graphics.moveTo(0, (_local1 * _tileLado));
_lienzo.graphics.lineTo((_mapaAncho * _tileLado), (_local1 * _tileLado));
_local1++;
};
_local1 = 1;
while (_local1 <= _mapaAncho) {
_lienzo.graphics.moveTo((_local1 * _tileLado), 0);
_lienzo.graphics.lineTo((_local1 * _tileLado), (_mapaAlto * _tileLado));
_local1++;
};
}
private function mostrarPanelError():void{
_panelErrorEditor.visible = !(_panelErrorEditor.visible);
}
private function manejarClickBomba(_arg1:MouseEvent):void{
switch (_arg1.currentTarget.name){
case "bomba_01":
_bombasDisponibles[0] = !(_bombasDisponibles[0]);
break;
case "bomba_02":
_bombasDisponibles[1] = !(_bombasDisponibles[1]);
break;
case "bomba_03":
_bombasDisponibles[2] = !(_bombasDisponibles[2]);
break;
case "bomba_04":
_bombasDisponibles[3] = !(_bombasDisponibles[3]);
break;
case "bomba_05":
_bombasDisponibles[4] = !(_bombasDisponibles[4]);
break;
case "bomba_06":
_bombasDisponibles[5] = !(_bombasDisponibles[5]);
break;
case "bomba_07":
_bombasDisponibles[6] = !(_bombasDisponibles[6]);
break;
case "bomba_08":
_bombasDisponibles[7] = !(_bombasDisponibles[7]);
break;
};
actualizaEstadoBombas();
}
private function manejarMouseClickLienzo(_arg1:MouseEvent):void{
}
private function pintarTilesCargados():void{
var _local1:int;
var _local2:int;
_pintandoTiles = true;
_local1 = 0;
while (_local1 < _matriz.length) {
_tileActualX = _local1;
_local2 = 0;
while (_local2 < _matriz[_local1].length) {
_tileActualY = _local2;
_tileActualI = _matriz[_local1][_local2];
if (_tileActualI != 0){
_tileActualMC = new catalogoTiles();
_tileActualMC.gotoAndStop(_tileActualI);
copiarTileAGrid();
};
_local2++;
};
_local1++;
};
_pintandoTiles = false;
_tileActualI = 0;
_tileActualX = 0;
_tileActualY = 0;
}
private function iniciaBotonesBombas():void{
_menuCatalogoTiles.bomba_01.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_02.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_03.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_04.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_04.visible = false;
_menuCatalogoTiles.bomba_05.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_06.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_07.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_07.visible = false;
_menuCatalogoTiles.bomba_08.addEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_08.visible = false;
actualizaEstadoBombas();
}
private function rellenarLista(_arg1:TileList, _arg2:int=1, _arg3:int=99999):void{
var _local4:DataProvider;
var _local5:MovieClip;
var _local6:uint;
var _local7:uint;
var _local8:MovieClip;
_local4 = new DataProvider();
_local5 = new catalogoTiles();
_local6 = _local5.totalFrames;
if (_local6 < _arg3){
_arg3 = _local6;
};
_local7 = _arg2;
while (_local7 < _arg3) {
_local5 = new catalogoTiles();
_local5.gotoAndStop((_local7 + 1));
if ((((((((_local5.width > 0)) && ((_local5.height > 0)))) && ((_local5.currentFrame >= _arg2)))) && ((_local5.currentFrame <= _arg3)))){
_local8 = _local5;
_local8.y = 45;
trace(_local8.height);
_local4.addItem({source:_local8, data:_local7, scaleContent:true});
};
_local7++;
};
_arg1.direction = ScrollBarDirection.VERTICAL;
_arg1.useHandCursor = true;
_arg1.opaqueBackground = null;
_arg1.addEventListener(Event.CHANGE, manejarCambioLista);
_arg1.allowMultipleSelection = false;
_arg1.columnWidth = 30;
_arg1.rowHeight = 30;
_arg1.dataProvider = _local4;
_arg1.columnCount = 4;
_arg1.rowCount = 8;
_arg1.x = 7;
_arg1.y = 32;
_arg1.height = 240;
_menuCatalogoTiles.addChild(_arg1);
_arg1.visible = false;
}
private function controlarSalirGuardar():void{
_menuGuardar.visible = false;
}
private function manejarClick(_arg1:MouseEvent):void{
switch (_arg1.currentTarget.name){
case "boton_ayuda":
mostrarAyuda();
break;
case "boton_goma":
controlarGomaTiles(!(_borrandoTiles));
break;
case "boton_goma2":
controlarGomaTiles(!(_borrandoTiles));
break;
case "boton_borrar_todo":
mostrarPanelBorrar();
break;
case "boton_matriz":
controlarMostrarMatriz();
break;
case "boton_matriz2":
controlarMostrarMatriz();
break;
case "boton_comunes":
limpiarSeleccionListas();
_menuCatalogoTiles.boton_comunes.gotoAndStop(2);
_menuCatalogoTiles.boton_solidos.gotoAndStop(1);
_menuCatalogoTiles.boton_no_solidos.gotoAndStop(1);
listaComunes.visible = true;
listaSolidos.visible = false;
listaDecoracion.visible = false;
break;
case "boton_solidos":
limpiarSeleccionListas();
_menuCatalogoTiles.boton_comunes.gotoAndStop(1);
_menuCatalogoTiles.boton_solidos.gotoAndStop(2);
_menuCatalogoTiles.boton_no_solidos.gotoAndStop(1);
listaComunes.visible = false;
listaSolidos.visible = true;
listaDecoracion.visible = false;
break;
case "boton_no_solidos":
limpiarSeleccionListas();
_menuCatalogoTiles.boton_comunes.gotoAndStop(1);
_menuCatalogoTiles.boton_solidos.gotoAndStop(1);
_menuCatalogoTiles.boton_no_solidos.gotoAndStop(2);
listaComunes.visible = false;
listaSolidos.visible = false;
listaDecoracion.visible = true;
break;
case "boton_probar":
VariablesGlobales.nivelPruebaActual = crearCadenaNivelActual();
if (validarMapaActual() == true){
this.dispatchEvent(new EditorEvent(EditorEvent.PROBAR_EDITOR));
} else {
mostrarPanelError();
};
break;
case "boton_salir":
this.dispatchEvent(new EditorEvent(EditorEvent.SALIR_EDITOR));
break;
case "boton_guardar":
controlarGuardarNivel();
break;
case "boton_cargar":
controlarCargarNivel();
break;
case "boton_salir_guardar":
controlarSalirGuardar();
break;
case "boton_subir_nivel":
subirNivel();
break;
case "boton_copiar":
System.setClipboard(_menuGuardar.nivel_guardar.text);
break;
case "boton_salir_cargar":
controlarSalirCargar();
break;
case "boton_cargar_nivel":
cargarNivel(_menuCargar.nivel_cargar.text);
controlarSalirCargar();
break;
case "cerrar_ayuda":
mostrarAyuda();
break;
case "boton_si_borrar":
borrarTodo();
mostrarPanelBorrar();
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.DESTROYER, _padre.parent);
break;
case "boton_no_borrar":
mostrarPanelBorrar();
break;
case "boton_ok_error":
mostrarPanelError();
break;
default:
trace(("error manejarMenus editor " + _arg1.currentTarget));
};
}
private function validarMapaActual():Boolean{
var _local1:Boolean;
_local1 = true;
trace(numeroAliens);
trace(numeroBombas);
if (numeroAliens <= 0){
return (false);
};
if (numeroBombas <= 0){
return (false);
};
return (_local1);
}
private function manejarMouseMoveLienzo(_arg1:MouseEvent):void{
_tileActualX = uint((_arg1.currentTarget.mouseX / _tileLado));
if (_tileActualX > (_mapaAncho - 1)){
_tileActualX = (_mapaAncho - 1);
};
_tileActualY = uint((_arg1.currentTarget.mouseY / _tileLado));
if (_tileActualY > (_mapaAlto - 1)){
_tileActualY = (_mapaAlto - 1);
};
if ((((_tileActualI > 0)) && (!((_borrandoTiles == true))))){
cursorTile.visible = true;
} else {
cursorTile.visible = false;
};
cursorTile.x = (_tileActualX * _tileLado);
cursorTile.y = (_tileActualY * _tileLado);
marcoTile.x = (_tileActualX * _tileLado);
marcoTile.y = (_tileActualY * _tileLado);
marcoTileGoma.x = (_tileActualX * _tileLado);
marcoTileGoma.y = (_tileActualY * _tileLado);
rellenarTileActual();
}
private function copiarTileAGrid():void{
var _local1:MovieClip;
_local1 = new MovieClip();
_local1 = _tileActualMC;
_matrizGrafica[_tileActualX][_tileActualY] = new MovieClip();
_matrizGrafica[_tileActualX][_tileActualY] = _local1;
_local1.x = (_tileActualX * _tileLado);
_local1.y = (_tileActualY * _tileLado);
_lienzo.addChild(_matrizGrafica[_tileActualX][_tileActualY]);
VariablesGlobales.camara.miniMapaDatos = _matriz;
}
private function actualizaEstadoBombas():void{
if (_bombasDisponibles[0] == true){
_menuCatalogoTiles.bomba_01.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_01.gotoAndStop(3);
};
if (_bombasDisponibles[1] == true){
_menuCatalogoTiles.bomba_02.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_02.gotoAndStop(3);
};
if (_bombasDisponibles[2] == true){
_menuCatalogoTiles.bomba_03.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_03.gotoAndStop(3);
};
if (_bombasDisponibles[3] == true){
_menuCatalogoTiles.bomba_04.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_04.gotoAndStop(3);
};
if (_bombasDisponibles[4] == true){
_menuCatalogoTiles.bomba_05.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_05.gotoAndStop(3);
};
if (_bombasDisponibles[5] == true){
_menuCatalogoTiles.bomba_06.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_06.gotoAndStop(3);
};
if (_bombasDisponibles[6] == true){
_menuCatalogoTiles.bomba_07.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_07.gotoAndStop(3);
};
if (_bombasDisponibles[7] == true){
_menuCatalogoTiles.bomba_08.gotoAndStop(1);
} else {
_menuCatalogoTiles.bomba_08.gotoAndStop(3);
};
}
private function manejarMouseOutLienzo(_arg1:MouseEvent):void{
}
private function finalizaBotonesBombas():void{
_menuCatalogoTiles.bomba_01.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_02.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_03.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_04.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_05.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_06.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_07.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
_menuCatalogoTiles.bomba_08.removeEventListener(MouseEvent.CLICK, manejarClickBomba);
actualizaEstadoBombas();
}
private function mostrarPanelBorrar():void{
_panelBorrarTodo.visible = !(_panelBorrarTodo.visible);
}
private function controlarGuardarNivel():void{
_menuGuardar.nivel_guardar.text = "";
_menuGuardar.nivel_guardar.text = crearCadenaNivelActual();
_menuGuardar.visible = true;
}
private function mostrarAyuda():void{
_panelAyuda.visible = !(_panelAyuda.visible);
}
private function controlarMinimizarMenuCatalogo():void{
if (_menuCatalogoTiles.y != (VariablesGlobales.ALTO_PANTALLA - 15)){
_menuCatalogoTiles.y = (VariablesGlobales.ALTO_PANTALLA - 15);
} else {
_menuCatalogoTiles.y = 0;
};
}
public function iniciaEditor(_arg1:DisplayObjectContainer){
var _local2:Number;
_local2 = 0;
_local2 = getTimer();
trace("Inicia Editor");
this.dispatchEvent(new EditorEvent(EditorEvent.CARGADO_EDITOR));
_padre = _arg1;
_juegoContenedor = new Sprite();
_padre.addChild(_juegoContenedor);
_lienzo = new Sprite();
_juegoContenedor.addChild(_lienzo);
_interfazContenedor = new Sprite();
_padre.addChild(_interfazContenedor);
_interfaz = new Sprite();
_interfazContenedor.addChild(_interfaz);
VariablesGlobales.camara = new Camara();
VariablesGlobales.camara.iniciaCamara(_juegoContenedor, VariablesGlobales.ALTO_PANTALLA, VariablesGlobales.ANCHO_PANTALLA);
crearGridEditor();
iniciaValores();
crearMenus();
if (VariablesGlobales.nivelPruebaActual != ""){
cargarNivel(VariablesGlobales.nivelPruebaActual);
};
trace("Editor iniciado");
this.dispatchEvent(new EditorEvent(EditorEvent.CARGADO_EDITOR));
_local2 = (getTimer() - _local2);
trace(_local2);
VariablesGlobales.MusicMan.stopAllSounds(false);
}
private function borrarTodo():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < _matrizGrafica.length) {
_local2 = 0;
while (_local2 < _matrizGrafica[_local1].length) {
if (_matrizGrafica[_local1][_local2] != null){
_lienzo.removeChild(_matrizGrafica[_local1][_local2]);
};
_local2++;
};
_local1++;
};
iniciaValores();
crearMatriz();
VariablesGlobales.camara.miniMapaDatos = _matriz;
}
private function crearMenus():void{
_menuCatalogoTiles = new menuCatalogoTiles();
_menuCatalogoTiles.x = (VariablesGlobales.ANCHO_PANTALLA - 150);
_interfaz.addChild(_menuCatalogoTiles);
_menuCatalogoTiles.boton_ayuda.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_goma.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_goma.visible = false;
_menuCatalogoTiles.boton_goma2.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_goma2.gotoAndStop(1);
_menuCatalogoTiles.boton_borrar_todo.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_matriz.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_matriz.visible = false;
_menuCatalogoTiles.boton_matriz2.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_matriz2.gotoAndStop(2);
_menuCatalogoTiles.boton_comunes.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_solidos.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_no_solidos.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_probar.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_guardar.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_cargar.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_salir.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.visible = true;
trace("cargar lista comunes ");
listaComunes = new TileList();
rellenarLista(listaComunes, 1, 199);
_menuCatalogoTiles.boton_comunes.gotoAndStop(2);
listaComunes.visible = true;
trace("cargar lista solidos");
listaSolidos = new TileList();
rellenarLista(listaSolidos, 200, 599);
_menuCatalogoTiles.boton_solidos.gotoAndStop(1);
listaSolidos.visible = false;
trace("cargar lista decoracion");
listaDecoracion = new TileList();
rellenarLista(listaDecoracion, 600, 720);
_menuCatalogoTiles.boton_no_solidos.gotoAndStop(1);
listaDecoracion.visible = false;
trace("cargar botones bombas");
iniciaBotonesBombas();
_menuCatalogoTiles.turnos.focusEnabled = false;
_menuGuardar = new menuGuardar();
_menuGuardar.x = 190;
_menuGuardar.y = 25;
_menuGuardar.visible = false;
_interfaz.addChild(_menuGuardar);
_menuGuardar.boton_salir_guardar.addEventListener(MouseEvent.CLICK, manejarClick);
_menuGuardar.boton_subir_nivel.addEventListener(MouseEvent.CLICK, manejarClick);
_menuGuardar.boton_copiar.addEventListener(MouseEvent.CLICK, manejarClick);
_panelSubirNivel = new panelSubirNivel();
_panelSubirNivel.visible = false;
_interfaz.addChild(_panelSubirNivel);
_panelSubirNivel.boton_subir_nivel.addEventListener(MouseEvent.CLICK, manejarClickSubirNivel);
_panelSubirNivel.boton_cancelar_nivel.addEventListener(MouseEvent.CLICK, manejarClickSubirNivel);
_menuCargar = new menuCargar();
_menuCargar.x = 190;
_menuCargar.y = 25;
_menuCargar.visible = false;
_interfaz.addChild(_menuCargar);
_menuCargar.boton_salir_cargar.addEventListener(MouseEvent.CLICK, manejarClick);
_menuCargar.boton_cargar_nivel.addEventListener(MouseEvent.CLICK, manejarClick);
_panelAyuda = new panelAyuda();
_panelAyuda.visible = false;
_interfaz.addChild(_panelAyuda);
_panelAyuda.cerrar_ayuda.addEventListener(MouseEvent.CLICK, manejarClick);
_panelBorrarTodo = new panelBorrarTodo();
_panelBorrarTodo.visible = false;
_interfaz.addChild(_panelBorrarTodo);
_panelBorrarTodo.boton_si_borrar.addEventListener(MouseEvent.CLICK, manejarClick);
_panelBorrarTodo.boton_no_borrar.addEventListener(MouseEvent.CLICK, manejarClick);
_panelErrorEditor = new panelErrorEditor();
_panelErrorEditor.visible = false;
_interfaz.addChild(_panelErrorEditor);
_panelErrorEditor.boton_ok_error.addEventListener(MouseEvent.CLICK, manejarClick);
trace("cargar minimapa");
VariablesGlobales.camara.irA(new Point(0, (_mapaAlto * _tileLado)));
VariablesGlobales.camara.crearMinimapa(_menuCatalogoTiles, ((_mapaAncho * _tileLado) + _menuCatalogoTiles.width), (_mapaAlto * _tileLado), new Point(30, 335));
VariablesGlobales.camara.limitesCamara = new Rectangle(0, 0, ((_mapaAncho * _tileLado) + 150), (_mapaAlto * _tileLado));
}
private function manejarClickSubirNivel(_arg1:MouseEvent):void{
switch (_arg1.currentTarget.name){
case "boton_subir_nivel":
break;
case "boton_cancelar_nivel":
break;
default:
trace(("error panelSubirNivel editor " + _arg1.currentTarget));
};
}
private function controlarCargarNivel():void{
_menuCargar.nivel_cargar.text = "";
_menuCargar.visible = true;
}
private function controlarGomaTiles(_arg1:Boolean):void{
_borrandoTiles = _arg1;
marcoTile.visible = !(_borrandoTiles);
marcoTileGoma.visible = _borrandoTiles;
if (_borrandoTiles){
_menuCatalogoTiles.boton_goma2.gotoAndStop(2);
} else {
_menuCatalogoTiles.boton_goma2.gotoAndStop(1);
};
}
private function controlarSalirCargar():void{
_menuCargar.visible = false;
}
private function crearCadenaNivelActual():String{
var _local1:String;
var _local2:int;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:int;
_local1 = "";
numeroAliens = 0;
numeroBombas = 0;
_local2 = 0;
while (_local2 < _matriz.length) {
_local5 = 0;
while (_local5 < _matriz[_local2].length) {
_local6 = "";
if (_matriz[_local2][_local5] != 0){
_local6 = _matriz[_local2][_local5];
if ((((_matriz[_local2][_local5] == LogicaTiles.ALIEN)) || ((_matriz[_local2][_local5] == LogicaTiles.ALIEN_BLINDADO)))){
numeroAliens = (numeroAliens + 1);
};
};
_local1 = (_local1 + _local6);
if (_local5 < (_matriz[_local2].length - 1)){
_local1 = (_local1 + ",");
};
_local5++;
};
_local1 = (_local1 + "|");
_local2++;
};
_local3 = "";
_local4 = 0;
while (_local4 < _bombasDisponibles.length) {
_local7 = 0;
if (_bombasDisponibles[_local4] == true){
_local7 = 1;
numeroBombas = (numeroBombas + 1);
};
_local3 = (_local3 + _local7);
if (_local4 != (_bombasDisponibles.length - 1)){
_local3 = (_local3 + ",");
};
_local4++;
};
_turnosNivel = _menuCatalogoTiles.turnos.value;
_local1 = ((((((((((_mapaAncho + ",") + _mapaAlto) + ",") + _temaNivel) + ",") + _turnosNivel) + ",") + _local3) + ";") + _local1);
return (_local1);
}
private function rellenarTileActual():void{
if (_pintandoTiles == true){
if (_borrandoTiles == true){
borrarContenidoTileActual();
} else {
if ((((_matriz[_tileActualX][_tileActualY] == 0)) && (!((_tileActualI == 0))))){
_tileActualMC = new catalogoTiles();
_tileActualMC.gotoAndStop(_tileActualI);
_matriz[_tileActualX][_tileActualY] = _tileActualI;
copiarTileAGrid();
};
};
};
}
private function manejarMouseUpLienzo(_arg1:MouseEvent):void{
_pintandoTiles = false;
}
private function eliminarGridEditor():void{
_lienzo.graphics.clear();
if (cursorTile != null){
_lienzo.removeChild(cursorTile);
};
if (marcoTile != null){
_lienzo.removeChild(marcoTile);
};
if (marcoTileGoma != null){
_lienzo.removeChild(marcoTileGoma);
};
_lienzo.removeEventListener(MouseEvent.MOUSE_DOWN, manejarMouseDownLienzo);
_lienzo.removeEventListener(MouseEvent.MOUSE_UP, manejarMouseUpLienzo);
_lienzo.removeEventListener(MouseEvent.CLICK, manejarMouseClickLienzo);
_lienzo.removeEventListener(MouseEvent.MOUSE_OUT, manejarMouseOutLienzo);
}
private function cargarNivel(_arg1:String):void{
borrarTodo();
iniciaValores();
parsearCadenaNivel(_arg1);
crearGridEditor();
pintarTilesCargados();
VariablesGlobales.nivelesCargados = (VariablesGlobales.nivelesCargados + 1);
if (VariablesGlobales.nivelesCargados >= 5){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.NEW_EXPERIENCES, _padre.parent);
};
}
private function agregarLienzoMouse(){
var _local1:Sprite;
_local1 = new Sprite();
_local1.graphics.lineStyle(0.1, 0xFFFFFF, 0.01, false);
_local1.graphics.beginFill(0xFFFFFF, 0.01);
_local1.graphics.drawRect(0, 0, (_mapaAncho * _tileLado), (_mapaAlto * _tileLado));
_lienzo.addChild(_local1);
}
private function finalizaMenus(){
_menuCatalogoTiles.boton_ayuda.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_goma.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_goma2.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_borrar_todo.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_matriz.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_matriz2.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_comunes.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_solidos.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_no_solidos.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_probar.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_guardar.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_cargar.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCatalogoTiles.boton_salir.removeEventListener(MouseEvent.CLICK, manejarClick);
listaComunes.removeEventListener(Event.CHANGE, manejarCambioLista);
listaSolidos.removeEventListener(Event.CHANGE, manejarCambioLista);
listaDecoracion.removeEventListener(Event.CHANGE, manejarCambioLista);
_menuGuardar.boton_salir_guardar.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuGuardar.boton_subir_nivel.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuGuardar.boton_copiar.removeEventListener(MouseEvent.CLICK, manejarClick);
_panelSubirNivel.boton_subir_nivel.removeEventListener(MouseEvent.CLICK, manejarClickSubirNivel);
_panelSubirNivel.boton_cancelar_nivel.removeEventListener(MouseEvent.CLICK, manejarClickSubirNivel);
_menuCargar.boton_salir_cargar.removeEventListener(MouseEvent.CLICK, manejarClick);
_menuCargar.boton_cargar_nivel.removeEventListener(MouseEvent.CLICK, manejarClick);
finalizaBotonesBombas();
_panelAyuda.cerrar_ayuda.removeEventListener(MouseEvent.CLICK, manejarClick);
_panelBorrarTodo.boton_si_borrar.removeEventListener(MouseEvent.CLICK, manejarClick);
_panelBorrarTodo.boton_no_borrar.removeEventListener(MouseEvent.CLICK, manejarClick);
_panelErrorEditor.boton_ok_error.removeEventListener(MouseEvent.CLICK, manejarClick);
}
}
}//package
Section 192
//EditorEvent (EditorEvent)
package {
import flash.events.*;
public class EditorEvent extends Event {
public static const EDITAR_EDITOR:String = "EditarEditor";
public static const CARGADO_EDITOR:String = "CargadoEditor";
public static const SALIR_EDITOR:String = "SalirEditor";
public static const PROBAR_EDITOR:String = "ProbarEditor";
public static const CARGAR_EDITOR:String = "CargarEditor";
public function EditorEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("EditorEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new EditorEvent(type, bubbles, cancelable));
}
}
}//package
Section 193
//EstaticoActor (EstaticoActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class EstaticoActor extends Actor {
public function EstaticoActor(_arg1:DisplayObjectContainer, _arg2:DisplayObject, _arg3:Point, _arg4:Array){
var _local5:b2Body;
_local5 = crearCuerpoDesdeCoordenadas(_arg4, _arg3);
_arg1.addChild(_arg2);
super(_local5, _arg2);
}
private function crearCuerpoDesdeCoordenadas(_arg1:Array, _arg2:Point):b2Body{
var _local3:Array;
var _local4:Array;
var _local5:b2BodyDef;
var _local6:b2Body;
var _local7:b2ShapeDef;
var _local8:b2PolygonDef;
var _local9:int;
var _local10:Point;
_local3 = [];
for each (_local4 in _arg1) {
_local8 = new b2PolygonDef();
_local8.vertexCount = _local4.length;
_local9 = 0;
while (_local9 < _local4.length) {
_local10 = _local4[_local9];
b2Vec2(_local8.vertices[_local9]).Set((_local10.x / VariablesGlobales.RATIO), (_local10.y / VariablesGlobales.RATIO));
_local9++;
};
_local8.density = 0;
_local8.friction = 0.2;
_local8.restitution = 0;
_local8.userData = this;
_local3.push(_local8);
};
_local5 = new b2BodyDef();
_local5.position.Set((_arg2.x / VariablesGlobales.RATIO), (_arg2.y / VariablesGlobales.RATIO));
_local5.allowSleep = false;
_local6 = VariablesGlobales.mundo.CreateBody(_local5);
for each (_local7 in _local3) {
_local6.CreateShape(_local7);
};
_local6.SetMassFromShapes();
return (_local6);
}
}
}//package
Section 194
//ExplodeWorld (ExplodeWorld)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class ExplodeWorld extends b2World {
var _sprite:Sprite;
public function ExplodeWorld(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
super(_arg1, _arg2, _arg3);
}
function esVisible(_arg1:b2Shape, _arg2:b2Shape, _arg3:b2Vec2):Boolean{
var _local4:Boolean;
var _local5:b2Segment;
var _local6:Array;
var _local7:*;
var _local8:b2Body;
var _local9:b2XForm;
var _local10:Array;
var _local11:String;
var _local12:int;
var _local13:int;
if (_arg1 == _arg2){
return (false);
};
_local4 = true;
_local5 = new b2Segment();
_local5.p1.SetV(_arg1.GetBody().GetPosition());
_local5.p2.SetV(new b2Vec2(0, 0));
_local5.p2.Add(_arg2.GetBody().GetWorldPoint(_arg3));
_local6 = new Array();
_local7 = 0x0100;
_local7 = VariablesGlobales.mundo.Raycast(_local5, _local6, _local7, true, null);
_local7 = (_local7 - 2);
_local8 = _arg2.GetBody();
_local9 = _arg2.GetBody().GetXForm();
_local10 = [0];
_arg2.TestSegment(_local9, _local10, VariablesGlobales.mundo.m_raycastNormal, _local5, 1);
_local11 = "";
_local12 = 0;
while (_local12 < _local10.length) {
_local11 = (((((_local11 + "l") + _local12) + ": ") + _local10[_local12]) + " ,");
_local12++;
};
_local6.shift();
_local6.pop();
_local11 = "";
_local11 = (("desde " + _arg1.GetUserData()) + " -> ");
_local13 = 0;
while (_local13 < _local6.length) {
_local11 = (((_local11 + "\n ") + _local6[_local13].GetUserData()) + ",");
if (_local6[_local13].GetUserData() != _arg2.GetUserData()){
};
_local13++;
};
if ((((((_local7 > 0)) && (!((_local10[0] == 0))))) && (!((_local10[0] == 1))))){
_local7 = (_local7 + 1);
};
_local11 = ((_local11 + "\nhasta ") + _arg2.GetUserData());
if (_local7 == 0){
_local4 = true;
} else {
_local4 = false;
};
return (_local4);
}
public function explode(_arg1:b2Shape, _arg2:b2Vec2, _arg3:Number, _arg4:Number, _arg5:DisplayObjectContainer):void{
var _local6:b2AABB;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Array;
var _local10:b2Body;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Segment;
var _local14:*;
var _local15:b2Vec2;
var _local16:b2Shape;
var _local17:int;
var _local18:Explosion;
var _local19:*;
var _local20:Array;
var _local21:int;
var _local22:b2Vec2;
trace(((("exp. :" + _arg2.x) + ", ") + _arg2.y));
_local6 = new b2AABB();
_local7 = _arg2.Copy();
_local7.Subtract(new b2Vec2(_arg3, _arg3));
_local8 = _arg2.Copy();
_local8.Add(new b2Vec2(_arg3, _arg3));
_local6.lowerBound = _local7;
_local6.upperBound = _local8;
_local9 = new Array();
this.Query(_local6, _local9, 100);
if (_sprite == null){
_sprite = new Sprite();
_arg5.addChild(_sprite);
} else {
_sprite.graphics.clear();
};
_local11 = new b2Vec2(0, 0);
_local12 = new b2Vec2(0, 0);
_local13 = new b2Segment();
_local13.p1.SetV(_arg2);
_local13.p2.SetV(_arg2);
_local13.p2.Add(new b2Vec2(0, 0));
_local14 = [1];
_local15 = new b2Vec2();
_local16 = _arg1;
_local17 = 1;
if ((_local16.GetBody().GetUserData() is BombaBaseActor)){
if (BombaBaseActor(_local16.GetBody().GetUserData()).tipo == BombaBaseActor.BOMBA_REPULSION){
_local17 = Explosion.EXPLOSION_RESPULSION;
} else {
if (BombaBaseActor(_local16.GetBody().GetUserData()).tipo == BombaBaseActor.BOMBA_ATRACCION){
_local17 = Explosion.EXPLOSION_ATRACCION;
};
};
} else {
if ((_local16.GetBody().GetUserData() is PiezaExplosivaActor)){
};
};
_local18 = new Explosion(VariablesGlobales.motor.lienzoEfectos, _local17, new Point((_arg2.x * VariablesGlobales.RATIO), (_arg2.y * VariablesGlobales.RATIO)));
_arg3 = ((_arg3 * VariablesGlobales.MAX_ANCHO_TILE) / VariablesGlobales.RATIO);
_local19 = 0;
while (_local19 < _local9.length) {
_local10 = _local9[_local19].GetBody();
if ((((_local9[_local19].GetType() == b2Shape.e_polygonShape)) && (!((_local9[_local19].GetBody().GetUserData() is EstaticoActor))))){
_local20 = [];
_local20.push(_local10.GetLocalCenter().Copy());
_local21 = 0;
while (_local21 < _local20.length) {
if (_local20[_local21] == null){
} else {
_local22 = _local20[_local21].Copy();
if (((!((_local10.GetWorldCenter() == _arg2))) && (esVisible(_local16, _local9[_local19], _local22)))){
_local12 = _local10.GetWorldCenter().Copy();
_local12.Subtract(_arg2);
if (_local12.x >= 0){
_local11.x = (-(_local12.x) + _arg3);
} else {
_local11.x = (-(_local12.x) - _arg3);
};
if (_local12.y >= 0){
_local11.y = (-(_local12.y) + _arg3);
} else {
_local11.y = (-(_local12.y) - _arg3);
};
_local11.Multiply(_arg4);
if ((_local16.GetBody().GetUserData() is BombaBaseActor)){
if ((_local10.GetUserData() is BombaBaseActor)){
} else {
switch (BombaBaseActor(_local16.GetBody().GetUserData()).tipo){
case BombaBaseActor.BOMBA_ATRACCION:
_local10.WakeUp();
_local10.ApplyForce(_local11.Negative(), _local10.GetWorldCenter());
break;
case BombaBaseActor.BOMBA_REPULSION:
_local10.WakeUp();
_local10.ApplyForce(_local11, _local10.GetWorldCenter());
break;
default:
_local10.WakeUp();
Actor(_local10.GetUserData()).afectadoPorExplosion();
_local10.ApplyForce(_local11, _local10.GetWorldCenter());
};
};
} else {
_local10.WakeUp();
Actor(_local10.GetUserData()).afectadoPorExplosion();
_local10.ApplyForce(_local11, _local10.GetWorldCenter());
};
};
};
_local21++;
};
};
_local19++;
};
}
}
}//package
Section 195
//Explosion (Explosion)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class Explosion extends Sprite {
private var _padre:DisplayObjectContainer;
private var _tipo:int;// = 0
private var _disfraz:MovieClip;
public static const EXPLOSION_RESPULSION:int = 2;
public static const EXPLOSION_01:int = 1;
public static const EXPLOSION_ATRACCION:int = 3;
public function Explosion(_arg1:DisplayObjectContainer, _arg2:int, _arg3:Point){
var _local4:int;
_tipo = 0;
super();
_padre = _arg1;
_tipo = _arg2;
switch (_tipo){
case Explosion.EXPLOSION_01:
_disfraz = new explosion1();
break;
case Explosion.EXPLOSION_RESPULSION:
_disfraz = new explosion_atraccion();
break;
case Explosion.EXPLOSION_ATRACCION:
_disfraz = new explosion_repulsion();
break;
default:
trace("error tipo explosion");
};
_disfraz.x = _arg3.x;
_disfraz.y = _arg3.y;
_padre.addChild(_disfraz);
_disfraz.stop();
_disfraz.play();
addEventListener(Event.ENTER_FRAME, manejarNuevoFrame);
_local4 = ((Math.random() * 3) + 1);
VariablesGlobales.SoundMan.playSound(String(("bomba" + _local4)), 0.3, 0, 0);
}
private function manejarNuevoFrame(_arg1:Event):void{
if (_disfraz.currentFrame >= _disfraz.totalFrames){
_disfraz.stop();
_padre.removeChild(_disfraz);
removeEventListener(Event.ENTER_FRAME, manejarNuevoFrame);
};
}
}
}//package
Section 196
//explosion_atraccion (explosion_atraccion)
package {
import flash.display.*;
public dynamic class explosion_atraccion extends MovieClip {
}
}//package
Section 197
//explosion_repulsion (explosion_repulsion)
package {
import flash.display.*;
public dynamic class explosion_repulsion extends MovieClip {
}
}//package
Section 198
//explosion1 (explosion1)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class explosion1 extends MovieClip {
public function explosion1(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package
Section 199
//ExplosionHielo (ExplosionHielo)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class ExplosionHielo extends Sprite {
private var _padre:DisplayObjectContainer;
private var _tipo:int;// = 0
private var _disfraz:MovieClip;
public static const EXPLOSION_RESPULSION:int = 2;
public static const EXPLOSION_01:int = 1;
public static const EXPLOSION_ATRACCION:int = 3;
public function ExplosionHielo(_arg1:DisplayObjectContainer, _arg2:int, _arg3:Point, _arg4:Number){
var _local5:int;
_tipo = 0;
super();
_padre = _arg1;
_tipo = _arg2;
switch (_tipo){
case 1:
_disfraz = new hieloroto1();
break;
case 2:
_disfraz = new hieloroto2();
break;
case 3:
_disfraz = new hieloroto3();
break;
case 4:
_disfraz = new hieloroto4();
break;
default:
trace("error tipo explosion");
};
_disfraz.x = _arg3.x;
_disfraz.y = _arg3.y;
_disfraz.rotation = _arg4;
_padre.addChild(_disfraz);
_disfraz.stop();
_disfraz.play();
addEventListener(Event.ENTER_FRAME, manejarNuevoFrame);
_local5 = ((Math.random() * 3) + 1);
VariablesGlobales.SoundMan.playSound(String(("bomba" + _local5)), 0.3, 0, 0);
}
private function manejarNuevoFrame(_arg1:Event):void{
if (_disfraz.currentFrame >= _disfraz.totalFrames){
_disfraz.stop();
_padre.removeChild(_disfraz);
removeEventListener(Event.ENTER_FRAME, manejarNuevoFrame);
};
}
}
}//package
Section 200
//FabricaActores (FabricaActores)
package {
import flash.display.*;
import flash.geom.*;
public class FabricaActores {
public function crearActor(_arg1:DisplayObjectContainer, _arg2:int, _arg3:int, _arg4:int):Actor{
var _local5:LogicaTiles;
var _local6:*;
var _local7:int;
var _local8:MovieClip;
_local5 = new LogicaTiles();
_local7 = _local5.tipoLogicaTile(_arg2);
_local8 = new catalogoTiles();
_local8.gotoAndStop(_arg2);
switch (_local7){
case LogicaTiles.ALIEN:
_local6 = new AlienActor(_arg1, new Point(_arg3, _arg4));
break;
case LogicaTiles.ALIEN_BLINDADO:
_local6 = new AlienBlindadoActor(_arg1, new Point(_arg3, _arg4));
break;
case LogicaTiles.PIEZA_INDESTRUIBLE_CUADRADO:
_local6 = new PiezaIndestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_INDESTRUIBLE_CUADRADO));
break;
case LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X2:
_local6 = new PiezaIndestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X2));
break;
case LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X3:
_local6 = new PiezaIndestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X3));
break;
case LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X4:
_local6 = new PiezaIndestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X4));
break;
case LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X2:
_local6 = new PiezaIndestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X2));
break;
case LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X3:
_local6 = new PiezaIndestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X3));
break;
case LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X4:
_local6 = new PiezaIndestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X4));
break;
case LogicaTiles.PIEZA_DESTRUIBLE_CUADRADO:
_local6 = new PiezaDestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_DESTRUIBLE_CUADRADO));
_local6.tipoActor = 1;
break;
case LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X2:
_local6 = new PiezaDestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X2));
_local6.tipoActor = 2;
break;
case LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X3:
_local6 = new PiezaDestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X3));
_local6.tipoActor = 3;
break;
case LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X4:
_local6 = new PiezaDestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X4));
_local6.tipoActor = 4;
break;
case LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X2:
_local6 = new PiezaDestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X2));
_local6.tipoActor = 5;
break;
case LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X3:
_local6 = new PiezaDestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X3));
_local6.tipoActor = 6;
break;
case LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X4:
_local6 = new PiezaDestruibleActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X4));
_local6.tipoActor = 7;
break;
case LogicaTiles.PIEZA_EXPLOSIVA_CUADRADO:
_local6 = new PiezaExplosivaActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_EXPLOSIVA_CUADRADO));
break;
case LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X2:
_local6 = new PiezaExplosivaActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X2));
break;
case LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X3:
_local6 = new PiezaExplosivaActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X3));
break;
case LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X4:
_local6 = new PiezaExplosivaActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X4));
break;
case LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X2:
_local6 = new PiezaExplosivaActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X2));
break;
case LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X3:
_local6 = new PiezaExplosivaActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X3));
break;
case LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X4:
_local6 = new PiezaExplosivaActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X4));
break;
case LogicaTiles.PIEZA_ALIEN_CUADRADO:
_local6 = new PiezaAlienActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.PIEZA_ALIEN_CUADRADO));
break;
case LogicaTiles.CUADRADO:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.CUADRADO));
break;
case LogicaTiles.RAMPA_45:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_45));
break;
case LogicaTiles.RAMPA_45_90:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_45_90));
break;
case LogicaTiles.RAMPA_45_180:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_45_180));
break;
case LogicaTiles.RAMPA_45_270:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_45_270));
break;
case LogicaTiles.MEDIO_CUADRADO:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.MEDIO_CUADRADO));
break;
case LogicaTiles.MEDIO_CUADRADO_90:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.MEDIO_CUADRADO_90));
break;
case LogicaTiles.MEDIO_CUADRADO_180:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.MEDIO_CUADRADO_180));
break;
case LogicaTiles.MEDIO_CUADRADO_270:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.MEDIO_CUADRADO_270));
break;
case LogicaTiles.RAMPA_BASE_30:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30));
break;
case LogicaTiles.RAMPA_BASE_30_90:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30_90));
break;
case LogicaTiles.RAMPA_BASE_30_180:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30_180));
break;
case LogicaTiles.RAMPA_BASE_30_270:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30_270));
break;
case LogicaTiles.RAMPA_BASE_30_INVERTIDA:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30_INVERTIDA));
break;
case LogicaTiles.RAMPA_BASE_30_INVERTIDA_90:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30_INVERTIDA_90));
break;
case LogicaTiles.RAMPA_BASE_30_INVERTIDA_180:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30_INVERTIDA_180));
break;
case LogicaTiles.RAMPA_BASE_30_INVERTIDA_270:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_BASE_30_INVERTIDA_270));
break;
case LogicaTiles.RAMPA_PICO_30:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30));
break;
case LogicaTiles.RAMPA_PICO_30_90:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30_90));
break;
case LogicaTiles.RAMPA_PICO_30_180:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30_180));
break;
case LogicaTiles.RAMPA_PICO_30_270:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30_270));
break;
case LogicaTiles.RAMPA_PICO_30_INVERTIDA:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30_INVERTIDA));
break;
case LogicaTiles.RAMPA_PICO_30_INVERTIDA_90:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30_INVERTIDA_90));
break;
case LogicaTiles.RAMPA_PICO_30_INVERTIDA_180:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30_INVERTIDA_180));
break;
case LogicaTiles.RAMPA_PICO_30_INVERTIDA_270:
_local6 = new EstaticoActor(_arg1, _local8, new Point(_arg3, _arg4), _local5.coordenadasLogicaTile(LogicaTiles.RAMPA_PICO_30_INVERTIDA_270));
break;
default:
_local6 = new DecoracionActor(_arg1, _local8, new Point(_arg3, _arg4));
};
_local6.indice = _arg2;
return (Actor(_local6));
}
}
}//package
Section 201
//Final (Final)
package {
import flash.display.*;
import flash.events.*;
public class Final extends MovieClip {
public var salir:SimpleButton;
public var main_class:MovieClip;
public function Final(){
salir.addEventListener(MouseEvent.CLICK, on_button_clicked);
}
public function on_button_clicked(_arg1:MouseEvent){
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "salir":
main_class.abre_pantalla(new Principal());
main_class.cierra_pantalla(this);
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package
Section 202
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 203
//goma1 (goma1)
package {
import flash.media.*;
public dynamic class goma1 extends Sound {
}
}//package
Section 204
//goma2 (goma2)
package {
import flash.media.*;
public dynamic class goma2 extends Sound {
}
}//package
Section 205
//hielo1 (hielo1)
package {
import flash.media.*;
public dynamic class hielo1 extends Sound {
}
}//package
Section 206
//hielo2 (hielo2)
package {
import flash.media.*;
public dynamic class hielo2 extends Sound {
}
}//package
Section 207
//hielo3 (hielo3)
package {
import flash.media.*;
public dynamic class hielo3 extends Sound {
}
}//package
Section 208
//hieloroto1 (hieloroto1)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class hieloroto1 extends MovieClip {
public function hieloroto1(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 209
//hieloroto2 (hieloroto2)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class hieloroto2 extends MovieClip {
public function hieloroto2(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 210
//hieloroto3 (hieloroto3)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class hieloroto3 extends MovieClip {
public function hieloroto3(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 211
//hieloroto4 (hieloroto4)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class hieloroto4 extends MovieClip {
public function hieloroto4(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 212
//loadingscreen (loadingscreen)
package {
import flash.display.*;
public dynamic class loadingscreen extends MovieClip {
}
}//package
Section 213
//LogicaTiles (LogicaTiles)
package {
import flash.geom.*;
public class LogicaTiles {
private var _tilesDB:Array;
private var _tilesPop:Array;
private var _coordenadasTilesDB:Array;
private var _lista:Array;
public static const RAMPA_BASE_30_270:int = 216;
public static const CUADRADO_REDONDEADO:int = 209;
public static const RAMPA_BASE_30_90:int = 214;
public static const RAMPA_PICO_30_INVERTIDA_90:int = 226;
public static const MEDIO_CUADRADO_270:int = 208;
public static const RAMPA_PICO_30_270:int = 224;
public static const PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X2:int = 58;
public static const PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X3:int = 59;
public static const PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X4:int = 60;
public static const RAMPA_BASE_30_INVERTIDA_270:int = 220;
public static const BOMBARDERO:int = 1;
public static const PIEZA_ALIEN_CUADRADO:int = 71;
public static const CUADRADO_REDONDEADO_270:int = 212;
public static const RAMPA_45:int = 201;
public static const MEDIO_CUADRADO:int = 205;
public static const PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X2:int = 61;
public static const PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X3:int = 62;
public static const PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X4:int = 63;
public static const RAMPA_BASE_30_180:int = 215;
public static const RAMPA_PICO_30_INVERTIDA_270:int = 228;
public static const RAMPA_BASE_30_INVERTIDA:int = 217;
public static const RAMPA_PICO_30_90:int = 222;
public static const PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X2:int = 68;
public static const PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X4:int = 70;
public static const PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X3:int = 69;
public static const PIEZA_EXPLOSIVA_CUADRADO:int = 64;
public static const MEDIO_CUADRADO_180:int = 207;
public static const CUADRADO:int = 200;
public static const RAMPA_PICO_30_180:int = 223;
public static const RAMPA_BASE_30_INVERTIDA_180:int = 219;
public static const RAMPA_PICO_30_INVERTIDA:int = 225;
public static const RAMPA_45_270:int = 204;
public static const ALIEN:int = 2;
public static const PIEZA_INDESTRUIBLE_CUADRADO:int = 50;
public static const CUADRADO_REDONDEADO_180:int = 211;
public static const RAMPA_BASE_30:int = 213;
public static const PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X2:int = 65;
public static const PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X3:int = 66;
public static const RAMPA_45_90:int = 202;
public static const RAMPA_PICO_30_INVERTIDA_180:int = 227;
public static const RAMPA_BASE_30_INVERTIDA_90:int = 218;
public static const PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X4:int = 67;
public static const ALIEN_BLINDADO:int = 3;
public static const CUADRADO_REDONDEADO_90:int = 210;
public static const MEDIO_CUADRADO_90:int = 206;
public static const PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X2:int = 54;
public static const PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X4:int = 56;
public static const PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X3:int = 55;
public static const PIEZA_DESTRUIBLE_CUADRADO:int = 57;
public static const RAMPA_PICO_30:int = 221;
public static const PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X2:int = 51;
public static const PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X3:int = 52;
public static const PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X4:int = 53;
public static const RAMPA_45_180:int = 203;
public function LogicaTiles(){
_tilesDB = [];
_tilesPop = [];
_coordenadasTilesDB = [];
_tilesDB.push(new Array(ALIEN, ALIEN, ALIEN));
_coordenadasTilesDB.push(new Array(ALIEN, [[new Point(0, 0), new Point(30, 0), new Point(30, 15), new Point(20, 30), new Point(10, 30), new Point(0, 15)]]));
_tilesDB.push(new Array(ALIEN_BLINDADO, ALIEN_BLINDADO, ALIEN_BLINDADO));
_coordenadasTilesDB.push(new Array(ALIEN_BLINDADO, [[new Point(0, 0), new Point(30, 0), new Point(30, 15), new Point(20, 30), new Point(10, 30), new Point(0, 15)]]));
_tilesDB.push(new Array(PIEZA_INDESTRUIBLE_CUADRADO, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_INDESTRUIBLE_CUADRADO, [[new Point(0, 0), new Point(30, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X2, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X2, [[new Point(0, 15), new Point(60, 15), new Point(60, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X3, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X3, [[new Point(0, 15), new Point(90, 15), new Point(90, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X4, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_HORIZONTAL_X4, [[new Point(0, 15), new Point(120, 15), new Point(120, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X2, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X2, [[new Point(0, 0), new Point(15, 0), new Point(15, 60), new Point(0, 60)]]));
_tilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X3, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X3, [[new Point(0, 0), new Point(15, 0), new Point(15, 90), new Point(0, 90)]]));
_tilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X4, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_INDESTRUIBLE_RECTANGULO_VERTICAL_X4, [[new Point(0, 0), new Point(15, 0), new Point(15, 120), new Point(0, 120)]]));
_tilesDB.push(new Array(PIEZA_DESTRUIBLE_CUADRADO, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_DESTRUIBLE_CUADRADO, [[new Point(0, 0), new Point(30, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X2, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X2, [[new Point(0, 15), new Point(60, 15), new Point(60, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X3, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X3, [[new Point(0, 15), new Point(90, 15), new Point(90, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X4, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_HORIZONTAL_X4, [[new Point(0, 15), new Point(120, 15), new Point(120, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X2, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X2, [[new Point(0, 0), new Point(15, 0), new Point(15, 60), new Point(0, 60)]]));
_tilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X3, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X3, [[new Point(0, 0), new Point(15, 0), new Point(15, 90), new Point(0, 90)]]));
_tilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X4, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_DESTRUIBLE_RECTANGULO_VERTICAL_X4, [[new Point(0, 0), new Point(15, 0), new Point(15, 120), new Point(0, 120)]]));
_tilesDB.push(new Array(PIEZA_EXPLOSIVA_CUADRADO, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_EXPLOSIVA_CUADRADO, [[new Point(0, 0), new Point(30, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X2, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X2, [[new Point(0, 15), new Point(60, 15), new Point(60, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X3, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X3, [[new Point(0, 15), new Point(90, 15), new Point(90, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X4, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_HORIZONTAL_X4, [[new Point(0, 15), new Point(120, 15), new Point(120, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X2, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X2, [[new Point(0, 0), new Point(15, 0), new Point(15, 60), new Point(0, 60)]]));
_tilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X3, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X3, [[new Point(0, 0), new Point(15, 0), new Point(15, 90), new Point(0, 90)]]));
_tilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X4, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_EXPLOSIVA_RECTANGULO_VERTICAL_X4, [[new Point(0, 0), new Point(15, 0), new Point(15, 120), new Point(0, 120)]]));
_tilesDB.push(new Array(PIEZA_ALIEN_CUADRADO, 0, 0));
_coordenadasTilesDB.push(new Array(PIEZA_ALIEN_CUADRADO, [[new Point(0, 0), new Point(30, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(CUADRADO, 250, 320));
_coordenadasTilesDB.push(new Array(CUADRADO, [[new Point(0, 0), new Point(30, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_45, 321, 329));
_coordenadasTilesDB.push(new Array(RAMPA_45, [[new Point(0, 30), new Point(30, 0), new Point(30, 30)]]));
_tilesDB.push(new Array(RAMPA_45_90, 330, 339));
_coordenadasTilesDB.push(new Array(RAMPA_45_90, [[new Point(0, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_45_180, 340, 349));
_coordenadasTilesDB.push(new Array(RAMPA_45_180, [[new Point(0, 0), new Point(30, 0), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_45_270, 350, 359));
_coordenadasTilesDB.push(new Array(RAMPA_45_270, [[new Point(0, 0), new Point(30, 0), new Point(30, 30)]]));
_tilesDB.push(new Array(MEDIO_CUADRADO, 360, 369));
_coordenadasTilesDB.push(new Array(MEDIO_CUADRADO, [[new Point(0, 15), new Point(30, 15), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(MEDIO_CUADRADO_90, 370, 379));
_coordenadasTilesDB.push(new Array(MEDIO_CUADRADO_90, [[new Point(0, 0), new Point(15, 0), new Point(15, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(MEDIO_CUADRADO_180, 380, 389));
_coordenadasTilesDB.push(new Array(MEDIO_CUADRADO_180, [[new Point(0, 0), new Point(30, 0), new Point(30, 15), new Point(0, 15)]]));
_tilesDB.push(new Array(MEDIO_CUADRADO_270, 390, 399));
_coordenadasTilesDB.push(new Array(MEDIO_CUADRADO_270, [[new Point(15, 0), new Point(30, 0), new Point(30, 30), new Point(15, 30)]]));
_tilesDB.push(new Array(RAMPA_BASE_30, 400, 415));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30, [[new Point(0, 15), new Point(30, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_BASE_30_90, 415, 429));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30_90, [[new Point(0, 0), new Point(15, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_BASE_30_180, 430, 444));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30_180, [[new Point(0, 0), new Point(30, 0), new Point(30, 15), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_BASE_30_270, 445, 459));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30_270, [[new Point(0, 0), new Point(30, 0), new Point(30, 30), new Point(15, 30)]]));
_tilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA, 460, 474));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA, [[new Point(0, 0), new Point(30, 15), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA_90, 475, 489));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA_90, [[new Point(0, 0), new Point(30, 0), new Point(15, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA_180, 490, 504));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA_180, [[new Point(0, 0), new Point(30, 0), new Point(30, 30), new Point(0, 15)]]));
_tilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA_270, 505, 519));
_coordenadasTilesDB.push(new Array(RAMPA_BASE_30_INVERTIDA_270, [[new Point(15, 0), new Point(30, 0), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_PICO_30, 520, 529));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30, [[new Point(0, 30), new Point(30, 15), new Point(30, 30)]]));
_tilesDB.push(new Array(RAMPA_PICO_30_90, 530, 539));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30_90, [[new Point(0, 0), new Point(15, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_PICO_30_180, 540, 549));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30_180, [[new Point(0, 0), new Point(30, 0), new Point(0, 15)]]));
_tilesDB.push(new Array(RAMPA_PICO_30_270, 550, 559));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30_270, [[new Point(15, 0), new Point(30, 0), new Point(30, 30)]]));
_tilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA, 560, 569));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA, [[new Point(0, 15), new Point(30, 30), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA_90, 570, 579));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA_90, [[new Point(0, 0), new Point(15, 0), new Point(0, 30)]]));
_tilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA_180, 580, 589));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA_180, [[new Point(0, 0), new Point(30, 0), new Point(30, 15)]]));
_tilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA_270, 590, 599));
_coordenadasTilesDB.push(new Array(RAMPA_PICO_30_INVERTIDA_270, [[new Point(30, 0), new Point(30, 30), new Point(15, 30)]]));
_tilesPop = [261, 262, 263, 264, 265, 266, 267, 268, 269, 281, 282, 283, 284, 285, 286, 287, 322, 331, 341, 351, 364, 366, 384, 401, 406, 416, 417, 431, 446, 448, 461, 466, 476, 478, 491, 506, 507, 521, 531, 543, 552, 561, 572, 583, 591, 671, 672, 673, 674, 675, 676, 688, 689, 690, 691];
}
public function get lista():Array{
return (_lista);
}
public function tipoLogicaTile(_arg1:int):Number{
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = 0;
for (;_local3 < _tilesDB.length;_local3++) {
if (_tilesDB[_local3][0] == _arg1){
_local2 = _tilesDB[_local3][0];
continue;
} else {
if ((((_arg1 >= _tilesDB[_local3][1])) && ((_arg1 <= _tilesDB[_local3][2])))){
_local2 = _tilesDB[_local3][0];
continue;
};
};
};
return (_local2);
}
public function coordenadasLogicaTile(_arg1:int):Array{
var _local2:Array;
var _local3:int;
_local2 = [];
_local3 = 0;
while (_local3 < _coordenadasTilesDB.length) {
if (_coordenadasTilesDB[_local3][0] == _arg1){
_local2 = _coordenadasTilesDB[_local3][1];
return (_local2);
};
_local3++;
};
return (_local2);
}
public function set lista(_arg1:Array):void{
_lista = _arg1;
}
public function tileDisponible(_arg1:int):Boolean{
var _local2:Boolean;
var _local3:int;
_local2 = false;
_local3 = 0;
for (;_local3 < _tilesDB.length;_local3++) {
if (_tilesDB[_local3][0] == _arg1){
_local2 = true;
continue;
} else {
if ((((_arg1 >= _tilesDB[_local3][1])) && ((_arg1 <= _tilesDB[_local3][2])))){
_local2 = true;
continue;
};
};
};
return (_local2);
}
public function traerAlFrente(_arg1:int):Boolean{
var _local2:Boolean;
_local2 = false;
if (_tilesPop.indexOf(_arg1) >= 0){
_local2 = true;
};
return (_local2);
}
}
}//package
Section 214
//logro (logro)
package {
import flash.media.*;
public dynamic class logro extends Sound {
}
}//package
Section 215
//Logros (Logros)
package {
import flash.display.*;
import flash.events.*;
public class Logros extends MovieClip {
public var achi12:MovieClip;
public var achi13:MovieClip;
public var achi14:MovieClip;
public var achi6:MovieClip;
public var achi8:MovieClip;
public var achi15:MovieClip;
public var achi16:MovieClip;
public var achi19:MovieClip;
public var achi21:MovieClip;
public var achi22:MovieClip;
public var achi24:MovieClip;
public var achi23:MovieClip;
public var achi7:MovieClip;
public var achi17:MovieClip;
public var achi11:MovieClip;
public var achi18:MovieClip;
public var achi10:MovieClip;
public var achi20:MovieClip;
public var salir:SimpleButton;
public var main_class:MovieClip;
public var desc:MovieClip;
public var achi1:MovieClip;
public var achi2:MovieClip;
public var achi4:MovieClip;
public var achi5:MovieClip;
public var achi9:MovieClip;
public var achi3:MovieClip;
public function Logros(){
salir.addEventListener(MouseEvent.CLICK, on_button_clicked);
EstadoLogros();
}
private function EstadoLogros():void{
achi1.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(1);
achi2.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(2);
achi3.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(3);
achi4.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(4);
achi5.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(5);
achi6.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(6);
achi7.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(7);
achi8.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(8);
achi9.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(9);
achi10.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(10);
achi11.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(11);
achi12.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(12);
achi13.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(13);
achi14.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(14);
achi15.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(15);
achi16.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(16);
achi17.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(17);
achi18.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(18);
achi19.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(19);
achi20.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(20);
achi21.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(21);
achi22.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(22);
achi23.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(23);
achi24.visible = VariablesGlobales.logrosMan.LogroDesbloqueado(24);
achi1.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi2.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi3.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi4.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi5.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi6.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi7.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi8.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi9.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi10.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi11.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi12.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi13.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi14.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi15.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi16.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi17.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi18.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi19.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi20.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi21.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi22.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi23.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi24.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
achi1.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi2.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi3.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi4.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi5.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi6.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi7.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi8.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi9.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi10.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi11.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi12.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi13.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi14.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi15.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi16.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi17.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi18.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi19.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi20.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi21.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi22.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi23.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
achi24.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
}
private function on_mouse_out(_arg1:MouseEvent):void{
desc.x = -10000;
desc.y = -10000;
}
private function on_mouse_move(_arg1:MouseEvent):void{
var _local2:String;
var _local3:int;
_local2 = _arg1.currentTarget.name;
_local3 = int(_local2.slice(4, 6));
desc.gotoAndStop(_local3);
desc.x = _arg1.currentTarget.x;
desc.y = _arg1.currentTarget.y;
}
public function on_button_clicked(_arg1:MouseEvent){
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "salir":
main_class.cierra_pantalla(this);
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package
Section 216
//ManagerLogros (ManagerLogros)
package {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.utils.*;
public class ManagerLogros {
public var matrizLogrosInicial:Array;
private var _colaLogros:Array;
private var _matrizLogros:Array;
private var _mostrandoLogro:Boolean;// = false
private var panelAchi:achipopups;
private var muertePanel:Timer;
private var timerLogros:Timer;
public var main_class:MovieClip;
public static const CONSTRUCTIVE:int = 23;
public static const BOUNCING:int = 12;
public static const DESTROYER:int = 20;
public static const I_LIKE_THE_VARIETY:int = 4;
public static const MASSACRE:int = 1;
public static const MEDIUM:int = 22;
public static const THE_END:int = 5;
public static const NEW_EXPERIENCES:int = 24;
public static const ICE_HATER:int = 6;
public static const LAND_TURTLE:int = 10;
public static const TARGET_LOCKING:int = 9;
public static const WASTE_OF_MONEY:int = 16;
public static const EPIC_FAIL:int = 13;
public static const WHERE_DO_YOU_AIM:int = 11;
public static const FREE_FALL:int = 2;
public static const SNIPER:int = 3;
public static const NO_SOUND:int = 18;
public static const WHO_MADE_IT:int = 19;
public static const NOT_AFFECT_ME_EITHER:int = 8;
public static const NOT_AFFECT_ME:int = 7;
public static const CONFUSED:int = 14;
public static const LAZY:int = 21;
public static const LOOKING_FOR_OTHERS:int = 15;
public static const NO_HELP:int = 17;
public function ManagerLogros(){
_matrizLogros = [0, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
matrizLogrosInicial = [0, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
_colaLogros = [];
_mostrandoLogro = false;
timerLogros = new Timer(1000, 1);
super();
trace("inicia manager logros");
_matrizLogros = [0, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
timerLogros.addEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);
timerLogros.start();
}
private function on_finish_timer(_arg1:TimerEvent):void{
muertePanel.removeEventListener(TimerEvent.TIMER_COMPLETE, on_finish_timer);
TweenLite.to(panelAchi, 3, {alpha:0, onComplete:onFinishTween});
}
function onFinishTween():void{
trace("mostrando logro = false");
_mostrandoLogro = false;
}
private function timerComplete(_arg1:TimerEvent):void{
timerLogros.start();
if ((((_colaLogros.length > 0)) && ((_mostrandoLogro == false)))){
mostrarLogro(_colaLogros.splice(0, 1));
};
}
private function mostrarLogro(_arg1:int):void{
_mostrandoLogro = true;
trace("mostrando logro = true");
panelAchi = new achipopups();
panelAchi.gotoAndStop(_arg1);
panelAchi.mouseEnabled = false;
panelAchi.mouseChildren = false;
panelAchi.x = 0;
panelAchi.y = 450;
main_class.parent.addChild(panelAchi);
muertePanel = new Timer(3000, 1);
muertePanel.addEventListener(TimerEvent.TIMER_COMPLETE, on_finish_timer);
muertePanel.start();
VariablesGlobales.SoundMan.playSound("logro", 1, 0, 0);
}
public function DesbloquearLogro(_arg1:int, _arg2:DisplayObjectContainer){
if (_matrizLogros[_arg1] == false){
_matrizLogros[_arg1] = true;
VariablesGlobales.savegameMan.salvarPartida();
_colaLogros.push(_arg1);
};
}
public function LogroDesbloqueado(_arg1:int):Boolean{
var _local2:Boolean;
_local2 = false;
_local2 = _matrizLogros[_arg1];
return (_local2);
}
public function set matrizLogros(_arg1:Array):void{
_matrizLogros = _arg1;
}
public function get matrizLogros():Array{
return (_matrizLogros);
}
}
}//package
Section 217
//ManagerPartidas (ManagerPartidas)
package {
import flash.net.*;
public class ManagerPartidas {
var so:SharedObject;
public function ManagerPartidas(){
so = SharedObject.getLocal("Bombardment_test");
super();
cargarPartida();
}
public function borrarPartida(){
iniciaPartida();
volcarDatos();
salvarPartida();
}
public function cargarPartida(){
if (so.data.inicializados == undefined){
trace("inicializar savegame");
iniciaPartida();
} else {
trace("cargar savegame");
};
volcarDatos();
}
public function salvarPartida(){
so.data.inicializados = true;
so.data.musica = VariablesGlobales.MusicMan.Activo;
so.data.sonido = VariablesGlobales.SoundMan.Activo;
so.data.misionMaxima = VariablesGlobales.indiceNivelMaximo;
so.data.tutoriales = VariablesGlobales.mostrarAyuda;
so.data.logros = VariablesGlobales.logrosMan.matrizLogros;
so.flush();
}
private function volcarDatos():void{
VariablesGlobales.MusicMan.Activo = so.data.musica;
VariablesGlobales.SoundMan.Activo = so.data.sonido;
VariablesGlobales.indiceNivelMaximo = so.data.misionMaxima;
VariablesGlobales.mostrarAyuda = so.data.tutoriales;
VariablesGlobales.logrosMan.matrizLogros = so.data.logros;
}
private function iniciaPartida(){
so.data.inicializados = new Boolean(true);
so.data.musica = true;
so.data.sonido = true;
so.data.misionMaxima = 1;
so.data.tutoriales = true;
so.data.logros = VariablesGlobales.logrosMan.matrizLogrosInicial;
}
}
}//package
Section 218
//menuBombas (menuBombas)
package {
import flash.display.*;
public dynamic class menuBombas extends MovieClip {
public var bomba_03:MovieClip;
public var bomba_04:MovieClip;
public var bomba_05:MovieClip;
public var bomba_08:MovieClip;
public var bomba_01:MovieClip;
public var bomba_07:MovieClip;
public var bomba_02:MovieClip;
public var bomba_06:MovieClip;
}
}//package
Section 219
//menuCargar (menuCargar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class menuCargar extends MovieClip {
public var boton_salir_cargar:SimpleButton;
public var boton_cargar_nivel:SimpleButton;
public var nivel_cargar:TextField;
}
}//package
Section 220
//menuCatalogoTiles (menuCatalogoTiles)
package {
import fl.controls.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class menuCatalogoTiles extends MovieClip {
public var turnos:NumericStepper;
public var boton_goma:SimpleButton;
public var boton_matriz:SimpleButton;
public var bomba_03:MovieClip;
public var bomba_04:MovieClip;
public var bomba_05:MovieClip;
public var bomba_08:MovieClip;
public var boton_guardar:SimpleButton;
public var bomba_01:MovieClip;
public var bomba_07:MovieClip;
public var boton_solidos:MovieClip;
public var boton_no_solidos:MovieClip;
public var bomba_06:MovieClip;
public var lista:TileList;
public var boton_matriz2:MovieClip;
public var boton_goma2:MovieClip;
public var boton_comunes:MovieClip;
public var bomba_02:MovieClip;
public var boton_probar:SimpleButton;
public var boton_borrar_todo:SimpleButton;
public var boton_ayuda:SimpleButton;
public var boton_salir:SimpleButton;
public var boton_cargar:SimpleButton;
public function menuCatalogoTiles(){
__setProp_turnos_menuCatalogoTiles_botonesbombas_1();
}
function __setProp_turnos_menuCatalogoTiles_botonesbombas_1(){
try {
turnos["componentInspectorSetting"] = true;
} catch(e:Error) {
};
turnos.enabled = true;
turnos.maximum = 99;
turnos.minimum = 1;
turnos.stepSize = 1;
turnos.value = 0;
turnos.visible = true;
try {
turnos["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 221
//menuEnJuego (menuEnJuego)
package {
import flash.display.*;
import flash.text.*;
public dynamic class menuEnJuego extends MovieClip {
public var musica:MovieClip;
public var nombre_nivel:TextField;
public var turnos:TextField;
public var solucion:SimpleButton;
public var satelite:MovieClip;
public var reiniciar:SimpleButton;
public var salir:SimpleButton;
public var aliens:TextField;
public var sonido:MovieClip;
public var masjuegos:SimpleButton;
}
}//package
Section 222
//menuGuardar (menuGuardar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class menuGuardar extends MovieClip {
public var boton_salir_guardar:SimpleButton;
public var nivel_guardar:TextField;
public var boton_copiar:SimpleButton;
public var boton_subir_nivel:SimpleButton;
}
}//package
Section 223
//menuMinimapa (menuMinimapa)
package {
import flash.display.*;
public dynamic class menuMinimapa extends MovieClip {
public var boton_minimizar_minimapa:SimpleButton;
public var selector:MovieClip;
}
}//package
Section 224
//menuMisionCumplida (menuMisionCumplida)
package {
import flash.display.*;
public dynamic class menuMisionCumplida extends MovieClip {
public var reintentar_cumplida:SimpleButton;
public var siguiente:SimpleButton;
public var salir:SimpleButton;
public var editar_cumplida:SimpleButton;
public var masjuegos:SimpleButton;
}
}//package
Section 225
//menuMisionFallida (menuMisionFallida)
package {
import flash.display.*;
public dynamic class menuMisionFallida extends MovieClip {
public var reintentar_fallida:SimpleButton;
public var reiniciar:SimpleButton;
public var salir:SimpleButton;
public var editar_fallida:SimpleButton;
public var masjuegos:SimpleButton;
}
}//package
Section 226
//metal1 (metal1)
package {
import flash.media.*;
public dynamic class metal1 extends Sound {
}
}//package
Section 227
//metal2 (metal2)
package {
import flash.media.*;
public dynamic class metal2 extends Sound {
}
}//package
Section 228
//metal3 (metal3)
package {
import flash.media.*;
public dynamic class metal3 extends Sound {
}
}//package
Section 229
//Misiones (Misiones)
package {
import flash.display.*;
import flash.events.*;
public class Misiones extends MovieClip {
public var check_ayuda:MovieClip;
public var musica:MovieClip;
public var m10:MovieClip;
public var m11:MovieClip;
public var m12:MovieClip;
public var m13:MovieClip;
public var m14:MovieClip;
public var m16:MovieClip;
public var m17:MovieClip;
public var m18:MovieClip;
public var m19:MovieClip;
public var m15:MovieClip;
public var m1:MovieClip;
public var m2:MovieClip;
public var m3:MovieClip;
public var m6:MovieClip;
public var m7:MovieClip;
public var m8:MovieClip;
public var m22:MovieClip;
public var m23:MovieClip;
public var m24:MovieClip;
public var m25:MovieClip;
public var m26:MovieClip;
public var m20:MovieClip;
public var m9:MovieClip;
public var m4:MovieClip;
public var m5:MovieClip;
public var m27:MovieClip;
public var m28:MovieClip;
public var m21:MovieClip;
public var main_class:MovieClip;
public var salir:SimpleButton;
public var m30:MovieClip;
public var m29:MovieClip;
public var sonido:MovieClip;
public function Misiones(){
salir.addEventListener(MouseEvent.CLICK, on_button_clicked);
musica.addEventListener(MouseEvent.CLICK, on_button_clicked);
sonido.addEventListener(MouseEvent.CLICK, on_button_clicked);
check_ayuda.addEventListener(MouseEvent.CLICK, on_button_clicked);
if (VariablesGlobales.mostrarAyuda){
check_ayuda.gotoAndStop(1);
} else {
check_ayuda.gotoAndStop(2);
};
EstadoIconosAudio();
estadoMisiones();
}
private function estadoMisiones():void{
var _local1:int;
_local1 = VariablesGlobales.indiceNivelMaximo;
if (_local1 >= 1){
m1.gotoAndStop(1);
m1.buttonMode = true;
m1.addEventListener(MouseEvent.CLICK, on_button_clicked);
m1.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m1.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m1.gotoAndStop(3);
};
if (_local1 >= 2){
m2.gotoAndStop(1);
m2.buttonMode = true;
m2.addEventListener(MouseEvent.CLICK, on_button_clicked);
m2.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m2.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m2.gotoAndStop(3);
};
if (_local1 >= 3){
m3.gotoAndStop(1);
m3.buttonMode = true;
m3.addEventListener(MouseEvent.CLICK, on_button_clicked);
m3.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m3.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m3.gotoAndStop(3);
};
if (_local1 >= 4){
m4.gotoAndStop(1);
m4.buttonMode = true;
m4.addEventListener(MouseEvent.CLICK, on_button_clicked);
m4.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m4.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m4.gotoAndStop(3);
};
if (_local1 >= 5){
m5.gotoAndStop(1);
m5.buttonMode = true;
m5.addEventListener(MouseEvent.CLICK, on_button_clicked);
m5.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m5.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m5.gotoAndStop(3);
};
if (_local1 >= 6){
m6.gotoAndStop(1);
m6.buttonMode = true;
m6.addEventListener(MouseEvent.CLICK, on_button_clicked);
m6.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m6.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m6.gotoAndStop(3);
};
if (_local1 >= 7){
m7.gotoAndStop(1);
m7.buttonMode = true;
m7.addEventListener(MouseEvent.CLICK, on_button_clicked);
m7.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m7.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m7.gotoAndStop(3);
};
if (_local1 >= 8){
m8.gotoAndStop(1);
m8.buttonMode = true;
m8.addEventListener(MouseEvent.CLICK, on_button_clicked);
m8.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m8.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m8.gotoAndStop(3);
};
if (_local1 >= 9){
m9.gotoAndStop(1);
m9.buttonMode = true;
m9.addEventListener(MouseEvent.CLICK, on_button_clicked);
m9.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m9.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m9.gotoAndStop(3);
};
if (_local1 >= 10){
m10.gotoAndStop(1);
m10.buttonMode = true;
m10.addEventListener(MouseEvent.CLICK, on_button_clicked);
m10.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m10.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m10.gotoAndStop(3);
};
if (_local1 >= 11){
m11.gotoAndStop(1);
m11.buttonMode = true;
m11.addEventListener(MouseEvent.CLICK, on_button_clicked);
m11.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m11.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m11.gotoAndStop(3);
};
if (_local1 >= 12){
m12.gotoAndStop(1);
m12.buttonMode = true;
m12.addEventListener(MouseEvent.CLICK, on_button_clicked);
m12.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m12.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m12.gotoAndStop(3);
};
if (_local1 >= 13){
m13.gotoAndStop(1);
m13.buttonMode = true;
m13.addEventListener(MouseEvent.CLICK, on_button_clicked);
m13.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m13.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m13.gotoAndStop(3);
};
if (_local1 >= 14){
m14.gotoAndStop(1);
m14.buttonMode = true;
m14.addEventListener(MouseEvent.CLICK, on_button_clicked);
m14.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m14.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m14.gotoAndStop(3);
};
if (_local1 >= 15){
m15.gotoAndStop(1);
m15.buttonMode = true;
m15.addEventListener(MouseEvent.CLICK, on_button_clicked);
m15.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m15.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m15.gotoAndStop(3);
};
if (_local1 >= 16){
m16.gotoAndStop(1);
m16.buttonMode = true;
m16.addEventListener(MouseEvent.CLICK, on_button_clicked);
m16.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m16.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m16.gotoAndStop(3);
};
if (_local1 >= 17){
m17.gotoAndStop(1);
m17.buttonMode = true;
m17.addEventListener(MouseEvent.CLICK, on_button_clicked);
m17.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m17.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m17.gotoAndStop(3);
};
if (_local1 >= 18){
m18.gotoAndStop(1);
m18.buttonMode = true;
m18.addEventListener(MouseEvent.CLICK, on_button_clicked);
m18.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m18.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m18.gotoAndStop(3);
};
if (_local1 >= 19){
m19.gotoAndStop(1);
m19.buttonMode = true;
m19.addEventListener(MouseEvent.CLICK, on_button_clicked);
m19.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m19.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m19.gotoAndStop(3);
};
if (_local1 >= 20){
m20.gotoAndStop(1);
m20.buttonMode = true;
m20.addEventListener(MouseEvent.CLICK, on_button_clicked);
m20.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m20.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m20.gotoAndStop(3);
};
if (_local1 >= 21){
m21.gotoAndStop(1);
m21.buttonMode = true;
m21.addEventListener(MouseEvent.CLICK, on_button_clicked);
m21.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m21.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m21.gotoAndStop(3);
};
if (_local1 >= 22){
m22.gotoAndStop(1);
m22.buttonMode = true;
m22.addEventListener(MouseEvent.CLICK, on_button_clicked);
m22.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m22.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m22.gotoAndStop(3);
};
if (_local1 >= 23){
m23.gotoAndStop(1);
m23.buttonMode = true;
m23.addEventListener(MouseEvent.CLICK, on_button_clicked);
m23.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m23.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m23.gotoAndStop(3);
};
if (_local1 >= 24){
m24.gotoAndStop(1);
m24.buttonMode = true;
m24.addEventListener(MouseEvent.CLICK, on_button_clicked);
m24.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m24.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m24.gotoAndStop(3);
};
if (_local1 >= 25){
m25.gotoAndStop(1);
m25.buttonMode = true;
m25.addEventListener(MouseEvent.CLICK, on_button_clicked);
m25.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m25.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m25.gotoAndStop(3);
};
if (_local1 >= 26){
m26.gotoAndStop(1);
m26.buttonMode = true;
m26.addEventListener(MouseEvent.CLICK, on_button_clicked);
m26.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m26.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m26.gotoAndStop(3);
};
if (_local1 >= 27){
m27.gotoAndStop(1);
m27.buttonMode = true;
m27.addEventListener(MouseEvent.CLICK, on_button_clicked);
m27.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m27.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m27.gotoAndStop(3);
};
if (_local1 >= 28){
m28.gotoAndStop(1);
m28.buttonMode = true;
m28.addEventListener(MouseEvent.CLICK, on_button_clicked);
m28.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m28.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m28.gotoAndStop(3);
};
if (_local1 >= 29){
m29.gotoAndStop(1);
m29.buttonMode = true;
m29.addEventListener(MouseEvent.CLICK, on_button_clicked);
m29.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m29.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m29.gotoAndStop(3);
};
if (_local1 >= 30){
m30.gotoAndStop(1);
m30.buttonMode = true;
m30.addEventListener(MouseEvent.CLICK, on_button_clicked);
m30.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
m30.addEventListener(MouseEvent.ROLL_OUT, on_button_out);
} else {
m30.gotoAndStop(3);
};
}
private function abrirMision(_arg1:int):void{
VariablesGlobales.nivelActual = VariablesGlobales.nivelesJuego.datos[_arg1];
VariablesGlobales.indiceNivelActual = _arg1;
main_class.abre_pantalla(new PantallaJuego());
main_class.cierra_pantalla(this);
}
private function EstadoIconosAudio():void{
if (VariablesGlobales.SoundMan.Activo){
sonido.gotoAndStop(1);
} else {
sonido.gotoAndStop(2);
};
if (VariablesGlobales.MusicMan.Activo){
musica.gotoAndStop(1);
} else {
musica.gotoAndStop(2);
};
}
public function on_button_clicked(_arg1:MouseEvent){
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "m1":
abrirMision(1);
break;
case "m2":
abrirMision(2);
break;
case "m3":
abrirMision(3);
break;
case "m4":
abrirMision(4);
break;
case "m5":
abrirMision(5);
break;
case "m6":
abrirMision(6);
break;
case "m7":
abrirMision(7);
break;
case "m8":
abrirMision(8);
break;
case "m9":
abrirMision(9);
break;
case "m10":
abrirMision(10);
break;
case "m11":
abrirMision(11);
break;
case "m12":
abrirMision(12);
break;
case "m13":
abrirMision(13);
break;
case "m14":
abrirMision(14);
break;
case "m15":
abrirMision(15);
break;
case "m16":
abrirMision(16);
break;
case "m17":
abrirMision(17);
break;
case "m18":
abrirMision(18);
break;
case "m19":
abrirMision(19);
break;
case "m20":
abrirMision(20);
break;
case "m21":
abrirMision(21);
break;
case "m22":
abrirMision(22);
break;
case "m23":
abrirMision(23);
break;
case "m24":
abrirMision(24);
break;
case "m25":
abrirMision(25);
break;
case "m26":
abrirMision(26);
break;
case "m27":
abrirMision(27);
break;
case "m28":
abrirMision(28);
break;
case "m29":
abrirMision(29);
break;
case "m30":
abrirMision(30);
break;
case "check_ayuda":
VariablesGlobales.mostrarAyuda = !(VariablesGlobales.mostrarAyuda);
if (VariablesGlobales.mostrarAyuda){
check_ayuda.gotoAndStop(1);
} else {
check_ayuda.gotoAndStop(2);
};
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.NO_HELP, main_class);
VariablesGlobales.savegameMan.salvarPartida();
break;
case "salir":
main_class.abre_pantalla(new Principal());
main_class.cierra_pantalla(this);
break;
case "musica":
VariablesGlobales.MusicMan.Mute();
EstadoIconosAudio();
break;
case "sonido":
VariablesGlobales.SoundMan.Mute();
EstadoIconosAudio();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
private function on_button_out(_arg1:MouseEvent):void{
_arg1.currentTarget.gotoAndStop(1);
}
private function on_button_over(_arg1:MouseEvent):void{
_arg1.currentTarget.gotoAndStop(2);
}
}
}//package
Section 230
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 231
//Motor (Motor)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import gs.*;
import Box2D.Collision.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import flash.utils.*;
import com.tanoku.utilidades.*;
import gs.easing.*;
public class Motor extends EventDispatcher {
private var _soltarLluviaBombas:Boolean;// = false
private var _indiceBombaActual:int;
private var _nivel:String;
private var _padre:DisplayObjectContainer;
private var _direccionObjetivoActual:Point;
private var _direccionObjetivo:Point;
private var _fondo:ParallaxBox;
private var _anguloObjetivoActual:Number;
private var _menuMisionFallida:menuMisionFallida;
private var _menuMisionCumplida:menuMisionCumplida;
private var _interfaz:Sprite;
private var _actores:Array;
private var _tiempoRetardoBombaLluvia:Number;// = 12
private var _bombasPorSoltar:int;
private var _menuBombas:menuBombas;
private var _nivelCargado:Boolean;// = false
private var _actoresABorrar:Array;
private var _turnos:int;// = 0
private var _mapaAncho:int;
private var _debug:Sprite;
private var fabrica:FabricaActores;
private var _interfazContenedor:Sprite;
private var _tiempoRetardo:Number;
private var _mapaAlto:int;
private var numTilesAct:int;// = 0
private var _coordenadaObjetivo:Point;
private var _bombasDisponibles:Array;
private var _tiles:Array;
private var _mostrandoTodoElMapa:Boolean;// = false
private var _menuEnJuego:menuEnJuego;
private var _objetivoCamara:Actor;
private var _bombarderoActual:BombarderoActor;
private var _dialogosEnJuego:dialogosEnJuego;
private var _turnosInfinitos:Boolean;// = false
private var _lienzo:Sprite;
private var _coordenadaSalidaBombardero:Point;
private var _temaNivel:int;
private var _objetivoFijado:Boolean;// = false
private var _sin_sonido:Boolean;// = false
private var _aliensPorMatar:int;// = 0
private var _turnosInicio;
private var _lienzoEfectos:Sprite;
private var _juegoContenedor:Sprite;
private var _bombarderoDisponible:Boolean;// = false
private var _coordenadaObjetivoActual:Point;
private var _fondoInterfaz:Sprite;
public function Motor(_arg1:DisplayObjectContainer){
_nivelCargado = false;
fabrica = new FabricaActores();
_soltarLluviaBombas = false;
_tiempoRetardoBombaLluvia = 12;
_tiempoRetardo = _tiempoRetardoBombaLluvia;
_aliensPorMatar = 0;
_turnos = 0;
_turnosInfinitos = false;
_bombarderoDisponible = false;
_objetivoFijado = false;
_mostrandoTodoElMapa = false;
_bombasDisponibles = [];
_sin_sonido = false;
numTilesAct = 0;
super();
_padre = _arg1;
}
private function primeraBombaDisponibleActual():int{
var _local1:int;
var _local2:int;
_local1 = 1;
_local2 = 1;
for (;_local2 < _bombasDisponibles.length;_local2++) {
if (_bombasDisponibles[_local2] == true){
trace((_local2 + " bomba por defecto"));
seleccionarBomba(_local2);
_local1 = _local2;
_local2 = _bombasDisponibles.length;
continue;
};
};
return (_local1);
}
private function parsearCadenaNivel(_arg1:String):Boolean{
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:int;
_local2 = _arg1.split(";");
_local3 = _local2[0].split(",");
_mapaAncho = _local3[0];
_mapaAlto = _local3[1];
_temaNivel = _local3[2];
_turnos = _local3[3];
_turnosInicio = _turnos;
_bombasDisponibles = [false, false, false, false, false, false, false, false, false];
if (_local3[4] == 1){
_bombasDisponibles[1] = true;
};
if (_local3[5] == 1){
_bombasDisponibles[2] = true;
};
if (_local3[6] == 1){
_bombasDisponibles[3] = true;
};
if (_local3[8] == 1){
_bombasDisponibles[5] = true;
};
if (_local3[9] == 1){
_bombasDisponibles[6] = true;
};
_local4 = _local2[1].split("|");
_local5 = [];
_tiles = new Array(_mapaAncho);
numTilesAct = 0;
_local6 = 0;
while (_local6 < _local4.length) {
_local5 = _local4[_local6].split(",");
_tiles[_local6] = new Array(_local5.length);
_local7 = 0;
while (_local7 < _local5.length) {
if (_local5[_local7] == ""){
_local5[_local7] = 0;
} else {
numTilesAct = (numTilesAct + 1);
};
_tiles[_local6][_local7] = _local5[_local7];
_local7++;
};
_local6++;
};
return (true);
}
private function controlSeguimientoCamara():void{
if (_objetivoCamara != null){
VariablesGlobales.camara.irA(new Point(_objetivoCamara.disfraz.x, _objetivoCamara.disfraz.y));
};
}
private function eliminarObjetosNivel():void{
var _local1:int;
_local1 = 0;
while (_local1 < _actores.length) {
eliminarActor(_actores[_local1]);
_local1++;
};
eliminarActoresAhora();
_actores = [];
_actoresABorrar = [];
}
private function manejarMouseMove(_arg1:MouseEvent):void{
rotateTurret();
}
function rotateTurret():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (_bombarderoDisponible){
_local1 = (180 / Math.PI);
_local2 = (Math.PI / 180);
_local3 = Math.atan2((_interfaz.mouseY - _menuEnJuego.satelite.y), (_interfaz.mouseX - _menuEnJuego.satelite.x));
_local3 = (_local3 * _local1);
if ((((_local3 > 180)) || ((_local3 < 0)))){
if (_interfaz.mouseX >= _menuEnJuego.satelite.x){
_local3 = 0;
} else {
_local3 = 180;
};
};
_menuEnJuego.satelite.objetivo.rotation = (_local3 - 90);
_coordenadaObjetivo = Coordenadas.localToLocal(_menuEnJuego.satelite, _lienzo).clone();
_direccionObjetivo = Coordenadas.localToLocal(_menuEnJuego.satelite.objetivo, _lienzo, new Point(_menuEnJuego.satelite.objetivo.mirilla.x, _menuEnJuego.satelite.objetivo.mirilla.y)).clone();
_anguloObjetivoActual = _menuEnJuego.satelite.objetivo.rotation;
};
}
private function iniciarLLuviaBombas(_arg1:int):void{
var _local2:BombaBaseActor;
var _local3:Point;
var _local4:Point;
var _local5:int;
var _local6:int;
_local3 = _coordenadaObjetivoActual.clone();
_local4 = _direccionObjetivoActual.clone();
_local5 = 1;
if (_anguloObjetivoActual < 0){
_local5 = 1;
} else {
_local5 = -1;
};
_local6 = 1;
while (_local6 < BombaBaseActor.CANTIDAD_BOMBAS_LLUVIAS) {
_local2 = new BombaBaseActor(_lienzo, _arg1, _local3, _local4);
_local4.x = (_local4.x + (15 * _local5));
_actores.push(_local2);
_local6++;
};
_bombarderoActual.armado = false;
}
private function manejarClickMisionFallida(_arg1:MouseEvent):void{
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "reiniciar":
_menuMisionFallida.visible = false;
this.dispatchEvent(new MotorEvent(MotorEvent.REINICIAR_NIVEL));
break;
case "salir":
this.dispatchEvent(new MotorEvent(MotorEvent.SALIR_NIVEL));
break;
case "reintentar_fallida":
_menuMisionFallida.visible = false;
this.dispatchEvent(new MotorEvent(MotorEvent.REINICIAR_NIVEL));
break;
case "editar_fallida":
this.dispatchEvent(new MotorEvent(MotorEvent.SALIR_NIVEL));
break;
case "masjuegos":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SPONSOR);
break;
default:
trace((_arg1.currentTarget.name + " no definido menu misin fallida"));
};
}
public function alienMuerto():void{
_aliensPorMatar = (_aliensPorMatar - 1);
if (_aliensPorMatar <= 0){
trace("todos los aliens eliminados");
};
}
private function configuraMenus():void{
cargarInterfaz();
}
public function ejecutarNivel(){
}
private function controlLogicaJuego():void{
var _local1:int;
var _local2:Number;
var _local3:int;
_menuEnJuego.turnos.text = ("" + _turnos);
_menuEnJuego.aliens.text = ("" + _aliensPorMatar);
if (VariablesGlobales.nivelPruebaActual != ""){
_menuEnJuego.nombre_nivel.text = "Test level";
} else {
_menuEnJuego.nombre_nivel.text = ("Mission " + VariablesGlobales.indiceNivelActual);
};
if (_aliensPorMatar <= 0){
if (_menuMisionCumplida.visible == false){
_menuMisionCumplida.visible = true;
_local1 = (_turnosInicio - _turnos);
if (_local1 == 1){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.SNIPER, _padre.parent);
};
if (((((((((VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_MISIL]) && (VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_RETARDADA]))) && (VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_ALIEN]))) && (VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_BOLA]))) && (VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_GOMA]))){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.I_LIKE_THE_VARIETY, _padre.parent);
};
_local2 = ((getTimer() - VariablesGlobales.tiempo_incio_nivel) / 1000);
if (_local2 > 300){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.LAND_TURTLE, _padre.parent);
};
if (_sin_sonido){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.NO_SOUND, _padre.parent);
};
if (VariablesGlobales.nivelPruebaActual == ""){
trace((("Mision " + VariablesGlobales.indiceNivelActual) + " cumplida"));
if (VariablesGlobales.indiceNivelMaximo <= VariablesGlobales.indiceNivelActual){
VariablesGlobales.indiceNivelMaximo = (VariablesGlobales.indiceNivelMaximo + 1);
};
} else {
trace(("test solucionado num tiles " + numTilesAct));
if ((((numTilesAct >= 50)) && ((numTilesAct <= 149)))){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.LAZY, _padre.parent);
} else {
if ((((numTilesAct >= 50)) && ((numTilesAct <= 149)))){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.MEDIUM, _padre.parent);
} else {
if (numTilesAct >= 150){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.CONSTRUCTIVE, _padre.parent);
};
};
};
};
};
} else {
if (_turnos <= 0){
_local3 = numeroDeObjetosEnMovimiento();
if (_local3 == 0){
if (_menuMisionFallida.visible == false){
_menuMisionFallida.visible = true;
if ((((VariablesGlobales.indiceNivelActual == 1)) && ((VariablesGlobales.nivelPruebaActual == "")))){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.EPIC_FAIL, _padre.parent);
};
};
};
};
};
if (_objetivoFijado){
if (_coordenadaObjetivoActual.x >= _coordenadaSalidaBombardero.x){
if (_bombarderoActual.disfraz.x >= _coordenadaObjetivoActual.x){
trace(((("SOLTAR BOMBA " + _bombarderoActual.disfraz.x) + ",") + _bombarderoActual.disfraz.y));
lanzarBomba();
};
} else {
if (_bombarderoActual.disfraz.x <= _coordenadaObjetivoActual.x){
trace(((("SOLTAR BOMBA " + _bombarderoActual.disfraz.x) + ",") + _bombarderoActual.disfraz.y));
lanzarBomba();
};
};
};
}
private function lanzarBomba():void{
VariablesGlobales.aliens_muertos_1_tiro = 0;
if (_indiceBombaActual == BombaBaseActor.BOMBA_EXPLOSIVA_DIRECTA){
VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_MISIL] = true;
};
if (_indiceBombaActual == BombaBaseActor.BOMBA_EXPLOSIVA_RETARDADA){
VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_RETARDADA] = true;
};
if (_indiceBombaActual == BombaBaseActor.BOMBA_EXPLOSIVA_ALIEN){
VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_ALIEN] = true;
};
if (_indiceBombaActual == BombaBaseActor.BOMBA_NO_EXPLOSIVA){
VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_BOLA] = true;
};
if (_indiceBombaActual == BombaBaseActor.BOMBA_EXPLOSIVA_RETARDADA_ELASTICA){
VariablesGlobales.bombas_usadas[VariablesGlobales.BOMBA_GOMA] = true;
};
if (_indiceBombaActual == BombaBaseActor.BOMBA_EXPLOSIVA_LLUVIA){
iniciarLLuviaBombas(_indiceBombaActual);
_bombarderoActual.maniobraEvasiva = true;
_bombarderoDisponible = true;
_objetivoFijado = false;
} else {
crearBomba(_indiceBombaActual, true);
_bombarderoActual.maniobraEvasiva = true;
_bombarderoDisponible = true;
_objetivoFijado = false;
};
_turnos = (_turnos - 1);
}
public function abandonarNivel(){
descargarNivel();
}
private function EstadoIconosAudio():void{
_sin_sonido = false;
if (VariablesGlobales.SoundMan.Activo){
_menuEnJuego.sonido.gotoAndStop(1);
} else {
_menuEnJuego.sonido.gotoAndStop(2);
};
if (VariablesGlobales.MusicMan.Activo){
_menuEnJuego.musica.gotoAndStop(1);
} else {
_menuEnJuego.musica.gotoAndStop(2);
};
}
private function inicializaMundo():void{
var _local1:b2AABB;
var _local2:b2Vec2;
var _local3:Boolean;
var _local4:b2DebugDraw;
_local1 = new b2AABB();
VariablesGlobales.limitesMundo = new Rectangle();
VariablesGlobales.limitesMundo.topLeft = new Point((-(VariablesGlobales.LADO_TILE) * 40), (-(VariablesGlobales.LADO_TILE) * 20));
VariablesGlobales.limitesMundo.bottomRight = new Point(((_mapaAncho * VariablesGlobales.LADO_TILE) + (VariablesGlobales.LADO_TILE * 40)), ((_mapaAlto * VariablesGlobales.LADO_TILE) + (VariablesGlobales.LADO_TILE * 10)));
_local1.lowerBound.Set((VariablesGlobales.limitesMundo.topLeft.x / VariablesGlobales.RATIO), (VariablesGlobales.limitesMundo.topLeft.y / VariablesGlobales.RATIO));
_local1.upperBound.Set((VariablesGlobales.limitesMundo.bottomRight.x / VariablesGlobales.RATIO), (VariablesGlobales.limitesMundo.bottomRight.y / VariablesGlobales.RATIO));
_local2 = new b2Vec2(0, VariablesGlobales.GRAVEDAD);
_local3 = true;
VariablesGlobales.mundo = new ExplodeWorld(_local1, _local2, _local3);
VariablesGlobales.mundo.SetContactListener(new BombardmentContactListener());
_local4 = new b2DebugDraw();
_local4.m_sprite = _debug;
_local4.m_drawScale = 30;
_local4.m_fillAlpha = 0.3;
_local4.m_lineThickness = 1;
_local4.m_drawFlags = ((b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit) | b2DebugDraw.e_aabbBit);
VariablesGlobales.mundo.SetDebugDraw(_local4);
_debug.visible = false;
}
public function bombarderoFueraDeLimites(_arg1:BombarderoActor){
if (_bombarderoActual == _arg1){
_bombarderoActual = null;
_bombarderoDisponible = true;
};
}
public function iniciaMotor(){
_juegoContenedor = new Sprite();
_padre.addChild(_juegoContenedor);
_lienzo = new Sprite();
_juegoContenedor.addChild(_lienzo);
_lienzoEfectos = new Sprite();
_juegoContenedor.addChild(_lienzoEfectos);
_debug = new Sprite();
_juegoContenedor.addChild(_debug);
_interfazContenedor = new Sprite();
_padre.addChild(_interfazContenedor);
crearAreaInterfaz();
_interfaz = new Sprite();
_interfazContenedor.addChild(_interfaz);
VariablesGlobales.camara = new Camara();
VariablesGlobales.camara.iniciaCamara(_juegoContenedor, VariablesGlobales.ALTO_PANTALLA, VariablesGlobales.ANCHO_PANTALLA);
_actores = [];
_actores = [];
_objetivoCamara = null;
VariablesGlobales.MusicMan.stopAllSounds(false);
VariablesGlobales.MusicMan.playSound("musica1", 1, 0, 99);
}
public function actualiza(){
var _local1:Actor;
if (VariablesGlobales.mundo != null){
VariablesGlobales.mundo.Step(VariablesGlobales.PASO_TIEMPO, 10);
for each (_local1 in _actores) {
_local1.actualizaAhora();
};
eliminarActoresAhora();
VariablesGlobales.mundo.DrawDebugData();
controlSeguimientoCamara();
controlLogicaJuego();
};
}
private function cargarInterfaz():void{
var _local1:Number;
var _local2:Number;
_menuBombas = new menuBombas();
_menuBombas.x = 275;
_menuBombas.y = 5;
_interfaz.addChild(_menuBombas);
rellenarListaBombas();
_menuEnJuego = new menuEnJuego();
_interfaz.addChild(_menuEnJuego);
_menuEnJuego.reiniciar.addEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.salir.addEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.musica.addEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.sonido.addEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.masjuegos.addEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.solucion.addEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
EstadoIconosAudio();
_dialogosEnJuego = new dialogosEnJuego();
_local1 = _dialogosEnJuego.width;
_local2 = _dialogosEnJuego.height;
if (!VariablesGlobales.mostrarAyuda){
_dialogosEnJuego.visible = false;
};
if (VariablesGlobales.nivelEditor){
_dialogosEnJuego.visible = false;
};
if (VariablesGlobales.indiceNivelActual <= _dialogosEnJuego.totalFrames){
_dialogosEnJuego.gotoAndStop(VariablesGlobales.indiceNivelActual);
} else {
_dialogosEnJuego.visible = false;
};
_interfaz.addChild(_dialogosEnJuego);
_dialogosEnJuego.cerrar_dialogo.addEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuMisionFallida = new menuMisionFallida();
_interfaz.addChild(_menuMisionFallida);
_menuMisionFallida.visible = false;
_menuMisionFallida.reiniciar.addEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.salir.addEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.reintentar_fallida.addEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.editar_fallida.addEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.masjuegos.addEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
if (VariablesGlobales.nivelPruebaActual == ""){
_menuMisionFallida.reintentar_fallida.visible = false;
_menuMisionFallida.editar_fallida.visible = false;
};
_menuMisionCumplida = new menuMisionCumplida();
_interfaz.addChild(_menuMisionCumplida);
_menuMisionCumplida.visible = false;
_menuMisionCumplida.siguiente.addEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.salir.addEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.reintentar_cumplida.addEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.editar_cumplida.addEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.masjuegos.addEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
if (VariablesGlobales.nivelPruebaActual == ""){
_menuMisionCumplida.reintentar_cumplida.visible = false;
_menuMisionCumplida.editar_cumplida.visible = false;
};
_menuEnJuego.setChildIndex(_menuEnJuego.satelite, 0);
_menuEnJuego.satelite.x = (VariablesGlobales.ANCHO_PANTALLA / 2);
_menuEnJuego.satelite.cuerpo.addEventListener(MouseEvent.MOUSE_DOWN, manejarMouseDownSatelite);
_menuEnJuego.satelite.area.visible = false;
_menuEnJuego.satelite.objetivo.addEventListener(MouseEvent.MOUSE_MOVE, manejarMouseMove);
_menuEnJuego.satelite.objetivo.addEventListener(MouseEvent.CLICK, manejarClickJuego);
}
public function pausarNivel(){
}
private function manejarMouseDownSatelite(_arg1:MouseEvent):void{
var _local2:Rectangle;
_local2 = new Rectangle(0, _menuEnJuego.satelite.y, (VariablesGlobales.MAX_ANCHO_TILE * VariablesGlobales.MAX_ANCHO_TILE), 0);
_menuEnJuego.satelite.startDrag(false, _local2);
_menuEnJuego.satelite.cuerpo.addEventListener(MouseEvent.MOUSE_UP, manejarMouseUpSatelite);
_padre.addEventListener(MouseEvent.MOUSE_UP, manejarMouseUpSatelite);
}
private function manejarClickJuego(_arg1:MouseEvent):void{
var _local2:int;
if (_mostrandoTodoElMapa){
if (((_bombarderoDisponible) && ((_turnos > 0)))){
_local2 = 1;
if (_arg1.localX <= (VariablesGlobales.ANCHO_PANTALLA / 2)){
_local2 = 1;
} else {
_local2 = -1;
};
if (_bombarderoActual == null){
lanzarBombardero(_local2);
} else {
if (_bombarderoActual.armado == true){
lanzarBomba();
} else {
lanzarBombardero(_local2);
};
};
};
} else {
_objetivoCamara = null;
_mostrandoTodoElMapa = true;
};
}
private function seleccionarBomba(_arg1:int):void{
if (_menuBombas.bomba_01.currentFrame == 2){
_menuBombas.bomba_01.gotoAndStop(1);
};
if (_menuBombas.bomba_02.currentFrame == 2){
_menuBombas.bomba_02.gotoAndStop(1);
};
if (_menuBombas.bomba_03.currentFrame == 2){
_menuBombas.bomba_03.gotoAndStop(1);
};
if (_menuBombas.bomba_04.currentFrame == 2){
_menuBombas.bomba_04.gotoAndStop(1);
};
if (_menuBombas.bomba_05.currentFrame == 2){
_menuBombas.bomba_05.gotoAndStop(1);
};
if (_menuBombas.bomba_06.currentFrame == 2){
_menuBombas.bomba_06.gotoAndStop(1);
};
if (_menuBombas.bomba_07.currentFrame == 2){
_menuBombas.bomba_07.gotoAndStop(1);
};
if (_menuBombas.bomba_08.currentFrame == 2){
_menuBombas.bomba_08.gotoAndStop(1);
};
if (_arg1 == 1){
_menuBombas.bomba_01.gotoAndStop(2);
};
if (_arg1 == 2){
_menuBombas.bomba_02.gotoAndStop(2);
};
if (_arg1 == 3){
_menuBombas.bomba_03.gotoAndStop(2);
};
if (_arg1 == 4){
_menuBombas.bomba_04.gotoAndStop(2);
};
if (_arg1 == 5){
_menuBombas.bomba_05.gotoAndStop(2);
};
if (_arg1 == 6){
_menuBombas.bomba_06.gotoAndStop(2);
};
if (_arg1 == 7){
_menuBombas.bomba_07.gotoAndStop(2);
};
if (_arg1 == 8){
_menuBombas.bomba_08.gotoAndStop(2);
};
if (_arg1 != _indiceBombaActual){
VariablesGlobales.numero_cambio_bomba = (VariablesGlobales.numero_cambio_bomba + 1);
if (VariablesGlobales.numero_cambio_bomba >= 20){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.CONFUSED, _padre.parent);
};
};
_indiceBombaActual = _arg1;
}
private function rellenarListaBombas():void{
if (_bombasDisponibles[1]){
_menuBombas.bomba_01.gotoAndStop(1);
_menuBombas.bomba_01.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_01.gotoAndStop(3);
};
if (_bombasDisponibles[2]){
_menuBombas.bomba_02.gotoAndStop(1);
_menuBombas.bomba_02.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_02.gotoAndStop(3);
};
if (_bombasDisponibles[3]){
_menuBombas.bomba_03.gotoAndStop(1);
_menuBombas.bomba_03.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_03.gotoAndStop(3);
};
if (_bombasDisponibles[4]){
_menuBombas.bomba_04.gotoAndStop(1);
_menuBombas.bomba_04.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_04.gotoAndStop(3);
};
_menuBombas.bomba_04.visible = false;
if (_bombasDisponibles[5]){
_menuBombas.bomba_05.gotoAndStop(1);
_menuBombas.bomba_05.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_05.gotoAndStop(3);
};
if (_bombasDisponibles[6]){
_menuBombas.bomba_06.gotoAndStop(1);
_menuBombas.bomba_06.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_06.gotoAndStop(3);
};
if (_bombasDisponibles[7]){
_menuBombas.bomba_07.gotoAndStop(1);
_menuBombas.bomba_07.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_07.gotoAndStop(3);
};
_menuBombas.bomba_07.visible = false;
if (_bombasDisponibles[8]){
_menuBombas.bomba_08.gotoAndStop(1);
_menuBombas.bomba_08.addEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
} else {
_menuBombas.bomba_08.gotoAndStop(3);
};
_menuBombas.bomba_08.visible = false;
primeraBombaDisponibleActual();
}
public function get objetivoCamara():Actor{
return (_objetivoCamara);
}
public function finalizaMotor(){
descargarNivel();
_padre.removeChild(_juegoContenedor);
_juegoContenedor.removeChild(_lienzo);
_juegoContenedor.removeChild(_lienzoEfectos);
_juegoContenedor.removeChild(_debug);
eliminarAreaInterfaz();
_padre.removeChild(_interfazContenedor);
crearAreaInterfaz();
_interfazContenedor.removeChild(_interfaz);
}
public function reiniciarNivel(){
descargarNivel();
cargarNivel();
ejecutarNivel();
}
private function numeroDeObjetosEnMovimiento():int{
var _local1:int;
var _local2:b2Body;
_local1 = 0;
_local2 = VariablesGlobales.mundo.GetBodyList();
while (_local2 != null) {
if (((!(_local2.IsSleeping())) && (!(_local2.IsStatic())))){
_local1 = (_local1 + 1);
};
_local2 = _local2.GetNext();
};
return (_local1);
}
public function descargarNivel(){
descargarInterfaz();
descargarFondo();
eliminarObjetosNivel();
}
private function crearAreaInterfaz():void{
_fondoInterfaz = new Sprite();
_interfazContenedor.addChild(_fondoInterfaz);
_fondoInterfaz.graphics.lineStyle(0, 0xFFFFFF, 0, false);
_fondoInterfaz.graphics.beginFill(0, 0);
_fondoInterfaz.graphics.drawRect(0, 0, VariablesGlobales.ANCHO_PANTALLA, VariablesGlobales.ALTO_PANTALLA);
_fondoInterfaz.addEventListener(MouseEvent.CLICK, manejarClickJuego);
_fondoInterfaz.addEventListener(MouseEvent.MOUSE_MOVE, manejarMouseMove);
}
private function manejarMouseUpSatelite(_arg1:MouseEvent):void{
_menuEnJuego.satelite.cuerpo.removeEventListener(MouseEvent.MOUSE_UP, manejarMouseUpSatelite);
_padre.removeEventListener(MouseEvent.MOUSE_UP, manejarMouseUpSatelite);
_menuEnJuego.satelite.stopDrag();
VariablesGlobales.satelite_movido = (VariablesGlobales.satelite_movido + 1);
if (VariablesGlobales.satelite_movido >= 25){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.TARGET_LOCKING, _padre.parent);
};
}
private function inicializaDatosPartida():void{
_bombarderoActual = null;
_bombarderoDisponible = true;
_bombasPorSoltar = 0;
_indiceBombaActual = primeraBombaDisponibleActual();
_soltarLluviaBombas = false;
}
private function descargarFondo():void{
_fondo.pause();
}
private function manejarDialogoEnJuego():void{
_dialogosEnJuego.visible = false;
}
private function configuraCamara():void{
_objetivoCamara = null;
VariablesGlobales.camara.limitesCamara = new Rectangle((VariablesGlobales.limitesMundo.left + (VariablesGlobales.LADO_TILE * 10)), (VariablesGlobales.limitesMundo.top + (VariablesGlobales.LADO_TILE * 5)), (VariablesGlobales.limitesMundo.width - (VariablesGlobales.LADO_TILE * 20)), (VariablesGlobales.limitesMundo.height - (VariablesGlobales.LADO_TILE * 15)));
VariablesGlobales.camara.irA(new Point(((_mapaAncho * VariablesGlobales.LADO_TILE) / 2), ((_mapaAlto * VariablesGlobales.LADO_TILE) / 2)));
}
private function traerAlFrenteTiles():void{
var _local1:LogicaTiles;
var _local2:int;
_local1 = new LogicaTiles();
_local2 = 0;
while (_local2 < _actores.length) {
if (_local1.traerAlFrente(Actor(_actores[_local2]).indice)){
_lienzo.setChildIndex(Actor(_actores[_local2]).disfraz, (_lienzo.numChildren - 1));
};
_local2++;
};
}
private function eliminarAreaInterfaz():void{
_fondoInterfaz.removeEventListener(MouseEvent.CLICK, manejarClickJuego);
}
public function set lienzoEfectos(_arg1:Sprite):void{
_lienzoEfectos = _arg1;
}
private function descargarListaBombas():void{
_menuBombas.bomba_01.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
_menuBombas.bomba_02.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
_menuBombas.bomba_03.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
_menuBombas.bomba_04.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
_menuBombas.bomba_05.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
_menuBombas.bomba_06.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
_menuBombas.bomba_07.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
_menuBombas.bomba_08.removeEventListener(MouseEvent.CLICK, manejarSeleccionBomba);
}
private function manejarClickMenuEnJuego(_arg1:MouseEvent):void{
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "reiniciar":
this.dispatchEvent(new MotorEvent(MotorEvent.REINICIAR_NIVEL));
break;
case "salir":
this.dispatchEvent(new MotorEvent(MotorEvent.SALIR_NIVEL));
break;
case "cerrar_dialogo":
manejarDialogoEnJuego();
break;
case "sonido":
VariablesGlobales.SoundMan.Mute();
EstadoIconosAudio();
break;
case "musica":
VariablesGlobales.MusicMan.Mute();
EstadoIconosAudio();
break;
case "masjuegos":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SPONSOR);
break;
case "solucion":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SOLUCION);
break;
default:
trace((_arg1.currentTarget.name + " no definido menu en juego"));
};
}
private function crearBomba(_arg1:int, _arg2:Boolean=false):void{
var _local3:BombaBaseActor;
if (_bombarderoActual != null){
_local3 = new BombaBaseActor(_lienzo, _arg1, _coordenadaObjetivoActual, _direccionObjetivoActual);
_actores.push(_local3);
_bombarderoActual.armado = false;
if (_arg2){
};
};
}
private function manejarClickMisionCumplida(_arg1:MouseEvent):void{
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "siguiente":
_menuMisionCumplida.visible = false;
this.dispatchEvent(new MotorEvent(MotorEvent.SIGUIENTE_NIVEL));
break;
case "salir":
this.dispatchEvent(new MotorEvent(MotorEvent.SALIR_NIVEL));
break;
case "reintentar_cumplida":
_menuMisionCumplida.visible = false;
this.dispatchEvent(new MotorEvent(MotorEvent.REINICIAR_NIVEL));
break;
case "editar_cumplida":
this.dispatchEvent(new MotorEvent(MotorEvent.SALIR_NIVEL));
break;
case "masjuegos":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SPONSOR);
break;
default:
trace((_arg1.currentTarget.name + " no definido menu misin fallida"));
};
}
private function manejarSeleccionBomba(_arg1:MouseEvent):void{
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.currentTarget.name){
case "bomba_01":
seleccionarBomba(1);
break;
case "bomba_02":
seleccionarBomba(2);
break;
case "bomba_03":
seleccionarBomba(3);
break;
case "bomba_04":
seleccionarBomba(4);
break;
case "bomba_05":
seleccionarBomba(5);
break;
case "bomba_06":
seleccionarBomba(6);
break;
case "bomba_07":
seleccionarBomba(7);
break;
case "bomba_08":
seleccionarBomba(8);
break;
default:
trace(("error click seleccion bomba " + _arg1.currentTarget.name));
};
}
public function eliminarActor(_arg1:Actor):void{
if (_actoresABorrar.indexOf(_arg1) < 0){
_actoresABorrar.push(_arg1);
};
}
public function cargarNivel():void{
if (VariablesGlobales.nivelActual == null){
trace("error motor cargar el nivel");
} else {
_nivel = VariablesGlobales.nivelActual;
if (parsearCadenaNivel(_nivel)){
inicializaMundo();
configuraCamara();
crearObjetosNivel();
configuraMenus();
inicializaDatosPartida();
crearFondo();
_nivelCargado = true;
VariablesGlobales.aliens_caidos_1_tiro = 0;
VariablesGlobales.bombas_usadas = [false, false, false, false, false];
VariablesGlobales.cajas_hielo_destruidas = 0;
VariablesGlobales.satelite_movido = 0;
VariablesGlobales.tiempo_incio_nivel = getTimer();
VariablesGlobales.numero_cambio_bomba = 0;
VariablesGlobales.numero_bombas_fuera_nivel = 0;
if ((((VariablesGlobales.SoundMan.Activo == false)) && ((VariablesGlobales.MusicMan.Activo == false)))){
_sin_sonido = true;
};
};
};
}
private function crearFondo():void{
var _local1:MovieClip;
var _local2:ParallaxBox;
var _local3:uint;
var _local4:String;
var _local5:int;
if (_fondo != null){
_fondo.pause();
_fondo.parent.removeChild(_fondo);
_fondo = null;
};
_local1 = new catalogoFondos();
_temaNivel = 1;
_local3 = 0;
while (_local3 < _local1.numChildren) {
_local4 = String(_local1.getChildAt(_local3));
_local5 = int(_local4.slice((_local4.length - 3), (_local4.length - 1)));
if (_temaNivel == _local5){
_local2 = (_local1.getChildAt(_local3) as ParallaxBox);
};
_local3++;
};
if (_local2 != null){
_fondo = _local2;
_padre.addChildAt(_fondo, 0);
_fondo.addItem("level1", 0, 0, false);
_fondo.addItem("level2", 0, 0, false);
_fondo.addItem("level3", 0, 0, false);
_fondo.xrate = 6;
_fondo.yrate = 8;
_fondo.mode = ParallaxBox.BOTH;
_fondo.blurred = false;
_fondo.start();
};
}
public function get lienzoEfectos():Sprite{
return (_lienzoEfectos);
}
private function lanzarBombardero(_arg1:int):void{
var _local2:Point;
var _local3:Number;
_coordenadaObjetivoActual = _coordenadaObjetivo.clone();
_direccionObjetivoActual = _direccionObjetivo.clone();
trace(((("objetivo fijado :" + _coordenadaObjetivoActual.x) + ",") + _coordenadaObjetivoActual.y));
_local2 = Coordenadas.localToLocal(_menuEnJuego.satelite, _lienzo, _coordenadaObjetivoActual).clone();
trace(((("posicion objetivo global " + _local2.x) + ",") + _local2.y));
if (_anguloObjetivoActual < 0){
_arg1 = 1;
} else {
_arg1 = -1;
};
_local3 = 0;
if (_arg1 == 1){
_local3 = (-(VariablesGlobales.LADO_TILE) * 10);
} else {
_local3 = ((_mapaAncho * VariablesGlobales.LADO_TILE) + (VariablesGlobales.LADO_TILE * 10));
};
_coordenadaSalidaBombardero = new Point(_local3, _coordenadaObjetivoActual.y);
_bombarderoActual = new BombarderoActor(_lienzo, _coordenadaSalidaBombardero, _arg1);
_actores.push(_bombarderoActual);
_objetivoFijado = true;
}
private function eliminarActoresAhora():void{
var _local1:Actor;
var _local2:int;
for each (_local1 in _actoresABorrar) {
_local1.destruir();
_local2 = _actores.indexOf(_local1);
if (_local2 > -1){
_actores.splice(_local2, 1);
};
};
_actoresABorrar = [];
}
private function descargarInterfaz(){
descargarListaBombas();
_interfaz.removeChild(_menuBombas);
_menuEnJuego.reiniciar.removeEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.salir.removeEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_dialogosEnJuego.cerrar_dialogo.removeEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.masjuegos.removeEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_menuEnJuego.solucion.removeEventListener(MouseEvent.CLICK, manejarClickMenuEnJuego);
_interfaz.removeChild(_menuEnJuego);
_menuMisionFallida.reiniciar.removeEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.salir.removeEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.reintentar_fallida.removeEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.editar_fallida.removeEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_menuMisionFallida.masjuegos.removeEventListener(MouseEvent.CLICK, manejarClickMisionFallida);
_interfaz.removeChild(_menuMisionFallida);
_menuMisionCumplida.siguiente.removeEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.salir.removeEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.reintentar_cumplida.removeEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.editar_cumplida.removeEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_menuMisionCumplida.masjuegos.removeEventListener(MouseEvent.CLICK, manejarClickMisionCumplida);
_interfaz.removeChild(_menuMisionCumplida);
}
public function set objetivoCamara(_arg1:Actor):void{
_objetivoCamara = _arg1;
}
private function crearObjetosNivel():void{
var _local1:int;
var _local2:int;
_actores = [];
_actoresABorrar = [];
_aliensPorMatar = 0;
_local1 = 0;
while (_local1 < _tiles.length) {
_local2 = 0;
while (_local2 < _tiles[_local1].length) {
if (_tiles[_local1][_local2] > 0){
_actores.push(fabrica.crearActor(_lienzo, _tiles[_local1][_local2], (_local1 * VariablesGlobales.LADO_TILE), (_local2 * VariablesGlobales.LADO_TILE)));
if ((((_tiles[_local1][_local2] == LogicaTiles.ALIEN)) || ((_tiles[_local1][_local2] == LogicaTiles.ALIEN_BLINDADO)))){
_aliensPorMatar = (_aliensPorMatar + 1);
};
};
_local2++;
};
_local1++;
};
traerAlFrenteTiles();
VariablesGlobales.camara.zoom(1.53, 0.3);
_mostrandoTodoElMapa = true;
}
}
}//package
Section 232
//MotorEvent (MotorEvent)
package {
import flash.events.*;
public class MotorEvent extends Event {
public static const SIGUIENTE_NIVEL:String = "Siguiente";
public static const SALIR_NIVEL:String = "Salir";
public static const REINICIAR_NIVEL:String = "Reiniciar";
public function MotorEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("MotorEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new MotorEvent(type, bubbles, cancelable));
}
}
}//package
Section 233
//musica1 (musica1)
package {
import flash.media.*;
public dynamic class musica1 extends Sound {
}
}//package
Section 234
//musica2 (musica2)
package {
import flash.media.*;
public dynamic class musica2 extends Sound {
}
}//package
Section 235
//Niveles (Niveles)
package {
public class Niveles {
public var datos:Array;
public function Niveles(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:String;
var _local10:String;
var _local11:String;
var _local12:String;
var _local13:String;
var _local14:String;
var _local15:String;
var _local16:String;
var _local17:String;
var _local18:String;
var _local19:String;
var _local20:String;
var _local21:String;
var _local22:String;
var _local23:String;
var _local24:String;
var _local25:String;
var _local26:String;
var _local27:String;
var _local28:String;
var _local29:String;
var _local30:String;
super();
_local1 = "40,15,1,2,1,0,0,0,0,0,0,0;,250,670,670,670,670,670,252,,,,,,,|,278,277,277,277,277,277,279,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,253,254,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,2,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,278,279,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,253,251,251,251,251,251,254,,,,,,,|,250,670,670,670,670,670,252,,,,,,,|||||||||||";
_local2 = "40,15,1,2,1,1,0,0,0,0,0,0;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,520|,,,,,,,,,,,,,,400|,,,,,,,,,,253,251,251,251,670|,,,,,,,,,,460,670,670,670,670|,,,,,,,,,,560,688,670,670,670|,,,,,,,,,,,460,670,670,670|,,,,,,,,,,,560,688,670,670|,,,,,,,,510,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,,250,670,670|,,,,,,,,255,,,2,250,670,670|,,,,,,,,286,350,,,250,670,670|,,,,,,,,250,670,251,251,670,670,670|,,,,,,,,330,688,670,670,670,670,670|,,,,,,,,,330,277,277,277,277,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||||||||||||";
_local3 = "40,15,1,3,1,1,1,1,0,0,1,1;,250,670,350,,,,,,,,,,,|,250,670,670,350,,,,,,,,,,|,330,670,670,670,350,,,,,,,,,|,,330,670,670,670,350,,,,,,,,|,,,330,670,670,670,350,,,,,,,|,352,,,330,670,670,670,350,,,,,,|,250,350,,,330,670,670,670,350,,,,,|,250,670,350,,,250,670,670,670,350,,,,|,250,670,252,,,250,670,670,670,670,350,,,|,250,670,252,,,250,670,670,670,670,252,,,|,250,670,252,,,250,670,670,670,670,252,,,|,250,670,252,,,330,688,670,670,670,252,,,|,460,670,670,350,,,330,688,670,670,252,,,|,560,688,670,670,350,,,330,688,670,252,,,|,,460,670,670,670,350,,,250,670,252,,,|,,560,688,670,670,252,,,250,670,252,,,|,,,460,670,670,252,,,250,670,252,,,|,,,560,688,670,252,,,250,670,252,,,|,,,,460,670,252,,,250,670,252,,,|,,,,560,688,670,580,,460,670,252,,,|,,,,,460,670,490,,560,688,670,350,,|,,,,,560,688,670,580,,460,670,670,350,|,,,,,,460,670,490,,560,688,670,670,350|,,,,,,560,688,252,,,250,670,670,670|,,,,,,,250,252,,,250,670,670,670|,,,,,,,250,252,,,250,670,670,670|,,,,,,,250,252,,,250,670,670,670|,,,,,,,250,252,,,250,670,670,670|,,,,,,,250,252,,,250,670,670,670|,,,,,,,250,252,,,250,670,670,670|,,,,,,,250,670,580,,460,670,670,670|,,,,,,,250,670,490,,560,688,670,670|,,,,,,,250,670,670,580,,460,670,670|,,,,,,,250,670,670,490,,560,688,670|,,,,,,,250,670,670,252,,,250,670|,,,,,,,250,670,670,252,,,250,670|,,,,,,,250,670,670,340,,,250,670|,,,,,,,250,670,252,,,2,250,670|,,,,,,,250,670,670,350,,321,670,670|,,,,,,,250,670,670,670,251,670,670,670||||||||||";
_local4 = "40,15,1,3,0,0,0,0,1,0,0,0;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,253,251,254,,,,,,253,251,251|,,,,250,670,252,,,,,,250,670,670|,,,,250,670,252,,,53,,,250,670,670|,,,,250,670,252,,2,,54,,250,670,670|,,,,250,670,252,,2,,,,250,670,670|,,,,250,670,252,,2,,54,,250,670,670|,,,,250,670,252,,,,,,250,670,670|,,,,250,670,252,,,,,,250,670,670|,,,,250,670,252,,,,,,250,670,670|,,,,278,277,279,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,321,671,670,670|,,,,,,,,,,321,671,670,670,670|,,,,,,,,,321,671,670,670,670,670|,,,,,,,,321,671,670,670,670,670,670|,,,,,,,321,671,670,670,670,670,670,670|,,,,,,321,671,670,670,670,670,670,670,670|,,,,,321,671,670,670,670,670,670,670,670,670|,,,,321,671,670,670,670,670,670,670,670,670,670|,,,321,670,670,670,670,670,670,670,670,670,670,670|,,,278,277,277,277,277,277,277,277,277,277,277,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||||||||";
_local5 = "40,15,1,5,0,0,0,0,0,1,0,0;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,253,251,251,251,251,251,251,251,251|,,,,,,250,277,277,277,277,277,277,277,670|,,,,,,255,,,,,,,,250|,,,,,,255,,,,,,,,250|,,,,,,255,,,,,,,,250|,,,,,,255,,,,,,,,250|,,,,,,255,,,,,,,2,250|,,,,,,255,,,,,,,,250|,,,,,,255,,,,,,,,250|,,,,,,255,,,,,,258,256,250|,,,,,,255,,,,,,,,250|,,,,,,280,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,278|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||||||";
_local6 = "40,15,1,3,1,0,0,1,0,0,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,253|,,,,,,,,,,,,,2,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,64,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,64,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,64,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,64,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,321,251,251,251,251,254,,250|,,,,,,321,691,277,277,277,277,279,,250|,,,,,321,691,340,,,,,,64,250|,,,,321,691,340,,50,53,56,,,,250|,,,,250,252,,50,50,,,,,,250|,,,,250,252,,50,50,,,,,,250|,,,,250,252,,2,50,,56,,,,250|,,,,250,672,580,,,,,,,,250|,,,,250,670,490,,,,,,,,250|,,,,250,670,672,580,,,,,,,278|,,,,250,670,670,490,,,,,,,|,,,,330,670,670,672,350,,,,,,|,,,,,330,670,670,672,350,,,,,|,,,,,,330,670,670,670,445,550,,,|,,,,,,,330,670,670,670,670,445,550,|,,,,,,,,330,277,277,277,277,281,449|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,||||||";
_local7 = "40,15,1,3,0,0,0,1,1,0,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,258,256,256,256,251,251,350,,|,,,,,,,,,,330,688,672,350,|,,,,,,,,,,,330,688,672,350|,,,,,,,,,,,,330,688,670|,,,,,,,,,,,,,330,670|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,260,71,250|,,,,,,,,,,,,255,,250|,,,,,,,,,,,,255,,250|,,,,,,,,,,,321,252,,250|,,,,,,,,,,321,691,340,,250|,,,,,,,,,,250,252,,2,250|,,,,,,,,,,330,673,350,321,670|,,,,,,,,,,,330,670,670,340|,,,,,,,,,258,256,256,277,340,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,||||";
_local8 = "40,15,1,5,1,1,0,1,0,0,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|253,251,251,251,251,251,251,251,251,251,251,251,251,251,251|278,277,277,277,277,277,277,277,277,277,670,670,670,670,670|,,,,,,,,,,530,415,670,670,670|,,,,,,,,,,,,330,670,670|,,,,,,,,,,,,,460,670|,,,,,,,,,,,,,560,670|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,3,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,520,670|,,,,,,,,,,,,,403,670|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,278|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||";
_local9 = "40,15,1,5,1,0,0,1,1,0,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,253,251,251,251,251,251,251,251,251,251,251|,,,,250,670,670,670,670,670,670,670,670,670,670|,,,,278,670,670,670,670,670,670,670,670,670,670|,,,,60,278,277,277,277,277,277,670,670,277,670|,,,,,,,,,,57,372,570,,250|,,,,,,,,,,57,392,550,2,250|,,,,,253,251,251,251,251,251,670,670,251,670|,,,,253,670,670,670,670,670,670,670,670,670,670|,,,,250,670,670,670,670,670,670,670,670,670,670|,,,,278,277,277,277,277,277,277,277,277,277,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,419,262,251,251,251,251,251,251,251|,,,,,,,330,688,670,670,670,670,670,670|,,,,,,,,330,688,670,670,670,670,670|,,,,,,,,,330,688,670,670,670,670|,,,,,,,,,,330,688,670,670,670|,,,,,253,251,251,256,257,,250,670,670,670|,,,,,250,670,252,59,,,250,670,670,670|,,,,,250,670,252,,57,57,250,670,670,670|,,,,,250,670,252,,,2,250,670,670,670|,,,,,250,670,670,254,,,278,277,277,277|,,,,,278,277,277,279,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,||||||||";
_local10 = "40,15,1,3,1,1,1,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,253,251|,,,,,,,,,,,,,250,670|,,,,,,,,,,,,,250,670|,,,253,251,251,256,256,257,,,,,250,670|,,,250,689,340,,,,50,50,50,50,250,670|,,,250,340,,,,,,,,,250,670|,,,255,,,,,,,,,,250,670|,,,255,50,52,,,,,,,,250,670|,,,255,2,,57,57,57,57,259,,,250,670|,,,255,64,,,,,,,,,250,670|,,,255,,,50,52,,,,,,250,670|,,,255,,,2,,57,57,57,259,,250,670|,,,255,,,64,,,,,,,250,670|,,,255,,,,,50,52,,,,250,670|,,,255,,,,,2,,57,57,259,250,670|,,,286,580,,,,64,,,,,250,670|,,,250,490,,,,,,,,,250,670|,,,250,672,580,,,,,,,,250,670|,,,250,670,490,,,,,,,,250,670|,,,278,277,277,256,256,257,,,,,250,670|,,,,,,,,,,,,,250,670|,,,,,,,,,,,,,250,670|,,,,,,,,,,,,,250,670|,,,,,,,,,,,,,250,670|,,,,,,,,,,,,,250,670|,,,,,,,,,,,,,278,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||||||||||||||||||";
_local11 = "40,15,1,3,1,1,1,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,253,251,251|,,,,,,,,,,59,57,250,670,670|,,,,,,,,,,,2,250,670,670|,,,,,,,,,,,57,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,260,,,,,250,670,670|,,,,,,,255,,,,,250,670,670|,,,,,,2,255,,,52,50,250,670,670|,,,,,,,255,,,,2,250,670,670|,,,,,323,71,255,,,,50,250,670,670|,,,,520,252,,255,,,,64,250,670,670|,,,,400,252,64,255,,,,,250,670,670|,,,520,671,252,,255,,,,,250,670,670|,,,560,688,252,64,250,350,,,,250,670,670|,,,,460,252,,250,277,353,,64,250,670,670|,,,,560,252,67,280,67,259,64,2,250,670,670|,,,,,332,,,,,,64,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,260,,260,,,250,670,670|,,,,,,,250,251,252,,,250,670,670|,,,,,,,278,277,279,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,250,670,670|,,,,,,,,,,,,278,277,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||||||||||||||||||||||";
_local12 = "40,15,1,3,1,1,1,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,253|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,2,64,260,,,,,2,64,250|,,,,,,,255,,,,,,,250|,,,,,3,64,255,,,,,3,64,250|,,,,,,2,255,,,,,,2,250|,,,,,3,64,255,,,,,3,64,250|,,,,,,,255,,,,,,,250|,,,,,2,64,280,,,,,2,64,250|,,,,,,,,,,,,,,250|,,,,,,,,64,259,,64,259,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,64,259,,64,259,,250|,,,,,,,,,,,,,,250|,,,,,2,64,260,,,,,2,64,250|,,,,,,,255,,,,,,,250|,,,,,3,64,255,,,,,3,64,250|,,,,,,2,255,,,,,,2,250|,,,,,3,64,255,,,,,3,64,250|,,,,,,,255,,,,,,,250|,,,,,2,64,280,,,,,2,64,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,278|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,||||||||||";
_local13 = "40,15,1,10,0,0,1,0,1,0,0,0;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|253,251,251,251,251,251,251,251,251,251,254,,253,251,251|250,670,670,340,460,670,670,340,330,670,252,,250,277,670|250,670,340,,560,670,340,,,330,252,52,280,,250|250,252,,323,,255,,,520,,255,,,2,250|250,252,,255,,255,,,402,,255,,260,,250|250,252,,255,,255,,321,252,,462,,250,251,670|250,252,,255,,462,,250,252,,560,,250,670,670|250,252,,250,580,560,,250,672,350,,520,670,670,670|250,252,,250,490,,321,670,670,672,350,400,670,670,670|250,252,,250,670,251,277,277,277,277,277,277,277,277,277|250,430,520,670,689,340,,,,,,,,,|278,540,400,670,340,,,,,,,,,,|,,250,252,,,,,,,,,,,|,,250,252,,,,,,,,,,,|,,250,252,,,,,,,,,,,|,321,670,670,251,251,251,251,251,251,251,251,251,251,251|509,277,277,277,277,277,277,670,670,670,670,475,415,670,670|,,,,,,,330,670,670,340,,,460,670|,,,,,,,,250,252,,,,560,670|,,,,,,,,250,252,,,,,250|,,,,,,,,250,252,50,260,,,250|,,,,,,,,250,252,2,280,,,250|,,,,,,,,250,252,,,,520,670|,,,,,,,,250,252,,,,400,670|,,,,,,,,278,279,,,321,670,670|,,,,,,,,,,590,505,670,670,670|,,,,,,,,590,505,670,670,670,670,475|,,,,,,590,505,670,670,670,670,475,570,|,,,,590,505,670,670,670,670,475,570,,,|,,590,505,670,670,670,670,475,570,,,,,|592,512,277,277,277,277,475,570,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||||||||||||||||||||";
_local14 = "40,15,1,4,1,1,1,1,1,0,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,50,53,,253,251|,,,,253,251,256,256,257,,,,321,670,670|,,,,250,340,,,,,,,330,670,670|,,,,255,,,50,53,,50,,,250,670|,,,,255,,,,,253,251,251,251,670,670|,,,,255,,,,,418,670,670,670,670,670|,,,,255,,,50,,,330,688,670,670,670|,,,,250,350,,,,,,330,688,670,670|,,,,460,670,350,,,,,,460,670,670|,,,,560,688,670,350,,,,2,365,277,277|,,,,,330,688,670,350,,,,,,|,,,,,,530,415,688,251,251,350,,,|,,,,,,,,530,415,688,670,350,,|,,,,,,,,,,330,688,670,350,|,,,,,,,,,,,330,670,670,350|260,,,,,,,,,,,,250,670,670|255,,,,,,,,,,,,250,670,670|255,,,,,,,60,55,,,64,250,670,670|255,,,,,,50,,,,,,250,670,670|255,,,,,50,50,,,,,,250,670,670|255,,,,,,,,55,,,64,250,670,670|255,,,,,,,,,,,,250,670,670|255,,3,259,,,,,,,,,250,670,670|255,,,,,,,,,,,,250,670,670|250,350,,,,,,,,,,,330,670,670|250,670,350,,,,,,,,,,,330,670|250,670,670,350,,,,,,,,,,,330|250,670,670,670,350,,,,,,,,,,|250,277,277,670,670,350,,,,,,,,,|255,,,330,670,670,350,,,,,,,,|255,,,,330,670,670,350,,,,,,,|255,,,,,330,670,670,350,,,,,,||||||||||||||||||||||||||";
_local15 = "40,15,1,10,1,1,1,1,1,1,1,1;,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,250,252,,|,,,,,,,,,,,460,670,350,|,,,,,,,,,,,560,670,670,350|,,,,,,,,,,,321,671,670,670|,,,,50,50,260,,,,520,691,340,250,670|,,,,50,3,255,,,,400,252,,250,670|,,,,50,2,255,,,520,670,430,2,250,670|,,,,50,50,280,,,400,670,540,,250,670|,,,,,,,,,250,252,57,57,250,670|,,,,,,,,,480,570,,,250,670|,,,,,,,,,,,,,250,670|,,,,,,3,258,257,,,,522,277,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,520,251,251|,,,,,,,,,321,254,,400,670,670|,,,,,,,,321,340,255,,250,670,340|,,,,,,,321,340,2,255,,250,252,|,,,,,,321,340,,321,279,,250,252,|,,,,,321,340,,321,340,,,250,252,|,,,,,280,,321,340,,,3,250,252,|,,,,,,321,340,,,,64,250,252,|,,,,,258,340,,,,,,250,252,|,,,,,,,,,,,,250,252,|,,,,,,,,,,,,250,252,|,,,,,,,,,,,321,671,340,|,,,,,,,,,,321,671,340,,|,,,,,,,,,,250,252,,,|,,,,,,53,55,,,250,252,,,|,,,,,,,,,2,250,252,,,|,,,,,,,,,,250,252,,,|,,,,,,,55,,,250,252,,,|,,,,,,,,,,250,252,,,|,,,,,,,,,,250,252,,,|,,,,,,,,,,250,340,,,|||||||||";
_local16 = "40,15,1,3,1,1,1,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,52,,|,,,,,,,,,,,,,259,|,,,,,,,,,,,,,2,259|,,,,,,,,,,,,,,|,,,253,350,,,,,,,,,,|,,,250,672,350,,,,,,,,,|,,,250,670,672,350,,,,,64,259,,|,,,250,670,670,672,254,,,,,,,|,,,250,670,670,670,252,,,,,,,|,,,250,670,670,670,252,,,,,,,|,,,250,670,670,670,252,,,,,,,|,,,250,670,670,670,252,,,64,259,,,|,,,250,670,670,689,279,,,,,,,|,,,250,670,689,340,,,,,55,,,253|,,,250,670,252,,,,,,,,2,278|,,,250,670,252,,,,,,,,,|,,,330,670,252,,,,64,259,,,,|,,,352,330,252,,,,,,,,,|,,,250,350,330,350,,,,,,,,|,,,250,252,,255,,,,,,,,|,,,278,279,59,280,,,,,,,,|,,,,64,,,,,259,,,,,|,,,253,254,,260,,,,,,,,|,,,250,252,321,340,,,,,,,,|,,,250,689,340,,,,,,,,,|,,,250,252,,,,,,,,,,|,,,250,252,,,64,259,,,,,,|,,,250,252,,,,,,,,,,|,,,250,252,,,,,,,,,,|,,,250,252,,,,,,,,,,|,,,250,252,,,,,,,,,,|,,,250,252,,64,259,,,,,,,|,,,250,252,,,,,,,,,,|,,,250,252,,,,,,,,,,|,,,250,430,,,,,,,,,,|,,,250,540,,,,,,,,,,|,,,255,2,64,259,,,,,,,,|,,,250,350,,,,,,,,,,|,,,250,672,350,,,,,,,,,||||||||||||||||||||||";
_local17 = "40,15,1,5,1,0,0,1,1,0,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,253,251,251,251,251,251,251,251,251,251,251,251|,,,278,277,277,277,277,277,670,670,670,670,670,670|,,,,,,,,,530,415,688,670,670,670|,,,,,,,,,,,330,688,670,670|,,,,,,,,,,,,330,688,670|,,,,,,,,,,,,,460,670|,,,,,,,,,,,,,560,688|,,,,,,,,,,,,,,250|,,,,,508,580,,,,,,,,250|,,,,321,670,490,,,,,,,,250|,,,321,671,670,340,,,508,580,,,520,671|,,508,691,475,570,,,321,670,381,,,400,670|,,250,252,,,,508,670,670,540,,321,671,670|,,250,252,,,,250,689,340,,321,671,670,670|,,418,676,445,550,2,372,570,590,505,671,670,670,670|,,,530,415,676,251,256,251,670,670,670,670,670,670|,,,,,530,421,60,670,670,670,670,670,670,670|,,450,550,,,,,415,670,670,670,670,670,670|,,250,672,445,550,,,,530,415,670,670,670,670|,,250,670,670,252,,,550,,,530,415,670,670|,,250,670,670,252,,,255,,,,,330,670|,,250,670,670,252,,,255,,,,,,250|,,250,670,670,252,,,255,,,,,,250|,,250,670,670,252,,,255,,,,,,250|,,250,670,670,252,,2,250,580,,,,,250|,,250,670,670,672,580,,460,490,,,,2,250|,,250,670,670,670,490,,560,676,580,,,,250|,,250,670,670,670,670,580,,460,490,,,,250|,,278,277,277,277,277,492,,560,279,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,321,670|,,,,253,251,251,251,251,251,251,251,251,670,670|,,,253,670,670,670,670,670,670,670,670,670,670,670|,,253,670,670,670,670,670,670,670,670,670,670,670,670||||||||||";
_local18 = "40,15,1,7,1,1,0,1,1,0,1,1;,,,,,,,,,,,,,,|,,,,,,,321,251,251,251,251,251,251,251|,,,,,,321,670,670,277,277,277,277,277,670|,,,,,321,670,475,570,,,71,53,,250|,,,,321,670,340,,,,,,,520,250|,,,321,670,340,,,,,,,,562,250|,,321,670,430,,,,,,,,,,250|,,250,689,540,,,,,,,,,,250|,,250,252,,,,,,,,253,256,256,277|590,505,671,477,,,,,,,,255,,,|250,475,570,590,,,,,,,,255,,,|570,590,505,288,,,,,,,520,288,,,|508,670,670,672,580,,,,,,400,252,,,|250,670,670,670,492,,,,,324,277,277,256,256,251|250,670,670,252,287,581,,,,,,,,,250|278,277,277,279,,385,,,,,,,,2,250|50,50,50,50,59,,,,,258,256,256,256,256,670|253,251,251,343,,383,,,,,,,,,250|250,670,252,71,,380,,,,,,,,,250|250,670,340,,360,381,,,,,,,,,250|278,279,,,400,490,,,,,,,,,250|,,,321,671,672,580,,,,,,,,250|,,,250,670,670,490,,,,,,,,250|,,2,250,670,670,672,350,,,,,,,250|,,,250,670,670,670,672,350,,,,,,250|,,,250,670,670,670,670,672,445,550,,,,250|,,321,670,670,670,277,670,670,670,670,251,251,251,670|,321,670,670,475,370,59,370,370,370,370,370,415,670,670|,250,670,252,,71,,,,,,,2,250,340|,250,670,252,,,,253,256,256,350,,64,255,|,250,670,252,,253,251,252,,,255,,,255,|,250,670,252,,250,277,340,,,255,,,255,|,250,670,252,,255,,,,,255,,50,255,|,250,670,252,,255,,,,,255,,2,255,|,250,670,252,2,255,,,,,255,,,255,|,250,670,430,520,252,,,,321,279,,71,255,|,250,670,540,400,252,,,,255,,,3,255,|,278,340,321,670,252,,,,255,,,,280,|,,520,670,670,340,,,,255,,,,,|,,360,670,340,,,,,255,,,,,|||||||||||||||||||||||||||||||||||||||||||||||||||";
_local19 = "40,15,1,3,1,1,1,1,0,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,253|,,,,,,,,,,,,50,64,250|,,,,,,,,,,,50,50,50,250|,,,,,,,,,,,50,57,71,250|,,,,,,,,,,,,59,50,250|,,,,,,,,,,57,64,,2,250|,,,,,,,,,50,71,59,,71,250|,,,,,,,,,57,57,,,2,250|,,590,550,,,,,,50,71,,59,71,250|,,250,670,447,,,,,,57,64,,2,250|,3,250,670,477,,,,,,,,,50,250|,,530,570,,,,,,,,50,57,71,250|,,,,,,,,,,,50,50,50,250|,,,,,,,,,,,,50,64,250|,,,,,,,,,,,,,,278|,,,,,,,,,321,350,,,,|,,,,,,,,3,250,670,350,,,|,,,,,,,,,250,670,340,,,|,,,,,,,,,330,340,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,2,253|,,,,,,53,,50,50,50,50,71,50,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,2,250|,,,,,,,52,,,,,,,250|,,,,,,71,,50,50,50,50,71,50,250|,,,,,,53,,,,,,,,250|,,494,,,,,,,,,,,2,250|,,286,580,,,,,,,,,,,250|,,250,490,,,,,50,50,50,50,71,50,250|,,460,672,580,,,,,,,,,2,278|,,560,688,490,,,,,,,,,,|,,,460,252,,,,,,,,,,|,,,560,252,,,,,,,,,,|,,,,255,,,,,,,,,,||||||||||||||||||||||||||||||||";
_local20 = "40,15,1,8,0,1,0,1,0,1,1,1;,,,250,670,580,,,,,,,,,|,,,250,670,490,,,,,,,,,|,,,250,670,670,445,550,,,,,,,|,,,250,670,670,670,670,350,,,,2,258,256|,,,250,277,277,277,277,252,,,,,,|,,,483,,,,,420,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,453,,,,,,,,,,,321|,,,461,350,,,,,,,,,321,670|,,,560,676,445,550,,,,,590,505,670,340|,,,,460,670,670,251,251,251,251,670,670,340,321|,,253,580,560,277,277,277,277,277,277,277,340,,250|,,250,490,,,,,,,,,,2,278|,,250,670,580,,,,,,,,,,|,,250,670,381,,,,,,,,,,|,,250,670,540,,,,,,,,,,|,,250,430,,,,,,,,,,2,253|,,278,540,520,251,251,251,251,251,251,251,350,,250|,,,,400,277,277,277,277,277,277,277,672,350,330|,,,520,431,,,,,,,,330,676,350|,,,401,540,,,,,,,,,330,688|,,,434,,,,,,,2,259,,,330|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,494,,,,,2,259,,,,,|,,,286,580,,,,,,,,,,|,,,250,490,,,,,,,,,,|,,,250,672,251,251,251,251,251,251,251,350,,|,,,250,670,670,670,670,670,670,670,670,670,350,|,,,250,670,670,670,670,277,670,670,670,670,670,350|,,,250,689,277,277,279,2,278,277,277,277,277,277|,,,267,340,,,,,,,,,,|,,,280,,,,,64,259,,,,,|,,,,,,,,,,,,,,258|,,,260,,,,,64,259,,,,,|,,,250,350,,,,,,,,,,|,,,250,672,251,251,254,2,253,251,251,251,251,251|,,,250,670,670,670,670,251,670,670,670,670,670,670|,,,250,670,670,670,670,670,670,670,670,670,670,670||||||||||||||||||||";
_local21 = "40,15,1,6,1,1,1,1,0,0,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,321,251,251,251,261,479,571,,,,,|,,321,671,670,670,475,570,,,,,,,|,520,671,670,670,340,,,,,,,,,|,400,670,670,252,,,,,,,,,,|,250,670,670,252,2,253,445,550,,,,,,|,250,670,670,252,50,250,670,672,447,,,,,|,250,670,670,252,53,250,670,670,252,,,,,|,250,670,670,252,,250,670,689,477,,,,,|,250,670,670,430,,278,475,570,,,,,,|,250,670,689,540,,,,,,,,,,|,250,689,340,,,,,,,,,,,|,372,570,,,56,,,,581,,,,,|,,,,,,260,,,493,,,,,|,,,,,,255,,2,286,350,,,,|,,,,,,280,,,460,670,350,,,321|,260,,,,,,,,560,688,670,251,251,670|,255,,,,,,,,,460,670,670,670,670|,255,,,,,,,,,560,688,670,670,670|,250,350,,,,,,,,,460,670,670,670|,250,252,,,,,,,,,360,670,670,670|,250,252,,,,,,,,,360,670,670,670|,250,340,,,,,,,,,360,670,670,670|,250,256,256,256,257,,,,,,360,670,670,670|,250,350,,,,,,,,,360,670,670,670|,250,252,,,,,,,,,360,670,670,670|,250,252,,,,,,,,,360,670,670,670|,250,340,,59,52,57,66,69,,,360,670,670,670|,255,,2,,,,,,,2,360,670,670,670|,250,350,,,,57,,64,64,64,360,670,670,670|,250,252,,,,,,,,,360,670,670,670|,250,252,,,,,,,,,360,670,670,670|,250,340,,,,,,,,,360,670,670,670|,250,256,256,256,257,,,,,,400,670,670,670|,250,350,,,,,,,,321,671,670,670,670|,250,672,350,,,,,590,505,671,670,670,670,670|,250,670,670,251,251,251,251,670,670,670,670,670,670,670|,250,670,670,670,670,670,670,670,670,670,670,670,670,670|||||||||||||||||||||";
_local22 = "40,15,1,4,1,0,0,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,453,,,,,,,,,|,,,,,286,580,,,,,,,,321|,,,,,250,490,,,,,,,321,671|,,,,2,250,670,350,,,,590,505,670,670|,,,,,250,670,670,447,,508,282,670,670,670|,,,,,278,277,277,279,,280,,278,277,670|,,,,,,,,,,,71,53,,250|,,,253,251,251,251,251,251,251,254,,,321,670|,,,250,670,670,277,277,277,277,277,257,,330,670|,,,250,670,340,,,,,,57,,,250|,,,250,252,,2,253,251,251,251,251,251,256,250|,,,250,670,350,,330,670,670,670,670,340,2,250|,,,250,670,670,350,,330,670,670,430,,,250|,,,250,670,670,252,,,250,670,540,,,250|,,,250,670,670,252,,71,250,252,,,,250|,,,250,670,670,670,251,251,670,252,,,,250|,,,250,670,670,670,277,277,670,252,,,,250|,,,250,670,670,252,,2,250,252,,,,250|,,,250,670,670,252,,,250,252,,,,250|,,,250,670,670,252,,,250,252,,,,250|,,,250,670,670,340,,321,670,252,,,,250|,,,278,277,340,,321,670,670,252,,,,250|,,,2,60,,321,670,670,670,252,,,520,670|,,,,,321,670,670,670,670,340,,,400,670|,,,,,330,277,277,277,340,,,321,670,670|,,,71,,,,,,,,321,670,670,670|,,71,253,251,350,,,,590,505,670,670,670,670|,,,250,670,670,256,256,256,670,670,670,670,670,670|,,,250,670,340,,,,530,415,670,670,670,670|,,,278,340,,,,,,,530,415,670,670|,,,,,,,,,,,,,530,415|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,||||||||||||||||||||||||";
_local23 = "40,15,1,7,1,0,1,1,1,0,1,1;,,,,,,250,670,670,252,,,,,|,,,,,,250,670,670,670,350,,,,|,,,,,,330,688,670,670,670,350,,,|,,,,,,,460,670,670,670,252,,,|,,,,,,,560,688,670,670,252,,,|,253,251,251,251,251,350,,460,670,670,252,,,|,250,670,277,277,277,672,580,560,688,670,252,,,|,250,252,,,,250,490,,250,670,670,350,,|,330,263,,,,250,252,51,250,670,670,252,,|,,330,256,256,256,277,279,,250,670,670,252,,|,,,,,,,,,250,670,670,252,,|,,,253,251,251,251,254,,250,670,670,252,,|,,,250,670,670,670,252,,250,670,670,252,,|,,,330,670,670,670,252,2,250,670,670,252,,|,,,,278,670,670,252,,360,670,670,430,,|,,,,,460,670,252,,360,670,670,540,,|,,,,,560,670,252,,360,670,252,,,|,,,,,,250,252,,250,670,252,,,|,,,,,,250,252,,250,670,252,,,|,,,,,,250,252,,250,670,252,,,|,,,,,520,670,252,2,278,670,670,445,550,|,,,,,400,670,252,,,330,670,670,252,|,,,,,250,670,252,,,,250,670,252,|,,,,,250,670,252,,,,250,670,252,|,,,,,250,670,252,,,,250,670,252,|,,,,,250,670,252,,,321,670,670,252,|,,,,,250,670,670,251,251,670,670,670,670,350|,,,,321,670,670,670,277,277,670,670,670,670,670|,,,,250,670,670,340,,59,372,370,370,370,250|,,,,250,670,252,,,,,,,2,250|,,,,250,670,252,,,,392,391,391,391,250|,,,,250,670,252,,2,253,670,670,670,670,670|,,,,250,670,252,,,250,670,670,670,277,277|,,,253,670,670,430,,,250,670,670,340,,|,,253,670,670,689,540,,,250,670,430,,,|,258,277,277,277,340,,,253,670,670,540,,,|,,,,,,,253,671,670,340,,,,|,,,,,,253,670,670,340,,,,,|,,,,,253,670,670,252,,,,,,|,,,508,251,670,670,670,252,,,,,,||||||||||||||||||||||||||||||||||||||";
_local24 = "40,15,1,5,0,1,1,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,520,254,,,,,,60,,,,,|,,400,430,,58,,,,,,,,253,251|,,250,381,64,,419,256,257,,253,251,251,670,670|,,250,381,,,,385,64,,560,688,670,670,670|,,250,540,,,,,,,,460,670,670,670|,,330,350,,,,,,,,560,688,670,670|,,,330,256,256,256,251,251,350,,,460,670,670|,,,,,60,,330,670,670,350,,560,688,670|,,253,256,256,580,258,256,277,277,279,,,372,250|,,250,350,2,,,,,,,,,,250|,59,365,277,257,,258,256,256,256,257,,258,251,670|64,,,,,,,,,,,64,64,250,670|,,363,251,257,60,258,256,256,256,382,,64,250,670|,,250,340,2,,,,,,,,71,250,670|,,278,256,256,540,258,256,256,256,382,,,250,670|,,,,,,,,,,,,,250,670|,,,,,,,,,,392,,,250,670|,,,,,260,,64,60,,250,580,,250,670|,,,,,255,,,,321,670,490,,250,670|,,,,,255,,,,330,670,252,,250,670|,,,253,580,255,,64,,53,330,252,,250,670|,,,267,540,250,350,,,,321,252,,250,670|,,,280,60,278,277,353,,,330,340,,250,670|,,,57,,,,,,,,,,250,670|,,253,257,,258,256,256,257,,,,321,670,670|,,255,2,,,,,,,590,505,671,670,670|,,255,,,,,,590,505,671,670,670,670,670|,,278,256,256,256,256,256,277,277,277,277,277,277,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||";
_local25 = "40,15,1,2,0,1,1,1,0,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,253,251,251,251,251,251,251,251,251,251,251,251,251,251|,250,670,670,689,277,277,277,277,277,670,670,670,670,670|,250,689,475,570,,,,,,530,415,688,670,670|,267,340,,,,,,,,,,330,688,670|,433,,,,,,,,,,,,460,670|,541,,,,,,,2,259,,,,560,688|,,,,,71,259,,,,,,,,250|,,,,,,,,,71,259,,,,250|,,,,,,64,71,259,,,,,,250|,,,,259,,,,,,,,,,250|,,,,,,259,2,259,,,,,,250|,,,,,,,,,,,,,,250|,,,,259,2,64,71,259,,,,,2,250|,,,,,,,,,,,,,,250|,,,,,,259,2,259,,,,,,250|,,,,259,,,,,,,,,,250|,,,,,,64,71,259,,,,,,250|,,,,,,,,,71,259,,,,250|,,,,,71,259,,,,,,,,250|,581,,,,,,,2,259,,,,520,671|,493,,,,,,,,,,,,400,670|,286,350,,,,,,,,,,321,671,670|,250,672,445,550,,,,,,590,505,671,670,670|,250,670,670,672,251,251,251,251,251,670,670,670,670,670|,278,277,277,277,277,277,277,277,277,277,277,277,277,277|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|||||||||||||||||||||||||||||||||";
_local26 = "40,15,1,7,0,1,1,1,1,1,1,1;,,,,,,,,,330,688,670,670,670,670|,,,,,,,,,,330,688,670,670,670|,,,,,,,,,,,330,688,670,670|,,,,,,,,,,,,330,688,670|,,,,,,,,,,,,,330,670|,,,352,352,,,53,,,,,260,,250|,,,250,252,,,,56,,,,255,,250|,,,250,252,,2,,,,,,255,,250|,,,250,252,,,,56,,,,255,,250|,,,250,252,,,53,,,,2,255,,250|,,,250,252,,,,56,,,,255,,250|,,,342,342,,,,,,,,255,,250|,,,,,,53,,56,,,,255,,250|,,,,,,,,54,,51,2,372,,250|,,,,,,,,,,,258,254,50,250|,,,,,,,53,,,,,255,50,250|,,,352,352,,,,56,,,,255,2,250|,,,250,252,,2,,,,,,255,,250|,,,250,252,,,,56,,,,255,,250|,,,250,252,,,,,,,,255,,250|,,,250,252,,,,,,,,255,,250|,,,342,342,,,67,56,,,,255,,250|,,,,,,,,,,,,255,,250|,,,352,352,,,,56,,,,280,,250|,,,250,252,,,,,,,,,,250|,,321,670,252,,67,,,,,,,321,670|,,250,670,252,,,253,251,251,350,,321,670,670|,,250,475,570,,,278,277,277,672,350,250,670,670|,,255,,67,,,,64,,330,670,670,670,670|,,255,,,260,,2,64,253,251,670,670,670,670|,,255,,,280,,2,64,278,277,670,670,670,670|,,255,,,,67,,64,,321,670,670,670,670|,,250,445,550,,,253,251,251,689,340,250,670,670|,,250,670,252,,,278,277,277,340,,330,670,670|,,250,475,570,,,,,,,,,330,670|,,570,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|,,,,,,,,,,,,,,250|||||||||||||||||||||||";
_local27 = "40,15,1,5,1,0,1,1,1,1,1,1;,,,,,,,,,,,,,,|258,256,256,251,254,,,,,,,,,,|,,,250,252,,,,,,53,,,,|,,,250,252,,,,,3,,259,,,|260,,,250,252,,,,,,,,,,321|255,,,250,670,350,,,,,,,,,250|255,,,250,670,670,350,,,,,,,64,250|255,,,250,670,670,670,580,,,,,,,250|255,,,250,670,670,670,490,,,,,,,250|255,,60,278,277,670,670,670,445,550,,,,71,250|280,,,,,330,670,670,670,670,445,550,,,250|,,,,,,330,670,670,670,670,252,,,250|,,,253,350,,,250,670,670,670,340,,520,670|,,,250,252,,,250,670,670,252,,,400,670|,,,250,252,,,278,277,670,252,,,250,670|,,,250,252,,,,67,480,570,,,250,670|260,,,250,252,,,,,,,,321,670,670|255,,3,250,252,,,,,324,256,251,670,670,670|280,,,250,252,,,,,,,278,277,670,670|,,,250,252,,,286,445,,50,50,50,250,670|,,,250,252,,,250,252,59,380,,2,250,670|260,,,250,670,251,251,670,340,,,,,250,670|255,,,250,670,670,670,340,50,,321,251,,250,670|255,,,250,670,670,340,50,321,251,670,340,,250,670|255,,,250,670,340,50,321,670,670,340,,,250,670|280,,,250,252,50,321,670,670,340,,,,250,670|,,,250,252,321,670,670,340,,,,,250,670|,,,250,252,670,670,340,,,,,321,670,277|258,256,251,670,670,670,340,,,,,321,670,340,|,,330,670,689,340,,,,,321,670,340,,|,,,330,340,,,,,321,670,340,,,|,,,,,,,,321,670,340,,,3,253|,,,,,,,253,670,340,,,,52,278|,,,,,,,250,670,350,,,,,|,,,,253,251,251,670,670,670,251,251,254,,251|,,,,250,340,278,277,277,475,370,370,370,64,250|,,,,342,,,,,,3,64,64,64,250|,,,,,,258,256,256,256,391,391,391,64,250|,,,,,,,,,,,,,321,670|,,,,,,253,251,251,251,251,251,251,670,670|||||||||||||||||||||||||||||||||||||||||||||";
_local28 = "40,15,1,6,0,0,1,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,590,505,256,445,550,,,,,,,|532,422,262,670,340,,330,670,251,445,550,,,,|,,330,263,,,2,330,670,670,672,350,,,|,,,332,360,350,2,321,277,277,670,670,350,,|,,,,360,670,251,252,50,60,530,415,670,350,|,,,,560,688,670,252,50,,,,330,676,580|,,,,,460,670,252,,,,,,460,490|,,,,,560,688,252,50,,60,,,560,670|,,,,,,330,252,,,,,,,250|,,,,,,,330,251,254,,260,,,250|,,,,,,,,330,279,,255,,,250|,,,,,,,,,,,255,,3,278|,,,,,,,,321,251,251,252,,,|,,,,,,253,256,277,277,277,340,,,|,,494,,,60,255,50,60,,,,,,|,,250,445,550,,255,,,259,,,,,|,,250,277,277,381,280,,,,,,,,|,,255,50,59,,,,,,,,52,3,259|,,255,50,,,,,,,,3,,,|,,255,50,,60,,,60,,,,,3,259|,,250,251,251,381,260,,,,,,,,|,,250,475,570,,255,,,259,,,,,|,,434,,,,255,50,,,,,,,|,,,,590,505,670,251,251,251,251,350,,,|,,,321,671,670,670,670,670,670,670,340,,,|,,520,671,670,670,277,277,670,670,252,,,,|,,400,670,475,570,,,530,415,279,,,,|,,278,340,,,,,,,,,,64,253|,,,,,,,,,,260,,,,250|,,253,580,,,,,,,255,,,2,250|,,460,490,,,,,,2,250,350,,,250|,,560,676,580,,,,,,530,415,350,,250|,,,330,490,,,,,,,,330,350,250|,,,,331,445,550,,,,,,,330,688|,,,,,530,415,449,551,,,,,,460|,,,,,,,,,,,,,,560|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,||||||||||||||||||||||||||||||";
_local29 = "40,15,1,4,0,0,0,0,1,1,0,0;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,,,,590|,,,,,,,,,,,,590,505,671|,,,,,,,,,,590,505,476,250,670|,,,,,,,,590,505,476,570,2,250,670|,,,,,,590,505,476,570,,,321,277,670|,,,,,58,480,570,,,,321,341,2,250|,,,,,,,,,,321,341,,520,670|,,,,,58,,,,321,341,,,400,670|253,254,,50,50,,258,256,261,340,,,520,431,250|330,252,,,,60,,321,340,,,,401,540,250|,255,,,,,321,341,,,,520,430,,250|,255,,,50,,342,,,,,400,540,,250|,255,,,,,,,,,520,431,,,250|,255,,,,60,,,,,401,540,,,250|,255,,50,50,,258,256,256,256,430,,,,250|,255,,,,,,,,400,540,,,,278|,255,,,,,,,520,431,,,,,|,255,,,,60,,,401,540,,,,,|321,252,,50,50,,258,256,430,,,,,,|278,279,,,,,,400,540,,,,,,|,,,,,,520,431,,,,,,,|,,,,,59,401,540,,,,,,,|,,,50,50,,342,,,,,,,,|,,,,,,,,,,,,,,321|,,,,,,,,,,,,,321,671|,,,,,,,,,,,,321,671,670|,,,,,,,,,,,321,671,670,670|,,,,,,,,,,321,671,670,689,475|,,,,,,,,,321,671,689,475,570,|,,,,,,,,321,671,689,340,,,|,,,,,,,,250,689,340,,,,|,,,,,,,,250,430,,,2,259,|,,,,,,,,250,540,,,,,|,,,,,,,,434,,,,,,|,,,,,,,,,,,,,,590|,,,,,,,,,,,,590,505,671|,,,,,,,,,,590,505,671,670,670|,,,,,,,,590,505,671,670,670,670,670||||||||||||||||||||||||||||||||";
_local30 = "40,15,1,9,0,1,0,1,1,1,1,1;,,,,,,,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,,,253,350,,|,,,,,,,,,,,250,252,2,253|,,,,,,510,,,419,251,670,670,251,670|,,,,,321,255,,,2,250,689,277,277,670|,,,590,505,341,250,350,,,250,340,,,250|,590,505,476,570,2,250,672,350,,420,,,3,250|321,476,570,,,407,277,277,277,451,,,,,250|255,,,,,,,,,,,,,,250|286,350,,333,262,261,343,,,,,,,,278|530,416,350,,330,340,,,,581,,,581,,|,,530,,,,,,3,495,,2,495,,|,,,,,,323,,,,,,,,|,,,,,324,279,,,,,,,,|,,,,,,,,,,,,,,|,,,,,,,,,590,506,481,,,253|,,,,,,,,508,475,570,64,64,64,250|352,,,,,,,,570,3,321,481,,,250|250,350,,,,,,,590,505,340,,,,278|330,670,350,,,,,,480,570,,,,,|59,330,672,580,,,,,,,,,,,|,,250,490,,,,,,,,,,,321|59,3,250,252,,,,,,,,,,321,341|,,250,252,,,,,,,,,64,255,|,321,670,340,,,,,,,321,254,,255,|321,670,340,,,,,,,321,671,252,71,255,|250,340,,,,,,,,250,689,340,,255,|342,,,,,,,,,250,340,,,255,|,,,,,,260,,,255,,,,255,|,,,,,253,340,,3,255,,,,433,|,,,,,255,,,,255,,,2,541,|,,,,253,340,,,,255,,,,,|,,,,255,,,,,255,,,,,|,,,253,340,,,,71,255,,,,,|,,,255,,50,50,53,50,255,,,,,|,,253,340,,50,50,,50,433,,,,,|,,255,,,,,,2,541,,,,,|,,255,,,,,,,,,,,,|,,255,,,,,,,,,,,,||||||||||||||||||||||||||||||||||||||||||";
datos = ["", _local1, _local2, _local3, _local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14, _local15, _local16, _local17, _local18, _local19, _local20, _local21, _local22, _local23, _local24, _local25, _local26, _local27, _local28, _local29, _local30];
}
}
}//package
Section 236
//NumericStepperDownArrow_disabledSkin (NumericStepperDownArrow_disabledSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_disabledSkin extends MovieClip {
}
}//package
Section 237
//NumericStepperDownArrow_downSkin (NumericStepperDownArrow_downSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_downSkin extends MovieClip {
}
}//package
Section 238
//NumericStepperDownArrow_overSkin (NumericStepperDownArrow_overSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_overSkin extends MovieClip {
}
}//package
Section 239
//NumericStepperDownArrow_upSkin (NumericStepperDownArrow_upSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_upSkin extends MovieClip {
}
}//package
Section 240
//NumericStepperUpArrow_disabledSkin (NumericStepperUpArrow_disabledSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_disabledSkin extends MovieClip {
}
}//package
Section 241
//NumericStepperUpArrow_downSkin (NumericStepperUpArrow_downSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_downSkin extends MovieClip {
}
}//package
Section 242
//NumericStepperUpArrow_overSkin (NumericStepperUpArrow_overSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_overSkin extends MovieClip {
}
}//package
Section 243
//NumericStepperUpArrow_upSkin (NumericStepperUpArrow_upSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_upSkin extends MovieClip {
}
}//package
Section 244
//panelAyuda (panelAyuda)
package {
import flash.display.*;
public dynamic class panelAyuda extends MovieClip {
public var cerrar_ayuda:SimpleButton;
}
}//package
Section 245
//panelBorrarTodo (panelBorrarTodo)
package {
import flash.display.*;
public dynamic class panelBorrarTodo extends MovieClip {
public var boton_si_borrar:SimpleButton;
public var boton_no_borrar:SimpleButton;
}
}//package
Section 246
//panelErrorEditor (panelErrorEditor)
package {
import flash.display.*;
public dynamic class panelErrorEditor extends MovieClip {
public var boton_ok_error:SimpleButton;
}
}//package
Section 247
//panelSubirNivel (panelSubirNivel)
package {
import flash.display.*;
import flash.text.*;
public dynamic class panelSubirNivel extends MovieClip {
public var nombre_nivel:TextField;
public var boton_cancelar_nivel:SimpleButton;
public var subido:TextField;
public var nombre_autor:TextField;
public var comentarios:TextField;
public var boton_subir_nivel:SimpleButton;
public var cadena_nivel:TextField;
}
}//package
Section 248
//PantallaEditor (PantallaEditor)
package {
import flash.display.*;
import flash.events.*;
public class PantallaEditor extends MovieClip {
private var pantallaLoading:loadingscreen;
public var main_class:MovieClip;
public function PantallaEditor(){
addEventListener(Event.ADDED_TO_STAGE, manejarAgregadoEscena);
}
private function descargarPantalla(){
removeEventListener(Event.ENTER_FRAME, nuevoFrame);
main_class.cierra_pantalla(this);
}
private function manejarCargarEditor(_arg1:EditorEvent):void{
VariablesGlobales.editor.removeEventListener(EditorEvent.CARGAR_EDITOR, manejarCargarEditor);
VariablesGlobales.editor.addEventListener(EditorEvent.CARGADO_EDITOR, manejarCargadoEditor);
pantallaLoading = new loadingscreen();
addChild(pantallaLoading);
}
private function manejarAgregadoEscena(_arg1:Event):void{
VariablesGlobales.editor = new Editor();
VariablesGlobales.editor.iniciaEditor(this);
VariablesGlobales.editor.addEventListener(EditorEvent.SALIR_EDITOR, manejarSalirEditor);
VariablesGlobales.editor.addEventListener(EditorEvent.PROBAR_EDITOR, manejarProbarEditor);
VariablesGlobales.editor.addEventListener(EditorEvent.CARGAR_EDITOR, manejarCargarEditor);
addEventListener(Event.ENTER_FRAME, nuevoFrame);
}
private function manejarProbarEditor(_arg1:EditorEvent):void{
VariablesGlobales.editor.finalizaEditor();
main_class.abre_pantalla(new PantallaPrueba());
descargarPantalla();
}
private function manejarCargadoEditor(_arg1:EditorEvent):void{
VariablesGlobales.editor.removeEventListener(EditorEvent.CARGADO_EDITOR, manejarCargadoEditor);
removeChild(pantallaLoading);
}
private function manejarSalirEditor(_arg1:EditorEvent):void{
VariablesGlobales.editor.finalizaEditor();
main_class.abre_pantalla(new Principal());
descargarPantalla();
}
private function nuevoFrame(_arg1:Event):void{
VariablesGlobales.editor.actualiza();
VariablesGlobales.camara.actualizaAhora();
}
}
}//package
Section 249
//PantallaJuego (PantallaJuego)
package {
import flash.display.*;
import flash.events.*;
public class PantallaJuego extends MovieClip {
public var main_class:MovieClip;
public function PantallaJuego(){
addEventListener(Event.ADDED_TO_STAGE, manejarAgregadoEscena);
}
private function descargarPantalla(){
VariablesGlobales.motor.removeEventListener(MotorEvent.SIGUIENTE_NIVEL, manejarSiguienteNivel);
VariablesGlobales.motor.removeEventListener(MotorEvent.REINICIAR_NIVEL, manejarReiniciarNivel);
VariablesGlobales.motor.removeEventListener(MotorEvent.SALIR_NIVEL, manejarSalirNivel);
removeEventListener(Event.ENTER_FRAME, nuevoFrame);
main_class.cierra_pantalla(this);
}
private function manejarAgregadoEscena(_arg1:Event):void{
VariablesGlobales.nivelPruebaActual = "";
VariablesGlobales.motor = new Motor(this);
VariablesGlobales.motor.iniciaMotor();
VariablesGlobales.motor.cargarNivel();
VariablesGlobales.motor.addEventListener(MotorEvent.SIGUIENTE_NIVEL, manejarSiguienteNivel);
VariablesGlobales.motor.addEventListener(MotorEvent.REINICIAR_NIVEL, manejarReiniciarNivel);
VariablesGlobales.motor.addEventListener(MotorEvent.SALIR_NIVEL, manejarSalirNivel);
addEventListener(Event.ENTER_FRAME, nuevoFrame);
}
private function manejarReiniciarNivel(_arg1:MotorEvent):void{
VariablesGlobales.motor.reiniciarNivel();
}
private function manejarSalirNivel(_arg1:MotorEvent):void{
VariablesGlobales.motor.finalizaMotor();
main_class.abre_pantalla(new Principal());
descargarPantalla();
}
private function manejarSiguienteNivel(_arg1:MotorEvent):void{
trace(VariablesGlobales.indiceNivelActual);
trace(VariablesGlobales.indiceNivelMaximo);
if (VariablesGlobales.indiceNivelActual == VariablesGlobales.indiceNivelMaximo){
VariablesGlobales.indiceNivelMaximo = (VariablesGlobales.indiceNivelMaximo + 1);
};
VariablesGlobales.indiceNivelActual = (VariablesGlobales.indiceNivelActual + 1);
if (VariablesGlobales.indiceNivelActual > VariablesGlobales.indiceNivelMaximo){
VariablesGlobales.indiceNivelMaximo = VariablesGlobales.indiceNivelActual;
};
if (VariablesGlobales.indiceNivelActual > 30){
VariablesGlobales.indiceNivelMaximo = 30;
VariablesGlobales.indiceNivelActual = VariablesGlobales.indiceNivelMaximo;
VariablesGlobales.motor.finalizaMotor();
if (VariablesGlobales.logrosMan.LogroDesbloqueado(ManagerLogros.THE_END) == false){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.THE_END, this.parent);
main_class.abre_pantalla(new Final());
} else {
main_class.abre_pantalla(new Misiones());
};
descargarPantalla();
} else {
if (VariablesGlobales.indiceNivelActual > VariablesGlobales.indiceNivelMaximo){
VariablesGlobales.indiceNivelActual = VariablesGlobales.indiceNivelMaximo;
VariablesGlobales.motor.finalizaMotor();
main_class.abre_pantalla(new Misiones());
descargarPantalla();
} else {
VariablesGlobales.nivelActual = VariablesGlobales.nivelesJuego.datos[VariablesGlobales.indiceNivelActual];
VariablesGlobales.motor.reiniciarNivel();
};
};
}
private function nuevoFrame(_arg1:Event):void{
VariablesGlobales.motor.actualiza();
VariablesGlobales.camara.actualizaAhora();
}
}
}//package
Section 250
//PantallaPrueba (PantallaPrueba)
package {
import flash.display.*;
import flash.events.*;
public class PantallaPrueba extends MovieClip {
public var main_class:MovieClip;
public function PantallaPrueba(){
addEventListener(Event.ADDED_TO_STAGE, manejarAgregadoEscena);
}
private function descargarPantalla(){
VariablesGlobales.motor.removeEventListener(MotorEvent.SIGUIENTE_NIVEL, manejarSiguienteNivel);
VariablesGlobales.motor.removeEventListener(MotorEvent.REINICIAR_NIVEL, manejarReiniciarNivel);
VariablesGlobales.motor.removeEventListener(MotorEvent.SALIR_NIVEL, manejarSalirNivel);
removeEventListener(Event.ENTER_FRAME, nuevoFrame);
main_class.cierra_pantalla(this);
}
private function manejarAgregadoEscena(_arg1:Event):void{
VariablesGlobales.motor = new Motor(this);
VariablesGlobales.motor.iniciaMotor();
VariablesGlobales.nivelActual = VariablesGlobales.nivelPruebaActual;
VariablesGlobales.motor.cargarNivel();
VariablesGlobales.motor.addEventListener(MotorEvent.REINICIAR_NIVEL, manejarReiniciarNivel);
VariablesGlobales.motor.addEventListener(MotorEvent.SALIR_NIVEL, manejarSalirNivel);
addEventListener(Event.ENTER_FRAME, nuevoFrame);
}
private function manejarReiniciarNivel(_arg1:MotorEvent):void{
VariablesGlobales.motor.reiniciarNivel();
}
private function manejarSalirNivel(_arg1:MotorEvent):void{
VariablesGlobales.motor.finalizaMotor();
main_class.abre_pantalla(new PantallaEditor());
descargarPantalla();
}
private function manejarSiguienteNivel(_arg1:MotorEvent):void{
VariablesGlobales.motor.finalizaMotor();
main_class.abre_pantalla(new Misiones());
descargarPantalla();
}
private function nuevoFrame(_arg1:Event):void{
VariablesGlobales.motor.actualiza();
VariablesGlobales.camara.actualizaAhora();
}
}
}//package
Section 251
//parallax_container_01 (parallax_container_01)
package {
public dynamic class parallax_container_01 extends ParallaxBox {
}
}//package
Section 252
//ParallaxBox (ParallaxBox)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
public dynamic class ParallaxBox extends MovieClip {
private var theStarts:Dictionary;
public var level1:MovieClip;
public var level2:MovieClip;
public var level3:MovieClip;
private var theObjects:Array;
private var _xrate:Number;// = 1
private var _blurred:Boolean;// = false
private var theState:Number;
private var _autodetect:Boolean;// = false
private var theMode:Number;
private var _yrate:Number;// = 1
public static const BOTH:Number = 3;
public static const DEBUG:Boolean = false;
public static const HORIZONTAL:Number = 1;
public static const VERTICAL:Number = 2;
public function ParallaxBox(){
_blurred = false;
_xrate = 1;
_yrate = 1;
_autodetect = false;
super();
theObjects = new Array();
theStarts = new Dictionary();
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(_arg1:Event):void{
if (DEBUG){
trace("init ok");
};
theState = 0;
}
public function addItem(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
var _local5:MovieClip;
_local5 = (this.getChildByName(_arg1) as MovieClip);
theObjects.push({movie:_local5, wingx:_arg2, wingy:_arg3, startx:_local5.x, starty:_local5.y, pixelhinting:_arg4});
if (DEBUG){
trace(("object added to render list: " + _local5));
};
}
public function set autowing(_arg1:Boolean):void{
_autodetect = _arg1;
}
public function set mode(_arg1:Number):void{
theMode = _arg1;
if (DEBUG){
trace(("mode selected: " + _arg1));
};
}
public function start():void{
addEventListener(Event.ENTER_FRAME, onFrame);
}
public function set blurred(_arg1:Boolean):void{
_blurred = _arg1;
}
public function set xrate(_arg1:Number):void{
_xrate = _arg1;
}
public function set yrate(_arg1:Number):void{
_yrate = _arg1;
}
private function onFrame(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:MovieClip;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local2 = -(((100 / (stage.stageWidth * 0.5)) * VariablesGlobales.camara.posicionActual().x));
_local3 = -(((100 / (stage.stageHeight * 0.5)) * VariablesGlobales.camara.posicionActual().y));
_local6 = 0;
while (_local6 < theObjects.length) {
_local7 = theObjects[_local6].movie;
_local4 = theObjects[_local6].wingx;
_local5 = theObjects[_local6].wingy;
if (_autodetect == true){
};
if ((((theMode == 1)) || ((theMode == 3)))){
_local8 = (theObjects[_local6].startx + ((_local4 / 100) * _local2));
_local9 = (_local7.x - _local8);
_local10 = (_local9 / _xrate);
_local11 = (Math.abs(_local10) * 1.2);
_local7.x = (_local7.x - (_local9 / _xrate));
if (theObjects[_local6].pixelhinting){
_local7.x = Math.floor(_local7.x);
};
};
if ((((theMode == 2)) || ((theMode == 3)))){
_local12 = (theObjects[_local6].starty + ((_local5 / 100) * _local3));
_local13 = (_local7.y - _local12);
_local14 = (_local13 / _yrate);
_local15 = (Math.abs(_local14) * 1.2);
_local7.y = (_local7.y - (_local13 / _yrate));
if (theObjects[_local6].pixelhinting){
_local7.y = Math.floor(_local7.y);
};
};
if ((((((Math.floor(_local11) >= 1)) || ((Math.floor(_local15) >= 1)))) && ((_blurred == true)))){
_local7.filters = new Array(new BlurFilter(_local11, _local15, 1));
};
_local6++;
};
}
public function pause():void{
removeEventListener(Event.ENTER_FRAME, onFrame);
}
}
}//package
Section 253
//picarcristal1 (picarcristal1)
package {
import flash.media.*;
public dynamic class picarcristal1 extends Sound {
}
}//package
Section 254
//picarcristal2 (picarcristal2)
package {
import flash.media.*;
public dynamic class picarcristal2 extends Sound {
}
}//package
Section 255
//picarcristal3 (picarcristal3)
package {
import flash.media.*;
public dynamic class picarcristal3 extends Sound {
}
}//package
Section 256
//PiedraDinamicaActor (PiedraDinamicaActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class PiedraDinamicaActor extends Actor {
public function PiedraDinamicaActor(_arg1:DisplayObjectContainer, _arg2:DisplayObject, _arg3:Point, _arg4:Array){
var _local5:b2Body;
_local5 = crearCuerpoDesdeCoordenadas(_arg4, _arg3);
_arg1.addChild(_arg2);
super(_local5, _arg2);
}
private function crearCuerpoDesdeCoordenadas(_arg1:Array, _arg2:Point):b2Body{
var _local3:Array;
var _local4:Array;
var _local5:b2BodyDef;
var _local6:b2Body;
var _local7:b2ShapeDef;
var _local8:b2PolygonDef;
var _local9:int;
var _local10:Point;
_local3 = [];
for each (_local4 in _arg1) {
_local8 = new b2PolygonDef();
_local8.vertexCount = _local4.length;
_local9 = 0;
while (_local9 < _local4.length) {
_local10 = _local4[_local9];
b2Vec2(_local8.vertices[_local9]).Set((_local10.x / VariablesGlobales.RATIO), (_local10.y / VariablesGlobales.RATIO));
_local9++;
};
_local8.density = 5;
_local8.friction = 0.2;
_local8.restitution = 0.3;
_local8.userData = this;
_local3.push(_local8);
};
_local5 = new b2BodyDef();
_local5.position.Set((_arg2.x / VariablesGlobales.RATIO), (_arg2.y / VariablesGlobales.RATIO));
_local6 = VariablesGlobales.mundo.CreateBody(_local5);
for each (_local7 in _local3) {
_local6.CreateShape(_local7);
};
_local6.SetMassFromShapes();
return (_local6);
}
override protected function actualizacionEspecificaHijo():void{
super.actualizacionEspecificaHijo();
}
override protected function gestionarFueraDeLimites():void{
VariablesGlobales.motor.eliminarActor(this);
super.gestionarFueraDeLimites();
}
}
}//package
Section 257
//PiezaAlienActor (PiezaAlienActor)
package {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class PiezaAlienActor extends PiedraDinamicaActor {
private const TIEMPO_RETARDO_EXPLOSION:Number = 100;
private var _tiempoExplosion:Number;
private var _armada:Boolean;// = true
public function PiezaAlienActor(_arg1:DisplayObjectContainer, _arg2:DisplayObject, _arg3:Point, _arg4:Array){
_armada = true;
super(_arg1, _arg2, _arg3, _arg4);
}
override public function explotar():void{
if (_armada){
_armada = false;
_tiempoExplosion = getTimer();
};
super.explotar();
}
override protected function actualizacionEspecificaHijo():void{
var _local1:Number;
if (_tiempoExplosion != 0){
_local1 = (getTimer() - _tiempoExplosion);
if (_local1 >= TIEMPO_RETARDO_EXPLOSION){
VariablesGlobales.mundo.explode(cuerpo.GetShapeList(), cuerpo.GetPosition(), ((VariablesGlobales.LADO_TILE * 7) / VariablesGlobales.RATIO), 1000, _disfraz.parent);
VariablesGlobales.motor.eliminarActor(this);
_tiempoExplosion = 0;
};
};
super.actualizacionEspecificaHijo();
}
}
}//package
Section 258
//PiezaDestruibleActor (PiezaDestruibleActor)
package {
import flash.display.*;
import flash.geom.*;
public class PiezaDestruibleActor extends PiedraDinamicaActor {
public function PiezaDestruibleActor(_arg1:DisplayObjectContainer, _arg2:DisplayObject, _arg3:Point, _arg4:Array){
super(_arg1, _arg2, _arg3, _arg4);
}
override public function afectadoPorExplosion():void{
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:ExplosionHielo;
_local1 = ((Math.random() * 3) + 1);
VariablesGlobales.SoundMan.playSound(String(("hielo" + _local1)), 0.3, 0, 0);
VariablesGlobales.motor.eliminarActor(this);
VariablesGlobales.cajas_hielo_destruidas = (VariablesGlobales.cajas_hielo_destruidas + 1);
if (VariablesGlobales.cajas_hielo_destruidas >= 7){
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.ICE_HATER, _disfraz.parent.parent);
};
_local2 = 0;
_local3 = 0;
trace(("tipo actor " + tipoActor));
_local3 = disfraz.rotation;
switch (this.tipoActor){
case 1:
_local2 = 1;
break;
case 2:
_local2 = 2;
break;
case 3:
_local2 = 3;
break;
case 4:
_local2 = 4;
break;
case 5:
_local2 = 2;
_local3 = (_local3 + 90);
break;
case 6:
_local2 = 3;
_local3 = (_local3 + 90);
break;
case 7:
_local2 = 4;
_local3 = (_local3 + 90);
break;
};
trace(((("tipo final " + _local2) + " rot ") + _local3));
_local4 = new ExplosionHielo(_disfraz.parent, _local2, new Point(_disfraz.x, _disfraz.y), _local3);
super.afectadoPorExplosion();
}
}
}//package
Section 259
//PiezaExplosivaActor (PiezaExplosivaActor)
package {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class PiezaExplosivaActor extends PiedraDinamicaActor {
private const TIEMPO_RETARDO_EXPLOSION:Number = 100;
private var _tiempoExplosion:Number;
private var _armada:Boolean;// = true
public function PiezaExplosivaActor(_arg1:DisplayObjectContainer, _arg2:DisplayObject, _arg3:Point, _arg4:Array){
_armada = true;
super(_arg1, _arg2, _arg3, _arg4);
}
override public function afectadoPorExplosion():void{
if (_armada){
_armada = false;
_tiempoExplosion = getTimer();
};
super.afectadoPorExplosion();
}
override protected function actualizacionEspecificaHijo():void{
var _local1:Number;
if (_tiempoExplosion != 0){
_local1 = (getTimer() - _tiempoExplosion);
if (_local1 >= TIEMPO_RETARDO_EXPLOSION){
VariablesGlobales.mundo.explode(cuerpo.GetShapeList(), cuerpo.GetPosition(), ((VariablesGlobales.LADO_TILE * 7) / VariablesGlobales.RATIO), 1000, _disfraz.parent);
VariablesGlobales.motor.eliminarActor(this);
_tiempoExplosion = 0;
};
};
super.actualizacionEspecificaHijo();
}
}
}//package
Section 260
//PiezaIndestruibleActor (PiezaIndestruibleActor)
package {
import flash.display.*;
import flash.geom.*;
public class PiezaIndestruibleActor extends PiedraDinamicaActor {
public function PiezaIndestruibleActor(_arg1:DisplayObjectContainer, _arg2:DisplayObject, _arg3:Point, _arg4:Array){
super(_arg1, _arg2, _arg3, _arg4);
}
}
}//package
Section 261
//preload (preload)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class preload extends MovieClip {
public function preload(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 262
//preloader_sc (preloader_sc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class preloader_sc extends MovieClip {
public var boton_tanoku:SimpleButton;
public var porc:TextField;
public var adBox:MovieClip;
public var jugar:SimpleButton;
public var boton_sponsor:SimpleButton;
}
}//package
Section 263
//Principal (Principal)
package {
import flash.display.*;
import flash.events.*;
public class Principal extends MovieClip {
public var onlyAt:MovieClip;
public var musica:MovieClip;
public var logros:SimpleButton;
public var sponsor:SimpleButton;
public var tanoku:SimpleButton;
public var editor:SimpleButton;
public var puntuaciones:SimpleButton;
public var main_class:MovieClip;
public var creditos:SimpleButton;
public var resetear:MovieClip;
public var jugar:SimpleButton;
public var sonido:MovieClip;
public var masjuegos:SimpleButton;
public function Principal(){
sonido.addEventListener(MouseEvent.CLICK, on_button_clicked);
musica.addEventListener(MouseEvent.CLICK, on_button_clicked);
jugar.addEventListener(MouseEvent.CLICK, on_button_clicked);
editor.addEventListener(MouseEvent.CLICK, on_button_clicked);
editor.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
editor.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
onlyAt.visible = false;
logros.addEventListener(MouseEvent.CLICK, on_button_clicked);
puntuaciones.addEventListener(MouseEvent.CLICK, on_button_clicked);
creditos.addEventListener(MouseEvent.CLICK, on_button_clicked);
masjuegos.addEventListener(MouseEvent.CLICK, on_button_clicked);
sponsor.addEventListener(MouseEvent.CLICK, on_button_clicked);
tanoku.addEventListener(MouseEvent.CLICK, on_button_clicked);
resetear.addEventListener(MouseEvent.CLICK, on_button_clicked);
EstadoIconosAudio();
VariablesGlobales.MusicMan.stopAllSounds(false);
VariablesGlobales.MusicMan.playSound("musica2", 0.5, 0, 99);
}
public function on_button_out(_arg1:MouseEvent){
onlyAt.visible = false;
}
private function EstadoIconosAudio():void{
if (VariablesGlobales.SoundMan.Activo){
sonido.gotoAndStop(1);
} else {
sonido.gotoAndStop(2);
};
if (VariablesGlobales.MusicMan.Activo){
musica.gotoAndStop(1);
} else {
musica.gotoAndStop(2);
};
VariablesGlobales.savegameMan.salvarPartida();
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
case "editor":
onlyAt.visible = !(VariablesGlobales.editorDisponible);
break;
};
}
public function on_button_clicked(_arg1:MouseEvent){
VariablesGlobales.SoundMan.playSound("click", 1, 0, 0);
switch (_arg1.target.name){
case "jugar":
VariablesGlobales.nivelEditor = false;
main_class.abre_pantalla(new Misiones());
main_class.cierra_pantalla(this);
break;
case "editor":
if (VariablesGlobales.editorDisponible){
VariablesGlobales.nivelEditor = true;
VariablesGlobales.nivelPruebaActual = "";
main_class.abre_pantalla(new PantallaEditor());
main_class.cierra_pantalla(this);
} else {
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_JUEGO);
};
break;
case "creditos":
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.WHO_MADE_IT, this.parent);
main_class.abre_pantalla(new Creditos());
break;
case "logros":
main_class.abre_pantalla(new Logros());
break;
case "musica":
VariablesGlobales.MusicMan.Mute();
EstadoIconosAudio();
break;
case "sonido":
VariablesGlobales.SoundMan.Mute();
EstadoIconosAudio();
break;
case "puntuaciones":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SOLUCION);
break;
case "sponsor":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SPONSOR);
VariablesGlobales.logrosMan.DesbloquearLogro(ManagerLogros.LOOKING_FOR_OTHERS, this.parent);
break;
case "tanoku":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_TANOKU);
break;
case "masjuegos":
VariablesGlobales.AbreWeb(VariablesGlobales.WEB_SPONSOR);
break;
case "resetear":
VariablesGlobales.savegameMan.borrarPartida();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package
Section 264
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 265
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 266
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 267
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 268
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 269
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 270
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 271
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 272
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 273
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 274
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 275
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 276
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 277
//silbido1 (silbido1)
package {
import flash.media.*;
public dynamic class silbido1 extends Sound {
}
}//package
Section 278
//smoke (smoke)
package {
import flash.display.*;
public dynamic class smoke extends MovieClip {
}
}//package
Section 279
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 280
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package
Section 281
//TileList_skin (TileList_skin)
package {
import flash.display.*;
public dynamic class TileList_skin extends MovieClip {
}
}//package
Section 282
//VariablesGlobales (VariablesGlobales)
package {
import flash.geom.*;
import com.tanoku.sonido.*;
import flash.net.*;
public class VariablesGlobales {
public static const WEB_NIVELES:String = "http://tanoku.com/eng2/bombardment/contact_bombardment.html";
public static const PASO_TIEMPO:Number = 0.02;
public static const ALTO_PANTALLA:int = 450;
public static const WEB_DOMINIO:String = "notdoppler.com";
public static const MAX_ALTO_TILE:int = 15;
public static const BOMBA_MISIL:int = 0;
public static const WEB_TANOKU:String = "http://tanoku.com";
public static const BOMBA_ALIEN:int = 2;
public static const MAX_ANCHO_TILE:int = 40;
public static const GRAVEDAD:Number = 9.8;
public static const DERECHA:int = 1;
public static const ANCHO_PANTALLA:int = 780;
public static const IZQUIERDA:int = -1;
public static const BOMBA_RETARDADA:int = 1;
public static const LADO_TILE:int = 30;
public static const WEB_SOLUCION:String = "http://www.notdoppler.com/bombardment-walkthrough.php?ref=bombardment";
public static const BOMBA_GOMA:int = 4;
public static const BOMBA_BOLA:int = 3;
public static const WEB_SPONSOR:String = "http://www.notdoppler.com/?ref=bombardment";
public static const RATIO:Number = 30;
public static const WEB_JUEGO:String = "http://www.notdoppler.com/bombardment.php?ref=bombardment";
private static var _tiempo_incio_nivel:Number = 0;
private static var _aliens_caidos_1_tiro:int = 0;
private static var _indiceNivelMaximo:int = 1;
private static var _savegameMan:ManagerPartidas;
private static var _camara:Camara;
private static var _estoyEnSponsor:Boolean = false;
private static var _nivelEditor:Boolean = true;
private static var _nivelPruebaActual:String = null;
private static var _logrosMan:ManagerLogros;
private static var _nivelActual:String = null;
private static var _motor:Motor;
private static var _nivelesJuego:Niveles = new Niveles();
private static var _mostrarAyuda:Boolean = true;
private static var _editorDisponible:Boolean = false;
private static var _numero_bombas_fuera_nivel:int = 0;
private static var _limitesMundo:Rectangle;
private static var _editor:Editor;
private static var _bombas_usadas:Array = [false, false, false, false, false];
private static var _numero_cambio_bomba:int = 0;
private static var _aliens_muertos_1_tiro:int = 0;
private static var _indiceNivelActual:int = 1;
private static var soundMan:SoundManager;
private static var _mundo:ExplodeWorld;
private static var _numero_rebotes_bomba:int = 0;
private static var _cajas_hielo_destruidas:int = 0;
private static var _nivelesCargados:int = 0;
private static var _satelite_movido:int = 0;
private static var musicMan:MusicManager;
public static function get logrosMan():ManagerLogros{
return (_logrosMan);
}
public static function get numero_bombas_fuera_nivel():int{
return (_numero_bombas_fuera_nivel);
}
public static function set motor(_arg1:Motor):void{
_motor = _arg1;
}
public static function get nivelEditor():Boolean{
return (_nivelEditor);
}
public static function set numero_rebotes_bomba(_arg1:int):void{
_numero_rebotes_bomba = _arg1;
}
public static function get camara():Camara{
return (_camara);
}
public static function set nivelesJuego(_arg1:Niveles):void{
_nivelesJuego = _arg1;
}
public static function set nivelEditor(_arg1:Boolean):void{
_nivelEditor = _arg1;
}
public static function get editorDisponible():Boolean{
return (_editorDisponible);
}
public static function get estoyEnSponsor():Boolean{
return (_estoyEnSponsor);
}
public static function set MusicMan(_arg1:MusicManager):void{
musicMan = _arg1;
}
public static function get MusicMan():MusicManager{
return (musicMan);
}
public static function get aliens_caidos_1_tiro():int{
return (_aliens_caidos_1_tiro);
}
public static function get nivelActual():String{
return (_nivelActual);
}
public static function get SoundMan():SoundManager{
return (soundMan);
}
public static function set mostrarAyuda(_arg1:Boolean):void{
_mostrarAyuda = _arg1;
}
public static function get satelite_movido():int{
return (_satelite_movido);
}
public static function get savegameMan():ManagerPartidas{
return (_savegameMan);
}
public static function set camara(_arg1:Camara):void{
_camara = _arg1;
}
public static function set numero_bombas_fuera_nivel(_arg1:int):void{
_numero_bombas_fuera_nivel = _arg1;
}
public static function set indiceNivelMaximo(_arg1:int):void{
_indiceNivelMaximo = _arg1;
}
public static function get nivelesCargados():int{
return (_nivelesCargados);
}
public static function set estoyEnSponsor(_arg1:Boolean):void{
_estoyEnSponsor = _arg1;
}
public static function get indiceNivelActual():int{
return (_indiceNivelActual);
}
public static function set nivelesCargados(_arg1:int):void{
_nivelesCargados = _arg1;
}
public static function set limitesMundo(_arg1:Rectangle):void{
_limitesMundo = _arg1;
}
public static function set savegameMan(_arg1:ManagerPartidas):void{
_savegameMan = _arg1;
}
public static function get numero_cambio_bomba():int{
return (_numero_cambio_bomba);
}
public static function set aliens_muertos_1_tiro(_arg1:int):void{
_aliens_muertos_1_tiro = _arg1;
}
public static function set satelite_movido(_arg1:int):void{
_satelite_movido = _arg1;
}
public static function set aliens_caidos_1_tiro(_arg1:int):void{
_aliens_caidos_1_tiro = _arg1;
}
public static function set nivelActual(_arg1:String):void{
_nivelActual = _arg1;
}
public static function get tiempo_incio_nivel():Number{
return (_tiempo_incio_nivel);
}
public static function get editor():Editor{
return (_editor);
}
public static function get motor():Motor{
return (_motor);
}
public static function get bombas_usadas():Array{
return (_bombas_usadas);
}
public static function get nivelesJuego():Niveles{
return (_nivelesJuego);
}
public static function set editorDisponible(_arg1:Boolean):void{
_editorDisponible = _arg1;
}
public static function get mostrarAyuda():Boolean{
return (_mostrarAyuda);
}
public static function AbreWeb(_arg1:String){
navigateToURL(new URLRequest(_arg1));
}
public static function set cajas_hielo_destruidas(_arg1:int):void{
_cajas_hielo_destruidas = _arg1;
}
public static function get limitesMundo():Rectangle{
return (_limitesMundo);
}
public static function set mundo(_arg1:ExplodeWorld):void{
_mundo = _arg1;
}
public static function get aliens_muertos_1_tiro():int{
return (_aliens_muertos_1_tiro);
}
public static function set indiceNivelActual(_arg1:int):void{
_indiceNivelActual = _arg1;
}
public static function get indiceNivelMaximo():int{
return (_indiceNivelMaximo);
}
public static function set nivelPruebaActual(_arg1:String):void{
_nivelPruebaActual = _arg1;
}
public static function set numero_cambio_bomba(_arg1:int):void{
_numero_cambio_bomba = _arg1;
}
public static function set tiempo_incio_nivel(_arg1:Number):void{
_tiempo_incio_nivel = _arg1;
}
public static function set logrosMan(_arg1:ManagerLogros):void{
_logrosMan = _arg1;
}
public static function get mundo():ExplodeWorld{
return (_mundo);
}
public static function set editor(_arg1:Editor):void{
_editor = _arg1;
}
public static function get cajas_hielo_destruidas():int{
return (_cajas_hielo_destruidas);
}
public static function get nivelPruebaActual():String{
return (_nivelPruebaActual);
}
public static function set SoundMan(_arg1:SoundManager):void{
soundMan = _arg1;
}
public static function set bombas_usadas(_arg1:Array):void{
_bombas_usadas = _arg1;
}
public static function get numero_rebotes_bomba():int{
return (_numero_rebotes_bomba);
}
}
}//package
Section 283
//VCam_AS3_Interactive (VCam_AS3_Interactive)
package {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
import flash.ui.*;
import flash.accessibility.*;
public dynamic class VCam_AS3_Interactive extends MovieClip {
public var sH:Number;
public var rp:Point;
public var sW:Number;
public var bounds_obj:Object;
public var camH:Number;
public var camW:Number;
public var oldScaleMode:String;
public function VCam_AS3_Interactive(){
addFrameScript(0, frame1);
}
public function set scaleX2(_arg1:Number):void{
setProperty2("scaleX", _arg1);
}
function frame1(){
mouseEnabled = false;
visible = false;
oldScaleMode = stage.scaleMode;
stage.scaleMode = "exactFit";
sW = stage.stageWidth;
sH = stage.stageHeight;
stage.scaleMode = oldScaleMode;
bounds_obj = this.getBounds(this);
camH = bounds_obj.height;
camW = bounds_obj.width;
rp = new Point(x, y);
addEventListener(Event.ENTER_FRAME, camControl);
addEventListener(Event.REMOVED_FROM_STAGE, reset);
camControl();
}
public function set x2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x + (_arg1 - _local2.x));
}
public function get rotation2():Number{
return (parent.rotation);
}
public function camControl(... _args):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
rp.x = x;
rp.y = y;
_local2 = (camH * scaleY);
_local3 = (camW * scaleX);
_local4 = (sH / _local2);
_local5 = (sW / _local3);
x2 = ((_local3 / 2) * _local5);
y2 = ((_local2 / 2) * _local4);
scaleX2 = _local5;
scaleY2 = _local4;
rotation2 = -(rotation);
parent.filters = this.filters;
parent.transform.colorTransform = this.transform.colorTransform;
}
public function set scaleY2(_arg1:Number):void{
setProperty2("scaleY", _arg1);
}
public function get scaleX2():Number{
return (parent.scaleX);
}
public function get x2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.x);
}
public function setProperty2(_arg1:String, _arg2:Number):void{
var _local3:Point;
var _local4:Point;
_local3 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent[_arg1] = _arg2;
_local4 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x - (_local4.x - _local3.x));
parent.y = (parent.y - (_local4.y - _local3.y));
}
public function set y2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.y = (parent.y + (_arg1 - _local2.y));
}
public function reset(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, camControl);
removeEventListener(Event.REMOVED_FROM_STAGE, reset);
parent.scaleX = 1;
parent.scaleY = 1;
parent.x = 0;
parent.y = 0;
parent.rotation = 0;
parent.visible = true;
}
public function get scaleY2():Number{
return (parent.scaleY);
}
public function get y2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.y);
}
public function set rotation2(_arg1:Number):void{
setProperty2("rotation", _arg1);
}
}
}//package