STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/59604988?noj=FRM59604988-22DC" width="1" height="1"></div>

pyro-ii.swf

This is the info page for
Flash #118873

(Click the ID number above for more basic data on this flash file.)


Text
ver. II.01.K

www.kongregate.com

<p align="center"><font face="Tiny Box BlackBitA8" size="21" color="#ffffff" letterSpacing="0.000000" kerning="1">Loading...</font></p>

<p align="left"><font face="Tiny Box BlackBitA8" size="10" color="#ffffff" letterSpacing="0.000000" kerning="1">Difficulty:</font></p><p align="left"><font face="Tiny Box BlackBitA8" size="10" color="#ffffff" letterSpacing="0.000000" kerning="1">Best Time:</font></p>

Want to get your name and level on this list? Submit it!

Want to get your name and level on this list? Submit it!

ACED!

<p align="left"><font face="Tiny Box BlackBitA8" size="10" color="#ffffff" letterSpacing="0.000000" kerning="1">Best Time:</font></p><p align="left"><font face="Tiny Box BlackBitA8" size="10" color="#ffffff" letterSpacing="0.000000" kerning="1">Total Aced:</font></p><p align="left"><font face="Tiny Box BlackBitA8" size="10" color="#ffffff" letterSpacing="0.000000" kerning="1">Total Time:</font></p>

Damijin Presents:

Loaded Die Games

Skip Intro

Skip Intro

Skip Intro

Community Edition

<p align="center"><font face="Franklin Gothic Medium" size="14" color="#ffffff" letterSpacing="0.000000" kerning="1">Want this game on your site?</font></p><p align="center"><font face="Franklin Gothic Medium" size="14" color="#ffffff" letterSpacing="0.000000" kerning="1">You can download it <font color="#0066ff"><a href="http://games.mochiads.com/c/g/pyro-ii/Pyro2.swf" target = "_blank">here</a></font>.</font></p>

<p align="left"><font face="Arial Black" size="14" color="#ffffff" letterSpacing="0.000000" kerning="1">TIP #1:</font></p>

<p align="left"><font face="Arial" size="11" color="#ffffff" letterSpacing="0.000000" kerning="1">Click and drag the fireball to set its angle and power. </font></p><p align="left"></p><p align="left"><font face="Arial" size="11" color="#ffffff" letterSpacing="0.000000" kerning="1">Aim for the tops of torches, and release the mouse button to fire.</font></p>

<p align="left"><font face="Arial" size="9" color="#ffffff" letterSpacing="0.000000" kerning="1">Wow... He&apos;s insanely good!</font></p>

YOU
MISSED!

<p align="left"><font face="Tiny Box BlackBitA8" size="12" color="#ffffff" letterSpacing="5.000000" kerning="0">Secret level A! - Secret level A! - Secret level A! - Secret level A! -</font></p>

ACED!

<p align="left"><font face="Arial Rounded MT Bold" size="11" color="#000000" letterSpacing="0.000000" kerning="1">Embed</font></p>

You Win!

Congratulations
on being a Pyromaniac!
You burned your way through 50
of the best levels that our minds
could come up with.
If you're still craving more,
there are 10 bonus levels
that you can unlock
and dozens of levels
created by Pyro fans from around the world
in the Player Levels section
on the Main Menu.
You can even create your own levels
and share them with the world
in the Level Editor.
Thanks For Playing!
-Damijin & Arkatufus-

Programmed and Produced by
Gregorius "Arkatufus" Soedharmo

Designed and Distributed by
Michael "Damijin" Gribbin

Additional Level Designs by
Darran Jamieson

Complete Ace Guide by
Mr. Rubix

Bonus Levels by

BlackBone
Jindo
Jugglinguy
Laxaria
RavingRabbid

Hokage4354
JohnRulz
Kyru
Marh
XEN0N

As always, we praise and worship
our supporters and beta testers!

arcaneCoder
DragonFlame997
hokage4354
Jindo
Kyru
Mastry
MSTaylor
Nadroj09
oceanix
QueentakesRook
Scotti
sillypirate
Sylicas
valkyrie
Winnitta

chitown15
GwenWilliams
ItBeNickYo
Joshhh
lightsun
moomoomoomoo
Nabb
Natha
PopUpPirate
redshirtbear
Sherri
skillyb
TheGhostGamer
Ventero

We would like to give special thanks to Dartle
for his $40 donation to Pyro 1.
People like him, and the rest of the folks on this list
keep these games free.

Donators are always the first to know
about our upcoming beta tests and future projects.

Thank you so much!

Sponsored By

+1

Retry

Retry

Retry

Level
Select

Level
Select

Level
Select

Stop
Preview

Stop
Preview

Stop
Preview

ActionScript [AS3]

Section 1
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; public class b2CircleDef extends b2ShapeDef { public var radius:Number; public var localPosition:b2Vec2; public function b2CircleDef(){ localPosition = new b2Vec2(0, 0); super(); type = b2Shape.e_circleShape; radius = 1; } } }//package Box2D.Collision.Shapes
Section 2
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2CircleShape extends b2Shape { public var m_localPosition:b2Vec2; public var m_radius:Number; public function b2CircleShape(_arg1:b2ShapeDef){ m_localPosition = new b2Vec2(); super(_arg1); var _local2:b2CircleDef = (_arg1 as b2CircleDef); m_type = e_circleShape; m_localPosition.SetV(_local2.localPosition); m_radius = _local2.radius; } override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{ var _local10:Number; var _local6:b2Mat22 = _arg1.R; var _local7:Number = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y))); var _local8:Number = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y))); var _local9:Number = (_arg4.p1.x - _local7); _local10 = (_arg4.p1.y - _local8); var _local11:Number = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius)); if (_local11 < 0){ return (false); }; var _local12:Number = (_arg4.p2.x - _arg4.p1.x); var _local13:Number = (_arg4.p2.y - _arg4.p1.y); var _local14:Number = ((_local9 * _local12) + (_local10 * _local13)); var _local15:Number = ((_local12 * _local12) + (_local13 * _local13)); var _local16:Number = ((_local14 * _local14) - (_local15 * _local11)); if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){ return (false); }; var _local17:Number = -((_local14 + Math.sqrt(_local16))); if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){ _local17 = (_local17 / _local15); _arg2[0] = _local17; _arg3.x = (_local9 + (_local17 * _local12)); _arg3.y = (_local10 + (_local17 * _local13)); _arg3.Normalize(); return (true); }; return (false); } public function GetLocalPosition():b2Vec2{ return (m_localPosition); } public function GetRadius():Number{ return (m_radius); } override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{ var _local4:b2Mat22; _local4 = _arg2.R; var _local5:Number = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y))); var _local6:Number = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y))); _local4 = _arg3.R; var _local7:Number = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y))); var _local8:Number = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y))); _arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius)); _arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius)); } override public function ComputeMass(_arg1:b2MassData):void{ _arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius); _arg1.center.SetV(m_localPosition); _arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y)))); } override public function UpdateSweepRadius(_arg1:b2Vec2):void{ var _local2:Number = (m_localPosition.x - _arg1.x); var _local3:Number = (m_localPosition.y - _arg1.y); _local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3))); m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop); } override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{ var _local3:b2Mat22 = _arg2.R; var _local4:Number = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y))); var _local5:Number = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y))); _arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius)); _arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius)); } override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{ var _local3:b2Mat22 = _arg1.R; var _local4:Number = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y))); var _local5:Number = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y))); _local4 = (_arg2.x - _local4); _local5 = (_arg2.y - _local5); return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius))); } } }//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData) package Box2D.Collision.Shapes { public class b2FilterData { public var maskBits:uint;// = 0xFFFF public var groupIndex:int;// = 0 public var categoryBits:uint;// = 1 public function Copy():b2FilterData{ var _local1:b2FilterData = new b2FilterData(); _local1.categoryBits = categoryBits; _local1.maskBits = maskBits; _local1.groupIndex = groupIndex; return (_local1); } } }//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; public class b2MassData { public var mass:Number;// = 0 public var center:b2Vec2; public var I:Number;// = 0 public function b2MassData(){ center = new b2Vec2(0, 0); super(); } } }//package Box2D.Collision.Shapes
Section 5
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2PolygonDef extends b2ShapeDef { public var vertices:Array; public var vertexCount:int; private static var s_mat:b2Mat22 = new b2Mat22(); public function b2PolygonDef(){ vertices = new Array(b2Settings.b2_maxPolygonVertices); super(); type = b2Shape.e_polygonShape; vertexCount = 0; var _local1:int; while (_local1 < b2Settings.b2_maxPolygonVertices) { vertices[_local1] = new b2Vec2(); _local1++; }; } public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{ var _local5:b2Vec2; var _local6:b2Mat22; var _local7:int; vertexCount = 4; vertices[0].Set(-(_arg1), -(_arg2)); vertices[1].Set(_arg1, -(_arg2)); vertices[2].Set(_arg1, _arg2); vertices[3].Set(-(_arg1), _arg2); if (_arg3){ _local5 = _arg3; _local6 = s_mat; _local6.Set(_arg4); _local7 = 0; while (_local7 < vertexCount) { _arg3 = vertices[_local7]; _arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y))); _arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y))); _arg3.x = _arg1; _local7++; }; }; } public function SetAsBox(_arg1:Number, _arg2:Number):void{ vertexCount = 4; vertices[0].Set(-(_arg1), -(_arg2)); vertices[1].Set(_arg1, -(_arg2)); vertices[2].Set(_arg1, _arg2); vertices[3].Set(-(_arg1), _arg2); } } }//package Box2D.Collision.Shapes
Section 6
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2PolygonShape extends b2Shape { public var m_coreVertices:Array; public var m_vertices:Array; private var s_supportVec:b2Vec2; public var m_centroid:b2Vec2; public var m_normals:Array; public var m_obb:b2OBB; public var m_vertexCount:int; private static var s_computeMat:b2Mat22 = new b2Mat22(); private static var s_sweptAABB1:b2AABB = new b2AABB(); private static var s_sweptAABB2:b2AABB = new b2AABB(); public function b2PolygonShape(_arg1:b2ShapeDef){ var _local3:int; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; s_supportVec = new b2Vec2(); m_obb = new b2OBB(); m_vertices = new Array(b2Settings.b2_maxPolygonVertices); m_normals = new Array(b2Settings.b2_maxPolygonVertices); m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices); super(_arg1); m_type = e_polygonShape; var _local2:b2PolygonDef = (_arg1 as b2PolygonDef); m_vertexCount = _local2.vertexCount; var _local4:int = _local3; var _local5:int = _local3; _local3 = 0; while (_local3 < m_vertexCount) { m_vertices[_local3] = _local2.vertices[_local3].Copy(); _local3++; }; _local3 = 0; while (_local3 < m_vertexCount) { _local4 = _local3; _local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0; _local6 = (m_vertices[_local5].x - m_vertices[_local4].x); _local7 = (m_vertices[_local5].y - m_vertices[_local4].y); _local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8)); _local3++; }; m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount); ComputeOBB(m_obb, m_vertices, m_vertexCount); _local3 = 0; while (_local3 < m_vertexCount) { _local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1); _local5 = _local3; _local9 = m_normals[_local4].x; _local10 = m_normals[_local4].y; _local11 = m_normals[_local5].x; _local12 = m_normals[_local5].y; _local13 = (m_vertices[_local3].x - m_centroid.x); _local14 = (m_vertices[_local3].y - m_centroid.y); _local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop); _local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop); _local17 = (1 / ((_local9 * _local12) - (_local10 * _local11))); m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y)); _local3++; }; } override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{ var _local4:b2AABB = s_sweptAABB1; var _local5:b2AABB = s_sweptAABB2; ComputeAABB(_local4, _arg2); ComputeAABB(_local5, _arg3); _arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y); _arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y); } public function GetVertices():Array{ return (m_vertices); } public function GetCoreVertices():Array{ return (m_coreVertices); } public function GetCentroid():b2Vec2{ return (m_centroid); } public function GetOBB():b2OBB{ return (m_obb); } public function GetFirstVertex(_arg1:b2XForm):b2Vec2{ return (b2Math.b2MulX(_arg1, m_coreVertices[0])); } public function Centroid(_arg1:b2XForm):b2Vec2{ return (b2Math.b2MulX(_arg1, m_centroid)); } override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{ var _local8:Number; var _local9:Number; var _local10:b2Mat22; var _local11:b2Vec2; var _local20:Number; var _local21:Number; var _local6:Number = 0; var _local7:Number = _arg5; _local8 = (_arg4.p1.x - _arg1.position.x); _local9 = (_arg4.p1.y - _arg1.position.y); _local10 = _arg1.R; var _local12:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y)); var _local13:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y)); _local8 = (_arg4.p2.x - _arg1.position.x); _local9 = (_arg4.p2.y - _arg1.position.y); _local10 = _arg1.R; var _local14:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y)); var _local15:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y)); var _local16:Number = (_local14 - _local12); var _local17:Number = (_local15 - _local13); var _local18 = -1; var _local19:int; while (_local19 < m_vertexCount) { _local11 = m_vertices[_local19]; _local8 = (_local11.x - _local12); _local9 = (_local11.y - _local13); _local11 = m_normals[_local19]; _local20 = ((_local11.x * _local8) + (_local11.y * _local9)); _local21 = ((_local11.x * _local16) + (_local11.y * _local17)); if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){ _local6 = (_local20 / _local21); _local18 = _local19; } else { if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){ _local7 = (_local20 / _local21); }; }; if (_local7 < _local6){ return (false); }; _local19++; }; if (_local18 >= 0){ _arg2[0] = _local6; _local10 = _arg1.R; _local11 = m_normals[_local18]; _arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y)); _arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y)); return (true); }; return (false); } override public function ComputeMass(_arg1:b2MassData):void{ var _local10:b2Vec2; var _local11:b2Vec2; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local2:Number = 0; var _local3:Number = 0; var _local4:Number = 0; var _local5:Number = 0; var _local6:Number = 0; var _local7:Number = 0; var _local8:Number = (1 / 3); var _local9:int; while (_local9 < m_vertexCount) { _local10 = m_vertices[_local9]; _local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0]; _local12 = (_local10.x - _local6); _local13 = (_local10.y - _local7); _local14 = (_local11.x - _local6); _local15 = (_local11.y - _local7); _local16 = ((_local12 * _local15) - (_local13 * _local14)); _local17 = (0.5 * _local16); _local4 = (_local4 + _local17); _local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x))); _local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y))); _local18 = _local6; _local19 = _local7; _local20 = _local12; _local21 = _local13; _local22 = _local14; _local23 = _local15; _local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18)); _local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19)); _local5 = (_local5 + (_local16 * (_local24 + _local25))); _local9++; }; _arg1.mass = (m_density * _local4); _local2 = (_local2 * (1 / _local4)); _local3 = (_local3 * (1 / _local4)); _arg1.center.Set(_local2, _local3); _arg1.I = (m_density * _local5); } public function GetNormals():Array{ return (m_normals); } public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{ var _local4:b2Vec2; var _local5:b2Mat22; var _local11:Number; _local5 = _arg1.R; var _local6:Number = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y)); var _local7:Number = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y)); var _local8:int; _local4 = m_coreVertices[0]; var _local9:Number = ((_local4.x * _local6) + (_local4.y * _local7)); var _local10 = 1; while (_local10 < m_vertexCount) { _local4 = m_coreVertices[_local10]; _local11 = ((_local4.x * _local6) + (_local4.y * _local7)); if (_local11 > _local9){ _local8 = _local10; _local9 = _local11; }; _local10++; }; _local5 = _arg1.R; _local4 = m_coreVertices[_local8]; s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y))); s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y))); return (s_supportVec); } public function GetVertexCount():int{ return (m_vertexCount); } override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{ var _local3:b2Mat22; var _local4:b2Vec2; var _local5:b2Mat22 = s_computeMat; _local3 = _arg2.R; _local4 = m_obb.R.col1; _local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); _local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); _local4 = m_obb.R.col2; _local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); _local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); _local5.Abs(); var _local6:b2Mat22 = _local5; _local4 = m_obb.extents; var _local7:Number = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y)); var _local8:Number = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y)); _local3 = _arg2.R; _local4 = m_obb.center; var _local9:Number = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y))); var _local10:Number = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y))); _arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8)); _arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8)); } override public function UpdateSweepRadius(_arg1:b2Vec2):void{ var _local2:b2Vec2; var _local4:Number; var _local5:Number; m_sweepRadius = 0; var _local3:int; while (_local3 < m_vertexCount) { _local2 = m_coreVertices[_local3]; _local4 = (_local2.x - _arg1.x); _local5 = (_local2.y - _arg1.y); _local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5))); if (_local4 > m_sweepRadius){ m_sweepRadius = _local4; }; _local3++; }; } override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{ var _local3:b2Vec2; var _local10:Number; var _local4:b2Mat22 = _arg1.R; var _local5:Number = (_arg2.x - _arg1.position.x); var _local6:Number = (_arg2.y - _arg1.position.y); var _local7:Number = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y)); var _local8:Number = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y)); var _local9:int; while (_local9 < m_vertexCount) { _local3 = m_vertices[_local9]; _local5 = (_local7 - _local3.x); _local6 = (_local8 - _local3.y); _local3 = m_normals[_local9]; _local10 = ((_local3.x * _local5) + (_local3.y * _local6)); if (_local10 > 0){ return (false); }; _local9++; }; return (true); } public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{ var _local3:b2Vec2; var _local7:Number; var _local9:b2Vec2; var _local10:b2Vec2; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; _local3 = new b2Vec2(); var _local4:Number = 0; var _local5:Number = 0; var _local6:Number = 0; _local7 = (1 / 3); var _local8:int; while (_local8 < _arg2) { _local9 = _arg1[_local8]; _local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0]; _local11 = (_local9.x - _local5); _local12 = (_local9.y - _local6); _local13 = (_local10.x - _local5); _local14 = (_local10.y - _local6); _local15 = ((_local11 * _local14) - (_local12 * _local13)); _local16 = (0.5 * _local15); _local4 = (_local4 + _local16); _local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x))); _local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y))); _local8++; }; _local3.x = (_local3.x * (1 / _local4)); _local3.y = (_local3.y * (1 / _local4)); return (_local3); } public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{ var _local4:int; var _local7:b2Vec2; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:int; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:b2Mat22; var _local5:Array = new Array((b2Settings.b2_maxPolygonVertices + 1)); _local4 = 0; while (_local4 < _arg3) { _local5[_local4] = _arg2[_local4]; _local4++; }; _local5[_arg3] = _local5[0]; var _local6:Number = Number.MAX_VALUE; _local4 = 1; while (_local4 <= _arg3) { _local7 = _local5[int((_local4 - 1))]; _local8 = (_local5[_local4].x - _local7.x); _local9 = (_local5[_local4].y - _local7.y); _local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9))); _local8 = (_local8 / _local10); _local9 = (_local9 / _local10); _local11 = -(_local9); _local12 = _local8; _local13 = Number.MAX_VALUE; _local14 = Number.MAX_VALUE; _local15 = -(Number.MAX_VALUE); _local16 = -(Number.MAX_VALUE); _local17 = 0; while (_local17 < _arg3) { _local19 = (_local5[_local17].x - _local7.x); _local20 = (_local5[_local17].y - _local7.y); _local21 = ((_local8 * _local19) + (_local9 * _local20)); _local22 = ((_local11 * _local19) + (_local12 * _local20)); if (_local21 < _local13){ _local13 = _local21; }; if (_local22 < _local14){ _local14 = _local22; }; if (_local21 > _local15){ _local15 = _local21; }; if (_local22 > _local16){ _local16 = _local22; }; _local17++; }; _local18 = ((_local15 - _local13) * (_local16 - _local14)); if (_local18 < (0.95 * _local6)){ _local6 = _local18; _arg1.R.col1.x = _local8; _arg1.R.col1.y = _local9; _arg1.R.col2.x = _local11; _arg1.R.col2.y = _local12; _local23 = (0.5 * (_local13 + _local15)); _local24 = (0.5 * (_local14 + _local16)); _local25 = _arg1.R; _arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24))); _arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24))); _arg1.extents.x = (0.5 * (_local15 - _local13)); _arg1.extents.y = (0.5 * (_local16 - _local14)); }; _local4++; }; } } }//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; public class b2Shape { public var m_next:b2Shape; public var m_type:int; public var m_sweepRadius:Number; public var m_density:Number; public var m_filter:b2FilterData; public var m_friction:Number; public var m_isSensor:Boolean; public var m_restitution:Number; public var m_userData; public var m_proxyId:uint; public var m_body:b2Body; public static const e_polygonShape:int = 1; public static const e_unknownShape:int = -1; public static const e_circleShape:int = 0; public static const e_shapeTypeCount:int = 2; private static var s_resetAABB:b2AABB = new b2AABB(); private static var s_syncAABB:b2AABB = new b2AABB(); private static var s_proxyAABB:b2AABB = new b2AABB(); public function b2Shape(_arg1:b2ShapeDef){ m_userData = _arg1.userData; m_friction = _arg1.friction; m_restitution = _arg1.restitution; m_density = _arg1.density; m_body = null; m_sweepRadius = 0; m_next = null; m_proxyId = b2Pair.b2_nullProxy; m_filter = _arg1.filter.Copy(); m_isSensor = _arg1.isSensor; } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function GetSweepRadius():Number{ return (m_sweepRadius); } public function GetNext():b2Shape{ return (m_next); } public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{ } public function GetType():int{ return (m_type); } public function GetRestitution():Number{ return (m_restitution); } public function GetFriction():Number{ return (m_friction); } public function GetFilterData():b2FilterData{ return (m_filter.Copy()); } public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{ return (false); } public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{ if (m_proxyId == b2Pair.b2_nullProxy){ return; }; _arg1.DestroyProxy(m_proxyId); var _local3:b2AABB = s_resetAABB; ComputeAABB(_local3, _arg2); var _local4:Boolean = _arg1.InRange(_local3); if (_local4){ m_proxyId = _arg1.CreateProxy(_local3, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; } public function SetFilterData(_arg1:b2FilterData):void{ m_filter = _arg1.Copy(); } public function GetUserData(){ return (m_userData); } public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{ if (m_proxyId == b2Pair.b2_nullProxy){ return (false); }; var _local4:b2AABB = s_syncAABB; ComputeSweptAABB(_local4, _arg2, _arg3); if (_arg1.InRange(_local4)){ _arg1.MoveProxy(m_proxyId, _local4); return (true); }; return (false); } public function ComputeMass(_arg1:b2MassData):void{ } public function IsSensor():Boolean{ return (m_isSensor); } public function DestroyProxy(_arg1:b2BroadPhase):void{ if (m_proxyId != b2Pair.b2_nullProxy){ _arg1.DestroyProxy(m_proxyId); m_proxyId = b2Pair.b2_nullProxy; }; } public function UpdateSweepRadius(_arg1:b2Vec2):void{ } public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{ } public function GetBody():b2Body{ return (m_body); } public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{ var _local3:b2AABB = s_proxyAABB; ComputeAABB(_local3, _arg2); var _local4:Boolean = _arg1.InRange(_local3); if (_local4){ m_proxyId = _arg1.CreateProxy(_local3, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; } public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{ return (false); } public static function Destroy(_arg1:b2Shape, _arg2):void{ } public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{ switch (_arg1.type){ case e_circleShape: return (new b2CircleShape(_arg1)); case e_polygonShape: return (new b2PolygonShape(_arg1)); default: return (null); }; } } }//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef) package Box2D.Collision.Shapes { public class b2ShapeDef { public var friction:Number;// = 0.2 public var isSensor:Boolean;// = false public var density:Number;// = 0 public var restitution:Number;// = 0 public var userData;// = null public var filter:b2FilterData; public var type:int; public function b2ShapeDef(){ type = b2Shape.e_unknownShape; filter = new b2FilterData(); super(); } } }//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB) package Box2D.Collision { import Box2D.Common.Math.*; public class b2AABB { public var upperBound:b2Vec2; public var lowerBound:b2Vec2; public function b2AABB(){ lowerBound = new b2Vec2(); upperBound = new b2Vec2(); super(); } public function IsValid():Boolean{ var _local1:Number = (upperBound.x - lowerBound.x); var _local2:Number = (upperBound.y - lowerBound.y); var _local3:Boolean = (((_local1 >= 0)) && ((_local2 >= 0))); _local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid())); return (_local3); } } }//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound) package Box2D.Collision { public class b2Bound { public var value:uint; public var proxyId:uint; public var stabbingCount:uint; public function Swap(_arg1:b2Bound):void{ var _local2:uint = value; var _local3:uint = proxyId; var _local4:uint = stabbingCount; value = _arg1.value; proxyId = _arg1.proxyId; stabbingCount = _arg1.stabbingCount; _arg1.value = _local2; _arg1.proxyId = _local3; _arg1.stabbingCount = _local4; } public function IsLower():Boolean{ return (((value & 1) == 0)); } public function IsUpper():Boolean{ return (((value & 1) == 1)); } } }//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues) package Box2D.Collision { public class b2BoundValues { public var lowerValues:Array; public var upperValues:Array; public function b2BoundValues(){ lowerValues = [0, 0]; upperValues = [0, 0]; super(); } } }//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2BroadPhase { public var m_bounds:Array; public var m_quantizationFactor:b2Vec2; public var m_worldAABB:b2AABB; public var m_freeProxy:uint; public var m_proxyCount:int; public var m_proxyPool:Array; public var m_queryResultCount:int; public var m_pairManager:b2PairManager; public var m_timeStamp:uint; public var m_queryResults:Array; public static const b2_nullEdge:uint = b2Settings.USHRT_MAX; public static const b2_invalid:uint = b2Settings.USHRT_MAX; public static var s_validate:Boolean = false; public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){ var _local3:int; var _local5:Number; var _local6:b2Proxy; var _local7:int; m_pairManager = new b2PairManager(); m_proxyPool = new Array(b2Settings.b2_maxPairs); m_bounds = new Array((2 * b2Settings.b2_maxProxies)); m_queryResults = new Array(b2Settings.b2_maxProxies); m_quantizationFactor = new b2Vec2(); super(); m_pairManager.Initialize(this, _arg2); m_worldAABB = _arg1; m_proxyCount = 0; _local3 = 0; while (_local3 < b2Settings.b2_maxProxies) { m_queryResults[_local3] = 0; _local3++; }; m_bounds = new Array(2); _local3 = 0; while (_local3 < 2) { m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies)); _local7 = 0; while (_local7 < (2 * b2Settings.b2_maxProxies)) { m_bounds[_local3][_local7] = new b2Bound(); _local7++; }; _local3++; }; var _local4:Number = (_arg1.upperBound.x - _arg1.lowerBound.x); _local5 = (_arg1.upperBound.y - _arg1.lowerBound.y); m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4); m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5); _local3 = 0; while (_local3 < (b2Settings.b2_maxProxies - 1)) { _local6 = new b2Proxy(); m_proxyPool[_local3] = _local6; _local6.SetNext((_local3 + 1)); _local6.timeStamp = 0; _local6.overlapCount = b2_invalid; _local6.userData = null; _local3++; }; _local6 = new b2Proxy(); m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6; _local6.SetNext(b2Pair.b2_nullProxy); _local6.timeStamp = 0; _local6.overlapCount = b2_invalid; _local6.userData = null; m_freeProxy = 0; m_timeStamp = 1; m_queryResultCount = 0; } public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{ var _local6:uint; var _local7:uint; var _local12:b2Proxy; var _local4:Array = new Array(); var _local5:Array = new Array(); ComputeBounds(_local4, _local5, _arg1); var _local8:Array = [_local6]; var _local9:Array = [_local7]; Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0); Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1); var _local10:int; var _local11:int; while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) { _local12 = m_proxyPool[m_queryResults[_local11]]; _arg2[_local11] = _local12.userData; _local11++; _local10++; }; m_queryResultCount = 0; IncrementTimeStamp(); return (_local10); } public function Commit():void{ m_pairManager.Commit(); } public function GetProxy(_arg1:int):b2Proxy{ var _local2:b2Proxy = m_proxyPool[_arg1]; if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){ return (null); }; return (_local2); } private function IncrementTimeStamp():void{ var _local1:uint; if (m_timeStamp == b2Settings.USHRT_MAX){ _local1 = 0; while (_local1 < b2Settings.b2_maxProxies) { (m_proxyPool[_local1] as b2Proxy).timeStamp = 0; _local1++; }; m_timeStamp = 1; } else { m_timeStamp++; }; } private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{ var _local10:b2Bound; var _local12:int; var _local13:int; var _local14:b2Proxy; var _local8:uint = BinarySearch(_arg5, _arg6, _arg3); var _local9:uint = BinarySearch(_arg5, _arg6, _arg4); var _local11:uint = _local8; while (_local11 < _local9) { _local10 = _arg5[_local11]; if (_local10.IsLower()){ IncrementOverlapCount(_local10.proxyId); }; _local11++; }; if (_local8 > 0){ _local12 = (_local8 - 1); _local10 = _arg5[_local12]; _local13 = _local10.stabbingCount; while (_local13) { _local10 = _arg5[_local12]; if (_local10.IsLower()){ _local14 = m_proxyPool[_local10.proxyId]; if (_local8 <= _local14.upperBounds[_arg7]){ IncrementOverlapCount(_local10.proxyId); _local13--; }; }; _local12--; }; }; _arg1[0] = _local8; _arg2[0] = _local9; } private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{ var _local4:Array; var _local5:b2Bound; var _local6:b2Bound; var _local3:int; while (_local3 < 2) { _local4 = m_bounds[_local3]; _local5 = _local4[_arg1.lowerBounds[_local3]]; _local6 = _local4[_arg2.upperBounds[_local3]]; if (_local5.value > _local6.value){ return (false); }; _local5 = _local4[_arg1.upperBounds[_local3]]; _local6 = _local4[_arg2.lowerBounds[_local3]]; if (_local5.value < _local6.value){ return (false); }; _local3++; }; return (true); } private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{ var _local4:Number = _arg3.lowerBound.x; var _local5:Number = _arg3.lowerBound.y; _local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x); _local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y); _local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x); _local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y); var _local6:Number = _arg3.upperBound.x; var _local7:Number = _arg3.upperBound.y; _local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x); _local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y); _local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x); _local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y); _arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1)); _arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1); _arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1)); _arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1); } public function CreateProxy(_arg1:b2AABB, _arg2):uint{ var _local3:uint; var _local4:b2Proxy; var _local11:Array; var _local12:uint; var _local13:uint; var _local14:Array; var _local15:Array; var _local16:Array; var _local17:int; var _local18:int; var _local19:b2Bound; var _local20:b2Bound; var _local21:b2Bound; var _local22:int; var _local23:b2Proxy; var _local5:uint = m_freeProxy; _local4 = m_proxyPool[_local5]; m_freeProxy = _local4.GetNext(); _local4.overlapCount = 0; _local4.userData = _arg2; var _local6:uint = (2 * m_proxyCount); var _local7:Array = new Array(); var _local8:Array = new Array(); ComputeBounds(_local7, _local8, _arg1); var _local9:int; while (_local9 < 2) { _local11 = m_bounds[_local9]; _local14 = [_local12]; _local15 = [_local13]; Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9); _local12 = _local14[0]; _local13 = _local15[0]; _local16 = new Array(); _local18 = (_local6 - _local13); _local17 = 0; while (_local17 < _local18) { _local16[_local17] = new b2Bound(); _local19 = _local16[_local17]; _local20 = _local11[int((_local13 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local18 = _local16.length; _local22 = (_local13 + 2); _local17 = 0; while (_local17 < _local18) { _local20 = _local16[_local17]; _local19 = _local11[int((_local22 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local16 = new Array(); _local18 = (_local13 - _local12); _local17 = 0; while (_local17 < _local18) { _local16[_local17] = new b2Bound(); _local19 = _local16[_local17]; _local20 = _local11[int((_local12 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local18 = _local16.length; _local22 = (_local12 + 1); _local17 = 0; while (_local17 < _local18) { _local20 = _local16[_local17]; _local19 = _local11[int((_local22 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local13++; _local19 = _local11[_local12]; _local20 = _local11[_local13]; _local19.value = _local7[_local9]; _local19.proxyId = _local5; _local20.value = _local8[_local9]; _local20.proxyId = _local5; _local21 = _local11[int((_local12 - 1))]; _local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount; _local21 = _local11[int((_local13 - 1))]; _local20.stabbingCount = _local21.stabbingCount; _local3 = _local12; while (_local3 < _local13) { _local21 = _local11[_local3]; _local21.stabbingCount++; _local3++; }; _local3 = _local12; while (_local3 < (_local6 + 2)) { _local19 = _local11[_local3]; _local23 = m_proxyPool[_local19.proxyId]; if (_local19.IsLower()){ _local23.lowerBounds[_local9] = _local3; } else { _local23.upperBounds[_local9] = _local3; }; _local3++; }; _local9++; }; m_proxyCount++; var _local10:int; while (_local10 < m_queryResultCount) { m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]); _local10++; }; m_pairManager.Commit(); m_queryResultCount = 0; IncrementTimeStamp(); return (_local5); } public function DestroyProxy(_arg1:uint):void{ var _local2:b2Bound; var _local3:b2Bound; var _local8:Array; var _local9:uint; var _local10:uint; var _local11:uint; var _local12:uint; var _local13:Array; var _local14:int; var _local15:int; var _local16:int; var _local17:uint; var _local18:int; var _local19:b2Proxy; var _local4:b2Proxy = m_proxyPool[_arg1]; var _local5:int = (2 * m_proxyCount); var _local6:int; while (_local6 < 2) { _local8 = m_bounds[_local6]; _local9 = _local4.lowerBounds[_local6]; _local10 = _local4.upperBounds[_local6]; _local2 = _local8[_local9]; _local11 = _local2.value; _local3 = _local8[_local10]; _local12 = _local3.value; _local13 = new Array(); _local15 = ((_local10 - _local9) - 1); _local14 = 0; while (_local14 < _local15) { _local13[_local14] = new b2Bound(); _local2 = _local13[_local14]; _local3 = _local8[int(((_local9 + 1) + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local15 = _local13.length; _local16 = _local9; _local14 = 0; while (_local14 < _local15) { _local3 = _local13[_local14]; _local2 = _local8[int((_local16 + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local13 = new Array(); _local15 = ((_local5 - _local10) - 1); _local14 = 0; while (_local14 < _local15) { _local13[_local14] = new b2Bound(); _local2 = _local13[_local14]; _local3 = _local8[int(((_local10 + 1) + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local15 = _local13.length; _local16 = (_local10 - 1); _local14 = 0; while (_local14 < _local15) { _local3 = _local13[_local14]; _local2 = _local8[int((_local16 + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local15 = (_local5 - 2); _local17 = _local9; while (_local17 < _local15) { _local2 = _local8[_local17]; _local19 = m_proxyPool[_local2.proxyId]; if (_local2.IsLower()){ _local19.lowerBounds[_local6] = _local17; } else { _local19.upperBounds[_local6] = _local17; }; _local17++; }; _local15 = (_local10 - 1); _local18 = _local9; while (_local18 < _local15) { _local2 = _local8[_local18]; _local2.stabbingCount--; _local18++; }; Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6); _local6++; }; var _local7:int; while (_local7 < m_queryResultCount) { m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]); _local7++; }; m_pairManager.Commit(); m_queryResultCount = 0; IncrementTimeStamp(); _local4.userData = null; _local4.overlapCount = b2_invalid; _local4.lowerBounds[0] = b2_invalid; _local4.lowerBounds[1] = b2_invalid; _local4.upperBounds[0] = b2_invalid; _local4.upperBounds[1] = b2_invalid; _local4.SetNext(m_freeProxy); m_freeProxy = _arg1; m_proxyCount--; } public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{ var _local4:Array; var _local5:b2Bound; var _local3:int; while (_local3 < 2) { _local4 = m_bounds[_local3]; _local5 = _local4[_arg2.upperBounds[_local3]]; if (_arg1.lowerValues[_local3] > _local5.value){ return (false); }; _local5 = _local4[_arg2.lowerBounds[_local3]]; if (_arg1.upperValues[_local3] < _local5.value){ return (false); }; _local3++; }; return (true); } public function Validate():void{ var _local1:b2Pair; var _local2:b2Proxy; var _local3:b2Proxy; var _local4:Boolean; var _local6:b2Bound; var _local7:uint; var _local8:uint; var _local9:uint; var _local10:b2Bound; var _local5:int; while (_local5 < 2) { _local6 = m_bounds[_local5]; _local7 = (2 * m_proxyCount); _local8 = 0; _local9 = 0; while (_local9 < _local7) { _local10 = _local6[_local9]; if (_local10.IsLower() == true){ _local8++; } else { _local8--; }; _local9++; }; _local5++; }; } private function IncrementOverlapCount(_arg1:uint):void{ var _local2:b2Proxy = m_proxyPool[_arg1]; if (_local2.timeStamp < m_timeStamp){ _local2.timeStamp = m_timeStamp; _local2.overlapCount = 1; } else { _local2.overlapCount = 2; m_queryResults[m_queryResultCount] = _arg1; m_queryResultCount++; }; } public function InRange(_arg1:b2AABB):Boolean{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = _arg1.lowerBound.x; _local3 = _arg1.lowerBound.y; _local2 = (_local2 - m_worldAABB.upperBound.x); _local3 = (_local3 - m_worldAABB.upperBound.y); _local4 = m_worldAABB.lowerBound.x; _local5 = m_worldAABB.lowerBound.y; _local4 = (_local4 - _arg1.upperBound.x); _local5 = (_local5 - _arg1.upperBound.y); _local2 = b2Math.b2Max(_local2, _local4); _local3 = b2Math.b2Max(_local3, _local5); return ((b2Math.b2Max(_local2, _local3) < 0)); } public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{ var _local3:Array; var _local4:int; var _local5:uint; var _local6:uint; var _local7:b2Bound; var _local8:b2Bound; var _local9:b2Bound; var _local10:uint; var _local11:b2Proxy; var _local16:Array; var _local17:uint; var _local18:uint; var _local19:uint; var _local20:uint; var _local21:int; var _local22:int; var _local23:uint; var _local24:b2Proxy; if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){ return; }; if (_arg2.IsValid() == false){ return; }; var _local12:uint = (2 * m_proxyCount); var _local13:b2Proxy = m_proxyPool[_arg1]; var _local14:b2BoundValues = new b2BoundValues(); ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2); var _local15:b2BoundValues = new b2BoundValues(); _local5 = 0; while (_local5 < 2) { _local7 = m_bounds[_local5][_local13.lowerBounds[_local5]]; _local15.lowerValues[_local5] = _local7.value; _local7 = m_bounds[_local5][_local13.upperBounds[_local5]]; _local15.upperValues[_local5] = _local7.value; _local5++; }; _local5 = 0; while (_local5 < 2) { _local16 = m_bounds[_local5]; _local17 = _local13.lowerBounds[_local5]; _local18 = _local13.upperBounds[_local5]; _local19 = _local14.lowerValues[_local5]; _local20 = _local14.upperValues[_local5]; _local7 = _local16[_local17]; _local21 = (_local19 - _local7.value); _local7.value = _local19; _local7 = _local16[_local18]; _local22 = (_local20 - _local7.value); _local7.value = _local20; if (_local21 < 0){ _local6 = _local17; while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) { _local7 = _local16[_local6]; _local8 = _local16[int((_local6 - 1))]; _local23 = _local8.proxyId; _local24 = m_proxyPool[_local8.proxyId]; _local8.stabbingCount++; if (_local8.IsUpper() == true){ if (TestOverlap(_local14, _local24)){ m_pairManager.AddBufferedPair(_arg1, _local23); }; _local3 = _local24.upperBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount++; } else { _local3 = _local24.lowerBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount--; }; _local3 = _local13.lowerBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.Swap(_local8); _local6--; }; }; if (_local22 > 0){ _local6 = _local18; while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) { _local7 = _local16[_local6]; _local9 = _local16[int((_local6 + 1))]; _local10 = _local9.proxyId; _local11 = m_proxyPool[_local10]; _local9.stabbingCount++; if (_local9.IsLower() == true){ if (TestOverlap(_local14, _local11)){ m_pairManager.AddBufferedPair(_arg1, _local10); }; _local3 = _local11.lowerBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount++; } else { _local3 = _local11.upperBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount--; }; _local3 = _local13.upperBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.Swap(_local9); _local6++; }; }; if (_local21 > 0){ _local6 = _local17; while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) { _local7 = _local16[_local6]; _local9 = _local16[int((_local6 + 1))]; _local10 = _local9.proxyId; _local11 = m_proxyPool[_local10]; _local9.stabbingCount--; if (_local9.IsUpper()){ if (TestOverlap(_local15, _local11)){ m_pairManager.RemoveBufferedPair(_arg1, _local10); }; _local3 = _local11.upperBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount--; } else { _local3 = _local11.lowerBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount++; }; _local3 = _local13.lowerBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.Swap(_local9); _local6++; }; }; if (_local22 < 0){ _local6 = _local18; while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) { _local7 = _local16[_local6]; _local8 = _local16[int((_local6 - 1))]; _local23 = _local8.proxyId; _local24 = m_proxyPool[_local23]; _local8.stabbingCount--; if (_local8.IsLower() == true){ if (TestOverlap(_local15, _local24)){ m_pairManager.RemoveBufferedPair(_arg1, _local23); }; _local3 = _local24.lowerBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount--; } else { _local3 = _local24.upperBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount++; }; _local3 = _local13.upperBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.Swap(_local8); _local6--; }; }; _local5++; }; } public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{ var _local6:int; var _local7:b2Bound; var _local4:int; var _local5:int = (_arg2 - 1); while (_local4 <= _local5) { _local6 = ((_local4 + _local5) / 2); _local7 = _arg1[_local6]; if (_local7.value > _arg3){ _local5 = (_local6 - 1); } else { if (_local7.value < _arg3){ _local4 = (_local6 + 1); } else { return (uint(_local6)); }; }; }; return (uint(_local4)); } } }//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair) package Box2D.Collision { public class b2BufferedPair { public var proxyId1:uint; public var proxyId2:uint; } }//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision) package Box2D.Collision { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Common.*; public class b2Collision { public static const b2_nullFeature:uint = 0xFF; private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2(); public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{ var _local11:b2Mat22; var _local12:b2Vec2; var _local25:Number; var _local6:int = _arg1.m_vertexCount; var _local7:Array = _arg1.m_vertices; var _local8:Array = _arg1.m_normals; var _local9:int = _arg4.m_vertexCount; var _local10:Array = _arg4.m_vertices; _local11 = _arg2.R; _local12 = _local8[_arg3]; var _local13:Number = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)); var _local14:Number = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)); _local11 = _arg5.R; var _local15:Number = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14)); var _local16:Number = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14)); var _local17:int; var _local18:Number = Number.MAX_VALUE; var _local19:int; while (_local19 < _local9) { _local12 = _local10[_local19]; _local25 = ((_local12.x * _local15) + (_local12.y * _local16)); if (_local25 < _local18){ _local18 = _local25; _local17 = _local19; }; _local19++; }; _local12 = _local7[_arg3]; _local11 = _arg2.R; var _local20:Number = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y))); var _local21:Number = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y))); _local12 = _local10[_local17]; _local11 = _arg5.R; var _local22:Number = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y))); var _local23:Number = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y))); _local22 = (_local22 - _local20); _local23 = (_local23 - _local21); var _local24:Number = ((_local22 * _local13) + (_local23 * _local14)); return (_local24); } public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{ var _local3:b2Vec2 = _arg2.lowerBound; var _local4:b2Vec2 = _arg1.upperBound; var _local5:Number = (_local3.x - _local4.x); var _local6:Number = (_local3.y - _local4.y); _local3 = _arg1.lowerBound; _local4 = _arg2.upperBound; var _local7:Number = (_local3.x - _local4.x); var _local8:Number = (_local3.y - _local4.y); if ((((_local5 > 0)) || ((_local6 > 0)))){ return (false); }; if ((((_local7 > 0)) || ((_local8 > 0)))){ return (false); }; return (true); } public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{ var _local12:b2Mat22; var _local13:b2Vec2; var _local20:ClipVertex; var _local23:Number; var _local7:int = _arg2.m_vertexCount; var _local8:Array = _arg2.m_normals; var _local9:int = _arg5.m_vertexCount; var _local10:Array = _arg5.m_vertices; var _local11:Array = _arg5.m_normals; _local12 = _arg3.R; _local13 = _local8[_arg4]; var _local14:Number = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)); var _local15:Number = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)); _local12 = _arg6.R; var _local16:Number = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15)); _local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15)); _local14 = _local16; var _local17:int; var _local18:Number = Number.MAX_VALUE; var _local19:int; while (_local19 < _local9) { _local13 = _local11[_local19]; _local23 = ((_local14 * _local13.x) + (_local15 * _local13.y)); if (_local23 < _local18){ _local18 = _local23; _local17 = _local19; }; _local19++; }; var _local21:int = _local17; var _local22:int = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0; _local20 = _arg1[0]; _local13 = _local10[_local21]; _local12 = _arg6.R; _local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y))); _local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y))); _local20.id.features.referenceEdge = _arg4; _local20.id.features.incidentEdge = _local21; _local20.id.features.incidentVertex = 0; _local20 = _arg1[1]; _local13 = _local10[_local22]; _local12 = _arg6.R; _local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y))); _local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y))); _local20.id.features.referenceEdge = _arg4; _local20.id.features.incidentEdge = _local22; _local20.id.features.incidentVertex = 1; } public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{ var _local6:ClipVertex; var _local13:b2PolygonShape; var _local14:b2PolygonShape; var _local17:int; var _local18:uint; var _local34:int; var _local37:b2Vec2; var _local38:Number; var _local39:b2ManifoldPoint; _arg1.pointCount = 0; var _local7:int; var _local8:Array = [_local7]; var _local9:Number = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5); _local7 = _local8[0]; if (_local9 > 0){ return; }; var _local10:int; var _local11:Array = [_local10]; var _local12:Number = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3); _local10 = _local11[0]; if (_local12 > 0){ return; }; var _local15:b2XForm = new b2XForm(); var _local16:b2XForm = new b2XForm(); var _local19:Number = 0.98; var _local20:Number = 0.001; if (_local12 > ((_local19 * _local9) + _local20)){ _local13 = _arg4; _local14 = _arg2; _local15.Set(_arg5); _local16.Set(_arg3); _local17 = _local10; _local18 = 1; } else { _local13 = _arg2; _local14 = _arg4; _local15.Set(_arg3); _local16.Set(_arg5); _local17 = _local7; _local18 = 0; }; var _local21:Array = [new ClipVertex(), new ClipVertex()]; FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16); var _local22:int = _local13.m_vertexCount; var _local23:Array = _local13.m_vertices; var _local24:b2Vec2 = _local23[_local17]; var _local25:b2Vec2 = _local24.Copy(); if ((_local17 + 1) < _local22){ _local24 = _local23[int((_local17 + 1))]; _local37 = _local24.Copy(); } else { _local24 = _local23[0]; _local37 = _local24.Copy(); }; var _local26:b2Vec2 = b2Math.SubtractVV(_local37, _local25); var _local27:b2Vec2 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25)); _local27.Normalize(); var _local28:b2Vec2 = b2Math.b2CrossVF(_local27, 1); _local25 = b2Math.b2MulX(_local15, _local25); _local37 = b2Math.b2MulX(_local15, _local37); var _local29:Number = b2Math.b2Dot(_local28, _local25); var _local30:Number = -(b2Math.b2Dot(_local27, _local25)); var _local31:Number = b2Math.b2Dot(_local27, _local37); var _local32:Array = [new ClipVertex(), new ClipVertex()]; var _local33:Array = [new ClipVertex(), new ClipVertex()]; _local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30); if (_local34 < 2){ return; }; _local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31); if (_local34 < 2){ return; }; _arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy(); var _local35:int; var _local36:int; while (_local36 < b2Settings.b2_maxManifoldPoints) { _local6 = _local33[_local36]; _local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29); if (_local38 <= 0){ _local39 = _arg1.points[_local35]; _local39.separation = _local38; _local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v); _local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v); _local39.id.key = _local6.id._key; _local39.id.features.flip = _local18; _local35++; }; _local36++; }; _arg1.pointCount = _local35; } public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{ var _local8:b2Vec2; var _local9:b2Mat22; var _local22:int; var _local23:Number; var _local24:int; var _local25:Number; var _local6:int = _arg2.m_vertexCount; var _local7:Array = _arg2.m_normals; _local9 = _arg5.R; _local8 = _arg4.m_centroid; var _local10:Number = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))); var _local11:Number = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))); _local9 = _arg3.R; _local8 = _arg2.m_centroid; _local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)))); _local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)))); var _local12:Number = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y)); var _local13:Number = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y)); var _local14:int; var _local15:Number = -(Number.MAX_VALUE); var _local16:int; while (_local16 < _local6) { _local8 = _local7[_local16]; _local25 = ((_local8.x * _local12) + (_local8.y * _local13)); if (_local25 > _local15){ _local15 = _local25; _local14 = _local16; }; _local16++; }; var _local17:Number = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5); if (_local17 > 0){ return (_local17); }; var _local18:int = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1); var _local19:Number = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5); if (_local19 > 0){ return (_local19); }; var _local20:int = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0; var _local21:Number = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5); if (_local21 > 0){ return (_local21); }; if ((((_local19 > _local17)) && ((_local19 > _local21)))){ _local24 = -1; _local22 = _local18; _local23 = _local19; } else { if (_local21 > _local17){ _local24 = 1; _local22 = _local20; _local23 = _local21; } else { _arg1[0] = _local14; return (_local17); }; }; while (true) { if (_local24 == -1){ _local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1); } else { _local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0; }; _local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5); if (_local17 > 0){ return (_local17); }; if (_local17 > _local23){ _local22 = _local14; _local23 = _local17; } else { break; }; }; _arg1[0] = _local22; return (_local23); } public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{ var _local5:ClipVertex; var _local6:int; var _local7:b2Vec2; var _local8:b2Vec2; var _local9:Number; var _local11:Number; var _local12:b2Vec2; var _local13:ClipVertex; _local6 = 0; _local5 = _arg2[0]; _local7 = _local5.v; _local5 = _arg2[1]; _local8 = _local5.v; _local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4); var _local10:Number = (b2Math.b2Dot(_arg3, _local8) - _arg4); if (_local9 <= 0){ var _temp1 = _local6; _local6 = (_local6 + 1); var _local14 = _temp1; _arg1[_local14] = _arg2[0]; }; if (_local10 <= 0){ var _temp2 = _local6; _local6 = (_local6 + 1); _local14 = _temp2; _arg1[_local14] = _arg2[1]; }; if ((_local9 * _local10) < 0){ _local11 = (_local9 / (_local9 - _local10)); _local5 = _arg1[_local6]; _local12 = _local5.v; _local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x))); _local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y))); _local5 = _arg1[_local6]; if (_local9 > 0){ _local13 = _arg2[0]; _local5.id = _local13.id; } else { _local13 = _arg2[1]; _local5.id = _local13.id; }; _local6++; }; return (_local6); } public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{ var _local6:b2Mat22; var _local7:b2Vec2; var _local18:Number; var _local24:Number; var _local25:Number; _arg1.pointCount = 0; _local6 = _arg3.R; _local7 = _arg2.m_localPosition; var _local8:Number = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y))); var _local9:Number = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y))); _local6 = _arg5.R; _local7 = _arg4.m_localPosition; var _local10:Number = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y))); var _local11:Number = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y))); var _local12:Number = (_local10 - _local8); var _local13:Number = (_local11 - _local9); var _local14:Number = ((_local12 * _local12) + (_local13 * _local13)); var _local15:Number = _arg2.m_radius; var _local16:Number = _arg4.m_radius; var _local17:Number = (_local15 + _local16); if (_local14 > (_local17 * _local17)){ return; }; if (_local14 < Number.MIN_VALUE){ _local18 = -(_local17); _arg1.normal.Set(0, 1); } else { _local24 = Math.sqrt(_local14); _local18 = (_local24 - _local17); _local25 = (1 / _local24); _arg1.normal.x = (_local25 * _local12); _arg1.normal.y = (_local25 * _local13); }; _arg1.pointCount = 1; var _local19:b2ManifoldPoint = _arg1.points[0]; _local19.id.key = 0; _local19.separation = _local18; _local8 = (_local8 + (_local15 * _arg1.normal.x)); _local9 = (_local9 + (_local15 * _arg1.normal.y)); _local10 = (_local10 - (_local16 * _arg1.normal.x)); _local11 = (_local11 - (_local16 * _arg1.normal.y)); var _local20:Number = (0.5 * (_local8 + _local10)); var _local21:Number = (0.5 * (_local9 + _local11)); var _local22:Number = (_local20 - _arg3.position.x); var _local23:Number = (_local21 - _arg3.position.y); _local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y)); _local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y)); _local22 = (_local20 - _arg5.position.x); _local23 = (_local21 - _arg5.position.y); _local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y)); _local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y)); } public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{ var _local6:b2ManifoldPoint; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:b2Vec2; var _local12:b2Mat22; var _local17:Number; var _local32:Number; var _local33:Number; var _local34:Number; _arg1.pointCount = 0; _local12 = _arg5.R; _local11 = _arg4.m_localPosition; var _local13:Number = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y))); var _local14:Number = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y))); _local7 = (_local13 - _arg3.position.x); _local8 = (_local14 - _arg3.position.y); _local12 = _arg3.R; var _local15:Number = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); var _local16:Number = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); var _local18:int; var _local19:Number = -(Number.MAX_VALUE); var _local20:Number = _arg4.m_radius; var _local21:int = _arg2.m_vertexCount; var _local22:Array = _arg2.m_vertices; var _local23:Array = _arg2.m_normals; var _local24:int; while (_local24 < _local21) { _local11 = _local22[_local24]; _local7 = (_local15 - _local11.x); _local8 = (_local16 - _local11.y); _local11 = _local23[_local24]; _local34 = ((_local11.x * _local7) + (_local11.y * _local8)); if (_local34 > _local20){ return; }; if (_local34 > _local19){ _local19 = _local34; _local18 = _local24; }; _local24++; }; if (_local19 < Number.MIN_VALUE){ _arg1.pointCount = 1; _local11 = _local23[_local18]; _local12 = _arg3.R; _arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)); _arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)); _local6 = _arg1.points[0]; _local6.id.features.incidentEdge = _local18; _local6.id.features.incidentVertex = b2_nullFeature; _local6.id.features.referenceEdge = 0; _local6.id.features.flip = 0; _local9 = (_local13 - (_local20 * _arg1.normal.x)); _local10 = (_local14 - (_local20 * _arg1.normal.y)); _local7 = (_local9 - _arg3.position.x); _local8 = (_local10 - _arg3.position.y); _local12 = _arg3.R; _local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local7 = (_local9 - _arg5.position.x); _local8 = (_local10 - _arg5.position.y); _local12 = _arg5.R; _local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local6.separation = (_local19 - _local20); return; }; var _local25:int = _local18; var _local26:int = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0; _local11 = _local22[_local25]; var _local27:b2Vec2 = _local22[_local26]; var _local28:Number = (_local27.x - _local11.x); var _local29:Number = (_local27.y - _local11.y); var _local30:Number = Math.sqrt(((_local28 * _local28) + (_local29 * _local29))); _local28 = (_local28 / _local30); _local29 = (_local29 / _local30); _local7 = (_local15 - _local11.x); _local8 = (_local16 - _local11.y); var _local31:Number = ((_local7 * _local28) + (_local8 * _local29)); _local6 = _arg1.points[0]; if (_local31 <= 0){ _local32 = _local11.x; _local33 = _local11.y; _local6.id.features.incidentEdge = b2_nullFeature; _local6.id.features.incidentVertex = _local25; } else { if (_local31 >= _local30){ _local32 = _local27.x; _local33 = _local27.y; _local6.id.features.incidentEdge = b2_nullFeature; _local6.id.features.incidentVertex = _local26; } else { _local32 = ((_local28 * _local31) + _local11.x); _local33 = ((_local29 * _local31) + _local11.y); _local6.id.features.incidentEdge = _local18; _local6.id.features.incidentVertex = b2_nullFeature; }; }; _local7 = (_local15 - _local32); _local8 = (_local16 - _local33); _local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8))); _local7 = (_local7 / _local17); _local8 = (_local8 / _local17); if (_local17 > _local20){ return; }; _arg1.pointCount = 1; _local12 = _arg3.R; _arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8)); _arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8)); _local9 = (_local13 - (_local20 * _arg1.normal.x)); _local10 = (_local14 - (_local20 * _arg1.normal.y)); _local7 = (_local9 - _arg3.position.x); _local8 = (_local10 - _arg3.position.y); _local12 = _arg3.R; _local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local7 = (_local9 - _arg5.position.x); _local8 = (_local10 - _arg5.position.y); _local12 = _arg5.R; _local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local6.separation = (_local17 - _local20); _local6.id.features.referenceEdge = 0; _local6.id.features.flip = 0; } } }//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID) package Box2D.Collision { public class b2ContactID { public var _key:uint; public var features:Features; public function b2ContactID(){ features = new Features(); super(); features._m_id = this; } public function Set(_arg1:b2ContactID):void{ key = _arg1._key; } public function Copy():b2ContactID{ var _local1:b2ContactID = new b2ContactID(); _local1.key = key; return (_local1); } public function set key(_arg1:uint):void{ _key = _arg1; features._referenceEdge = (_key & 0xFF); features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF); features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF); features._flip = (((_key & 4278190080) >> 24) & 0xFF); } public function get key():uint{ return (_key); } } }//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint) package Box2D.Collision { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; public class b2ContactPoint { public var friction:Number; public var separation:Number; public var normal:b2Vec2; public var position:b2Vec2; public var restitution:Number; public var shape1:b2Shape; public var shape2:b2Shape; public var id:b2ContactID; public var velocity:b2Vec2; public function b2ContactPoint(){ position = new b2Vec2(); velocity = new b2Vec2(); normal = new b2Vec2(); id = new b2ContactID(); super(); } } }//package Box2D.Collision
Section 17
//b2Distance (Box2D.Collision.b2Distance) package Box2D.Collision { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Common.*; public class b2Distance { private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()]; private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()]; private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()]; private static var gPoint:b2Point = new b2Point(); public static var g_GJK_Iterations:int = 0; public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{ var _local6:b2Vec2; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local4:Number = (100 * Number.MIN_VALUE); var _local5:int; while (_local5 < _arg3) { _local6 = _arg2[_local5]; _local7 = Math.abs((_arg1.x - _local6.x)); _local8 = Math.abs((_arg1.y - _local6.y)); _local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x)); _local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y)); if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){ return (true); }; _local5++; }; return (false); } public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{ var _local7:b2Vec2; var _local15:Number; var _local16:Number; var _local17:b2Vec2; var _local18:b2Vec2; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:int; var _local8:Array = s_p1s; var _local9:Array = s_p2s; var _local10:Array = s_points; var _local11:int; _arg1.SetV(_arg3.GetFirstVertex(_arg4)); _arg2.SetV(_arg5.GetFirstVertex(_arg6)); var _local12:Number = 0; var _local13 = 20; var _local14:int; while (_local14 < _local13) { _local15 = (_arg2.x - _arg1.x); _local16 = (_arg2.y - _arg1.y); _local17 = _arg3.Support(_arg4, _local15, _local16); _local18 = _arg5.Support(_arg6, -(_local15), -(_local16)); _local12 = ((_local15 * _local15) + (_local16 * _local16)); _local19 = (_local18.x - _local17.x); _local20 = (_local18.y - _local17.y); _local21 = ((_local15 * _local19) + (_local16 * _local20)); if ((_local12 - _local21) <= (0.01 * _local12)){ if (_local11 == 0){ _arg1.SetV(_local17); _arg2.SetV(_local18); }; g_GJK_Iterations = _local14; return (Math.sqrt(_local12)); }; switch (_local11){ case 0: _local7 = _local8[0]; _local7.SetV(_local17); _local7 = _local9[0]; _local7.SetV(_local18); _local7 = _local10[0]; _local7.x = _local19; _local7.y = _local20; _arg1.SetV(_local8[0]); _arg2.SetV(_local9[0]); _local11++; break; case 1: _local7 = _local8[1]; _local7.SetV(_local17); _local7 = _local9[1]; _local7.SetV(_local18); _local7 = _local10[1]; _local7.x = _local19; _local7.y = _local20; _local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10); break; case 2: _local7 = _local8[2]; _local7.SetV(_local17); _local7 = _local9[2]; _local7.SetV(_local18); _local7 = _local10[2]; _local7.x = _local19; _local7.y = _local20; _local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10); break; }; if (_local11 == 3){ g_GJK_Iterations = _local14; return (0); }; _local22 = -(Number.MAX_VALUE); _local23 = 0; while (_local23 < _local11) { _local7 = _local10[_local23]; _local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y))); _local23++; }; if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){ g_GJK_Iterations = _local14; _local15 = (_arg2.x - _arg1.x); _local16 = (_arg2.y - _arg1.y); _local12 = ((_local15 * _local15) + (_local16 * _local16)); return (Math.sqrt(_local12)); }; _local14++; }; g_GJK_Iterations = _local13; return (Math.sqrt(_local12)); } public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{ var _local7:b2Mat22; var _local8:b2Vec2; var _local19:Number; var _local20:Number; _local7 = _arg4.R; _local8 = _arg3.m_localPosition; var _local9:Number = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y))); var _local10:Number = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y))); _local7 = _arg6.R; _local8 = _arg5.m_localPosition; var _local11:Number = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y))); var _local12:Number = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y))); var _local13:Number = (_local11 - _local9); var _local14:Number = (_local12 - _local10); var _local15:Number = ((_local13 * _local13) + (_local14 * _local14)); var _local16:Number = (_arg3.m_radius - b2Settings.b2_toiSlop); var _local17:Number = (_arg5.m_radius - b2Settings.b2_toiSlop); var _local18:Number = (_local16 + _local17); if (_local15 > (_local18 * _local18)){ _local19 = Math.sqrt(_local15); _local13 = (_local13 / _local19); _local14 = (_local14 / _local19); _local20 = (_local19 - _local18); _arg1.x = (_local9 + (_local16 * _local13)); _arg1.y = (_local10 + (_local16 * _local14)); _arg2.x = (_local11 - (_local17 * _local13)); _arg2.y = (_local12 - (_local17 * _local14)); return (_local20); }; if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){ _local19 = Math.sqrt(_local15); _local13 = (_local13 / _local19); _local14 = (_local14 / _local19); _arg1.x = (_local9 + (_local16 * _local13)); _arg1.y = (_local10 + (_local16 * _local14)); _arg2.x = _arg1.x; _arg2.y = _arg1.y; return (0); }; _arg1.x = _local9; _arg1.y = _local10; _arg2.x = _arg1.x; _arg2.y = _arg1.y; return (0); } public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{ var _local6:b2Vec2; var _local7:b2Vec2; var _local8:b2Vec2; var _local9:b2Vec2; var _local10:b2Vec2; var _local11:b2Vec2; var _local12:b2Vec2; var _local13:b2Vec2; var _local35:Number; _local6 = _arg5[0]; _local7 = _arg5[1]; _local8 = _arg5[2]; _local9 = _arg3[0]; _local10 = _arg3[1]; _local11 = _arg3[2]; _local12 = _arg4[0]; _local13 = _arg4[1]; var _local14:b2Vec2 = _arg4[2]; var _local15:Number = _local6.x; var _local16:Number = _local6.y; var _local17:Number = _local7.x; var _local18:Number = _local7.y; var _local19:Number = _local8.x; var _local20:Number = _local8.y; var _local21:Number = (_local17 - _local15); var _local22:Number = (_local18 - _local16); var _local23:Number = (_local19 - _local15); var _local24:Number = (_local20 - _local16); var _local25:Number = (_local19 - _local17); var _local26:Number = (_local20 - _local18); var _local27:Number = -(((_local15 * _local21) + (_local16 * _local22))); var _local28:Number = ((_local17 * _local21) + (_local18 * _local22)); var _local29:Number = -(((_local15 * _local23) + (_local16 * _local24))); var _local30:Number = ((_local19 * _local23) + (_local20 * _local24)); var _local31:Number = -(((_local17 * _local25) + (_local18 * _local26))); var _local32:Number = ((_local19 * _local25) + (_local20 * _local26)); if ((((_local30 <= 0)) && ((_local32 <= 0)))){ _arg1.SetV(_local11); _arg2.SetV(_local14); _local9.SetV(_local11); _local12.SetV(_local14); _local6.SetV(_local8); return (1); }; var _local33:Number = ((_local21 * _local24) - (_local22 * _local23)); var _local34:Number = (_local33 * ((_local15 * _local18) - (_local16 * _local17))); var _local36:Number = (_local33 * ((_local17 * _local20) - (_local18 * _local19))); if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){ _local35 = (_local31 / (_local31 + _local32)); _arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x))); _arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y))); _arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x))); _arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y))); _local9.SetV(_local11); _local12.SetV(_local14); _local6.SetV(_local8); return (2); }; var _local37:Number = (_local33 * ((_local19 * _local16) - (_local20 * _local15))); if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){ _local35 = (_local29 / (_local29 + _local30)); _arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x))); _arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y))); _arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x))); _arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y))); _local10.SetV(_local11); _local13.SetV(_local14); _local7.SetV(_local8); return (2); }; var _local38:Number = ((_local36 + _local37) + _local34); _local38 = (1 / _local38); var _local39:Number = (_local36 * _local38); var _local40:Number = (_local37 * _local38); var _local41:Number = ((1 - _local39) - _local40); _arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x)); _arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y)); _arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x)); _arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y)); return (3); } public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{ var _local7:b2Mat22; var _local8:b2Vec2; var _local12:Number; var _local13:Number; var _local14:Number; var _local9:b2Point = gPoint; _local8 = _arg5.m_localPosition; _local7 = _arg6.R; _local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y))); _local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y))); var _local10:Number = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity); var _local11:Number = (_arg5.m_radius - b2Settings.b2_toiSlop); if (_local10 > _local11){ _local10 = (_local10 - _local11); _local12 = (_arg2.x - _arg1.x); _local13 = (_arg2.y - _arg1.y); _local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13))); _local12 = (_local12 / _local14); _local13 = (_local13 / _local14); _arg2.x = (_arg2.x - (_local11 * _local12)); _arg2.y = (_arg2.y - (_local11 * _local13)); } else { _local10 = 0; _arg2.x = _arg1.x; _arg2.y = _arg1.y; }; return (_local10); } public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{ var _local7:int = _arg3.m_type; var _local8:int = _arg5.m_type; if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){ return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6)); }; if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){ return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6)); }; if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){ return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4)); }; if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){ return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6)); }; return (0); } public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{ var _local9:b2Vec2; var _local10:b2Vec2; var _local11:b2Vec2; var _local17:Number; var _local6:b2Vec2 = _arg5[0]; var _local7:b2Vec2 = _arg5[1]; var _local8:b2Vec2 = _arg3[0]; _local9 = _arg3[1]; _local10 = _arg4[0]; _local11 = _arg4[1]; var _local12:Number = -(_local7.x); var _local13:Number = -(_local7.y); var _local14:Number = (_local6.x - _local7.x); var _local15:Number = (_local6.y - _local7.y); var _local16:Number = Math.sqrt(((_local14 * _local14) + (_local15 * _local15))); _local14 = (_local14 / _local16); _local15 = (_local15 / _local16); _local17 = ((_local12 * _local14) + (_local13 * _local15)); if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){ _arg1.SetV(_local9); _arg2.SetV(_local11); _local8.SetV(_local9); _local10.SetV(_local11); _local6.SetV(_local7); return (1); }; _local17 = (_local17 / _local16); _arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x))); _arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y))); _arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x))); _arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y))); return (2); } } }//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2Manifold { public var pointCount:int;// = 0 public var normal:b2Vec2; public var points:Array; public function b2Manifold(){ points = new Array(b2Settings.b2_maxManifoldPoints); var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { points[_local1] = new b2ManifoldPoint(); _local1++; }; normal = new b2Vec2(); } public function Set(_arg1:b2Manifold):void{ pointCount = _arg1.pointCount; var _local2:int; while (_local2 < b2Settings.b2_maxManifoldPoints) { (points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]); _local2++; }; normal.SetV(_arg1.normal); } public function Reset():void{ var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { (points[_local1] as b2ManifoldPoint).Reset(); _local1++; }; normal.SetZero(); pointCount = 0; } } }//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint) package Box2D.Collision { import Box2D.Common.Math.*; public class b2ManifoldPoint { public var separation:Number; public var localPoint2:b2Vec2; public var normalImpulse:Number; public var tangentImpulse:Number; public var localPoint1:b2Vec2; public var id:b2ContactID; public function b2ManifoldPoint(){ localPoint1 = new b2Vec2(); localPoint2 = new b2Vec2(); id = new b2ContactID(); super(); } public function Set(_arg1:b2ManifoldPoint):void{ localPoint1.SetV(_arg1.localPoint1); localPoint2.SetV(_arg1.localPoint2); separation = _arg1.separation; normalImpulse = _arg1.normalImpulse; tangentImpulse = _arg1.tangentImpulse; id.key = _arg1.id.key; } public function Reset():void{ localPoint1.SetZero(); localPoint2.SetZero(); separation = 0; normalImpulse = 0; tangentImpulse = 0; id.key = 0; } } }//package Box2D.Collision
Section 20
//b2OBB (Box2D.Collision.b2OBB) package Box2D.Collision { import Box2D.Common.Math.*; public class b2OBB { public var R:b2Mat22; public var center:b2Vec2; public var extents:b2Vec2; public function b2OBB(){ R = new b2Mat22(); center = new b2Vec2(); extents = new b2Vec2(); super(); } } }//package Box2D.Collision
Section 21
//b2Pair (Box2D.Collision.b2Pair) package Box2D.Collision { import Box2D.Common.*; public class b2Pair { public var proxyId1:uint; public var userData;// = null public var proxyId2:uint; public var status:uint; public var next:uint; public static var e_pairFinal:uint = 4; public static var b2_tableMask:int = (b2_tableCapacity - 1); public static var e_pairRemoved:uint = 2; public static var b2_nullPair:uint = b2Settings.USHRT_MAX; public static var e_pairBuffered:uint = 1; public static var b2_nullProxy:uint = b2Settings.USHRT_MAX; public static var b2_tableCapacity:int = b2Settings.b2_maxPairs; public function SetBuffered():void{ status = (status | e_pairBuffered); } public function IsBuffered():Boolean{ return (((status & e_pairBuffered) == e_pairBuffered)); } public function IsFinal():Boolean{ return (((status & e_pairFinal) == e_pairFinal)); } public function ClearRemoved():void{ status = (status & ~(e_pairRemoved)); } public function SetFinal():void{ status = (status | e_pairFinal); } public function IsRemoved():Boolean{ return (((status & e_pairRemoved) == e_pairRemoved)); } public function ClearBuffered():void{ status = (status & ~(e_pairBuffered)); } public function SetRemoved():void{ status = (status | e_pairRemoved); } } }//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback) package Box2D.Collision { public class b2PairCallback { public function PairRemoved(_arg1, _arg2, _arg3):void{ } public function PairAdded(_arg1, _arg2){ return (null); } } }//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2PairManager { public var m_pairCount:int; public var m_pairBuffer:Array; public var m_hashTable:Array; public var m_callback:b2PairCallback; public var m_pairs:Array; public var m_pairBufferCount:int; public var m_broadPhase:b2BroadPhase; public var m_freePair:uint; public function b2PairManager(){ var _local1:uint; super(); m_hashTable = new Array(b2Pair.b2_tableCapacity); _local1 = 0; while (_local1 < b2Pair.b2_tableCapacity) { m_hashTable[_local1] = b2Pair.b2_nullPair; _local1++; }; m_pairs = new Array(b2Settings.b2_maxPairs); _local1 = 0; while (_local1 < b2Settings.b2_maxPairs) { m_pairs[_local1] = new b2Pair(); _local1++; }; m_pairBuffer = new Array(b2Settings.b2_maxPairs); _local1 = 0; while (_local1 < b2Settings.b2_maxPairs) { m_pairBuffer[_local1] = new b2BufferedPair(); _local1++; }; _local1 = 0; while (_local1 < b2Settings.b2_maxPairs) { m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy; m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy; m_pairs[_local1].userData = null; m_pairs[_local1].status = 0; m_pairs[_local1].next = (_local1 + 1); _local1++; }; m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair; m_pairCount = 0; m_pairBufferCount = 0; } private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{ var _local4:b2Pair; var _local5:uint = m_hashTable[_arg3]; _local4 = m_pairs[_local5]; while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) { _local5 = _local4.next; _local4 = m_pairs[_local5]; }; if (_local5 == b2Pair.b2_nullPair){ return (null); }; return (_local4); } private function Find(_arg1:uint, _arg2:uint):b2Pair{ var _local4:uint; if (_arg1 > _arg2){ _local4 = _arg1; _arg1 = _arg2; _arg2 = _local4; }; var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask); return (FindHash(_arg1, _arg2, _local3)); } private function ValidateBuffer():void{ } public function Commit():void{ var _local1:b2BufferedPair; var _local2:int; var _local5:b2Pair; var _local6:b2Proxy; var _local7:b2Proxy; var _local3:int; var _local4:Array = m_broadPhase.m_proxyPool; _local2 = 0; while (_local2 < m_pairBufferCount) { _local1 = m_pairBuffer[_local2]; _local5 = Find(_local1.proxyId1, _local1.proxyId2); _local5.ClearBuffered(); _local6 = _local4[_local5.proxyId1]; _local7 = _local4[_local5.proxyId2]; if (_local5.IsRemoved()){ if (_local5.IsFinal() == true){ m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData); }; _local1 = m_pairBuffer[_local3]; _local1.proxyId1 = _local5.proxyId1; _local1.proxyId2 = _local5.proxyId2; _local3++; } else { if (_local5.IsFinal() == false){ _local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData); _local5.SetFinal(); }; }; _local2++; }; _local2 = 0; while (_local2 < _local3) { _local1 = m_pairBuffer[_local2]; RemovePair(_local1.proxyId1, _local1.proxyId2); _local2++; }; m_pairBufferCount = 0; if (b2BroadPhase.s_validate){ ValidateTable(); }; } public function RemoveBufferedPair(_arg1:int, _arg2:int):void{ var _local3:b2BufferedPair; var _local4:b2Pair = Find(_arg1, _arg2); if (_local4 == null){ return; }; if (_local4.IsBuffered() == false){ _local4.SetBuffered(); _local3 = m_pairBuffer[m_pairBufferCount]; _local3.proxyId1 = _local4.proxyId1; _local3.proxyId2 = _local4.proxyId2; m_pairBufferCount++; }; _local4.SetRemoved(); if (b2BroadPhase.s_validate){ ValidateBuffer(); }; } private function RemovePair(_arg1:uint, _arg2:uint){ var _local3:b2Pair; var _local7:uint; var _local8:uint; var _local9:*; if (_arg1 > _arg2){ _local7 = _arg1; _arg1 = _arg2; _arg2 = _local7; }; var _local4:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask); var _local5:uint = m_hashTable[_local4]; var _local6:b2Pair; while (_local5 != b2Pair.b2_nullPair) { if (Equals(m_pairs[_local5], _arg1, _arg2)){ _local8 = _local5; _local3 = m_pairs[_local5]; if (_local6){ _local6.next = _local3.next; } else { m_hashTable[_local4] = _local3.next; }; _local3 = m_pairs[_local8]; _local9 = _local3.userData; _local3.next = m_freePair; _local3.proxyId1 = b2Pair.b2_nullProxy; _local3.proxyId2 = b2Pair.b2_nullProxy; _local3.userData = null; _local3.status = 0; m_freePair = _local8; m_pairCount--; return (_local9); } else { _local6 = m_pairs[_local5]; _local5 = _local6.next; }; }; return (null); } public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{ m_broadPhase = _arg1; m_callback = _arg2; } public function AddBufferedPair(_arg1:int, _arg2:int):void{ var _local3:b2BufferedPair; var _local4:b2Pair = AddPair(_arg1, _arg2); if (_local4.IsBuffered() == false){ _local4.SetBuffered(); _local3 = m_pairBuffer[m_pairBufferCount]; _local3.proxyId1 = _local4.proxyId1; _local3.proxyId2 = _local4.proxyId2; m_pairBufferCount++; }; _local4.ClearRemoved(); if (b2BroadPhase.s_validate){ ValidateBuffer(); }; } private function AddPair(_arg1:uint, _arg2:uint):b2Pair{ var _local6:uint; if (_arg1 > _arg2){ _local6 = _arg1; _arg1 = _arg2; _arg2 = _local6; }; var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask); var _local4 = FindHash(_arg1, _arg2, _local3); if (_local4 != null){ return (_local4); }; var _local5:uint = m_freePair; _local4 = m_pairs[_local5]; m_freePair = _local4.next; _local4.proxyId1 = _arg1; _local4.proxyId2 = _arg2; _local4.status = 0; _local4.userData = null; _local4.next = m_hashTable[_local3]; m_hashTable[_local3] = _local5; m_pairCount++; return (_local4); } private function ValidateTable():void{ } public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{ return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2)))); } public static function Hash(_arg1:uint, _arg2:uint):uint{ var _local3:uint = (((_arg2 << 16) & 4294901760) | _arg1); _local3 = (~(_local3) + ((_local3 << 15) & 4294934528)); _local3 = (_local3 ^ ((_local3 >> 12) & 1048575)); _local3 = (_local3 + ((_local3 << 2) & 4294967292)); _local3 = (_local3 ^ ((_local3 >> 4) & 268435455)); _local3 = (_local3 * 2057); _local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF)); return (_local3); } public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{ return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3)))); } } }//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point) package Box2D.Collision { import Box2D.Common.Math.*; public class b2Point { public var p:b2Vec2; public function b2Point(){ p = new b2Vec2(); super(); } public function GetFirstVertex(_arg1:b2XForm):b2Vec2{ return (p); } public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{ return (p); } } }//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy) package Box2D.Collision { public class b2Proxy { public var overlapCount:uint; public var userData;// = null public var lowerBounds:Array; public var upperBounds:Array; public var timeStamp:uint; public function b2Proxy(){ lowerBounds = [uint(0), uint(0)]; upperBounds = [uint(0), uint(0)]; super(); } public function GetNext():uint{ return (lowerBounds[0]); } public function IsValid():Boolean{ return (!((overlapCount == b2BroadPhase.b2_invalid))); } public function SetNext(_arg1:uint):void{ lowerBounds[0] = (_arg1 & 0xFFFF); } } }//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2Segment { public var p1:b2Vec2; public var p2:b2Vec2; public function b2Segment(){ p1 = new b2Vec2(); p2 = new b2Vec2(); super(); } public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{ var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local5:b2Vec2 = _arg3.p1; var _local6:Number = (_arg3.p2.x - _local5.x); var _local7:Number = (_arg3.p2.y - _local5.y); var _local8:Number = (p2.x - p1.x); var _local9:Number = (p2.y - p1.y); var _local10:Number = _local9; var _local11:Number = -(_local8); var _local12:Number = (100 * Number.MIN_VALUE); var _local13:Number = -(((_local6 * _local10) + (_local7 * _local11))); if (_local13 > _local12){ _local14 = (_local5.x - p1.x); _local15 = (_local5.y - p1.y); _local16 = ((_local14 * _local10) + (_local15 * _local11)); if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){ _local17 = ((-(_local6) * _local15) + (_local7 * _local14)); if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){ _local16 = (_local16 / _local13); _local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11))); _local10 = (_local10 / _local18); _local11 = (_local11 / _local18); _arg1[0] = _local16; _arg2.Set(_local10, _local11); return (true); }; }; }; return (false); } } }//package Box2D.Collision
Section 27
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact) package Box2D.Collision { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Common.*; public class b2TimeOfImpact { public static var s_xf1:b2XForm = new b2XForm(); public static var s_xf2:b2XForm = new b2XForm(); public static var s_p1:b2Vec2 = new b2Vec2(); public static var s_p2:b2Vec2 = new b2Vec2(); public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{ var _local5:Number; var _local6:Number; var _local25:Number; var _local26:b2XForm; var _local27:b2XForm; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local7:Number = _arg1.m_sweepRadius; var _local8:Number = _arg3.m_sweepRadius; var _local9:Number = _arg2.t0; var _local10:Number = (_arg2.c.x - _arg2.c0.x); var _local11:Number = (_arg2.c.y - _arg2.c0.y); var _local12:Number = (_arg4.c.x - _arg4.c0.x); var _local13:Number = (_arg4.c.y - _arg4.c0.y); var _local14:Number = (_arg2.a - _arg2.a0); var _local15:Number = (_arg4.a - _arg4.a0); var _local16:Number = 0; var _local17:b2Vec2 = s_p1; var _local18:b2Vec2 = s_p2; var _local19 = 20; var _local20:int; var _local21:Number = 0; var _local22:Number = 0; var _local23:Number = 0; var _local24:Number = 0; while (true) { _local25 = (((1 - _local16) * _local9) + _local16); _local26 = s_xf1; _local27 = s_xf2; _arg2.GetXForm(_local26, _local25); _arg4.GetXForm(_local27, _local25); _local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27); if (_local20 == 0){ if (_local23 > (2 * b2Settings.b2_toiSlop)){ _local24 = (1.5 * b2Settings.b2_toiSlop); } else { _local5 = (0.05 * b2Settings.b2_toiSlop); _local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop)); _local24 = ((_local5 > _local6)) ? _local5 : _local6; }; }; if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){ break; }; _local21 = (_local18.x - _local17.x); _local22 = (_local18.y - _local17.y); _local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22))); _local21 = (_local21 / _local28); _local22 = (_local22 / _local28); _local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8)); if (_local29 == 0){ _local16 = 1; break; }; _local30 = ((_local23 - _local24) / _local29); _local31 = (_local16 + _local30); if ((((_local31 < 0)) || ((1 < _local31)))){ _local16 = 1; break; }; if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){ break; }; _local16 = _local31; _local20++; }; return (_local16); } } }//package Box2D.Collision
Section 28
//ClipVertex (Box2D.Collision.ClipVertex) package Box2D.Collision { import Box2D.Common.Math.*; public class ClipVertex { public var id:b2ContactID; public var v:b2Vec2; public function ClipVertex(){ v = new b2Vec2(); id = new b2ContactID(); super(); } } }//package Box2D.Collision
Section 29
//Features (Box2D.Collision.Features) package Box2D.Collision { public class Features { public var _referenceEdge:int; public var _incidentEdge:int; public var _flip:int; public var _incidentVertex:int; public var _m_id:b2ContactID; public function get referenceEdge():int{ return (_referenceEdge); } public function set incidentVertex(_arg1:int):void{ _incidentVertex = _arg1; _m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000)); } public function get flip():int{ return (_flip); } public function get incidentEdge():int{ return (_incidentEdge); } public function set referenceEdge(_arg1:int):void{ _referenceEdge = _arg1; _m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF)); } public function get incidentVertex():int{ return (_incidentVertex); } public function set flip(_arg1:int):void{ _flip = _arg1; _m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080)); } public function set incidentEdge(_arg1:int):void{ _incidentEdge = _arg1; _m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00)); } } }//package Box2D.Collision
Section 30
//b2Mat22 (Box2D.Common.Math.b2Mat22) package Box2D.Common.Math { public class b2Mat22 { public var col1:b2Vec2; public var col2:b2Vec2; public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){ var _local4:Number; var _local5:Number; col1 = new b2Vec2(); col2 = new b2Vec2(); super(); if (((!((_arg2 == null))) && (!((_arg3 == null))))){ col1.SetV(_arg2); col2.SetV(_arg3); } else { _local4 = Math.cos(_arg1); _local5 = Math.sin(_arg1); col1.x = _local4; col2.x = -(_local5); col1.y = _local5; col2.y = _local4; }; } public function SetIdentity():void{ col1.x = 1; col2.x = 0; col1.y = 0; col2.y = 1; } public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{ col1.SetV(_arg1); col2.SetV(_arg2); } public function Set(_arg1:Number):void{ var _local2:Number; _local2 = Math.cos(_arg1); var _local3:Number = Math.sin(_arg1); col1.x = _local2; col2.x = -(_local3); col1.y = _local3; col2.y = _local2; } public function SetZero():void{ col1.x = 0; col2.x = 0; col1.y = 0; col2.y = 0; } public function SetM(_arg1:b2Mat22):void{ col1.SetV(_arg1.col1); col2.SetV(_arg1.col2); } public function AddM(_arg1:b2Mat22):void{ col1.x = (col1.x + _arg1.col1.x); col1.y = (col1.y + _arg1.col1.y); col2.x = (col2.x + _arg1.col2.x); col2.y = (col2.y + _arg1.col2.y); } public function Abs():void{ col1.Abs(); col2.Abs(); } public function Copy():b2Mat22{ return (new b2Mat22(0, col1, col2)); } public function Invert(_arg1:b2Mat22):b2Mat22{ var _local2:Number; var _local4:Number; var _local6:Number; _local2 = col1.x; var _local3:Number = col2.x; _local4 = col1.y; var _local5:Number = col2.y; _local6 = ((_local2 * _local5) - (_local3 * _local4)); _local6 = (1 / _local6); _arg1.col1.x = (_local6 * _local5); _arg1.col2.x = (-(_local6) * _local3); _arg1.col1.y = (-(_local6) * _local4); _arg1.col2.y = (_local6 * _local2); return (_arg1); } public function GetAngle():Number{ return (Math.atan2(col1.y, col1.x)); } public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{ var _local4:Number = col1.x; var _local5:Number = col2.x; var _local6:Number = col1.y; var _local7:Number = col2.y; var _local8:Number = ((_local4 * _local7) - (_local5 * _local6)); _local8 = (1 / _local8); _arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3))); _arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2))); return (_arg1); } } }//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math) package Box2D.Common.Math { public class b2Math { public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1)); public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity); public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0); public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x)); return (_local3); } public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y)); return (_local3); } public static function b2IsValid(_arg1:Number):Boolean{ return (isFinite(_arg1)); } public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y)); return (_local3); } public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2; _local3 = b2MulMV(_arg1.R, _arg2); _local3.x = (_local3.x + _arg1.position.x); _local3.y = (_local3.y + _arg1.position.y); return (_local3); } public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{ var _local3:Number = (_arg1.x - _arg2.x); var _local4:Number = (_arg1.y - _arg2.y); return (((_local3 * _local3) + (_local4 * _local4))); } public static function b2Swap(_arg1:Array, _arg2:Array):void{ var _local3:* = _arg1[0]; _arg1[0] = _arg2[0]; _arg2[0] = _local3; } public static function b2AbsM(_arg1:b2Mat22):b2Mat22{ var _local2:b2Mat22 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2)); return (_local2); } public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)); return (_local3); } public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2; var _local4:Number; _local3 = SubtractVV(_arg2, _arg1.position); _local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y)); _local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y)); _local3.x = _local4; return (_local3); } public static function b2Abs(_arg1:Number):Number{ return (((_arg1 > 0)) ? _arg1 : -(_arg1)); } public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{ return (b2Max(_arg2, b2Min(_arg1, _arg3))); } public static function b2AbsV(_arg1:b2Vec2):b2Vec2{ var _local2:b2Vec2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y)); return (_local2); } public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y)); return (_local3); } public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{ return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))); } public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{ return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y))); } public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x)); return (_local3); } public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{ var _local3:b2Mat22 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2)); return (_local3); } public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{ var _local3:Number = (_arg1.x - _arg2.x); var _local4:Number = (_arg1.y - _arg2.y); return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4)))); } public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{ var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1)); var _local4:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2)); var _local5:b2Mat22 = new b2Mat22(0, _local3, _local4); return (_local5); } public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y)); return (_local3); } public static function b2IsPowerOfTwo(_arg1:uint):Boolean{ var _local2:Boolean = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0))); return (_local2); } public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{ return (b2MaxV(_arg2, b2MinV(_arg1, _arg3))); } public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{ var _local3:Number = Math.random(); _local3 = (((_arg2 - _arg1) * _local3) + _arg1); return (_local3); } public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2)); return (_local3); } public static function b2Min(_arg1:Number, _arg2:Number):Number{ return (((_arg1 < _arg2)) ? _arg1 : _arg2); } public static function b2Random():Number{ return (((Math.random() * 2) - 1)); } public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{ var _local3:b2Mat22 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2)); return (_local3); } public static function b2NextPowerOfTwo(_arg1:uint):uint{ _arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647)); _arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823)); _arg1 = (_arg1 | ((_arg1 >> 4) & 268435455)); _arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF)); _arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF)); return ((_arg1 + 1)); } public static function b2Max(_arg1:Number, _arg2:Number):Number{ return (((_arg1 > _arg2)) ? _arg1 : _arg2); } public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y))); return (_local3); } } }//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep) package Box2D.Common.Math { public class b2Sweep { public var localCenter:b2Vec2; public var a:Number; public var c:b2Vec2; public var a0:Number; public var c0:b2Vec2; public var t0:Number; public function b2Sweep(){ localCenter = new b2Vec2(); c0 = new b2Vec2(); c = new b2Vec2(); super(); } public function Advance(_arg1:Number):void{ var _local2:Number; if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){ _local2 = ((_arg1 - t0) / (1 - t0)); c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x)); c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y)); a0 = (((1 - _local2) * a0) + (_local2 * a)); t0 = _arg1; }; } public function GetXForm(_arg1:b2XForm, _arg2:Number):void{ var _local4:Number; var _local5:Number; if ((1 - t0) > Number.MIN_VALUE){ _local4 = ((_arg2 - t0) / (1 - t0)); _arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x)); _arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y)); _local5 = (((1 - _local4) * a0) + (_local4 * a)); _arg1.R.Set(_local5); } else { _arg1.position.SetV(c); _arg1.R.Set(a); }; var _local3:b2Mat22 = _arg1.R; _arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y))); _arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y))); } } }//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2) package Box2D.Common.Math { public class b2Vec2 { public var y:Number; public var x:Number; public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{ x = _arg1; y = _arg2; } public function Add(_arg1:b2Vec2):void{ x = (x + _arg1.x); y = (y + _arg1.y); } public function Set(_arg1:Number=0, _arg2:Number=0):void{ x = _arg1; y = _arg2; } public function Multiply(_arg1:Number):void{ x = (x * _arg1); y = (y * _arg1); } public function Length():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function LengthSquared():Number{ return (((x * x) + (y * y))); } public function MulM(_arg1:b2Mat22):void{ var _local2:Number = x; x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y)); y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y)); } public function SetZero():void{ x = 0; y = 0; } public function MinV(_arg1:b2Vec2):void{ x = ((x < _arg1.x)) ? x : _arg1.x; y = ((y < _arg1.y)) ? y : _arg1.y; } public function Normalize():Number{ var _local1:Number = Math.sqrt(((x * x) + (y * y))); if (_local1 < Number.MIN_VALUE){ return (0); }; var _local2:Number = (1 / _local1); x = (x * _local2); y = (y * _local2); return (_local1); } public function CrossVF(_arg1:Number):void{ var _local2:Number = x; x = (_arg1 * y); y = (-(_arg1) * _local2); } public function MaxV(_arg1:b2Vec2):void{ x = ((x > _arg1.x)) ? x : _arg1.x; y = ((y > _arg1.y)) ? y : _arg1.y; } public function SetV(_arg1:b2Vec2):void{ x = _arg1.x; y = _arg1.y; } public function Negative():b2Vec2{ return (new b2Vec2(-(x), -(y))); } public function CrossFV(_arg1:Number):void{ var _local2:Number = x; x = (-(_arg1) * y); y = (_arg1 * _local2); } public function Abs():void{ if (x < 0){ x = -(x); }; if (y < 0){ y = -(y); }; } public function Subtract(_arg1:b2Vec2):void{ x = (x - _arg1.x); y = (y - _arg1.y); } public function Copy():b2Vec2{ return (new b2Vec2(x, y)); } public function MulTM(_arg1:b2Mat22):void{ var _local2:Number = b2Math.b2Dot(this, _arg1.col1); y = b2Math.b2Dot(this, _arg1.col2); x = _local2; } public function IsValid():Boolean{ return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y)))); } public static function Make(_arg1:Number, _arg2:Number):b2Vec2{ return (new b2Vec2(_arg1, _arg2)); } } }//package Box2D.Common.Math
Section 34
//b2XForm (Box2D.Common.Math.b2XForm) package Box2D.Common.Math { public class b2XForm { public var position:b2Vec2; public var R:b2Mat22; public var scale:Number; 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); }; scale = 1; } public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{ position.SetV(_arg1); R.SetM(_arg2); } public function Set(_arg1:b2XForm):void{ position.SetV(_arg1.position); R.SetM(_arg1.R); } public function SetIdentity():void{ position.SetZero(); R.SetIdentity(); } } }//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color) package Box2D.Common { import Box2D.Common.Math.*; public class b2Color { private var _r:uint;// = 0 private var _g:uint;// = 0 private var _b:uint;// = 0 public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){ _r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); _g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1))); _b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1))); } public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{ _r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); _g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1))); _b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1))); } public function set b(_arg1:Number):void{ _b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); } public function get color():uint{ return (((_r | (_g << 8)) | (_b << 16))); } public function set r(_arg1:Number):void{ _r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); } public function set g(_arg1:Number):void{ _g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); } } }//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings) package Box2D.Common { import Box2D.Common.Math.*; public class b2Settings { public static const b2_angularSleepTolerance:Number = 0.0111111111111111; public static const b2_linearSleepTolerance:Number = 0.01; public static const b2_angularSlop:Number = 0.0349065850398866; public static const b2_linearSlop:Number = 0.005; public static const b2_pi:Number = 3.14159265358979; public static const b2_maxProxies:int = 0x0200; public static const b2_maxAngularVelocitySquared:Number = 62500; public static const b2_maxPolygonVertices:int = 8; public static const b2_velocityThreshold:Number = 1; public static const b2_contactBaumgarte:Number = 0.2; public static const b2_maxPairs:int = 4096; public static const b2_maxTOIContactsPerIsland:int = 32; public static const b2_timeToSleep:Number = 0.5; public static const b2_maxManifoldPoints:int = 2; public static const b2_maxAngularVelocity:Number = 250; public static const b2_maxAngularCorrection:Number = 0.139626340159546; public static const USHRT_MAX:int = 0xFFFF; public static const b2_maxLinearVelocity:Number = 200; public static const b2_maxLinearCorrection:Number = 0.2; public static const b2_toiSlop:Number = 0.04; public static const b2_maxLinearVelocitySquared:Number = 40000; public static function b2Assert(_arg1:Boolean):void{ var _local2:b2Vec2; if (!_arg1){ _local2.x++; }; } } }//package Box2D.Common
Section 37
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact) package Box2D.Dynamics.Contacts { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2CircleContact extends b2Contact { private var m_manifolds:Array; public var m_manifold:b2Manifold; private var m0:b2Manifold; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){ m_manifolds = [new b2Manifold()]; m0 = new b2Manifold(); super(_arg1, _arg2); m_manifold = m_manifolds[0]; m_manifold.pointCount = 0; var _local3:b2ManifoldPoint = m_manifold.points[0]; _local3.normalImpulse = 0; _local3.tangentImpulse = 0; } override public function Evaluate(_arg1:b2ContactListener):void{ var _local2:b2Vec2; var _local3:b2Vec2; var _local4:b2ManifoldPoint; var _local8:b2ManifoldPoint; var _local5:b2Body = m_shape1.m_body; var _local6:b2Body = m_shape2.m_body; m0.Set(m_manifold); b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf); var _local7:b2ContactPoint = s_evalCP; _local7.shape1 = m_shape1; _local7.shape2 = m_shape2; _local7.friction = m_friction; _local7.restitution = m_restitution; if (m_manifold.pointCount > 0){ m_manifoldCount = 1; _local8 = m_manifold.points[0]; if (m0.pointCount == 0){ _local8.normalImpulse = 0; _local8.tangentImpulse = 0; if (_arg1){ _local7.position = _local5.GetWorldPoint(_local8.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local8.separation; _local7.id.key = _local8.id._key; _arg1.Add(_local7); }; } else { _local4 = m0.points[0]; _local8.normalImpulse = _local4.normalImpulse; _local8.tangentImpulse = _local4.tangentImpulse; if (_arg1){ _local7.position = _local5.GetWorldPoint(_local8.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local8.separation; _local7.id.key = _local8.id._key; _arg1.Persist(_local7); }; }; } else { m_manifoldCount = 0; if ((((m0.pointCount > 0)) && (_arg1))){ _local4 = m0.points[0]; _local7.position = _local5.GetWorldPoint(_local4.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m0.normal); _local7.separation = _local4.separation; _local7.id.key = _local4.id._key; _arg1.Remove(_local7); }; }; } override public function GetManifolds():Array{ return (m_manifolds); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2CircleContact(_arg1, _arg2)); } } }//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact) package Box2D.Dynamics.Contacts { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2Contact { public var m_shape1:b2Shape; public var m_shape2:b2Shape; public var m_prev:b2Contact; public var m_toi:Number; public var m_next:b2Contact; public var m_friction:Number; public var m_manifoldCount:int; public var m_node1:b2ContactEdge; public var m_node2:b2ContactEdge; public var m_restitution:Number; public var m_flags:uint; public static var e_toiFlag:uint = 8; public static var e_nonSolidFlag:uint = 1; public static var e_slowFlag:uint = 2; public static var e_islandFlag:uint = 4; public static var s_registers:Array; public static var s_initialized:Boolean = false; public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){ m_node1 = new b2ContactEdge(); m_node2 = new b2ContactEdge(); super(); m_flags = 0; if (((!(_arg1)) || (!(_arg2)))){ m_shape1 = null; m_shape2 = null; return; }; if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){ m_flags = (m_flags | e_nonSolidFlag); }; m_shape1 = _arg1; m_shape2 = _arg2; m_manifoldCount = 0; m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction)); m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution); m_prev = null; m_next = null; m_node1.contact = null; m_node1.prev = null; m_node1.next = null; m_node1.other = null; m_node2.contact = null; m_node2.prev = null; m_node2.next = null; m_node2.other = null; } public function IsSolid():Boolean{ return (((m_flags & e_nonSolidFlag) == 0)); } public function GetShape1():b2Shape{ return (m_shape1); } public function GetShape2():b2Shape{ return (m_shape2); } public function GetNext():b2Contact{ return (m_next); } public function GetManifoldCount():int{ return (m_manifoldCount); } public function GetManifolds():Array{ return (null); } public function Update(_arg1:b2ContactListener):void{ var _local2:int = m_manifoldCount; Evaluate(_arg1); var _local3:int = m_manifoldCount; var _local4:b2Body = m_shape1.m_body; var _local5:b2Body = m_shape2.m_body; if ((((_local3 == 0)) && ((_local2 > 0)))){ _local4.WakeUp(); _local5.WakeUp(); }; if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){ m_flags = (m_flags & ~(e_slowFlag)); } else { m_flags = (m_flags | e_slowFlag); }; } public function Evaluate(_arg1:b2ContactListener):void{ } public static function InitializeRegisters():void{ var _local2:int; s_registers = new Array(b2Shape.e_shapeTypeCount); var _local1:int; while (_local1 < b2Shape.e_shapeTypeCount) { s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount); _local2 = 0; while (_local2 < b2Shape.e_shapeTypeCount) { s_registers[_local1][_local2] = new b2ContactRegister(); _local2++; }; _local1++; }; AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape); AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape); AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape); } public static function Destroy(_arg1:b2Contact, _arg2):void{ if (_arg1.m_manifoldCount > 0){ _arg1.m_shape1.m_body.WakeUp(); _arg1.m_shape2.m_body.WakeUp(); }; var _local3:int = _arg1.m_shape1.m_type; var _local4:int = _arg1.m_shape2.m_type; var _local5:b2ContactRegister = s_registers[_local3][_local4]; var _local6:Function = _local5.destroyFcn; _local6(_arg1, _arg2); } public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{ s_registers[_arg3][_arg4].createFcn = _arg1; s_registers[_arg3][_arg4].destroyFcn = _arg2; s_registers[_arg3][_arg4].primary = true; if (_arg3 != _arg4){ s_registers[_arg4][_arg3].createFcn = _arg1; s_registers[_arg4][_arg3].destroyFcn = _arg2; s_registers[_arg4][_arg3].primary = false; }; } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ var _local8:b2Contact; var _local9:int; var _local10:b2Manifold; if (s_initialized == false){ InitializeRegisters(); s_initialized = true; }; var _local4:int = _arg1.m_type; var _local5:int = _arg2.m_type; var _local6:b2ContactRegister = s_registers[_local4][_local5]; var _local7:Function = _local6.createFcn; if (_local7 != null){ if (_local6.primary){ return (_local7(_arg1, _arg2, _arg3)); }; _local8 = _local7(_arg2, _arg1, _arg3); _local9 = 0; while (_local9 < _local8.m_manifoldCount) { _local10 = _local8.GetManifolds()[_local9]; _local8.GetManifolds()[_local9].normal = _local10.normal.Negative(); _local9++; }; return (_local8); //unresolved jump }; return (null); } } }//package Box2D.Dynamics.Contacts
Section 39
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2ContactConstraint { public var points:Array; public var normal:b2Vec2; public var restitution:Number; public var body1:b2Body; public var manifold:b2Manifold; public var body2:b2Body; public var friction:Number; public var pointCount:int; public function b2ContactConstraint(){ normal = new b2Vec2(); super(); points = new Array(b2Settings.b2_maxManifoldPoints); var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { points[_local1] = new b2ContactConstraintPoint(); _local1++; }; } } }//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; public class b2ContactConstraintPoint { public var r2:b2Vec2; public var separation:Number; public var positionImpulse:Number; public var normalImpulse:Number; public var tangentMass:Number; public var equalizedMass:Number; public var tangentImpulse:Number; public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var normalMass:Number; public var velocityBias:Number; public var r1:b2Vec2; public function b2ContactConstraintPoint(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); r1 = new b2Vec2(); r2 = new b2Vec2(); super(); } } }//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge) package Box2D.Dynamics.Contacts { import Box2D.Dynamics.*; public class b2ContactEdge { public var other:b2Body; public var prev:b2ContactEdge; public var contact:b2Contact; public var next:b2ContactEdge; } }//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister) package Box2D.Dynamics.Contacts { public class b2ContactRegister { public var primary:Boolean; public var createFcn:Function; public var destroyFcn:Function; } }//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult) package Box2D.Dynamics.Contacts { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Collision.*; public class b2ContactResult { public var position:b2Vec2; public var shape1:b2Shape; public var shape2:b2Shape; public var normalImpulse:Number; public var normal:b2Vec2; public var tangentImpulse:Number; public var id:b2ContactID; public function b2ContactResult(){ position = new b2Vec2(); normal = new b2Vec2(); id = new b2ContactID(); super(); } } }//package Box2D.Dynamics.Contacts
Section 44
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2ContactSolver { public var m_constraintCount:int; public var m_constraints:Array; public var m_allocator; public var m_step:b2TimeStep; public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){ var _local5:b2Contact; var _local6:int; var _local7:b2Vec2; var _local8:b2Mat22; var _local10:b2Body; var _local11:b2Body; var _local12:int; var _local13:Array; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:int; var _local23:b2Manifold; var _local24:Number; var _local25:Number; var _local26:b2ContactConstraint; var _local27:uint; var _local28:b2ManifoldPoint; var _local29:b2ContactConstraintPoint; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:Number; var _local38:Number; var _local39:Number; var _local40:Number; var _local41:Number; var _local42:Number; var _local43:Number; var _local44:Number; var _local45:Number; var _local46:Number; var _local47:Number; m_step = new b2TimeStep(); m_constraints = new Array(); super(); m_step.dt = _arg1.dt; m_step.inv_dt = _arg1.inv_dt; m_step.maxIterations = _arg1.maxIterations; m_allocator = _arg4; m_constraintCount = 0; _local6 = 0; while (_local6 < _arg3) { _local5 = _arg2[_local6]; m_constraintCount = (m_constraintCount + _local5.m_manifoldCount); _local6++; }; _local6 = 0; while (_local6 < m_constraintCount) { m_constraints[_local6] = new b2ContactConstraint(); _local6++; }; var _local9:int; _local6 = 0; while (_local6 < _arg3) { _local5 = _arg2[_local6]; _local10 = _local5.m_shape1.m_body; _local11 = _local5.m_shape2.m_body; _local12 = _local5.m_manifoldCount; _local13 = _local5.GetManifolds(); _local14 = _local5.m_friction; _local15 = _local5.m_restitution; _local16 = _local10.m_linearVelocity.x; _local17 = _local10.m_linearVelocity.y; _local18 = _local11.m_linearVelocity.x; _local19 = _local11.m_linearVelocity.y; _local20 = _local10.m_angularVelocity; _local21 = _local11.m_angularVelocity; _local22 = 0; while (_local22 < _local12) { _local23 = _local13[_local22]; _local24 = _local23.normal.x; _local25 = _local23.normal.y; _local26 = m_constraints[_local9]; _local26.body1 = _local10; _local26.body2 = _local11; _local26.manifold = _local23; _local26.normal.x = _local24; _local26.normal.y = _local25; _local26.pointCount = _local23.pointCount; _local26.friction = _local14; _local26.restitution = _local15; _local27 = 0; while (_local27 < _local26.pointCount) { _local28 = _local23.points[_local27]; _local29 = _local26.points[_local27]; _local29.normalImpulse = _local28.normalImpulse; _local29.tangentImpulse = _local28.tangentImpulse; _local29.separation = _local28.separation; _local29.positionImpulse = 0; _local29.localAnchor1.SetV(_local28.localPoint1); _local29.localAnchor2.SetV(_local28.localPoint2); _local8 = _local10.m_xf.R; _local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x); _local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y); _local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33)); _local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33)); _local32 = _local30; _local29.r1.Set(_local32, _local33); _local8 = _local11.m_xf.R; _local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x); _local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y); _local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35)); _local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35)); _local34 = _local30; _local29.r2.Set(_local34, _local35); _local36 = ((_local32 * _local32) + (_local33 * _local33)); _local37 = ((_local34 * _local34) + (_local35 * _local35)); _local38 = ((_local32 * _local24) + (_local33 * _local25)); _local39 = ((_local34 * _local24) + (_local35 * _local25)); _local40 = (_local10.m_invMass + _local11.m_invMass); _local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39))))); _local29.normalMass = (1 / _local40); _local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass)); _local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39))))); _local29.equalizedMass = (1 / _local41); _local42 = _local25; _local43 = -(_local24); _local44 = ((_local32 * _local42) + (_local33 * _local43)); _local45 = ((_local34 * _local42) + (_local35 * _local43)); _local46 = (_local10.m_invMass + _local11.m_invMass); _local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45))))); _local29.tangentMass = (1 / _local46); _local29.velocityBias = 0; if (_local29.separation > 0){ _local29.velocityBias = (-60 * _local29.separation); }; _local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33)); _local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32)); _local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31)); if (_local47 < -(b2Settings.b2_velocityThreshold)){ _local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47)); }; _local27++; }; _local9++; _local22++; }; _local6++; }; } public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Vec2; var _local3:b2Vec2; var _local4:b2Mat22; var _local6:b2ContactConstraint; var _local7:b2Body; var _local8:b2Body; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:int; var _local19:int; var _local20:b2ContactConstraintPoint; var _local21:Number; var _local22:Number; var _local23:b2ContactConstraintPoint; var _local5:int; while (_local5 < m_constraintCount) { _local6 = m_constraints[_local5]; _local7 = _local6.body1; _local8 = _local6.body2; _local9 = _local7.m_invMass; _local10 = _local7.m_invI; _local11 = _local8.m_invMass; _local12 = _local8.m_invI; _local13 = _local6.normal.x; _local14 = _local6.normal.y; _local15 = _local14; _local16 = -(_local13); if (_arg1.warmStarting){ _local19 = _local6.pointCount; _local18 = 0; while (_local18 < _local19) { _local20 = _local6.points[_local18]; _local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio); _local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio); _local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15)); _local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16)); _local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21)))); _local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21)); _local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22)); _local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21)))); _local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21)); _local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22)); _local18++; }; } else { _local19 = _local6.pointCount; _local18 = 0; while (_local18 < _local19) { _local23 = _local6.points[_local18]; _local23.normalImpulse = 0; _local23.tangentImpulse = 0; _local18++; }; }; _local5++; }; } public function SolvePositionConstraints(_arg1:Number):Boolean{ var _local3:b2Mat22; var _local4:b2Vec2; var _local6:b2ContactConstraint; var _local7:b2Body; var _local8:b2Body; var _local9:b2Vec2; var _local10:Number; var _local11:b2Vec2; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:int; var _local20:int; var _local21:b2ContactConstraintPoint; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:Number; var _local38:Number; var _local2:Number = 0; var _local5:int; while (_local5 < m_constraintCount) { _local6 = m_constraints[_local5]; _local7 = _local6.body1; _local8 = _local6.body2; _local9 = _local7.m_sweep.c; _local10 = _local7.m_sweep.a; _local11 = _local8.m_sweep.c; _local12 = _local8.m_sweep.a; _local13 = (_local7.m_mass * _local7.m_invMass); _local14 = (_local7.m_mass * _local7.m_invI); _local15 = (_local8.m_mass * _local8.m_invMass); _local16 = (_local8.m_mass * _local8.m_invI); _local17 = _local6.normal.x; _local18 = _local6.normal.y; _local19 = _local6.pointCount; _local20 = 0; while (_local20 < _local19) { _local21 = _local6.points[_local20]; _local3 = _local7.m_xf.R; _local4 = _local7.m_sweep.localCenter; _local22 = (_local21.localAnchor1.x - _local4.x); _local23 = (_local21.localAnchor1.y - _local4.y); _local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23)); _local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23)); _local22 = _local26; _local3 = _local8.m_xf.R; _local4 = _local8.m_sweep.localCenter; _local24 = (_local21.localAnchor2.x - _local4.x); _local25 = (_local21.localAnchor2.y - _local4.y); _local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25)); _local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25)); _local24 = _local26; _local27 = (_local9.x + _local22); _local28 = (_local9.y + _local23); _local29 = (_local11.x + _local24); _local30 = (_local11.y + _local25); _local31 = (_local29 - _local27); _local32 = (_local30 - _local28); _local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation); _local2 = b2Math.b2Min(_local2, _local33); _local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0)); _local35 = (-(_local21.equalizedMass) * _local34); _local36 = _local21.positionImpulse; _local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0); _local35 = (_local21.positionImpulse - _local36); _local37 = (_local35 * _local17); _local38 = (_local35 * _local18); _local9.x = (_local9.x - (_local13 * _local37)); _local9.y = (_local9.y - (_local13 * _local38)); _local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37)))); _local7.m_sweep.a = _local10; _local7.SynchronizeTransform(); _local11.x = (_local11.x + (_local15 * _local37)); _local11.y = (_local11.y + (_local15 * _local38)); _local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37)))); _local8.m_sweep.a = _local12; _local8.SynchronizeTransform(); _local20++; }; _local5++; }; return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop))); } public function SolveVelocityConstraints():void{ var _local1:int; var _local2:b2ContactConstraintPoint; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:b2Mat22; var _local18:b2Vec2; var _local20:b2ContactConstraint; var _local21:b2Body; var _local22:b2Body; var _local23:Number; var _local24:Number; var _local25:b2Vec2; var _local26:b2Vec2; var _local27:Number; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:int; var _local38:Number; var _local19:int; while (_local19 < m_constraintCount) { _local20 = m_constraints[_local19]; _local21 = _local20.body1; _local22 = _local20.body2; _local23 = _local21.m_angularVelocity; _local24 = _local22.m_angularVelocity; _local25 = _local21.m_linearVelocity; _local26 = _local22.m_linearVelocity; _local27 = _local21.m_invMass; _local28 = _local21.m_invI; _local29 = _local22.m_invMass; _local30 = _local22.m_invI; _local31 = _local20.normal.x; _local32 = _local20.normal.y; _local33 = _local32; _local34 = -(_local31); _local35 = _local20.friction; _local37 = _local20.pointCount; _local1 = 0; while (_local1 < _local37) { _local2 = _local20.points[_local1]; _local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y)); _local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x)); _local9 = ((_local7 * _local31) + (_local8 * _local32)); _local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias)); _local10 = ((_local7 * _local33) + (_local8 * _local34)); _local12 = (_local2.tangentMass * -(_local10)); _local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0); _local11 = (_local13 - _local2.normalImpulse); _local38 = (_local35 * _local2.normalImpulse); _local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38); _local12 = (_local14 - _local2.tangentImpulse); _local15 = ((_local11 * _local31) + (_local12 * _local33)); _local16 = ((_local11 * _local32) + (_local12 * _local34)); _local25.x = (_local25.x - (_local27 * _local15)); _local25.y = (_local25.y - (_local27 * _local16)); _local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15)))); _local26.x = (_local26.x + (_local29 * _local15)); _local26.y = (_local26.y + (_local29 * _local16)); _local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15)))); _local2.normalImpulse = _local13; _local2.tangentImpulse = _local14; _local1++; }; _local21.m_angularVelocity = _local23; _local22.m_angularVelocity = _local24; _local19++; }; } public function FinalizeVelocityConstraints():void{ var _local2:b2ContactConstraint; var _local3:b2Manifold; var _local4:int; var _local5:b2ManifoldPoint; var _local6:b2ContactConstraintPoint; var _local1:int; while (_local1 < m_constraintCount) { _local2 = m_constraints[_local1]; _local3 = _local2.manifold; _local4 = 0; while (_local4 < _local2.pointCount) { _local5 = _local3.points[_local4]; _local6 = _local2.points[_local4]; _local5.normalImpulse = _local6.normalImpulse; _local5.tangentImpulse = _local6.tangentImpulse; _local4++; }; _local1++; }; } } }//package Box2D.Dynamics.Contacts
Section 45
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact) package Box2D.Dynamics.Contacts { import Box2D.Dynamics.*; public class b2NullContact extends b2Contact { override public function Evaluate(_arg1:b2ContactListener):void{ } override public function GetManifolds():Array{ return (null); } } }//package Box2D.Dynamics.Contacts
Section 46
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact) package Box2D.Dynamics.Contacts { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2PolyAndCircleContact extends b2Contact { private var m_manifolds:Array; public var m_manifold:b2Manifold; private var m0:b2Manifold; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){ m_manifolds = [new b2Manifold()]; m0 = new b2Manifold(); super(_arg1, _arg2); m_manifold = m_manifolds[0]; b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape)); b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape)); m_manifold.pointCount = 0; var _local3:b2ManifoldPoint = m_manifold.points[0]; _local3.normalImpulse = 0; _local3.tangentImpulse = 0; } override public function Evaluate(_arg1:b2ContactListener):void{ var _local2:int; var _local3:b2Vec2; var _local4:b2Vec2; var _local5:b2ManifoldPoint; var _local10:b2ManifoldPoint; var _local11:Boolean; var _local12:uint; var _local13:int; var _local6:b2Body = m_shape1.m_body; var _local7:b2Body = m_shape2.m_body; m0.Set(m_manifold); b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf); var _local8:Array = [false, false]; var _local9:b2ContactPoint = s_evalCP; _local9.shape1 = m_shape1; _local9.shape2 = m_shape2; _local9.friction = m_friction; _local9.restitution = m_restitution; if (m_manifold.pointCount > 0){ _local2 = 0; while (_local2 < m_manifold.pointCount) { _local10 = m_manifold.points[_local2]; _local10.normalImpulse = 0; _local10.tangentImpulse = 0; _local11 = false; _local12 = _local10.id._key; _local13 = 0; while (_local13 < m0.pointCount) { if (_local8[_local13] == true){ } else { _local5 = m0.points[_local13]; if (_local5.id._key == _local12){ _local8[_local13] = true; _local10.normalImpulse = _local5.normalImpulse; _local10.tangentImpulse = _local5.tangentImpulse; _local11 = true; if (_arg1 != null){ _local9.position = _local6.GetWorldPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y)); _local9.normal.SetV(m_manifold.normal); _local9.separation = _local10.separation; _local9.id.key = _local12; _arg1.Persist(_local9); }; break; }; }; _local13++; }; if ((((_local11 == false)) && (!((_arg1 == null))))){ _local9.position = _local6.GetWorldPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y)); _local9.normal.SetV(m_manifold.normal); _local9.separation = _local10.separation; _local9.id.key = _local12; _arg1.Add(_local9); }; _local2++; }; m_manifoldCount = 1; } else { m_manifoldCount = 0; }; if (_arg1 == null){ return; }; _local2 = 0; while (_local2 < m0.pointCount) { if (_local8[_local2]){ } else { _local5 = m0.points[_local2]; _local9.position = _local6.GetWorldPoint(_local5.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1); _local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2); _local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y)); _local9.normal.SetV(m0.normal); _local9.separation = _local5.separation; _local9.id.key = _local5.id._key; _arg1.Remove(_local9); }; _local2++; }; } override public function GetManifolds():Array{ return (m_manifolds); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2PolyAndCircleContact(_arg1, _arg2)); } } }//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact) package Box2D.Dynamics.Contacts { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import Box2D.Common.*; public class b2PolygonContact extends b2Contact { private var m_manifolds:Array; private var m0:b2Manifold; public var m_manifold:b2Manifold; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{ m0 = new b2Manifold(); m_manifolds = [new b2Manifold()]; super(_arg1, _arg2); m_manifold = m_manifolds[0]; m_manifold.pointCount = 0; } override public function Evaluate(_arg1:b2ContactListener):void{ var _local2:b2Vec2; var _local3:b2Vec2; var _local4:b2ManifoldPoint; var _local7:b2ContactPoint; var _local8:int; var _local10:b2ManifoldPoint; var _local11:Boolean; var _local12:uint; var _local13:int; var _local5:b2Body = m_shape1.m_body; var _local6:b2Body = m_shape2.m_body; m0.Set(m_manifold); b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf); var _local9:Array = [false, false]; _local7 = s_evalCP; _local7.shape1 = m_shape1; _local7.shape2 = m_shape2; _local7.friction = m_friction; _local7.restitution = m_restitution; if (m_manifold.pointCount > 0){ _local8 = 0; while (_local8 < m_manifold.pointCount) { _local10 = m_manifold.points[_local8]; _local10.normalImpulse = 0; _local10.tangentImpulse = 0; _local11 = false; _local12 = _local10.id._key; _local13 = 0; while (_local13 < m0.pointCount) { if (_local9[_local13] == true){ } else { _local4 = m0.points[_local13]; if (_local4.id._key == _local12){ _local9[_local13] = true; _local10.normalImpulse = _local4.normalImpulse; _local10.tangentImpulse = _local4.tangentImpulse; _local11 = true; if (_arg1 != null){ _local7.position = _local5.GetWorldPoint(_local10.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local10.separation; _local7.id.key = _local12; _arg1.Persist(_local7); }; break; }; }; _local13++; }; if ((((_local11 == false)) && (!((_arg1 == null))))){ _local7.position = _local5.GetWorldPoint(_local10.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local10.separation; _local7.id.key = _local12; _arg1.Add(_local7); }; _local8++; }; m_manifoldCount = 1; } else { m_manifoldCount = 0; }; if (_arg1 == null){ return; }; _local8 = 0; while (_local8 < m0.pointCount) { if (_local9[_local8]){ } else { _local4 = m0.points[_local8]; _local7.position = _local5.GetWorldPoint(_local4.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m0.normal); _local7.separation = _local4.separation; _local7.id.key = _local4.id._key; _arg1.Remove(_local7); }; _local8++; }; } override public function GetManifolds():Array{ return (m_manifolds); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2PolygonContact(_arg1, _arg2)); } } }//package Box2D.Dynamics.Contacts
Section 48
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2DistanceJoint extends b2Joint { public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_bias:Number; public var m_gamma:Number; public var m_u:b2Vec2; public var m_mass:Number; public var m_impulse:Number; public var m_dampingRatio:Number; public var m_frequencyHz:Number; public var m_length:Number; public function b2DistanceJoint(_arg1:b2DistanceJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_u = new b2Vec2(); super(_arg1); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_length = _arg1.length; m_frequencyHz = _arg1.frequencyHz; m_dampingRatio = _arg1.dampingRatio; m_impulse = 0; m_gamma = 0; m_bias = 0; m_inv_dt = 0; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Mat22; var _local3:Number; var _local4:b2Body; var _local5:b2Body; var _local6:Number; var _local8:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; m_inv_dt = _arg1.inv_dt; _local4 = m_body1; _local5 = m_body2; _local2 = _local4.m_xf.R; _local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor1.y - _local4.m_sweep.localCenter.y); _local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7)); _local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7)); _local6 = _local3; _local2 = _local5.m_xf.R; _local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local5.m_sweep.localCenter.y); _local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9)); _local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9)); _local8 = _local3; m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6); m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7); var _local10:Number = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y))); if (_local10 > b2Settings.b2_linearSlop){ m_u.Multiply((1 / _local10)); } else { m_u.SetZero(); }; var _local11:Number = ((_local6 * m_u.y) - (_local7 * m_u.x)); var _local12:Number = ((_local8 * m_u.y) - (_local9 * m_u.x)); var _local13:Number = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12)); m_mass = (1 / _local13); if (m_frequencyHz > 0){ _local14 = (_local10 - m_length); _local15 = ((2 * Math.PI) * m_frequencyHz); _local16 = (((2 * m_mass) * m_dampingRatio) * _local15); _local17 = ((m_mass * _local15) * _local15); m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17)))); m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma); m_mass = (1 / (_local13 + m_gamma)); }; if (_arg1.warmStarting){ m_impulse = (m_impulse * _arg1.dtRatio); _local18 = (m_impulse * m_u.x); _local19 = (m_impulse * m_u.y); _local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18)); _local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19)); _local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18)))); _local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18)); _local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19)); _local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18)))); } else { m_impulse = 0; }; } override public function GetReactionTorque():Number{ return (0); } override public function GetReactionForce():b2Vec2{ var _local1:b2Vec2 = new b2Vec2(); _local1.SetV(m_u); _local1.Multiply((m_inv_dt * m_impulse)); return (_local1); } override public function SolvePositionConstraints():Boolean{ var _local1:b2Mat22; if (m_frequencyHz > 0){ return (true); }; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local1 = _local2.m_xf.R; var _local4:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local5:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); var _local6:Number = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5)); _local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5)); _local4 = _local6; _local1 = _local3.m_xf.R; var _local7:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local8:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8)); _local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8)); _local7 = _local6; var _local9:Number = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4); var _local10:Number = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5); var _local11:Number = Math.sqrt(((_local9 * _local9) + (_local10 * _local10))); _local9 = (_local9 / _local11); _local10 = (_local10 / _local11); var _local12:Number = (_local11 - m_length); _local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); var _local13:Number = (-(m_mass) * _local12); m_u.Set(_local9, _local10); var _local14:Number = (_local13 * m_u.x); var _local15:Number = (_local13 * m_u.y); _local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15)); _local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14)))); _local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15)); _local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14)))); _local2.SynchronizeTransform(); _local3.SynchronizeTransform(); return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop)); } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Mat22; var _local3:b2Body = m_body1; var _local4:b2Body = m_body2; _local2 = _local3.m_xf.R; var _local5:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); var _local6:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); var _local7:Number = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6)); _local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6)); _local5 = _local7; _local2 = _local4.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9)); _local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9)); _local8 = _local7; var _local10:Number = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6)); var _local11:Number = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5)); var _local12:Number = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9)); var _local13:Number = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8)); var _local14:Number = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11))); var _local15:Number = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse))); m_impulse = (m_impulse + _local15); var _local16:Number = (_local15 * m_u.x); var _local17:Number = (_local15 * m_u.y); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17)); _local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16)))); _local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16)); _local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17)); _local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16)))); } } }//package Box2D.Dynamics.Joints
Section 49
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2DistanceJointDef extends b2JointDef { public var localAnchor1:b2Vec2; public var length:Number; public var dampingRatio:Number; public var localAnchor2:b2Vec2; public var frequencyHz:Number; public function b2DistanceJointDef(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); super(); type = b2Joint.e_distanceJoint; length = 1; frequencyHz = 0; dampingRatio = 0; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{ body1 = _arg1; body2 = _arg2; localAnchor1.SetV(body1.GetLocalPoint(_arg3)); localAnchor2.SetV(body2.GetLocalPoint(_arg4)); var _local5:Number = (_arg4.x - _arg3.x); var _local6:Number = (_arg4.y - _arg3.y); length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6))); frequencyHz = 0; dampingRatio = 0; } } }//package Box2D.Dynamics.Joints
Section 50
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2GearJoint extends b2Joint { public var m_ground2:b2Body; public var m_groundAnchor1:b2Vec2; public var m_groundAnchor2:b2Vec2; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_ratio:Number; public var m_revolute2:b2RevoluteJoint; public var m_force:Number; public var m_mass:Number; public var m_prismatic2:b2PrismaticJoint; public var m_ground1:b2Body; public var m_revolute1:b2RevoluteJoint; public var m_prismatic1:b2PrismaticJoint; public var m_constant:Number; public var m_J:b2Jacobian; public function b2GearJoint(_arg1:b2GearJointDef){ var _local4:Number; var _local5:Number; m_groundAnchor1 = new b2Vec2(); m_groundAnchor2 = new b2Vec2(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_J = new b2Jacobian(); super(_arg1); var _local2:int = _arg1.joint1.m_type; var _local3:int = _arg1.joint2.m_type; m_revolute1 = null; m_prismatic1 = null; m_revolute2 = null; m_prismatic2 = null; m_ground1 = _arg1.joint1.m_body1; m_body1 = _arg1.joint1.m_body2; if (_local2 == b2Joint.e_revoluteJoint){ m_revolute1 = (_arg1.joint1 as b2RevoluteJoint); m_groundAnchor1.SetV(m_revolute1.m_localAnchor1); m_localAnchor1.SetV(m_revolute1.m_localAnchor2); _local4 = m_revolute1.GetJointAngle(); } else { m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint); m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1); m_localAnchor1.SetV(m_prismatic1.m_localAnchor2); _local4 = m_prismatic1.GetJointTranslation(); }; m_ground2 = _arg1.joint2.m_body1; m_body2 = _arg1.joint2.m_body2; if (_local3 == b2Joint.e_revoluteJoint){ m_revolute2 = (_arg1.joint2 as b2RevoluteJoint); m_groundAnchor2.SetV(m_revolute2.m_localAnchor1); m_localAnchor2.SetV(m_revolute2.m_localAnchor2); _local5 = m_revolute2.GetJointAngle(); } else { m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint); m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1); m_localAnchor2.SetV(m_prismatic2.m_localAnchor2); _local5 = m_prismatic2.GetJointTranslation(); }; m_ratio = _arg1.ratio; m_constant = (_local4 + (m_ratio * _local5)); m_force = 0; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:b2Mat22; var _local11:b2Vec2; var _local12:Number; var _local13:Number; var _local15:Number; var _local2:b2Body = m_ground1; var _local3:b2Body = m_ground2; var _local4:b2Body = m_body1; var _local5:b2Body = m_body2; var _local14:Number = 0; m_J.SetZero(); if (m_revolute1){ m_J.angular1 = -1; _local14 = (_local14 + _local4.m_invI); } else { _local10 = _local2.m_xf.R; _local11 = m_prismatic1.m_localXAxis1; _local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y)); _local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y)); _local10 = _local4.m_xf.R; _local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x); _local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y); _local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9)); _local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9)); _local8 = _local13; _local12 = ((_local8 * _local7) - (_local9 * _local6)); m_J.linear1.Set(-(_local6), -(_local7)); m_J.angular1 = -(_local12); _local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12))); }; if (m_revolute2){ m_J.angular2 = -(m_ratio); _local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI)); } else { _local10 = _local3.m_xf.R; _local11 = m_prismatic2.m_localXAxis1; _local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y)); _local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y)); _local10 = _local5.m_xf.R; _local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x); _local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y); _local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9)); _local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9)); _local8 = _local13; _local12 = ((_local8 * _local7) - (_local9 * _local6)); m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7)); m_J.angular2 = (-(m_ratio) * _local12); _local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12)))); }; m_mass = (1 / _local14); if (_arg1.warmStarting){ _local15 = (_arg1.dt * m_force); _local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x)); _local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y)); _local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1)); _local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x)); _local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y)); _local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2)); } else { m_force = 0; }; } override public function GetReactionTorque():Number{ var _local1:b2Mat22 = m_body2.m_xf.R; var _local2:Number = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x); var _local3:Number = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y); var _local4:Number = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3)); _local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3)); _local2 = _local4; _local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x)))); return (_local4); } override public function GetReactionForce():b2Vec2{ var _local1:b2Vec2 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y)); return (_local1); } override public function SolvePositionConstraints():Boolean{ var _local4:Number; var _local5:Number; var _local1:Number = 0; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; if (m_revolute1){ _local4 = m_revolute1.GetJointAngle(); } else { _local4 = m_prismatic1.GetJointTranslation(); }; if (m_revolute2){ _local5 = m_revolute2.GetJointAngle(); } else { _local5 = m_prismatic2.GetJointTranslation(); }; var _local6:Number = (m_constant - (_local4 + (m_ratio * _local5))); var _local7:Number = (-(m_mass) * _local6); _local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y)); _local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1)); _local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y)); _local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2)); _local2.SynchronizeTransform(); _local3.SynchronizeTransform(); return ((_local1 < b2Settings.b2_linearSlop)); } public function GetRatio():Number{ return (m_ratio); } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; var _local4:Number = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); var _local5:Number = ((-(_arg1.inv_dt) * m_mass) * _local4); m_force = (m_force + _local5); var _local6:Number = (_arg1.dt * _local5); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2)); } } }//package Box2D.Dynamics.Joints
Section 51
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef) package Box2D.Dynamics.Joints { public class b2GearJointDef extends b2JointDef { public var joint1:b2Joint; public var joint2:b2Joint; public var ratio:Number; public function b2GearJointDef(){ type = b2Joint.e_gearJoint; joint1 = null; joint2 = null; ratio = 1; } } }//package Box2D.Dynamics.Joints
Section 52
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2Jacobian { public var linear1:b2Vec2; public var linear2:b2Vec2; public var angular1:Number; public var angular2:Number; public function b2Jacobian(){ linear1 = new b2Vec2(); linear2 = new b2Vec2(); super(); } public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{ linear1.SetV(_arg1); angular1 = _arg2; linear2.SetV(_arg3); angular2 = _arg4; } public function SetZero():void{ linear1.SetZero(); angular1 = 0; linear2.SetZero(); angular2 = 0; } public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{ return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4))); } } }//package Box2D.Dynamics.Joints
Section 53
//b2Joint (Box2D.Dynamics.Joints.b2Joint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2Joint { public var m_islandFlag:Boolean; public var m_body1:b2Body; public var m_prev:b2Joint; public var m_next:b2Joint; public var m_type:int; public var m_collideConnected:Boolean; public var m_node1:b2JointEdge; public var m_node2:b2JointEdge; public var m_inv_dt:Number; public var m_userData; public var m_body2:b2Body; public static const e_unknownJoint:int = 0; public static const e_inactiveLimit:int = 0; public static const e_atUpperLimit:int = 2; public static const e_atLowerLimit:int = 1; public static const e_gearJoint:int = 6; public static const e_revoluteJoint:int = 1; public static const e_equalLimits:int = 3; public static const e_distanceJoint:int = 3; public static const e_pulleyJoint:int = 4; public static const e_prismaticJoint:int = 2; public static const e_mouseJoint:int = 5; public function b2Joint(_arg1:b2JointDef){ m_node1 = new b2JointEdge(); m_node2 = new b2JointEdge(); super(); m_type = _arg1.type; m_prev = null; m_next = null; m_body1 = _arg1.body1; m_body2 = _arg1.body2; m_collideConnected = _arg1.collideConnected; m_islandFlag = false; m_userData = _arg1.userData; } public function GetBody2():b2Body{ return (m_body2); } public function GetAnchor1():b2Vec2{ return (null); } public function GetAnchor2():b2Vec2{ return (null); } public function GetNext():b2Joint{ return (m_next); } public function GetType():int{ return (m_type); } public function InitVelocityConstraints(_arg1:b2TimeStep):void{ } public function GetReactionTorque():Number{ return (0); } public function GetUserData(){ return (m_userData); } public function GetReactionForce():b2Vec2{ return (null); } public function SolvePositionConstraints():Boolean{ return (false); } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function GetBody1():b2Body{ return (m_body1); } public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ } public function InitPositionConstraints():void{ } public static function Destroy(_arg1:b2Joint, _arg2):void{ } public static function Create(_arg1:b2JointDef, _arg2):b2Joint{ var _local3:b2Joint; switch (_arg1.type){ case e_distanceJoint: _local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef)); break; case e_mouseJoint: _local3 = new b2MouseJoint((_arg1 as b2MouseJointDef)); break; case e_prismaticJoint: _local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef)); break; case e_revoluteJoint: _local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef)); break; case e_pulleyJoint: _local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef)); break; case e_gearJoint: _local3 = new b2GearJoint((_arg1 as b2GearJointDef)); break; default: break; }; return (_local3); } } }//package Box2D.Dynamics.Joints
Section 54
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef) package Box2D.Dynamics.Joints { import Box2D.Dynamics.*; public class b2JointDef { public var body2:b2Body; public var type:int; public var userData; public var collideConnected:Boolean; public var body1:b2Body; public function b2JointDef(){ type = b2Joint.e_unknownJoint; userData = null; body1 = null; body2 = null; collideConnected = false; } } }//package Box2D.Dynamics.Joints
Section 55
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge) package Box2D.Dynamics.Joints { import Box2D.Dynamics.*; public class b2JointEdge { public var other:b2Body; public var next:b2JointEdge; public var prev:b2JointEdge; public var joint:b2Joint; } }//package Box2D.Dynamics.Joints
Section 56
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2MouseJoint extends b2Joint { private var K1:b2Mat22; private var K:b2Mat22; public var m_beta:Number; public var m_mass:b2Mat22; private var K2:b2Mat22; public var m_target:b2Vec2; public var m_gamma:Number; public var m_impulse:b2Vec2; public var m_C:b2Vec2; public var m_localAnchor:b2Vec2; public var m_maxForce:Number; public function b2MouseJoint(_arg1:b2MouseJointDef){ var _local3:Number; K = new b2Mat22(); K1 = new b2Mat22(); K2 = new b2Mat22(); m_localAnchor = new b2Vec2(); m_target = new b2Vec2(); m_impulse = new b2Vec2(); m_mass = new b2Mat22(); m_C = new b2Vec2(); super(_arg1); m_target.SetV(_arg1.target); var _local2:Number = (m_target.x - m_body2.m_xf.position.x); _local3 = (m_target.y - m_body2.m_xf.position.y); var _local4:b2Mat22 = m_body2.m_xf.R; m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y)); m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y)); m_maxForce = _arg1.maxForce; m_impulse.SetZero(); var _local5:Number = m_body2.m_mass; var _local6:Number = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz); var _local7:Number = (((2 * _local5) * _arg1.dampingRatio) * _local6); var _local8:Number = ((_arg1.timeStep * _local5) * (_local6 * _local6)); m_gamma = (1 / (_local7 + _local8)); m_beta = (_local8 / (_local7 + _local8)); } public function SetTarget(_arg1:b2Vec2):void{ if (m_body2.IsSleeping()){ m_body2.WakeUp(); }; m_target = _arg1; } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor)); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local3:b2Mat22; var _local4:Number; var _local5:Number; var _local7:Number; var _local8:Number; _local2 = m_body2; _local3 = _local2.m_xf.R; _local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x); _local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y); var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)); _local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)); _local4 = _local6; _local7 = _local2.m_invMass; _local8 = _local2.m_invI; K1.col1.x = _local7; K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = _local7; K2.col1.x = ((_local8 * _local5) * _local5); K2.col2.x = ((-(_local8) * _local4) * _local5); K2.col1.y = ((-(_local8) * _local4) * _local5); K2.col2.y = ((_local8 * _local4) * _local4); K.SetM(K1); K.AddM(K2); K.col1.x = (K.col1.x + m_gamma); K.col2.y = (K.col2.y + m_gamma); K.Invert(m_mass); m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x); m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y); _local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98); var _local9:Number = (_arg1.dt * m_impulse.x); var _local10:Number = (_arg1.dt * m_impulse.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9)))); } override public function GetAnchor1():b2Vec2{ return (m_target); } override public function GetReactionTorque():Number{ return (0); } override public function GetReactionForce():b2Vec2{ return (m_impulse); } override public function SolvePositionConstraints():Boolean{ return (true); } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local3:b2Mat22; var _local4:Number; var _local5:Number; var _local2:b2Body = m_body2; _local3 = _local2.m_xf.R; var _local6:Number = (m_localAnchor.x - _local2.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor.y - _local2.m_sweep.localCenter.y); _local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7)); _local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7)); _local6 = _local4; var _local8:Number = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7)); var _local9:Number = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6)); _local3 = m_mass; _local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x)); _local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y)); var _local10:Number = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5))); var _local11:Number = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5))); var _local12:Number = m_impulse.x; var _local13:Number = m_impulse.y; m_impulse.x = (m_impulse.x + _local10); m_impulse.y = (m_impulse.y + _local11); var _local14:Number = m_impulse.Length(); if (_local14 > m_maxForce){ m_impulse.Multiply((m_maxForce / _local14)); }; _local10 = (m_impulse.x - _local12); _local11 = (m_impulse.y - _local13); var _local15:Number = (_arg1.dt * _local10); var _local16:Number = (_arg1.dt * _local11); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15)))); } } }//package Box2D.Dynamics.Joints
Section 57
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2MouseJointDef extends b2JointDef { public var timeStep:Number; public var target:b2Vec2; public var maxForce:Number; public var dampingRatio:Number; public var frequencyHz:Number; public function b2MouseJointDef(){ target = new b2Vec2(); super(); type = b2Joint.e_mouseJoint; maxForce = 0; frequencyHz = 5; dampingRatio = 0.7; timeStep = (1 / 60); } } }//package Box2D.Dynamics.Joints
Section 58
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2PrismaticJoint extends b2Joint { public var m_limitForce:Number; public var m_lowerTranslation:Number; public var m_localXAxis1:b2Vec2; public var m_refAngle:Number; public var m_torque:Number; public var m_motorForce:Number; public var m_enableLimit:Boolean; public var m_angularMass:Number; public var m_maxMotorForce:Number; public var m_localYAxis1:b2Vec2; public var m_force:Number; public var m_motorMass:Number; public var m_upperTranslation:Number; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_limitState:int; public var m_linearMass:Number; public var m_motorJacobian:b2Jacobian; public var m_limitPositionImpulse:Number; public var m_motorSpeed:Number; public var m_enableMotor:Boolean; public var m_linearJacobian:b2Jacobian; public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_localXAxis1 = new b2Vec2(); m_localYAxis1 = new b2Vec2(); m_linearJacobian = new b2Jacobian(); m_motorJacobian = new b2Jacobian(); super(_arg1); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_localXAxis1.SetV(_arg1.localAxis1); m_localYAxis1.x = -(m_localXAxis1.y); m_localYAxis1.y = m_localXAxis1.x; m_refAngle = _arg1.referenceAngle; m_linearJacobian.SetZero(); m_linearMass = 0; m_force = 0; m_angularMass = 0; m_torque = 0; m_motorJacobian.SetZero(); m_motorMass = 0; m_motorForce = 0; m_limitForce = 0; m_limitPositionImpulse = 0; m_lowerTranslation = _arg1.lowerTranslation; m_upperTranslation = _arg1.upperTranslation; m_maxMotorForce = _arg1.maxMotorForce; m_motorSpeed = _arg1.motorSpeed; m_enableLimit = _arg1.enableLimit; m_enableMotor = _arg1.enableMotor; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local8:Number; var _local11:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; var _local4:Number = _local2.m_invMass; var _local5:Number = _local3.m_invMass; var _local6:Number = _local2.m_invI; var _local7:Number = _local3.m_invI; var _local9:Number = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); var _local10:Number = ((-(_arg1.inv_dt) * m_linearMass) * _local9); m_force = (m_force + _local10); _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)); var _local12:Number = (_local3.m_angularVelocity - _local2.m_angularVelocity); var _local13:Number = ((-(_arg1.inv_dt) * m_angularMass) * _local12); m_torque = (m_torque + _local13); var _local14:Number = (_arg1.dt * _local13); _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14)); if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){ _local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed); _local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15); _local17 = m_motorForce; m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce); _local16 = (m_motorForce - _local17); _local11 = (_arg1.dt * _local16); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2)); }; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); _local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18); if (m_limitState == e_equalLimits){ m_limitForce = (m_limitForce + _local19); } else { if (m_limitState == e_atLowerLimit){ _local8 = m_limitForce; m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0); _local19 = (m_limitForce - _local8); } else { if (m_limitState == e_atUpperLimit){ _local8 = m_limitForce; m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0); _local19 = (m_limitForce - _local8); }; }; }; _local11 = (_arg1.dt * _local19); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2)); }; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } public function GetUpperLimit():Number{ return (m_upperTranslation); } public function GetLowerLimit():Number{ return (m_lowerTranslation); } public function EnableMotor(_arg1:Boolean):void{ m_enableMotor = _arg1; } public function GetJointTranslation():Number{ var _local3:b2Mat22; var _local1:b2Body = m_body1; var _local2:b2Body = m_body2; var _local4:b2Vec2 = _local1.GetWorldPoint(m_localAnchor1); var _local5:b2Vec2 = _local2.GetWorldPoint(m_localAnchor2); var _local6:Number = (_local5.x - _local4.x); var _local7:Number = (_local5.y - _local4.y); var _local8:b2Vec2 = _local1.GetWorldVector(m_localXAxis1); var _local9:Number = ((_local8.x * _local6) + (_local8.y * _local7)); return (_local9); } public function GetMotorSpeed():Number{ return (m_motorSpeed); } override public function GetReactionForce():b2Vec2{ var _local1:b2Mat22 = m_body1.m_xf.R; var _local2:Number = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y))); var _local3:Number = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y))); var _local4:Number = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y))); var _local5:Number = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y))); return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5)))); } override public function SolvePositionConstraints():Boolean{ var _local1:Number; var _local2:Number; var _local9:b2Mat22; var _local10:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local3:b2Body = m_body1; var _local4:b2Body = m_body2; var _local5:Number = _local3.m_invMass; var _local6:Number = _local4.m_invMass; var _local7:Number = _local3.m_invI; var _local8:Number = _local4.m_invI; _local9 = _local3.m_xf.R; var _local11:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); var _local12:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12)); _local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12)); _local11 = _local10; _local9 = _local4.m_xf.R; var _local13:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); var _local14:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14)); _local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14)); _local13 = _local10; var _local15:Number = (_local3.m_sweep.c.x + _local11); var _local16:Number = (_local3.m_sweep.c.y + _local12); var _local17:Number = (_local4.m_sweep.c.x + _local13); var _local18:Number = (_local4.m_sweep.c.y + _local14); var _local19:Number = (_local17 - _local15); var _local20:Number = (_local18 - _local16); _local9 = _local3.m_xf.R; var _local21:Number = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y)); var _local22:Number = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y)); var _local23:Number = ((_local21 * _local19) + (_local22 * _local20)); _local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); var _local24:Number = (-(m_linearMass) * _local23); _local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y)); _local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1)); _local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x)); _local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y)); _local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2)); var _local25:Number = b2Math.b2Abs(_local23); var _local26:Number = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle); _local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection); var _local27:Number = (-(m_angularMass) * _local26); _local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27)); _local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27)); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); var _local28:Number = b2Math.b2Abs(_local26); if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local9 = _local3.m_xf.R; _local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); _local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12)); _local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12)); _local11 = _local10; _local9 = _local4.m_xf.R; _local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); _local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14)); _local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14)); _local13 = _local10; _local15 = (_local3.m_sweep.c.x + _local11); _local16 = (_local3.m_sweep.c.y + _local12); _local17 = (_local4.m_sweep.c.x + _local13); _local18 = (_local4.m_sweep.c.y + _local14); _local19 = (_local17 - _local15); _local20 = (_local18 - _local16); _local9 = _local3.m_xf.R; _local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y)); _local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y)); _local31 = ((_local29 * _local19) + (_local30 * _local20)); _local32 = 0; if (m_limitState == e_equalLimits){ _local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); _local32 = (-(m_motorMass) * _local1); _local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26)); } else { if (m_limitState == e_atLowerLimit){ _local1 = (_local31 - m_lowerTranslation); _local25 = b2Math.b2Max(_local25, -(_local1)); _local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local32 = (-(m_motorMass) * _local1); _local2 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0); _local32 = (m_limitPositionImpulse - _local2); } else { if (m_limitState == e_atUpperLimit){ _local1 = (_local31 - m_upperTranslation); _local25 = b2Math.b2Max(_local25, _local1); _local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection); _local32 = (-(m_motorMass) * _local1); _local2 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0); _local32 = (m_limitPositionImpulse - _local2); }; }; }; _local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y)); _local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1)); _local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x)); _local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y)); _local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2)); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); }; return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop)))); } public function SetMotorSpeed(_arg1:Number):void{ m_motorSpeed = _arg1; } public function GetJointSpeed():Number{ var _local3:b2Mat22; var _local1:b2Body = m_body1; var _local2:b2Body = m_body2; _local3 = _local1.m_xf.R; var _local4:Number = (m_localAnchor1.x - _local1.m_sweep.localCenter.x); var _local5:Number = (m_localAnchor1.y - _local1.m_sweep.localCenter.y); var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)); _local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)); _local4 = _local6; _local3 = _local2.m_xf.R; var _local7:Number = (m_localAnchor2.x - _local2.m_sweep.localCenter.x); var _local8:Number = (m_localAnchor2.y - _local2.m_sweep.localCenter.y); _local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8)); _local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8)); _local7 = _local6; var _local9:Number = (_local1.m_sweep.c.x + _local4); var _local10:Number = (_local1.m_sweep.c.y + _local5); var _local11:Number = (_local2.m_sweep.c.x + _local7); var _local12:Number = (_local2.m_sweep.c.y + _local8); var _local13:Number = (_local11 - _local9); var _local14:Number = (_local12 - _local10); var _local15:b2Vec2 = _local1.GetWorldVector(m_localXAxis1); var _local16:b2Vec2 = _local1.m_linearVelocity; var _local17:b2Vec2 = _local2.m_linearVelocity; var _local18:Number = _local1.m_angularVelocity; var _local19:Number = _local2.m_angularVelocity; var _local20:Number = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4))))); return (_local20); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local5:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7)); _local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7)); _local6 = _local5; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local5; var _local10:Number = _local2.m_invMass; var _local11:Number = _local3.m_invMass; var _local12:Number = _local2.m_invI; var _local13:Number = _local3.m_invI; _local4 = _local2.m_xf.R; var _local14:Number = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y)); var _local15:Number = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y)); var _local16:Number = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x); var _local17:Number = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y); m_linearJacobian.linear1.x = -(_local14); m_linearJacobian.linear1.y = -(_local15); m_linearJacobian.linear2.x = _local14; m_linearJacobian.linear2.y = _local15; m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14))); m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14)); m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2)); m_linearMass = (1 / m_linearMass); m_angularMass = (_local12 + _local13); if (m_angularMass > Number.MIN_VALUE){ m_angularMass = (1 / m_angularMass); }; if (((m_enableLimit) || (m_enableMotor))){ _local4 = _local2.m_xf.R; _local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y)); _local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y)); m_motorJacobian.linear1.x = -(_local18); m_motorJacobian.linear1.y = -(_local19); m_motorJacobian.linear2.x = _local18; m_motorJacobian.linear2.y = _local19; m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18))); m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18)); m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2)); m_motorMass = (1 / m_motorMass); if (m_enableLimit){ _local20 = (_local16 - _local6); _local21 = (_local17 - _local7); _local22 = ((_local18 * _local20) + (_local19 * _local21)); if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){ m_limitState = e_equalLimits; } else { if (_local22 <= m_lowerTranslation){ if (m_limitState != e_atLowerLimit){ m_limitForce = 0; }; m_limitState = e_atLowerLimit; } else { if (_local22 >= m_upperTranslation){ if (m_limitState != e_atUpperLimit){ m_limitForce = 0; }; m_limitState = e_atUpperLimit; } else { m_limitState = e_inactiveLimit; m_limitForce = 0; }; }; }; }; }; if (m_enableMotor == false){ m_motorForce = 0; }; if (m_enableLimit == false){ m_limitForce = 0; }; if (_arg1.warmStarting){ _local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x))); _local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y))); _local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x))); _local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y))); _local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1))); _local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2))); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28)); } else { m_force = 0; m_torque = 0; m_limitForce = 0; m_motorForce = 0; }; m_limitPositionImpulse = 0; } public function GetMotorForce():Number{ return (m_motorForce); } public function EnableLimit(_arg1:Boolean):void{ m_enableLimit = _arg1; } public function SetMaxMotorForce(_arg1:Number):void{ m_maxMotorForce = _arg1; } override public function GetReactionTorque():Number{ return (m_torque); } public function IsLimitEnabled():Boolean{ return (m_enableLimit); } public function IsMotorEnabled():Boolean{ return (m_enableMotor); } public function SetLimits(_arg1:Number, _arg2:Number):void{ m_lowerTranslation = _arg1; m_upperTranslation = _arg2; } } }//package Box2D.Dynamics.Joints
Section 59
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2PrismaticJointDef extends b2JointDef { public var motorSpeed:Number; public var localAxis1:b2Vec2; public var referenceAngle:Number; public var upperTranslation:Number; public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var enableLimit:Boolean; public var enableMotor:Boolean; public var maxMotorForce:Number; public var lowerTranslation:Number; public function b2PrismaticJointDef(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); localAxis1 = new b2Vec2(); super(); type = b2Joint.e_prismaticJoint; localAxis1.Set(1, 0); referenceAngle = 0; enableLimit = false; lowerTranslation = 0; upperTranslation = 0; enableMotor = false; maxMotorForce = 0; motorSpeed = 0; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{ body1 = _arg1; body2 = _arg2; localAnchor1 = body1.GetLocalPoint(_arg3); localAnchor2 = body2.GetLocalPoint(_arg3); localAxis1 = body1.GetLocalVector(_arg4); referenceAngle = (body2.GetAngle() - body1.GetAngle()); } } }//package Box2D.Dynamics.Joints
Section 60
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2PulleyJoint extends b2Joint { public var m_limitState1:int; public var m_limitState2:int; public var m_ground:b2Body; public var m_maxLength2:Number; public var m_maxLength1:Number; public var m_limitPositionImpulse1:Number; public var m_limitPositionImpulse2:Number; public var m_force:Number; public var m_constant:Number; public var m_positionImpulse:Number; public var m_state:int; public var m_ratio:Number; public var m_groundAnchor1:b2Vec2; public var m_groundAnchor2:b2Vec2; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_limitMass1:Number; public var m_limitMass2:Number; public var m_pulleyMass:Number; public var m_u1:b2Vec2; public var m_limitForce1:Number; public var m_limitForce2:Number; public var m_u2:b2Vec2; public static const b2_minPulleyLength:Number = 2; public function b2PulleyJoint(_arg1:b2PulleyJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; m_groundAnchor1 = new b2Vec2(); m_groundAnchor2 = new b2Vec2(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_u1 = new b2Vec2(); m_u2 = new b2Vec2(); super(_arg1); m_ground = m_body1.m_world.m_groundBody; m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x); m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y); m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x); m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_ratio = _arg1.ratio; m_constant = (_arg1.length1 + (m_ratio * _arg1.length2)); m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength))); m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio)); m_force = 0; m_limitForce1 = 0; m_limitForce2 = 0; } public function GetGroundAnchor2():b2Vec2{ var _local1:b2Vec2 = m_ground.m_xf.position.Copy(); _local1.Add(m_groundAnchor2); return (_local1); } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function GetReactionForce():b2Vec2{ var _local1:b2Vec2 = m_u2.Copy(); _local1.Multiply(m_force); return (_local1); } override public function SolvePositionConstraints():Boolean{ var _local3:b2Mat22; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local1:b2Body = m_body1; var _local2:b2Body = m_body2; var _local4:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x); var _local5:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y); var _local6:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x); var _local7:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y); var _local23:Number = 0; if (m_state == e_atUpperLimit){ _local3 = _local1.m_xf.R; _local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x); _local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9)); _local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9)); _local8 = _local22; _local3 = _local2.m_xf.R; _local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x); _local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11)); _local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11)); _local10 = _local22; _local12 = (_local1.m_sweep.c.x + _local8); _local13 = (_local1.m_sweep.c.y + _local9); _local14 = (_local2.m_sweep.c.x + _local10); _local15 = (_local2.m_sweep.c.y + _local11); m_u1.Set((_local12 - _local4), (_local13 - _local5)); m_u2.Set((_local14 - _local6), (_local15 - _local7)); _local16 = m_u1.Length(); _local17 = m_u2.Length(); if (_local16 > b2Settings.b2_linearSlop){ m_u1.Multiply((1 / _local16)); } else { m_u1.SetZero(); }; if (_local17 > b2Settings.b2_linearSlop){ m_u2.Multiply((1 / _local17)); } else { m_u2.SetZero(); }; _local18 = ((m_constant - _local16) - (m_ratio * _local17)); _local23 = b2Math.b2Max(_local23, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_pulleyMass) * _local18); _local20 = m_positionImpulse; m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19)); _local19 = (m_positionImpulse - _local20); _local12 = (-(_local19) * m_u1.x); _local13 = (-(_local19) * m_u1.y); _local14 = ((-(m_ratio) * _local19) * m_u2.x); _local15 = ((-(m_ratio) * _local19) * m_u2.y); _local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12)); _local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13)); _local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12)))); _local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15)); _local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14)))); _local1.SynchronizeTransform(); _local2.SynchronizeTransform(); }; if (m_limitState1 == e_atUpperLimit){ _local3 = _local1.m_xf.R; _local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x); _local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9)); _local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9)); _local8 = _local22; _local12 = (_local1.m_sweep.c.x + _local8); _local13 = (_local1.m_sweep.c.y + _local9); m_u1.Set((_local12 - _local4), (_local13 - _local5)); _local16 = m_u1.Length(); if (_local16 > b2Settings.b2_linearSlop){ m_u1.x = (m_u1.x * (1 / _local16)); m_u1.y = (m_u1.y * (1 / _local16)); } else { m_u1.SetZero(); }; _local18 = (m_maxLength1 - _local16); _local23 = b2Math.b2Max(_local23, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_limitMass1) * _local18); _local21 = m_limitPositionImpulse1; m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19)); _local19 = (m_limitPositionImpulse1 - _local21); _local12 = (-(_local19) * m_u1.x); _local13 = (-(_local19) * m_u1.y); _local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12)); _local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13)); _local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12)))); _local1.SynchronizeTransform(); }; if (m_limitState2 == e_atUpperLimit){ _local3 = _local2.m_xf.R; _local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x); _local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11)); _local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11)); _local10 = _local22; _local14 = (_local2.m_sweep.c.x + _local10); _local15 = (_local2.m_sweep.c.y + _local11); m_u2.Set((_local14 - _local6), (_local15 - _local7)); _local17 = m_u2.Length(); if (_local17 > b2Settings.b2_linearSlop){ m_u2.x = (m_u2.x * (1 / _local17)); m_u2.y = (m_u2.y * (1 / _local17)); } else { m_u2.SetZero(); }; _local18 = (m_maxLength2 - _local17); _local23 = b2Math.b2Max(_local23, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_limitMass2) * _local18); _local21 = m_limitPositionImpulse2; m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19)); _local19 = (m_limitPositionImpulse2 - _local21); _local14 = (-(_local19) * m_u2.x); _local15 = (-(_local19) * m_u2.y); _local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15)); _local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14)))); _local2.SynchronizeTransform(); }; return ((_local23 < b2Settings.b2_linearSlop)); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6)); _local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6)); _local5 = _local7; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local7; var _local10:Number = (_local2.m_sweep.c.x + _local5); var _local11:Number = (_local2.m_sweep.c.y + _local6); var _local12:Number = (_local3.m_sweep.c.x + _local8); var _local13:Number = (_local3.m_sweep.c.y + _local9); var _local14:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x); var _local15:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y); var _local16:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x); var _local17:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y); m_u1.Set((_local10 - _local14), (_local11 - _local15)); m_u2.Set((_local12 - _local16), (_local13 - _local17)); var _local18:Number = m_u1.Length(); var _local19:Number = m_u2.Length(); if (_local18 > b2Settings.b2_linearSlop){ m_u1.Multiply((1 / _local18)); } else { m_u1.SetZero(); }; if (_local19 > b2Settings.b2_linearSlop){ m_u2.Multiply((1 / _local19)); } else { m_u2.SetZero(); }; var _local20:Number = ((m_constant - _local18) - (m_ratio * _local19)); if (_local20 > 0){ m_state = e_inactiveLimit; m_force = 0; } else { m_state = e_atUpperLimit; m_positionImpulse = 0; }; if (_local18 < m_maxLength1){ m_limitState1 = e_inactiveLimit; m_limitForce1 = 0; } else { m_limitState1 = e_atUpperLimit; m_limitPositionImpulse1 = 0; }; if (_local19 < m_maxLength2){ m_limitState2 = e_inactiveLimit; m_limitForce2 = 0; } else { m_limitState2 = e_atUpperLimit; m_limitPositionImpulse2 = 0; }; var _local21:Number = ((_local5 * m_u1.y) - (_local6 * m_u1.x)); var _local22:Number = ((_local8 * m_u2.y) - (_local9 * m_u2.x)); m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21)); m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22)); m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2)); m_limitMass1 = (1 / m_limitMass1); m_limitMass2 = (1 / m_limitMass2); m_pulleyMass = (1 / m_pulleyMass); if (_arg1.warmStarting){ _local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x); _local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y); _local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x); _local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23)))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25)))); } else { m_force = 0; m_limitForce1 = 0; m_limitForce2 = 0; }; } override public function GetReactionTorque():Number{ return (0); } public function GetRatio():Number{ return (m_ratio); } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6)); _local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6)); _local5 = _local7; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local7; if (m_state == e_atUpperLimit){ _local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6)); _local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5)); _local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)); _local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)); _local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13)))); _local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18); _local20 = m_force; m_force = b2Math.b2Max(0, (m_force + _local19)); _local19 = (m_force - _local20); _local14 = ((-(_arg1.dt) * _local19) * m_u1.x); _local15 = ((-(_arg1.dt) * _local19) * m_u1.y); _local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x); _local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14)))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16)))); }; if (m_limitState1 == e_atUpperLimit){ _local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6)); _local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5)); _local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11))); _local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18); _local20 = m_limitForce1; m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19)); _local19 = (m_limitForce1 - _local20); _local14 = ((-(_arg1.dt) * _local19) * m_u1.x); _local15 = ((-(_arg1.dt) * _local19) * m_u1.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14)))); }; if (m_limitState2 == e_atUpperLimit){ _local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)); _local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)); _local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13))); _local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18); _local20 = m_limitForce2; m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19)); _local19 = (m_limitForce2 - _local20); _local16 = ((-(_arg1.dt) * _local19) * m_u2.x); _local17 = ((-(_arg1.dt) * _local19) * m_u2.y); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16)))); }; } public function GetLength1():Number{ var _local1:b2Vec2 = m_body1.GetWorldPoint(m_localAnchor1); var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x); var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y); var _local4:Number = (_local1.x - _local2); var _local5:Number = (_local1.y - _local3); return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))); } public function GetLength2():Number{ var _local1:b2Vec2 = m_body2.GetWorldPoint(m_localAnchor2); var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x); var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y); var _local4:Number = (_local1.x - _local2); var _local5:Number = (_local1.y - _local3); return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))); } public function GetGroundAnchor1():b2Vec2{ var _local1:b2Vec2 = m_ground.m_xf.position.Copy(); _local1.Add(m_groundAnchor1); return (_local1); } } }//package Box2D.Dynamics.Joints
Section 61
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2PulleyJointDef extends b2JointDef { public var maxLength1:Number; public var maxLength2:Number; public var length1:Number; public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var groundAnchor1:b2Vec2; public var groundAnchor2:b2Vec2; public var ratio:Number; public var length2:Number; public function b2PulleyJointDef(){ groundAnchor1 = new b2Vec2(); groundAnchor2 = new b2Vec2(); localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); super(); type = b2Joint.e_pulleyJoint; groundAnchor1.Set(-1, 1); groundAnchor2.Set(1, 1); localAnchor1.Set(-1, 0); localAnchor2.Set(1, 0); length1 = 0; maxLength1 = 0; length2 = 0; maxLength2 = 0; ratio = 1; collideConnected = true; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{ body1 = _arg1; body2 = _arg2; groundAnchor1.SetV(_arg3); groundAnchor2.SetV(_arg4); localAnchor1 = body1.GetLocalPoint(_arg5); localAnchor2 = body2.GetLocalPoint(_arg6); var _local8:Number = (_arg5.x - _arg3.x); var _local9:Number = (_arg5.y - _arg3.y); length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9))); var _local10:Number = (_arg6.x - _arg4.x); var _local11:Number = (_arg6.y - _arg4.y); length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11))); ratio = _arg7; var _local12:Number = (length1 + (ratio * length2)); maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength)); maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio); } } }//package Box2D.Dynamics.Joints
Section 62
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2RevoluteJoint extends b2Joint { public var m_limitForce:Number; public var m_pivotMass:b2Mat22; public var m_motorForce:Number; public var m_enableLimit:Boolean; public var m_limitState:int; public var m_motorMass:Number; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; private var K1:b2Mat22; private var K2:b2Mat22; private var K3:b2Mat22; private var K:b2Mat22; public var m_pivotForce:b2Vec2; public var m_enableMotor:Boolean; public var m_referenceAngle:Number; public var m_limitPositionImpulse:Number; public var m_motorSpeed:Number; public var m_upperAngle:Number; public var m_lowerAngle:Number; public var m_maxMotorTorque:Number; public static var tImpulse:b2Vec2 = new b2Vec2(); public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){ K = new b2Mat22(); K1 = new b2Mat22(); K2 = new b2Mat22(); K3 = new b2Mat22(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_pivotForce = new b2Vec2(); m_pivotMass = new b2Mat22(); super(_arg1); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_referenceAngle = _arg1.referenceAngle; m_pivotForce.Set(0, 0); m_motorForce = 0; m_limitForce = 0; m_limitPositionImpulse = 0; m_lowerAngle = _arg1.lowerAngle; m_upperAngle = _arg1.upperAngle; m_maxMotorTorque = _arg1.maxMotorTorque; m_motorSpeed = _arg1.motorSpeed; m_enableLimit = _arg1.enableLimit; m_enableMotor = _arg1.enableMotor; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local5:Number; var _local10:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7)); _local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7)); _local6 = _local5; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local5; var _local11:Number = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7)); var _local12:Number = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6)); var _local13:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12))); var _local14:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12))); m_pivotForce.x = (m_pivotForce.x + _local13); m_pivotForce.y = (m_pivotForce.y + _local14); var _local15:Number = (_arg1.dt * _local13); _local16 = (_arg1.dt * _local14); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16)); _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15)))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15)))); if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){ _local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed); _local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17); _local19 = m_motorForce; m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque); _local18 = (m_motorForce - _local19); _local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18)); }; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity); _local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20); if (m_limitState == e_equalLimits){ m_limitForce = (m_limitForce + _local21); } else { if (m_limitState == e_atLowerLimit){ _local10 = m_limitForce; m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0); _local21 = (m_limitForce - _local10); } else { if (m_limitState == e_atUpperLimit){ _local10 = m_limitForce; m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0); _local21 = (m_limitForce - _local10); }; }; }; _local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21)); }; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } public function GetUpperLimit():Number{ return (m_upperAngle); } public function GetLowerLimit():Number{ return (m_lowerAngle); } public function EnableMotor(_arg1:Boolean):void{ m_enableMotor = _arg1; } public function GetMotorSpeed():Number{ return (m_motorSpeed); } override public function GetReactionForce():b2Vec2{ return (m_pivotForce); } override public function SolvePositionConstraints():Boolean{ var _local1:Number; var _local2:Number; var _local6:b2Mat22; var _local25:Number; var _local26:Number; var _local3:b2Body = m_body1; var _local4:b2Body = m_body2; var _local5:Number = 0; _local6 = _local3.m_xf.R; var _local7:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); var _local8:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); var _local9:Number = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8)); _local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8)); _local7 = _local9; _local6 = _local4.m_xf.R; var _local10:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); var _local11:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11)); _local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11)); _local10 = _local9; var _local12:Number = (_local3.m_sweep.c.x + _local7); var _local13:Number = (_local3.m_sweep.c.y + _local8); var _local14:Number = (_local4.m_sweep.c.x + _local10); var _local15:Number = (_local4.m_sweep.c.y + _local11); var _local16:Number = (_local14 - _local12); var _local17:Number = (_local15 - _local13); _local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17))); var _local18:Number = _local3.m_invMass; var _local19:Number = _local4.m_invMass; var _local20:Number = _local3.m_invI; var _local21:Number = _local4.m_invI; K1.col1.x = (_local18 + _local19); K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = (_local18 + _local19); K2.col1.x = ((_local20 * _local8) * _local8); K2.col2.x = ((-(_local20) * _local7) * _local8); K2.col1.y = ((-(_local20) * _local7) * _local8); K2.col2.y = ((_local20 * _local7) * _local7); K3.col1.x = ((_local21 * _local11) * _local11); K3.col2.x = ((-(_local21) * _local10) * _local11); K3.col1.y = ((-(_local21) * _local10) * _local11); K3.col2.y = ((_local21 * _local10) * _local10); K.SetM(K1); K.AddM(K2); K.AddM(K3); K.Solve(tImpulse, -(_local16), -(_local17)); var _local22:Number = tImpulse.x; var _local23:Number = tImpulse.y; _local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23)); _local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22)))); _local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22)); _local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23)); _local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22)))); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); var _local24:Number = 0; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle); _local26 = 0; if (m_limitState == e_equalLimits){ _local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection); _local26 = (-(m_motorMass) * _local2); _local24 = b2Math.b2Abs(_local2); } else { if (m_limitState == e_atLowerLimit){ _local2 = (_local25 - m_lowerAngle); _local24 = b2Math.b2Max(0, -(_local2)); _local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0); _local26 = (-(m_motorMass) * _local2); _local1 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0); _local26 = (m_limitPositionImpulse - _local1); } else { if (m_limitState == e_atUpperLimit){ _local2 = (_local25 - m_upperAngle); _local24 = b2Math.b2Max(0, _local2); _local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection); _local26 = (-(m_motorMass) * _local2); _local1 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0); _local26 = (m_limitPositionImpulse - _local1); }; }; }; _local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26)); _local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26)); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); }; return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop)))); } public function SetMotorSpeed(_arg1:Number):void{ m_motorSpeed = _arg1; } public function GetJointSpeed():Number{ return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity)); } public function SetMaxMotorTorque(_arg1:Number):void{ m_maxMotorTorque = _arg1; } public function GetJointAngle():Number{ return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle)); } public function GetMotorTorque():Number{ return (m_motorForce); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local3:b2Body; var _local4:b2Mat22; var _local5:Number; var _local7:Number; var _local14:Number; _local2 = m_body1; _local3 = m_body2; _local4 = _local2.m_xf.R; var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); _local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7)); _local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7)); _local6 = _local5; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local5; var _local10:Number = _local2.m_invMass; var _local11:Number = _local3.m_invMass; var _local12:Number = _local2.m_invI; var _local13:Number = _local3.m_invI; K1.col1.x = (_local10 + _local11); K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = (_local10 + _local11); K2.col1.x = ((_local12 * _local7) * _local7); K2.col2.x = ((-(_local12) * _local6) * _local7); K2.col1.y = ((-(_local12) * _local6) * _local7); K2.col2.y = ((_local12 * _local6) * _local6); K3.col1.x = ((_local13 * _local9) * _local9); K3.col2.x = ((-(_local13) * _local8) * _local9); K3.col1.y = ((-(_local13) * _local8) * _local9); K3.col2.y = ((_local13 * _local8) * _local8); K.SetM(K1); K.AddM(K2); K.AddM(K3); K.Invert(m_pivotMass); m_motorMass = (1 / (_local12 + _local13)); if (m_enableMotor == false){ m_motorForce = 0; }; if (m_enableLimit){ _local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle); if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){ m_limitState = e_equalLimits; } else { if (_local14 <= m_lowerAngle){ if (m_limitState != e_atLowerLimit){ m_limitForce = 0; }; m_limitState = e_atLowerLimit; } else { if (_local14 >= m_upperAngle){ if (m_limitState != e_atUpperLimit){ m_limitForce = 0; }; m_limitState = e_atUpperLimit; } else { m_limitState = e_inactiveLimit; m_limitForce = 0; }; }; }; } else { m_limitForce = 0; }; if (_arg1.warmStarting){ _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce))); } else { m_pivotForce.SetZero(); m_motorForce = 0; m_limitForce = 0; }; m_limitPositionImpulse = 0; } public function EnableLimit(_arg1:Boolean):void{ m_enableLimit = _arg1; } override public function GetReactionTorque():Number{ return (m_limitForce); } public function IsLimitEnabled():Boolean{ return (m_enableLimit); } public function IsMotorEnabled():Boolean{ return (m_enableMotor); } public function SetLimits(_arg1:Number, _arg2:Number):void{ m_lowerAngle = _arg1; m_upperAngle = _arg2; } } }//package Box2D.Dynamics.Joints
Section 63
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2RevoluteJointDef extends b2JointDef { public var upperAngle:Number; public var enableMotor:Boolean; public var referenceAngle:Number; public var motorSpeed:Number; public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var enableLimit:Boolean; public var lowerAngle:Number; public var maxMotorTorque:Number; public function b2RevoluteJointDef(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); super(); type = b2Joint.e_revoluteJoint; localAnchor1.Set(0, 0); localAnchor2.Set(0, 0); referenceAngle = 0; lowerAngle = 0; upperAngle = 0; maxMotorTorque = 0; motorSpeed = 0; enableLimit = false; enableMotor = false; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{ body1 = _arg1; body2 = _arg2; localAnchor1 = body1.GetLocalPoint(_arg3); localAnchor2 = body2.GetLocalPoint(_arg3); referenceAngle = (body2.GetAngle() - body1.GetAngle()); } } }//package Box2D.Dynamics.Joints
Section 64
//b2Body (Box2D.Dynamics.b2Body) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import flash.geom.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.Contacts.*; public class b2Body { public var m_next:b2Body; public var m_xf:b2XForm; public var m_contactList:b2ContactEdge; public var m_angularVelocity:Number; public var m_shapeList:b2Shape; public var m_force:b2Vec2; public var m_mass:Number; public var m_sweep:b2Sweep; public var m_torque:Number; public var m_userData; public var m_flags:uint; public var m_world:b2World; public var m_prev:b2Body; public var m_invMass:Number; public var m_type:int; public var m_linearDamping:Number; public var m_shapeCount:int; public var m_angularDamping:Number; public var m_invI:Number; public var m_linearVelocity:b2Vec2; public var m_sleepTime:Number; public var m_jointList:b2JointEdge; public var m_I:Number; public static var e_fixedRotationFlag:uint = 64; public static var e_frozenFlag:uint = 2; public static var e_maxTypes:uint = 3; public static var e_sleepFlag:uint = 8; private static var s_massData:b2MassData = new b2MassData(); public static var e_bulletFlag:uint = 32; public static var e_staticType:uint = 1; public static var e_islandFlag:uint = 4; public static var e_allowSleepFlag:uint = 16; private static var s_xf1:b2XForm = new b2XForm(); public static var e_dynamicType:uint = 2; public function b2Body(_arg1:b2BodyDef, _arg2:b2World){ m_xf = new b2XForm(); m_sweep = new b2Sweep(); m_linearVelocity = new b2Vec2(); m_force = new b2Vec2(); super(); m_flags = 0; if (_arg1.isBullet){ m_flags = (m_flags | e_bulletFlag); }; if (_arg1.fixedRotation){ m_flags = (m_flags | e_fixedRotationFlag); }; if (_arg1.allowSleep){ m_flags = (m_flags | e_allowSleepFlag); }; if (_arg1.isSleeping){ m_flags = (m_flags | e_sleepFlag); }; m_world = _arg2; m_xf.position.SetV(_arg1.position); m_xf.R.Set(_arg1.angle); m_xf.scale = _arg1.scale; m_sweep.localCenter.SetV(_arg1.massData.center); m_sweep.t0 = 1; m_sweep.a0 = (m_sweep.a = _arg1.angle); var _local3:b2Mat22 = m_xf.R; var _local4:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); m_jointList = null; m_contactList = null; m_prev = null; m_next = null; m_linearDamping = _arg1.linearDamping; m_angularDamping = _arg1.angularDamping; m_force.Set(0, 0); m_torque = 0; m_linearVelocity.SetZero(); m_angularVelocity = 0; m_sleepTime = 0; m_invMass = 0; m_I = 0; m_invI = 0; m_mass = _arg1.massData.mass; if (m_mass > 0){ m_invMass = (1 / m_mass); }; if ((m_flags & b2Body.e_fixedRotationFlag) == 0){ m_I = _arg1.massData.I; }; if (m_I > 0){ m_invI = (1 / m_I); }; if ((((m_invMass == 0)) && ((m_invI == 0)))){ m_type = e_staticType; } else { m_type = e_dynamicType; }; m_userData = _arg1.userData; m_shapeList = null; m_shapeCount = 0; } public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{ return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_arg1.x - m_sweep.c.x))))); } public function SetLinearVelocity(_arg1:b2Vec2):void{ m_linearVelocity.SetV(_arg1); } public function WakeUp():void{ m_flags = (m_flags & ~(e_sleepFlag)); m_sleepTime = 0; } public function GetLocalCenter():b2Vec2{ return (m_sweep.localCenter); } public function ApplyTorque(_arg1:Number):void{ if (IsSleeping()){ WakeUp(); }; m_torque = (m_torque + _arg1); } public function IsFrozen():Boolean{ return (((m_flags & e_frozenFlag) == e_frozenFlag)); } public function IsDynamic():Boolean{ return ((m_type == e_dynamicType)); } public function GetLinearVelocity():b2Vec2{ return (m_linearVelocity); } public function SynchronizeTransform():void{ m_xf.R.Set(m_sweep.a); var _local1:b2Mat22 = m_xf.R; var _local2:b2Vec2 = m_sweep.localCenter; m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y))); m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y))); } public function GetInertia():Number{ return (m_I); } public function IsSleeping():Boolean{ return (((m_flags & e_sleepFlag) == e_sleepFlag)); } public function SetMassFromShapes():void{ var _local1:b2Shape; if (m_world.m_lock == true){ return; }; m_mass = 0; m_invMass = 0; m_I = 0; m_invI = 0; var _local2:Number = 0; var _local3:Number = 0; var _local4:b2MassData = s_massData; _local1 = m_shapeList; while (_local1) { _local1.ComputeMass(_local4); m_mass = (m_mass + _local4.mass); _local2 = (_local2 + (_local4.mass * _local4.center.x)); _local3 = (_local3 + (_local4.mass * _local4.center.y)); m_I = (m_I + _local4.I); _local1 = _local1.m_next; }; if (m_mass > 0){ m_invMass = (1 / m_mass); _local2 = (_local2 * m_invMass); _local3 = (_local3 * m_invMass); }; if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){ m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3)))); m_invI = (1 / m_I); } else { m_I = 0; m_invI = 0; }; m_sweep.localCenter.Set(_local2, _local3); var _local5:b2Mat22 = m_xf.R; var _local6:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)); m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); _local1 = m_shapeList; while (_local1) { _local1.UpdateSweepRadius(m_sweep.localCenter); _local1 = _local1.m_next; }; var _local7:int = m_type; if ((((m_invMass == 0)) && ((m_invI == 0)))){ m_type = e_staticType; } else { m_type = e_dynamicType; }; if (_local7 != m_type){ _local1 = m_shapeList; while (_local1) { _local1.RefilterProxy(m_world.m_broadPhase, m_xf); _local1 = _local1.m_next; }; }; } public function PutToSleep():void{ m_flags = (m_flags | e_sleepFlag); m_sleepTime = 0; m_linearVelocity.SetZero(); m_angularVelocity = 0; m_force.SetZero(); m_torque = 0; } public function GetJointList():b2JointEdge{ return (m_jointList); } public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{ var _local3:b2Shape; var _local7:Boolean; if (m_world.m_lock == true){ return (true); }; if (IsFrozen()){ return (false); }; m_xf.R.Set(_arg2); m_xf.position.SetV(_arg1); var _local4:b2Mat22 = m_xf.R; var _local5:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y)); m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); m_sweep.a0 = (m_sweep.a = _arg2); var _local6:Boolean; _local3 = m_shapeList; while (_local3) { _local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf); if (_local7 == false){ _local6 = true; break; }; _local3 = _local3.m_next; }; if (_local6 == true){ m_flags = (m_flags | e_frozenFlag); m_linearVelocity.SetZero(); m_angularVelocity = 0; _local3 = m_shapeList; while (_local3) { _local3.DestroyProxy(m_world.m_broadPhase); _local3 = _local3.m_next; }; return (false); }; m_world.m_broadPhase.Commit(); return (true); } public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulXT(m_xf, _arg1)); } public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{ if (IsSleeping()){ WakeUp(); }; m_force.x = (m_force.x + _arg1.x); m_force.y = (m_force.y + _arg1.y); m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))); } public function SynchronizeShapes():Boolean{ var _local4:b2Shape; var _local1:b2XForm = s_xf1; _local1.R.Set(m_sweep.a0); var _local2:b2Mat22 = _local1.R; var _local3:b2Vec2 = m_sweep.localCenter; _local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y))); _local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y))); var _local5:Boolean; _local4 = m_shapeList; while (_local4) { _local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf); if (_local5 == false){ break; }; _local4 = _local4.m_next; }; if (_local5 == false){ m_flags = (m_flags | e_frozenFlag); m_linearVelocity.SetZero(); m_angularVelocity = 0; _local4 = m_shapeList; while (_local4) { _local4.DestroyProxy(m_world.m_broadPhase); _local4 = _local4.m_next; }; return (false); }; return (true); } public function GetAngle():Number{ return (m_sweep.a); } public function GetXForm():b2XForm{ return (m_xf); } public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{ if (IsSleeping()){ WakeUp(); }; m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x)); m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y)); m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)))); } public function GetAngularVelocity():Number{ return (m_angularVelocity); } public function GetMass():Number{ return (m_mass); } public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{ var _local2:b2Mat22 = m_xf.R; var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y))); _local3.x = (_local3.x + m_xf.position.x); _local3.y = (_local3.y + m_xf.position.y); return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x))))); } public function GetShapeList():b2Shape{ return (m_shapeList); } public function SetAngularVelocity(_arg1:Number):void{ m_angularVelocity = _arg1; } public function SetMass(_arg1:b2MassData):void{ var _local2:b2Shape; if (m_world.m_lock == true){ return; }; m_invMass = 0; m_I = 0; m_invI = 0; m_mass = _arg1.mass; if (m_mass > 0){ m_invMass = (1 / m_mass); }; if ((m_flags & b2Body.e_fixedRotationFlag) == 0){ m_I = _arg1.I; }; if (m_I > 0){ m_invI = (1 / m_I); }; m_sweep.localCenter.SetV(_arg1.center); var _local3:b2Mat22 = m_xf.R; var _local4:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); _local2 = m_shapeList; while (_local2) { _local2.UpdateSweepRadius(m_sweep.localCenter); _local2 = _local2.m_next; }; var _local5:int = m_type; if ((((m_invMass == 0)) && ((m_invI == 0)))){ m_type = e_staticType; } else { m_type = e_dynamicType; }; if (_local5 != m_type){ _local2 = m_shapeList; while (_local2) { _local2.RefilterProxy(m_world.m_broadPhase, m_xf); _local2 = _local2.m_next; }; }; } public function IsStatic():Boolean{ return ((m_type == e_staticType)); } public function GetTransform():Matrix{ var _local1:Number = m_xf.scale; return (new Matrix(1, 0, 0, 1, (m_xf.position.x * _local1), (m_xf.position.y * _local1))); } public function GetWorldVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulMV(m_xf.R, _arg1)); } public function GetNext():b2Body{ return (m_next); } public function Advance(_arg1:Number):void{ m_sweep.Advance(_arg1); m_sweep.c.SetV(m_sweep.c0); m_sweep.a = m_sweep.a0; SynchronizeTransform(); } public function SetBullet(_arg1:Boolean):void{ if (_arg1){ m_flags = (m_flags | e_bulletFlag); } else { m_flags = (m_flags & ~(e_bulletFlag)); }; } public function CreateShape(_arg1:b2ShapeDef):b2Shape{ var _local2:b2Shape; if (m_world.m_lock == true){ return (null); }; _local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator); _local2.m_next = m_shapeList; m_shapeList = _local2; m_shapeCount++; _local2.m_body = this; _local2.CreateProxy(m_world.m_broadPhase, m_xf); _local2.UpdateSweepRadius(m_sweep.localCenter); return (_local2); } public function IsConnected(_arg1:b2Body):Boolean{ var _local2:b2JointEdge = m_jointList; while (_local2) { if (_local2.other == _arg1){ return ((_local2.joint.m_collideConnected == false)); }; _local2 = _local2.next; }; return (false); } public function DestroyShape(_arg1:b2Shape):void{ if (m_world.m_lock == true){ return; }; _arg1.DestroyProxy(m_world.m_broadPhase); var _local2:b2Shape = m_shapeList; var _local3:b2Shape; var _local4:Boolean; while (_local2 != null) { if (_local2 == _arg1){ if (_local3){ _local3.m_next = _arg1.m_next; } else { m_shapeList = _arg1.m_next; }; _local4 = true; break; }; _local3 = _local2; _local2 = _local2.m_next; }; _arg1.m_body = null; _arg1.m_next = null; m_shapeCount--; b2Shape.Destroy(_arg1, m_world.m_blockAllocator); } public function GetUserData(){ return (m_userData); } public function IsBullet():Boolean{ return (((m_flags & e_bulletFlag) == e_bulletFlag)); } public function GetWorldCenter():b2Vec2{ return (m_sweep.c); } public function AllowSleeping(_arg1:Boolean):void{ if (_arg1){ m_flags = (m_flags | e_allowSleepFlag); } else { m_flags = (m_flags & ~(e_allowSleepFlag)); WakeUp(); }; } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function GetLocalVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulTMV(m_xf.R, _arg1)); } public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{ var _local2:b2Mat22 = m_xf.R; var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y))); _local3.x = (_local3.x + m_xf.position.x); _local3.y = (_local3.y + m_xf.position.y); return (_local3); } public function GetWorld():b2World{ return (m_world); } public function GetPosition():b2Vec2{ return (m_xf.position); } } }//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; public class b2BodyDef { public var angularDamping:Number; public var isSleeping:Boolean; public var position:b2Vec2; public var scale:Number; public var isBullet:Boolean; public var allowSleep:Boolean; public var userData; public var angle:Number; public var linearDamping:Number; public var massData:b2MassData; public var fixedRotation:Boolean; public function b2BodyDef(){ massData = new b2MassData(); position = new b2Vec2(); super(); massData.center.SetZero(); massData.mass = 0; massData.I = 0; userData = null; position.Set(0, 0); angle = 0; linearDamping = 0; angularDamping = 0; allowSleep = true; isSleeping = false; fixedRotation = false; isBullet = false; } } }//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener) package Box2D.Dynamics { public class b2BoundaryListener { public function Violation(_arg1:b2Body):void{ } } }//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; public class b2ContactFilter { public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter); ; public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{ var _local3:b2FilterData = _arg1.GetFilterData(); var _local4:b2FilterData = _arg2.GetFilterData(); if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){ return ((_local3.groupIndex > 0)); }; var _local5:Boolean = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0)))); return (_local5); } } }//package Box2D.Dynamics
Section 68
//b2ContactListener (Box2D.Dynamics.b2ContactListener) package Box2D.Dynamics { import Box2D.Collision.*; import Box2D.Dynamics.Contacts.*; public class b2ContactListener { public function Add(_arg1:b2ContactPoint):void{ } public function Remove(_arg1:b2ContactPoint):void{ } public function Persist(_arg1:b2ContactPoint):void{ } public function Result(_arg1:b2ContactResult):void{ } } }//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Collision.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; public class b2ContactManager extends b2PairCallback { public var m_world:b2World; public var m_destroyImmediate:Boolean; public var m_nullContact:b2NullContact; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2ContactManager(){ m_nullContact = new b2NullContact(); super(); m_world = null; m_destroyImmediate = false; } override public function PairRemoved(_arg1, _arg2, _arg3):void{ if (_arg3 == null){ return; }; var _local4:b2Contact = (_arg3 as b2Contact); if (_local4 == m_nullContact){ return; }; Destroy(_local4); } public function Destroy(_arg1:b2Contact):void{ var _local7:b2Body; var _local8:b2Body; var _local9:Array; var _local10:b2ContactPoint; var _local11:int; var _local12:b2Manifold; var _local13:int; var _local14:b2ManifoldPoint; var _local15:b2Vec2; var _local16:b2Vec2; var _local2:b2Shape = _arg1.m_shape1; var _local3:b2Shape = _arg1.m_shape2; var _local4:int = _arg1.m_manifoldCount; if ((((_local4 > 0)) && (m_world.m_contactListener))){ _local7 = _local2.m_body; _local8 = _local3.m_body; _local9 = _arg1.GetManifolds(); _local10 = s_evalCP; _local10.shape1 = _arg1.m_shape1; _local10.shape2 = _arg1.m_shape2; _local10.friction = _arg1.m_friction; _local10.restitution = _arg1.m_restitution; _local11 = 0; while (_local11 < _local4) { _local12 = _local9[_local11]; _local10.normal.SetV(_local12.normal); _local13 = 0; while (_local13 < _local12.pointCount) { _local14 = _local12.points[_local13]; _local10.position = _local7.GetWorldPoint(_local14.localPoint1); _local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1); _local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2); _local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y)); _local10.separation = _local14.separation; _local10.id.key = _local14.id._key; m_world.m_contactListener.Remove(_local10); _local13++; }; _local11++; }; }; if (_arg1.m_prev){ _arg1.m_prev.m_next = _arg1.m_next; }; if (_arg1.m_next){ _arg1.m_next.m_prev = _arg1.m_prev; }; if (_arg1 == m_world.m_contactList){ m_world.m_contactList = _arg1.m_next; }; var _local5:b2Body = _local2.m_body; var _local6:b2Body = _local3.m_body; if (_arg1.m_node1.prev){ _arg1.m_node1.prev.next = _arg1.m_node1.next; }; if (_arg1.m_node1.next){ _arg1.m_node1.next.prev = _arg1.m_node1.prev; }; if (_arg1.m_node1 == _local5.m_contactList){ _local5.m_contactList = _arg1.m_node1.next; }; if (_arg1.m_node2.prev){ _arg1.m_node2.prev.next = _arg1.m_node2.next; }; if (_arg1.m_node2.next){ _arg1.m_node2.next.prev = _arg1.m_node2.prev; }; if (_arg1.m_node2 == _local6.m_contactList){ _local6.m_contactList = _arg1.m_node2.next; }; b2Contact.Destroy(_arg1, m_world.m_blockAllocator); m_world.m_contactCount--; } override public function PairAdded(_arg1, _arg2){ var _local3:b2Shape = (_arg1 as b2Shape); var _local4:b2Shape = (_arg2 as b2Shape); var _local5:b2Body = _local3.m_body; var _local6:b2Body = _local4.m_body; if (((_local5.IsStatic()) && (_local6.IsStatic()))){ return (m_nullContact); }; if (_local3.m_body == _local4.m_body){ return (m_nullContact); }; if (_local6.IsConnected(_local5)){ return (m_nullContact); }; if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){ return (m_nullContact); }; var _local7:b2Contact = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator); if (_local7 == null){ return (m_nullContact); }; _local3 = _local7.m_shape1; _local4 = _local7.m_shape2; _local5 = _local3.m_body; _local6 = _local4.m_body; _local7.m_prev = null; _local7.m_next = m_world.m_contactList; if (m_world.m_contactList != null){ m_world.m_contactList.m_prev = _local7; }; m_world.m_contactList = _local7; _local7.m_node1.contact = _local7; _local7.m_node1.other = _local6; _local7.m_node1.prev = null; _local7.m_node1.next = _local5.m_contactList; if (_local5.m_contactList != null){ _local5.m_contactList.prev = _local7.m_node1; }; _local5.m_contactList = _local7.m_node1; _local7.m_node2.contact = _local7; _local7.m_node2.other = _local5; _local7.m_node2.prev = null; _local7.m_node2.next = _local6.m_contactList; if (_local6.m_contactList != null){ _local6.m_contactList.prev = _local7.m_node2; }; _local6.m_contactList = _local7.m_node2; m_world.m_contactCount++; return (_local7); } public function Collide():void{ var _local2:b2Body; var _local3:b2Body; var _local1:b2Contact = m_world.m_contactList; while (_local1) { _local2 = _local1.m_shape1.m_body; _local3 = _local1.m_shape2.m_body; if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){ } else { _local1.Update(m_world.m_contactListener); }; _local1 = _local1.m_next; }; } } }//package Box2D.Dynamics
Section 70
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import flash.display.*; import Box2D.Collision.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; public class b2DebugDraw { public var m_xformScale:Number;// = 1 public var m_fillAlpha:Number;// = 1 public var m_alpha:Number;// = 1 public var m_drawFlags:uint; public var m_lineThickness:Number;// = 1 public var m_drawScale:Number;// = 1 public var m_sprite:Sprite; public static var e_coreShapeBit:uint = 4; public static var e_shapeBit:uint = 1; public static var e_centerOfMassBit:uint = 64; public static var e_aabbBit:uint = 8; public static var e_obbBit:uint = 16; public static var e_pairBit:uint = 32; public static var e_jointBit:uint = 2; public function b2DebugDraw(){ m_drawFlags = 0; } public function ClearFlags(_arg1:uint):void{ m_drawFlags = (m_drawFlags & ~(_arg1)); } public function SetFlags(_arg1:uint):void{ m_drawFlags = _arg1; } public function AppendFlags(_arg1:uint):void{ m_drawFlags = (m_drawFlags | _arg1); } public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale)); m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale)); } public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha); var _local4 = 1; while (_local4 < _arg2) { m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale)); _local4++; }; m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); m_sprite.graphics.endFill(); } public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale)); } public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); var _local4 = 1; while (_local4 < _arg2) { m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale)); _local4++; }; m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); } public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha); m_sprite.graphics.moveTo(0, 0); m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha); m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale)); m_sprite.graphics.endFill(); m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale)); m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale)); } public function GetFlags():uint{ return (m_drawFlags); } public function DrawXForm(_arg1:b2XForm):void{ m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha); m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale)); m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale)); m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha); m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale)); m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale)); } } }//package Box2D.Dynamics
Section 71
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Joints.*; public class b2DestructionListener { public function SayGoodbyeShape(_arg1:b2Shape):void{ } public function SayGoodbyeJoint(_arg1:b2Joint):void{ } } }//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island) package Box2D.Dynamics { import Box2D.Common.Math.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; public class b2Island { public var m_listener:b2ContactListener; public var m_positionIterationCount:int; public var m_bodyCapacity:int; public var m_bodies:Array; public var m_joints:Array; public var m_jointCapacity:int; public var m_contactCount:int; public var m_contacts:Array; public var m_contactCapacity:int; public var m_jointCount:int; public var m_allocator; public var m_bodyCount:int; private static var s_reportCR:b2ContactResult = new b2ContactResult(); public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){ var _local6:int; super(); m_bodyCapacity = _arg1; m_contactCapacity = _arg2; m_jointCapacity = _arg3; m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; m_allocator = _arg4; m_listener = _arg5; m_bodies = new Array(_arg1); _local6 = 0; while (_local6 < _arg1) { m_bodies[_local6] = null; _local6++; }; m_contacts = new Array(_arg2); _local6 = 0; while (_local6 < _arg2) { m_contacts[_local6] = null; _local6++; }; m_joints = new Array(_arg3); _local6 = 0; while (_local6 < _arg3) { m_joints[_local6] = null; _local6++; }; m_positionIterationCount = 0; } public function AddBody(_arg1:b2Body):void{ var _local2 = m_bodyCount++; m_bodies[_local2] = _arg1; } public function AddJoint(_arg1:b2Joint):void{ var _local2 = m_jointCount++; m_joints[_local2] = _arg1; } public function Report(_arg1:Array):void{ var _local2:b2Mat22; var _local3:b2Vec2; var _local5:b2Contact; var _local6:b2ContactConstraint; var _local7:b2ContactResult; var _local8:b2Body; var _local9:int; var _local10:Array; var _local11:int; var _local12:b2Manifold; var _local13:int; var _local14:b2ManifoldPoint; var _local15:b2ContactConstraintPoint; if (m_listener == null){ return; }; var _local4:int; while (_local4 < m_contactCount) { _local5 = m_contacts[_local4]; _local6 = _arg1[_local4]; _local7 = s_reportCR; _local7.shape1 = _local5.m_shape1; _local7.shape2 = _local5.m_shape2; _local8 = _local7.shape1.m_body; _local9 = _local5.m_manifoldCount; _local10 = _local5.GetManifolds(); _local11 = 0; while (_local11 < _local9) { _local12 = _local10[_local11]; _local7.normal.SetV(_local12.normal); _local13 = 0; while (_local13 < _local12.pointCount) { _local14 = _local12.points[_local13]; _local15 = _local6.points[_local13]; _local7.position = _local8.GetWorldPoint(_local14.localPoint1); _local7.normalImpulse = _local15.normalImpulse; _local7.tangentImpulse = _local15.tangentImpulse; _local7.id.key = _local14.id.key; m_listener.Result(_local7); _local13++; }; _local11++; }; _local4++; }; } public function AddContact(_arg1:b2Contact):void{ var _local2 = m_contactCount++; m_contacts[_local2] = _arg1; } public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{ var _local5:int; var _local6:b2Body; var _local7:b2Joint; var _local9:int; var _local10:Boolean; var _local11:Boolean; var _local12:Boolean; var _local13:Number; var _local14:Number; var _local15:Number; _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; if (_local6.IsStatic()){ } else { _local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x)))); _local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y)))); _local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque)); _local6.m_force.SetZero(); _local6.m_torque = 0; _local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1)); _local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1)); if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){ _local6.m_linearVelocity.Normalize(); _local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity); _local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity); }; if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){ if (_local6.m_angularVelocity < 0){ _local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity); } else { _local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity; }; }; }; _local5++; }; var _local8:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator); _local8.InitVelocityConstraints(_arg1); _local5 = 0; while (_local5 < m_jointCount) { _local7 = m_joints[_local5]; _local7.InitVelocityConstraints(_arg1); _local5++; }; _local5 = 0; while (_local5 < _arg1.maxIterations) { _local8.SolveVelocityConstraints(); _local9 = 0; while (_local9 < m_jointCount) { _local7 = m_joints[_local9]; _local7.SolveVelocityConstraints(_arg1); _local9++; }; _local5++; }; _local8.FinalizeVelocityConstraints(); _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; if (_local6.IsStatic()){ } else { _local6.m_sweep.c0.SetV(_local6.m_sweep.c); _local6.m_sweep.a0 = _local6.m_sweep.a; _local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x)); _local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y)); _local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity)); _local6.SynchronizeTransform(); }; _local5++; }; if (_arg3){ _local5 = 0; while (_local5 < m_jointCount) { _local7 = m_joints[_local5]; _local7.InitPositionConstraints(); _local5++; }; m_positionIterationCount = 0; while (m_positionIterationCount < _arg1.maxIterations) { _local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte); _local11 = true; _local5 = 0; while (_local5 < m_jointCount) { _local7 = m_joints[_local5]; _local12 = _local7.SolvePositionConstraints(); _local11 = ((_local11) && (_local12)); _local5++; }; if (((_local10) && (_local11))){ break; }; m_positionIterationCount++; }; }; Report(_local8.m_constraints); if (_arg4){ _local13 = Number.MAX_VALUE; _local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance); _local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance); _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; if (_local6.m_invMass == 0){ } else { if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){ _local6.m_sleepTime = 0; _local13 = 0; }; if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){ _local6.m_sleepTime = 0; _local13 = 0; } else { _local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt); _local13 = b2Math.b2Min(_local13, _local6.m_sleepTime); }; }; _local5++; }; if (_local13 >= b2Settings.b2_timeToSleep){ _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag); _local6.m_linearVelocity.SetZero(); _local6.m_angularVelocity = 0; _local5++; }; }; }; } public function Clear():void{ m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; } public function SolveTOI(_arg1:b2TimeStep):void{ var _local2:int; var _local5:b2Body; var _local6:Boolean; var _local3:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator); _local2 = 0; while (_local2 < _arg1.maxIterations) { _local3.SolveVelocityConstraints(); _local2++; }; _local2 = 0; while (_local2 < m_bodyCount) { _local5 = m_bodies[_local2]; if (_local5.IsStatic()){ } else { _local5.m_sweep.c0.SetV(_local5.m_sweep.c); _local5.m_sweep.a0 = _local5.m_sweep.a; _local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x)); _local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y)); _local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity)); _local5.SynchronizeTransform(); }; _local2++; }; var _local4:Number = 0.75; _local2 = 0; while (_local2 < _arg1.maxIterations) { _local6 = _local3.SolvePositionConstraints(_local4); if (_local6){ break; }; _local2++; }; Report(_local3.m_constraints); } } }//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep) package Box2D.Dynamics { public class b2TimeStep { public var warmStarting:Boolean; public var positionCorrection:Boolean; public var dt:Number; public var maxIterations:int; public var dtRatio:Number; public var inv_dt:Number; } }//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; public class b2World { public var m_inv_dt0:Number; public var m_boundaryListener:b2BoundaryListener; public var m_contactList:b2Contact; public var m_blockAllocator; public var m_contactListener:b2ContactListener; public var m_allowSleep:Boolean; public var m_broadPhase:b2BroadPhase; public var m_destructionListener:b2DestructionListener; public var m_jointCount:int; public var m_bodyCount:int; public var m_lock:Boolean; public var m_positionIterationCount:int; public var m_groundBody:b2Body; public var m_contactCount:int; public var m_debugDraw:b2DebugDraw; public var m_contactFilter:b2ContactFilter; public var m_bodyList:b2Body; public var m_stackAllocator; public var m_jointList:b2Joint; public var m_gravity:b2Vec2; public var m_contactManager:b2ContactManager; private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8); public static var m_continuousPhysics:Boolean; public static var m_warmStarting:Boolean; private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6); public static var m_positionCorrection:Boolean; private static var s_xf:b2XForm = new b2XForm(); public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){ m_contactManager = new b2ContactManager(); super(); m_destructionListener = null; m_boundaryListener = null; m_contactFilter = b2ContactFilter.b2_defaultFilter; m_contactListener = null; m_debugDraw = null; m_bodyList = null; m_contactList = null; m_jointList = null; m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; m_positionCorrection = true; m_warmStarting = true; m_continuousPhysics = true; m_allowSleep = _arg3; m_gravity = _arg2; m_lock = false; m_inv_dt0 = 0; m_contactManager.m_world = this; m_broadPhase = new b2BroadPhase(_arg1, m_contactManager); var _local4:b2BodyDef = new b2BodyDef(); m_groundBody = CreateBody(_local4); } public function DrawJoint(_arg1:b2Joint):void{ var _local11:b2PulleyJoint; var _local12:b2Vec2; var _local13:b2Vec2; var _local2:b2Body = _arg1.m_body1; var _local3:b2Body = _arg1.m_body2; var _local4:b2XForm = _local2.m_xf; var _local5:b2XForm = _local3.m_xf; var _local6:b2Vec2 = _local4.position; var _local7:b2Vec2 = _local5.position; var _local8:b2Vec2 = _arg1.GetAnchor1(); var _local9:b2Vec2 = _arg1.GetAnchor2(); var _local10:b2Color = s_jointColor; switch (_arg1.m_type){ case b2Joint.e_distanceJoint: m_debugDraw.DrawSegment(_local8, _local9, _local10); break; case b2Joint.e_pulleyJoint: _local11 = (_arg1 as b2PulleyJoint); _local12 = _local11.GetGroundAnchor1(); _local13 = _local11.GetGroundAnchor2(); m_debugDraw.DrawSegment(_local12, _local8, _local10); m_debugDraw.DrawSegment(_local13, _local9, _local10); m_debugDraw.DrawSegment(_local12, _local13, _local10); break; case b2Joint.e_mouseJoint: m_debugDraw.DrawSegment(_local8, _local9, _local10); break; default: if (_local2 != m_groundBody){ m_debugDraw.DrawSegment(_local6, _local8, _local10); }; m_debugDraw.DrawSegment(_local8, _local9, _local10); if (_local3 != m_groundBody){ m_debugDraw.DrawSegment(_local7, _local9, _local10); }; }; } public function Refilter(_arg1:b2Shape):void{ _arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf); } public function SetDebugDraw(_arg1:b2DebugDraw):void{ m_debugDraw = _arg1; } public function SetContinuousPhysics(_arg1:Boolean):void{ m_continuousPhysics = _arg1; } public function GetProxyCount():int{ return (m_broadPhase.m_proxyCount); } public function DrawDebugData():void{ var _local2:int; var _local3:b2Body; var _local4:b2Shape; var _local5:b2Joint; var _local6:b2BroadPhase; var _local11:b2XForm; var _local15:Boolean; var _local16:uint; var _local17:b2Pair; var _local18:b2Proxy; var _local19:b2Proxy; var _local20:b2Vec2; var _local21:b2Vec2; var _local22:b2Proxy; var _local23:b2PolygonShape; var _local24:b2OBB; var _local25:b2Vec2; var _local26:b2Mat22; var _local27:b2Vec2; var _local28:Number; if (m_debugDraw == null){ return; }; m_debugDraw.m_sprite.graphics.clear(); var _local1:uint = m_debugDraw.GetFlags(); var _local7:b2Vec2 = new b2Vec2(); var _local8:b2Vec2 = new b2Vec2(); var _local9:b2Vec2 = new b2Vec2(); var _local10:b2Color = new b2Color(0, 0, 0); var _local12:b2AABB = new b2AABB(); var _local13:b2AABB = new b2AABB(); var _local14:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()]; if ((_local1 & b2DebugDraw.e_shapeBit)){ _local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit); _local3 = m_bodyList; while (_local3) { _local11 = _local3.m_xf; _local4 = _local3.GetShapeList(); while (_local4) { if (_local3.IsStatic()){ DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15); } else { if (_local3.IsSleeping()){ DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15); } else { DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15); }; }; _local4 = _local4.m_next; }; _local3 = _local3.m_next; }; }; if ((_local1 & b2DebugDraw.e_jointBit)){ _local5 = m_jointList; while (_local5) { DrawJoint(_local5); _local5 = _local5.m_next; }; }; if ((_local1 & b2DebugDraw.e_pairBit)){ _local6 = m_broadPhase; _local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y)); _local10.Set(0.9, 0.9, 0.3); _local2 = 0; while (_local2 < b2Pair.b2_tableCapacity) { _local16 = _local6.m_pairManager.m_hashTable[_local2]; while (_local16 != b2Pair.b2_nullPair) { _local17 = _local6.m_pairManager.m_pairs[_local16]; _local18 = _local6.m_proxyPool[_local17.proxyId1]; _local19 = _local6.m_proxyPool[_local17.proxyId2]; _local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value)); _local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value)); _local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value)); _local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value)); _local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value)); _local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value)); _local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value)); _local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value)); _local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x)); _local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y)); _local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x)); _local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y)); m_debugDraw.DrawSegment(_local8, _local9, _local10); _local16 = _local17.next; }; _local2++; }; }; if ((_local1 & b2DebugDraw.e_aabbBit)){ _local6 = m_broadPhase; _local20 = _local6.m_worldAABB.lowerBound; _local21 = _local6.m_worldAABB.upperBound; _local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y)); _local10.Set(0.9, 0.3, 0.9); _local2 = 0; while (_local2 < b2Settings.b2_maxProxies) { _local22 = _local6.m_proxyPool[_local2]; if (_local22.IsValid() == false){ } else { _local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value)); _local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value)); _local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value)); _local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value)); _local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y); _local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y); _local14[2].Set(_local12.upperBound.x, _local12.upperBound.y); _local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y); m_debugDraw.DrawPolygon(_local14, 4, _local10); }; _local2++; }; _local14[0].Set(_local20.x, _local20.y); _local14[1].Set(_local21.x, _local20.y); _local14[2].Set(_local21.x, _local21.y); _local14[3].Set(_local20.x, _local21.y); m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9)); }; if ((_local1 & b2DebugDraw.e_obbBit)){ _local10.Set(0.5, 0.3, 0.5); _local3 = m_bodyList; while (_local3) { _local11 = _local3.m_xf; _local4 = _local3.GetShapeList(); while (_local4) { if (_local4.m_type != b2Shape.e_polygonShape){ } else { _local23 = (_local4 as b2PolygonShape); _local24 = _local23.GetOBB(); _local25 = _local24.extents; _local14[0].Set(-(_local25.x), -(_local25.y)); _local14[1].Set(_local25.x, -(_local25.y)); _local14[2].Set(_local25.x, _local25.y); _local14[3].Set(-(_local25.x), _local25.y); _local2 = 0; while (_local2 < 4) { _local26 = _local24.R; _local27 = _local14[_local2]; _local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y))); _local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y))); _local14[_local2].x = _local28; _local26 = _local11.R; _local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y))); _local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y))); _local14[_local2].x = _local28; _local2++; }; m_debugDraw.DrawPolygon(_local14, 4, _local10); }; _local4 = _local4.m_next; }; _local3 = _local3.m_next; }; }; if ((_local1 & b2DebugDraw.e_centerOfMassBit)){ _local3 = m_bodyList; while (_local3) { _local11 = s_xf; _local11.R = _local3.m_xf.R; _local11.position = _local3.GetWorldCenter(); m_debugDraw.DrawXForm(_local11); _local3 = _local3.m_next; }; }; } public function DestroyBody(_arg1:b2Body):void{ var _local4:b2JointEdge; var _local5:b2Shape; if (m_lock == true){ return; }; var _local2:b2JointEdge = _arg1.m_jointList; while (_local2) { _local4 = _local2; _local2 = _local2.next; if (m_destructionListener){ m_destructionListener.SayGoodbyeJoint(_local4.joint); }; DestroyJoint(_local4.joint); }; var _local3:b2Shape = _arg1.m_shapeList; while (_local3) { _local5 = _local3; _local3 = _local3.m_next; if (m_destructionListener){ m_destructionListener.SayGoodbyeShape(_local5); }; _local5.DestroyProxy(m_broadPhase); b2Shape.Destroy(_local5, m_blockAllocator); }; if (_arg1.m_prev){ _arg1.m_prev.m_next = _arg1.m_next; }; if (_arg1.m_next){ _arg1.m_next.m_prev = _arg1.m_prev; }; if (_arg1 == m_bodyList){ m_bodyList = _arg1.m_next; }; m_bodyCount--; } public function SetContactFilter(_arg1:b2ContactFilter):void{ m_contactFilter = _arg1; } public function GetGroundBody():b2Body{ return (m_groundBody); } public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{ var _local6:b2CircleShape; var _local7:b2Vec2; var _local8:Number; var _local9:b2Vec2; var _local10:int; var _local11:b2PolygonShape; var _local12:int; var _local13:Array; var _local14:Array; var _local15:Array; var _local5:b2Color = s_coreColor; switch (_arg1.m_type){ case b2Shape.e_circleShape: _local6 = (_arg1 as b2CircleShape); _local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition); _local8 = _local6.m_radius; _local9 = _arg2.R.col1; m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3); if (_arg4){ m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5); }; break; case b2Shape.e_polygonShape: _local11 = (_arg1 as b2PolygonShape); _local12 = _local11.GetVertexCount(); _local13 = _local11.GetVertices(); _local14 = new Array(b2Settings.b2_maxPolygonVertices); _local10 = 0; while (_local10 < _local12) { _local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]); _local10++; }; m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3); if (_arg4){ _local15 = _local11.GetCoreVertices(); _local10 = 0; while (_local10 < _local12) { _local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]); _local10++; }; m_debugDraw.DrawPolygon(_local14, _local12, _local5); }; break; }; } public function GetContactCount():int{ return (m_contactCount); } public function Solve(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local9:int; var _local10:int; var _local11:b2Body; var _local12:b2ContactEdge; var _local13:b2JointEdge; var _local14:Boolean; m_positionIterationCount = 0; var _local3:b2Island = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener); _local2 = m_bodyList; while (_local2) { _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); _local2 = _local2.m_next; }; var _local4:b2Contact = m_contactList; while (_local4) { _local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag)); _local4 = _local4.m_next; }; var _local5:b2Joint = m_jointList; while (_local5) { _local5.m_islandFlag = false; _local5 = _local5.m_next; }; var _local6:int = m_bodyCount; var _local7:Array = new Array(_local6); var _local8:b2Body = m_bodyList; while (_local8) { if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){ } else { if (_local8.IsStatic()){ } else { _local3.Clear(); _local9 = 0; var _temp1 = _local9; _local9 = (_local9 + 1); var _local15 = _temp1; _local7[_local15] = _local8; _local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag); while (_local9 > 0) { --_local9; _local2 = _local7[_local9]; _local3.AddBody(_local2); _local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag)); if (_local2.IsStatic()){ } else { _local12 = _local2.m_contactList; while (_local12) { if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){ } else { if (_local12.contact.m_manifoldCount == 0){ } else { _local3.AddContact(_local12.contact); _local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag); _local11 = _local12.other; if ((_local11.m_flags & b2Body.e_islandFlag)){ } else { var _temp2 = _local9; _local9 = (_local9 + 1); var _local16 = _temp2; _local7[_local16] = _local11; _local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag); }; }; }; _local12 = _local12.next; }; _local13 = _local2.m_jointList; while (_local13) { if (_local13.joint.m_islandFlag == true){ } else { _local3.AddJoint(_local13.joint); _local13.joint.m_islandFlag = true; _local11 = _local13.other; if ((_local11.m_flags & b2Body.e_islandFlag)){ } else { var _temp3 = _local9; _local9 = (_local9 + 1); _local16 = _temp3; _local7[_local16] = _local11; _local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag); }; }; _local13 = _local13.next; }; }; }; _local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep); if (_local3.m_positionIterationCount > m_positionIterationCount){ m_positionIterationCount = _local3.m_positionIterationCount; }; _local10 = 0; while (_local10 < _local3.m_bodyCount) { _local2 = _local3.m_bodies[_local10]; if (_local2.IsStatic()){ _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); }; _local10++; }; }; }; _local8 = _local8.m_next; }; _local2 = m_bodyList; while (_local2) { if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){ } else { if (_local2.IsStatic()){ } else { _local14 = _local2.SynchronizeShapes(); if ((((_local14 == false)) && (!((m_boundaryListener == null))))){ m_boundaryListener.Violation(_local2); }; }; }; _local2 = _local2.m_next; }; m_broadPhase.Commit(); } public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{ var _local4:Array = new Array(_arg3); var _local5:int = m_broadPhase.QueryAABB(_arg1, _local4, _arg3); var _local6:int; while (_local6 < _local5) { _arg2[_local6] = _local4[_local6]; _local6++; }; return (_local5); } public function SetGravity(_arg1:b2Vec2):void{ m_gravity = _arg1; } public function SolveTOI(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local3:b2Shape; var _local4:b2Shape; var _local5:b2Body; var _local6:b2Body; var _local7:b2ContactEdge; var _local11:b2Contact; var _local12:b2Contact; var _local13:Number; var _local14:b2Body; var _local15:int; var _local16:b2TimeStep; var _local17:int; var _local18:Number; var _local19:Number; var _local20:b2Body; var _local21:Boolean; var _local8:b2Island = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener); var _local9:int = m_bodyCount; var _local10:Array = new Array(_local9); _local2 = m_bodyList; while (_local2) { _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); _local2.m_sweep.t0 = 0; _local2 = _local2.m_next; }; _local11 = m_contactList; while (_local11) { _local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag))); _local11 = _local11.m_next; }; while (true) { _local12 = null; _local13 = 1; _local11 = m_contactList; for (;_local11;(_local11 = _local11.m_next)) { if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){ } else { _local18 = 1; if ((_local11.m_flags & b2Contact.e_toiFlag)){ _local18 = _local11.m_toi; } else { _local3 = _local11.m_shape1; _local4 = _local11.m_shape2; _local5 = _local3.m_body; _local6 = _local4.m_body; if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){ continue; }; _local19 = _local5.m_sweep.t0; if (_local5.m_sweep.t0 < _local6.m_sweep.t0){ _local19 = _local6.m_sweep.t0; _local5.m_sweep.Advance(_local19); } else { if (_local6.m_sweep.t0 < _local5.m_sweep.t0){ _local19 = _local5.m_sweep.t0; _local6.m_sweep.Advance(_local19); }; }; _local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep); if ((((_local18 > 0)) && ((_local18 < 1)))){ _local18 = (((1 - _local18) * _local19) + _local18); if (_local18 > 1){ _local18 = 1; }; }; _local11.m_toi = _local18; _local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag); }; if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){ _local12 = _local11; _local13 = _local18; }; }; }; if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){ break; }; _local3 = _local12.m_shape1; _local4 = _local12.m_shape2; _local5 = _local3.m_body; _local6 = _local4.m_body; _local5.Advance(_local13); _local6.Advance(_local13); _local12.Update(m_contactListener); _local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag)); if (_local12.m_manifoldCount == 0){ } else { _local14 = _local5; if (_local14.IsStatic()){ _local14 = _local6; }; _local8.Clear(); _local15 = 0; var _temp1 = _local15; _local15 = (_local15 + 1); var _local22 = _temp1; _local10[_local22] = _local14; _local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag); while (_local15 > 0) { --_local15; _local2 = _local10[_local15]; _local8.AddBody(_local2); _local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag)); if (_local2.IsStatic()){ } else { _local7 = _local2.m_contactList; while (_local7) { if (_local8.m_contactCount == _local8.m_contactCapacity){ } else { if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){ } else { if (_local7.contact.m_manifoldCount == 0){ } else { _local8.AddContact(_local7.contact); _local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag); _local20 = _local7.other; if ((_local20.m_flags & b2Body.e_islandFlag)){ } else { if (_local20.IsStatic() == false){ _local20.Advance(_local13); _local20.WakeUp(); }; var _temp2 = _local15; _local15 = (_local15 + 1); var _local23 = _temp2; _local10[_local23] = _local20; _local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag); }; }; }; }; _local7 = _local7.next; }; }; }; _local16 = new b2TimeStep(); _local16.dt = ((1 - _local13) * _arg1.dt); _local16.inv_dt = (1 / _local16.dt); _local16.maxIterations = _arg1.maxIterations; _local8.SolveTOI(_local16); _local17 = 0; while (_local17 < _local8.m_bodyCount) { _local2 = _local8.m_bodies[_local17]; _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){ } else { if (_local2.IsStatic()){ } else { _local21 = _local2.SynchronizeShapes(); if ((((_local21 == false)) && (!((m_boundaryListener == null))))){ m_boundaryListener.Violation(_local2); }; _local7 = _local2.m_contactList; while (_local7) { _local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag)); _local7 = _local7.next; }; }; }; _local17++; }; _local17 = 0; while (_local17 < _local8.m_contactCount) { _local11 = _local8.m_contacts[_local17]; _local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag))); _local17++; }; m_broadPhase.Commit(); }; }; } public function GetJointList():b2Joint{ return (m_jointList); } public function GetBodyList():b2Body{ return (m_bodyList); } public function GetPairCount():int{ return (m_broadPhase.m_pairManager.m_pairCount); } public function Validate():void{ m_broadPhase.Validate(); } public function SetWarmStarting(_arg1:Boolean):void{ m_warmStarting = _arg1; } public function SetPositionCorrection(_arg1:Boolean):void{ m_positionCorrection = _arg1; } public function CreateJoint(_arg1:b2JointDef):b2Joint{ var _local3:b2Body; var _local4:b2Shape; var _local2:b2Joint = b2Joint.Create(_arg1, m_blockAllocator); _local2.m_prev = null; _local2.m_next = m_jointList; if (m_jointList){ m_jointList.m_prev = _local2; }; m_jointList = _local2; m_jointCount++; _local2.m_node1.joint = _local2; _local2.m_node1.other = _local2.m_body2; _local2.m_node1.prev = null; _local2.m_node1.next = _local2.m_body1.m_jointList; if (_local2.m_body1.m_jointList){ _local2.m_body1.m_jointList.prev = _local2.m_node1; }; _local2.m_body1.m_jointList = _local2.m_node1; _local2.m_node2.joint = _local2; _local2.m_node2.other = _local2.m_body1; _local2.m_node2.prev = null; _local2.m_node2.next = _local2.m_body2.m_jointList; if (_local2.m_body2.m_jointList){ _local2.m_body2.m_jointList.prev = _local2.m_node2; }; _local2.m_body2.m_jointList = _local2.m_node2; if (_arg1.collideConnected == false){ _local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2; _local4 = _local3.m_shapeList; while (_local4) { _local4.RefilterProxy(m_broadPhase, _local3.m_xf); _local4 = _local4.m_next; }; }; return (_local2); } public function DestroyJoint(_arg1:b2Joint):void{ var _local5:b2Body; var _local6:b2Shape; var _local2:Boolean = _arg1.m_collideConnected; if (_arg1.m_prev){ _arg1.m_prev.m_next = _arg1.m_next; }; if (_arg1.m_next){ _arg1.m_next.m_prev = _arg1.m_prev; }; if (_arg1 == m_jointList){ m_jointList = _arg1.m_next; }; var _local3:b2Body = _arg1.m_body1; var _local4:b2Body = _arg1.m_body2; _local3.WakeUp(); _local4.WakeUp(); if (_arg1.m_node1.prev){ _arg1.m_node1.prev.next = _arg1.m_node1.next; }; if (_arg1.m_node1.next){ _arg1.m_node1.next.prev = _arg1.m_node1.prev; }; if (_arg1.m_node1 == _local3.m_jointList){ _local3.m_jointList = _arg1.m_node1.next; }; _arg1.m_node1.prev = null; _arg1.m_node1.next = null; if (_arg1.m_node2.prev){ _arg1.m_node2.prev.next = _arg1.m_node2.next; }; if (_arg1.m_node2.next){ _arg1.m_node2.next.prev = _arg1.m_node2.prev; }; if (_arg1.m_node2 == _local4.m_jointList){ _local4.m_jointList = _arg1.m_node2.next; }; _arg1.m_node2.prev = null; _arg1.m_node2.next = null; b2Joint.Destroy(_arg1, m_blockAllocator); m_jointCount--; if (_local2 == false){ _local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4; _local6 = _local5.m_shapeList; while (_local6) { _local6.RefilterProxy(m_broadPhase, _local5.m_xf); _local6 = _local6.m_next; }; }; } public function SetContactListener(_arg1:b2ContactListener):void{ m_contactListener = _arg1; } public function CreateBody(_arg1:b2BodyDef):b2Body{ if (m_lock == true){ return (null); }; var _local2:b2Body = new b2Body(_arg1, this); _local2.m_prev = null; _local2.m_next = m_bodyList; if (m_bodyList){ m_bodyList.m_prev = _local2; }; m_bodyList = _local2; m_bodyCount++; return (_local2); } public function SetBoundaryListener(_arg1:b2BoundaryListener):void{ m_boundaryListener = _arg1; } public function SetDestructionListener(_arg1:b2DestructionListener):void{ m_destructionListener = _arg1; } public function Step(_arg1:Number, _arg2:int):void{ m_lock = true; var _local3:b2TimeStep = new b2TimeStep(); _local3.dt = _arg1; _local3.maxIterations = _arg2; if (_arg1 > 0){ _local3.inv_dt = (1 / _arg1); } else { _local3.inv_dt = 0; }; _local3.dtRatio = (m_inv_dt0 * _arg1); _local3.positionCorrection = m_positionCorrection; _local3.warmStarting = m_warmStarting; m_contactManager.Collide(); if (_local3.dt > 0){ Solve(_local3); }; if (((m_continuousPhysics) && ((_local3.dt > 0)))){ SolveTOI(_local3); }; DrawDebugData(); m_inv_dt0 = _local3.inv_dt; m_lock = false; } public function GetBodyCount():int{ return (m_bodyCount); } public function GetJointCount():int{ return (m_jointCount); } } }//package Box2D.Dynamics
Section 75
//IHash (com.hurlant.crypto.hash.IHash) package com.hurlant.crypto.hash { import flash.utils.*; public interface IHash { function toString():String; function getHashSize():uint; function getInputSize():uint; function hash(_arg1:ByteArray):ByteArray; } }//package com.hurlant.crypto.hash
Section 76
//MD5 (com.hurlant.crypto.hash.MD5) package com.hurlant.crypto.hash { import flash.utils.*; public class MD5 implements IHash { public static const HASH_SIZE:int = 16; private function ff(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{ return (cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7)); } private function cmn(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint):uint{ return ((rol((((_arg2 + _arg1) + _arg4) + _arg6), _arg5) + _arg3)); } private function hh(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{ return (cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7)); } public function getHashSize():uint{ return (HASH_SIZE); } public function hash(_arg1:ByteArray):ByteArray{ var _local2:uint = (_arg1.length * 8); var _local3:String = _arg1.endian; while ((_arg1.length % 4) != 0) { _arg1[_arg1.length] = 0; }; _arg1.position = 0; var _local4:Array = []; _arg1.endian = Endian.LITTLE_ENDIAN; var _local5:uint; while (_local5 < _arg1.length) { _local4.push(_arg1.readUnsignedInt()); _local5 = (_local5 + 4); }; var _local6:Array = core_md5(_local4, _local2); var _local7:ByteArray = new ByteArray(); _local7.endian = Endian.LITTLE_ENDIAN; _local5 = 0; while (_local5 < 4) { _local7.writeUnsignedInt(_local6[_local5]); _local5++; }; _arg1.length = (_local2 / 8); _arg1.endian = _local3; return (_local7); } private function gg(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{ return (cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7)); } public function toString():String{ return ("md5"); } public function getInputSize():uint{ return (64); } private function rol(_arg1:uint, _arg2:uint):uint{ return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2)))); } private function ii(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{ return (cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7)); } private function core_md5(_arg1:Array, _arg2:uint):Array{ var _local8:uint; var _local9:uint; var _local10:uint; var _local11:uint; _arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32))); _arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2; var _local3:uint = 1732584193; var _local4:uint = 4023233417; var _local5:uint = 2562383102; var _local6:uint = 271733878; var _local7:uint; while (_local7 < _arg1.length) { _arg1[_local7] = ((_arg1[_local7]) || (0)); _arg1[(_local7 + 1)] = ((_arg1[(_local7 + 1)]) || (0)); _arg1[(_local7 + 2)] = ((_arg1[(_local7 + 2)]) || (0)); _arg1[(_local7 + 3)] = ((_arg1[(_local7 + 3)]) || (0)); _arg1[(_local7 + 4)] = ((_arg1[(_local7 + 4)]) || (0)); _arg1[(_local7 + 5)] = ((_arg1[(_local7 + 5)]) || (0)); _arg1[(_local7 + 6)] = ((_arg1[(_local7 + 6)]) || (0)); _arg1[(_local7 + 7)] = ((_arg1[(_local7 + 7)]) || (0)); _arg1[(_local7 + 8)] = ((_arg1[(_local7 + 8)]) || (0)); _arg1[(_local7 + 9)] = ((_arg1[(_local7 + 9)]) || (0)); _arg1[(_local7 + 10)] = ((_arg1[(_local7 + 10)]) || (0)); _arg1[(_local7 + 11)] = ((_arg1[(_local7 + 11)]) || (0)); _arg1[(_local7 + 12)] = ((_arg1[(_local7 + 12)]) || (0)); _arg1[(_local7 + 13)] = ((_arg1[(_local7 + 13)]) || (0)); _arg1[(_local7 + 14)] = ((_arg1[(_local7 + 14)]) || (0)); _arg1[(_local7 + 15)] = ((_arg1[(_local7 + 15)]) || (0)); _local8 = _local3; _local9 = _local4; _local10 = _local5; _local11 = _local6; _local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, 3614090360); _local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, 3905402710); _local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819); _local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, 3250441966); _local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, 4118548399); _local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426); _local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, 2821735955); _local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, 4249261313); _local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416); _local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, 2336552879); _local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, 4294925233); _local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, 2304563134); _local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682); _local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, 4254626195); _local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, 2792965006); _local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329); _local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, 4129170786); _local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, 3225465664); _local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713); _local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, 3921069994); _local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, 3593408605); _local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083); _local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, 3634488961); _local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, 3889429448); _local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438); _local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, 3275163606); _local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, 4107603335); _local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501); _local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, 2850285829); _local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, 4243563512); _local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473); _local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, 2368359562); _local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, 4294588738); _local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, 2272392833); _local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562); _local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, 4259657740); _local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, 2763975236); _local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353); _local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, 4139469664); _local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, 3200236656); _local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174); _local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, 3936430074); _local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, 3572445317); _local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189); _local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, 3654602809); _local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, 3873151461); _local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520); _local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, 3299628645); _local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, 4096336452); _local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415); _local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, 2878612391); _local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, 4237533241); _local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571); _local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, 2399980690); _local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, 4293915773); _local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, 2240044497); _local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359); _local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, 4264355552); _local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, 2734768916); _local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649); _local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, 4149444226); _local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, 3174756917); _local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259); _local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, 3951481745); _local3 = (_local3 + _local8); _local4 = (_local4 + _local9); _local5 = (_local5 + _local10); _local6 = (_local6 + _local11); _local7 = (_local7 + 16); }; return ([_local3, _local4, _local5, _local6]); } } }//package com.hurlant.crypto.hash
Section 77
//ArrayUtil (com.hurlant.util.ArrayUtil) package com.hurlant.util { import flash.utils.*; public class ArrayUtil { public static function equals(_arg1:ByteArray, _arg2:ByteArray):Boolean{ if (_arg1.length != _arg2.length){ return (false); }; var _local3:int = _arg1.length; var _local4:int; while (_local4 < _local3) { if (_arg1[_local4] != _arg2[_local4]){ return (false); }; _local4++; }; return (true); } } }//package com.hurlant.util
Section 78
//Base64 (com.hurlant.util.Base64) package com.hurlant.util { import flash.utils.*; public class Base64 { public static const version:String = "1.0.0"; private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; public function Base64(){ throw (new Error("Base64 class is static container only")); } public static function encode(_arg1:String):String{ var _local2:ByteArray = new ByteArray(); _local2.writeUTFBytes(_arg1); return (encodeByteArray(_local2)); } public static function encodeByteArray(_arg1:ByteArray):String{ var _local3:Array; var _local5:uint; var _local6:uint; var _local7:uint; var _local2 = ""; var _local4:Array = new Array(4); _arg1.position = 0; while (_arg1.bytesAvailable > 0) { _local3 = new Array(); _local5 = 0; while ((((_local5 < 3)) && ((_arg1.bytesAvailable > 0)))) { _local3[_local5] = _arg1.readUnsignedByte(); _local5++; }; _local4[0] = ((_local3[0] & 252) >> 2); _local4[1] = (((_local3[0] & 3) << 4) | (_local3[1] >> 4)); _local4[2] = (((_local3[1] & 15) << 2) | (_local3[2] >> 6)); _local4[3] = (_local3[2] & 63); _local6 = _local3.length; while (_local6 < 3) { _local4[(_local6 + 1)] = 64; _local6++; }; _local7 = 0; while (_local7 < _local4.length) { _local2 = (_local2 + BASE64_CHARS.charAt(_local4[_local7])); _local7++; }; }; return (_local2); } public static function decode(_arg1:String):String{ var _local2:ByteArray = decodeToByteArray(_arg1); return (_local2.readUTFBytes(_local2.length)); } public static function decodeToByteArray(_arg1:String):ByteArray{ var _local6:uint; var _local7:uint; var _local2:ByteArray = new ByteArray(); var _local3:Array = new Array(4); var _local4:Array = new Array(3); var _local5:uint; while (_local5 < _arg1.length) { _local6 = 0; while ((((_local6 < 4)) && (((_local5 + _local6) < _arg1.length)))) { _local3[_local6] = BASE64_CHARS.indexOf(_arg1.charAt((_local5 + _local6))); _local6++; }; _local4[0] = ((_local3[0] << 2) + ((_local3[1] & 48) >> 4)); _local4[1] = (((_local3[1] & 15) << 4) + ((_local3[2] & 60) >> 2)); _local4[2] = (((_local3[2] & 3) << 6) + _local3[3]); _local7 = 0; while (_local7 < _local4.length) { if (_local3[(_local7 + 1)] == 64){ break; }; _local2.writeByte(_local4[_local7]); _local7++; }; _local5 = (_local5 + 4); }; _local2.position = 0; return (_local2); } } }//package com.hurlant.util
Section 79
//ApiConnection (com.kongregate.ApiConnection) package com.kongregate { import flash.display.*; import flash.events.*; import flash.net.*; import flash.system.*; public class ApiConnection extends Loader { private var __type:String; public var userLevelData:Object; private var __loaded:Boolean; private var __url:String; public var userLevelAvailable:Boolean; private var __api:Object; public function ApiConnection(_arg1:Stage){ userLevelData = new Object(); super(); this.__loaded = false; this.__type = "kongregate"; Security.allowDomain("*"); var _local2:Object = LoaderInfo(_arg1.loaderInfo).parameters; this.__url = ((_local2.api_path)!=undefined) ? _local2.api_path : "http://www.kongregate.com/flash/API_AS3_Local.swf"; this.contentLoaderInfo.addEventListener(Event.COMPLETE, this.__loaderComplete); _arg1.addChild(this); } private function __loaderComplete(_arg1:Event):void{ this.__loaded = true; this.__api = _arg1.target.content; this.__api.sharedContent.addLoadListener("Level", onLoadLevel); this.__api.services.connect(); var _local2:* = new ApiConnectionEvent(ApiConnectionEvent.CONNECTED); this.dispatchEvent(_local2); } public function get scores():Object{ if (!this.loaded){ return (null); }; return (this.__api.scores); } public function get type():String{ return (this.__type); } public function get user():Object{ if (!this.loaded){ return (null); }; return (this.__api.user); } public function get loaded():Boolean{ return (this.__loaded); } public function get services():Object{ if (!this.loaded){ return (null); }; return (this.__api.services); } private function onLoadLevel(_arg1:Object):void{ userLevelData.id = _arg1.id; userLevelData.name = _arg1.name; userLevelData.permalink = _arg1.permalink; userLevelData.content = _arg1.content; userLevelData.label = _arg1.label; userLevelAvailable = true; var _local2:* = new ApiConnectionEvent(ApiConnectionEvent.USER_LEVEL); this.dispatchEvent(_local2); } public function connect():void{ var _local1:URLRequest; if (!this.connected){ _local1 = new URLRequest(this.__url); this.load(_local1); }; } public function get url():String{ return (this.__url); } public function get sharedContent():Object{ if (!this.loaded){ return (null); }; return (this.__api.sharedContent); } public function get connected():Boolean{ return (((this.__api)!=null) ? this.__api.isConnected() : false); } public function get stats():Object{ if (!this.loaded){ return (null); }; return (this.__api.stats); } } }//package com.kongregate
Section 80
//ApiConnectionEvent (com.kongregate.ApiConnectionEvent) package com.kongregate { import flash.events.*; public class ApiConnectionEvent extends Event { public static const USER_LEVEL:String = "user level"; public static const CONNECTED:String = "connected"; public function ApiConnectionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function toString():String{ return ((((((((("[ApiConnectionEvent type=\"" + this.type) + "\" bubbles=") + this.bubbles) + " cancelable=") + this.cancelable) + " eventPhase=") + this.eventPhase) + "]")); } override public function clone():Event{ return (new ApiConnectionEvent(this.type, this.bubbles, this.cancelable)); } } }//package com.kongregate
Section 81
//CircCursor (com.leveleditor.CircCursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class CircCursor extends Cursor { public var disabledIcon:MovieClip; public function CircCursor():void{ rect = new Rectangle(0, 0, 0, 0); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 82
//CrateCursor (com.leveleditor.CrateCursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class CrateCursor extends Cursor { public var disabledIcon:MovieClip; public function CrateCursor():void{ rect = new Rectangle(0, 0, 20, 20); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 83
//CrateEditor (com.leveleditor.CrateEditor) package com.leveleditor { public class CrateEditor extends EditableObject { public function CrateEditor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.5); graphics.beginFill(0xFF, 0.1); graphics.drawRect((rect.x - 1), (rect.y - 1), (rect.width + 2), (rect.height + 2)); graphics.endFill(); } } }//package com.leveleditor
Section 84
//CTCursor (com.leveleditor.CTCursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class CTCursor extends Cursor { public var disabledIcon:MovieClip; public function CTCursor():void{ rect = new Rectangle(0, 0, 23, 37); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 85
//CTEditor (com.leveleditor.CTEditor) package com.leveleditor { import flash.geom.*; public class CTEditor extends EditableObject { public function CTEditor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; rect = new Rectangle(0, 0, 23, 37); } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.5); graphics.beginFill(0xFF, 0.1); graphics.drawRect(rect.x, rect.y, rect.width, rect.height); graphics.endFill(); } } }//package com.leveleditor
Section 86
//Cursor (com.leveleditor.Cursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class Cursor extends Sprite { public var rect:Rectangle; public function Cursor():void{ } public function get disabled():Boolean{ return (false); } public function set disabled(_arg1:Boolean):void{ } } }//package com.leveleditor
Section 87
//DragNode (com.leveleditor.DragNode) package com.leveleditor { import flash.display.*; import flash.events.*; public class DragNode extends Sprite { private var isDown:Boolean;// = false private var state:String;// = "up" public var id:String; private var isOver:Boolean;// = false private var hitMask:Sprite; public function DragNode():void{ hitMask = new Sprite(); super(); hitMask.graphics.clear(); hitMask.graphics.beginFill(0xFF); hitMask.graphics.drawCircle(0, 0, 8); hitMask.graphics.endFill(); addChild(hitMask); hitMask.visible = false; hitMask.mouseEnabled = false; hitArea = hitMask; addEventListener(MouseEvent.ROLL_OVER, handleOver); addEventListener(MouseEvent.ROLL_OUT, handleOut); addEventListener(MouseEvent.MOUSE_DOWN, handleDown); addEventListener(MouseEvent.MOUSE_UP, handleUp); draw(); visible = false; } private function handleOver(_arg1:MouseEvent):void{ state = "over"; isOver = true; draw(); } private function draw():void{ graphics.clear(); switch (state){ case "up": graphics.lineStyle(); graphics.beginFill(0xFF00); graphics.drawRect(-4, -4, 8, 8); graphics.endFill(); break; case "over": graphics.lineStyle(); graphics.beginFill(0xFFFFFF); graphics.drawRect(-4, -4, 8, 8); graphics.endFill(); break; case "down": graphics.clear(); graphics.lineStyle(); graphics.beginFill(0xFFFFFF); graphics.drawRect(-4, -4, 8, 8); graphics.endFill(); graphics.lineStyle(1, 0xFFFFFF); graphics.drawRect(-5.5, -5.5, 11, 11); break; }; } private function handleOut(_arg1:MouseEvent):void{ state = "up"; isOver = false; draw(); } private function handleDown(_arg1:MouseEvent):void{ state = "down"; isDown = true; draw(); } private function handleUp(_arg1:MouseEvent):void{ isDown = false; if (isOver){ state = "over"; } else { state = "up"; }; } } }//package com.leveleditor
Section 88
//EditableCircle (com.leveleditor.EditableCircle) package com.leveleditor { import flash.geom.*; import flash.display.*; import flash.events.*; public class EditableCircle extends EditableObject { private var rad:int;// = 10 public function EditableCircle(_arg1:int=0, _arg2:int=0, _arg3:int=10):void{ rect.x = 0; rect.y = 0; rect.width = 0; rect.height = 0; overlay.x = (x = _arg1); overlay.y = (y = _arg2); var _local4:DragNode = new DragNode(); _local4.id = "TL"; _local4.x = _arg3; nodes.push(_local4); addChild(_local4); calcRect(); draw(); } public function get radius():Number{ return (rad); } override protected function draw():void{ calcRect(); if (((((x + nodes[0].x) > 380)) && ((nodes[0].x > 0)))){ nodes[0].x = (nodes[0].x * -1); }; if ((x + nodes[0].x) < 10){ nodes[0].x = (nodes[0].x * -1); }; graphics.clear(); if (((_selected) || (highlighted))){ graphics.lineStyle(2, 3355647, 0.5); graphics.beginFill(0xFF, 0.3); } else { graphics.lineStyle(); graphics.beginFill(0xFF, 0.01); }; graphics.drawCircle(0, 0, rad); graphics.endFill(); overlay.graphics.clear(); overlay.graphics.lineStyle(); overlay.graphics.beginFill(0xFF); overlay.graphics.drawCircle(0, 0, rad); overlay.graphics.endFill(); } override public function setData3(_arg1:int):void{ rad = _arg1; updateObject(); } override protected function updateObject():void{ if (rad < 10){ rad = 10; } else { if (rad > 190){ rad = 190; }; }; nodes[0].x = rad; if ((x + nodes[0].x) > 380){ nodes[0].x = -(rad); } else { nodes[0].x = rad; }; nodes[0].y = 0; overlay.x = x; overlay.y = y; draw(); } protected function calcRect():void{ var _local1:int = nodes[0].x; var _local2:int = nodes[0].y; if (gridMode){ _local1 = (int((_local1 / 10)) * 10); _local2 = (int((_local2 / 10)) * 10); }; var _local3:Point = new Point(_local1, _local2); rad = _local3.length; } override public function get info():Object{ infoObj.data1 = (int(x) - 10); infoObj.data2 = int(y); infoObj.data3 = int(rad); return (infoObj); } } }//package com.leveleditor
Section 89
//EditableObject (com.leveleditor.EditableObject) package com.leveleditor { import flash.geom.*; import flash.display.*; import flash.events.*; public class EditableObject extends Sprite { public var overlay:Sprite; protected var highlighted:Boolean; public var matId:int; public var rect:Rectangle; protected var updateFirst:Boolean; public var id:String; protected var isDown:Boolean; protected var nodes:Array; protected var _selected:Boolean; protected static const changeEvent = new EditorEvent(EditorEvent.CHANGE); protected static const selectEvent = new EditorEvent(EditorEvent.SELECT); public static var gridMode:Boolean = false; protected static var _highlightable:Boolean = true; protected static var dragObject:Object; protected static var suppressed:Boolean = false; protected static var dy:Number = 0; public static var boundWH:Point; protected static var isDragging:Boolean = false; protected static var dx:Number = 0; protected static var infoObj:Object = {data1:0, data2:0, data3:0, data4:0}; protected static var curSelected:EditableObject; public static var boundTL:Point; public function EditableObject():void{ overlay = new Sprite(); super(); if (!boundTL){ boundTL = new Point(10, 0); boundWH = new Point(380, 490); }; overlay = new Sprite(); overlay.mouseEnabled = false; overlay.mouseChildren = false; rect = new Rectangle(-10, -10, 20, 20); nodes = new Array(); _selected = false; addEventListener(MouseEvent.CLICK, handleClick); addEventListener(MouseEvent.MOUSE_DOWN, handleDown); addEventListener(MouseEvent.MOUSE_UP, handleUp); addEventListener(MouseEvent.ROLL_OUT, handleOut); addEventListener(MouseEvent.ROLL_OVER, handleOver); } protected function handleClick(_arg1:MouseEvent=null):void{ if (suppressed){ return; }; deselectAll(); selected = true; curSelected = this; var _local2:EditorEvent = new EditorEvent(EditorEvent.SELECT); _local2.obj = curSelected; dispatchEvent(_local2); } public function moveTo(_arg1:int, _arg2:int):void{ overlay.x = (x = _arg1); overlay.y = (y = _arg2); } protected function handleOut(_arg1:MouseEvent):void{ if (isDragging){ return; }; highlighted = false; draw(); } public function setData3(_arg1:int):void{ } protected function draw():void{ } public function setData1(_arg1:int):void{ _arg1 = (_arg1 + 10); if (_arg1 < 10){ _arg1 = 10; }; var _local2:int = (390 - rect.width); if (_arg1 > _local2){ _arg1 = _local2; }; overlay.x = (x = _arg1); } protected function delayedDraw(_arg1:Event):void{ removeEventListener(Event.ENTER_FRAME, delayedDraw); draw(); } public function set material(_arg1:int):void{ matId = _arg1; dispatchEvent(new Event(Event.CHANGE, true, true)); } protected function hideNodes():void{ var _local1:int; while (_local1 < nodes.length) { nodes[_local1].visible = false; _local1++; }; } public function setData4(_arg1:int):void{ } protected function handleMove(_arg1:MouseEvent):void{ if (((((gridMode) && (isDown))) && (!((dragObject is DragNode))))){ if ((dragObject is LTEditor)){ x = (int(((parent.mouseX + dx) / 10)) * 10); y = (int(((parent.mouseY + dy) / 10)) * 10); } else { if ((dragObject is RTEditor)){ x = (int(((parent.mouseX + dx) / 10)) * 10); y = (int(((parent.mouseY + dy) / 10)) * 10); } else { if ((dragObject is CTEditor)){ x = (int(((parent.mouseX + dx) / 10)) * 10); y = (int(((parent.mouseY + dy) / 10)) * 10); } else { x = (int(((parent.mouseX + dx) / 10)) * 10); y = (int(((parent.mouseY + dy) / 10)) * 10); }; }; }; }; overlay.x = x; overlay.y = y; draw(); _arg1.updateAfterEvent(); var _local2:EditorEvent = new EditorEvent(EditorEvent.CHANGE); _local2.obj = curSelected; dispatchEvent(_local2); } protected function removeMoveHandler():void{ stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleMove); dragObject.stopDrag(); isDragging = false; if ((dragObject is DragNode)){ dragObject.parent.isDown = false; } else { dragObject.isDown = false; }; updateObject(); draw(); overlay.x = x; overlay.y = y; highlighted = false; if ((this is SpawnerEditor)){ addEventListener(Event.ENTER_FRAME, delayedDraw); } else { draw(); }; showNodes(); dispatchEvent(new EditorEvent(EditorEvent.STOPDRAG)); } public function setData2(_arg1:int):void{ var _local2:int = (480 - rect.height); if (_arg1 > _local2){ _arg1 = _local2; }; y = _arg1; overlay.y = _arg1; } public function dispose():void{ if (overlay.parent){ overlay.parent.removeChild(overlay); }; if (parent){ parent.removeChild(this); }; } protected function handleUp(_arg1:MouseEvent):void{ isDown = false; if (((isDragging) && ((_arg1.target == dragObject)))){ stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleMove); updateObject(); isDragging = false; if ((this is SpawnerEditor)){ addEventListener(Event.ENTER_FRAME, delayedDraw); } else { draw(); }; _arg1.target.stopDrag(); dragObject = null; overlay.x = x; overlay.y = y; showNodes(); dispatchEvent(new EditorEvent(EditorEvent.STOPDRAG)); }; } protected function updateObject():void{ } protected function handleOver(_arg1:MouseEvent):void{ if (isDragging){ return; }; if (_highlightable){ highlighted = true; draw(); }; } public function get info():Object{ infoObj.data1 = (x - 10); infoObj.data2 = y; return (infoObj); } protected function showNodes():void{ var _local1:int; while (_local1 < nodes.length) { nodes[_local1].visible = true; _local1++; }; } public function set selected(_arg1:Boolean):void{ _selected = _arg1; overlay.visible = _arg1; curSelected = this; if (_arg1){ showNodes(); } else { hideNodes(); }; draw(); } protected function handleDown(_arg1:MouseEvent):void{ var _local4:int; var _local5:int; var _local6:int; var _local7:int; var _local8:int; var _local9:int; if (suppressed){ return; }; if (isDragging){ return; }; stage.addEventListener(MouseEvent.MOUSE_MOVE, handleMove); handleClick(); var _local2:DisplayObject = (_arg1.target as DisplayObject); var _local3:Point = _local2.parent.globalToLocal(boundTL); if ((_local2 is DragNode)){ _arg1.target.startDrag(false, new Rectangle(_local3.x, _local3.y, boundWH.x, boundWH.y)); } else { _local4 = rect.width; _local5 = rect.height; _local6 = (_local4 / 2); _local7 = (_local5 / 2); _local8 = rect.x; _local9 = rect.y; dx = (this.x - parent.mouseX); dy = (this.y - parent.mouseY); if ((((((_local2 is CTEditor)) || ((_local2 is RTEditor)))) || ((_local2 is LTEditor)))){ if (!gridMode){ _arg1.target.startDrag(false, new Rectangle(_local3.x, _local3.y, (boundWH.x - _local4), (boundWH.y - _local5))); }; } else { if ((_local2 is EditableRectangle)){ if (!gridMode){ _arg1.target.startDrag(false, new Rectangle(_local3.x, _local3.y, (boundWH.x - _local4), (boundWH.y - _local5))); }; } else { if (!gridMode){ _arg1.target.startDrag(false, new Rectangle((_local3.x + _local6), (_local3.y + _local7), (boundWH.x - _local4), (boundWH.y - _local5))); }; }; }; isDown = true; hideNodes(); }; isDragging = true; dragObject = _arg1.target; draw(); dispatchEvent(new EditorEvent(EditorEvent.STARTDRAG)); } public static function set highlightable(_arg1:Boolean):void{ _highlightable = _arg1; } public static function deselectAll():void{ if (curSelected){ curSelected.selected = false; curSelected = null; }; } public static function set suppressSelect(_arg1:Boolean):void{ suppressed = _arg1; } public static function stopDragging():void{ if (isDragging){ if ((dragObject is DragNode)){ dragObject.parent.removeMoveHandler(); } else { dragObject.removeMoveHandler(); }; dragObject = null; }; } public static function get selectedObject():EditableObject{ return (curSelected); } } }//package com.leveleditor
Section 90
//EditablePolygon (com.leveleditor.EditablePolygon) package com.leveleditor { import flash.geom.*; import flash.display.*; import flash.events.*; public class EditablePolygon extends EditableObject { private var screenHit:Sprite; public var mode:String;// = "edit" public function EditablePolygon():void{ screenHit = new Sprite(); super(); screenHit.graphics.beginFill(0xFF); screenHit.graphics.drawRect(10, 0, 380, 490); screenHit.graphics.endFill(); draw(); } protected function drawPoly():void{ graphics.clear(); if (((_selected) || (highlighted))){ graphics.lineStyle(0, 0xFF, 0.5); graphics.beginFill(0xFF, 0.3); } else { graphics.lineStyle(); graphics.beginFill(0xFF, 0.01); }; graphics.moveTo(nodes[0].x, nodes[0].y); var _local1 = 1; while (_local1 < nodes.length) { graphics.lineTo(nodes[_local1].x, nodes[_local1].y); _local1++; }; graphics.endFill(); overlay.graphics.clear(); overlay.graphics.lineStyle(); overlay.graphics.beginFill(0xFF); overlay.graphics.moveTo(nodes[0].x, nodes[0].y); _local1 = 1; while (_local1 < nodes.length) { overlay.graphics.lineTo(nodes[_local1].x, nodes[_local1].y); _local1++; }; overlay.graphics.endFill(); } public function addNode(_arg1:int, _arg2:int):void{ var _local3:DragNode; _local3 = new DragNode(); _local3.x = _arg1; _local3.y = _arg2; nodes.push(_local3); addChild(_local3); } override protected function draw():void{ if (mode == "edit"){ if (!nodes[0]){ return; }; drawPoly(); }; } override protected function updateObject():void{ var _local1:int; while (_local1 < nodes.length) { nodes[_local1].x = (nodes[_local1].x + x); nodes[_local1].y = (nodes[_local1].y + y); _local1++; }; x = (y = 0); drawPoly(); } protected function calcRect():void{ } } }//package com.leveleditor
Section 91
//EditableRectangle (com.leveleditor.EditableRectangle) package com.leveleditor { import flash.geom.*; import flash.display.*; import flash.events.*; public class EditableRectangle extends EditableObject { private var count:int; public function EditableRectangle(_arg1:int=0, _arg2:int=0, _arg3:int=20, _arg4:int=20):void{ var _local5:DragNode; super(); overlay.x = (x = (_arg1 - (_arg3 / 2))); overlay.y = (y = (_arg2 - (_arg4 / 2))); rect.x = x; rect.y = y; rect.width = _arg3; rect.height = _arg4; _local5 = new DragNode(); _local5.id = "TL"; _local5.x = 0; _local5.y = 0; nodes.push(_local5); addChild(_local5); _local5 = new DragNode(); _local5.x = _arg3; _local5.y = _arg4; _local5.id = "BR"; nodes.push(_local5); addChild(_local5); draw(); } override public function setData4(_arg1:int):void{ if (_arg1 < 5){ _arg1 = 5; }; var _local2:int = (490 - (y + rect.y)); if (_arg1 > _local2){ _arg1 = _local2; }; rect.height = _arg1; updateFirst = true; draw(); } override protected function draw():void{ calcRect(); overlay.x = x; overlay.y = y; graphics.clear(); if (((_selected) || (highlighted))){ graphics.lineStyle(2, 3355647, 0.5); graphics.beginFill(0xFF, 0.3); } else { graphics.lineStyle(); graphics.beginFill(0xFF, 0.01); }; graphics.drawRect(rect.x, rect.y, rect.width, rect.height); graphics.endFill(); overlay.graphics.clear(); overlay.graphics.lineStyle(); overlay.graphics.beginFill(0xFF); overlay.graphics.drawRect(rect.x, rect.y, rect.width, rect.height); overlay.graphics.endFill(); } override public function get info():Object{ infoObj.data1 = (int((x + rect.x)) - 10); infoObj.data2 = int((y + rect.y)); infoObj.data3 = int(rect.width); infoObj.data4 = int(rect.height); return (infoObj); } override public function setData2(_arg1:int):void{ var _local2:int = (490 - rect.height); if (_arg1 > _local2){ _arg1 = _local2; }; var _local3:Point = new Point(0, _arg1); var _local4:Point = globalToLocal(_local3); overlay.y = (y = (_local3.y + (rect.height / 2))); draw(); } override public function setData3(_arg1:int):void{ if (_arg1 < 5){ _arg1 = 5; }; var _local2:int = (390 - (x + rect.x)); if (_arg1 > _local2){ _arg1 = _local2; }; rect.width = _arg1; updateFirst = true; draw(); } override protected function updateObject():void{ x = (x + rect.x); y = (y + rect.y); nodes[0].x = 0; nodes[0].y = 0; nodes[1].x = rect.width; nodes[1].y = rect.height; rect.x = 0; rect.y = 0; } protected function calcRect():void{ var _local5:Point; var _local6:int; var _local1:Number = nodes[0].x; var _local2:Number = nodes[0].y; var _local3:Number = nodes[1].x; var _local4:Number = nodes[1].y; if (gridMode){ if (dragObject){ if (dragObject == nodes[0]){ _local5 = new Point(_local1, _local2); _local5 = this.localToGlobal(_local5); _local5.x = (int((_local5.x / 10)) * 10); _local5.y = (int((_local5.y / 10)) * 10); _local5 = this.globalToLocal(_local5); _local1 = _local5.x; _local2 = _local5.y; if (!isDragging){ nodes[0].x = _local1; nodes[0].y = _local2; dragObject = null; }; } else { if (dragObject == nodes[1]){ _local5 = new Point(_local3, _local4); _local5 = this.localToGlobal(_local5); _local5.x = (int((_local5.x / 10)) * 10); _local5.y = (int((_local5.y / 10)) * 10); _local5 = this.globalToLocal(_local5); _local3 = _local5.x; _local4 = _local5.y; if (!isDragging){ nodes[1].x = _local3; nodes[1].y = _local4; dragObject = null; }; }; }; }; }; if (_local3 < _local1){ _local6 = _local1; _local1 = _local3; _local3 = _local6; }; if (_local4 < _local2){ _local6 = _local2; _local2 = _local4; _local4 = _local6; }; rect.left = _local1; rect.right = _local3; rect.top = _local2; rect.bottom = _local4; } override public function setData1(_arg1:int):void{ _arg1 = (_arg1 + 10); if (_arg1 < 10){ _arg1 = 10; }; var _local2:int = (380 - rect.width); if (_arg1 > _local2){ _arg1 = _local2; }; overlay.x = (x = (_arg1 + (rect.width / 2))); draw(); } } }//package com.leveleditor
Section 92
//EditorDisplay (com.leveleditor.EditorDisplay) package com.leveleditor { import flash.geom.*; import flash.display.*; import flash.events.*; import flash.utils.*; import com.*; import flash.system.*; import flash.ui.*; public class EditorDisplay extends Sprite { public var metal:MovieClip; private var gridMode:Boolean;// = false public var gridBG:MovieClip; public var crates:Array; public var editorHitArea:DisplayScreenHit; public var objects:Array; public var isDragging:Boolean;// = false public var powerups:Array; private var mode:String;// = "Edit" public var gridIndex:int; public var _levelName:String;// = "Level Name..." public var torches:Array; public var supressDelete:Boolean;// = false public var needed:int;// = 1 private var csrMgr:CursorManager; public var brick:MovieClip; public var overlay:MovieClip; public var ballSpawner:SpawnerEditor; private var lastObject:EditableObject; public var lifes:int;// = 1 public var glass:MovieClip; public function EditorDisplay():void{ var _local2:BitmapData; objects = new Array(); torches = new Array(); crates = new Array(); powerups = new Array(); super(); gridIndex = this.getChildIndex(gridBG); gridBG.visible = false; var _local1:BitmapData = new BitmapData(400, 500, false, 0); var _local3:Sprite = new Sprite(); _local3.graphics.beginBitmapFill(new BrickBitmap(20, 20)); _local3.graphics.drawRect(0, 0, 400, 500); _local3.graphics.endFill(); _local2 = new BitmapData(400, 500, false, 0); _local2.draw(_local3); _local1.noise((Math.random() * int.MAX_VALUE), 0, 10, 7, true); _local2.draw(_local1, null, null, "add"); brick.overlay.graphics.beginBitmapFill(_local2); brick.overlay.graphics.drawRect(0, 0, 400, 500); brick.overlay.graphics.endFill(); brick.overlay.mouseEnabled = false; _local3.graphics.clear(); _local3.graphics.beginBitmapFill(new MetalBitmap(13, 16)); _local3.graphics.drawRect(0, 0, 400, 500); _local3.graphics.endFill(); _local2 = new BitmapData(400, 500, false, 0); _local2.draw(_local3); _local1.noise((Math.random() * int.MAX_VALUE), 0, 10, 7, true); _local2.draw(_local1, null, null, "add"); metal.overlay.graphics.beginBitmapFill(_local2); metal.overlay.graphics.drawRect(0, 0, 400, 500); metal.overlay.graphics.endFill(); metal.overlay.mouseEnabled = false; glass.overlay.graphics.beginFill(1060992); glass.overlay.graphics.drawRect(0, 0, 400, 500); glass.overlay.graphics.endFill(); glass.alpha = 0.5; glass.overlay.mouseEnabled = false; hitArea = editorHitArea; editorHitArea.visible = false; editorHitArea.mouseEnabled = false; csrMgr = CursorManager.instance; addEventListener(MouseEvent.ROLL_OVER, handleOver); addEventListener(MouseEvent.ROLL_OUT, handleOut); addEventListener(MouseEvent.CLICK, handleClick); addEventListener(MouseEvent.MOUSE_UP, handleUp); addEventListener(Event.ADDED_TO_STAGE, handleAdded); addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved); csrMgr.addEventListener(Event.CHANGE, handleCursorChange); addEventListener(EditorEvent.STARTDRAG, handleStartDrag); addEventListener(EditorEvent.STOPDRAG, handleStopDrag); addEventListener(Event.CHANGE, handleMaterialChange); } protected function parseData(_arg1:ByteArray):void{ var len:int; var i:int; var type:int; var _x:int; var _y:int; var _w:int; var _h:int; var obj:EditableObject; var _r:int; var dat = _arg1; resetBoard(); try { dat.position = 0; levelName = dat.readUTF(); lifes = dat.readUnsignedByte(); needed = dat.readUnsignedByte(); ballSpawner.x = dat.readUnsignedShort(); ballSpawner.y = dat.readUnsignedShort(); len = dat.readUnsignedShort(); i = 0; while (i < len) { type = dat.readUnsignedByte(); if (type == 0){ _x = dat.readUnsignedShort(); _y = dat.readUnsignedShort(); _w = dat.readUnsignedShort(); _h = dat.readUnsignedShort(); obj = new EditableRectangle(_x, _y, _w, _h); obj.matId = dat.readUnsignedByte(); changeMaterial(obj); objects.push(obj); } else { if (type == 1){ _x = dat.readUnsignedShort(); _y = dat.readUnsignedShort(); _r = dat.readUnsignedShort(); obj = new EditableCircle(_x, _y, _r); obj.matId = dat.readUnsignedByte(); changeMaterial(obj); objects.push(obj); }; }; i = (i + 1); }; len = dat.readUnsignedShort(); i = 0; while (i < len) { _x = dat.readUnsignedShort(); _y = dat.readUnsignedShort(); obj = new CrateEditor(_x, _y); overlay.addChild(obj); crates.push(obj); i = (i + 1); }; len = dat.readUnsignedShort(); i = 0; while (i < len) { type = dat.readUnsignedByte(); _x = dat.readUnsignedShort(); _y = dat.readUnsignedShort(); if (type == 0){ obj = new LTEditor(_x, _y); } else { if (type == 1){ obj = new RTEditor(_x, _y); } else { obj = new CTEditor(_x, _y); }; }; overlay.addChild(obj); torches.push(obj); i = (i + 1); }; len = dat.readUnsignedShort(); i = 0; while (i < len) { type = dat.readUnsignedByte(); _x = dat.readUnsignedShort(); _y = dat.readUnsignedShort(); if (type == 0){ obj = new Pow1Editor(_x, _y); } else { if (type == 1){ obj = new Pow2Editor(_x, _y); } else { if (type == 2){ obj = new Pow3Editor(_x, _y); } else { obj = new Pow4Editor(_x, _y); }; }; }; overlay.addChild(obj); powerups.push(obj); i = (i + 1); }; } catch(e:Error) { }; dispatchEvent(new EditorEvent(EditorEvent.LOAD)); } protected function handleCursorChange(_arg1:Event):void{ var _local2:Rectangle = csrMgr.bounds; editorHitArea.width = (380 - _local2.width); editorHitArea.height = (490 - _local2.height); if (mode != csrMgr.mode){ mode = csrMgr.mode; EditableObject.deselectAll(); EditableObject.highlightable = (mode == "Edit"); EditableObject.suppressSelect = false; }; } public function set grid(_arg1:Boolean):void{ gridMode = _arg1; gridBG.visible = _arg1; EditableObject.gridMode = _arg1; } private function handleOut(_arg1:MouseEvent):void{ csrMgr.hide(); if (isDragging){ stopDragging(); }; } protected function handleRemoved(_arg1:Event):void{ stage.removeEventListener(KeyboardEvent.KEY_UP, handleKeyboard); } private function handleOver(_arg1:MouseEvent):void{ csrMgr.show(); } protected function handleStopDrag(_arg1:EditorEvent):void{ isDragging = false; } public function get data():ByteArray{ return (generateData()); } public function get levelName():String{ return (_levelName); } protected function handleAdded(_arg1:Event):void{ stage.addEventListener(KeyboardEvent.KEY_UP, handleKeyboard); } protected function handleKeyboard(_arg1:KeyboardEvent):void{ var _local3:int; var _local4:int; var _local6:int; var _local7:int; var _local8:int; var _local9:int; var _local10:int; var _local11:Array; var _local2:EditableObject = EditableObject.selectedObject; if (!_local2){ return; }; switch (_arg1.keyCode){ case Keyboard.UP: if (_arg1.shiftKey){ _local4 = -5; } else { _local4 = -1; }; break; case Keyboard.DOWN: if (_arg1.shiftKey){ _local4 = 5; } else { _local4 = 1; }; break; case Keyboard.LEFT: if (_arg1.shiftKey){ _local3 = -5; } else { _local3 = -1; }; break; case Keyboard.RIGHT: if (_arg1.shiftKey){ _local3 = 5; } else { _local3 = 1; }; break; case Keyboard.DELETE: case Keyboard.BACKSPACE: if ((((_local2 is SpawnerEditor)) || (supressDelete))){ return; }; if ((((((_local2 is LTEditor)) || ((_local2 is CTEditor)))) || ((_local2 is RTEditor)))){ _local11 = torches; } else { if ((_local2 is CrateEditor)){ _local11 = crates; } else { if ((((((((_local2 is Pow1Editor)) || ((_local2 is Pow2Editor)))) || ((_local2 is Pow3Editor)))) || ((_local2 is Pow4Editor)))){ _local11 = powerups; } else { _local11 = objects; _local2.overlay.parent.removeChild(_local2.overlay); }; }; }; overlay.removeChild(_local2); _local10 = _local11.indexOf(_local2); _local11.splice(_local10, 1); EditableObject.deselectAll(); return; default: return; }; var _local5:Rectangle = _local2.rect; if ((((((_local2 is LTEditor)) || ((_local2 is CTEditor)))) || ((_local2 is RTEditor)))){ _local6 = 10; } else { _local6 = (10 - (_local5.width / 2)); _local8 = (_local5.height / 2); }; _local7 = (380 - _local5.width); _local9 = (490 - _local5.height); _local3 = (_local3 + _local2.x); _local4 = (_local4 + _local2.y); _local3 = ((_local3 < _local6)) ? _local6 : ((_local3 > _local7)) ? _local7 : _local3; _local4 = ((_local4 < _local8)) ? _local8 : ((_local4 > _local9)) ? _local9 : _local4; _local2.moveTo(_local3, _local4); } protected function generateData():ByteArray{ var _local4:Rectangle; var _local1:ByteArray = new ByteArray(); _local1.writeUTF(levelName); _local1.writeByte(lifes); _local1.writeByte(needed); _local1.writeShort(ballSpawner.x); _local1.writeShort(ballSpawner.y); var _local2:int = objects.length; _local1.writeShort(_local2); var _local3:int; while (_local3 < _local2) { if ((objects[_local3] is EditableRectangle)){ _local4 = objects[_local3].rect; _local1.writeByte(0); _local1.writeShort((objects[_local3].x + (_local4.width / 2))); _local1.writeShort((objects[_local3].y + (_local4.height / 2))); _local1.writeShort(_local4.width); _local1.writeShort(_local4.height); } else { if ((objects[_local3] is EditableCircle)){ _local1.writeByte(1); _local1.writeShort(objects[_local3].x); _local1.writeShort(objects[_local3].y); _local1.writeShort(objects[_local3].radius); }; }; _local1.writeByte(objects[_local3].matId); _local3++; }; _local2 = crates.length; _local1.writeShort(_local2); _local3 = 0; while (_local3 < _local2) { _local1.writeShort(crates[_local3].x); _local1.writeShort(crates[_local3].y); _local3++; }; _local2 = torches.length; _local1.writeShort(_local2); _local3 = 0; while (_local3 < _local2) { if ((torches[_local3] is LTEditor)){ _local1.writeByte(0); } else { if ((torches[_local3] is RTEditor)){ _local1.writeByte(1); } else { _local1.writeByte(2); }; }; _local1.writeShort(torches[_local3].x); _local1.writeShort(torches[_local3].y); _local3++; }; _local2 = powerups.length; _local1.writeShort(_local2); _local3 = 0; while (_local3 < _local2) { if ((powerups[_local3] is Pow1Editor)){ _local1.writeByte(0); } else { if ((powerups[_local3] is Pow2Editor)){ _local1.writeByte(1); } else { if ((powerups[_local3] is Pow3Editor)){ _local1.writeByte(2); } else { _local1.writeByte(3); }; }; }; _local1.writeShort(powerups[_local3].x); _local1.writeShort(powerups[_local3].y); _local3++; }; _local1.position = 0; return (_local1); } protected function handleClick(_arg1:MouseEvent):void{ var _local2:EditableObject; if (mode == "Edit"){ if ((_arg1.target is EditorDisplay)){ EditableObject.deselectAll(); dispatchEvent(new EditorEvent(EditorEvent.DESELECT)); }; return; }; var _local3:int = mouseX; var _local4:int = mouseY; if (gridMode){ _local3 = ((int((_local3 / 10)) * 10) + 10); _local4 = ((int((_local4 / 10)) * 10) + 10); }; switch (mode){ case "LT": _local2 = new LTEditor(_local3, _local4); overlay.addChild(_local2); torches.push(_local2); break; case "RT": _local2 = new RTEditor(_local3, _local4); overlay.addChild(_local2); torches.push(_local2); break; case "CT": _local2 = new CTEditor(_local3, _local4); overlay.addChild(_local2); torches.push(_local2); break; case "Crate": _local2 = new CrateEditor(_local3, _local4); overlay.addChild(_local2); crates.push(_local2); break; case "Rect": _local2 = new EditableRectangle(_local3, _local4); changeMaterial(_local2); objects.push(_local2); break; case "Circ": _local2 = new EditableCircle(_local3, _local4); changeMaterial(_local2); objects.push(_local2); break; case "Poly": break; case "Pow1": _local2 = new Pow1Editor(_local3, _local4); overlay.addChild(_local2); powerups.push(_local2); break; case "Pow2": _local2 = new Pow2Editor(_local3, _local4); overlay.addChild(_local2); powerups.push(_local2); break; case "Pow3": _local2 = new Pow3Editor(_local3, _local4); overlay.addChild(_local2); powerups.push(_local2); break; case "Pow4": _local2 = new Pow4Editor(_local3, _local4); overlay.addChild(_local2); powerups.push(_local2); break; default: break; }; EditableObject.suppressSelect = true; } public function set data(_arg1:ByteArray):void{ parseData(_arg1); } protected function resetBoard():void{ ballSpawner.x = 200; ballSpawner.y = 50; if (((lastObject) && (lastObject.parent))){ lastObject.parent.removeChild(lastObject); }; var _local1:int = objects.length; var _local2:int; while (_local2 < _local1) { objects[_local2].dispose(); _local2++; }; objects.length = 0; _local1 = crates.length; _local2 = 0; while (_local2 < _local1) { overlay.removeChild(crates[_local2]); _local2++; }; crates.length = 0; _local1 = torches.length; _local2 = 0; while (_local2 < _local1) { overlay.removeChild(torches[_local2]); _local2++; }; torches.length = 0; _local1 = powerups.length; _local2 = 0; while (_local2 < _local1) { overlay.removeChild(powerups[_local2]); _local2++; }; powerups.length = 0; System.gc(); } public function set levelName(_arg1:String):void{ _levelName = _arg1; } protected function handleUp(_arg1:MouseEvent):void{ if (isDragging){ EditableObject.stopDragging(); }; } public function stopDragging():void{ isDragging = false; EditableObject.stopDragging(); } protected function handleStartDrag(_arg1:EditorEvent):void{ isDragging = true; } protected function changeMaterial(_arg1:EditableObject):void{ if (_arg1.overlay.parent){ _arg1.overlay.parent.removeChild(_arg1.overlay); }; switch (_arg1.matId){ case 0: brick._mask.addChild(_arg1.overlay); break; case 1: metal._mask.addChild(_arg1.overlay); break; case 2: glass._mask.addChild(_arg1.overlay); break; }; overlay.addChild(_arg1); } protected function handleMaterialChange(_arg1:Event):void{ var _local2:EditableObject = (_arg1.target as EditableObject); changeMaterial(_local2); } } }//package com.leveleditor
Section 93
//EditorEvent (com.leveleditor.EditorEvent) package com.leveleditor { import flash.events.*; public class EditorEvent extends Event { public var obj:EditableObject; public static const STOPDRAG:String = "EditorEvent.STOPDRAG"; public static const LOAD:String = "EditorEvent.LOAD"; public static const CHANGE:String = "EditorEvent.CHANGE"; public static const STARTDRAG:String = "EditorEvent.STARTDRAG"; public static const SELECT:String = "EditorEvent.SELECT"; public static const DESELECT:String = "EditorEvent.DESELECT"; public function EditorEvent(_arg1:String):void{ super(_arg1, true, true); } override public function toString():String{ return (formatToString("EditorEvent", "type", "bubbles", "cancelable", "eventPhase", "obj")); } override public function clone():Event{ return (new EditorEvent(type)); } } }//package com.leveleditor
Section 94
//EditorPanel (com.leveleditor.EditorPanel) package com.leveleditor { import fl.controls.*; import flash.display.*; import flash.events.*; import fl.data.*; import fl.events.*; import com.*; public class EditorPanel extends Sprite { public var __id5_:Label; public var j2; public var btn_edit:Button; public var btn_torchC:Button; public var btn_torchL:Button; public var btn_torchR:Button; public var btn_circ:Button; public var check_grid:CheckBox; public var btn_crate:Button; public var __id6_:Label; public var cb_Material:ComboBox; public var collObj2:DataProvider; public var __id7_:Label; public var __id10_:Label; public var label_opt3:Label; public var label_opt4:Label; public var txt_opt1:TextInput; public var txt_opt2:TextInput; public var txt_opt3:TextInput; public var txt_opt4:TextInput; public var btn_MainMenu:Button; private var selectedObj:EditableObject; public var __id8_:Label; public var check_longGuide:CheckBox; public var __id0_:Label; public var txt_life:TextInput; public var txt_torch:TextInput; public var btn_save:Button; public var __id9_:Label; public var __id1_:Label; private var _editor:EditorDisplay; public var btn_test:Button; private var selected:Button; public var __id2_:Label; public var collProp2:Object; private var csrMgr:CursorManager; public var __id3_:Label; public var itemObj2:SimpleCollectionItem; public var btn_pow1:Button; public var btn_pow2:Button; public var btn_pow3:Button; public var btn_pow4:Button; public var __id4_:Label; public var btn_rect:Button; public var btn_load:Button; public var collProps2:Array; public var i2:int; public var txt_name:TextInput; public function EditorPanel():void{ csrMgr = CursorManager.instance; super(); addEventListener(Event.ADDED_TO_STAGE, init); __setProp_txt_torch_EditPanel_Labels_0(); __setProp_txt_life_EditPanel_Labels_0(); __setProp___id0__EditPanel_Labels_0(); __setProp___id1__EditPanel_Labels_0(); __setProp___id2__EditPanel_Labels_0(); __setProp___id3__EditPanel_Labels_0(); __setProp___id4__EditPanel_Labels_0(); __setProp_txt_opt1_EditPanel_Labels_0(); __setProp_txt_opt2_EditPanel_Labels_0(); __setProp___id5__EditPanel_Labels_0(); __setProp___id6__EditPanel_Labels_0(); __setProp_txt_opt3_EditPanel_Labels_0(); __setProp_txt_opt4_EditPanel_Labels_0(); __setProp_label_opt3_EditPanel_Labels_0(); __setProp_label_opt4_EditPanel_Labels_0(); __setProp___id7__EditPanel_Labels_0(); __setProp___id8__EditPanel_Labels_0(); __setProp___id9__EditPanel_Labels_0(); __setProp___id10__EditPanel_Labels_0(); __setProp_txt_name_EditPanel_Labels_0(); __setProp_check_longGuide_EditPanel_Buttons_0(); __setProp_btn_torchL_EditPanel_Buttons_0(); __setProp_btn_torchC_EditPanel_Buttons_0(); __setProp_btn_torchR_EditPanel_Buttons_0(); __setProp_btn_crate_EditPanel_Buttons_0(); __setProp_btn_rect_EditPanel_Buttons_0(); __setProp_btn_circ_EditPanel_Buttons_0(); __setProp_btn_edit_EditPanel_Buttons_0(); __setProp_btn_pow1_EditPanel_Buttons_0(); __setProp_btn_pow2_EditPanel_Buttons_0(); __setProp_btn_pow3_EditPanel_Buttons_0(); __setProp_btn_pow4_EditPanel_Buttons_0(); __setProp_btn_test_EditPanel_Buttons_0(); __setProp_btn_load_EditPanel_Buttons_0(); __setProp_btn_save_EditPanel_Buttons_0(); __setProp_cb_Material_EditPanel_Buttons_0(); __setProp_btn_MainMenu_EditPanel_Buttons_0(); __setProp_check_grid_EditPanel_Buttons_0(); } protected function handleTxtOut(_arg1:Event):void{ _editor.supressDelete = false; updateInfo(); } function __setProp_label_opt4_EditPanel_Labels_0(){ try { label_opt4["componentInspectorSetting"] = true; } catch(e:Error) { }; label_opt4.autoSize = "right"; label_opt4.condenseWhite = false; label_opt4.enabled = true; label_opt4.htmlText = ""; label_opt4.selectable = false; label_opt4.text = "Height:"; label_opt4.visible = true; label_opt4.wordWrap = false; try { label_opt4["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_opt2_EditPanel_Labels_0(){ try { txt_opt2["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_opt2.displayAsPassword = false; txt_opt2.editable = true; txt_opt2.enabled = true; txt_opt2.maxChars = 3; txt_opt2.restrict = "0123456789"; txt_opt2.text = ""; txt_opt2.visible = true; try { txt_opt2["componentInspectorSetting"] = false; } catch(e:Error) { }; } protected function init(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, init); txt_opt1.enabled = false; txt_opt1.addEventListener(ComponentEvent.ENTER, handleTxtEnter); txt_opt1.addEventListener(FocusEvent.FOCUS_OUT, handleTxtOut); txt_opt1.addEventListener(Event.CHANGE, handleChangeOpt1); txt_opt1.addEventListener(FocusEvent.FOCUS_IN, handleTxtIn); txt_opt2.enabled = false; txt_opt2.addEventListener(ComponentEvent.ENTER, handleTxtEnter); txt_opt2.addEventListener(FocusEvent.FOCUS_OUT, handleTxtOut); txt_opt2.addEventListener(Event.CHANGE, handleChangeOpt2); txt_opt2.addEventListener(FocusEvent.FOCUS_IN, handleTxtIn); txt_opt3.visible = false; txt_opt3.addEventListener(ComponentEvent.ENTER, handleTxtEnter); txt_opt3.addEventListener(FocusEvent.FOCUS_OUT, handleTxtOut); txt_opt3.addEventListener(Event.CHANGE, handleChangeOpt3); txt_opt3.addEventListener(FocusEvent.FOCUS_IN, handleTxtIn); txt_opt4.visible = false; txt_opt4.addEventListener(ComponentEvent.ENTER, handleTxtEnter); txt_opt4.addEventListener(FocusEvent.FOCUS_OUT, handleTxtOut); txt_opt4.addEventListener(Event.CHANGE, handleChangeOpt4); txt_opt4.addEventListener(FocusEvent.FOCUS_IN, handleTxtIn); label_opt3.visible = false; label_opt4.visible = false; cb_Material.visible = false; cb_Material.addEventListener(Event.CHANGE, handleComboChange); check_grid.addEventListener(Event.CHANGE, handleGridChange); btn_rect.toggle = true; btn_rect.setStyle("icon", Rect_Icon); btn_circ.toggle = true; btn_circ.setStyle("icon", Circ_Icon); btn_torchL.toggle = true; btn_torchL.setStyle("icon", LT_Icon); btn_torchC.toggle = true; btn_torchC.setStyle("icon", CT_Icon); btn_torchR.toggle = true; btn_torchR.setStyle("icon", RT_Icon); btn_crate.toggle = true; btn_crate.setStyle("icon", Crate_Icon); btn_edit.toggle = true; btn_edit.setStyle("icon", Edit_Icon); btn_pow1.toggle = true; btn_pow1.setStyle("icon", Pow1_Icon); btn_pow2.toggle = true; btn_pow2.setStyle("icon", Pow2_Icon); btn_pow3.toggle = true; btn_pow3.setStyle("icon", Pow3_Icon); btn_pow4.toggle = true; btn_pow4.setStyle("icon", Pow4_Icon); txt_name.addEventListener(Event.CHANGE, handleNameChange); txt_torch.addEventListener(Event.CHANGE, handleTorchChange); txt_life.addEventListener(Event.CHANGE, handleLifeChange); txt_name.addEventListener(FocusEvent.FOCUS_IN, handleTxtIn); txt_torch.addEventListener(FocusEvent.FOCUS_IN, handleTxtIn); txt_life.addEventListener(FocusEvent.FOCUS_IN, handleTxtIn); txt_name.addEventListener(FocusEvent.FOCUS_OUT, handleTxtOut); txt_torch.addEventListener(FocusEvent.FOCUS_OUT, handleTxtOut); txt_life.addEventListener(FocusEvent.FOCUS_OUT, handleTxtOut); txt_name.addEventListener(ComponentEvent.ENTER, handleTxtEnter); txt_torch.addEventListener(ComponentEvent.ENTER, handleTxtEnter); txt_life.addEventListener(ComponentEvent.ENTER, handleTxtEnter); addEventListener(MouseEvent.CLICK, handleClick); } private function handleLifeChange(_arg1:Event):void{ _editor.lifes = int(txt_life.text); } protected function updateInfo():void{ if (!selectedObj){ return; }; var _local1:Object = selectedObj.info; txt_opt1.text = _local1.data1.toString(); txt_opt2.text = _local1.data2.toString(); txt_opt3.text = _local1.data3.toString(); txt_opt4.text = _local1.data4.toString(); } function __setProp_btn_torchL_EditPanel_Buttons_0(){ try { btn_torchL["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_torchL.emphasized = false; btn_torchL.enabled = true; btn_torchL.label = ""; btn_torchL.labelPlacement = "right"; btn_torchL.selected = false; btn_torchL.toggle = false; btn_torchL.visible = true; try { btn_torchL["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id8__EditPanel_Labels_0(){ try { __id8_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id8_.autoSize = "left"; __id8_.condenseWhite = false; __id8_.enabled = true; __id8_.htmlText = ""; __id8_.selectable = false; __id8_.text = "Burnables"; __id8_.visible = true; __id8_.wordWrap = false; try { __id8_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_torchR_EditPanel_Buttons_0(){ try { btn_torchR["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_torchR.emphasized = false; btn_torchR.enabled = true; btn_torchR.label = ""; btn_torchR.labelPlacement = "right"; btn_torchR.selected = false; btn_torchR.toggle = false; btn_torchR.visible = true; try { btn_torchR["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id0__EditPanel_Labels_0(){ try { __id0_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id0_.autoSize = "center"; __id0_.condenseWhite = false; __id0_.enabled = true; __id0_.htmlText = ""; __id0_.selectable = false; __id0_.text = "Level Properties"; __id0_.visible = true; __id0_.wordWrap = false; try { __id0_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_test_EditPanel_Buttons_0(){ try { btn_test["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_test.emphasized = false; btn_test.enabled = true; btn_test.label = "Preview Level"; btn_test.labelPlacement = "right"; btn_test.selected = false; btn_test.toggle = false; btn_test.visible = true; try { btn_test["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_circ_EditPanel_Buttons_0(){ try { btn_circ["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_circ.emphasized = false; btn_circ.enabled = true; btn_circ.label = ""; btn_circ.labelPlacement = "right"; btn_circ.selected = false; btn_circ.toggle = false; btn_circ.visible = true; try { btn_circ["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleEditorLoad(_arg1:EditorEvent):void{ txt_name.text = _editor.levelName; txt_torch.text = _editor.needed.toString(); txt_life.text = _editor.lifes.toString(); } function __setProp_check_grid_EditPanel_Buttons_0(){ try { check_grid["componentInspectorSetting"] = true; } catch(e:Error) { }; check_grid.enabled = true; check_grid.label = "Grid"; check_grid.labelPlacement = "right"; check_grid.selected = false; check_grid.visible = true; try { check_grid["componentInspectorSetting"] = false; } catch(e:Error) { }; } protected function handleEditorChanged(_arg1:EditorEvent):void{ updateInfo(); } protected function handleClick(_arg1:MouseEvent):void{ var _local2:Button = (_arg1.target as Button); if (!_local2){ return; }; switch (_local2.name){ case "btn_test": dispatchEvent(new Event("TEST", true, true)); return; case "btn_save": dispatchEvent(new Event("SAVE", true, true)); return; case "btn_load": dispatchEvent(new Event("LOAD", true, true)); return; case "btn_MainMenu": dispatchEvent(new Event("MAIN MENU", true, true)); return; }; handleEditorClick(); if (selected == _local2){ if (!_local2.selected){ csrMgr.mode = "Edit"; btn_edit.selected = true; selected = btn_edit; }; return; }; if (selected){ selected.selected = false; }; selected = _local2; switch (_local2.name){ case "btn_torchL": csrMgr.mode = "LT"; break; case "btn_torchR": csrMgr.mode = "RT"; break; case "btn_torchC": csrMgr.mode = "CT"; break; case "btn_crate": csrMgr.mode = "Crate"; break; case "btn_rect": csrMgr.mode = "Rect"; break; case "btn_circ": csrMgr.mode = "Circ"; break; case "btn_poly": csrMgr.mode = "Poly"; break; case "btn_pow1": csrMgr.mode = "Pow1"; break; case "btn_pow2": csrMgr.mode = "Pow2"; break; case "btn_pow3": csrMgr.mode = "Pow3"; break; case "btn_pow4": csrMgr.mode = "Pow4"; break; default: csrMgr.mode = "Edit"; }; } private function handleNameChange(_arg1:Event):void{ _editor.levelName = txt_name.text; } function __setProp_btn_pow2_EditPanel_Buttons_0(){ try { btn_pow2["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_pow2.emphasized = false; btn_pow2.enabled = true; btn_pow2.label = ""; btn_pow2.labelPlacement = "right"; btn_pow2.selected = false; btn_pow2.toggle = false; btn_pow2.visible = true; try { btn_pow2["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_pow4_EditPanel_Buttons_0(){ try { btn_pow4["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_pow4.emphasized = false; btn_pow4.enabled = true; btn_pow4.label = ""; btn_pow4.labelPlacement = "right"; btn_pow4.selected = false; btn_pow4.toggle = false; btn_pow4.visible = true; try { btn_pow4["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_label_opt3_EditPanel_Labels_0(){ try { label_opt3["componentInspectorSetting"] = true; } catch(e:Error) { }; label_opt3.autoSize = "right"; label_opt3.condenseWhite = false; label_opt3.enabled = true; label_opt3.htmlText = ""; label_opt3.selectable = false; label_opt3.text = "Width:"; label_opt3.visible = true; label_opt3.wordWrap = false; try { label_opt3["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id10__EditPanel_Labels_0(){ try { __id10_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id10_.autoSize = "left"; __id10_.condenseWhite = false; __id10_.enabled = true; __id10_.htmlText = ""; __id10_.selectable = false; __id10_.text = "Edit Mode"; __id10_.visible = true; __id10_.wordWrap = false; try { __id10_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id1__EditPanel_Labels_0(){ try { __id1_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id1_.autoSize = "right"; __id1_.condenseWhite = false; __id1_.enabled = true; __id1_.htmlText = ""; __id1_.selectable = false; __id1_.text = "Torch required:"; __id1_.visible = true; __id1_.wordWrap = false; try { __id1_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_opt3_EditPanel_Labels_0(){ try { txt_opt3["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_opt3.displayAsPassword = false; txt_opt3.editable = true; txt_opt3.enabled = true; txt_opt3.maxChars = 3; txt_opt3.restrict = "0123456789"; txt_opt3.text = ""; txt_opt3.visible = true; try { txt_opt3["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id3__EditPanel_Labels_0(){ try { __id3_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id3_.autoSize = "center"; __id3_.condenseWhite = false; __id3_.enabled = true; __id3_.htmlText = ""; __id3_.selectable = false; __id3_.text = "Shapes"; __id3_.visible = true; __id3_.wordWrap = false; try { __id3_["componentInspectorSetting"] = false; } catch(e:Error) { }; } protected function handleTxtIn(_arg1:Event):void{ _editor.supressDelete = true; } function __setProp___id5__EditPanel_Labels_0(){ try { __id5_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id5_.autoSize = "right"; __id5_.condenseWhite = false; __id5_.enabled = true; __id5_.htmlText = ""; __id5_.selectable = false; __id5_.text = "X:"; __id5_.visible = true; __id5_.wordWrap = false; try { __id5_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_rect_EditPanel_Buttons_0(){ try { btn_rect["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_rect.emphasized = false; btn_rect.enabled = true; btn_rect.label = ""; btn_rect.labelPlacement = "right"; btn_rect.selected = false; btn_rect.toggle = false; btn_rect.visible = true; try { btn_rect["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id7__EditPanel_Labels_0(){ try { __id7_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id7_.autoSize = "left"; __id7_.condenseWhite = false; __id7_.enabled = true; __id7_.htmlText = ""; __id7_.selectable = false; __id7_.text = "Solids"; __id7_.visible = true; __id7_.wordWrap = false; try { __id7_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_load_EditPanel_Buttons_0(){ try { btn_load["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_load.emphasized = false; btn_load.enabled = true; btn_load.label = "Load Level"; btn_load.labelPlacement = "right"; btn_load.selected = false; btn_load.toggle = false; btn_load.visible = true; try { btn_load["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id9__EditPanel_Labels_0(){ try { __id9_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id9_.autoSize = "left"; __id9_.condenseWhite = false; __id9_.enabled = true; __id9_.htmlText = ""; __id9_.selectable = false; __id9_.text = "Power Ups"; __id9_.visible = true; __id9_.wordWrap = false; try { __id9_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_crate_EditPanel_Buttons_0(){ try { btn_crate["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_crate.emphasized = false; btn_crate.enabled = true; btn_crate.label = ""; btn_crate.labelPlacement = "right"; btn_crate.selected = false; btn_crate.toggle = false; btn_crate.visible = true; try { btn_crate["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_cb_Material_EditPanel_Buttons_0(){ try { cb_Material["componentInspectorSetting"] = true; } catch(e:Error) { }; collObj2 = new DataProvider(); collProps2 = [{label:"Brick", data:0}, {label:"Metal", data:1}, {label:"Glass", data:2}]; i2 = 0; while (i2 < collProps2.length) { itemObj2 = new SimpleCollectionItem(); collProp2 = collProps2[i2]; for (j2 in collProp2) { itemObj2[j2] = collProp2[j2]; }; collObj2.addItem(itemObj2); i2++; }; cb_Material.dataProvider = collObj2; cb_Material.editable = false; cb_Material.enabled = true; cb_Material.prompt = ""; cb_Material.restrict = ""; cb_Material.rowCount = 5; cb_Material.visible = true; try { cb_Material["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function set display(_arg1:EditorDisplay):void{ if (_editor){ _editor.removeEventListener(EditorEvent.SELECT, handleEditorClick); _editor.removeEventListener(EditorEvent.DESELECT, clearInfo); _editor.removeEventListener(EditorEvent.CHANGE, handleEditorChanged); _editor.removeEventListener(EditorEvent.LOAD, handleEditorLoad); }; _editor = _arg1; if (_editor){ _editor.addEventListener(EditorEvent.SELECT, handleEditorClick); _editor.addEventListener(EditorEvent.DESELECT, clearInfo); _editor.addEventListener(EditorEvent.CHANGE, handleEditorChanged); _editor.addEventListener(EditorEvent.LOAD, handleEditorLoad); }; } function __setProp_btn_save_EditPanel_Buttons_0(){ try { btn_save["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_save.emphasized = false; btn_save.enabled = true; btn_save.label = "Save Level"; btn_save.labelPlacement = "right"; btn_save.selected = false; btn_save.toggle = false; btn_save.visible = true; try { btn_save["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleTorchChange(_arg1:Event):void{ _editor.needed = int(txt_torch.text); } protected function handleTxtEnter(_arg1:ComponentEvent):void{ TextInput(_arg1.target).focusManager.setFocus(stage); } function __setProp_btn_torchC_EditPanel_Buttons_0(){ try { btn_torchC["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_torchC.emphasized = false; btn_torchC.enabled = true; btn_torchC.label = ""; btn_torchC.labelPlacement = "right"; btn_torchC.selected = false; btn_torchC.toggle = false; btn_torchC.visible = true; try { btn_torchC["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleComboChange(_arg1:Event):void{ if (selectedObj){ selectedObj.material = cb_Material.selectedItem.data; }; } private function clearInfo(_arg1:EditorEvent):void{ txt_opt1.text = ""; txt_opt2.text = ""; txt_opt1.enabled = false; txt_opt2.enabled = false; txt_opt3.visible = false; txt_opt4.visible = false; label_opt3.visible = false; label_opt4.visible = false; cb_Material.visible = false; txt_opt1.focusManager.setFocus(stage); } function __setProp_btn_edit_EditPanel_Buttons_0(){ try { btn_edit["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_edit.emphasized = false; btn_edit.enabled = true; btn_edit.label = ""; btn_edit.labelPlacement = "right"; btn_edit.selected = false; btn_edit.toggle = false; btn_edit.visible = true; try { btn_edit["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_opt1_EditPanel_Labels_0(){ try { txt_opt1["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_opt1.displayAsPassword = false; txt_opt1.editable = true; txt_opt1.enabled = true; txt_opt1.maxChars = 3; txt_opt1.restrict = "0123456789"; txt_opt1.text = ""; txt_opt1.visible = true; try { txt_opt1["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_torch_EditPanel_Labels_0(){ try { txt_torch["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_torch.displayAsPassword = false; txt_torch.editable = true; txt_torch.enabled = true; txt_torch.maxChars = 2; txt_torch.restrict = "0123456789"; txt_torch.text = "1"; txt_torch.visible = true; try { txt_torch["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function handleEditorChange(_arg1:EditorEvent):void{ updateInfo(); } function __setProp_txt_opt4_EditPanel_Labels_0(){ try { txt_opt4["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_opt4.displayAsPassword = false; txt_opt4.editable = true; txt_opt4.enabled = true; txt_opt4.maxChars = 3; txt_opt4.restrict = "0123456789"; txt_opt4.text = ""; txt_opt4.visible = true; try { txt_opt4["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_life_EditPanel_Labels_0(){ try { txt_life["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_life.displayAsPassword = false; txt_life.editable = true; txt_life.enabled = true; txt_life.maxChars = 2; txt_life.restrict = "0123456789"; txt_life.text = "1"; txt_life.visible = true; try { txt_life["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleEditorClick(_arg1:EditorEvent=null):void{ if (_arg1){ selectedObj = _arg1.obj; } else { selectedObj = null; }; if ((selectedObj is EditableRectangle)){ txt_opt1.enabled = true; txt_opt2.enabled = true; label_opt3.visible = true; label_opt4.visible = true; label_opt3.text = "Width:"; txt_opt3.visible = true; txt_opt4.visible = true; cb_Material.visible = true; cb_Material.selectedIndex = selectedObj.matId; } else { if ((selectedObj is EditableCircle)){ txt_opt1.enabled = true; txt_opt2.enabled = true; label_opt3.visible = true; label_opt4.visible = false; label_opt3.text = "Radius:"; txt_opt3.visible = true; txt_opt4.visible = false; cb_Material.visible = true; cb_Material.selectedIndex = selectedObj.matId; } else { if ((selectedObj is EditablePolygon)){ txt_opt1.enabled = true; txt_opt2.enabled = true; txt_opt3.visible = false; txt_opt4.visible = false; label_opt3.visible = false; label_opt4.visible = false; cb_Material.visible = true; } else { if (selectedObj == null){ txt_opt1.text = ""; txt_opt2.text = ""; txt_opt1.enabled = false; txt_opt2.enabled = false; txt_opt3.visible = false; txt_opt4.visible = false; label_opt3.visible = false; label_opt4.visible = false; cb_Material.visible = false; } else { txt_opt1.enabled = true; txt_opt2.enabled = true; txt_opt3.visible = false; txt_opt4.visible = false; label_opt3.visible = false; label_opt4.visible = false; cb_Material.visible = false; }; }; }; }; updateInfo(); } function __setProp_txt_name_EditPanel_Labels_0(){ try { txt_name["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_name.displayAsPassword = false; txt_name.editable = true; txt_name.enabled = true; txt_name.maxChars = 250; txt_name.restrict = ""; txt_name.text = "Level Name..."; txt_name.visible = true; try { txt_name["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_MainMenu_EditPanel_Buttons_0(){ try { btn_MainMenu["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_MainMenu.emphasized = false; btn_MainMenu.enabled = true; btn_MainMenu.label = "Main Menu"; btn_MainMenu.labelPlacement = "right"; btn_MainMenu.selected = false; btn_MainMenu.toggle = false; btn_MainMenu.visible = true; try { btn_MainMenu["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_pow1_EditPanel_Buttons_0(){ try { btn_pow1["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_pow1.emphasized = false; btn_pow1.enabled = true; btn_pow1.label = ""; btn_pow1.labelPlacement = "right"; btn_pow1.selected = false; btn_pow1.toggle = false; btn_pow1.visible = true; try { btn_pow1["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleGridChange(_arg1:Event):void{ _editor.grid = check_grid.selected; } function __setProp_check_longGuide_EditPanel_Buttons_0(){ try { check_longGuide["componentInspectorSetting"] = true; } catch(e:Error) { }; check_longGuide.enabled = true; check_longGuide.label = "Long guide"; check_longGuide.labelPlacement = "right"; check_longGuide.selected = false; check_longGuide.visible = true; try { check_longGuide["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_pow3_EditPanel_Buttons_0(){ try { btn_pow3["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_pow3.emphasized = false; btn_pow3.enabled = true; btn_pow3.label = ""; btn_pow3.labelPlacement = "right"; btn_pow3.selected = false; btn_pow3.toggle = false; btn_pow3.visible = true; try { btn_pow3["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id2__EditPanel_Labels_0(){ try { __id2_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id2_.autoSize = "right"; __id2_.condenseWhite = false; __id2_.enabled = true; __id2_.htmlText = ""; __id2_.selectable = false; __id2_.text = "Starting balls:"; __id2_.visible = true; __id2_.wordWrap = false; try { __id2_["componentInspectorSetting"] = false; } catch(e:Error) { }; } protected function handleChangeOpt1(_arg1:Event):void{ if (txt_opt1.text == ""){ selectedObj.setData1(0); } else { selectedObj.setData1(int(txt_opt1.text)); }; } protected function handleChangeOpt2(_arg1:Event):void{ if (txt_opt2.text == ""){ selectedObj.setData2(0); } else { selectedObj.setData2(int(txt_opt2.text)); }; } protected function handleChangeOpt4(_arg1:Event):void{ if (txt_opt4.text == ""){ selectedObj.setData4(0); } else { selectedObj.setData4(int(txt_opt4.text)); }; } function __setProp___id4__EditPanel_Labels_0(){ try { __id4_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id4_.autoSize = "center"; __id4_.condenseWhite = false; __id4_.enabled = true; __id4_.htmlText = ""; __id4_.selectable = false; __id4_.text = "Shape Options"; __id4_.visible = true; __id4_.wordWrap = false; try { __id4_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id6__EditPanel_Labels_0(){ try { __id6_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id6_.autoSize = "right"; __id6_.condenseWhite = false; __id6_.enabled = true; __id6_.htmlText = ""; __id6_.selectable = false; __id6_.text = "Y:"; __id6_.visible = true; __id6_.wordWrap = false; try { __id6_["componentInspectorSetting"] = false; } catch(e:Error) { }; } protected function handleChangeOpt3(_arg1:Event):void{ if (txt_opt3.text == ""){ selectedObj.setData3(0); } else { selectedObj.setData3(int(txt_opt3.text)); }; } } }//package com.leveleditor
Section 95
//LTCursor (com.leveleditor.LTCursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class LTCursor extends Cursor { public var disabledIcon:MovieClip; public function LTCursor():void{ rect = new Rectangle(0, 0, 23, 51); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 96
//LTEditor (com.leveleditor.LTEditor) package com.leveleditor { import flash.geom.*; public class LTEditor extends EditableObject { public function LTEditor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; rect = new Rectangle(0, 0, 23, 51); } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.5); graphics.beginFill(0xFF, 0.1); graphics.drawRect(rect.x, rect.y, rect.width, rect.height); graphics.endFill(); } } }//package com.leveleditor
Section 97
//PolyCursor (com.leveleditor.PolyCursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class PolyCursor extends Cursor { public var disabledIcon:MovieClip; public function PolyCursor():void{ rect = new Rectangle(0, 0, 0, 0); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 98
//Pow1Cursor (com.leveleditor.Pow1Cursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class Pow1Cursor extends Cursor { public var disabledIcon:MovieClip; public function Pow1Cursor():void{ rect = new Rectangle(-9, -9, 18, 18); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 99
//Pow1Editor (com.leveleditor.Pow1Editor) package com.leveleditor { public class Pow1Editor extends EditableObject { public function Pow1Editor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; rect.x = (rect.y = -9); rect.width = (rect.height = 18); } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.75); graphics.beginFill(0xFF, 0.1); graphics.drawCircle(0, 0, 10); graphics.endFill(); } } }//package com.leveleditor
Section 100
//Pow2Cursor (com.leveleditor.Pow2Cursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class Pow2Cursor extends Cursor { public var disabledIcon:MovieClip; public function Pow2Cursor():void{ rect = new Rectangle(-9, -9, 18, 18); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 101
//Pow2Editor (com.leveleditor.Pow2Editor) package com.leveleditor { public class Pow2Editor extends EditableObject { public function Pow2Editor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; rect.x = (rect.y = -9); rect.width = (rect.height = 18); } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.75); graphics.beginFill(0xFF, 0.1); graphics.drawCircle(0, 0, 10); graphics.endFill(); } } }//package com.leveleditor
Section 102
//Pow3Cursor (com.leveleditor.Pow3Cursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class Pow3Cursor extends Cursor { public var disabledIcon:MovieClip; public function Pow3Cursor():void{ rect = new Rectangle(-9, -9, 18, 18); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 103
//Pow3Editor (com.leveleditor.Pow3Editor) package com.leveleditor { public class Pow3Editor extends EditableObject { public function Pow3Editor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; rect.x = (rect.y = -9); rect.width = (rect.height = 18); } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.75); graphics.beginFill(0xFF, 0.1); graphics.drawCircle(0, 0, 10); graphics.endFill(); } } }//package com.leveleditor
Section 104
//Pow4Cursor (com.leveleditor.Pow4Cursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class Pow4Cursor extends Cursor { public var disabledIcon:MovieClip; public function Pow4Cursor():void{ rect = new Rectangle(-9, -9, 18, 18); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 105
//Pow4Editor (com.leveleditor.Pow4Editor) package com.leveleditor { public class Pow4Editor extends EditableObject { public function Pow4Editor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; rect.x = (rect.y = -9); rect.width = (rect.height = 18); } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.75); graphics.beginFill(0xFF, 0.1); graphics.drawCircle(0, 0, 10); graphics.endFill(); } } }//package com.leveleditor
Section 106
//RectCursor (com.leveleditor.RectCursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class RectCursor extends Cursor { public var disabledIcon:MovieClip; public function RectCursor():void{ rect = new Rectangle(0, 0, 0, 0); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 107
//RTCursor (com.leveleditor.RTCursor) package com.leveleditor { import flash.geom.*; import flash.display.*; public class RTCursor extends Cursor { public var disabledIcon:MovieClip; public function RTCursor():void{ rect = new Rectangle(0, 0, 23, 51); } override public function set disabled(_arg1:Boolean):void{ disabledIcon.visible = _arg1; } override public function get disabled():Boolean{ return (disabledIcon.visible); } } }//package com.leveleditor
Section 108
//RTEditor (com.leveleditor.RTEditor) package com.leveleditor { import flash.geom.*; public class RTEditor extends EditableObject { public function RTEditor(_arg1:int=0, _arg2:int=0):void{ x = _arg1; y = _arg2; rect = new Rectangle(0, 0, 23, 51); } override protected function draw():void{ graphics.clear(); if (((!(_selected)) && (!(highlighted)))){ return; }; graphics.lineStyle(2, 3355647, 0.5); graphics.beginFill(0xFF, 0.1); graphics.drawRect(rect.x, rect.y, rect.width, rect.height); graphics.endFill(); } } }//package com.leveleditor
Section 109
//SpawnerEditor (com.leveleditor.SpawnerEditor) package com.leveleditor { import flash.geom.*; public class SpawnerEditor extends EditableObject { private var thisIndex:int;// = -1 public var spawnHitArea:ButtonHitArea; public var background:ButtonDisplay; public function SpawnerEditor():void{ hitArea = spawnHitArea; spawnHitArea.mouseEnabled = false; spawnHitArea.visible = false; mouseChildren = false; rect = new Rectangle(-25, -25, 25, 25); } override protected function draw():void{ spawnHitArea.visible = highlighted; if ((((thisIndex == -1)) && (parent))){ thisIndex = (EditorDisplay(parent).gridIndex + 1); }; if (thisIndex != -1){ parent.addChildAt(this, thisIndex); }; } } }//package com.leveleditor
Section 110
//KnuthShuffle (com.rng.KnuthShuffle) package com.rng { public class KnuthShuffle { private var origArr:Array; private var idxArr:Array; private var idx:int; public function KnuthShuffle(){ idx = -1; } private function populate(){ var _local1:int = origArr.length; var _local2:int; while (_local2 < _local1) { idxArr[_local2] = _local2; _local2++; }; } public function reshuffle(){ var _local2:int; var _local4:int; var _local1:int = (origArr.length - 1); var _local3:int = _local1; while (_local3 > 0) { _local2 = (Math.random() * (_local3 + 1)); _local4 = idxArr[_local3]; idxArr[_local3] = idxArr[_local2]; idxArr[_local2] = _local4; _local3--; }; } public function getNext():Object{ idx++; if (idx >= origArr.length){ reshuffle(); idx = 0; }; return (origArr[idxArr[idx]]); } public function initialize(_arg1:Array){ origArr = _arg1; idxArr = new Array(); populate(); reshuffle(); } } }//package com.rng
Section 111
//CursorManager (com.CursorManager) package com { import flash.geom.*; import flash.display.*; import flash.events.*; import com.leveleditor.*; import flash.ui.*; public class CursorManager extends Sprite { private const circ_Csr:Cursor; private const pow1_Csr:Cursor; private const rect_Csr:Cursor; private const crt_Csr:Cursor; private const CT_Csr:Cursor; private const RT_Csr:Cursor; private const LT_Csr:Cursor; private const poly_Csr:Cursor; private const pow2_Csr:Cursor; private const pow3_Csr:Cursor; private const pow4_Csr:Cursor; private var _mode:String; private var emptyRect:Rectangle; private var hidden:Boolean; private var _cursor:Cursor; private static var modeEvent:Event = new Event(Event.SELECT, true, true); private static var changeEvent:Event = new Event(Event.CHANGE, true, true); private static var _instance:CursorManager; public function CursorManager():void{ LT_Csr = new LTCursor(); RT_Csr = new RTCursor(); CT_Csr = new CTCursor(); crt_Csr = new CrateCursor(); rect_Csr = new RectCursor(); circ_Csr = new CircCursor(); poly_Csr = new PolyCursor(); pow1_Csr = new Pow1Cursor(); pow2_Csr = new Pow2Cursor(); pow3_Csr = new Pow3Cursor(); pow4_Csr = new Pow4Cursor(); emptyRect = new Rectangle(0, 0, 0, 0); super(); addEventListener(Event.ADDED_TO_STAGE, handleAdded); addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved); mouseEnabled = false; mouseChildren = false; } public function set mode(_arg1:String):void{ _mode = _arg1; if (_cursor){ removeChild(_cursor); }; switch (_arg1){ case "LT": _cursor = LT_Csr; break; case "RT": _cursor = RT_Csr; break; case "CT": _cursor = CT_Csr; break; case "Crate": _cursor = crt_Csr; break; case "Rect": _cursor = rect_Csr; break; case "Circ": _cursor = circ_Csr; break; case "Poly": _cursor = poly_Csr; break; case "Pow1": _cursor = pow1_Csr; break; case "Pow2": _cursor = pow2_Csr; break; case "Pow3": _cursor = pow3_Csr; break; case "Pow4": _cursor = pow4_Csr; break; case "Edit": default: _cursor = null; Mouse.show(); }; if (_arg1 != "Edit"){ _cursor.x = mouseX; _cursor.y = mouseY; _cursor.disabled = hidden; addChild(_cursor); Mouse.hide(); }; dispatchEvent(changeEvent); } public function hide():void{ hidden = true; if (_cursor){ _cursor.disabled = hidden; }; } public function show():void{ hidden = false; if (_cursor){ _cursor.disabled = hidden; }; } public function get bounds():Rectangle{ if (_cursor){ return (_cursor.rect); }; return (emptyRect); } private function handleRemoved(_arg1:Event):void{ stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleCursor); Mouse.show(); } private function handleAdded(_arg1:Event):void{ stage.addEventListener(MouseEvent.MOUSE_MOVE, handleCursor); if (_cursor){ Mouse.hide(); }; } public function get mode():String{ return (_mode); } private function handleCursor(_arg1:MouseEvent):void{ if (!_cursor){ return; }; _cursor.x = _arg1.stageX; _cursor.y = _arg1.stageY; _arg1.updateAfterEvent(); } public static function get instance():CursorManager{ if (!_instance){ _instance = new (CursorManager); }; return (_instance); } } }//package com
Section 112
//PyroCellRenderer (com.PyroCellRenderer) package com { import fl.controls.listClasses.*; import fl.core.*; import fl.controls.*; import flash.display.*; import flash.events.*; import flash.text.*; import flash.filters.*; public class PyroCellRenderer extends Sprite implements ICellRenderer { protected var _listData:ListData; protected var _data:Object; public var textField:TextField; protected var state:String;// = "up" protected var masker:Sprite; public var divider:MovieClip; public var acedIcon:MovieClip; protected var background:Bitmap; protected var _selected:Boolean;// = false protected static const downColor:int = 0xFF8800; protected static const disabledColor:int = 0x888888; protected static const upColor:int = 0; protected static const overGlowFilter:GlowFilter = new GlowFilter(0); protected static const upColorDark:int = 0xFFFFFF; protected static const downGlowFilter:GlowFilter = new GlowFilter(0xFF0000); protected static var upSkins:Array; protected static var textPadding:int = 5; protected static var disabledSkinsDark:Array; protected static var upSkinsDark:Array; protected static var disabledSkins:Array; protected static var downSkins:Array; public function PyroCellRenderer():void{ background = new Bitmap(); masker = new Sprite(); super(); if (!upSkins){ upSkins = [new Wood_00(0, 0), new Wood_01(0, 0), new Wood_02(0, 0), new Wood_03(0, 0), new Wood_04(0, 0)]; upSkinsDark = [new DarkWood_00(0, 0), new DarkWood_01(0, 0), new DarkWood_02(0, 0), new DarkWood_03(0, 0), new DarkWood_04(0, 0)]; downSkins = [new Burn_00(0, 0), new Burn_01(0, 0), new Burn_02(0, 0), new Burn_03(0, 0), new Burn_04(0, 0)]; disabledSkins = [new Dis_00(0, 0), new Dis_01(0, 0), new Dis_02(0, 0), new Dis_03(0, 0), new Dis_04(0, 0)]; disabledSkinsDark = [new DarkDis_00(0, 0), new DarkDis_01(0, 0), new DarkDis_02(0, 0), new DarkDis_03(0, 0), new DarkDis_04(0, 0)]; }; masker.graphics.clear(); masker.graphics.beginFill(0xFF); masker.graphics.drawRect(0, 0, 100, 20); masker.graphics.endFill(); addChildAt(masker, 0); background = new Bitmap(); addChildAt(background, 0); addEventListener(MouseEvent.ROLL_OVER, handleOver); addEventListener(MouseEvent.ROLL_OUT, handleUp); addEventListener(MouseEvent.MOUSE_DOWN, handleDown); addEventListener(MouseEvent.MOUSE_UP, handleUp); background.mask = masker; divider.y = 19; } public function drawNow():void{ drawLayout(); } protected function handleDown(_arg1:MouseEvent):void{ state = "down"; drawLayout(); } public function setSize(_arg1:Number, _arg2:Number):void{ masker.graphics.clear(); masker.graphics.beginFill(0xFF); masker.graphics.drawRect(0, 0, _arg1, _arg2); masker.graphics.endFill(); divider.width = _arg1; divider.y = (_arg2 - 1); acedIcon.height = (_arg2 - 4); acedIcon.scaleX = acedIcon.scaleY; textField.x = ((acedIcon.x + acedIcon.width) + textPadding); if (data){ drawLayout(); }; } public function get selected():Boolean{ return (_selected); } public function set listData(_arg1:ListData):void{ _listData = _arg1; textField.text = _listData.label; if (data){ drawLayout(); }; } public function set data(_arg1:Object):void{ _data = _arg1; drawLayout(); } protected function drawLayout():void{ if (textField.text.length > 0){ textField.visible = true; textField.width = Math.max(0, ((width - textField.x) - textPadding)); textField.height = (textField.textHeight + 4); textField.y = ((height - textField.height) >> 1); } else { textField.visible = false; }; if (_data.type == "aced"){ acedIcon.visible = true; } else { acedIcon.visible = false; }; textField.filters = []; if (_data.type == "disabled"){ if (data.isBonus == "yes"){ background.bitmapData = disabledSkinsDark[_data.bgIdx]; } else { background.bitmapData = disabledSkins[_data.bgIdx]; }; textField.textColor = disabledColor; } else { if (!selected){ switch (state){ case "up": if (data.isBonus == "yes"){ background.bitmapData = upSkinsDark[_data.bgIdx]; } else { background.bitmapData = upSkins[_data.bgIdx]; }; textField.textColor = upColor; break; case "over": background.bitmapData = downSkins[_data.bgIdx]; textField.textColor = downColor; textField.filters = [overGlowFilter]; break; case "down": background.bitmapData = downSkins[_data.bgIdx]; textField.textColor = downColor; textField.filters = [downGlowFilter]; break; }; } else { if (selected){ background.bitmapData = downSkins[data.bgIdx]; textField.textColor = downColor; textField.filters = [downGlowFilter]; }; }; }; } public function get listData():ListData{ return (_listData); } protected function handleUp(_arg1:MouseEvent):void{ state = "up"; drawLayout(); } public function get data():Object{ return (_data); } protected function handleOver(_arg1:MouseEvent):void{ state = "over"; drawLayout(); } public function setStyle(_arg1:String, _arg2:Object):void{ } public function set selected(_arg1:Boolean):void{ if (data.disabled){ _arg1 = false; }; if (_selected != _arg1){ _selected = _arg1; drawLayout(); }; } public function setMouseState(_arg1:String):void{ state = _arg1; drawLayout(); } } }//package com
Section 113
//CreditFlame (effects.CreditFlame) package effects { import flash.geom.*; import flash.display.*; import flash.filters.*; public class CreditFlame extends Bitmap { private const DEST:Point; private const MATRIX_3x5; private var cFilter:ConvolutionFilter; private var SPARKS:int; private var backBuffer:BitmapData; private var frontBuffer:BitmapData; private var screenBuffer:BitmapData; private var FLAME_HEIGHT:int; private var SOURCE:Rectangle; private var FLAME_WIDTH:int; private var palette:Array; public var running:Boolean; public function CreditFlame(_arg1:int, _arg2:int):void{ DEST = new Point(0, 0); MATRIX_3x5 = new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0); cFilter = new ConvolutionFilter(3, 5, MATRIX_3x5, 4.6, -1, false, false, 4278190335, 0); palette = new Array(); super(null, "auto", true); FLAME_WIDTH = _arg1; FLAME_HEIGHT = _arg2; SPARKS = (FLAME_WIDTH / 2); SOURCE = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); frontBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, false, 0xFF); screenBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, true, 0); bitmapData = screenBuffer; initpalette(); running = true; } public function update():void{ var _local1:uint; var _local2:uint; var _local3:uint; if (running){ _local1 = (FLAME_HEIGHT - 7); frontBuffer.lock(); _local2 = 0; while (_local2 < SPARKS) { _local3 = 0; while (_local3 < 6) { frontBuffer.setPixel(uint((Math.random() * FLAME_WIDTH)), (_local1 + _local3), (Math.random() * 25)); _local3++; }; _local2++; }; frontBuffer.unlock(); }; frontBuffer.applyFilter(frontBuffer, SOURCE, DEST, cFilter); screenBuffer.paletteMap(frontBuffer, SOURCE, DEST, null, null, palette, null); screenBuffer.threshold(screenBuffer, SOURCE, DEST, "==", 4278190080, 0, 4278190080, true); } public function dispose():void{ bitmapData = null; frontBuffer.dispose(); screenBuffer.dispose(); palette.length = 0; frontBuffer = null; screenBuffer = null; palette = null; cFilter = null; } private function initpalette():void{ var _local1:Sprite = new TransparentCreditFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 1)); _local3++; }; _local2.dispose(); } } }//package effects
Section 114
//Fireball (effects.Fireball) package effects { import flash.geom.*; import flash.display.*; import flash.media.*; import flash.filters.*; public class Fireball extends Bitmap { private const FLAME_WIDTH:int = 400; private const PT_ZERO:Point; private const FLAME_HEIGHT:int = 500; private const SCREEN_RECT:Rectangle; private const MATRIX_3x5; private var cFilter:ConvolutionFilter; private var backBuffer:BitmapData; private var frontBuffer:BitmapData; private var screenBuffer:BitmapData; private var flareTfm:SoundTransform; private var targetVol:Number; private var flare:Sound; private var masker:BitmapData; private var offset:Number; private var SOURCE:Rectangle; private var spark:BitmapData; private var DEST:Point; private var torches:Array; private var noiseSeed:uint;// = 0 private var soundOn:Boolean; private var flareChannel:SoundChannel; private var palette:Array; public function Fireball():void{ MATRIX_3x5 = new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0); SCREEN_RECT = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); PT_ZERO = new Point(0, 0); cFilter = new ConvolutionFilter(3, 5, MATRIX_3x5, 4.35, -2, true, false, 0xFF, 1); backBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, false, 0xFF); frontBuffer = backBuffer.clone(); screenBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, false, 0); palette = new Array(); super(); initPalette(); var _local1:Sprite = new NoiseGenerator(); spark = new BitmapData(_local1.width, _local1.height, false, 0xFF); masker = new BitmapData(_local1.width, _local1.height, false); masker.draw(_local1); bitmapData = screenBuffer; SOURCE = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); DEST = new Point(0, 0); offset = (spark.width / 2); torches = new Array(); flare = new Flare(); flareTfm = new SoundTransform(0, 0); flareChannel = flare.play(0, int.MAX_VALUE, flareTfm); targetVol = 0; soundOn = true; } public function scale(_arg1:Number){ var _local2:Matrix = new Matrix(_arg1, 0, 0, _arg1, 0, 0); var _local3:Sprite = new NoiseGenerator(); spark = new BitmapData((_local3.width * _arg1), (_local3.height * _arg1), false, 0xFF); masker = new BitmapData((_local3.width * _arg1), (_local3.height * _arg1), false); masker.draw(_local3, _local2); offset = (spark.width / 2); } public function update(_arg1:Matrix, _arg2:Number):void{ var _local6:Number; var _local7:Number; var _local8:Number; noiseSeed++; var _local3:Number = (_arg2 * 0.1); _local3 = (155 - (_local3 * 155)); if (_local3 < 0){ _local3 = 0; }; spark.noise(noiseSeed, _local3, 0x0100, BitmapDataChannel.BLUE, true); spark.draw(masker, null, null, BlendMode.ADD); _arg1.tx = (_arg1.tx - offset); _arg1.ty = (_arg1.ty - offset); frontBuffer.draw(spark, _arg1, null, BlendMode.MULTIPLY); SOURCE = frontBuffer.getColorBoundsRect(4294967295, 4278190335, false); SOURCE = frontBuffer.generateFilterRect(SOURCE, cFilter); DEST.x = SOURCE.x; DEST.y = SOURCE.y; frontBuffer.applyFilter(frontBuffer, SOURCE, DEST, cFilter); SOURCE.inflate(6, 6); DEST.offset(-6, -6); var _local4:BitmapData = new BitmapData(SOURCE.width, SOURCE.height, false, 0); var _local5:Rectangle = SOURCE.clone(); _local5.x = 0; _local5.y = 0; _local4.paletteMap(frontBuffer, SOURCE, PT_ZERO, null, null, palette); screenBuffer.copyPixels(_local4, _local5, DEST); _local4.dispose(); if (((soundOn) && (flareChannel))){ _local6 = (_arg2 - 7.5); _local7 = flareTfm.volume; _local8 = ((_arg1.tx - 200) * 0.0025); targetVol = (((_local6 * _local6) * 0.1) * ((_local6 < 0)) ? -1 : 1); if (targetVol > 1){ targetVol = 1; } else { if (targetVol < 0.05){ targetVol = 0.05; }; }; _local7 = (_local7 + ((targetVol - _local7) * 0.2)); flareTfm.volume = _local7; flareTfm.pan = _local8; flareChannel.soundTransform = flareTfm; }; } public function dispose():void{ if (flareChannel){ flareChannel.stop(); }; flareChannel = null; flare = null; flareTfm = null; spark.dispose(); masker.dispose(); screenBuffer.dispose(); palette.length = 0; spark = null; masker = null; screenBuffer = null; palette = null; } public function switchPalette(_arg1:Sprite):void{ var _local2:BitmapData = new BitmapData(0x0100, 10, false); _local2.draw(_arg1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = _local2.getPixel(_local3, 2); _local3++; }; _local2.dispose(); } private function initPalette():void{ var _local1:Sprite = new FlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, false); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = _local2.getPixel(_local3, 2); _local3++; }; _local2.dispose(); } public function stopSound():void{ soundOn = false; if (flareChannel){ flareChannel.stop(); }; } } }//package effects
Section 115
//Flame (effects.Flame) package effects { import flash.geom.*; import flash.display.*; import flash.filters.*; public class Flame extends Bitmap { private const DEST:Point; private const MATRIX_3x5; private var cFilter:ConvolutionFilter; private var SPARKS:int; private var backBuffer:BitmapData; private var screenBuffer:BitmapData; private var FLAME_HEIGHT:int; private var SOURCE:Rectangle; private var disposed:Boolean;// = false private var FLAME_WIDTH:int; private var palette:Array; public function Flame(_arg1:int, _arg2:int){ DEST = new Point(0, 0); MATRIX_3x5 = new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0); cFilter = new ConvolutionFilter(3, 5, MATRIX_3x5, 4.56, -1, false, false, 4278190335, 0); palette = new Array(); super(null, "auto", true); FLAME_WIDTH = _arg1; FLAME_HEIGHT = _arg2; SOURCE = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); backBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, false, 0xFF); screenBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, true, 0); bitmapData = screenBuffer; initpalette(); disposed = false; } public function update(_arg1:int){ var _local4:uint; if (disposed){ return; }; var _local2:uint = (FLAME_HEIGHT - 10); SPARKS = (_arg1 / 2); FLAME_WIDTH = _arg1; backBuffer.lock(); var _local3:uint; while (_local3 < SPARKS) { _local4 = 0; while (_local4 < 7) { backBuffer.setPixel(uint((Math.random() * FLAME_WIDTH)), (_local2 + _local4), (Math.random() * 25)); _local4++; }; _local3++; }; backBuffer.unlock(); backBuffer.applyFilter(backBuffer, SOURCE, DEST, cFilter); screenBuffer.paletteMap(backBuffer, SOURCE, DEST, null, null, palette, null); screenBuffer.threshold(screenBuffer, SOURCE, DEST, "==", 4278190080, 0, 4278190080, true); } public function dispose():void{ cFilter = null; bitmapData = null; backBuffer.dispose(); screenBuffer.dispose(); disposed = true; } private function initpalette(){ var _local1:Sprite = new TransparentFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 1)); _local3++; }; _local2.dispose(); } } }//package effects
Section 116
//MaskedFlame (effects.MaskedFlame) package effects { import flash.geom.*; import flash.display.*; import flash.events.*; import flash.filters.*; public class MaskedFlame extends Bitmap { const DEST:Point; const MATRIX_3x5; var noiseBmp:Bitmap; private var dir:Array; private var offset:Array; private var masker:BitmapData; var noise:Sprite; private var SOURCE:Rectangle; private var noiseSeed:uint; private var mtx:Matrix; private var tfm:ColorTransform; private var skipper:int;// = 0 private var cFilter:ConvolutionFilter; private var frontBuffer:BitmapData; private var screenBuffer:BitmapData; private var FLAME_HEIGHT:int; private var perlin:BitmapData; private var noiseGenerator:BitmapData; private var perlinSeed:uint; private var dead:Boolean;// = true private var burnoutTimer:int;// = 0 private var _burning:Boolean;// = false private var FLAME_WIDTH:int; private var palette:Array; public function MaskedFlame(_arg1:MovieClip, _arg2:int, _arg3:int){ DEST = new Point(0, 0); MATRIX_3x5 = new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0); offset = new Array(new Point(0, 0), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Point(0, 0)); dir = new Array(new Point(rnd(), rnd()), new Point(rnd(), rnd()), new Point(rnd(), rnd()), new Point(rnd(), rnd()), new Point(rnd(), rnd())); cFilter = new ConvolutionFilter(3, 5, MATRIX_3x5, 4, -2, false, false, 0xFF, 0); palette = new Array(); noiseSeed = (Math.random() * uint.MAX_VALUE); perlinSeed = (Math.random() * uint.MAX_VALUE); super(null, "always", true); FLAME_WIDTH = _arg2; FLAME_HEIGHT = _arg3; noiseGenerator = new BitmapData(_arg1.flameMask.width, _arg1.flameMask.height, false); masker = new BitmapData(_arg1.flameMask.width, _arg1.flameMask.height, false); perlin = new BitmapData(_arg1.flameMask.width, _arg1.flameMask.height, false); masker.draw(_arg1.flameMask); _arg1.flameMask.visible = false; mtx = new Matrix(1, 0, 0, 1, _arg1.flameMask.x, _arg1.flameMask.y); tfm = new ColorTransform(0.2, 0.2, 0.2); perlin.perlinNoise(5, 30, offset.length, perlinSeed, false, false, 7, true, offset); SOURCE = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); frontBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, false, 0xFF); screenBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, true, 0); bitmapData = perlin; bitmapData = screenBuffer; initPalette(); this.addEventListener(Event.ADDED_TO_STAGE, startFlame); this.addEventListener(Event.REMOVED_FROM_STAGE, stopFlame); _arg1.addChild(this); } private function dispose():void{ this.removeEventListener(Event.ENTER_FRAME, update); perlin.dispose(); noiseGenerator.dispose(); frontBuffer.dispose(); screenBuffer.dispose(); palette.length = 0; perlin = null; noiseGenerator = null; frontBuffer = null; screenBuffer = null; } public function switchPalette(_arg1:Sprite):void{ var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_arg1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 1)); _local3++; }; _local2.dispose(); } private function rnd():Number{ return ((Math.random() - 0.5)); } public function get burning():Boolean{ return (_burning); } private function initPalette(){ var _local1:Sprite = new TransparentFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 1)); _local3++; }; _local2.dispose(); } private function update(_arg1:Event):void{ var _local2:int; var _local3:int; if (dead){ return; }; if (burning){ noiseSeed++; _local2 = offset.length; _local3 = 0; while (_local3 < _local2) { offset[_local3] = offset[_local3].add(dir[_local3]); _local3++; }; perlin.perlinNoise(5, 30, offset.length, perlinSeed, false, false, 7, true, offset); noiseGenerator.noise(noiseSeed, 80, 0xFF, 7, true); noiseGenerator.draw(masker, null, null, BlendMode.ADD); noiseGenerator.draw(perlin, null, tfm, BlendMode.ADD); frontBuffer.draw(noiseGenerator, mtx, null, BlendMode.MULTIPLY); } else { burnoutTimer++; if (burnoutTimer > 200){ dead = true; }; }; frontBuffer.applyFilter(frontBuffer, SOURCE, DEST, cFilter); screenBuffer.paletteMap(frontBuffer, SOURCE, DEST, null, null, palette); screenBuffer.threshold(screenBuffer, SOURCE, DEST, "==", 4278190080, 0, 4278190080, true); } private function stopFlame(_arg1:Event){ this.removeEventListener(Event.ADDED_TO_STAGE, startFlame); this.removeEventListener(Event.REMOVED_FROM_STAGE, stopFlame); if (parent){ parent.removeChild(this); }; dispose(); } public function set burning(_arg1:Boolean):void{ _burning = _arg1; if (_arg1){ dead = false; burnoutTimer = 0; }; } private function startFlame(_arg1:Event){ this.addEventListener(Event.ENTER_FRAME, update); } } }//package effects
Section 117
//BaseScrollPane (fl.containers.BaseScrollPane) package fl.containers { import fl.core.*; import flash.geom.*; import fl.controls.*; import flash.display.*; import flash.events.*; import fl.events.*; public class BaseScrollPane extends UIComponent { protected var contentHeight:Number;// = 0 protected var _horizontalScrollBar:ScrollBar; protected var _horizontalPageScrollSize:Number;// = 0 protected var _verticalPageScrollSize:Number;// = 0 protected var _maxHorizontalScrollPosition:Number;// = 0 protected var defaultLineScrollSize:Number;// = 4 protected var vOffset:Number;// = 0 protected var contentScrollRect:Rectangle; protected var background:DisplayObject; protected var _verticalScrollBar:ScrollBar; protected var disabledOverlay:Shape; protected var vScrollBar:Boolean; protected var _horizontalScrollPolicy:String; protected var useFixedHorizontalScrolling:Boolean;// = false protected var contentWidth:Number;// = 0 protected var availableHeight:Number; protected var _verticalScrollPolicy:String; protected var contentPadding:Number;// = 0 protected var _useBitmpScrolling:Boolean;// = false protected var availableWidth:Number; protected var hScrollBar:Boolean; 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}; override public function set enabled(_arg1:Boolean):void{ if (enabled == _arg1){ return; }; _verticalScrollBar.enabled = _arg1; _horizontalScrollBar.enabled = _arg1; super.enabled = _arg1; } public function set useBitmapScrolling(_arg1:Boolean):void{ _useBitmpScrolling = _arg1; invalidate(InvalidationType.STATE); } public function set horizontalLineScrollSize(_arg1:Number):void{ _horizontalScrollBar.lineScrollSize = _arg1; } 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 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)); } protected function handleScroll(_arg1:ScrollEvent):void{ if (_arg1.target == _verticalScrollBar){ setVerticalScrollPosition(_arg1.position); } else { setHorizontalScrollPosition(_arg1.position); }; } public function get verticalLineScrollSize():Number{ return (_verticalScrollBar.lineScrollSize); } protected function drawBackground():void{ var _local1:DisplayObject = background; background = getDisplayObjectInstance(getStyleValue("skin")); background.width = width; background.height = height; addChildAt(background, 0); if (((!((_local1 == null))) && (!((_local1 == background))))){ removeChild(_local1); }; } protected function calculateAvailableSize():void{ var _local1:Number = ScrollBar.WIDTH; var _local2:Number = (contentPadding = Number(getStyleValue("contentPadding"))); var _local3:Number = ((height - (2 * _local2)) - vOffset); vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3))))); var _local4:Number = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2)); var _local5:Number = (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 verticalScrollPosition():Number{ return (_verticalScrollBar.scrollPosition); } public function get horizontalScrollPolicy():String{ return (_horizontalScrollPolicy); } protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ } public function get horizontalPageScrollSize():Number{ if (isNaN(availableWidth)){ drawNow(); }; return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize); } public function set horizontalScrollPosition(_arg1:Number):void{ drawNow(); _horizontalScrollBar.scrollPosition = _arg1; setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false); } public function set verticalLineScrollSize(_arg1:Number):void{ _verticalScrollBar.lineScrollSize = _arg1; } public function get maxVerticalScrollPosition():Number{ drawNow(); return (Math.max(0, (contentHeight - availableHeight))); } 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 get horizontalScrollBar():ScrollBar{ return (_horizontalScrollBar); } protected function calculateContentWidth():void{ } public function set horizontalScrollPolicy(_arg1:String):void{ _horizontalScrollPolicy = _arg1; invalidate(InvalidationType.SIZE); } override protected function configUI():void{ 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(); var _local1:Graphics = disabledOverlay.graphics; _local1.beginFill(0xFFFFFF); _local1.drawRect(0, 0, width, height); _local1.endFill(); addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true); } 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 get horizontalScrollPosition():Number{ return (_horizontalScrollBar.scrollPosition); } public function get verticalScrollBar():ScrollBar{ return (_verticalScrollBar); } public function get horizontalLineScrollSize():Number{ return (_horizontalScrollBar.lineScrollSize); } public function set verticalScrollPosition(_arg1:Number):void{ drawNow(); _verticalScrollBar.scrollPosition = _arg1; setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false); } protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ } protected function setStyles():void{ copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES); copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES); } public function set verticalPageScrollSize(_arg1:Number):void{ _verticalPageScrollSize = _arg1; invalidate(InvalidationType.SIZE); } protected function setContentSize(_arg1:Number, _arg2:Number):void{ if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){ return; }; contentWidth = _arg1; contentHeight = _arg2; invalidate(InvalidationType.SIZE); } public function set verticalScrollPolicy(_arg1:String):void{ _verticalScrollPolicy = _arg1; invalidate(InvalidationType.SIZE); } public function get maxHorizontalScrollPosition():Number{ drawNow(); return (Math.max(0, (contentWidth - availableWidth))); } protected function updateChildren():void{ _verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled); _verticalScrollBar.drawNow(); _horizontalScrollBar.drawNow(); } public function get verticalPageScrollSize():Number{ if (isNaN(availableHeight)){ drawNow(); }; return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize); } public function get verticalScrollPolicy():String{ return (_verticalScrollPolicy); } public function get useBitmapScrolling():Boolean{ return (_useBitmpScrolling); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition())); } } }//package fl.containers
Section 118
//CellRenderer (fl.controls.listClasses.CellRenderer) package fl.controls.listClasses { import fl.controls.*; import flash.events.*; public class CellRenderer extends LabelButton implements ICellRenderer { protected var _listData:ListData; protected var _data:Object; 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 public function set selected(_arg1:Boolean):void{ super.selected = _arg1; } override protected function drawLayout():void{ var _local3:Number; var _local1:Number = Number(getStyleValue("textPadding")); var _local2:Number = 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 listData():ListData{ return (_listData); } override public function setSize(_arg1:Number, _arg2:Number):void{ super.setSize(_arg1, _arg2); } public function get data():Object{ return (_data); } public function set data(_arg1:Object):void{ _data = _arg1; } public function set listData(_arg1:ListData):void{ _listData = _arg1; label = _listData.label; setStyle("icon", _listData.icon); } override public function get selected():Boolean{ return (super.selected); } override protected function toggleSelected(_arg1:MouseEvent):void{ } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls.listClasses
Section 119
//ICellRenderer (fl.controls.listClasses.ICellRenderer) package fl.controls.listClasses { public interface ICellRenderer { function set x(_arg1:Number):void; function set y(_arg1:Number):void; function setSize(_arg1:Number, _arg2:Number):void; function set data(_arg1:Object):void; function set selected(_arg1:Boolean):void; function set listData(_arg1:ListData):void; function get listData():ListData; function get data():Object; function get selected():Boolean; function setMouseState(_arg1:String):void; } }//package fl.controls.listClasses
Section 120
//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){ _label = _arg1; _icon = _arg2; _owner = _arg3; _index = _arg4; _row = _arg5; _column = _arg6; } public function get row():uint{ return (_row); } public function get owner():UIComponent{ return (_owner); } public function get label():String{ return (_label); } 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 121
//BaseButton (fl.controls.BaseButton) package fl.controls { import fl.core.*; import flash.display.*; import flash.events.*; import flash.utils.*; import fl.events.*; public class BaseButton extends UIComponent { protected var pressTimer:Timer; protected var _autoRepeat:Boolean;// = false protected var _selected:Boolean;// = false protected var background:DisplayObject; private var unlockedMouseState:String; protected var mouseState:String; private var _mouseStateLocked: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(){ buttonMode = true; mouseChildren = false; useHandCursor = false; setupMouseEvents(); setMouseState("up"); pressTimer = new Timer(1, 0); pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true); } override public function get enabled():Boolean{ return (super.enabled); } protected function startPress():void{ if (_autoRepeat){ pressTimer.delay = Number(getStyleValue("repeatDelay")); pressTimer.start(); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } 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 drawLayout():void{ background.width = width; background.height = height; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; mouseEnabled = _arg1; } public function set autoRepeat(_arg1:Boolean):void{ _autoRepeat = _arg1; } 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(); }; }; }; } protected function drawBackground():void{ var _local1:String = (enabled) ? mouseState : "disabled"; if (selected){ _local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1)); }; _local1 = (_local1 + "Skin"); var _local2:DisplayObject = background; background = getDisplayObjectInstance(getStyleValue(_local1)); addChildAt(background, 0); if (((!((_local2 == null))) && (!((_local2 == background))))){ removeChild(_local2); }; } public function get selected():Boolean{ return (_selected); } 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 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 selected(_arg1:Boolean):void{ if (_selected == _arg1){ return; }; _selected = _arg1; invalidate(InvalidationType.STATE); } 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 setMouseState(_arg1:String):void{ if (_mouseStateLocked){ unlockedMouseState = _arg1; return; }; if (mouseState == _arg1){ return; }; mouseState = _arg1; invalidate(InvalidationType.STATE); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 122
//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 _emphasized:Boolean;// = false protected var emphasizedBorder:DisplayObject; private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2}; public static var createAccessibilityImplementation:Function; public function set emphasized(_arg1:Boolean):void{ _emphasized = _arg1; invalidate(InvalidationType.STYLES); } override protected function initializeAccessibility():void{ if (Button.createAccessibilityImplementation != null){ Button.createAccessibilityImplementation(this); }; } protected function drawEmphasized():void{ var _local2:Number; if (emphasizedBorder != null){ removeChild(emphasizedBorder); }; emphasizedBorder = null; if (!_emphasized){ return; }; var _local1:Object = 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 function get emphasized():Boolean{ return (_emphasized); } override protected function draw():void{ if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){ drawEmphasized(); }; super.draw(); if (emphasizedBorder != null){ setChildIndex(emphasizedBorder, (numChildren - 1)); }; } 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 static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles)); } } }//package fl.controls
Section 123
//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 124
//CheckBox (fl.controls.CheckBox) package fl.controls { import flash.display.*; public class CheckBox extends LabelButton { private static var defaultStyles:Object = {icon:null, upIcon:"CheckBox_upIcon", downIcon:"CheckBox_downIcon", overIcon:"CheckBox_overIcon", disabledIcon:"CheckBox_disabledIcon", selectedDisabledIcon:"CheckBox_selectedDisabledIcon", focusRectSkin:null, focusRectPadding:null, selectedUpIcon:"CheckBox_selectedUpIcon", selectedDownIcon:"CheckBox_selectedDownIcon", selectedOverIcon:"CheckBox_selectedOverIcon", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5}; public static var createAccessibilityImplementation:Function; override protected function drawBackground():void{ } override public function get toggle():Boolean{ return (true); } override protected function initializeAccessibility():void{ if (CheckBox.createAccessibilityImplementation != null){ CheckBox.createAccessibilityImplementation(this); }; } override public function set toggle(_arg1:Boolean):void{ throw (new Error("Warning: You cannot change a CheckBox's toggle.")); } override public function get autoRepeat():Boolean{ return (false); } override public function set autoRepeat(_arg1:Boolean):void{ } override public function drawFocus(_arg1:Boolean):void{ var _local2:Number; super.drawFocus(_arg1); if (_arg1){ _local2 = Number(getStyleValue("focusRectPadding")); uiFocusRect.x = (background.x - _local2); uiFocusRect.y = (background.y - _local2); uiFocusRect.width = (background.width + (_local2 << 1)); uiFocusRect.height = (background.height + (_local2 << 1)); }; } override protected function configUI():void{ super.configUI(); super.toggle = true; var _local1:Shape = new Shape(); var _local2:Graphics = _local1.graphics; _local2.beginFill(0, 0); _local2.drawRect(0, 0, 100, 100); _local2.endFill(); background = (_local1 as DisplayObject); addChildAt(background, 0); } override protected function drawLayout():void{ super.drawLayout(); var _local1:Number = Number(getStyleValue("textPadding")); switch (_labelPlacement){ case ButtonLabelPlacement.RIGHT: icon.x = _local1; textField.x = (icon.x + (icon.width + _local1)); background.width = ((textField.x + textField.width) + _local1); background.height = (Math.max(textField.height, icon.height) + (_local1 * 2)); break; case ButtonLabelPlacement.LEFT: icon.x = ((width - icon.width) - _local1); textField.x = (((width - icon.width) - (_local1 * 2)) - textField.width); background.width = ((textField.width + icon.width) + (_local1 * 3)); background.height = (Math.max(textField.height, icon.height) + (_local1 * 2)); break; case ButtonLabelPlacement.TOP: case ButtonLabelPlacement.BOTTOM: background.width = (Math.max(textField.width, icon.width) + (_local1 * 2)); background.height = ((textField.height + icon.height) + (_local1 * 3)); break; }; background.x = Math.min((icon.x - _local1), (textField.x - _local1)); background.y = Math.min((icon.y - _local1), (textField.y - _local1)); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 125
//ComboBox (fl.controls.ComboBox) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.geom.*; import flash.display.*; import flash.events.*; import fl.data.*; import fl.events.*; import fl.managers.*; import flash.text.*; import flash.ui.*; public class ComboBox extends UIComponent implements IFocusManagerComponent { protected var isKeyDown:Boolean;// = false protected var _labels:Array; protected var background:BaseButton; protected var _dropdownWidth:Number; protected var inputField:TextInput; protected var highlightedCell:int;// = -1 protected var listOverIndex:uint; protected var editableValue:String; protected var _prompt:String; protected var isOpen:Boolean;// = false protected var list:List; protected var _rowCount:uint;// = 5 protected var _editable:Boolean;// = false private var collectionItemImport:SimpleCollectionItem; protected var currentIndex:int; protected static const BACKGROUND_STYLES:Object = {overSkin:"overSkin", downSkin:"downSkin", upSkin:"upSkin", disabledSkin:"disabledSkin", repeatInterval:"repeatInterval"}; protected static const LIST_STYLES:Object = {upSkin:"comboListUpSkin", overSkin:"comboListOverSkin", downSkin:"comobListDownSkin", disabledSkin:"comboListDisabledSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval", textFormat:"textFormat", disabledAlpha:"disabledAlpha", skin:"listSkin"}; private static var defaultStyles:Object = {upSkin:"ComboBox_upSkin", downSkin:"ComboBox_downSkin", overSkin:"ComboBox_overSkin", disabledSkin:"ComboBox_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, buttonWidth:24, disabledAlpha:null, listSkin:null}; public static var createAccessibilityImplementation:Function; protected function drawList():void{ list.rowCount = Math.max(0, Math.min(_rowCount, list.dataProvider.length)); } public function get imeMode():String{ return (inputField.imeMode); } protected function onInputFieldFocusOut(_arg1:FocusEvent):void{ inputField.removeEventListener(ComponentEvent.ENTER, onEnter); selectedIndex = selectedIndex; } public function set imeMode(_arg1:String):void{ inputField.imeMode = _arg1; } protected function passEvent(_arg1:Event):void{ dispatchEvent(_arg1); } protected function calculateAvailableHeight():Number{ var _local1:Number = Number(getStyleValue("contentPadding")); return ((list.height - (_local1 * 2))); } public function get dropdown():List{ return (list); } override protected function focusOutHandler(_arg1:FocusEvent):void{ isKeyDown = false; if (isOpen){ if (((!(_arg1.relatedObject)) || (!(list.contains(_arg1.relatedObject))))){ if (((!((highlightedCell == -1))) && (!((highlightedCell == selectedIndex))))){ selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; close(); }; }; super.focusOutHandler(_arg1); } public function get selectedLabel():String{ if (editableValue != null){ return (editableValue); }; if (selectedIndex == -1){ return (null); }; return (itemToLabel(selectedItem)); } protected function onListChange(_arg1:Event):void{ editableValue = null; dispatchEvent(_arg1); invalidate(InvalidationType.SELECTED); if (isKeyDown){ return; }; close(); } public function get text():String{ return (inputField.text); } protected function onEnter(_arg1:ComponentEvent):void{ _arg1.stopPropagation(); } public function sortItemsOn(_arg1:String, _arg2:Object=null){ return (list.sortItemsOn(_arg1, _arg2)); } protected function handleDataChange(_arg1:DataChangeEvent):void{ invalidate(InvalidationType.DATA); } protected function onToggleListVisibility(_arg1:MouseEvent):void{ _arg1.stopPropagation(); dispatchEvent(_arg1); if (isOpen){ close(); } else { open(); stage.addEventListener(MouseEvent.MOUSE_UP, onListItemUp, false, 0, true); }; } public function get dropdownWidth():Number{ return (list.width); } protected function highlightCell(_arg1:int=-1):void{ var _local2:ICellRenderer; if (highlightedCell > -1){ _local2 = list.itemToCellRenderer(getItemAt(highlightedCell)); if (_local2 != null){ _local2.setMouseState("up"); }; }; if (_arg1 == -1){ return; }; list.scrollToIndex(_arg1); list.drawNow(); _local2 = list.itemToCellRenderer(getItemAt(_arg1)); if (_local2 != null){ _local2.setMouseState("over"); highlightedCell = _arg1; }; } public function removeItemAt(_arg1:uint):void{ list.removeItemAt(_arg1); invalidate(InvalidationType.DATA); } override protected function draw():void{ var _local1:* = selectedIndex; if ((((_local1 == -1)) && (((((!((prompt == null))) || (editable))) || ((length == 0)))))){ _local1 = Math.max(-1, Math.min(_local1, (length - 1))); } else { editableValue = null; _local1 = Math.max(0, Math.min(_local1, (length - 1))); }; if (list.selectedIndex != _local1){ list.selectedIndex = _local1; invalidate(InvalidationType.SELECTED, false); }; if (isInvalid(InvalidationType.STYLES)){ setStyles(); setEmbedFonts(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.STATE)){ drawTextFormat(); drawLayout(); invalidate(InvalidationType.DATA); }; if (isInvalid(InvalidationType.DATA)){ drawList(); invalidate(InvalidationType.SELECTED, true); }; if (isInvalid(InvalidationType.SELECTED)){ if ((((_local1 == -1)) && (!((editableValue == null))))){ inputField.text = editableValue; } else { if (_local1 > -1){ if (length > 0){ inputField.horizontalScrollPosition = 0; inputField.text = itemToLabel(list.selectedItem); }; } else { if ((((_local1 == -1)) && (!((_prompt == null))))){ showPrompt(); } else { inputField.text = ""; }; }; }; if (((((editable) && ((selectedIndex > -1)))) && ((stage.focus == inputField.textField)))){ inputField.setSelection(0, inputField.length); }; }; drawTextField(); super.draw(); } public function get selectedItem():Object{ return (list.selectedItem); } public function open():void{ currentIndex = selectedIndex; if (((isOpen) || ((length == 0)))){ return; }; dispatchEvent(new Event(Event.OPEN)); isOpen = true; addEventListener(Event.ENTER_FRAME, addCloseListener, false, 0, true); positionList(); list.scrollToSelected(); stage.addChild(list); } override protected function configUI():void{ super.configUI(); background = new BaseButton(); background.focusEnabled = false; copyStylesToChild(background, BACKGROUND_STYLES); background.addEventListener(MouseEvent.MOUSE_DOWN, onToggleListVisibility, false, 0, true); addChild(background); inputField = new TextInput(); inputField.focusTarget = (this as IFocusManagerComponent); inputField.focusEnabled = false; inputField.addEventListener(Event.CHANGE, onTextInput, false, 0, true); addChild(inputField); list = new List(); list.focusEnabled = false; copyStylesToChild(list, LIST_STYLES); list.addEventListener(Event.CHANGE, onListChange, false, 0, true); list.addEventListener(ListEvent.ITEM_CLICK, onListChange, false, 0, true); list.addEventListener(ListEvent.ITEM_ROLL_OUT, passEvent, false, 0, true); list.addEventListener(ListEvent.ITEM_ROLL_OVER, passEvent, false, 0, true); list.verticalScrollBar.addEventListener(Event.SCROLL, passEvent, false, 0, true); } public function set text(_arg1:String):void{ if (!editable){ return; }; inputField.text = _arg1; } public function addItem(_arg1:Object):void{ list.addItem(_arg1); invalidate(InvalidationType.DATA); } public function get editable():Boolean{ return (_editable); } public function get labelField():String{ return (list.labelField); } protected function positionList():void{ var _local1:Point = localToGlobal(new Point(0, 0)); list.x = _local1.x; if (((_local1.y + height) + list.height) > stage.stageHeight){ list.y = (_local1.y - list.height); } else { list.y = (_local1.y + height); }; } protected function onStageClick(_arg1:MouseEvent):void{ if (!isOpen){ return; }; if (((!(contains((_arg1.target as DisplayObject)))) && (!(list.contains((_arg1.target as DisplayObject)))))){ if (highlightedCell != -1){ selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; close(); }; } public function set dropdownWidth(_arg1:Number):void{ _dropdownWidth = _arg1; invalidate(InvalidationType.SIZE); } public function get prompt():String{ return (_prompt); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ isKeyDown = true; if (_arg1.ctrlKey){ switch (_arg1.keyCode){ case Keyboard.UP: if (highlightedCell > -1){ selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; close(); break; case Keyboard.DOWN: open(); break; }; return; }; _arg1.stopPropagation(); var _local2:int = Math.max(((calculateAvailableHeight() / list.rowHeight) << 0), 1); var _local3:uint = selectedIndex; var _local4:Number = ((highlightedCell)==-1) ? selectedIndex : highlightedCell; var _local5 = -1; switch (_arg1.keyCode){ case Keyboard.SPACE: if (isOpen){ close(); } else { open(); }; return; case Keyboard.ESCAPE: if (isOpen){ if (highlightedCell > -1){ selectedIndex = selectedIndex; }; close(); }; return; case Keyboard.UP: _local5 = Math.max(0, (_local4 - 1)); break; case Keyboard.DOWN: _local5 = Math.min((length - 1), (_local4 + 1)); break; case Keyboard.PAGE_UP: _local5 = Math.max((_local4 - _local2), 0); break; case Keyboard.PAGE_DOWN: _local5 = Math.min((_local4 + _local2), (length - 1)); break; case Keyboard.HOME: _local5 = 0; break; case Keyboard.END: _local5 = (length - 1); break; case Keyboard.ENTER: if (((_editable) && ((highlightedCell == -1)))){ editableValue = inputField.text; selectedIndex = -1; } else { if (((isOpen) && ((highlightedCell > -1)))){ editableValue = null; selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; }; dispatchEvent(new ComponentEvent(ComponentEvent.ENTER)); close(); return; default: if (editable){ break; }; _local5 = list.getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), _local4); break; }; if (_local5 > -1){ if (isOpen){ highlightCell(_local5); inputField.text = list.itemToLabel(getItemAt(_local5)); } else { highlightCell(); selectedIndex = _local5; dispatchEvent(new Event(Event.CHANGE)); }; }; } public function get value():String{ var _local1:Object; if (editableValue != null){ return (editableValue); }; _local1 = selectedItem; if (((!(_editable)) && (!((_local1.data == null))))){ return (_local1.data); }; return (itemToLabel(_local1)); } override protected function focusInHandler(_arg1:FocusEvent):void{ super.focusInHandler(_arg1); if (editable){ stage.focus = inputField.textField; }; } public function set dataProvider(_arg1:DataProvider):void{ _arg1.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true); list.dataProvider = _arg1; invalidate(InvalidationType.DATA); } public function get rowCount():uint{ return (_rowCount); } public function set restrict(_arg1:String):void{ if (((componentInspectorSetting) && ((_arg1 == "")))){ _arg1 = null; }; if (!_editable){ return; }; inputField.restrict = _arg1; } public function replaceItemAt(_arg1:Object, _arg2:uint):Object{ return (list.replaceItemAt(_arg1, _arg2)); } public function removeAll():void{ list.removeAll(); inputField.text = ""; invalidate(InvalidationType.DATA); } protected function onTextInput(_arg1:Event):void{ _arg1.stopPropagation(); if (!_editable){ return; }; editableValue = inputField.text; selectedIndex = -1; dispatchEvent(new Event(Event.CHANGE)); } protected function onInputFieldFocus(_arg1:FocusEvent):void{ inputField.addEventListener(ComponentEvent.ENTER, onEnter, false, 0, true); close(); } protected function onListItemUp(_arg1:MouseEvent):void{ stage.removeEventListener(MouseEvent.MOUSE_UP, onListItemUp); if (((!((_arg1.target is ICellRenderer))) || (!(list.contains((_arg1.target as DisplayObject)))))){ return; }; editableValue = null; var _local2:* = selectedIndex; selectedIndex = _arg1.target.listData.index; if (_local2 != selectedIndex){ dispatchEvent(new Event(Event.CHANGE)); }; close(); } override protected function keyUpHandler(_arg1:KeyboardEvent):void{ isKeyDown = false; } protected function drawLayout():void{ var _local1:Number = (getStyleValue("buttonWidth") as Number); var _local2:Number = (getStyleValue("textPadding") as Number); background.setSize(width, height); inputField.x = (inputField.y = _local2); inputField.setSize(((width - _local1) - _local2), (height - _local2)); list.width = (isNaN(_dropdownWidth)) ? width : _dropdownWidth; background.enabled = enabled; background.drawNow(); } public function set selectedItem(_arg1:Object):void{ list.selectedItem = _arg1; invalidate(InvalidationType.SELECTED); } public function getItemAt(_arg1:uint):Object{ return (list.getItemAt(_arg1)); } override protected function initializeAccessibility():void{ if (ComboBox.createAccessibilityImplementation != null){ ComboBox.createAccessibilityImplementation(this); }; } public function itemToLabel(_arg1:Object):String{ if (_arg1 == null){ return (""); }; return (list.itemToLabel(_arg1)); } public function addItemAt(_arg1:Object, _arg2:uint):void{ list.addItemAt(_arg1, _arg2); invalidate(InvalidationType.DATA); } private function addCloseListener(_arg1:Event){ removeEventListener(Event.ENTER_FRAME, addCloseListener); if (!isOpen){ return; }; stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageClick, false, 0, true); } protected function setEmbedFonts():void{ var _local1:Object = getStyleValue("embedFonts"); if (_local1 != null){ inputField.textField.embedFonts = _local1; }; } public function set rowCount(_arg1:uint):void{ _rowCount = _arg1; invalidate(InvalidationType.SIZE); } public function removeItem(_arg1:Object):Object{ return (list.removeItem(_arg1)); } public function get dataProvider():DataProvider{ return (list.dataProvider); } public function get restrict():String{ return (inputField.restrict); } protected function showPrompt():void{ inputField.text = _prompt; } public function sortItems(... _args){ return (list.sortItems.apply(list, _args)); } public function set editable(_arg1:Boolean):void{ _editable = _arg1; drawTextField(); } public function set labelField(_arg1:String):void{ list.labelField = _arg1; invalidate(InvalidationType.DATA); } public function get textField():TextInput{ return (inputField); } public function set prompt(_arg1:String):void{ if (_arg1 == ""){ _prompt = null; } else { _prompt = _arg1; }; invalidate(InvalidationType.STATE); } public function set labelFunction(_arg1:Function):void{ list.labelFunction = _arg1; invalidate(InvalidationType.DATA); } protected function setStyles():void{ copyStylesToChild(background, BACKGROUND_STYLES); copyStylesToChild(list, LIST_STYLES); } public function get length():int{ return (list.length); } protected function drawTextFormat():void{ var _local1:TextFormat = (getStyleValue((_enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local1 == null){ _local1 = new TextFormat(); }; inputField.textField.defaultTextFormat = _local1; inputField.textField.setTextFormat(_local1); setEmbedFonts(); } protected function drawTextField():void{ inputField.setStyle("upSkin", ""); inputField.setStyle("disabledSkin", ""); inputField.enabled = enabled; inputField.editable = _editable; inputField.textField.selectable = ((enabled) && (_editable)); inputField.mouseEnabled = (inputField.mouseChildren = ((enabled) && (_editable))); inputField.focusEnabled = false; if (_editable){ inputField.addEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus, false, 0, true); inputField.addEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut, false, 0, true); } else { inputField.removeEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus); inputField.removeEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut); }; } public function get labelFunction():Function{ return (list.labelFunction); } public function set selectedIndex(_arg1:int):void{ list.selectedIndex = _arg1; highlightCell(); invalidate(InvalidationType.SELECTED); } public function get selectedIndex():int{ return (list.selectedIndex); } public function close():void{ highlightCell(); highlightedCell = -1; if (!isOpen){ return; }; dispatchEvent(new Event(Event.CLOSE)); stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageClick); isOpen = false; stage.removeChild(list); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, List.getStyleDefinition())); } } }//package fl.controls
Section 126
//Label (fl.controls.Label) package fl.controls { import fl.core.*; import fl.events.*; import flash.text.*; public class Label extends UIComponent { protected var _savedHTML:String; protected var _html:Boolean;// = false public var textField:TextField; protected var actualHeight:Number; protected var actualWidth:Number; protected var defaultLabel:String;// = "Label" private static var defaultStyles:Object = {textFormat:null, embedFonts:false}; public function Label(){ text = defaultLabel; actualWidth = _width; actualHeight = _height; } override public function setSize(_arg1:Number, _arg2:Number):void{ actualWidth = _arg1; actualHeight = _arg2; super.setSize(_arg1, _arg2); } override protected function draw():void{ var _local1:Object; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawTextFormat(); _local1 = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE, false); }; }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; super.draw(); } override public function get width():Number{ if (((!((textField.autoSize == TextFieldAutoSize.NONE))) && (!(wordWrap)))){ return (_width); }; return (actualWidth); } public function get condenseWhite():Boolean{ return (textField.condenseWhite); } protected function drawLayout():void{ var _local2:Number; var _local3:Number; var _local1:Boolean; textField.width = width; textField.height = height; if (textField.autoSize != TextFieldAutoSize.NONE){ _local2 = textField.width; _local3 = textField.height; _local1 = ((!((_width == _local2))) || (!((_height == _local3)))); _width = _local2; _height = _local3; switch (textField.autoSize){ case TextFieldAutoSize.CENTER: textField.x = ((actualWidth / 2) - (textField.width / 2)); break; case TextFieldAutoSize.LEFT: textField.x = 0; break; case TextFieldAutoSize.RIGHT: textField.x = -((textField.width - actualWidth)); break; }; } else { textField.width = actualWidth; textField.height = actualHeight; textField.x = 0; }; if (_local1){ dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, true)); }; } public function get autoSize():String{ return (textField.autoSize); } override public function set width(_arg1:Number):void{ actualWidth = _arg1; super.width = _arg1; } public function get selectable():Boolean{ return (textField.selectable); } public function set condenseWhite(_arg1:Boolean):void{ textField.condenseWhite = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } public function set text(_arg1:String):void{ if (_arg1 == text){ return; }; if (((componentInspectorSetting) && ((_arg1 == defaultLabel)))){ return; }; _html = false; textField.text = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } override protected function configUI():void{ super.configUI(); textField = new TextField(); addChild(textField); textField.type = TextFieldType.DYNAMIC; textField.selectable = false; textField.wordWrap = false; } public function set autoSize(_arg1:String):void{ textField.autoSize = _arg1; invalidate(InvalidationType.SIZE); } override public function get height():Number{ if (((!((textField.autoSize == TextFieldAutoSize.NONE))) && (wordWrap))){ return (_height); }; return (actualHeight); } public function set wordWrap(_arg1:Boolean):void{ textField.wordWrap = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } public function set selectable(_arg1:Boolean):void{ textField.selectable = _arg1; } public function get text():String{ return (textField.text); } protected function drawTextFormat():void{ var _local2:Object; var _local1:TextFormat = (getStyleValue("textFormat") as TextFormat); if (_local1 == null){ _local2 = UIComponent.getStyleDefinition(); _local1 = (enabled) ? (_local2.defaultTextFormat as TextFormat) : (_local2.defaultDisabledTextFormat as TextFormat); }; textField.defaultTextFormat = _local1; textField.setTextFormat(_local1); if (((_html) && (!((_savedHTML == null))))){ htmlText = _savedHTML; }; } public function get wordWrap():Boolean{ return (textField.wordWrap); } public function set htmlText(_arg1:String):void{ if (_arg1 == htmlText){ return; }; if (((componentInspectorSetting) && ((_arg1 == "")))){ return; }; _html = true; _savedHTML = _arg1; textField.htmlText = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } public function get htmlText():String{ return (textField.htmlText); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 127
//LabelButton (fl.controls.LabelButton) package fl.controls { import fl.core.*; import flash.display.*; import flash.events.*; import fl.events.*; import fl.managers.*; import flash.text.*; import flash.ui.*; public class LabelButton extends BaseButton implements IFocusManagerComponent { protected var _toggle:Boolean;// = false public var textField:TextField; protected var mode:String;// = "center" protected var _labelPlacement:String;// = "right" protected var oldMouseState:String; protected var _label:String;// = "Label" protected var icon:DisplayObject; 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; 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(); } override protected function drawLayout():void{ var _local7:Number; var _local8:Number; var _local1:Number = Number(getStyleValue("textPadding")); var _local2:String = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement; textField.height = (textField.textHeight + 4); var _local3:Number = (textField.textWidth + 4); var _local4:Number = (textField.textHeight + 4); var _local5:Number = ((icon)==null) ? 0 : (icon.width + _local1); var _local6:Number = ((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(); } protected function toggleSelected(_arg1:MouseEvent):void{ selected = !(selected); dispatchEvent(new Event(Event.CHANGE, true)); } 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)); }; } public function get labelPlacement():String{ return (_labelPlacement); } public function get toggle():Boolean{ return (_toggle); } protected function setEmbedFont(){ var _local1:Object = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } override public function get selected():Boolean{ return ((_toggle) ? _selected : false); } override protected function configUI():void{ super.configUI(); textField = new TextField(); textField.type = TextFieldType.DYNAMIC; textField.selectable = false; addChild(textField); } override protected function initializeAccessibility():void{ if (LabelButton.createAccessibilityImplementation != null){ LabelButton.createAccessibilityImplementation(this); }; } public function set labelPlacement(_arg1:String):void{ _labelPlacement = _arg1; invalidate(InvalidationType.SIZE); } protected function drawIcon():void{ var _local1:DisplayObject = icon; var _local2:String = (enabled) ? mouseState : "disabled"; if (selected){ _local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1)); }; _local2 = (_local2 + "Icon"); var _local3:Object = 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); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ if (oldMouseState == null){ oldMouseState = mouseState; }; setMouseState("down"); startPress(); }; } 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); } override public function set selected(_arg1:Boolean):void{ _selected = _arg1; if (_toggle){ invalidate(InvalidationType.STATE); }; } protected function drawTextFormat():void{ var _local1:Object = UIComponent.getStyleDefinition(); var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); } public function get label():String{ return (_label); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition())); } } }//package fl.controls
Section 128
//List (fl.controls.List) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.geom.*; import flash.display.*; import flash.events.*; import flash.utils.*; import fl.managers.*; import flash.ui.*; public class List extends SelectableList implements IFocusManagerComponent { protected var _iconField:String;// = "icon" protected var _labelField:String;// = "label" protected var _iconFunction:Function; protected var _rowHeight:Number;// = 20 protected var _cellRenderer:Object; protected var _labelFunction:Function; private static var defaultStyles:Object = {focusRectSkin:null, focusRectPadding:null}; public static var createAccessibilityImplementation:Function; public function get iconField():String{ return (_iconField); } public function set iconField(_arg1:String):void{ if (_arg1 == _iconField){ return; }; _iconField = _arg1; invalidate(InvalidationType.DATA); } public function set labelField(_arg1:String):void{ if (_arg1 == _labelField){ return; }; _labelField = _arg1; invalidate(InvalidationType.DATA); } public function set rowHeight(_arg1:Number):void{ _rowHeight = _arg1; invalidate(InvalidationType.SIZE); } override protected function draw():void{ var _local1 = !((contentHeight == (rowHeight * length))); contentHeight = (rowHeight * length); if (isInvalid(InvalidationType.STYLES)){ setStyles(); drawBackground(); if (contentPadding != getStyleValue("contentPadding")){ invalidate(InvalidationType.SIZE, false); }; if (_cellRenderer != getStyleValue("cellRenderer")){ _invalidateList(); _cellRenderer = getStyleValue("cellRenderer"); }; }; if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){ drawLayout(); }; if (isInvalid(InvalidationType.RENDERER_STYLES)){ updateRendererStyles(); }; if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){ drawList(); }; updateChildren(); validate(); } override public function get rowCount():uint{ return (Math.ceil((calculateAvailableHeight() / rowHeight))); } override protected function configUI():void{ useFixedHorizontalScrolling = true; _horizontalScrollPolicy = ScrollPolicy.AUTO; _verticalScrollPolicy = ScrollPolicy.AUTO; super.configUI(); } public function set labelFunction(_arg1:Function):void{ if (_labelFunction == _arg1){ return; }; _labelFunction = _arg1; invalidate(InvalidationType.DATA); } override public function scrollToIndex(_arg1:int):void{ drawNow(); var _local2:uint = (Math.floor(((_verticalScrollPosition + availableHeight) / rowHeight)) - 1); var _local3:uint = Math.ceil((_verticalScrollPosition / rowHeight)); if (_arg1 < _local3){ verticalScrollPosition = (_arg1 * rowHeight); } else { if (_arg1 > _local2){ verticalScrollPosition = (((_arg1 + 1) * rowHeight) - availableHeight); }; }; } override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ } override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ list.x = -(_arg1); super.setHorizontalScrollPosition(_arg1, true); } override protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ var _local4:int = Math.max(Math.floor((calculateAvailableHeight() / rowHeight)), 1); var _local5 = -1; var _local6:int; switch (_arg1){ case Keyboard.UP: if (caretIndex > 0){ _local5 = (caretIndex - 1); }; break; case Keyboard.DOWN: if (caretIndex < (length - 1)){ _local5 = (caretIndex + 1); }; break; case Keyboard.PAGE_UP: if (caretIndex > 0){ _local5 = Math.max((caretIndex - _local4), 0); }; break; case Keyboard.PAGE_DOWN: if (caretIndex < (length - 1)){ _local5 = Math.min((caretIndex + _local4), (length - 1)); }; break; case Keyboard.HOME: if (caretIndex > 0){ _local5 = 0; }; break; case Keyboard.END: if (caretIndex < (length - 1)){ _local5 = (length - 1); }; break; }; if (_local5 >= 0){ doKeySelection(_local5, _arg2, _arg3); scrollToSelected(); }; } protected function doKeySelection(_arg1:int, _arg2:Boolean, _arg3:Boolean):void{ var _local5:int; var _local6:Array; var _local7:int; var _local8:int; var _local4:Boolean; if (_arg2){ _local6 = []; _local7 = lastCaretIndex; _local8 = _arg1; if (_local7 == -1){ _local7 = ((caretIndex)!=-1) ? caretIndex : _arg1; }; if (_local7 > _local8){ _local8 = _local7; _local7 = _arg1; }; _local5 = _local7; while (_local5 <= _local8) { _local6.push(_local5); _local5++; }; selectedIndices = _local6; caretIndex = _arg1; _local4 = true; } else { selectedIndex = _arg1; caretIndex = (lastCaretIndex = _arg1); _local4 = true; }; if (_local4){ dispatchEvent(new Event(Event.CHANGE)); }; invalidate(InvalidationType.DATA); } public function get rowHeight():Number{ return (_rowHeight); } override protected function initializeAccessibility():void{ if (List.createAccessibilityImplementation != null){ List.createAccessibilityImplementation(this); }; } public function get labelField():String{ return (_labelField); } public function set iconFunction(_arg1:Function):void{ if (_iconFunction == _arg1){ return; }; _iconFunction = _arg1; invalidate(InvalidationType.DATA); } public function set rowCount(_arg1:uint):void{ var _local2:Number = Number(getStyleValue("contentPadding")); var _local3:Number = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0; height = (((rowHeight * _arg1) + (2 * _local2)) + _local3); } public function get labelFunction():Function{ return (_labelFunction); } override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ invalidate(InvalidationType.SCROLL); super.setVerticalScrollPosition(_arg1, true); } override protected function drawList():void{ var _local4:uint; var _local5:Object; var _local6:ICellRenderer; var _local9:Boolean; var _local10:String; var _local11:Object; var _local12:Sprite; var _local13:String; listHolder.x = (listHolder.y = contentPadding); var _local1:Rectangle = listHolder.scrollRect; _local1.x = _horizontalScrollPosition; _local1.y = (Math.floor(_verticalScrollPosition) % rowHeight); listHolder.scrollRect = _local1; listHolder.cacheAsBitmap = useBitmapScrolling; var _local2:uint = Math.floor((_verticalScrollPosition / rowHeight)); var _local3:uint = Math.min(length, ((_local2 + rowCount) + 1)); var _local7:Dictionary = (renderedItems = new Dictionary(true)); _local4 = _local2; while (_local4 < _local3) { _local7[_dataProvider.getItemAt(_local4)] = true; _local4++; }; var _local8:Dictionary = new Dictionary(true); while (activeCellRenderers.length > 0) { _local6 = (activeCellRenderers.pop() as ICellRenderer); _local5 = _local6.data; if ((((_local7[_local5] == null)) || ((invalidItems[_local5] == true)))){ availableCellRenderers.push(_local6); } else { _local8[_local5] = _local6; invalidItems[_local5] = true; }; list.removeChild((_local6 as DisplayObject)); }; invalidItems = new Dictionary(true); _local4 = _local2; while (_local4 < _local3) { _local9 = false; _local5 = _dataProvider.getItemAt(_local4); if (_local8[_local5] != null){ _local9 = true; _local6 = _local8[_local5]; delete _local8[_local5]; } else { if (availableCellRenderers.length > 0){ _local6 = (availableCellRenderers.pop() as ICellRenderer); } else { _local6 = (getDisplayObjectInstance(getStyleValue("cellRenderer")) as ICellRenderer); _local12 = (_local6 as Sprite); if (_local12 != null){ _local12.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true); _local12.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true); _local12.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true); _local12.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true); _local12.doubleClickEnabled = true; _local12.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true); if (_local12.hasOwnProperty("setStyle")){ for (_local13 in rendererStyles) { var _local16 = _local12; _local16["setStyle"](_local13, rendererStyles[_local13]); }; }; }; }; }; list.addChild((_local6 as Sprite)); activeCellRenderers.push(_local6); _local6.y = (rowHeight * (_local4 - _local2)); _local6.setSize((availableWidth + _maxHorizontalScrollPosition), rowHeight); _local10 = itemToLabel(_local5); _local11 = null; if (_iconFunction != null){ _local11 = _iconFunction(_local5); } else { if (_iconField != null){ _local11 = _local5[_iconField]; }; }; if (!_local9){ _local6.data = _local5; }; _local6.listData = new ListData(_local10, _local11, this, _local4, _local4, 0); _local6.selected = !((_selectedIndices.indexOf(_local4) == -1)); if ((_local6 is UIComponent)){ (_local6 as UIComponent).drawNow(); }; _local4++; }; } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ var _local2:int; if (!selectable){ return; }; switch (_arg1.keyCode){ case Keyboard.UP: case Keyboard.DOWN: case Keyboard.END: case Keyboard.HOME: case Keyboard.PAGE_UP: case Keyboard.PAGE_DOWN: moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection))); break; case Keyboard.LEFT: case Keyboard.RIGHT: moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection))); break; case Keyboard.SPACE: if (caretIndex == -1){ caretIndex = 0; }; doKeySelection(caretIndex, _arg1.shiftKey, _arg1.ctrlKey); scrollToSelected(); break; default: _local2 = getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), selectedIndex); if (_local2 > -1){ selectedIndex = _local2; scrollToSelected(); }; break; }; _arg1.stopPropagation(); } public function get iconFunction():Function{ return (_iconFunction); } override public function itemToLabel(_arg1:Object):String{ if (_labelFunction != null){ return (String(_labelFunction(_arg1))); }; return (((_arg1[_labelField])!=null) ? String(_arg1[_labelField]) : ""); } protected function calculateAvailableHeight():Number{ var _local1:Number = Number(getStyleValue("contentPadding")); return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0)); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition())); } } }//package fl.controls
Section 129
//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" private var _minScrollPosition:Number;// = 0 private var _pageSize:Number;// = 10 private var _maxScrollPosition:Number;// = 0 protected var downArrow:BaseButton; private var _lineScrollSize:Number;// = 1 protected var upArrow:BaseButton; private var _scrollPosition:Number;// = 0 private var thumbScrollOffset:Number; protected var track:BaseButton; protected var thumb:LabelButton; protected var inDrag:Boolean;// = false private var _pageScrollSize:Number;// = 0 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(){ setStyles(); focusEnabled = false; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition)))))); updateThumb(); } override public function setSize(_arg1:Number, _arg2:Number):void{ if (_direction == ScrollBarDirection.HORIZONTAL){ super.setSize(_arg2, _arg1); } else { super.setSize(_arg1, _arg2); }; } public function set lineScrollSize(_arg1:Number):void{ if (_arg1 > 0){ _lineScrollSize = _arg1; }; } public function get minScrollPosition():Number{ return (_minScrollPosition); } protected function updateThumb():void{ var _local1:Number = ((_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; }; } public function set minScrollPosition(_arg1:Number):void{ setScrollProperties(_pageSize, _arg1, _maxScrollPosition); } public function get lineScrollSize():Number{ return (_lineScrollSize); } public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{ var _local3:Number = 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 get maxScrollPosition():Number{ return (_maxScrollPosition); } public function get scrollPosition():Number{ return (_scrollPosition); } override public function get height():Number{ return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height); } public function get pageSize():Number{ return (_pageSize); } public function set maxScrollPosition(_arg1:Number):void{ setScrollProperties(_pageSize, _minScrollPosition, _arg1); } 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; }; } public function set scrollPosition(_arg1:Number):void{ setScrollPosition(_arg1, true); } 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 public function get width():Number{ return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width); } 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 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(); } public function get pageScrollSize():Number{ return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize); } protected function handleThumbDrag(_arg1:MouseEvent):void{ var _local2:Number = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset))); setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition)); } protected function setStyles():void{ copyStylesToChild(downArrow, DOWN_ARROW_STYLES); copyStylesToChild(thumb, THUMB_STYLES); copyStylesToChild(track, TRACK_STYLES); copyStylesToChild(upArrow, UP_ARROW_STYLES); } 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))); }; }; }; }; } 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); } public function set direction(_arg1:String):void{ if (_direction == _arg1){ return; }; _direction = _arg1; if (isLivePreview){ return; }; setScaleY(1); var _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 get direction():String{ return (_direction); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 130
//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 131
//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 132
//SelectableList (fl.controls.SelectableList) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.display.*; import flash.events.*; import flash.utils.*; import fl.data.*; import fl.events.*; import fl.managers.*; import fl.containers.*; import flash.ui.*; public class SelectableList extends BaseScrollPane implements IFocusManagerComponent { protected var invalidItems:Dictionary; protected var renderedItems:Dictionary; protected var caretIndex:int;// = -1 protected var updatedRendererStyles:Object; protected var _allowMultipleSelection:Boolean;// = false protected var lastCaretIndex:int;// = -1 protected var _verticalScrollPosition:Number; protected var _selectedIndices:Array; protected var preChangeItems:Array; protected var activeCellRenderers:Array; protected var availableCellRenderers:Array; protected var rendererStyles:Object; protected var list:Sprite; protected var _dataProvider:DataProvider; protected var _horizontalScrollPosition:Number; private var collectionItemImport:SimpleCollectionItem; protected var listHolder:Sprite; 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(){ 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{ } protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ } 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 set selectedIndices(_arg1:Array):void{ if (!_selectable){ return; }; _selectedIndices = ((_arg1)==null) ? [] : _arg1.concat(); invalidate(InvalidationType.SELECTED); } public function isItemSelected(_arg1:Object):Boolean{ return ((selectedItems.indexOf(_arg1) > -1)); } public function set allowMultipleSelection(_arg1:Boolean):void{ if (_arg1 == _allowMultipleSelection){ return; }; _allowMultipleSelection = _arg1; if (((!(_arg1)) && ((_selectedIndices.length > 1)))){ _selectedIndices = [_selectedIndices.pop()]; invalidate(InvalidationType.DATA); }; } override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ if (_arg1 == _verticalScrollPosition){ return; }; var _local3:Number = (_arg1 - _verticalScrollPosition); _verticalScrollPosition = _arg1; if (_arg2){ dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _local3, _arg1)); }; } public function sortItemsOn(_arg1:String, _arg2:Object=null){ return (_dataProvider.sortOn(_arg1, _arg2)); } public function getNextIndexAtLetter(_arg1:String, _arg2:int=-1):int{ var _local5:Number; var _local6:Object; var _local7:String; if (length == 0){ return (-1); }; _arg1 = _arg1.toUpperCase(); var _local3:int = (length - 1); var _local4:Number = 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); } override protected function draw():void{ super.draw(); } public function removeItemAt(_arg1:uint):Object{ return (_dataProvider.removeItemAt(_arg1)); } public function get selectedItem():Object{ return (((_selectedIndices.length)==0) ? null : _dataProvider.getItemAt(selectedIndex)); } protected function handleDataChange(_arg1:DataChangeEvent):void{ var _local5:uint; var _local2:int = _arg1.startIndex; var _local3:int = _arg1.endIndex; var _local4:String = _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); } 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 addItem(_arg1:Object):void{ _dataProvider.addItem(_arg1); invalidateList(); } public function get rowCount():uint{ return (0); } override protected function configUI():void{ super.configUI(); listHolder = new Sprite(); addChild(listHolder); listHolder.scrollRect = contentScrollRect; list = new Sprite(); listHolder.addChild(list); } public function get selectable():Boolean{ return (_selectable); } public function clearRendererStyle(_arg1:String, _arg2:int=-1):void{ delete rendererStyles[_arg1]; updatedRendererStyles[_arg1] = null; invalidate(InvalidationType.RENDERER_STYLES); } protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{ var _local2:ICellRenderer = (_arg1.target as ICellRenderer); var _local3:String = ((_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)); } 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; }; } protected function handleCellRendererDoubleClick(_arg1:MouseEvent):void{ if (!_enabled){ return; }; var _local2:ICellRenderer = (_arg1.currentTarget as ICellRenderer); var _local3:uint = _local2.listData.index; dispatchEvent(new ListEvent(ListEvent.ITEM_DOUBLE_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)); } 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 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(); } public function invalidateList():void{ _invalidateList(); invalidate(InvalidationType.DATA); } public function replaceItemAt(_arg1:Object, _arg2:uint):Object{ return (_dataProvider.replaceItemAt(_arg1, _arg2)); } public function removeAll():void{ _dataProvider.removeAll(); } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; list.mouseChildren = _enabled; } public function scrollToIndex(_arg1:int):void{ } public function get selectedIndices():Array{ return (_selectedIndices.concat()); } override protected function drawLayout():void{ super.drawLayout(); contentScrollRect = listHolder.scrollRect; contentScrollRect.width = availableWidth; contentScrollRect.height = availableHeight; listHolder.scrollRect = contentScrollRect; } protected function _invalidateList():void{ availableCellRenderers = []; while (activeCellRenderers.length > 0) { list.removeChild((activeCellRenderers.pop() as DisplayObject)); }; } public function set selectedItem(_arg1:Object):void{ var _local2:int = _dataProvider.getItemIndex(_arg1); selectedIndex = _local2; } public function getItemAt(_arg1:uint):Object{ return (_dataProvider.getItemAt(_arg1)); } protected function handleCellRendererChange(_arg1:Event):void{ var _local2:ICellRenderer = (_arg1.currentTarget as ICellRenderer); var _local3:uint = _local2.listData.index; _dataProvider.invalidateItemAt(_local3); } protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ } public function itemToLabel(_arg1:Object):String{ return (_arg1["label"]); } public function addItemAt(_arg1:Object, _arg2:uint):void{ _dataProvider.addItemAt(_arg1, _arg2); invalidateList(); } override protected function initializeAccessibility():void{ if (SelectableList.createAccessibilityImplementation != null){ SelectableList.createAccessibilityImplementation(this); }; } protected function updateRendererStyles():void{ var _local4:String; var _local1:Array = availableCellRenderers.concat(activeCellRenderers); var _local2:uint = _local1.length; var _local3:uint; 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 selectable(_arg1:Boolean):void{ if (_arg1 == _selectable){ return; }; if (!_arg1){ selectedIndices = []; }; _selectable = _arg1; } 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 clearSelection():void{ selectedIndex = -1; } public function invalidateItemAt(_arg1:uint):void{ var _local2:Object = _dataProvider.getItemAt(_arg1); if (_local2 != null){ invalidateItem(_local2); }; } public function sortItems(... _args){ return (_dataProvider.sort.apply(_dataProvider, _args)); } public function set selectedItems(_arg1:Array):void{ var _local4:int; if (_arg1 == null){ selectedIndices = null; return; }; var _local2:Array = []; var _local3:uint; while (_local3 < _arg1.length) { _local4 = _dataProvider.getItemIndex(_arg1[_local3]); if (_local4 != -1){ _local2.push(_local4); }; _local3++; }; selectedIndices = _local2; } override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ if (_arg1 == _horizontalScrollPosition){ return; }; var _local3:Number = (_arg1 - _horizontalScrollPosition); _horizontalScrollPosition = _arg1; if (_arg2){ dispatchEvent(new ScrollEvent(ScrollBarDirection.HORIZONTAL, _local3, _arg1)); }; } override public function get maxHorizontalScrollPosition():Number{ return (_maxHorizontalScrollPosition); } public function scrollToSelected():void{ scrollToIndex(selectedIndex); } public function get selectedItems():Array{ var _local1:Array = []; var _local2:uint; while (_local2 < _selectedIndices.length) { _local1.push(_dataProvider.getItemAt(_selectedIndices[_local2])); _local2++; }; return (_local1); } public function get length():uint{ return (_dataProvider.length); } public function invalidateItem(_arg1:Object):void{ if (renderedItems[_arg1] == null){ return; }; invalidItems[_arg1] = true; invalidate(InvalidationType.DATA); } public function set selectedIndex(_arg1:int):void{ selectedIndices = ((_arg1)==-1) ? null : [_arg1]; } public function get selectedIndex():int{ return (((_selectedIndices.length)==0) ? -1 : _selectedIndices[(_selectedIndices.length - 1)]); } public function getRendererStyle(_arg1:String, _arg2:int=-1):Object{ return (rendererStyles[_arg1]); } protected function handleCellRendererClick(_arg1:MouseEvent):void{ var _local5:int; var _local6:uint; if (!_enabled){ return; }; var _local2:ICellRenderer = (_arg1.currentTarget as ICellRenderer); var _local3:uint = _local2.listData.index; if (((!(dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)))) || (!(_selectable)))){ return; }; var _local4:int = 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 static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition())); } } }//package fl.controls
Section 133
//TextArea (fl.controls.TextArea) package fl.controls { import fl.core.*; import flash.display.*; import flash.events.*; import fl.events.*; import fl.managers.*; import flash.text.*; import flash.system.*; import flash.ui.*; public class TextArea extends UIComponent implements IFocusManagerComponent { protected var _horizontalScrollBar:UIScrollBar; protected var _html:Boolean;// = false protected var background:DisplayObject; protected var _verticalScrollBar:UIScrollBar; protected var _savedHTML:String; protected var _horizontalScrollPolicy:String;// = "auto" protected var _editable:Boolean;// = true protected var textHasChanged:Boolean;// = false public var textField:TextField; protected var _wordWrap:Boolean;// = true protected var _verticalScrollPolicy:String;// = "auto" protected static const SCROLL_BAR_STYLES:Object = {downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"}; private static var defaultStyles:Object = {upSkin:"TextArea_upSkin", disabledSkin:"TextArea_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, embedFonts:false}; public static var createAccessibilityImplementation:Function; public function set alwaysShowSelection(_arg1:Boolean):void{ textField.alwaysShowSelection = _arg1; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; mouseChildren = enabled; invalidate(InvalidationType.STATE); } override protected function focusInHandler(_arg1:FocusEvent):void{ setIMEMode(true); if (_arg1.target == this){ stage.focus = textField; }; var _local2:IFocusManager = focusManager; if (_local2){ if (editable){ _local2.showFocusIndicator = true; }; _local2.defaultButtonEnabled = false; }; super.focusInHandler(_arg1); if (editable){ setIMEMode(true); }; } protected function handleChange(_arg1:Event):void{ _arg1.stopPropagation(); dispatchEvent(new Event(Event.CHANGE, true)); invalidate(InvalidationType.DATA); } public function set imeMode(_arg1:String):void{ _imeMode = _arg1; } public function get imeMode():String{ return (IME.conversionMode); } override public function drawFocus(_arg1:Boolean):void{ if (focusTarget != null){ focusTarget.drawFocus(_arg1); return; }; super.drawFocus(_arg1); } protected function handleWheel(_arg1:MouseEvent):void{ if (((!(enabled)) || (!(_verticalScrollBar.visible)))){ return; }; _verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * _verticalScrollBar.lineScrollSize)); dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, (_arg1.delta * _verticalScrollBar.lineScrollSize), _verticalScrollBar.scrollPosition)); } public function set condenseWhite(_arg1:Boolean):void{ textField.condenseWhite = _arg1; invalidate(InvalidationType.DATA); } public function get textWidth():Number{ drawNow(); return (textField.textWidth); } override protected function focusOutHandler(_arg1:FocusEvent):void{ var _local2:IFocusManager = focusManager; if (_local2){ _local2.defaultButtonEnabled = true; }; setSelection(0, 0); super.focusOutHandler(_arg1); if (editable){ setIMEMode(false); }; } protected function handleScroll(_arg1:ScrollEvent):void{ dispatchEvent(_arg1); } protected function drawLayout():void{ var _local1:Number = Number(getStyleValue("textPadding")); textField.x = (textField.y = _local1); background.width = width; background.height = height; var _local2:Number = height; var _local3:Boolean = needVScroll(); var _local4:Number = (width - (_local3) ? _verticalScrollBar.width : 0); var _local5:Boolean = needHScroll(); if (_local5){ _local2 = (_local2 - _horizontalScrollBar.height); }; setTextSize(_local4, _local2, _local1); if (((((_local5) && (!(_local3)))) && (needVScroll()))){ _local3 = true; _local4 = (_local4 - _verticalScrollBar.width); setTextSize(_local4, _local2, _local1); }; if (_local3){ _verticalScrollBar.visible = true; _verticalScrollBar.x = (width - _verticalScrollBar.width); _verticalScrollBar.height = _local2; _verticalScrollBar.visible = true; _verticalScrollBar.enabled = enabled; } else { _verticalScrollBar.visible = false; }; if (_local5){ _horizontalScrollBar.visible = true; _horizontalScrollBar.y = (height - _horizontalScrollBar.height); _horizontalScrollBar.width = _local4; _horizontalScrollBar.visible = true; _horizontalScrollBar.enabled = enabled; } else { _horizontalScrollBar.visible = false; }; updateScrollBars(); addEventListener(Event.ENTER_FRAME, delayedLayoutUpdate, false, 0, true); } public function set displayAsPassword(_arg1:Boolean):void{ textField.displayAsPassword = _arg1; } protected function drawBackground():void{ var _local1:DisplayObject = background; var _local2:String = (enabled) ? "upSkin" : "disabledSkin"; background = getDisplayObjectInstance(getStyleValue(_local2)); if (background != null){ addChildAt(background, 0); }; if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){ removeChild(_local1); }; } public function get horizontalScrollPolicy():String{ return (_horizontalScrollPolicy); } protected function delayedLayoutUpdate(_arg1:Event):void{ if (textHasChanged){ textHasChanged = false; drawLayout(); return; }; removeEventListener(Event.ENTER_FRAME, delayedLayoutUpdate); } public function get verticalScrollPosition():Number{ return (textField.scrollV); } public function get text():String{ return (textField.text); } public function get verticalScrollBar():UIScrollBar{ return (_verticalScrollBar); } public function set maxChars(_arg1:int):void{ textField.maxChars = _arg1; } public function get textHeight():Number{ drawNow(); return (textField.textHeight); } override protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((((_arg1 == textField)) || (super.isOurFocus(_arg1)))); } public function get maxVerticalScrollPosition():int{ return (textField.maxScrollV); } public function set horizontalScrollPosition(_arg1:Number):void{ drawNow(); textField.scrollH = _arg1; } public function get restrict():String{ return (textField.restrict); } protected function setEmbedFont(){ var _local1:Object = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } public function get alwaysShowSelection():Boolean{ return (textField.alwaysShowSelection); } override public function get enabled():Boolean{ return (super.enabled); } override protected function draw():void{ if (isInvalid(InvalidationType.STATE)){ updateTextFieldType(); }; if (isInvalid(InvalidationType.STYLES)){ setStyles(); setEmbedFont(); }; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawTextFormat(); drawBackground(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA)){ drawLayout(); }; super.draw(); } public function set horizontalScrollPolicy(_arg1:String):void{ _horizontalScrollPolicy = _arg1; invalidate(InvalidationType.SIZE); } public function set editable(_arg1:Boolean):void{ _editable = _arg1; invalidate(InvalidationType.STATE); } public function setSelection(_arg1:int, _arg2:int):void{ textField.setSelection(_arg1, _arg2); } public function get condenseWhite():Boolean{ return (textField.condenseWhite); } public function get displayAsPassword():Boolean{ return (textField.displayAsPassword); } protected function setTextSize(_arg1:Number, _arg2:Number, _arg3:Number):void{ var _local4:Number = (_arg1 - (_arg3 * 2)); var _local5:Number = (_arg2 - (_arg3 * 2)); if (_local4 != textField.width){ textField.width = _local4; }; if (_local5 != textField.height){ textField.height = _local5; }; } public function get horizontalScrollBar():UIScrollBar{ return (_horizontalScrollBar); } public function get selectionBeginIndex():int{ return (textField.selectionBeginIndex); } override protected function configUI():void{ super.configUI(); tabChildren = true; textField = new TextField(); addChild(textField); updateTextFieldType(); _verticalScrollBar = new UIScrollBar(); _verticalScrollBar.name = "V"; _verticalScrollBar.visible = false; _verticalScrollBar.focusEnabled = false; copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES); _verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true); addChild(_verticalScrollBar); _horizontalScrollBar = new UIScrollBar(); _horizontalScrollBar.name = "H"; _horizontalScrollBar.visible = false; _horizontalScrollBar.focusEnabled = false; _horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL; copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES); _horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true); addChild(_horizontalScrollBar); 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); _horizontalScrollBar.scrollTarget = textField; _verticalScrollBar.scrollTarget = textField; addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true); } public function set verticalScrollPosition(_arg1:Number):void{ drawNow(); textField.scrollV = _arg1; } public function get maxChars():int{ return (textField.maxChars); } public function set text(_arg1:String):void{ if (((componentInspectorSetting) && ((_arg1 == "")))){ return; }; textField.text = _arg1; _html = false; invalidate(InvalidationType.DATA); invalidate(InvalidationType.STYLES); textHasChanged = true; } protected function updateScrollBars(){ _horizontalScrollBar.update(); _verticalScrollBar.update(); _verticalScrollBar.enabled = enabled; _horizontalScrollBar.enabled = enabled; _horizontalScrollBar.drawNow(); _verticalScrollBar.drawNow(); } public function get maxHorizontalScrollPosition():int{ return (textField.maxScrollH); } protected function needHScroll():Boolean{ if (_horizontalScrollPolicy == ScrollPolicy.OFF){ return (false); }; if (_horizontalScrollPolicy == ScrollPolicy.ON){ return (true); }; return ((textField.maxScrollH > 0)); } protected function handleKeyDown(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ENTER){ dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true)); }; } public function get horizontalScrollPosition():Number{ return (textField.scrollH); } public function get selectionEndIndex():int{ return (textField.selectionEndIndex); } public function get editable():Boolean{ return (_editable); } protected function updateTextFieldType():void{ textField.type = (((enabled) && (_editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC; textField.selectable = enabled; textField.wordWrap = _wordWrap; textField.multiline = true; } public function appendText(_arg1:String):void{ textField.appendText(_arg1); invalidate(InvalidationType.DATA); } public function set wordWrap(_arg1:Boolean):void{ _wordWrap = _arg1; invalidate(InvalidationType.STATE); } public function set verticalScrollPolicy(_arg1:String):void{ _verticalScrollPolicy = _arg1; invalidate(InvalidationType.SIZE); } protected function setStyles():void{ copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES); copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES); } public function get length():Number{ return (textField.text.length); } protected function drawTextFormat():void{ var _local1:Object = UIComponent.getStyleDefinition(); var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); if (_html){ textField.htmlText = _savedHTML; }; } public function set htmlText(_arg1:String):void{ if (((componentInspectorSetting) && ((_arg1 == "")))){ return; }; if (_arg1 == ""){ text = ""; return; }; _html = true; _savedHTML = _arg1; textField.htmlText = _arg1; invalidate(InvalidationType.DATA); invalidate(InvalidationType.STYLES); textHasChanged = true; } public function get verticalScrollPolicy():String{ return (_verticalScrollPolicy); } protected function handleTextInput(_arg1:TextEvent):void{ _arg1.stopPropagation(); dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text)); } public function get htmlText():String{ return (textField.htmlText); } public function getLineMetrics(_arg1:int):TextLineMetrics{ return (textField.getLineMetrics(_arg1)); } public function get wordWrap():Boolean{ return (_wordWrap); } protected function needVScroll():Boolean{ if (_verticalScrollPolicy == ScrollPolicy.OFF){ return (false); }; if (_verticalScrollPolicy == ScrollPolicy.ON){ return (true); }; return ((textField.maxScrollV > 1)); } public function set restrict(_arg1:String):void{ if (((componentInspectorSetting) && ((_arg1 == "")))){ _arg1 = null; }; textField.restrict = _arg1; } public static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition())); } } }//package fl.controls
Section 134
//TextInput (fl.controls.TextInput) package fl.controls { import fl.core.*; import flash.display.*; import flash.events.*; import fl.events.*; import fl.managers.*; import flash.text.*; import flash.ui.*; public class TextInput extends UIComponent implements IFocusManagerComponent { protected var _html:Boolean;// = false protected var background:DisplayObject; protected var _savedHTML:String; 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 set alwaysShowSelection(_arg1:Boolean):void{ textField.alwaysShowSelection = _arg1; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; updateTextFieldType(); } public function get imeMode():String{ return (_imeMode); } protected function handleChange(_arg1:Event):void{ _arg1.stopPropagation(); dispatchEvent(new Event(Event.CHANGE, true)); } public function set imeMode(_arg1:String):void{ _imeMode = _arg1; } protected function setEmbedFont(){ var _local1:Object = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } protected function drawLayout():void{ var _local1:Number = 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 condenseWhite(_arg1:Boolean):void{ textField.condenseWhite = _arg1; } public function get textWidth():Number{ return (textField.textWidth); } override protected function focusOutHandler(_arg1:FocusEvent):void{ super.focusOutHandler(_arg1); if (editable){ setIMEMode(false); }; } override public function setFocus():void{ stage.focus = textField; } public function set displayAsPassword(_arg1:Boolean):void{ textField.displayAsPassword = _arg1; } protected function drawBackground():void{ var _local1:DisplayObject = background; var _local2:String = (enabled) ? "upSkin" : "disabledSkin"; background = getDisplayObjectInstance(getStyleValue(_local2)); if (background == null){ return; }; addChildAt(background, 0); if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){ removeChild(_local1); }; } public function get text():String{ return (textField.text); } public function set maxChars(_arg1:int):void{ textField.maxChars = _arg1; } public function set horizontalScrollPosition(_arg1:int):void{ textField.scrollH = _arg1; } override protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((((_arg1 == textField)) || (super.isOurFocus(_arg1)))); } public function get textHeight():Number{ return (textField.textHeight); } public function get restrict():String{ return (textField.restrict); } public function get alwaysShowSelection():Boolean{ return (textField.alwaysShowSelection); } override public function get enabled():Boolean{ return (super.enabled); } 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(); } public function set editable(_arg1:Boolean):void{ _editable = _arg1; updateTextFieldType(); } public function setSelection(_arg1:int, _arg2:int):void{ textField.setSelection(_arg1, _arg2); } public function get condenseWhite():Boolean{ return (textField.condenseWhite); } public function get displayAsPassword():Boolean{ return (textField.displayAsPassword); } public function get selectionBeginIndex():int{ return (textField.selectionBeginIndex); } 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 get maxChars():int{ return (textField.maxChars); } 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; } protected function handleKeyDown(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ENTER){ dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true)); }; } public function get horizontalScrollPosition():int{ return (textField.scrollH); } public function get selectionEndIndex():int{ return (textField.selectionEndIndex); } public function get editable():Boolean{ return (_editable); } public function get maxHorizontalScrollPosition():int{ return (textField.maxScrollH); } public function appendText(_arg1:String):void{ textField.appendText(_arg1); } protected function drawTextFormat():void{ var _local1:Object = UIComponent.getStyleDefinition(); var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); if (_html){ textField.htmlText = _savedHTML; }; } public function get length():int{ return (textField.length); } public function set htmlText(_arg1:String):void{ if (_arg1 == ""){ text = ""; return; }; _html = true; _savedHTML = _arg1; textField.htmlText = _arg1; invalidate(InvalidationType.DATA); invalidate(InvalidationType.STYLES); } protected function handleTextInput(_arg1:TextEvent):void{ _arg1.stopPropagation(); dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text)); } public function set restrict(_arg1:String):void{ if (((componentInspectorSetting) && ((_arg1 == "")))){ _arg1 = null; }; textField.restrict = _arg1; } public function getLineMetrics(_arg1:int):TextLineMetrics{ return (textField.getLineMetrics(_arg1)); } override public function drawFocus(_arg1:Boolean):void{ if (focusTarget != null){ focusTarget.drawFocus(_arg1); return; }; super.drawFocus(_arg1); } override protected function focusInHandler(_arg1:FocusEvent):void{ if (_arg1.target == this){ stage.focus = textField; }; var _local2:IFocusManager = 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 htmlText():String{ return (textField.htmlText); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 135
//UIScrollBar (fl.controls.UIScrollBar) package fl.controls { import fl.core.*; import flash.events.*; import fl.events.*; import flash.text.*; public class UIScrollBar extends ScrollBar { protected var inEdit:Boolean;// = false protected var inScroll:Boolean;// = false protected var _scrollTarget:TextField; private static var defaultStyles:Object = {}; protected function updateScrollTargetProperties():void{ var _local1:Boolean; var _local2:Number; if (_scrollTarget == null){ setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, pageScrollSize); scrollPosition = 0; } else { _local1 = (direction == ScrollBarDirection.HORIZONTAL); _local2 = (_local1) ? _scrollTarget.width : 10; setScrollProperties(_local2, (_local1) ? 0 : 1, (_local1) ? _scrollTarget.maxScrollH : _scrollTarget.maxScrollV, pageScrollSize); scrollPosition = (_local1) ? _scrollTarget.scrollH : _scrollTarget.scrollV; }; } override public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{ var _local5:Number = _arg3; var _local6:Number = ((_arg2)<0) ? 0 : _arg2; if (_scrollTarget != null){ if (direction == ScrollBarDirection.HORIZONTAL){ _local5 = ((_arg3)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local5; } else { _local5 = ((_arg3)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local5; }; }; super.setScrollProperties(_arg1, _local6, _local5, _arg4); } protected function handleTargetScroll(_arg1:Event):void{ if (inDrag){ return; }; if (!enabled){ return; }; inEdit = true; updateScrollTargetProperties(); scrollPosition = ((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV; inEdit = false; } override public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{ super.setScrollPosition(_arg1, _arg2); if (!_scrollTarget){ inScroll = false; return; }; updateTargetScroll(); } public function get scrollTargetName():String{ return (_scrollTarget.name); } override protected function draw():void{ if (isInvalid(InvalidationType.DATA)){ updateScrollTargetProperties(); }; super.draw(); } override public function set direction(_arg1:String):void{ if (isLivePreview){ return; }; super.direction = _arg1; updateScrollTargetProperties(); } protected function updateTargetScroll(_arg1:ScrollEvent=null):void{ if (inEdit){ return; }; if (direction == ScrollBarDirection.HORIZONTAL){ _scrollTarget.scrollH = scrollPosition; } else { _scrollTarget.scrollV = scrollPosition; }; } override public function set minScrollPosition(_arg1:Number):void{ super.minScrollPosition = ((_arg1)<0) ? 0 : _arg1; } override public function set maxScrollPosition(_arg1:Number):void{ var _local2:Number = _arg1; if (_scrollTarget != null){ if (direction == ScrollBarDirection.HORIZONTAL){ _local2 = ((_local2)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local2; } else { _local2 = ((_local2)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local2; }; }; super.maxScrollPosition = _local2; } protected function handleTargetChange(_arg1:Event):void{ inEdit = true; setScrollPosition(((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV, true); updateScrollTargetProperties(); inEdit = false; } public function update():void{ inEdit = true; updateScrollTargetProperties(); inEdit = false; } public function set scrollTargetName(_arg1:String):void{ var target = _arg1; try { scrollTarget = (parent.getChildByName(target) as TextField); } catch(error:Error) { throw (new Error("ScrollTarget not found, or is not a TextField")); }; } public function set scrollTarget(_arg1:TextField):void{ if (_scrollTarget != null){ _scrollTarget.removeEventListener(Event.CHANGE, handleTargetChange, false); _scrollTarget.removeEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false); _scrollTarget.removeEventListener(Event.SCROLL, handleTargetScroll, false); removeEventListener(ScrollEvent.SCROLL, updateTargetScroll, false); }; _scrollTarget = _arg1; if (_scrollTarget != null){ _scrollTarget.addEventListener(Event.CHANGE, handleTargetChange, false, 0, true); _scrollTarget.addEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false, 0, true); _scrollTarget.addEventListener(Event.SCROLL, handleTargetScroll, false, 0, true); addEventListener(ScrollEvent.SCROLL, updateTargetScroll, false, 0, true); }; invalidate(InvalidationType.DATA); } public function get scrollTarget():TextField{ return (_scrollTarget); } override public function get direction():String{ return (super.direction); } public static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition())); } } }//package fl.controls
Section 136
//ComponentShim (fl.core.ComponentShim) package fl.core { import flash.display.*; public dynamic class ComponentShim extends MovieClip { } }//package fl.core
Section 137
//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 138
//UIComponent (fl.core.UIComponent) package fl.core { import flash.display.*; import flash.events.*; import flash.utils.*; import fl.events.*; import fl.managers.*; import flash.text.*; import flash.system.*; public class UIComponent extends Sprite { protected var _x:Number; protected var _enabled:Boolean;// = true protected var callLaterMethods:Dictionary; private var _mouseFocusEnabled:Boolean;// = true private var tempText:TextField; private var _focusEnabled:Boolean;// = true protected var startHeight:Number; protected var _height:Number; protected var invalidateFlag:Boolean;// = false protected var _oldIMEMode:String;// = null protected var _inspector:Boolean;// = false protected var startWidth:Number; public var focusTarget:IFocusManagerComponent; protected var errorCaught:Boolean;// = false protected var invalidHash:Object; protected var sharedStyles:Object; protected var uiFocusRect:DisplayObject; protected var isLivePreview:Boolean;// = false protected var _imeMode:String;// = null protected var _width:Number; protected var instanceStyles:Object; public var version:String;// = "3.0.0.16" protected var isFocused:Boolean;// = false 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(){ 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 getStyle(_arg1:String):Object{ return (instanceStyles[_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")); } private function callLaterDispatcher(_arg1:Event):void{ var _local3:Object; if (_arg1.type == Event.ADDED_TO_STAGE){ removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher); stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); return; }; _arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher); if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); return; }; inCallLaterPhase = true; var _local2:Dictionary = callLaterMethods; for (_local3 in _local2) { _local3(); delete _local2[_local3]; }; inCallLaterPhase = false; } protected function validate():void{ invalidHash = {}; } 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); } override public function get height():Number{ return (_height); } private function addedHandler(_arg1:Event):void{ removeEventListener("addedToStage", addedHandler); initializeFocusManager(); } protected function getStyleValue(_arg1:String):Object{ return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]); } public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{ invalidHash[_arg1] = true; if (_arg2){ this.callLater(draw); }; } protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((_arg1 == this)); } 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{ } override public function get scaleY():Number{ return ((height / startHeight)); } 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; }; }; } protected function draw():void{ if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } override public function set height(_arg1:Number):void{ if (_height == _arg1){ return; }; setSize(width, _arg1); } protected function configUI():void{ isLivePreview = checkLivePreview(); var _local1:Number = rotation; rotation = 0; var _local2:Number = super.width; var _local3:Number = 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 setScaleY(_arg1:Number):void{ super.scaleY = _arg1; } override public function get scaleX():Number{ return ((width / startWidth)); } protected function setScaleX(_arg1:Number):void{ super.scaleX = _arg1; } private function initializeFocusManager():void{ if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true); } else { createFocusManager(); }; } protected function keyDownHandler(_arg1:KeyboardEvent):void{ } 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 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); } 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 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); } public function set enabled(_arg1:Boolean):void{ if (_arg1 == _enabled){ return; }; _enabled = _arg1; invalidate(InvalidationType.STATE); } public function setSize(_arg1:Number, _arg2:Number):void{ _width = _arg1; _height = _arg2; invalidate(InvalidationType.SIZE); dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false)); } protected function keyUpHandler(_arg1:KeyboardEvent):void{ } 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); }; } public function set focusEnabled(_arg1:Boolean):void{ _focusEnabled = _arg1; } override public function set width(_arg1:Number):void{ if (_width == _arg1){ return; }; setSize(_arg1, height); } public function setFocus():void{ if (stage){ stage.focus = this; }; } 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 skin = _arg1; var classDef:Object; 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 initializeAccessibility():void{ if (UIComponent.createAccessibilityImplementation != null){ UIComponent.createAccessibilityImplementation(this); }; } public function get focusManager():IFocusManager{ var _local1:DisplayObject = 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); } 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); }; } 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(); } override public function set visible(_arg1:Boolean):void{ if (super.visible == _arg1){ return; }; super.visible = _arg1; var _local2:String = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE; dispatchEvent(new ComponentEvent(_local2, true)); } protected function createFocusManager():void{ if (focusManagers[stage] == null){ focusManagers[stage] = new FocusManager(stage); }; } 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 y(_arg1:Number):void{ move(_x, _arg1); } 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); }; } override public function set x(_arg1:Number):void{ move(_arg1, _y); } public function drawNow():void{ draw(); } public static function getStyleDefinition():Object{ return (defaultStyles); } public static function mergeStyles(... _args):Object{ var _local5:Object; var _local6:String; var _local2:Object = {}; var _local3:uint = _args.length; var _local4:uint; 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 139
//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); }; } public function invalidateItemAt(_arg1:int):void{ checkIndex(_arg1, (data.length - 1)); dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _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 getItemIndex(_arg1:Object):int{ return (data.indexOf(_arg1)); } public function removeItemAt(_arg1:uint):Object{ checkIndex(_arg1, (data.length - 1)); dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1); var _local2:Array = data.splice(_arg1, 1); dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1); return (_local2[0]); } protected function getDataFromObject(_arg1:Object):Array{ var _local2:Array; var _local3:Array; var _local4:uint; var _local5:Object; var _local6:XML; var _local7:XMLList; var _local8:XML; var _local9:XMLList; var _local10:XML; var _local11:XMLList; var _local12:XML; if ((_arg1 is Array)){ _local3 = (_arg1 as Array); if (_local3.length > 0){ if ((((_local3[0] is String)) || ((_local3[0] is Number)))){ _local2 = []; _local4 = 0; while (_local4 < _local3.length) { _local5 = {label:String(_local3[_local4]), data:_local3[_local4]}; _local2.push(_local5); _local4++; }; return (_local2); }; }; return (_arg1.concat()); } else { if ((_arg1 is DataProvider)){ return (_arg1.toArray()); }; if ((_arg1 is XML)){ _local6 = (_arg1 as XML); _local2 = []; _local7 = _local6.*; for each (_local8 in _local7) { _arg1 = {}; _local9 = _local8.attributes(); for each (_local10 in _local9) { _arg1[_local10.localName()] = _local10.toString(); }; _local11 = _local8.*; for each (_local12 in _local11) { if (_local12.hasSimpleContent()){ _arg1[_local12.localName()] = _local12.toString(); }; }; _local2.push(_arg1); }; return (_local2); //unresolved jump }; }; throw (new ((!NULL! + !NULL!) + " to Array or DataProvider.").TypeError(!NULL!)); } public function 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 concat(_arg1:Object):void{ addItems(_arg1); } public function getItemAt(_arg1:uint):Object{ checkIndex(_arg1, (data.length - 1)); return (data[_arg1]); } public function sortOn(_arg1:Object, _arg2:Object=null){ dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); var _local3:Array = data.sortOn(_arg1, _arg2); dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); return (_local3); } public function toArray():Array{ return (data.concat()); } public function addItems(_arg1:Object):void{ addItemsAt(_arg1, data.length); } public function clone():DataProvider{ return (new DataProvider(data)); } public function sort(... _args){ dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); var _local2:Array = data.sort.apply(data, _args); dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); return (_local2); } 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); } override public function toString():String{ return ((("DataProvider [" + data.join(" , ")) + "]")); } public function invalidateItem(_arg1:Object):void{ var _local2:uint = 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{ checkIndex(_arg2, data.length); var _local3:Array = 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 = getItemIndex(_arg2); if (_local3 != -1){ return (replaceItemAt(_arg1, _local3)); }; return (null); } public function removeItem(_arg1:Object):Object{ var _local2:int = getItemIndex(_arg1); if (_local2 != -1){ return (removeItemAt(_local2)); }; return (null); } public function merge(_arg1:Object):void{ var _local6:Object; var _local2:Array = getDataFromObject(_arg1); var _local3:uint = _local2.length; var _local4:uint = data.length; dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1)); var _local5:uint; 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{ checkIndex(_arg2, (data.length - 1)); var _local3:Array = [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 = data.concat(); dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length); data = []; dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length); } } }//package fl.data
Section 140
//SimpleCollectionItem (fl.data.SimpleCollectionItem) package fl.data { public dynamic class SimpleCollectionItem { public var data:String; public var label:String; public function toString():String{ return ((((("[SimpleCollectionItem: " + label) + ",") + data) + "]")); } } }//package fl.data
Section 141
//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 142
//DataChangeEvent (fl.events.DataChangeEvent) package fl.events { import flash.events.*; public class DataChangeEvent extends Event { protected var _items:Array; protected var _changeType:String; protected var _startIndex:uint; protected var _endIndex: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 items():Array{ return (_items); } public function get changeType():String{ return (_changeType); } public function get startIndex():uint{ return (_startIndex); } public function get endIndex():uint{ return (_endIndex); } override public function toString():String{ return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable")); } override public function clone():Event{ return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex)); } } }//package fl.events
Section 143
//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 144
//ListEvent (fl.events.ListEvent) package fl.events { import flash.events.*; public class ListEvent extends Event { protected var _item:Object; protected var _index:int; protected var _rowIndex:int; protected var _columnIndex: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 item():Object{ return (_item); } override public function toString():String{ return (formatToString("ListEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "index", "item")); } override public function clone():Event{ return (new ListEvent(type, bubbles, cancelable, _columnIndex, _rowIndex)); } public function get rowIndex():Object{ return (_rowIndex); } public function get index():int{ return (_index); } public function get columnIndex():int{ return (_columnIndex); } } }//package fl.events
Section 145
//ScrollEvent (fl.events.ScrollEvent) package fl.events { import flash.events.*; public class ScrollEvent extends Event { private var _direction:String; private var _position:Number; 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; } public function get position():Number{ return (_position); } public function get direction():String{ return (_direction); } public function get delta():Number{ return (_delta); } override public function toString():String{ return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position")); } override public function clone():Event{ return (new ScrollEvent(_direction, _delta, _position)); } } }//package fl.events
Section 146
//FocusManager (fl.managers.FocusManager) package fl.managers { import fl.core.*; import fl.controls.*; import flash.display.*; import flash.events.*; import flash.utils.*; import flash.text.*; 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){ 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 _local7:DisplayObject; var _local8:IFocusManagerGroup; var _local9:int; var _local10:DisplayObject; var _local11:IFocusManagerGroup; var _local5:int = focusableCandidates.length; var _local6:int = _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); } private function mouseFocusChangeHandler(_arg1:FocusEvent):void{ if ((_arg1.relatedObject is TextField)){ return; }; _arg1.preventDefault(); } 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)); } public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{ var _local2:InteractiveObject = _arg1; while (_arg1) { if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){ return (_arg1); }; _arg1 = _arg1.parent; }; return (_local2); } private function focusOutHandler(_arg1:FocusEvent):void{ var _local2:InteractiveObject = (_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); } private function setFocusToNextObject(_arg1:FocusEvent):void{ if (!hasFocusableObjects()){ return; }; var _local2:InteractiveObject = getNextFocusManagerComponent(_arg1.shiftKey); if (_local2){ setFocus(_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 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); } public function sendDefaultButtonEvent():void{ defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); } private function addedHandler(_arg1:Event):void{ var _local2:DisplayObject = DisplayObject(_arg1.target); if (_local2.stage){ addFocusables(DisplayObject(_arg1.target)); }; } private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{ var _local3:TextField; var _local4:SimpleButton; var _local2:DisplayObjectContainer = 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); } private function tabChildrenChangeHandler(_arg1:Event):void{ if (_arg1.target != _arg1.currentTarget){ return; }; calculateCandidates = true; var _local2:DisplayObjectContainer = DisplayObjectContainer(_arg1.target); if (_local2.tabChildren){ addFocusables(_local2, true); } else { removeFocusables(_local2); }; } private function deactivateHandler(_arg1:Event):void{ var _local2:InteractiveObject = InteractiveObject(_arg1.target); } public function setFocus(_arg1:InteractiveObject):void{ if ((_arg1 is IFocusManagerComponent)){ IFocusManagerComponent(_arg1).setFocus(); } else { form.stage.focus = _arg1; }; } public function getFocus():InteractiveObject{ var _local1:InteractiveObject = form.stage.focus; return (findFocusManagerComponent(_local1)); } private function hasFocusableObjects():Boolean{ var _local1:Object; for (_local1 in focusableObjects) { return (true); }; return (false); } private function tabIndexChangeHandler(_arg1:Event):void{ calculateCandidates = true; } public function set defaultButton(_arg1:Button):void{ var _local2:Button = (_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 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 = focusableCandidates.length; var _local3:int; _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 _local4:InteractiveObject; var _local3:DisplayObject = 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 _local5:int; var _local6:String; var _local7:String; var _local3 = ""; var _local4 = ""; var _local8 = "0000"; var _local9:DisplayObject = DisplayObject(_arg1); var _local10:DisplayObject = 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 = 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 _local8:IFocusManagerGroup; if (!hasFocusableObjects()){ return (null); }; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; var _local2:DisplayObject = form.stage.focus; _local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2))); var _local3 = ""; if ((_local2 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local2); _local3 = _local8.groupName; }; var _local4:int = getIndexOfFocusedObject(_local2); var _local5:Boolean; var _local6:int = _local4; if (_local4 == -1){ if (_arg1){ _local4 = focusableCandidates.length; }; _local5 = true; }; var _local7:int = getIndexOfNextObject(_local4, _arg1, _local5, _local3); return (findFocusManagerComponent(focusableCandidates[_local7])); } private function mouseDownHandler(_arg1:MouseEvent):void{ if (_arg1.isDefaultPrevented()){ return; }; var _local2:InteractiveObject = 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 = _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 _local3:Button; var _local2:InteractiveObject = 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{ calculateCandidates = true; var _local2:InteractiveObject = InteractiveObject(_arg1.target); var _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 get defaultButtonEnabled():Boolean{ return (_defaultButtonEnabled); } 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; } } }//package fl.managers
Section 147
//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 findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject; function get nextTabIndex():int; function get defaultButton():Button; function get showFocusIndicator():Boolean; function hideFocus():void; function activate():void; function showFocus():void; function set defaultButtonEnabled(_arg1:Boolean):void; function setFocus(_arg1:InteractiveObject):void; function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject; } }//package fl.managers
Section 148
//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 149
//IFocusManagerGroup (fl.managers.IFocusManagerGroup) package fl.managers { public interface IFocusManagerGroup { function get groupName():String; function get selected():Boolean; function set groupName(_arg1:String):void; function set selected(_arg1:Boolean):void; } }//package fl.managers
Section 150
//StyleManager (fl.managers.StyleManager) package fl.managers { import fl.core.*; import flash.utils.*; import flash.text.*; public class StyleManager { private var classToInstancesDict:Dictionary; private var globalStyles:Object; private var styleToClassesHash:Object; private var classToStylesDict:Dictionary; private var classToDefaultStylesDict: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 = getClassDef(_arg1); var _local4:Object = 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 = getClassDef(_arg1); var _local5:Object = 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 _local5:String; var _local2:StyleManager = getInstance(); var _local3:Class = getClassDef(_arg1); var _local4:Object = _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 = getClassDef(_arg1); var _local4:Object = 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 _local4:Object; var _local5:UIComponent; var _local3:Dictionary = 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 _local3:Object; var _local2:Dictionary = getInstance().styleToClassesHash[_arg1]; if (_local2 == null){ return; }; for (_local3 in _local2) { invalidateComponentStyle(Class(_local3), _arg1); }; } public static function registerInstance(_arg1:UIComponent):void{ var target:Class; var defaultStyles:Object; var styleToClasses:Object; var n:String; var instance = _arg1; var inst:StyleManager = getInstance(); var classDef:Class = 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; if (inst.classToStylesDict[classDef] == null){ 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 = getClassDef(_arg1); var _local4:StyleManager = getInstance(); var _local5:Object = _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 = getInstance().globalStyles; if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; _local3[_arg1] = _arg2; invalidateStyle(_arg1); } } }//package fl.managers
Section 151
//Block (game.Block) package game { import flash.display.*; public class Block extends Shape { public var type:int; public function Block(_arg1:int):void{ type = _arg1; } } }//package game
Section 152
//BounceUpPowerUp (game.BounceUpPowerUp) package game { import flash.display.*; import com.leveleditor.*; public class BounceUpPowerUp extends PowerUpBase { public var powerUpHitArea:Pow2Editor; public function BounceUpPowerUp():void{ } override protected function applyEffect():void{ owner.bounceBonus(); } override protected function initPalette():void{ var _local1:Sprite = new TransparentGreenFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 2)); _local3++; }; _local2.dispose(); } override protected function hideHitArea():void{ } } }//package game
Section 153
//Burnable (game.Burnable) package game { import screen.*; import flash.geom.*; import Box2D.Dynamics.*; import flash.display.*; import flash.events.*; import flash.utils.*; import flash.media.*; import flash.filters.*; public class Burnable extends Sprite implements IFireEmitter { protected const PT_ZERO:Point; protected const MATRIX_3x5; protected const FLAME_HEIGHT:int = 35; protected const SCREEN_RECT:Rectangle; protected const FLAME_WIDTH:int = 20; protected var dissolveRandom:int; protected var disintegrateCounter:int; protected var SOURCE:Rectangle; public var neighbour:Array; protected var DEST:Point; protected var targetBitmap:BitmapData; public var dummy:MovieClip; protected var DISSOLVE_SOURCE:Rectangle; protected var noiseSeed:uint;// = 0 protected var mtx:Matrix; protected var burning:Boolean; protected var cFilter:ConvolutionFilter; public var burnTime:int; protected var fire:Bitmap; protected var display:Bitmap; protected var destroyed:Boolean;// = false protected var frontBuffer:BitmapData; protected var dissolveCounter:int; protected var screenBuffer:BitmapData; protected var alive:Boolean; public var blockBody:b2Body; protected var owner:GameLevelScreen; protected var origBitmap:BitmapData; protected var noiseMin:int; protected var spark:BitmapData; public var spreadTime:int; protected var dissolving:Boolean; protected var stopTime:int; protected var spread:Boolean;// = false protected var currentTime:int; protected var palette:Array; public var bound:Rectangle; protected static var burnCount:int; protected static var targetVol:Number; public static var depth:int; protected static var crackleTfm:SoundTransform; protected static var isPlaying:Boolean; protected static var crackle:Sound; protected static var crackleChannel:SoundChannel; public function Burnable():void{ MATRIX_3x5 = new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0); SCREEN_RECT = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); PT_ZERO = new Point(0, 0); cFilter = new ConvolutionFilter(3, 5, MATRIX_3x5, 4.35, -2, true, false, 0xFF, 1); frontBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, false, 0xFF); screenBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, true, 0); palette = new Array(); DISSOLVE_SOURCE = new Rectangle(0, 0, 20, 20); super(); neighbour = new Array(); burning = false; alive = true; disintegrateCounter = -1; currentTime = 0; } public function drawSpark(_arg1:int=0):void{ var _local2:int; var _local3:int; var _local4:int; if (!burning){ return; }; if (alive){ noiseSeed++; spark.noise(noiseSeed, noiseMin, 0xFF, BitmapDataChannel.BLUE, true); frontBuffer.draw(spark, mtx, null, BlendMode.MULTIPLY); }; frontBuffer.applyFilter(frontBuffer, SOURCE, DEST, cFilter); screenBuffer.paletteMap(frontBuffer, SOURCE, PT_ZERO, null, null, palette); screenBuffer.threshold(screenBuffer, SOURCE, DEST, "==", 4278190080, 0, 4278190080, true); if (dissolveCounter > 0){ dissolveCounter--; dissolveRandom = origBitmap.pixelDissolve(targetBitmap, DISSOLVE_SOURCE, DEST, dissolveRandom, 30); } else { if (disintegrateCounter > 0){ disintegrateCounter--; dissolveRandom = origBitmap.pixelDissolve(origBitmap, DISSOLVE_SOURCE, DEST, dissolveRandom, 30, 0); } else { if (disintegrateCounter == 0){ removeChild(display); }; }; }; updateSound(); currentTime++; if ((((currentTime >= spreadTime)) && (!(spread)))){ spread = true; _local3 = neighbour.length; _local4 = (currentTime - spreadTime); _local2 = 0; while (_local2 < _local3) { neighbour[_local2].burn(_local4); _local2++; }; }; if ((((currentTime >= burnTime)) && (!(destroyed)))){ destroyed = true; blockBody.m_world.DestroyBody(blockBody); alive = false; dissolveRandom = (Math.random() * int.MAX_VALUE); disintegrateCounter = 50; }; if (currentTime > stopTime){ dispose(); }; } public function addNeighbour(_arg1:DisplayObjectContainer):void{ neighbour.push(_arg1); } public function init(_arg1:Class, _arg2:Class):void{ var _local3:DisplayObjectContainer = DisplayObjectContainer(owner); origBitmap = new _arg1(20, 20); targetBitmap = new _arg2(20, 20); display = new Bitmap(origBitmap); display.x = dummy.x; display.y = dummy.y; addChild(display); removeChild(dummy); dummy = null; _local3.addChild(fire); bound = this.getBounds(this.parent); bound.inflate(2, 2); stopTime = int.MAX_VALUE; } public function dispose(_arg1:Event=null):void{ var e = _arg1; try { owner.removeFire(this); } catch(e:Error) { }; this.visible = false; burnCount--; if (burnCount < 0){ burnCount = 0; }; if (burnCount < 13){ targetVol = (burnCount / 12); }; if (crackleChannel){ updateSound(); }; try { fire.parent.removeChild(fire); } catch(e:Error) { }; try { removeChild(display); } catch(e:Error) { }; display = null; frontBuffer.dispose(); screenBuffer.dispose(); spark.dispose(); origBitmap.dispose(); targetBitmap.dispose(); frontBuffer = null; screenBuffer = null; spark = null; origBitmap = null; targetBitmap = null; cFilter = null; palette.length = 0; try { parent.removeChild(this); } catch(e:Error) { }; owner.reportBurnStop(); } public function initSpark(_arg1:GameLevelScreen):void{ owner = _arg1; noiseSeed = (Math.random() * 50000); noiseMin = ((Math.random() * 10) + 160); dissolveRandom = (Math.random() * int.MAX_VALUE); dissolveCounter = 50; spark = new BitmapData(20, 20, false, 0); mtx = new Matrix(1, 0, 0, 1, 0, (FLAME_HEIGHT - 20)); fire = new Bitmap(screenBuffer); fire.x = (x - (width / 2)); fire.y = ((y - FLAME_HEIGHT) + (height / 2)); SOURCE = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); DEST = new Point(); initPalette(); if (!crackle){ crackle = new Crackle(); crackleTfm = new SoundTransform(0, 0); isPlaying = false; targetVol = 0; burnCount = 0; }; } protected function initPalette():void{ var _local1:Sprite = new TransparentFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 2)); _local3++; }; _local2.dispose(); } public function burn(_arg1:int=0):void{ if (!burning){ parent.addChildAt(fire, depth); burning = true; burnCount++; if (burnCount < 13){ targetVol = (burnCount / 12); }; spreadTime = (spreadTime + (Math.random() * 20)); stopTime = (burnTime + 48); owner.reportBurnStart(); }; } protected function updateSound():void{ var _local1:Number = crackleTfm.volume; _local1 = (_local1 + ((targetVol - _local1) * 0.05)); if (_local1 < 0.0001){ _local1 = 0; }; crackleTfm.volume = _local1; if (((_local1) && (!(isPlaying)))){ isPlaying = true; crackleChannel = crackle.play(0, int.MAX_VALUE, crackleTfm); } else { if (_local1){ if (crackleChannel){ crackleChannel.soundTransform = crackleTfm; }; } else { if (crackleChannel){ crackleChannel.stop(); }; isPlaying = false; }; }; } public static function stopSound():void{ if (crackleChannel){ crackleChannel.stop(); isPlaying = false; }; } } }//package game
Section 154
//ContactListener (game.ContactListener) package game { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import flash.display.*; import Box2D.Collision.*; import Box2D.Common.*; import Box2D.Dynamics.Contacts.*; import flash.media.*; public class ContactListener extends b2ContactListener { private const NEG:uint; private var mParent:MovieClip; private static var thocks:Array; private static var glass:Array; private static var thunks:Array; private static var metals:Array; public function ContactListener(_arg1:DisplayObjectContainer):void{ NEG = (1 << 31); super(); mParent = (_arg1 as MovieClip); if (!thocks){ thocks = new Array(2); thocks[0] = new Thock_0(); thocks[1] = new Thock_1(); thunks = new Array(4); thunks[0] = new Thunk_0(); thunks[1] = new Thunk_1(); thunks[2] = new Thunk_2(); thunks[3] = new Thunk_3(); metals = new Array(4); metals[0] = new Metal1(); metals[1] = new Metal2(); metals[2] = new Metal3(); metals[3] = new Metal4(); glass = new Array(3); glass[0] = new Glass1(); glass[1] = new Glass2(); glass[2] = new Glass3(); }; } override public function Add(_arg1:b2ContactPoint):void{ var _local4:DisplayObject; var _local5:b2Body; var _local6:DisplayObject; var _local2:b2Shape = _arg1.shape1; var _local3:b2Shape = _arg1.shape2; if (_local2.m_isSensor){ _local4 = _local3.GetBody().m_userData; if ((_local4 is DummyBody)){ return; }; _local5 = _local2.GetBody(); _local6 = _local5.m_userData; if ((_local6 is TorchBase)){ TorchBase(_local6).touch(); _local5.m_world.DestroyBody(_local5); } else { if ((_local6 is PowerUpBase)){ PowerUpBase(_local6).touch(); _local5.m_world.DestroyBody(_local5); }; }; } else { if (_local3.m_isSensor){ _local6 = _local2.GetBody().m_userData; if ((_local6 is DummyBody)){ return; }; _local5 = _local3.GetBody(); _local4 = _local5.m_userData; if ((_local4 is TorchBase)){ TorchBase(_local4).touch(); _local5.m_world.DestroyBody(_local5); } else { if ((_local4 is PowerUpBase)){ PowerUpBase(_local4).touch(); _local5.m_world.DestroyBody(_local5); }; }; }; }; } override public function Result(_arg1:b2ContactResult):void{ var _local4:Number; var _local5:int; var _local2:DisplayObject = _arg1.shape2.GetBody().m_userData; if ((_local2 is DummyBody)){ return; }; var _local3:DisplayObject = _arg1.shape1.GetBody().m_userData; if ((_local3 is Crate)){ _local4 = _arg1.normalImpulse; Burnable(_local3).burn(); if (_local4 > 0.1){ _local5 = (((_local4 - 0.1) * 0.5) * 4); if (_local5 > 3){ _local5 = 3; }; thunks[_local5].play(); }; } else { if ((_local3 is Block)){ _local4 = _arg1.normalImpulse; if (_local4 > 0.1){ switch ((_local3 as Block).type){ case 0: _local5 = (_local4 - 0.1); if (_local5 > 1){ _local5 = 1; }; thocks[_local5].play(); break; case 1: _local5 = (((_local4 - 0.1) * 0.8) * 4); if (_local5 > 3){ _local5 = 3; }; metals[_local5].play(); break; case 2: _local5 = (((_local4 - 0.1) * 0.8) * 3); if (_local5 > 2){ _local5 = 2; }; glass[_local5].play(); break; }; }; }; }; } } }//package game
Section 155
//HalfSizePowerUp (game.HalfSizePowerUp) package game { import flash.display.*; import com.leveleditor.*; public class HalfSizePowerUp extends PowerUpBase { public var powerUpHitArea:Pow4Editor; public function HalfSizePowerUp():void{ } override protected function applyEffect():void{ owner.halfSizeBonus(); } override protected function initPalette():void{ var _local1:Sprite = new TransparentBlueFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 2)); _local3++; }; _local2.dispose(); } override protected function hideHitArea():void{ } } }//package game
Section 156
//IFireEmitter (game.IFireEmitter) package game { import screen.*; public interface IFireEmitter { function drawSpark(_arg1:int=0):void; function initSpark(_arg1:GameLevelScreen):void; } }//package game
Section 157
//LongLinePowerUp (game.LongLinePowerUp) package game { import flash.display.*; import com.leveleditor.*; public class LongLinePowerUp extends PowerUpBase { public var powerUpHitArea:Pow3Editor; public function LongLinePowerUp():void{ } override protected function applyEffect():void{ owner.previewBonus(); } override protected function initPalette():void{ var _local1:Sprite = new TransparentRedFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 2)); _local3++; }; _local2.dispose(); } override protected function hideHitArea():void{ } } }//package game
Section 158
//PlusOnePowerUp (game.PlusOnePowerUp) package game { import com.leveleditor.*; public class PlusOnePowerUp extends PowerUpBase { public var powerUpHitArea:Pow1Editor; public function PlusOnePowerUp():void{ } override protected function applyEffect():void{ owner.lifeBonus(); } override protected function hideHitArea():void{ } } }//package game
Section 159
//PowerUpBase (game.PowerUpBase) package game { import screen.*; import flash.geom.*; import flash.display.*; import flash.events.*; import flash.utils.*; import flash.filters.*; public class PowerUpBase extends Sprite implements IFireEmitter { protected const PT_ZERO:Point; protected const FLAME_HEIGHT:int = 35; protected const MATRIX_3x5; protected var cFilter:ConvolutionFilter; protected var frontBuffer:BitmapData; protected var screenBuffer:BitmapData; protected var alive:Boolean; protected var fire:Bitmap; protected var timer:Timer; protected var masker:BitmapData; protected var SOURCE:Rectangle; protected var spark:BitmapData; protected var DEST:Point; protected var noiseSeed:uint;// = 0 protected var mtx:Matrix; protected var owner:GameLevelScreen; protected var palette:Array; public static var depth:int; protected static var sounds:Array; public function PowerUpBase():void{ MATRIX_3x5 = new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0); PT_ZERO = new Point(0, 0); cFilter = new ConvolutionFilter(3, 5, MATRIX_3x5, 4.35, -2, true, false, 0xFF, 1); palette = new Array(); super(); alive = true; if (!sounds){ sounds = new Array(4); sounds[0] = new Torch_0(); sounds[1] = new Torch_1(); sounds[2] = new Torch_2(); sounds[3] = new Torch_3(); }; } public function drawSpark(_arg1:int=0):void{ if (alive){ noiseSeed++; spark.noise(noiseSeed, 163, 0xFF, BitmapDataChannel.BLUE, true); spark.draw(masker, null, null, BlendMode.ADD); frontBuffer.draw(spark, mtx, null, BlendMode.MULTIPLY); }; frontBuffer.applyFilter(frontBuffer, SOURCE, DEST, cFilter); screenBuffer.paletteMap(frontBuffer, SOURCE, PT_ZERO, null, null, palette); screenBuffer.threshold(screenBuffer, SOURCE, DEST, "==", 4278190080, 0, 4278190080, true); } protected function hideHitArea():void{ } public function dispose(_arg1:TimerEvent=null):void{ owner.removeChild(fire); if (parent){ this.parent.removeChild(this); }; owner.removeFire(this); if (timer){ timer.stop(); timer.removeEventListener(TimerEvent.TIMER, dispose); }; screenBuffer.dispose(); frontBuffer.dispose(); spark.dispose(); masker.dispose(); palette.length = 0; fire = null; screenBuffer = null; frontBuffer = null; spark = null; masker = null; palette = null; mtx = null; SOURCE = null; DEST = null; timer = null; } protected function initPalette():void{ var _local1:Sprite = new TransparentFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 2)); _local3++; }; _local2.dispose(); } protected function applyEffect():void{ } public function initSpark(_arg1:GameLevelScreen):void{ var _local2:DisplayObjectContainer; _local2 = DisplayObjectContainer(_arg1); owner = _arg1; hideHitArea(); noiseSeed = (Math.random() * uint.MAX_VALUE); var _local3:Sprite = new NoiseGenerator(); spark = new BitmapData(_local3.width, _local3.height, false, 0); masker = new BitmapData(_local3.width, _local3.height, false, 0); frontBuffer = new BitmapData(_local3.width, FLAME_HEIGHT, false, 0xFF); screenBuffer = new BitmapData(_local3.width, FLAME_HEIGHT, true, 0); masker.draw(_local3); mtx = new Matrix(1, 0, 0, 1, 0, (FLAME_HEIGHT - _local3.height)); fire = new Bitmap(screenBuffer); fire.x = (this.x - (_local3.width / 2)); fire.y = ((this.y - FLAME_HEIGHT) + (_local3.height / 2)); _local2.addChildAt(fire, depth); SOURCE = new Rectangle(0, 0, frontBuffer.width, frontBuffer.height); DEST = new Point(0, 0); initPalette(); } public function touch(_arg1:int=0):void{ if (!alive){ return; }; alive = false; applyEffect(); var _local2:int = (Math.random() * 4); sounds[_local2].play(); timer = new Timer(1500, 1); timer.addEventListener(TimerEvent.TIMER, dispose); timer.start(); } } }//package game
Section 160
//SaveFile (game.SaveFile) package game { import flash.utils.*; import flash.net.*; import com.hurlant.util.*; import com.rng.*; import com.hurlant.crypto.hash.*; public class SaveFile { public var bonusUnlocked:int; public var so:SharedObject; public var gameWon:Boolean; public var levelData:Array; public var lastLevel:int; public var bonusArray:Array; public static const maxLevel:int = 50; public static const maxBonus:int = 10; private static var _instance:SaveFile; public function SaveFile(_arg1:Singleton):void{ so = SharedObject.getLocal("Pyro2"); if (!readSaveFile()){ createNewFile(); }; } private function createNewFile():void{ var _local1:int; var _local2:Object; lastLevel = 0; levelAced = 0; bonusUnlocked = 0; gameWon = false; levelData = new Array(maxLevel); bonusArray = new Array(maxBonus); _local1 = 0; while (_local1 < maxLevel) { _local2 = {aced:false, time:600000}; levelData[_local1] = _local2; _local1++; }; _local1 = 0; while (_local1 < maxBonus) { bonusArray[_local1] = {aced:false, time:600000}; _local1++; }; writeSaveFile(); } protected function sendKongStats():void{ var _local3:int; var _local1:Array = new Array(); var _local2:int = levelAced; _local1.push({name:"AcedLevels", value:_local2}); if (_local2 >= 50){ _local1.push({name:"PerfectAces", value:"1"}); }; if (_local2 >= 60){ _local1.push({name:"FlawlessAces", value:"1"}); }; if (gameWon){ _local1.push({name:"GameWon", value:"1"}); _local1.push({name:"TotalTime", value:totalTime}); }; _local1.push({name:"BonusLevelUnlocked", value:bonusUnlocked}); _local1.push({name:"LevelCompleted", value:levelCompleted}); if (Protection.debug){ _local3 = 0; while (_local3 < _local1.length) { _local3++; }; }; if (((_local1.length) && ((((((Protection.domain == "localhost")) && (Protection.debug))) || ((Protection.domain == "Kongregate")))))){ Protection.kongAPI.stats.submitArray(_local1); }; } public function get levelAced():int{ var _local2:int; var _local1:int; _local2 = 0; while (_local2 < maxLevel) { if (levelData[_local2].aced){ _local1++; }; _local2++; }; _local2 = 0; while (_local2 < maxBonus) { if (bonusArray[_local2].aced){ _local1++; }; _local2++; }; return (_local1); } public function flush():void{ writeSaveFile(); sendKongStats(); } public function get levelCompleted():int{ var _local2:int; var _local1:int = lastLevel; _local2 = 0; while (_local2 < maxBonus) { if (bonusArray[_local2].complete){ _local1++; }; _local2++; }; return (_local1); } public function mergeData(_arg1:XML):void{ var _local2:int = maxLevel; var _local3:Array = [0, 1, 2, 3, 4]; var _local4:KnuthShuffle = new KnuthShuffle(); _local4.initialize(_local3); var _local5:int; while (_local5 < maxLevel) { if (_local5 <= lastLevel){ if (levelData[_local5].aced){ _arg1.level[_local5].type = "aced"; } else { _arg1.level[_local5].type = "normal"; }; } else { _arg1.level[_local5].type = "disabled"; }; _arg1.level[_local5].bgIdx = _local4.getNext(); _arg1.level[_local5].isBonus = "no"; _local5++; }; _local5 = 0; while (_local5 < maxBonus) { if (_local5 < bonusUnlocked){ if (bonusArray[_local5].aced){ _arg1.level[(_local5 + _local2)].type = "aced"; } else { _arg1.level[(_local5 + _local2)].type = "normal"; }; } else { _arg1.level[(_local5 + _local2)].type = "disabled"; }; _arg1.level[(_local5 + _local2)].bgIdx = _local4.getNext(); _arg1.level[(_local5 + _local2)].isBonus = "yes"; _local5++; }; } public function set levelAced(_arg1:int):void{ } private function readSaveFile():Boolean{ var i:int; var aced:Boolean; var time:int; if (((!(so.data.gameData)) || (!(so.data.signature)))){ return (false); }; if (so.data.version != "001"){ return (false); }; var data:ByteArray = so.data.gameData; var hash:ByteArray = so.data.signature; var md5:MD5 = new MD5(); var rehash:ByteArray = md5.hash(data); if (!ArrayUtil.equals(hash, rehash)){ return (false); }; data.position = 0; lastLevel = data.readUnsignedShort(); levelAced = data.readUnsignedShort(); bonusUnlocked = data.readShort(); gameWon = data.readBoolean(); levelData = new Array(maxLevel); bonusArray = new Array(maxBonus); i = 0; while (i < maxLevel) { try { aced = data.readBoolean(); time = data.readInt(); levelData[i] = {aced:aced, time:time}; } catch(e:Error) { return (false); }; i = (i + 1); }; i = 0; while (i < maxBonus) { try { aced = data.readBoolean(); time = data.readInt(); bonusArray[i] = {aced:aced, time:time}; } catch(e:Error) { return (false); }; i = (i + 1); }; return (true); } public function get totalTime():int{ var _local2:int; var _local1:int; _local2 = 0; while (_local2 < maxLevel) { _local1 = (_local1 + levelData[_local2].time); _local2++; }; return ((_local1 / 1000)); } public function mergePlayerData(_arg1:XML):void{ var _local7:int; var _local8:Object; var _local2:Array = [0, 1, 2, 3, 4]; var _local3:KnuthShuffle = new KnuthShuffle(); var _local4:int = _arg1.level.length(); var _local5:Array = so.data.playerData; _local3.initialize(_local2); if (!_local5){ _local5 = new Array(); so.data.playerData = _local5; }; var _local6:int; while (_local6 < _local4) { _local7 = int(_arg1.level[_local6].id); if (!_local5[_local7]){ _local8 = new Object(); _local8.time = -1; _local8.aced = false; _local5[_local7] = _local8; }; if (_local5[_local7].aced){ _arg1.level[_local6].type = "aced"; } else { _arg1.level[_local6].type = "normal"; }; _arg1.level[_local6].bgIdx = _local3.getNext(); _arg1.level[_local6].isBonus = "no"; _local6++; }; so.flush(); } public function writeSaveFile():void{ var _local2:int; var _local1:ByteArray = new ByteArray(); _local1.writeShort(lastLevel); _local1.writeShort(levelAced); _local1.writeShort(bonusUnlocked); _local1.writeBoolean(gameWon); _local2 = 0; while (_local2 < maxLevel) { _local1.writeBoolean(levelData[_local2].aced); _local1.writeInt(levelData[_local2].time); _local2++; }; _local2 = 0; while (_local2 < maxBonus) { _local1.writeBoolean(bonusArray[_local2].aced); _local1.writeInt(bonusArray[_local2].time); _local2++; }; var _local3:MD5 = new MD5(); var _local4:ByteArray = _local3.hash(_local1); so.data.gameData = _local1; so.data.signature = _local4; so.data.version = "001"; so.flush(); } public static function get instance():SaveFile{ if (!_instance){ _instance = new SaveFile(new Singleton()); }; return (_instance); } } }//package game class Singleton { private function Singleton(){ } }
Section 161
//TorchBase (game.TorchBase) package game { import screen.*; import flash.geom.*; import flash.display.*; import flash.filters.*; public class TorchBase extends Sprite implements IFireEmitter { private const FLAME_WIDTH:int = 16; private const PT_ZERO:Point; private const FLAME_HEIGHT:int = 35; private const SCREEN_RECT:Rectangle; private const MATRIX_3x5; private var cFilter:ConvolutionFilter; private var frontBuffer:BitmapData; private var burning:Boolean; private var screenBuffer:BitmapData; private var fire:Bitmap; private var SOURCE:Rectangle; private var spark:BitmapData; private var DEST:Point; public var torchHitArea:TorchHitArea; private var mtx:Matrix; private var noiseSeed:uint;// = 0 private var owner:GameLevelScreen; private var palette:Array; protected static var sounds:Array; public function TorchBase(){ MATRIX_3x5 = new Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0); SCREEN_RECT = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); PT_ZERO = new Point(0, 0); cFilter = new ConvolutionFilter(3, 5, MATRIX_3x5, 4.35, -2, true, false, 0xFF, 1); frontBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, false, 0xFF); screenBuffer = new BitmapData(FLAME_WIDTH, FLAME_HEIGHT, true, 0); palette = new Array(); super(); burning = false; if (!sounds){ sounds = new Array(4); sounds[0] = new Torch_0(); sounds[1] = new Torch_1(); sounds[2] = new Torch_2(); sounds[3] = new Torch_3(); }; } public function drawSpark(_arg1:int=0):void{ if (!burning){ return; }; noiseSeed++; spark.noise(noiseSeed, 90, 0xFF, BitmapDataChannel.BLUE, true); frontBuffer.draw(spark, mtx, null, BlendMode.MULTIPLY); frontBuffer.applyFilter(frontBuffer, SOURCE, DEST, cFilter); screenBuffer.paletteMap(frontBuffer, SOURCE, PT_ZERO, null, null, palette); screenBuffer.threshold(screenBuffer, SOURCE, DEST, "==", 4278190080, 0, 4278190080, true); } private function initPalette():void{ var _local1:Sprite = new TransparentFlamePalette(); var _local2:BitmapData = new BitmapData(0x0100, 10, true, 0); _local2.draw(_local1); var _local3:uint; while (_local3 < 0x0100) { palette[_local3] = uint(_local2.getPixel32(_local3, 2)); _local3++; }; _local2.dispose(); } public function burn(_arg1:int=0):void{ touch(); } public function dispose():void{ owner.removeFire(this); removeChild(fire); fire = null; spark.dispose(); frontBuffer.dispose(); screenBuffer.dispose(); palette.length = 0; spark = null; frontBuffer = null; screenBuffer = null; palette = null; } public function initSpark(_arg1:GameLevelScreen):void{ owner = _arg1; noiseSeed = 0; spark = new BitmapData(FLAME_WIDTH, 8, false, 0); mtx = new Matrix(1, 0, 0, 1, 0, (FLAME_HEIGHT - 8)); fire = new Bitmap(screenBuffer); fire.x = (torchHitArea.x - (FLAME_WIDTH / 2)); fire.y = ((torchHitArea.y - FLAME_HEIGHT) + (torchHitArea.height / 2)); addChildAt(fire, 0); SOURCE = new Rectangle(0, 0, FLAME_WIDTH, FLAME_HEIGHT); DEST = new Point(); initPalette(); } public function touch():void{ if (burning){ return; }; burning = true; owner.score(); var _local1:int = (Math.random() * 4); sounds[_local1].play(); } } }//package game
Section 162
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin) package gs.plugins { import flash.display.*; import gs.*; public class AutoAlphaPlugin extends TweenPlugin { protected var _tweenVisible:Boolean; protected var _target:Object; protected var _visible:Boolean; protected var _tween:TweenLite; public static const VERSION:Number = 1; public static const API:Number = 1; public function AutoAlphaPlugin(){ this.propName = "autoAlpha"; this.overwriteProps = ["alpha", "visible"]; this.onComplete = onCompleteTween; } override public function killProps(_arg1:Object):void{ super.killProps(_arg1); _tweenVisible = !(Boolean(("visible" in _arg1))); } 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 set changeFactor(_arg1:Number):void{ updateTweens(_arg1); if (((!((_target.visible == true))) && (_tweenVisible))){ _target.visible = true; }; } } }//package gs.plugins
Section 163
//EndArrayPlugin (gs.plugins.EndArrayPlugin) package gs.plugins { import flash.display.*; import gs.*; import gs.utils.tween.*; public class EndArrayPlugin extends TweenPlugin { protected var _a:Array; protected var _info:Array; public static const VERSION:Number = 1.01; public static const API:Number = 1; public function EndArrayPlugin(){ _info = []; super(); this.propName = "endArray"; this.overwriteProps = ["endArray"]; } public function init(_arg1:Array, _arg2:Array):void{ _a = _arg1; var _local3:int = (_arg2.length - 1); while (_local3 > -1) { if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){ _info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3])); }; _local3--; }; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){ return (false); }; init((_arg1 as Array), _arg2); return (true); } override public function set changeFactor(_arg1:Number):void{ var _local2:int; var _local3:ArrayTweenInfo; var _local4:Number; var _local5:int; if (this.round){ _local2 = (_info.length - 1); while (_local2 > -1) { _local3 = _info[_local2]; _local4 = (_local3.start + (_local3.change * _arg1)); _local5 = ((_local4)<0) ? -1 : 1; _a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4); _local2--; }; } else { _local2 = (_info.length - 1); while (_local2 > -1) { _local3 = _info[_local2]; _a[_local3.index] = (_local3.start + (_local3.change * _arg1)); _local2--; }; }; } } }//package gs.plugins
Section 164
//FramePlugin (gs.plugins.FramePlugin) package gs.plugins { import flash.display.*; import gs.*; public class FramePlugin extends TweenPlugin { protected var _target:MovieClip; public var frame:int; public static const VERSION:Number = 1.01; public static const API:Number = 1; public function FramePlugin(){ this.propName = "frame"; this.overwriteProps = ["frame"]; this.round = true; } 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); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _target.gotoAndStop(this.frame); } } }//package gs.plugins
Section 165
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin) package gs.plugins { public class RemoveTintPlugin extends TintPlugin { public static const VERSION:Number = 1.01; public static const API:Number = 1; public function RemoveTintPlugin(){ this.propName = "removeTint"; } } }//package gs.plugins
Section 166
//TintPlugin (gs.plugins.TintPlugin) package gs.plugins { import flash.geom.*; import flash.display.*; import gs.*; import gs.utils.tween.*; public class TintPlugin extends TweenPlugin { protected var _target:DisplayObject; protected var _ct:ColorTransform; protected var _ignoreAlpha:Boolean; public static const VERSION:Number = 1.1; public static const API:Number = 1; protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"]; public function TintPlugin(){ this.propName = "tint"; this.overwriteProps = ["tint"]; } 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{ if (!(_arg1 is DisplayObject)){ return (false); }; var _local4:ColorTransform = new ColorTransform(); if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){ _local4.color = uint(_arg2); }; _ignoreAlpha = true; init((_arg1 as DisplayObject), _local4); return (true); } 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; } } }//package gs.plugins
Section 167
//TweenPlugin (gs.plugins.TweenPlugin) package gs.plugins { import gs.*; import gs.utils.tween.*; public class TweenPlugin { public var overwriteProps:Array; protected var _tweens:Array; public var propName:String; public var onComplete:Function; public var round:Boolean; protected var _changeFactor:Number;// = 0 public static const VERSION:Number = 1.03; public static const API:Number = 1; public function TweenPlugin(){ _tweens = []; super(); } protected function updateTweens(_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 168
//VisiblePlugin (gs.plugins.VisiblePlugin) package gs.plugins { import flash.display.*; import gs.*; public class VisiblePlugin extends TweenPlugin { protected var _target:Object; protected var _visible:Boolean; protected var _tween:TweenLite; public static const VERSION:Number = 1; public static const API:Number = 1; public function VisiblePlugin(){ this.propName = "visible"; this.overwriteProps = ["visible"]; this.onComplete = onCompleteTween; } public function onCompleteTween():void{ if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){ _target.visible = _visible; }; } override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{ _target = _arg1; _tween = _arg3; _visible = Boolean(_arg2); return (true); } override public function set changeFactor(_arg1:Number):void{ if (_target.visible != true){ _target.visible = true; }; } } }//package gs.plugins
Section 169
//VolumePlugin (gs.plugins.VolumePlugin) package gs.plugins { import flash.display.*; import gs.*; import flash.media.*; public class VolumePlugin extends TweenPlugin { protected var _target:Object; protected var _st:SoundTransform; public static const VERSION:Number = 1.01; public static const API:Number = 1; public function VolumePlugin(){ this.propName = "volume"; this.overwriteProps = ["volume"]; } 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); } override public function set changeFactor(_arg1:Number):void{ updateTweens(_arg1); _target.soundTransform = _st; } } }//package gs.plugins
Section 170
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo) package gs.utils.tween { public class ArrayTweenInfo { public var change:Number; public var start:Number; public var index:uint; public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){ this.index = _arg1; this.start = _arg2; this.change = _arg3; } } }//package gs.utils.tween
Section 171
//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 172
//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 started:Boolean; public var delay:Number; protected var _hasUpdate:Boolean; protected var _hasPlugins:Boolean; public var initted:Boolean; public var active:Boolean; public var startTime:Number; public var target:Object; public var duration:Number; public var gc:Boolean; public var tweens:Array; public var vars:Object; public var ease:Function; public var exposedVars:Object; public var initTime:Number; public var combinedTimeScale:Number; public static const version:Number = 10.09; private static var _timer:Timer = new Timer(2000); public static var defaultEase:Function = 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){ 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)); var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite); if (((!((_arg1 in masterList))) || ((_local4 == 1)))){ masterList[_arg1] = [this]; } else { masterList[_arg1].push(this); }; if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){ initTweenVals(); if (this.active){ render((this.startTime + 1)); } else { render(this.startTime); }; if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){ this.target.visible = this.exposedVars.visible; }; }; } public function get enabled():Boolean{ return ((this.gc) ? false : true); } public function set enabled(_arg1:Boolean):void{ var _local2:Array; var _local3:Boolean; var _local4:int; if (_arg1){ if (!(this.target in masterList)){ masterList[this.target] = [this]; } else { _local2 = masterList[this.target]; _local4 = (_local2.length - 1); while (_local4 > -1) { if (_local2[_local4] == this){ _local3 = true; break; }; _local4--; }; if (!_local3){ _local2[_local2.length] = this; }; }; }; this.gc = (_arg1) ? false : true; if (this.gc){ this.active = false; } else { this.active = this.started; }; } public function clear():void{ this.tweens = []; this.vars = (this.exposedVars = {ease:this.vars.ease}); _hasUpdate = false; } public function render(_arg1:uint):void{ var _local3:Number; var _local4:TweenInfo; var _local5:int; var _local2:Number = ((_arg1 - this.startTime) * 0.001); if (_local2 >= this.duration){ _local2 = this.duration; _local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0; } else { _local3 = this.ease(_local2, 0, 1, this.duration); }; _local5 = (this.tweens.length - 1); while (_local5 > -1) { _local4 = this.tweens[_local5]; _local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change)); _local5--; }; if (_hasUpdate){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_local2 == this.duration){ complete(true); }; } public function activate():void{ this.started = (this.active = true); if (!this.initted){ initTweenVals(); }; if (this.vars.onStart != null){ this.vars.onStart.apply(null, this.vars.onStartParams); }; if (this.duration == 0.001){ this.startTime = (this.startTime - 1); }; } public function initTweenVals():void{ var _local1:String; var _local2:int; var _local3:*; var _local4:TweenInfo; if (((!((this.exposedVars.timeScale == undefined))) && ((this.target is TweenLite)))){ this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false); }; for (_local1 in this.exposedVars) { if ((_local1 in _reservedProps)){ } else { if ((_local1 in plugins)){ _local3 = new (plugins[_local1]); if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){ this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false); } else { this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true); _hasPlugins = true; }; } else { this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false); }; }; }; if (this.vars.runBackwards == true){ _local2 = (this.tweens.length - 1); while (_local2 > -1) { _local4 = this.tweens[_local2]; this.tweens[_local2].start = (_local4.start + _local4.change); _local4.change = -(_local4.change); _local2--; }; }; if (this.vars.onUpdate != null){ _hasUpdate = true; }; if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){ overwriteManager.manageOverwrites(this, masterList[this.target]); }; this.initted = true; } protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } public function killVars(_arg1:Object):void{ if (overwriteManager.enabled){ overwriteManager.killVars(_arg1, this.exposedVars, this.tweens); }; } public function complete(_arg1:Boolean=false):void{ var _local2:int; if (!_arg1){ if (!this.initted){ initTweenVals(); }; this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale)); render(currentTime); return; }; if (_hasPlugins){ _local2 = (this.tweens.length - 1); while (_local2 > -1) { if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){ this.tweens[_local2].target.onComplete(); }; _local2--; }; }; if (this.vars.persist != true){ this.enabled = false; }; if (this.vars.onComplete != null){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); }; } public static function updateAll(_arg1:Event=null):void{ var _local4:Array; var _local5:int; var _local6:TweenLite; var _local2:uint = (currentTime = getTimer()); var _local3:Dictionary = masterList; for each (_local4 in _local3) { _local5 = (_local4.length - 1); while (_local5 > -1) { _local6 = _local4[_local5]; if (_local6.active){ _local6.render(_local2); } else { if (_local6.gc){ _local4.splice(_local5, 1); } else { if (_local2 >= _local6.startTime){ _local6.activate(); _local6.render(_local2); }; }; }; _local5--; }; }; } public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{ if (_arg1 != null){ if (_arg2){ _arg1.clear(); }; _arg1.enabled = false; }; } public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{ var _local3:Array; var _local4:int; var _local5:TweenLite; if (((!((_arg1 == null))) && ((_arg1 in masterList)))){ _local3 = masterList[_arg1]; _local4 = (_local3.length - 1); while (_local4 > -1) { _local5 = _local3[_local4]; if (((_arg2) && (!(_local5.gc)))){ _local5.complete(false); }; _local5.clear(); _local4--; }; delete masterList[_arg1]; }; } public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ _arg3.runBackwards = true; return (new TweenLite(_arg1, _arg2, _arg3)); } public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); } protected static function killGarbage(_arg1:TimerEvent):void{ var _local3:Object; var _local2:Dictionary = masterList; for (_local3 in _local2) { if (_local2[_local3].length == 0){ delete _local2[_local3]; }; }; } public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{ return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0})); } public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ return (new TweenLite(_arg1, _arg2, _arg3)); } } }//package gs
Section 173
//MochiAd (mochi.as3.MochiAd) package mochi.as3 { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.net.*; import flash.system.*; public class MochiAd { public static function getVersion():String{ return ("3.02 as3"); } public static function showClickAwayAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{ }, ad_finished:function ():void{ }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ }, ad_skipped:function ():void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); options.ad_finished(); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; var sendHostProgress:Boolean; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; chk["onEnterFrame"] = function ():void{ var _local4:Number; if (!this.parent){ delete this.onEnterFrame; return; }; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; _local3 = true; chk.started = getTimer(); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (this.root == null){ _local3 = true; }; if (_local3){ delete this.onEnterFrame; }; }; doOnEnterFrame(chk); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function _allowDomains(_arg1:String):String{ var _local2:String = _arg1.split("/")[2].split(":")[0]; if (Security.sandboxType == "application"){ return (_local2); }; Security.allowDomain("*"); Security.allowDomain(_local2); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(_local2); return (_local2); } public static function unload(_arg1:Object):Boolean{ if (((_arg1.clip) && (_arg1.clip._mochiad))){ _arg1 = _arg1.clip; }; if (_arg1.origFrameRate != undefined){ _arg1.stage.frameRate = _arg1.origFrameRate; }; if (!_arg1._mochiad){ return (false); }; if (_arg1._mochiad._containerLCName != undefined){ _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"}); }; if (_arg1._mochiad.onUnload){ _arg1._mochiad.onUnload(); }; delete _arg1._mochiad_loaded; delete _arg1._mochiad; return (true); } public static function showInterLevelAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ }, ad_skipped:function ():void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); options.ad_finished(); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ if (!this.parent){ delete this.onEnterFrame; delete this.fadeFunction; return; }; var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { MochiAd.unload(clip); delete this["onEnterFrame"]; }; }; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = (_arg1 - 250); }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; chk["onEnterFrame"] = function ():void{ var _local4:Number; if (!this.parent){ delete this.onEnterFrame; delete this.fadeFunction; return; }; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (_local2 > chk.ad_msec){ _local3 = true; }; if (_local3){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function _parseOptions(_arg1:Object, _arg2:Object):Object{ var _local4:String; var _local5:Array; var _local6:Number; var _local7:Array; var _local3:Object = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; if (_arg1){ for (_local4 in _arg1) { _local3[_local4] = _arg1[_local4]; }; }; if (_local3.clip == undefined){ throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite.")); }; _arg1 = _local3.clip.loaderInfo.parameters.mochiad_options; if (_arg1){ _local5 = _arg1.split("&"); _local6 = 0; while (_local6 < _local5.length) { _local7 = _local5[_local6].split("="); _local3[unescape(_local7[0])] = unescape(_local7[1]); _local6++; }; }; if (_local3.id == "test"){ }; return (_local3); } public static function _cleanup(_arg1:Object):void{ var k:String; var lc:LocalConnection; var f:Function; var mc = _arg1; if (("lc" in mc)){ lc = mc.lc; f = function ():void{ try { lc.client = null; lc.close(); } catch(e:Error) { }; }; setTimeout(f, 0); }; var idx:Number = DisplayObjectContainer(mc).numChildren; while (idx > 0) { idx = (idx - 1); DisplayObjectContainer(mc).removeChildAt(idx); }; for (k in mc) { delete mc[k]; }; } public static function load(_arg1:Object):MovieClip{ var clip:Object; var k:String; var server:String; var hostname:String; var lc:LocalConnection; var name:String; var loader:Loader; var g:Function; var req:URLRequest; var v:Object; var options = _arg1; var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"}; options = MochiAd._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = MochiAd.getVersion(); clip = options.clip; if (!MochiAd._isNetworkAvailable()){ return (null); }; try { if (clip._mochiad_loaded){ return (null); }; } catch(e:Error) { throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic.")); }; var depth:Number = options.depth; delete options.depth; var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth); var wh:Array = MochiAd._getRes(options, clip); options.res = ((wh[0] + "x") + wh[1]); options.server = (options.server + options.id); delete options.id; clip._mochiad_loaded = true; if (clip.loaderInfo.loaderURL.indexOf("http") == 0){ options.as3_swf = clip.loaderInfo.loaderURL; //unresolved jump }; var lv:URLVariables = new URLVariables(); for (k in options) { v = options[k]; if (!(v is Function)){ lv[k] = v; }; }; server = lv.server; delete lv.server; hostname = _allowDomains(server); lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.lc = lc; mc.lcName = name; lv.lc = name; lv.st = getTimer(); loader = new Loader(); g = function (_arg1:Object):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); MochiAd.unload(clip); }; loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g); req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime())); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{ }); loader.load(req); mc.addChild(loader); mc._mochiad_ctr = loader; return (mc); } public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{ var _local4:Array = _arg2.split("."); var _local5:Number = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return (undefined); }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; if (typeof(_arg1[_local4[_local5]]) == "function"){ return (_arg1[_local4[_local5]].apply(_arg1, _arg3)); }; return (undefined); } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{ var _local4:MovieClip = new MovieClip(); if (((false) && (_arg3))){ _arg1.addChildAt(_local4, _arg3); } else { _arg1.addChild(_local4); }; _arg1[_arg2] = _local4; _local4["_name"] = _arg2; return (_local4); } public static function _getRes(_arg1:Object, _arg2:Object):Array{ var _local6:Array; var _local3:Object = _arg2.getBounds(_arg2.root); var _local4:Number = 0; var _local5:Number = 0; if (typeof(_arg1.res) != "undefined"){ _local6 = _arg1.res.split("x"); _local4 = parseFloat(_local6[0]); _local5 = parseFloat(_local6[1]); } else { _local4 = (_local3.xMax - _local3.xMin); _local5 = (_local3.yMax - _local3.yMin); }; if ((((_local4 == 0)) || ((_local5 == 0)))){ _local4 = _arg2.stage.stageWidth; _local5 = _arg2.stage.stageHeight; }; return ([_local4, _local5]); } public static function adShowing(_arg1:Object):void{ _arg1.origFrameRate = _arg1.stage.frameRate; _arg1.stage.frameRate = 30; } public static function getValue(_arg1:Object, _arg2:String):Object{ var _local3:Array = _arg2.split("."); var _local4:Number = 0; while (_local4 < (_local3.length - 1)) { if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){ return (undefined); }; _arg1 = _arg1[_local3[_local4]]; _local4++; }; return (_arg1[_local3[_local4]]); } public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{ var _local4:Object; var _local5:Object; switch (_arg3.id){ case "setValue": MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value); break; case "getValue": _local4 = MochiAd.getValue(_arg1, _arg3.objectName); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4); break; case "runMethod": _local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5); break; }; } public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{ var _local4:Array = _arg2.split("."); var _local5:Number = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return; }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; _arg1[_local4[_local5]] = _arg3; } public static function showPreGameAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var complete:Boolean; var unloaded:Boolean; var sendHostProgress:Boolean; var fn:Function; var r:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ }, ad_skipped:function ():void{ }, ad_progress:function (_arg1:Number):void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){ options.ad_started(); fn = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); return; }; clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = options.fadeout_time; delete options.fadeout_time; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); var fn:Function = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.x = (w * -0.5); chk.y = (h * -0.5); var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4); if (options.no_progress_bar){ bar.visible = false; delete options.no_progress_bar; } else { bar.x = 10; bar.y = (h - 20); }; var bar_color:Number = options.color; delete options.color; var bar_background:Number = options.background; delete options.background; var bar_outline:Number = options.outline; delete options.outline; var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1); var backing:Object = backing_mc.graphics; backing.beginFill(bar_background); backing.moveTo(0, 0); backing.lineTo((w - 20), 0); backing.lineTo((w - 20), 10); backing.lineTo(0, 10); backing.lineTo(0, 0); backing.endFill(); var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2); var inside:Object = inside_mc.graphics; inside.beginFill(bar_color); inside.moveTo(0, 0); inside.lineTo((w - 20), 0); inside.lineTo((w - 20), 10); inside.lineTo(0, 10); inside.lineTo(0, 0); inside.endFill(); inside_mc.scaleX = 0; var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3); var outline:Object = outline_mc.graphics; outline.lineStyle(0, bar_outline, 100); outline.moveTo(0, 0); outline.lineTo((w - 20), 0); outline.lineTo((w - 20), 10); outline.lineTo(0, 10); outline.lineTo(0, 0); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { MochiAd.unload(clip); delete this["onEnterFrame"]; }; }; complete = false; unloaded = false; var f:Function = function (_arg1:Event):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); complete = true; if (unloaded){ MochiAd.unload(clip); }; }; if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){ complete = true; } else { if ((clip.root is MovieClip)){ r = (clip.root as MovieClip); if (r.framesLoaded >= r.totalFrames){ complete = true; } else { clip.loaderInfo.addEventListener(Event.COMPLETE, f); }; } else { clip.loaderInfo.addEventListener(Event.COMPLETE, f); }; }; mc.unloadAd = function ():void{ unloaded = true; if (complete){ MochiAd.unload(clip); }; }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = _arg1; }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; mc.rpcTestFn = function (_arg1:String):Object{ return (_arg1); }; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; sendHostProgress = false; mc.sendHostLoadProgress = function (_arg1:String):void{ sendHostProgress = true; }; chk["onEnterFrame"] = function ():void{ var _local11:Number; if (((!(this.parent)) || (!(this.parent.parent)))){ delete this["onEnterFrame"]; return; }; var _local1:Object = this.parent.parent.root; var _local2:Object = this.parent._mochiad_ctr; var _local3:Number = (getTimer() - this.started); var _local4:Boolean; var _local5:Number = _local1.loaderInfo.bytesTotal; var _local6:Number = _local1.loaderInfo.bytesLoaded; if (complete){ _local6 = Math.max(1, _local6); _local5 = _local6; }; var _local7:Number = ((100 * _local6) / _local5); var _local8:Number = ((100 * _local3) / chk.ad_msec); var _local9:Object = this._mochiad_bar._inside; var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8)); _local10 = Math.max(this.last_pcnt, _local10); this.last_pcnt = _local10; _local9.scaleX = (_local10 * 0.01); options.ad_progress(_local10); if (sendHostProgress){ clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7}); if (_local7 == 100){ sendHostProgress = false; }; }; if (!chk.showing){ _local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local11 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){ options.ad_failed(); _local4 = true; }; }; }; if (_local3 > chk.ad_msec){ _local4 = true; }; if (((complete) && (_local4))){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function showPreloaderAd(_arg1:Object):void{ MochiAd.showPreGameAd(_arg1); } public static function showTimedAd(_arg1:Object):void{ MochiAd.showInterLevelAd(_arg1); } public static function doOnEnterFrame(_arg1:MovieClip):void{ var mc = _arg1; var f:Function = function (_arg1:Object):void{ if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){ mc.onEnterFrame(); } else { _arg1.target.removeEventListener(_arg1.type, arguments.callee); }; }; mc.addEventListener(Event.ENTER_FRAME, f); } } }//package mochi.as3
Section 174
//AcedScreen_70 (Pyro2_fla.AcedScreen_70) package Pyro2_fla { import flash.display.*; import flash.events.*; public dynamic class AcedScreen_70 extends MovieClip { public var unlockText:MovieClip; public var unlockBackground:MovieClip; public function AcedScreen_70(){ addFrameScript(0, frame1, 55, frame56); } function frame1(){ stop(); } function frame56(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package Pyro2_fla
Section 175
//AssetsHolder_20 (Pyro2_fla.AssetsHolder_20) package Pyro2_fla { import flash.display.*; public dynamic class AssetsHolder_20 extends MovieClip { public function AssetsHolder_20(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package Pyro2_fla
Section 176
//DialogWindow_204 (Pyro2_fla.DialogWindow_204) package Pyro2_fla { import flash.display.*; import fl.controls.*; import flash.text.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; public dynamic class DialogWindow_204 extends MovieClip { public var txt_desc:Label; public var txt_title:Label; public var btn_close:SimpleButton; public var txt_dialog:TextArea; public var btn_copy:Button; public var btn_submit:Button; public var btn_OK:Button; public function DialogWindow_204(){ __setProp_txt_dialog_DialogWindow_Layer3_0(); __setProp_btn_OK_DialogWindow_Layer3_0(); __setProp_txt_desc_DialogWindow_Layer3_0(); __setProp_btn_copy_DialogWindow_Layer3_0(); __setProp_btn_submit_DialogWindow_Layer3_0(); } function __setProp_btn_submit_DialogWindow_Layer3_0(){ try { btn_submit["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_submit.emphasized = false; btn_submit.enabled = true; btn_submit.label = "Submit to Kongregate"; btn_submit.labelPlacement = "right"; btn_submit.selected = false; btn_submit.toggle = false; btn_submit.visible = true; try { btn_submit["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_dialog_DialogWindow_Layer3_0(){ try { txt_dialog["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_dialog.condenseWhite = false; txt_dialog.editable = false; txt_dialog.enabled = true; txt_dialog.horizontalScrollPolicy = "auto"; txt_dialog.htmlText = ""; txt_dialog.maxChars = 0; txt_dialog.restrict = ""; txt_dialog.text = ""; txt_dialog.verticalScrollPolicy = "auto"; txt_dialog.visible = true; txt_dialog.wordWrap = true; try { txt_dialog["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_copy_DialogWindow_Layer3_0(){ try { btn_copy["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_copy.emphasized = false; btn_copy.enabled = true; btn_copy.label = "Copy"; btn_copy.labelPlacement = "right"; btn_copy.selected = false; btn_copy.toggle = false; btn_copy.visible = true; try { btn_copy["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_OK_DialogWindow_Layer3_0(){ try { btn_OK["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_OK.emphasized = false; btn_OK.enabled = true; btn_OK.label = "OK"; btn_OK.labelPlacement = "right"; btn_OK.selected = false; btn_OK.toggle = false; btn_OK.visible = true; try { btn_OK["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_desc_DialogWindow_Layer3_0(){ try { txt_desc["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_desc.autoSize = "none"; txt_desc.condenseWhite = false; txt_desc.enabled = true; txt_desc.htmlText = ""; txt_desc.selectable = false; txt_desc.text = "Press 'Copy' and then paste the code into a forum, instant messenger, or e-mail to share your level with friends."; txt_desc.visible = true; txt_desc.wordWrap = true; try { txt_desc["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package Pyro2_fla
Section 177
//GregLogo_Screen_52 (Pyro2_fla.GregLogo_Screen_52) package Pyro2_fla { import screen.*; import flash.display.*; public dynamic class GregLogo_Screen_52 extends MovieClip { public var anim_text:GregIntroTypeEffect; public function GregLogo_Screen_52(){ addFrameScript(0, frame1, 1, frame2); } function frame1(){ stop(); } function frame2(){ stop(); MovieClip(this.parent).play(); } } }//package Pyro2_fla
Section 178
//HUDPanel_193 (Pyro2_fla.HUDPanel_193) package Pyro2_fla { import flash.display.*; import fl.controls.*; import flash.text.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; public dynamic class HUDPanel_193 extends MovieClip { public var level:MovieClip; public var lifeText:Label; public var btn_Restart:Button; public var btn_Sponsor:Button; public var percentText:Label; public var tip:MovieClip; public var txt_levelName:Label; public var btn_StopPreview:Button; public var label_life:Label; public var btn_Suicide:Button; public var btn_Browse:Button; public var label_torch:Label; public var btn_Mute:Button; public function HUDPanel_193(){ __setProp_btn_StopPreview_HUDPanel_Labels_0(); __setProp_btn_Restart_HUDPanel_Labels_0(); __setProp_label_life_HUDPanel_Labels_0(); __setProp_label_torch_HUDPanel_Labels_0(); __setProp_txt_levelName_HUDPanel_Labels_0(); __setProp_btn_Mute_HUDPanel_Labels_0(); __setProp_btn_Suicide_HUDPanel_Labels_0(); __setProp_btn_Sponsor_HUDPanel_Labels_0(); __setProp_btn_Browse_HUDPanel_Labels_0(); } function __setProp_btn_Sponsor_HUDPanel_Labels_0(){ try { btn_Sponsor["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Sponsor.emphasized = false; btn_Sponsor.enabled = true; btn_Sponsor.label = "Play More Games!"; btn_Sponsor.labelPlacement = "right"; btn_Sponsor.selected = false; btn_Sponsor.toggle = false; btn_Sponsor.visible = true; try { btn_Sponsor["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Browse_HUDPanel_Labels_0(){ try { btn_Browse["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Browse.emphasized = false; btn_Browse.enabled = true; btn_Browse.label = "Browse Levels"; btn_Browse.labelPlacement = "right"; btn_Browse.selected = false; btn_Browse.toggle = false; btn_Browse.visible = true; try { btn_Browse["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_label_life_HUDPanel_Labels_0(){ try { label_life["componentInspectorSetting"] = true; } catch(e:Error) { }; label_life.autoSize = "none"; label_life.condenseWhite = false; label_life.enabled = true; label_life.htmlText = ""; label_life.selectable = false; label_life.text = "Lives:"; label_life.visible = true; label_life.wordWrap = false; try { label_life["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_txt_levelName_HUDPanel_Labels_0(){ try { txt_levelName["componentInspectorSetting"] = true; } catch(e:Error) { }; txt_levelName.autoSize = "center"; txt_levelName.condenseWhite = false; txt_levelName.enabled = true; txt_levelName.htmlText = ""; txt_levelName.selectable = false; txt_levelName.text = "Label"; txt_levelName.visible = true; txt_levelName.wordWrap = true; try { txt_levelName["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_StopPreview_HUDPanel_Labels_0(){ try { btn_StopPreview["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_StopPreview.emphasized = false; btn_StopPreview.enabled = true; btn_StopPreview.label = "Stop Preview"; btn_StopPreview.labelPlacement = "right"; btn_StopPreview.selected = false; btn_StopPreview.toggle = false; btn_StopPreview.visible = true; try { btn_StopPreview["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Suicide_HUDPanel_Labels_0(){ try { btn_Suicide["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Suicide.emphasized = false; btn_Suicide.enabled = true; btn_Suicide.label = "Suicide"; btn_Suicide.labelPlacement = "right"; btn_Suicide.selected = false; btn_Suicide.toggle = false; btn_Suicide.visible = true; try { btn_Suicide["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_label_torch_HUDPanel_Labels_0(){ try { label_torch["componentInspectorSetting"] = true; } catch(e:Error) { }; label_torch.autoSize = "none"; label_torch.condenseWhite = false; label_torch.enabled = true; label_torch.htmlText = ""; label_torch.selectable = false; label_torch.text = "Torch Needed:"; label_torch.visible = true; label_torch.wordWrap = false; try { label_torch["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Mute_HUDPanel_Labels_0(){ try { btn_Mute["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Mute.emphasized = false; btn_Mute.enabled = true; btn_Mute.label = "Mute"; btn_Mute.labelPlacement = "right"; btn_Mute.selected = false; btn_Mute.toggle = false; btn_Mute.visible = true; try { btn_Mute["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Restart_HUDPanel_Labels_0(){ try { btn_Restart["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Restart.emphasized = false; btn_Restart.enabled = true; btn_Restart.label = "Restart"; btn_Restart.labelPlacement = "right"; btn_Restart.selected = false; btn_Restart.toggle = false; btn_Restart.visible = true; try { btn_Restart["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package Pyro2_fla
Section 179
//LooseScreen_57 (Pyro2_fla.LooseScreen_57) package Pyro2_fla { import flash.geom.*; import fl.controls.*; import flash.display.*; import flash.events.*; import flash.utils.*; import flash.text.*; import flash.net.*; import flash.media.*; import flash.filters.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.xml.*; public dynamic class LooseScreen_57 extends MovieClip { public var btn_Retry:Button; public var btn_Browse:Button; public var btn_Sponsor:Button; public var btn_LevelSelect:Button; public function LooseScreen_57(){ __setProp_btn_Retry_LooseScreen_Layer3_0(); __setProp_btn_LevelSelect_LooseScreen_Layer3_0(); __setProp_btn_Sponsor_LooseScreen_Layer3_0(); __setProp_btn_Browse_LooseScreen_Layer3_0(); } function __setProp_btn_Browse_LooseScreen_Layer3_0(){ try { btn_Browse["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Browse.emphasized = false; btn_Browse.enabled = true; btn_Browse.label = "Browse Player Levels"; btn_Browse.labelPlacement = "right"; btn_Browse.selected = false; btn_Browse.toggle = false; btn_Browse.visible = true; try { btn_Browse["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_LevelSelect_LooseScreen_Layer3_0(){ try { btn_LevelSelect["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_LevelSelect.emphasized = false; btn_LevelSelect.enabled = true; btn_LevelSelect.label = "Level Select"; btn_LevelSelect.labelPlacement = "right"; btn_LevelSelect.selected = false; btn_LevelSelect.toggle = false; btn_LevelSelect.visible = true; try { btn_LevelSelect["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Sponsor_LooseScreen_Layer3_0(){ try { btn_Sponsor["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Sponsor.emphasized = false; btn_Sponsor.enabled = true; btn_Sponsor.label = "Play Something Else"; btn_Sponsor.labelPlacement = "right"; btn_Sponsor.selected = false; btn_Sponsor.toggle = false; btn_Sponsor.visible = true; try { btn_Sponsor["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Retry_LooseScreen_Layer3_0(){ try { btn_Retry["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Retry.emphasized = false; btn_Retry.enabled = true; btn_Retry.label = "Retry >"; btn_Retry.labelPlacement = "right"; btn_Retry.selected = false; btn_Retry.toggle = false; btn_Retry.visible = true; try { btn_Retry["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package Pyro2_fla
Section 180
//Tip_194 (Pyro2_fla.Tip_194) package Pyro2_fla { import flash.display.*; import fl.controls.*; import flash.text.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; public dynamic class Tip_194 extends MovieClip { public var txt_Content:TextField; public var btn_Guide:Button; public var txt_Footer:TextField; public var txt_Head:TextField; public function Tip_194(){ __setProp_btn_Guide_Tip_Layer3_0(); } function __setProp_btn_Guide_Tip_Layer3_0(){ try { btn_Guide["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Guide.emphasized = false; btn_Guide.enabled = true; btn_Guide.label = "Ace Guide"; btn_Guide.labelPlacement = "right"; btn_Guide.selected = false; btn_Guide.toggle = false; btn_Guide.visible = true; try { btn_Guide["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package Pyro2_fla
Section 181
//WinScroll_184 (Pyro2_fla.WinScroll_184) package Pyro2_fla { import flash.display.*; import fl.controls.*; import flash.text.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; public dynamic class WinScroll_184 extends MovieClip { public var btn_Back:Button; public function WinScroll_184(){ __setProp_btn_Back_WinScroll_Layer1_0(); } function __setProp_btn_Back_WinScroll_Layer1_0(){ try { btn_Back["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Back.emphasized = false; btn_Back.enabled = true; btn_Back.label = "< Back"; btn_Back.labelPlacement = "right"; btn_Back.selected = false; btn_Back.toggle = false; btn_Back.visible = true; try { btn_Back["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package Pyro2_fla
Section 182
//AbstractScreen (screen.AbstractScreen) package screen { import flash.display.*; import game.*; import flash.events.*; import gs.*; import flash.utils.*; public class AbstractScreen extends MovieClip { public static const COMPLETE:String = "TransitionComplete"; protected static var fullTransition:Boolean = false; protected static var oldGameScreen:GameLevelScreen; public static var screens:ScreenList; public static var _parent:DisplayObjectContainer; protected static var currentScreen:AbstractScreen; protected static var saveGame:SaveFile; protected static var levelData:XML; protected static var currentLevelIndex:int; protected static var currentLevelData:ByteArray; protected static var targetScreen:AbstractScreen; public static var isTransitioning:Boolean = false; protected static var playerLevelData:XML; public function AbstractScreen(){ if (!screens){ screens = new ScreenList(); }; this.alpha = 0; if (!currentScreen){ currentScreen = this; }; } public function transitionTo(_arg1:AbstractScreen):void{ if (isTransitioning){ return; }; targetScreen = _arg1; isTransitioning = true; fullTransition = true; if (currentScreen){ currentScreen.fadeOut(); } else { targetScreen.fadeIn(); }; } public function fadeIn():void{ if (!parent){ _parent.addChild(this); }; TweenLite.to(this, 0.25, {alpha:1, onComplete:fadeInComplete}); isTransitioning = true; } public function fadeOut():void{ TweenLite.to(this, 0.25, {alpha:0, onComplete:fadeOutComplete}); isTransitioning = true; } public function loadUserLevel(_arg1:Event=null):void{ if (!Protection.kongAPI.userLevelAvailable){ return; }; Protection.kongAPI.userLevelAvailable = false; var _local2:String = Protection.kongAPI.userLevelData.content; LevelEditorScreen(screens.LevelEditor).loadExternalLevel(_local2); } protected function fadeInComplete():void{ if (fullTransition){ currentScreen = targetScreen; } else { currentScreen = this; }; fullTransition = false; isTransitioning = false; targetScreen = null; dispatchEvent(new Event(COMPLETE, true)); } protected function fadeOutComplete():void{ if (parent){ parent.removeChild(this); }; if (fullTransition){ targetScreen.fadeIn(); } else { isTransitioning = false; dispatchEvent(new Event(COMPLETE, true)); }; } } }//package screen
Section 183
//CreditsScreen (screen.CreditsScreen) package screen { import fl.controls.*; import flash.display.*; import flash.events.*; import effects.*; public class CreditsScreen extends AbstractScreen { public var btn_Back:Button; public var creditScroll:MovieClip; var scrollMax:int; var flame:CreditFlame; public function CreditsScreen():void{ if (!screens.Credits){ screens.Credits = this; } else { throw (new Error("There can only be one credits screen.")); }; btn_Back.addEventListener(MouseEvent.CLICK, handleBack); creditScroll.btn_Kong.addEventListener(MouseEvent.CLICK, sponsor); __setProp_btn_Back_CreditsScreen_Layer3_0(); } override public function fadeIn():void{ super.fadeIn(); flame = new CreditFlame(558, 50); flame.x = -4; flame.y = 458; flame.smoothing = false; scrollMax = (-(creditScroll.height) + 250); creditScroll.y = 500; addChild(flame); addEventListener(Event.ENTER_FRAME, updateScreen); } function __setProp_btn_Back_CreditsScreen_Layer3_0(){ try { btn_Back["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Back.emphasized = false; btn_Back.enabled = true; btn_Back.label = "< Back"; btn_Back.labelPlacement = "right"; btn_Back.selected = false; btn_Back.toggle = false; btn_Back.visible = true; try { btn_Back["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function sponsor(_arg1:Event):void{ Protection.toSponsor(); } override protected function fadeOutComplete():void{ super.fadeOutComplete(); removeEventListener(Event.ENTER_FRAME, updateScreen); if (flame){ flame.dispose(); }; flame = null; } private function handleBack(_arg1:Event):void{ flame.running = false; transitionTo(screens.MainMenu); } function updateScreen(_arg1:Event):void{ if (creditScroll.y > scrollMax){ creditScroll.y = (creditScroll.y + -1); }; flame.update(); } } }//package screen
Section 184
//DamijinIntroScreen (screen.DamijinIntroScreen) package screen { import flash.display.*; import flash.events.*; public class DamijinIntroScreen extends AbstractScreen { public var btn_Skip:SimpleButton; public function DamijinIntroScreen():void{ addFrameScript(0, frame1, 159, frame160); super(); if (!screens.DamijinIntro){ screens.DamijinIntro = this; } else { throw (new Error("There can only be one damijin intro screen.")); }; btn_Skip.addEventListener(MouseEvent.CLICK, handleIntroSkip); btn_Skip.visible = Protection.skipable; x = (width / 2); y = (height / 2); } private function handleIntroSkip(_arg1:Event):void{ stop(); if (Protection.kongAPI.userLevelAvailable){ loadUserLevel(); } else { transitionTo(screens.MainMenu); }; } override protected function fadeInComplete():void{ super.fadeInComplete(); play(); } function frame1(){ stop(); } private function handleIntroComplete():void{ transitionTo(screens.GregIntro); } function frame160(){ handleIntroComplete(); } } }//package screen
Section 185
//FlameLoaderScreen (screen.FlameLoaderScreen) package screen { import flash.display.*; import game.*; import flash.events.*; import flash.text.*; import flash.net.*; import effects.*; public class FlameLoaderScreen extends AbstractScreen { private var delay:int; private var percent:Number; public var flameContainer:MovieClip; private var loader:URLLoader; private var playerLoader:URLLoader; public var txt_status:TextField; public var logo:Kong_Logo_Pyro; private var status:String;// = "main" private var currWidth:Number;// = 3 private var targetWidth:Number;// = 3 private var flame:Flame; public var play_hitArea:MovieClip; public function FlameLoaderScreen():void{ loader = new URLLoader(); playerLoader = new URLLoader(); super(); if (!screens.FlameLoader){ screens.FlameLoader = this; } else { throw (new Error("There can only be one flame loader screen.")); }; flame = new Flame(305, 45); flameContainer.addChild(flame); flame.x = -3; addEventListener(Event.ENTER_FRAME, update); logo.addEventListener(MouseEvent.CLICK, sponsor); this.alpha = 1; play_hitArea.alpha = 0; play_hitArea.mouseEnabled = false; play_hitArea.buttonMode = true; txt_status.mouseEnabled = false; logo.buttonMode = true; logo.mouseChildren = false; } private function update(_arg1:Event):void{ var _local2:LoaderInfo = root.loaderInfo; percent = (_local2.bytesLoaded / _local2.bytesTotal); targetWidth = ((percent * 302) + 3); if (currWidth < targetWidth){ if (Protection.debug){ currWidth = targetWidth; } else { currWidth = (currWidth + 1); }; }; if ((((currWidth > 302)) && ((percent == 1)))){ if (status == "main"){ txt_status.text = "Loading Levels Data..."; status = "xml"; loader.addEventListener(Event.COMPLETE, levelDataComplete); if ((((Protection.domain == "Kongregate")) || ((Protection.debug == true)))){ loader.load(new URLRequest("Levels.xml")); } else { loader.load(new URLRequest("http://games.mochiads.com/c/g/pyro-ii/Levels.xml")); }; playerLoader.addEventListener(Event.COMPLETE, playerLevelDataComplete); if ((((Protection.domain == "Kongregate")) || ((Protection.debug == true)))){ playerLoader.load(new URLRequest("PlayerLevels.xml")); } else { playerLoader.load(new URLRequest("http://games.mochiads.com/c/g/pyro-ii/PlayerLevels.xml")); }; } else { if (status == "complete"){ status = "done"; txt_status.text = "Play! >"; play_hitArea.mouseEnabled = true; play_hitArea.addEventListener(MouseEvent.CLICK, handlePlay); }; }; }; flame.update(currWidth); } private function handlePlay(_arg1:MouseEvent):void{ play_hitArea.removeEventListener(MouseEvent.CLICK, handlePlay); (parent as MovieClip).play(); } private function playerLevelDataComplete(_arg1:Event):void{ playerLoader.removeEventListener(Event.COMPLETE, playerLevelDataComplete); playerLevelData = XML(playerLoader.data); playerLoader = null; saveGame = SaveFile.instance; saveGame.mergePlayerData(playerLevelData); if (status == "xml"){ status = "playerLevel"; } else { status = "complete"; }; } override protected function fadeOutComplete():void{ removeEventListener(Event.ENTER_FRAME, update); logo.removeEventListener(MouseEvent.CLICK, sponsor); flame.dispose(); flame = null; super.fadeOutComplete(); } private function sponsor(_arg1:MouseEvent):void{ if (_arg1.target == logo){ Protection.toSponsor(); }; } private function saveDataComplete(_arg1:Event):void{ } private function levelDataComplete(_arg1:Event):void{ loader.removeEventListener(Event.COMPLETE, levelDataComplete); levelData = XML(loader.data); loader = null; saveGame = SaveFile.instance; saveGame.mergeData(levelData); if (status == "xml"){ status = "playerLevel"; } else { status = "complete"; }; } } }//package screen
Section 186
//GameLevelScreen (screen.GameLevelScreen) package screen { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import flash.geom.*; import Box2D.Dynamics.*; import fl.controls.*; import flash.display.*; import game.*; import Box2D.Collision.*; import flash.events.*; import flash.utils.*; import com.leveleditor.*; import flash.text.*; import flash.media.*; import effects.*; import flash.system.*; public class GameLevelScreen extends AbstractScreen { protected const SCALE:int = 60; protected var isPulling:Boolean; protected var crateSpreadTime:Number;// = 30 protected var fireballBouncinessBonus:Number;// = 0.84 protected var torchLit:int; public var acedScreen:MovieClip; protected var maxPrevLineLength:int; protected var bonuses:Array; protected var instructionOn:Boolean; protected var fireballRadius:uint;// = 9 public var background:MovieClip; protected var winReport:Boolean; private var tipHead:TextField; protected var fireball:b2Body; protected var winAimTime:int; protected var fireballRadiusBonus:Number;// = 6 protected var m_world:b2World; protected var m_iterations:int;// = 10 protected var fireballStopDeathTime:int;// = 500 private var btn_Guide:Button; protected var soundOn:Boolean; protected var previewLineLengthBonus:uint;// = 25 protected var winFrameTime:int; private var tipContent:TextField; public var ballSpawner:SpawnerEditor; protected var waitingForCrates:Boolean; protected var winTimeStarted:Boolean; protected var fireballView:Fireball; protected var dragHandle:DragHandle; protected var previewBody:b2Body; protected var longLine:Boolean;// = false protected var isDragging:Boolean; protected var won:Boolean; protected var previewContainer:Sprite; protected var burningCrates:int; protected var crateBurnOutTime:Number;// = 300 public var looseScreen:MovieClip; protected var oldTime:int; protected var previewLine_LongLine:uint;// = 100 private var tip:MovieClip; private var footer:TextField; protected var oY:Number;// = 0 protected var m_timeStep:Number;// = 0.025 protected var alive:Boolean; protected var oX:Number;// = 0 protected var torchNeeded:int; protected var dragArea:Rectangle; protected var previewLineLength:uint;// = 15 protected var simulating:Boolean; protected var torchNum:int; protected var winTimer:Timer; protected var stopTime:int; protected var fireballDensity:Number;// = 1 protected var lifes:int; protected var fireballBounciness:Number;// = 0.7 protected var contactListener:ContactListener; public var shotTaken:int; protected var fires:Array; public var hud:MovieClip; public static const ACED:String = "aced"; protected static const KB_Q:int = 81; public static const QUIT:String = "quit"; public static const DEATH:String = "death"; protected static const KB_A:int = 65; protected static const KB_I:int = 73; protected static const KB_ESCAPE:int = 27; protected static const KB_R:int = 82; protected static const KB_S:int = 83; public static const RESET:String = "reset"; public static const WIN:String = "win"; public static const LOOSE:String = "gameOver"; protected static const TIPS:Array = ["Click and drag the fireball to set its angle and power.\n\nAim for the tops of torches, and release the mouse button to fire.", "Unlike bricks, crates can be lit on fire.\n\nCrates can also ignite other nearby crates and torches.", "Completing a level in only one shot is called an ace.\n\nAll 50 official levels of Pyro II can be aced.", "A bonus level is unlocked for every 5 official levels that are aced.", "Having trouble acing this level?\n\nThe complete ace guide by Mr. Rubix may help!"]; public function GameLevelScreen():void{ var _local5:BitmapData; super(); if (screens.GameLevel){ oldGameScreen = GameLevelScreen(screens.GameLevel); }; screens.GameLevel = this; var _local1:SoundTransform = SoundMixer.soundTransform; hud.label_life.text = "Lives:"; hud.label_torch.text = "Torch needed:"; hud.btn_Restart.label = "Restart"; hud.btn_Suicide.label = "Suicide"; hud.btn_Mute.label = ((_local1.volume == 1)) ? "Mute" : "Unmute"; hud.btn_StopPreview.label = "Stop Preview"; hud.btn_Sponsor.tabEnabled = false; tip = hud.tip; btn_Guide = hud.tip.btn_Guide; tipHead = hud.tip.txt_Head; tipContent = hud.tip.txt_Content; footer = hud.tip.txt_Footer; hud.removeChild(tip); var _local2:Font = new TinyBoxFont(); var _local3:TextFormat = new TextFormat(); _local3.font = _local2.fontName; _local3.color = 0xFFFFFF; _local3.size = 16; looseScreen.btn_Retry.setStyle("textFormat", _local3); looseScreen.btn_LevelSelect.setStyle("textFormat", _local3); _local3 = new TextFormat(); _local3.font = _local2.fontName; _local3.color = 0xFFFFFF; _local3.size = 12; looseScreen.btn_Sponsor.setStyle("textFormat", _local3); looseScreen.btn_Browse.setStyle("textFormat", _local3); looseScreen.btn_Retry.setStyle("embedFonts", true); looseScreen.btn_LevelSelect.setStyle("embedFonts", true); looseScreen.btn_Sponsor.setStyle("embedFonts", true); looseScreen.btn_Browse.setStyle("embedFonts", true); looseScreen.visible = false; acedScreen.stop(); acedScreen.visible = false; acedScreen.unlockBackground.visible = false; acedScreen.unlockText.visible = false; removeChild(acedScreen); previewContainer = new Sprite(); burningCrates = 0; soundOn = true; instructionOn = true; alive = true; waitingForCrates = false; winReport = false; winTimeStarted = false; maxPrevLineLength = previewLineLength; bonuses = new Array(); var _local4:BitmapData = new BitmapData(400, 500, false, 0); var _local6:Sprite = new Sprite(); _local6.graphics.beginBitmapFill(new BrickBitmap(20, 20)); _local6.graphics.drawRect(0, 0, 400, 500); _local6.graphics.endFill(); _local5 = new BitmapData(400, 500, false, 0); _local5.draw(_local6); _local4.noise((Math.random() * int.MAX_VALUE), 0, 10, 7, true); _local5.draw(_local4, null, null, "add"); background.brick.overlay.graphics.beginBitmapFill(_local5); background.brick.overlay.graphics.drawRect(0, 0, 400, 500); background.brick.overlay.graphics.endFill(); _local6.graphics.clear(); _local6.graphics.beginBitmapFill(new MetalBitmap(13, 16)); _local6.graphics.drawRect(0, 0, 400, 500); _local6.graphics.endFill(); _local5 = new BitmapData(400, 500, false, 0); _local5.draw(_local6); _local4.noise((Math.random() * int.MAX_VALUE), 0, 10, 7, true); _local5.draw(_local4, null, null, "add"); background.metal.overlay.graphics.beginBitmapFill(_local5); background.metal.overlay.graphics.drawRect(0, 0, 400, 500); background.metal.overlay.graphics.endFill(); _local4.dispose(); background.glass.overlay.graphics.beginFill(1060992); background.glass.overlay.graphics.drawRect(0, 0, 400, 500); background.glass.overlay.graphics.endFill(); background.glass.alpha = 0.5; } protected function handleSuicide(_arg1:MouseEvent):void{ if (waitingForCrates){ waitingForCrates = false; burningCrates = 0; }; if (lifes == 1){ waitingForCrates = false; burningCrates = 0; }; handleReset(); } public function get winTime():int{ var _local1:int = int((winFrameTime / 40)); _local1 = (_local1 + ((winFrameTime - (_local1 * 40)) / 40)); _local1 = int((_local1 * 1000)); return ((_local1 + winAimTime)); } public function handleReset(_arg1:String="death"):void{ var _local2:b2CircleShape; simulating = false; switch (_arg1){ case DEATH: if (won){ fireball.PutToSleep(); previewBody.PutToSleep(); alive = false; simulating = false; return; }; lifes--; if (lifes < 1){ lifes = 0; hud.lifeText.text = ("x" + lifes); alive = false; fireball.PutToSleep(); previewBody.PutToSleep(); if (burningCrates < 1){ fireballView.stopSound(); Burnable.stopSound(); looseScreen.visible = true; dispatchEvent(new Event(LOOSE, true, false)); } else { waitingForCrates = true; }; return; }; hud.lifeText.text = ("x" + lifes); oldTime = getTimer(); break; case WIN: if (fireball){ fireball.PutToSleep(); }; if (previewBody){ previewBody.PutToSleep(); }; if (fireballView){ fireballView.stopSound(); }; simulating = false; Burnable.stopSound(); if (!winReport){ winReport = true; dispatchEvent(new Event(WIN, true, false)); }; alive = false; return; case RESET: break; case QUIT: if (fireball){ fireball.PutToSleep(); }; if (previewBody){ previewBody.PutToSleep(); }; if (fireballView){ fireballView.stopSound(); }; simulating = false; Burnable.stopSound(); dispatchEvent(new Event(QUIT, true, false)); alive = false; return; }; maxPrevLineLength = previewLineLength; _local2 = b2CircleShape(fireball.m_shapeList); _local2.m_radius = (fireballRadius / SCALE); _local2.m_restitution = fireballBounciness; _local2 = b2CircleShape(previewBody.m_shapeList); _local2.m_radius = (fireballRadius / SCALE); _local2.m_restitution = fireballBounciness; fireballView.scale(1); fireballView.switchPalette(new FlamePalette()); var _local3:int = bonuses.length; var _local4:int; while (_local4 < _local3) { bonuses[_local4].call(this); _local4++; }; bonuses.length = 0; oX = ballSpawner.x; oY = ballSpawner.y; fireball.SetXForm(new b2Vec2((ballSpawner.x / SCALE), (ballSpawner.y / SCALE)), 0); fireball.SetLinearVelocity(new b2Vec2(0, 0)); fireball.SetAngularVelocity(0); fireball.PutToSleep(); previewBody.PutToSleep(); } public function init(_arg1:ByteArray, _arg2:String="", _arg3:Boolean=false, _arg4:Boolean=false):void{ longLine = _arg4; _arg1.position = 0; hud.txt_levelName.text = _arg1.readUTF(); if (_arg2 != ""){ hud.txt_levelName.text = _arg2; }; lifes = _arg1.readUnsignedByte(); torchNeeded = _arg1.readUnsignedByte(); ballSpawner.x = _arg1.readUnsignedShort(); ballSpawner.y = _arg1.readUnsignedShort(); ballSpawner.spawnHitArea.visible = false; hud.percentText.text = ("0/" + torchNeeded); hud.lifeText.text = ("x" + lifes); if (_arg3){ hud.btn_StopPreview.label = "Stop Preview"; looseScreen.btn_LevelSelect.label = "Stop Preview"; } else { hud.btn_StopPreview.label = "Level Select"; hud.btn_Browse.visible = false; looseScreen.btn_Browse.visible = false; }; fireballView = new Fireball(); isDragging = false; dragHandle = new DragHandle(); addChild(dragHandle); dragHandle.visible = false; simulating = false; torchNum = 0; torchLit = 0; var _local5:b2AABB = new b2AABB(); var _local6:b2Vec2 = new b2Vec2(0, 10); var _local7:Boolean; _local5.lowerBound.Set(-100, -100); _local5.upperBound.Set(100, 100); m_world = new b2World(_local5, _local6, _local7); var _local8:ContactListener = new ContactListener(this); m_world.SetContactListener(_local8); createObjects(_arg1); addChildAt(fireballView, 0); this.visible = true; winFrameTime = 0; winAimTime = 0; winTimeStarted = false; addEventListener(Event.ENTER_FRAME, Update, false, 0, true); addEventListener(Event.REMOVED_FROM_STAGE, dispose); } public function dispose(_arg1:Event=null):void{ var _local2:b2Body; removeEventListener(Event.ENTER_FRAME, Update); removeEventListener(Event.REMOVED_FROM_STAGE, dispose); if (parent){ if (stage){ stage.removeEventListener(KeyboardEvent.KEY_UP, handleKeyboard); stage.removeEventListener(MouseEvent.MOUSE_UP, handleStopDrag); stage.removeEventListener(MouseEvent.MOUSE_DOWN, handleStartDrag); }; if (!_arg1){ parent.removeChild(this); }; btn_Guide.removeEventListener(MouseEvent.MOUSE_UP, handleGuide); hud.btn_Restart.removeEventListener(MouseEvent.MOUSE_UP, handleRestart); hud.btn_Suicide.removeEventListener(MouseEvent.MOUSE_UP, handleSuicide); hud.btn_Mute.removeEventListener(MouseEvent.MOUSE_UP, handleMute); hud.btn_StopPreview.removeEventListener(MouseEvent.MOUSE_UP, handleQuit); hud.btn_Sponsor.removeEventListener(MouseEvent.CLICK, sponsor); hud.btn_Browse.removeEventListener(MouseEvent.CLICK, browseLevel); looseScreen.btn_Retry.removeEventListener(MouseEvent.CLICK, handleRestart); looseScreen.btn_LevelSelect.removeEventListener(MouseEvent.CLICK, handleQuit); looseScreen.btn_Sponsor.removeEventListener(MouseEvent.CLICK, sponsor); looseScreen.btn_Browse.removeEventListener(MouseEvent.CLICK, browseLevel); }; if (fires){ while (fires.length) { fires[0].dispose(); }; }; if (m_world){ _local2 = m_world.GetBodyList(); m_world.DestroyBody(_local2); m_world = null; }; if (fireballView){ removeChild(fireballView); fireballView.dispose(); }; fireballView = null; previewContainer = null; fires = null; fireball = null; previewBody = null; contactListener = null; Burnable.stopSound(); System.gc(); } protected function handleKeyboard(_arg1:KeyboardEvent):void{ switch (_arg1.keyCode){ case KB_ESCAPE: if (!isPulling){ return; }; stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleDrag); isPulling = false; dragHandle.visible = false; removeChild(previewContainer); break; case KB_I: break; case KB_S: handleSuicide(null); break; case KB_R: handleRestart(); break; case KB_Q: handleQuit(); break; case KB_A: if (!Protection.debug){ return; }; shotTaken = 1; won = true; if (!winTimer){ winTimer = new Timer(1000, 1); winTimer.addEventListener(TimerEvent.TIMER, handleWin); winTimer.start(); }; break; }; } public function set tipIndex(_arg1:int):void{ if (_arg1 > 4){ _arg1 = 4; }; if (_arg1 < 4){ btn_Guide.visible = false; footer.visible = false; }; tipHead.text = (("TIP #" + (_arg1 + 1)) + ":"); tipContent.text = TIPS[_arg1]; hud.addChild(tip); } public function previewBonus():void{ lifes++; hud.lifeText.text = ("x" + lifes); bonuses.push(applyPreviewBonus); } private function browseLevel(_arg1:MouseEvent):void{ if (Protection.domain == "Kongregate"){ Protection.kongAPI.sharedContent.browse("Level"); } else { Protection.toLevelSharing(); }; } public function applyBounceBonus():void{ var _local1:b2Shape; _local1 = fireball.m_shapeList; _local1.m_restitution = fireballBouncinessBonus; _local1 = previewBody.m_shapeList; _local1.m_restitution = fireballBouncinessBonus; fireballView.switchPalette(new GreenFlamePalette()); } private function sponsor(_arg1:MouseEvent):void{ Protection.toSponsor(); } override protected function fadeInComplete():void{ btn_Guide.addEventListener(MouseEvent.MOUSE_UP, handleGuide); hud.btn_Restart.addEventListener(MouseEvent.MOUSE_UP, handleRestart); hud.btn_Suicide.addEventListener(MouseEvent.MOUSE_UP, handleSuicide); hud.btn_Mute.addEventListener(MouseEvent.MOUSE_UP, handleMute); hud.btn_StopPreview.addEventListener(MouseEvent.MOUSE_UP, handleQuit); hud.btn_Sponsor.addEventListener(MouseEvent.CLICK, sponsor); hud.btn_Browse.addEventListener(MouseEvent.CLICK, browseLevel); looseScreen.btn_Retry.addEventListener(MouseEvent.CLICK, handleRestart); looseScreen.btn_LevelSelect.addEventListener(MouseEvent.CLICK, handleQuit); looseScreen.btn_Sponsor.addEventListener(MouseEvent.CLICK, sponsor); looseScreen.btn_Browse.addEventListener(MouseEvent.CLICK, browseLevel); stage.addEventListener(KeyboardEvent.KEY_UP, handleKeyboard); stage.addEventListener(MouseEvent.MOUSE_UP, handleStopDrag); stage.addEventListener(MouseEvent.MOUSE_DOWN, handleStartDrag); if (oldGameScreen){ oldGameScreen.dispose(); oldGameScreen = null; }; super.fadeInComplete(); } protected function handleMute(_arg1:MouseEvent):void{ var _local2:SoundTransform = SoundMixer.soundTransform; _local2.volume = ((_local2.volume == 1)) ? 0 : 1; hud.btn_Mute.label = ((_local2.volume == 1)) ? "Mute" : "Unmute"; SoundMixer.soundTransform = _local2; } public function reportBurnStart():void{ burningCrates++; } protected function handleStartDrag(_arg1:MouseEvent):void{ if (((simulating) || (!(alive)))){ return; }; if (_arg1.stageX > 400){ return; }; if (!winTimeStarted){ winTimeStarted = true; oldTime = getTimer(); }; isPulling = true; dragHandle.gauge.scaleX = 0.01; dragHandle.x = ballSpawner.x; dragHandle.y = ballSpawner.y; var _local2:int = (mouseX - dragHandle.x); var _local3:int = (mouseY - dragHandle.y); dragHandle.rotation = Math.atan2(_local2, _local3); dragHandle.visible = true; previewContainer.graphics.clear(); addChild(previewContainer); stage.addEventListener(MouseEvent.MOUSE_MOVE, handleDrag); } public function bounceBonus():void{ lifes++; hud.lifeText.text = ("x" + lifes); bonuses.push(applyBounceBonus); } protected function createObjects(_arg1:ByteArray):void{ var _local2:b2Body; var _local3:b2BodyDef; var _local4:b2PolygonDef; var _local5:b2CircleDef; var _local6:DisplayObject; var _local7:Number; var _local8:Number; var _local9:TorchBase; var _local10:Rectangle; var _local11:Crate; var _local12:PowerUpBase; var _local21:Rectangle; var _local22:Rectangle; var _local25:Array; var _local26:Number; var _local27:Number; var _local29:int; var _local30:int; var _local31:int; var _local32:int; var _local33:int; var _local34:EditableObject; var _local35:int; var _local36:int; var _local13:Array = new Array(); var _local14:Array = new Array(); var _local15:Array = new Array(); fires = new Array(); _local3 = new b2BodyDef(); _local3.position.x = (ballSpawner.x / SCALE); _local3.position.y = (ballSpawner.y / SCALE); _local7 = (fireballRadius / SCALE); _local3.scale = SCALE; oX = ballSpawner.x; oY = ballSpawner.y; _local5 = new b2CircleDef(); _local5.radius = _local7; _local5.density = fireballDensity; _local5.friction = 0; _local5.restitution = fireballBounciness; _local3.isBullet = true; _local2 = m_world.CreateBody(_local3); _local5.filter.categoryBits = 2; _local5.filter.maskBits = 3; _local2.CreateShape(_local5); _local2.SetMassFromShapes(); _local2.PutToSleep(); fireball = _local2; _local3.userData = new DummyBody(); _local3.isBullet = true; _local2 = m_world.CreateBody(_local3); _local5.filter.categoryBits = 4; _local5.filter.maskBits = 5; _local2.CreateShape(_local5); _local2.SetMassFromShapes(); _local2.PutToSleep(); previewBody = _local2; createRectBox(200, -90, 400, 20); createRectBox(0, 220, 20, 600); createRectBox(400, 220, 20, 600); createRectBox(40, 500, 20, 20); createRectBox(80, 500, 20, 20); createRectBox(120, 500, 20, 20); createRectBox(160, 500, 20, 20); createRectBox(200, 500, 20, 20); createRectBox(240, 500, 20, 20); createRectBox(280, 500, 20, 20); createRectBox(320, 500, 20, 20); createRectBox(360, 500, 20, 20); var _local16:int = _arg1.readUnsignedShort(); var _local17:int; while (_local17 < _local16) { _local29 = _arg1.readUnsignedByte(); if (_local29 == 0){ _local30 = _arg1.readUnsignedShort(); _local31 = _arg1.readUnsignedShort(); _local32 = _arg1.readUnsignedShort(); _local33 = _arg1.readUnsignedShort(); _local34 = new EditableRectangle(_local30, _local31, _local32, _local33); _local34.matId = _arg1.readUnsignedByte(); switch (_local34.matId){ case 0: background.brick._mask.addChild(_local34.overlay); break; case 1: background.metal._mask.addChild(_local34.overlay); break; case 2: background.glass._mask.addChild(_local34.overlay); break; }; _local13.push(_local34); createRectBox(_local30, _local31, _local32, _local33, _local34.matId); } else { if (_local29 == 1){ _local30 = _arg1.readUnsignedShort(); _local31 = _arg1.readUnsignedShort(); _local35 = _arg1.readUnsignedShort(); _local34 = new EditableCircle(_local30, _local31, _local35); _local34.matId = _arg1.readUnsignedByte(); switch (_local34.matId){ case 0: background.brick._mask.addChild(_local34.overlay); break; case 1: background.metal._mask.addChild(_local34.overlay); break; case 2: background.glass._mask.addChild(_local34.overlay); break; }; _local13.push(_local34); _local3 = new b2BodyDef(); _local3.position.x = (_local30 / SCALE); _local3.position.y = (_local31 / SCALE); _local7 = (_local35 / SCALE); _local3.scale = SCALE; _local5 = new b2CircleDef(); _local5.radius = _local7; assignMat(_local34.matId, _local5, _local3); _local2 = m_world.CreateBody(_local3); _local5.filter.categoryBits = 1; _local5.filter.maskBits = 7; _local2.CreateShape(_local5); }; }; _local17++; }; removeChild(ballSpawner); var _local18:BitmapData = new BitmapData(400, 500, true, 0); _local18.draw(background); var _local19:Bitmap = new Bitmap(_local18); removeChild(background); addChildAt(_local19, 0); _local17 = 0; while (_local17 < _local16) { _local13[_local17].dispose(); _local17++; }; _local13.length = 0; var _local20:int = getChildIndex(looseScreen); _local16 = _arg1.readUnsignedShort(); _local17 = 0; while (_local17 < _local16) { _local30 = _arg1.readUnsignedShort(); _local31 = _arg1.readUnsignedShort(); _local6 = new Crate(); _local6.x = _local30; _local6.y = _local31; addChildAt(_local6, _local20); _local20++; fires.push(_local6); _local15.push(_local6); _local3 = new b2BodyDef(); _local3.position.x = (_local6.x / SCALE); _local3.position.y = (_local6.y / SCALE); _local7 = (_local6.width / (SCALE * 2)); _local8 = (_local6.height / (SCALE * 2)); _local3.scale = SCALE; _local4 = new b2PolygonDef(); _local4.SetAsBox(_local7, _local8); _local4.friction = 0; _local4.restitution = 0.6; _local4.isSensor = false; _local3.userData = _local6; _local2 = m_world.CreateBody(_local3); _local11 = Crate(_local6); _local11.blockBody = _local2; _local11.spreadTime = crateSpreadTime; _local11.burnTime = crateBurnOutTime; _local11.initSpark(this); _local11.init(CrateBitmap, CrateBurnBitmap); _local4.filter.categoryBits = 1; _local4.filter.maskBits = 7; _local2.CreateShape(_local4); _local2.SetMassFromShapes(); _local17++; }; _local16 = _arg1.readUnsignedShort(); _local17 = 0; while (_local17 < _local16) { _local29 = _arg1.readUnsignedByte(); _local30 = _arg1.readUnsignedShort(); _local31 = _arg1.readUnsignedShort(); if (_local29 == 0){ _local6 = new LTorch(); } else { if (_local29 == 1){ _local6 = new RTorch(); } else { _local6 = new Torch(); }; }; _local6.x = _local30; _local6.y = _local31; addChildAt(_local6, _local20); _local20++; _local9 = TorchBase(_local6); _local10 = _local9.torchHitArea.getBounds(this); fires.push(_local6); _local14.push(_local9); _local9.torchHitArea.visible = false; _local9.initSpark(this); torchNum++; _local3 = new b2BodyDef(); _local7 = (_local10.width / (SCALE * 2)); _local8 = (_local10.height / (SCALE * 2)); _local3.position.x = ((_local10.x / SCALE) + _local7); _local3.position.y = ((_local10.y / SCALE) + _local8); _local3.scale = SCALE; _local4 = new b2PolygonDef(); _local4.SetAsBox(_local7, _local8); _local4.isSensor = true; _local3.userData = _local6; _local2 = m_world.CreateBody(_local3); _local2.CreateShape(_local4); _local17++; }; _local16 = _arg1.readUnsignedShort(); _local17 = 0; while (_local17 < _local16) { _local29 = _arg1.readUnsignedByte(); _local30 = _arg1.readUnsignedShort(); _local31 = _arg1.readUnsignedShort(); if (_local29 == 0){ _local6 = new PlusOnePowerUp(); } else { if (_local29 == 1){ _local6 = new BounceUpPowerUp(); } else { if (_local29 == 2){ _local6 = new LongLinePowerUp(); } else { _local6 = new HalfSizePowerUp(); }; }; }; _local6.x = _local30; _local6.y = _local31; fires.push(_local6); _local3 = new b2BodyDef(); _local3.position.x = (_local6.x / SCALE); _local3.position.y = (_local6.y / SCALE); _local7 = (18 / (SCALE * 2)); _local3.scale = SCALE; _local5 = new b2CircleDef(); _local5.radius = _local7; _local5.isSensor = true; _local3.userData = _local6; _local2 = m_world.CreateBody(_local3); _local2.CreateShape(_local5); _local2.SetMassFromShapes(); _local12 = PowerUpBase(_local6); PowerUpBase.depth = _local20; _local12.initSpark(this); _local20++; _local17++; }; Burnable.depth = _local20; var _local23:int = _local14.length; var _local24:int = _local15.length; var _local28:Point = new Point(); _local17 = 0; while (_local17 < _local24) { _local11 = _local15[_local17]; _local21 = _local11.bound; _local36 = 0; while (_local36 < _local23) { _local9 = _local14[_local36]; _local22 = _local9.torchHitArea.getBounds(this); if (_local21.intersects(_local22)){ _local11.addNeighbour(_local9); }; _local36++; }; _local26 = _local11.x; _local27 = _local11.y; _local36 = 0; while (_local36 < _local24) { if (_local15[_local36] == _local11){ } else { _local22 = _local15[_local36].bound; if (_local21.intersects(_local22)){ _local11.addNeighbour(_local15[_local36]); }; }; _local36++; }; _local17++; }; _local15.length = 0; _local14.length = 0; _local15 = null; _local14 = null; } protected function handleDrag(_arg1:MouseEvent):void{ var _local2:int; var _local3:int; var _local4:Number; var _local5:Number; var _local6:Point; var _local7:int; var _local8:b2Vec2; if (isPulling){ _local2 = (mouseX - dragHandle.x); _local3 = (mouseY - dragHandle.y); _local4 = Math.atan2(_local3, _local2); _local5 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3))); _local5 = Math.min(69.6, _local5); _local5 = Math.max(0.1, _local5); _local5 = (_local5 / 69.6); dragHandle.rotation = (_local4 * (180 / Math.PI)); dragHandle.gauge.scaleX = _local5; _local5 = (_local5 * 13); _local6 = Point.polar(_local5, _local4); previewBody.SetXForm(new b2Vec2((ballSpawner.x / SCALE), (ballSpawner.y / SCALE)), 0); previewBody.SetAngularVelocity(0); previewBody.SetLinearVelocity(new b2Vec2(_local6.x, _local6.y)); previewBody.WakeUp(); fireball.PutToSleep(); previewContainer.graphics.clear(); previewContainer.graphics.lineStyle(1, 0xFFFFFF); previewContainer.graphics.moveTo(ballSpawner.x, ballSpawner.y); if (longLine){ maxPrevLineLength = previewLine_LongLine; }; _local7 = 0; while (_local7 < maxPrevLineLength) { m_world.Step(m_timeStep, m_iterations); _local8 = previewBody.GetPosition(); previewContainer.graphics.lineTo((_local8.x * SCALE), (_local8.y * SCALE)); if ((_local8.y * SCALE) > 600){ break; }; _local7++; }; previewBody.PutToSleep(); }; } public function playAced(_arg1:int):void{ acedScreen.addEventListener(Event.COMPLETE, handleAceComplete); acedScreen.visible = true; addChild(acedScreen); if (_arg1 > 0){ acedScreen.unlockText.text.text = (((((((("Secret level " + _arg1) + "! - Secret level ") + _arg1) + "! - Secret level ") + _arg1) + "! - Secret level ") + _arg1) + "! -"); acedScreen.unlockBackground.visible = true; acedScreen.unlockText.visible = true; }; acedScreen.play(); } protected function handleQuit(_arg1:Event=null):void{ waitingForCrates = false; burningCrates = 0; handleReset(QUIT); } protected function handleStopDrag(_arg1:MouseEvent):void{ var _local2:int; var _local3:int; var _local4:Number; var _local5:Number; var _local6:Point; if (isPulling){ stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleDrag); winAimTime = (winAimTime + (getTimer() - oldTime)); isPulling = false; shotTaken++; dragHandle.visible = false; _local2 = (mouseX - dragHandle.x); _local3 = (mouseY - dragHandle.y); _local4 = Math.atan2(_local3, _local2); _local5 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3))); _local5 = Math.min(69.6, _local5); _local5 = Math.max(0.1, _local5); _local5 = ((_local5 / 69.6) * 13); _local6 = Point.polar(_local5, _local4); removeChild(previewContainer); fireball.WakeUp(); fireball.SetLinearVelocity(new b2Vec2(_local6.x, _local6.y)); simulating = true; }; } protected function createRectBox(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int=0):void{ var _local6:b2Body; var _local7:b2BodyDef; var _local8:b2PolygonDef; var _local9:Number; var _local10:Number; _local7 = new b2BodyDef(); _local7.position.x = (_arg1 / SCALE); _local7.position.y = (_arg2 / SCALE); _local9 = (_arg3 / (SCALE * 2)); _local10 = (_arg4 / (SCALE * 2)); _local7.scale = SCALE; _local8 = new b2PolygonDef(); _local8.SetAsBox(_local9, _local10); assignMat(_arg5, _local8, _local7); _local6 = m_world.CreateBody(_local7); _local8.filter.categoryBits = 1; _local8.filter.maskBits = 7; _local6.CreateShape(_local8); } public function lifeBonus():void{ lifes++; hud.lifeText.text = ("x" + lifes); } public function halfSizeBonus():void{ lifes++; hud.lifeText.text = ("x" + lifes); bonuses.push(applyHalfSizeBonus); } private function handleGuide(_arg1:MouseEvent):void{ Protection.toGuide(); } protected function handleWin(_arg1:TimerEvent):void{ if (winTimer){ winTimer.removeEventListener(TimerEvent.TIMER, handleWin); winTimer.stop(); winTimer = null; }; handleReset(WIN); } public function score():void{ torchLit = (((torchLit >> 2) + 1) << 2); hud.percentText.text = (((torchLit >> 2) + "/") + torchNeeded); } protected function handleAceComplete(_arg1:Event):void{ acedScreen.removeEventListener(Event.COMPLETE, handleAceComplete); dispatchEvent(new Event(ACED, true, false)); } public function reportBurnStop():void{ burningCrates--; } protected function handleRestart(_arg1:Event=null):void{ dispatchEvent(new Event(RESET, true, false)); } protected function applyPreviewBonus():void{ maxPrevLineLength = previewLineLengthBonus; fireballView.switchPalette(new RedFlamePalette()); } public function applyHalfSizeBonus():void{ var _local1:b2CircleShape = b2CircleShape(fireball.m_shapeList); _local1.m_radius = (fireballRadiusBonus / SCALE); _local1 = b2CircleShape(previewBody.m_shapeList); _local1.m_radius = (fireballRadiusBonus / SCALE); fireballView.scale((fireballRadiusBonus / fireballRadius)); fireballView.switchPalette(new BlueFlamePalette()); } protected function Update(_arg1:Event):void{ if (simulating){ previewBody.PutToSleep(); m_world.Step(m_timeStep, m_iterations); if (!won){ winFrameTime++; }; }; var _local2:Matrix = fireball.GetTransform(); var _local3:Number = _local2.tx; var _local4:Number = _local2.ty; var _local5:Number = (_local3 - oX); var _local6:Number = (_local4 - oY); oX = _local3; oY = _local4; var _local7:Number = Math.sqrt(((_local5 * _local5) + (_local6 * _local6))); fireballView.update(_local2, _local7); var _local8:int = fires.length; var _local9:int = getTimer(); var _local10:int = (_local8 - 1); while (_local10 > -1) { fires[_local10].drawSpark(_local9); _local10--; }; if (((!(_local7)) && (simulating))){ stopTime++; if (stopTime > fireballStopDeathTime){ handleReset(); return; }; } else { stopTime = 0; }; if ((((((((((oY < -500)) || ((oY > 600)))) || ((oX < -100)))) || ((oX > 500)))) && (alive))){ handleReset(); return; }; if (((((!(alive)) && (waitingForCrates))) && ((burningCrates < 1)))){ handleReset(); return; }; if ((torchLit >> 2) >= torchNeeded){ won = true; if (!winTimer){ winTimer = new Timer(1000, 1); winTimer.addEventListener(TimerEvent.TIMER, handleWin); winTimer.start(); }; }; } protected function assignMat(_arg1:int, _arg2:b2ShapeDef, _arg3:b2BodyDef):void{ switch (_arg1){ case 0: _arg2.friction = 0.25; _arg2.restitution = 0.7; break; case 1: _arg2.friction = 0.15; _arg2.restitution = 0.8; break; case 2: _arg2.friction = 0.5; _arg2.restitution = 0.75; break; }; _arg3.userData = new Block(_arg1); } public function removeFire(_arg1:IFireEmitter):void{ var _local2:int; _local2 = fires.indexOf(_arg1); fires.splice(_local2, 1); } } }//package screen
Section 187
//GameLevelSnapshot (screen.GameLevelSnapshot) package screen { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import flash.geom.*; import Box2D.Dynamics.*; import flash.display.*; import game.*; import Box2D.Collision.*; import flash.events.*; import flash.utils.*; import com.leveleditor.*; import flash.media.*; import effects.*; import flash.system.*; public class GameLevelSnapshot extends Sprite { public var ballSpawner:PlayerSnap; public var background:MovieClip; public function GameLevelSnapshot():void{ var _local2:BitmapData; super(); var _local1:BitmapData = new BitmapData(400, 500, false, 0); var _local3:Sprite = new Sprite(); _local3.graphics.beginBitmapFill(new BrickBitmap(20, 20)); _local3.graphics.drawRect(0, 0, 400, 500); _local3.graphics.endFill(); _local2 = new BitmapData(400, 500, false, 0); _local2.draw(_local3); _local1.noise((Math.random() * int.MAX_VALUE), 0, 10, 7, true); _local2.draw(_local1, null, null, "add"); background.brick.overlay.graphics.beginBitmapFill(_local2); background.brick.overlay.graphics.drawRect(0, 0, 400, 500); background.brick.overlay.graphics.endFill(); _local3.graphics.clear(); _local3.graphics.beginBitmapFill(new MetalBitmap(13, 16)); _local3.graphics.drawRect(0, 0, 400, 500); _local3.graphics.endFill(); _local2 = new BitmapData(400, 500, false, 0); _local2.draw(_local3); _local1.noise((Math.random() * int.MAX_VALUE), 0, 10, 7, true); _local2.draw(_local1, null, null, "add"); background.metal.overlay.graphics.beginBitmapFill(_local2); background.metal.overlay.graphics.drawRect(0, 0, 400, 500); background.metal.overlay.graphics.endFill(); _local1.dispose(); _local2.dispose(); background.glass.overlay.graphics.beginFill(1060992); background.glass.overlay.graphics.drawRect(0, 0, 400, 500); background.glass.overlay.graphics.endFill(); background.glass.alpha = 0.5; } public function draw(_arg1:ByteArray):void{ _arg1.position = 0; _arg1.readUTF(); _arg1.readUnsignedByte(); _arg1.readUnsignedByte(); ballSpawner.x = _arg1.readUnsignedShort(); ballSpawner.y = _arg1.readUnsignedShort(); createObjects(_arg1); } protected function createObjects(_arg1:ByteArray):void{ var _local2:DisplayObject; var _local3:Number; var _local4:Number; var _local5:TorchBase; var _local6:Rectangle; var _local7:Crate; var _local8:PowerUpBase; var _local12:int; var _local13:int; var _local14:int; var _local15:int; var _local16:int; var _local17:EditableObject; var _local18:int; var _local9:Array = new Array(); var _local10:int = _arg1.readUnsignedShort(); var _local11:int; while (_local11 < _local10) { _local12 = _arg1.readUnsignedByte(); if (_local12 == 0){ _local13 = _arg1.readUnsignedShort(); _local14 = _arg1.readUnsignedShort(); _local15 = _arg1.readUnsignedShort(); _local16 = _arg1.readUnsignedShort(); _local17 = new EditableRectangle(_local13, _local14, _local15, _local16); _local17.matId = _arg1.readUnsignedByte(); switch (_local17.matId){ case 0: background.brick._mask.addChild(_local17.overlay); break; case 1: background.metal._mask.addChild(_local17.overlay); break; case 2: background.glass._mask.addChild(_local17.overlay); break; }; _local9.push(_local17); } else { if (_local12 == 1){ _local13 = _arg1.readUnsignedShort(); _local14 = _arg1.readUnsignedShort(); _local18 = _arg1.readUnsignedShort(); _local17 = new EditableCircle(_local13, _local14, _local18); _local17.matId = _arg1.readUnsignedByte(); switch (_local17.matId){ case 0: background.brick._mask.addChild(_local17.overlay); break; case 1: background.metal._mask.addChild(_local17.overlay); break; case 2: background.glass._mask.addChild(_local17.overlay); break; }; _local9.push(_local17); }; }; _local11++; }; _local10 = _arg1.readUnsignedShort(); _local11 = 0; while (_local11 < _local10) { _local13 = _arg1.readUnsignedShort(); _local14 = _arg1.readUnsignedShort(); _local2 = new Crate(); _local2.x = _local13; _local2.y = _local14; addChild(_local2); _local11++; }; _local10 = _arg1.readUnsignedShort(); _local11 = 0; while (_local11 < _local10) { _local12 = _arg1.readUnsignedByte(); _local13 = _arg1.readUnsignedShort(); _local14 = _arg1.readUnsignedShort(); if (_local12 == 0){ _local2 = new LTorch(); } else { if (_local12 == 1){ _local2 = new RTorch(); } else { _local2 = new Torch(); }; }; _local2.x = _local13; _local2.y = _local14; addChild(_local2); _local5 = TorchBase(_local2); _local5.torchHitArea.visible = false; _local11++; }; _local10 = _arg1.readUnsignedShort(); _local11 = 0; while (_local11 < _local10) { _local12 = _arg1.readUnsignedByte(); _local13 = _arg1.readUnsignedShort(); _local14 = _arg1.readUnsignedShort(); if (_local12 == 0){ _local2 = new PlusOneSnap(); } else { if (_local12 == 1){ _local2 = new BounceSnap(); } else { if (_local12 == 2){ _local2 = new LongLineSnap(); } else { _local2 = new HalfSizeSnap(); }; }; }; _local2.x = _local13; _local2.y = _local14; addChild(_local2); _local11++; }; } } }//package screen
Section 188
//GregIntroScreen (screen.GregIntroScreen) package screen { import flash.display.*; import flash.events.*; import flash.media.*; public class GregIntroScreen extends AbstractScreen { public var btn_Skip:SimpleButton; var humm:Sound; var hummTfm:SoundTransform; var turnOff:Sound; public var anim_text:MovieClip; var hummChan:SoundChannel; public function GregIntroScreen():void{ humm = new Humm(); turnOff = new MonitorOff(); hummTfm = new SoundTransform(0); addFrameScript(0, frame1, 4, frame5, 24, frame25); super(); if (!screens.GregIntro){ screens.GregIntro = this; } else { throw (new Error("There can only be one greg intro screen.")); }; btn_Skip.addEventListener(MouseEvent.CLICK, handleIntroSkip); btn_Skip.visible = Protection.skipable; x = (width / 2); y = (height / 2); } override public function fadeIn():void{ super.fadeIn(); hummTfm.volume = 0; hummChan = humm.play(0, int.MAX_VALUE, hummTfm); addEventListener(Event.ENTER_FRAME, handleFadeIn); } override protected function fadeOutComplete():void{ super.fadeOutComplete(); stop(); if (anim_text){ anim_text.anim_text.stop(); anim_text.anim_text.stopIntro(); }; if (hummChan){ hummChan.stop(); }; } function frame1(){ stop(); } function frame5(){ addEventListener(Event.ENTER_FRAME, handleFadeOut); } override protected function fadeInComplete():void{ super.fadeInComplete(); anim_text.anim_text.play(); } private function handleIntroSkip(_arg1:Event):void{ stop(); if (Protection.kongAPI.userLevelAvailable){ loadUserLevel(); } else { transitionTo(screens.MainMenu); }; } private function handleFadeIn(_arg1:Event):void{ if (!hummChan){ return; }; var _local2:Number = hummTfm.volume; _local2 = (_local2 + 0.1); if (_local2 >= 1){ _local2 = 1; removeEventListener(Event.ENTER_FRAME, handleFadeIn); }; hummTfm.volume = _local2; hummChan.soundTransform = hummTfm; } private function handleFadeOut(_arg1:Event):void{ if (!hummChan){ return; }; var _local2:Number = hummTfm.volume; _local2 = (_local2 - 0.1); if (_local2 <= 0){ hummChan.stop(); removeEventListener(Event.ENTER_FRAME, handleFadeOut); return; }; hummTfm.volume = _local2; hummChan.soundTransform = hummTfm; } public function stopSound():void{ hummChan.stop(); } function frame25(){ stop(); handleIntroComplete(); } private function handleIntroComplete():void{ if (Protection.kongAPI.userLevelAvailable){ loadUserLevel(); } else { transitionTo(screens.MainMenu); }; } } }//package screen
Section 189
//GregIntroTypeEffect (screen.GregIntroTypeEffect) package screen { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.media.*; public class GregIntroTypeEffect extends MovieClip { private var spaceSound:Array; private var minType:int;// = 40 private var keyType:String;// = "normal" private var maxType:int;// = 80 private var timer:Timer; private var typeSound:Array; public function GregIntroTypeEffect():void{ typeSound = new Array(3); spaceSound = new Array(3); timer = new Timer(randomTime(), 1); super(); addFrameScript(0, frame1, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28, 28, frame29, 29, frame30, 30, frame31, 31, frame32, 32, frame33, 33, frame34, 41, frame42, 42, frame43, 43, frame44, 44, frame45, 53, frame54, 54, frame55, 55, frame56, 56, frame57, 57, frame58, 58, frame59, 59, frame60, 60, frame61, 61, frame62, 62, frame63, 63, frame64, 64, frame65, 65, frame66, 66, frame67, 82, frame83, 83, frame84, 84, frame85, 85, frame86, 86, frame87, 87, frame88, 88, frame89, 89, frame90, 90, frame91, 91, frame92, 92, frame93, 93, frame94, 94, frame95, 95, frame96, 96, frame97, 97, frame98, 98, frame99, 99, frame100, 100, frame101, 101, frame102, 102, frame103, 103, frame104, 104, frame105, 105, frame106, 169, frame170); typeSound[0] = new Keyboard_Click_0(); typeSound[1] = new Keyboard_Click_1(); typeSound[2] = new Keyboard_Click_2(); spaceSound[0] = new Keyboard_Spacebar_0(); spaceSound[1] = new Keyboard_Spacebar_1(); spaceSound[2] = new Keyboard_Spacebar_2(); timer.addEventListener(TimerEvent.TIMER, handleTimer); } function frame63(){ playsound(); delay(); } function delay():void{ timer.delay = randomTime(); timer.start(); } function frame66(){ playsound(); delay(); } function frame67(){ play(); } function stopIntro():void{ stop(); if (timer){ timer.stop(); timer = null; }; typeSound.length = 0; spaceSound.length = 0; } function frame31(){ playsound(); delay(); } function frame32(){ playsound(); delay(); } function frame33(){ playsound(); delay(); } function frame34(){ playsound(); play(); } function frame98(){ playsound(); delay(); } function frame106(){ play(); } function frame30(){ keyType = "normal"; playsound(); delay(); } function frame100(){ playsound(); delay(); } function frame83(){ stop(); keyType = "normal"; playsound(); delay(); } function frame85(){ playsound(); delay(); } function frame42(){ stop(); playsound(); delay(); } function frame43(){ playsound(); delay(); } function frame44(){ playsound(); delay(); } function frame45(){ playsound(); play(); } function randomTime():int{ return (((Math.random() * (maxType - minType)) + minType)); } function frame86(){ playsound(); delay(); } function frame88(){ playsound(); delay(); } function frame89(){ playsound(); delay(); } function frame84(){ playsound(); delay(); } function frame87(){ playsound(); delay(); } function frame170(){ stop(); MovieClip(this.parent).play(); } function frame90(){ playsound(); delay(); } function frame92(){ playsound(); delay(); } function frame93(){ playsound(); delay(); } function frame94(){ playsound(); delay(); } function frame95(){ playsound(); delay(); } function frame96(){ playsound(); delay(); } function frame97(){ playsound(); delay(); } function frame54(){ stop(); playsound(); delay(); } function frame55(){ playsound(); delay(); } function frame56(){ playsound(); delay(); } function frame13(){ stop(); keyType = "normal"; playsound(); delay(); } function frame14(){ playsound(); delay(); } function frame15(){ playsound(); delay(); } function frame17(){ keyType = "space"; playsound(); delay(); } function frame18(){ keyType = "normal"; playsound(); delay(); } function frame19(){ playsound(); delay(); } function frame57(){ playsound(); delay(); } function frame58(){ playsound(); delay(); } function frame16(){ playsound(); delay(); } function playsound():void{ var _local1:int = (Math.random() * 3); if (keyType == "normal"){ typeSound[_local1].play(0, 0); } else { if (keyType == "space"){ spaceSound[_local1].play(0, 0); }; }; } function frame99(){ playsound(); delay(); } function frame91(){ playsound(); delay(); } function frame59(){ playsound(); delay(); } function frame1(){ stop(); } function frame101(){ playsound(); delay(); } function frame102(){ playsound(); delay(); } function frame60(){ playsound(); delay(); } function frame61(){ playsound(); delay(); } function frame62(){ playsound(); delay(); } function frame20(){ playsound(); delay(); } function frame21(){ keyType = "space"; playsound(); delay(); } function frame22(){ keyType = "normal"; playsound(); delay(); } function frame23(){ playsound(); delay(); } function frame24(){ playsound(); delay(); } function frame25(){ playsound(); delay(); } function frame26(){ playsound(); delay(); } function frame27(){ playsound(); delay(); } function frame28(){ playsound(); delay(); } function frame29(){ keyType = "space"; playsound(); delay(); } function frame103(){ playsound(); delay(); } function frame104(){ playsound(); delay(); } function frame105(){ playsound(); delay(); } function frame64(){ playsound(); delay(); } function frame65(){ playsound(); delay(); } function handleTimer(_arg1:TimerEvent):void{ this.nextFrame(); } } }//package screen
Section 190
//LevelEditorScreen (screen.LevelEditorScreen) package screen { import flash.geom.*; import flash.display.*; import game.*; import flash.events.*; import flash.utils.*; import com.leveleditor.*; import com.*; import flash.text.*; import theme.*; import com.hurlant.util.*; import flash.media.*; import flash.system.*; public class LevelEditorScreen extends AbstractScreen { private var snapshot:Bitmap; public var dialog:MovieClip; private var winSound:Sound; private var snapshotData:BitmapData; private var reset:Boolean; public var editPanel:EditorPanel; private var loadingExternal:Boolean;// = false public var editor:EditorDisplay; public function LevelEditorScreen():void{ snapshot = new Bitmap(); super(); if (!screens.LevelEditor){ screens.LevelEditor = this; } else { throw (new Error("There can only be one level editor screen.")); }; var _local1:TextFormat = new TextFormat(); _local1.font = "_sans"; _local1.color = 0xFFFFFF; _local1.size = 13; _local1.bold = true; dialog.txt_title.setStyle("textFormat", _local1); _local1 = new TextFormat(); _local1.font = "_sans"; _local1.color = 0xFFFFFF; _local1.size = 13; dialog.txt_desc.setStyle("textFormat", _local1); dialog.visible = false; addChild(CursorManager.instance); editPanel.display = editor; addEventListener("SAVE", showSaveDialog); addEventListener("LOAD", showLoadDialog); addEventListener("TEST", handlePreview); addEventListener("MAIN MENU", handleMainMenu); dialog.btn_OK.addEventListener(MouseEvent.CLICK, closeDialog); dialog.btn_close.addEventListener(MouseEvent.CLICK, closeDialog); winSound = new Win(); } private function handleMainMenu(_arg1:Event):void{ transitionTo(screens.MainMenu); } private function showSaveDialog(_arg1:Event):void{ var _local2:ByteArray = editor.data; dialog.txt_title.text = "Save Level"; dialog.txt_dialog.text = Base64.encodeByteArray(_local2); dialog.txt_dialog.editable = false; dialog.txt_desc.text = "Press 'Copy' and then paste the code into a forum, instant messenger, or e-mail to share your level with friends."; dialog.btn_copy.label = "Copy"; dialog.btn_copy.addEventListener(MouseEvent.CLICK, copyText); dialog.btn_OK.label = "OK"; dialog.btn_submit.addEventListener(MouseEvent.CLICK, submitLevel); if ((((((Protection.domain == "localhost")) && (Protection.debug))) || ((Protection.domain == "Kongregate")))){ dialog.btn_submit.label = "Submit to Kongregate"; } else { dialog.btn_submit.label = "Share Your Level!"; }; dialog.visible = true; } protected function startPreview():void{ var _local1:GameLevelScreen = new GameLevelScreen(); _local1.addEventListener(GameLevelScreen.WIN, handleWin); _local1.addEventListener(GameLevelScreen.QUIT, stopPreview); _local1.addEventListener(GameLevelScreen.RESET, handleReset); cursorManager = false; _parent.addChild(_local1); _local1.init(editor.data, "", true, editPanel.check_longGuide.selected); transitionTo(_local1); } private function handleReset(_arg1:Event):void{ reset = true; stopPreview(); startPreview(); } private function copyText(_arg1:MouseEvent):void{ System.setClipboard(dialog.txt_dialog.text); } private function submitLevel(_arg1:MouseEvent):void{ if (Protection.domain != "Kongregate"){ Protection.toLevelSharing(); return; }; var _local2:GameLevelSnapshot = new GameLevelSnapshot(); _local2.draw(editor.data); var _local3:Matrix = new Matrix(); _local3.scale((150 / 400), (190 / 500)); snapshotData = new BitmapData(150, 190); snapshotData.draw(_local2, _local3); snapshot.bitmapData = snapshotData; Protection.kongAPI.sharedContent.save("Level", Base64.encodeByteArray(editor.data), handleLevelSaved, snapshot, editPanel.txt_name.text); } private function handleWin(_arg1:Event):void{ reset = true; winSound.play(0, 0); stopPreview(); startPreview(); } private function handlePreview(_arg1:Event):void{ startPreview(); } private function closeDialog(_arg1:MouseEvent):void{ dialog.btn_copy.removeEventListener(MouseEvent.CLICK, copyText); dialog.btn_copy.removeEventListener(MouseEvent.CLICK, loadLevel); dialog.visible = false; } private function browseLevel(_arg1:MouseEvent):void{ if (Protection.domain == "Kongregate"){ Protection.kongAPI.sharedContent.browse("Level"); } else { Protection.toLevelSharing(); }; } private function showLoadDialog(_arg1:Event):void{ dialog.txt_title.text = "Load Level"; dialog.txt_dialog.text = ""; dialog.txt_dialog.editable = true; dialog.txt_desc.text = "Copy a map code from a forum, instant messenger, or e-mail, and then paste it into this box (Ctrl-V)."; dialog.btn_copy.label = "Load"; dialog.btn_copy.addEventListener(MouseEvent.CLICK, loadLevel); dialog.btn_OK.label = "Cancel"; dialog.btn_submit.addEventListener(MouseEvent.CLICK, browseLevel); dialog.btn_submit.label = "Browse Levels at Kongregate!"; dialog.visible = true; } protected function stopPreview(_arg1:Event=null):void{ var _local2:GameLevelScreen = GameLevelScreen(screens.GameLevel); _local2.removeEventListener(GameLevelScreen.WIN, handleWin); _local2.removeEventListener(GameLevelScreen.QUIT, stopPreview); _local2.removeEventListener(GameLevelScreen.RESET, handleReset); cursorManager = true; if (reset){ reset = false; } else { transitionTo(this); }; } public function set cursorManager(_arg1:Boolean):void{ var val = _arg1; if (val){ addChild(CursorManager.instance); } else { try { removeChild(CursorManager.instance); } catch(err:Error) { }; }; } function handleLevelSaved(_arg1:Object){ if (snapshotData){ snapshotData.dispose(); }; dialog.btn_copy.removeEventListener(MouseEvent.CLICK, copyText); dialog.btn_copy.removeEventListener(MouseEvent.CLICK, loadLevel); dialog.visible = false; } public function loadExternalLevel(_arg1:String):void{ if ((currentScreen is GameLevelScreen)){ LevelSelectorScreen(screens.LevelSelector).stopLevel(); } else { if (screens.GameLevel){ GameLevelScreen(screens.GameLevel).dispose(); }; }; var _local2:ByteArray = Base64.decodeToByteArray(_arg1); editor.data = _local2; var _local3:GameLevelScreen = new GameLevelScreen(); _local3.addEventListener(GameLevelScreen.WIN, handleReset); _local3.addEventListener(GameLevelScreen.QUIT, stopPreview); _local3.addEventListener(GameLevelScreen.RESET, handleReset); cursorManager = false; _parent.addChild(_local3); _local3.init(editor.data, "", true, editPanel.check_longGuide.selected); loadingExternal = false; startPreview(); } private function loadLevel(_arg1:MouseEvent):void{ dialog.btn_copy.removeEventListener(MouseEvent.CLICK, loadLevel); var _local2:ByteArray = Base64.decodeToByteArray(dialog.txt_dialog.text); editor.data = _local2; dialog.visible = false; } } }//package screen
Section 191
//LevelSelectorScreen (screen.LevelSelectorScreen) package screen { import flash.geom.*; import fl.controls.*; import flash.display.*; import game.*; import flash.events.*; import fl.data.*; import com.*; import flash.text.*; import com.hurlant.util.*; import flash.media.*; public class LevelSelectorScreen extends AbstractScreen { public var aced:MovieClip; protected var buttonArray:Array; public var levelList:List; protected var snd_click:Sound; public var time:TextField; protected var previewPane:Bitmap; protected var winSound:Sound; public var btn_Sponsor:Button; public var btn_MainMenu:Button; public var btn_Play:Button; protected var snd_playClick:Sound; protected var snd_over:Sound; protected var snd_playOut:Sound; public var btn_Guide:Button; protected var snd_playOver:Sound; public function LevelSelectorScreen():void{ snd_over = new Thunk_0(); snd_click = new Thunk_2(); snd_playOver = new Play_Over(); snd_playOut = new Play_Out(); snd_playClick = new Play_Click(); super(); if (!screens.LevelSelector){ screens.LevelSelector = this; } else { throw (new Error("There can only be one level selector screen.")); }; buttonArray = new Array(); previewPane = new Bitmap(); previewPane.x = 370; previewPane.y = 15; addChildAt(previewPane, (numChildren - 2)); aced.visible = false; var _local1:Font = new TinyBoxFont(); var _local2:TextFormat = new TextFormat(); _local2.font = _local1.fontName; _local2.color = 0xFFFFFF; _local2.size = 16; btn_Play.setStyle("textFormat", _local2); btn_MainMenu.setStyle("textFormat", _local2); _local2 = new TextFormat(); _local2.font = _local1.fontName; _local2.color = 0xFFFFFF; _local2.size = 12; btn_Guide.setStyle("textFormat", _local2); btn_Sponsor.setStyle("textFormat", _local2); btn_Play.setStyle("embedFonts", true); btn_MainMenu.setStyle("embedFonts", true); btn_Guide.setStyle("embedFonts", true); btn_Sponsor.setStyle("embedFonts", true); levelList.rowHeight = 24; levelList.setStyle("contentPadding", 4); levelList.setStyle("cellRenderer", PyroCellRenderer); btn_Play.addEventListener(MouseEvent.CLICK, handleClick); btn_MainMenu.addEventListener(MouseEvent.CLICK, handleClick); btn_Guide.addEventListener(MouseEvent.CLICK, handleClick); btn_Sponsor.addEventListener(MouseEvent.CLICK, handleClick); levelList.dataProvider = new DataProvider(levelData); levelList.selectedIndex = saveGame.lastLevel; if (levelList.selectedIndex >= SaveFile.maxLevel){ levelList.selectedIndex--; }; levelList.addEventListener(Event.CHANGE, handleLevelSelect); winSound = new Win(); __setProp_btn_Play_LevelSelectorScreen_Layer3_0(); __setProp_btn_MainMenu_LevelSelectorScreen_Layer3_0(); __setProp_btn_Sponsor_LevelSelectorScreen_Layer3_0(); __setProp_btn_Guide_LevelSelectorScreen_Layer3_0(); } private function handleClick(_arg1:Event):void{ switch (_arg1.target.name){ case "btn_Play": currentLevelIndex = levelList.selectedIndex; currentLevelData = Base64.decodeToByteArray(levelList.selectedItem.data); startLevel(); break; case "btn_MainMenu": transitionTo(screens.MainMenu); break; case "btn_Sponsor": Protection.toSponsor(); break; case "btn_Guide": Protection.toGuide(); break; }; } protected function convertTotalTime(_arg1:int):String{ var _local2:int = (_arg1 / 60); var _local3:int = (_arg1 - (_local2 * 60)); var _local4:String = ((_local3 < 10)) ? ("0" + _local3) : _local3.toString(); var _local5:String = ((_local2 < 10)) ? ("0" + _local2) : _local2.toString(); return (((_local5 + ":") + _local4)); } private function drawPreview():void{ if (currentLevelIndex < SaveFile.maxLevel){ aced.visible = saveGame.levelData[currentLevelIndex].aced; } else { aced.visible = saveGame.bonusArray[(currentLevelIndex - SaveFile.maxLevel)].aced; }; if (currentLevelIndex < SaveFile.maxLevel){ time.text = ("Best Time: " + convertTime(saveGame.levelData[currentLevelIndex].time)); } else { time.text = ("Best Time: " + convertTime(saveGame.levelData[(currentLevelIndex - SaveFile.maxLevel)].time)); }; var _local1:int = saveGame.levelAced; if (_local1 > 0){ time.appendText(("\nTotal Aced: " + _local1)); }; if (saveGame.gameWon){ time.appendText(("\nTotal time: " + convertTotalTime(saveGame.totalTime))); }; var _local2:GameLevelSnapshot = new GameLevelSnapshot(); _local2.draw(currentLevelData); var _local3:Matrix = new Matrix(); _local3.scale((150 / 400), (190 / 500)); var _local4:BitmapData = new BitmapData(150, 190); _local4.draw(_local2, _local3); if (previewPane.bitmapData){ previewPane.bitmapData.dispose(); }; previewPane.bitmapData = _local4; } function __setProp_btn_Sponsor_LevelSelectorScreen_Layer3_0(){ try { btn_Sponsor["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Sponsor.emphasized = false; btn_Sponsor.enabled = true; btn_Sponsor.label = "Play More Games!"; btn_Sponsor.labelPlacement = "right"; btn_Sponsor.selected = false; btn_Sponsor.toggle = false; btn_Sponsor.visible = true; try { btn_Sponsor["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function startLevel():void{ var _local1:GameLevelScreen = new GameLevelScreen(); _local1.addEventListener(GameLevelScreen.WIN, handleWin); _local1.addEventListener(GameLevelScreen.RESET, handleReset); _local1.addEventListener(GameLevelScreen.QUIT, handleQuit); _parent.addChild(_local1); _local1.init(currentLevelData, levelList.selectedItem.label); if (currentLevelIndex < SaveFile.maxLevel){ _local1.tipIndex = currentLevelIndex; }; transitionTo(_local1); } private function handleReset(_arg1:Event=null):void{ if (isTransitioning){ return; }; stopLevel(); startLevel(); } private function handleLevelSelect(_arg1:Event=null):void{ if (levelList.selectedItem.type == "disabled"){ levelList.selectedIndex = currentLevelIndex; return; }; currentLevelIndex = levelList.selectedIndex; currentLevelData = Base64.decodeToByteArray(levelList.selectedItem.data); levelList.scrollToSelected(); drawPreview(); } override public function fadeIn():void{ super.fadeIn(); handleLevelSelect(); } function __setProp_btn_MainMenu_LevelSelectorScreen_Layer3_0(){ try { btn_MainMenu["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_MainMenu.emphasized = false; btn_MainMenu.enabled = true; btn_MainMenu.label = "Main Menu"; btn_MainMenu.labelPlacement = "right"; btn_MainMenu.selected = false; btn_MainMenu.toggle = false; btn_MainMenu.visible = true; try { btn_MainMenu["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function stopLevel():void{ var _local1:GameLevelScreen = GameLevelScreen(screens.GameLevel); _local1.removeEventListener(GameLevelScreen.ACED, handleAceComplete); _local1.removeEventListener(GameLevelScreen.WIN, handleWin); _local1.removeEventListener(GameLevelScreen.RESET, handleReset); _local1.removeEventListener(GameLevelScreen.QUIT, handleQuit); } private function handleWin(_arg1:Event):void{ var _local5:Boolean; var _local7:int; var _local8:int; var _local2:GameLevelScreen = GameLevelScreen(screens.GameLevel); var _local3:Boolean = ((_local2.shotTaken == 1)) ? true : false; var _local4:int = currentLevelIndex; var _local6:int = (SaveFile.maxLevel - 1); if (_local4 < SaveFile.maxLevel){ _local5 = ((_local3) && (!(saveGame.levelData[_local4].aced))); } else { _local5 = ((_local3) && (!(saveGame.bonusArray[(_local4 - SaveFile.maxLevel)].aced))); }; if (_local5){ _local7 = (SaveFile.instance.levelAced + 1); if ((_local7 % 5) == 0){ _local6 = (_local6 + (_local7 / 5)); if (_local6 < (SaveFile.maxLevel + SaveFile.maxBonus)){ saveGame.bonusUnlocked++; levelData.level[_local6].type = "normal"; levelList.getItemAt(_local6).type = "normal"; }; }; }; if (_local4 < SaveFile.maxLevel){ if (_local3){ saveGame.levelData[_local4].aced = true; }; if (_local2.winTime < saveGame.levelData[_local4].time){ saveGame.levelData[_local4].time = _local2.winTime; }; if (saveGame.levelData[_local4].aced){ levelData.level[_local4].type = "aced"; levelList.getItemAt(_local4).type = "aced"; } else { levelData.level[_local4].type = "normal"; levelList.getItemAt(_local4).type = "normal"; }; levelList.invalidateItemAt(_local4); if (_local4 == saveGame.lastLevel){ saveGame.lastLevel++; if (saveGame.lastLevel < SaveFile.maxLevel){ levelData.level[saveGame.lastLevel].type = "normal"; levelList.getItemAt(saveGame.lastLevel).type = "normal"; }; }; } else { _local8 = (_local4 - SaveFile.maxLevel); if (_local3){ saveGame.bonusArray[_local8].aced = true; }; if (_local2.winTime < saveGame.bonusArray[_local8].time){ saveGame.bonusArray[_local8].time = _local2.winTime; }; if (saveGame.bonusArray[_local8].aced){ levelData.level[_local4].type = "aced"; levelList.getItemAt(_local4).type = "aced"; } else { levelData.level[_local4].type = "normal"; levelList.getItemAt(_local4).type = "normal"; }; levelList.invalidateItemAt(_local4); }; saveGame.flush(); winSound.play(0, 0); if (_local3){ _local2.addEventListener(GameLevelScreen.ACED, handleAceComplete); _local2.playAced(((_local6 - SaveFile.maxLevel) + 1)); } else { nextLevel(); }; } protected function convertTime(_arg1:int):String{ if (_arg1 >= 600000){ return ("--:--:---"); }; var _local2:int = (_arg1 / 1000); var _local3:int = (_local2 / 60); var _local4:int = (_arg1 - (_local2 * 1000)); _local2 = (_local2 - (_local3 * 60)); var _local5:String = ((_local4 < 100)) ? ((_local4 < 10)) ? ("00" + _local4) : ("0" + _local4) : _local4.toString(); var _local6:String = ((_local2 < 10)) ? ("0" + _local2) : _local2.toString(); var _local7:String = ((_local3 < 10)) ? ("0" + _local3) : _local3.toString(); return (((((_local7 + ":") + _local6) + ":") + _local5)); } private function nextLevel():void{ if (currentLevelIndex < SaveFile.maxLevel){ currentLevelIndex++; if (currentLevelIndex == SaveFile.maxLevel){ if (!saveGame.gameWon){ saveGame.gameWon = true; saveGame.flush(); stopLevel(); transitionTo(screens.Win); } else { handleQuit(); }; } else { levelList.selectedIndex = currentLevelIndex; levelList.scrollToSelected(); currentLevelData = Base64.decodeToByteArray(levelList.selectedItem.data); stopLevel(); startLevel(); }; } else { handleQuit(); }; } private function handleAceComplete(_arg1:Event):void{ nextLevel(); } private function handleQuit(_arg1:Event=null):void{ stopLevel(); transitionTo(screens.LevelSelector); } function __setProp_btn_Play_LevelSelectorScreen_Layer3_0(){ try { btn_Play["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Play.emphasized = false; btn_Play.enabled = true; btn_Play.label = "Play >"; btn_Play.labelPlacement = "right"; btn_Play.selected = false; btn_Play.toggle = false; btn_Play.visible = true; try { btn_Play["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Guide_LevelSelectorScreen_Layer3_0(){ try { btn_Guide["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Guide.emphasized = false; btn_Guide.enabled = true; btn_Guide.label = "Ace Guide"; btn_Guide.labelPlacement = "right"; btn_Guide.selected = false; btn_Guide.toggle = false; btn_Guide.visible = true; try { btn_Guide["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package screen
Section 192
//MainMenuScreen (screen.MainMenuScreen) package screen { import fl.controls.*; import flash.display.*; import game.*; import flash.events.*; import flash.text.*; import flash.net.*; import flash.media.*; import effects.*; public class MainMenuScreen extends AbstractScreen { const MAXLEVEL:int = 40; private var mainClickSound:Sound; public var maskedFlameII:MovieClip; public var btn_Instruction:Button; public var maskedBall2_L:MovieClip; public var maskedBall4_L:MovieClip; public var maskedBall2_R:MovieClip; private var mainAmbientSoundTransform:SoundTransform; public var maskedBall4_R:MovieClip; public var btn_Sponsor:MovieClip; private var titleFlameII:MaskedFlame; private var ball4_L:MaskedFlame; private var ball2_R:MaskedFlame; public var btn_Credits:Button; private var mainAmbientSound:Sound; private var titleFlame:MaskedFlame; private var gameData:SaveFile; public var btn_NewGame:Button; private var ball2_L:MaskedFlame; public var btn_Editor:Button; public var btn_PlayerLevels:Button; public var maskedBall1_L:MovieClip; private var ball4_R:MaskedFlame; public var maskedBall3_L:MovieClip; public var maskedBall5_L:MovieClip; public var maskedBall1_R:MovieClip; public var maskedBall3_R:MovieClip; public var maskedBall5_R:MovieClip; private var ball1_L:MaskedFlame; private var ball3_L:MaskedFlame; private var ball5_L:MaskedFlame; private var mainAmbientChannel:SoundChannel; private var ball3_R:MaskedFlame; public var maskedFlame:MovieClip; private var ball5_R:MaskedFlame; private var ball1_R:MaskedFlame; public function MainMenuScreen():void{ mainClickSound = new Play_Over(); mainAmbientSound = new Crackle(); mainAmbientSoundTransform = new SoundTransform(0.1, 0); super(); if (!screens.MainMenu){ screens.MainMenu = this; } else { throw (new Error("There can only be one main menu screen.")); }; if (!gameData){ gameData = SaveFile.instance; gameData.flush(); }; btn_Sponsor.mouseChildren = false; btn_Sponsor.buttonMode = true; initButtons(); if ((((((Protection.domain == "localhost")) && (Protection.debug))) || ((Protection.domain == "Kongregate")))){ Protection.kongAPI.addEventListener("user level", loadUserLevel); }; __setProp_btn_NewGame_MainMenuScreen_Layer1_0(); __setProp_btn_Editor_MainMenuScreen_Layer1_0(); __setProp_btn_Instruction_MainMenuScreen_Layer1_0(); __setProp_btn_Credits_MainMenuScreen_Layer1_0(); __setProp_btn_PlayerLevels_MainMenuScreen_Layer1_0(); } function __setProp_btn_NewGame_MainMenuScreen_Layer1_0(){ try { btn_NewGame["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_NewGame.emphasized = false; btn_NewGame.enabled = true; btn_NewGame.label = "Play >"; btn_NewGame.labelPlacement = "right"; btn_NewGame.selected = false; btn_NewGame.toggle = false; btn_NewGame.visible = true; try { btn_NewGame["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleOut(_arg1:MouseEvent):void{ if (!ball1_L){ return; }; switch (_arg1.target.name){ case "btn_NewGame": ball1_L.burning = false; ball1_R.burning = false; break; case "btn_PlayerLevels": ball2_L.burning = false; ball2_R.burning = false; break; case "btn_Editor": ball3_L.burning = false; ball3_R.burning = false; break; case "btn_Instruction": ball4_L.burning = false; ball4_R.burning = false; break; case "btn_Credits": ball5_L.burning = false; ball5_R.burning = false; break; }; } override protected function fadeOutComplete():void{ super.fadeOutComplete(); titleFlame = null; titleFlameII = null; ball1_L = null; ball1_R = null; ball2_L = null; ball2_R = null; ball3_L = null; ball3_R = null; ball4_L = null; ball4_R = null; ball5_L = null; ball5_R = null; } private function handleOver(_arg1:MouseEvent):void{ if (!ball1_L){ return; }; mainClickSound.play(); switch (_arg1.target.name){ case "btn_NewGame": ball1_L.burning = true; ball1_R.burning = true; break; case "btn_PlayerLevels": ball2_L.burning = true; ball2_R.burning = true; break; case "btn_Editor": ball3_L.burning = true; ball3_R.burning = true; break; case "btn_Instruction": ball4_L.burning = true; ball4_R.burning = true; break; case "btn_Credits": ball5_L.burning = true; ball5_R.burning = true; break; }; } override public function fadeIn():void{ super.fadeIn(); titleFlame = new MaskedFlame(maskedFlame, 250, 115); titleFlame.burning = true; titleFlameII = new MaskedFlame(maskedFlameII, 85, 129); titleFlameII.switchPalette(new TransparentBlueFlamePalette()); titleFlameII.burning = true; ball1_L = new MaskedFlame(maskedBall1_L, 23, 43); ball1_R = new MaskedFlame(maskedBall1_R, 23, 43); ball2_L = new MaskedFlame(maskedBall2_L, 23, 43); ball2_R = new MaskedFlame(maskedBall2_R, 23, 43); ball3_L = new MaskedFlame(maskedBall3_L, 23, 43); ball3_R = new MaskedFlame(maskedBall3_R, 23, 43); ball4_L = new MaskedFlame(maskedBall4_L, 23, 43); ball4_R = new MaskedFlame(maskedBall4_R, 23, 43); ball5_L = new MaskedFlame(maskedBall5_L, 23, 43); ball5_R = new MaskedFlame(maskedBall5_R, 23, 43); mainAmbientChannel = mainAmbientSound.play(0, int.MAX_VALUE, mainAmbientSoundTransform); } private function handleClick(_arg1:MouseEvent):void{ mainClickSound.play(); switch (_arg1.target.name){ case "btn_Instruction": Protection.toInstruction(); break; case "btn_NewGame": if (mainAmbientChannel){ mainAmbientChannel.stop(); }; transitionTo(screens.LevelSelector); break; case "btn_PlayerLevels": if (mainAmbientChannel){ mainAmbientChannel.stop(); }; transitionTo(screens.PlayerLevelSelector); break; case "btn_Credits": if (mainAmbientChannel){ mainAmbientChannel.stop(); }; transitionTo(screens.Credits); break; case "btn_Editor": if (mainAmbientChannel){ mainAmbientChannel.stop(); }; transitionTo(screens.LevelEditor); break; case "btn_Sponsor": Protection.toSponsor(); break; }; } private function initButtons():void{ var _local1:Font = new TinyBoxFont(); var _local2:TextFormat = new TextFormat(); _local2.font = _local1.fontName; _local2.color = 0xFFFFFF; _local2.size = 16; btn_Instruction.setStyle("textFormat", _local2); btn_NewGame.setStyle("textFormat", _local2); btn_PlayerLevels.setStyle("textFormat", _local2); btn_Credits.setStyle("textFormat", _local2); btn_Editor.setStyle("textFormat", _local2); btn_Instruction.setStyle("embedFonts", true); btn_NewGame.setStyle("embedFonts", true); btn_PlayerLevels.setStyle("embedFonts", true); btn_Credits.setStyle("embedFonts", true); btn_Editor.setStyle("embedFonts", true); btn_Instruction.addEventListener(MouseEvent.CLICK, handleClick); btn_NewGame.addEventListener(MouseEvent.CLICK, handleClick); btn_PlayerLevels.addEventListener(MouseEvent.CLICK, handleClick); btn_Credits.addEventListener(MouseEvent.CLICK, handleClick); btn_Editor.addEventListener(MouseEvent.CLICK, handleClick); btn_Instruction.addEventListener(MouseEvent.ROLL_OVER, handleOver); btn_NewGame.addEventListener(MouseEvent.ROLL_OVER, handleOver); btn_PlayerLevels.addEventListener(MouseEvent.ROLL_OVER, handleOver); btn_Credits.addEventListener(MouseEvent.ROLL_OVER, handleOver); btn_Editor.addEventListener(MouseEvent.ROLL_OVER, handleOver); btn_Instruction.addEventListener(MouseEvent.ROLL_OUT, handleOut); btn_NewGame.addEventListener(MouseEvent.ROLL_OUT, handleOut); btn_PlayerLevels.addEventListener(MouseEvent.ROLL_OUT, handleOut); btn_Credits.addEventListener(MouseEvent.ROLL_OUT, handleOut); btn_Editor.addEventListener(MouseEvent.ROLL_OUT, handleOut); btn_PlayerLevels.enabled = false; btn_Sponsor.addEventListener(MouseEvent.CLICK, handleClick); btn_Sponsor.visible = Protection.sponsorVisible; } function __setProp_btn_Editor_MainMenuScreen_Layer1_0(){ try { btn_Editor["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Editor.emphasized = false; btn_Editor.enabled = true; btn_Editor.label = "Level Editor"; btn_Editor.labelPlacement = "right"; btn_Editor.selected = false; btn_Editor.toggle = false; btn_Editor.visible = true; try { btn_Editor["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Credits_MainMenuScreen_Layer1_0(){ try { btn_Credits["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Credits.emphasized = false; btn_Credits.enabled = true; btn_Credits.label = "Credits"; btn_Credits.labelPlacement = "right"; btn_Credits.selected = false; btn_Credits.toggle = false; btn_Credits.visible = true; try { btn_Credits["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_Instruction_MainMenuScreen_Layer1_0(){ try { btn_Instruction["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Instruction.emphasized = false; btn_Instruction.enabled = true; btn_Instruction.label = "Instructions"; btn_Instruction.labelPlacement = "right"; btn_Instruction.selected = false; btn_Instruction.toggle = false; btn_Instruction.visible = true; try { btn_Instruction["componentInspectorSetting"] = false; } catch(e:Error) { }; } function handleMute(_arg1:KeyboardEvent){ var _local2:SoundTransform; if (_arg1.keyCode == 77){ _local2 = SoundMixer.soundTransform; if (_local2.volume == 1){ _local2.volume = 0; SoundMixer.soundTransform = _local2; } else { _local2.volume = 1; SoundMixer.soundTransform = _local2; }; }; } function __setProp_btn_PlayerLevels_MainMenuScreen_Layer1_0(){ try { btn_PlayerLevels["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_PlayerLevels.emphasized = false; btn_PlayerLevels.enabled = true; btn_PlayerLevels.label = "Player Levels >"; btn_PlayerLevels.labelPlacement = "right"; btn_PlayerLevels.selected = false; btn_PlayerLevels.toggle = false; btn_PlayerLevels.visible = true; try { btn_PlayerLevels["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package screen
Section 193
//PlayerLevelSelectorScreen (screen.PlayerLevelSelectorScreen) package screen { import flash.geom.*; import fl.controls.*; import flash.display.*; import game.*; import flash.events.*; import fl.data.*; import com.*; import flash.text.*; import com.hurlant.util.*; import flash.media.*; public class PlayerLevelSelectorScreen extends AbstractScreen { public var aced:MovieClip; public var btn_SubmitInfo:SimpleButton; public var time:TextField; protected var previewPane:Bitmap; public var levelList:List; protected var winSound:Sound; public var btn_Sponsor:SimpleButton; public var btn_MainMenu:Button; public var btn_Play:Button; protected var snd_playClick:Sound; protected var snd_over:Sound; protected var snd_playOut:Sound; public var btn_Browse:Button; protected var snd_click:Sound; protected var snd_playOver:Sound; public function PlayerLevelSelectorScreen():void{ snd_over = new Thunk_0(); snd_click = new Thunk_2(); snd_playOver = new Play_Over(); snd_playOut = new Play_Out(); snd_playClick = new Play_Click(); super(); if (!screens.PlayerLevelSelector){ screens.PlayerLevelSelector = this; } else { throw (new Error("There can only be one player level selector screen.")); }; previewPane = new Bitmap(); previewPane.x = 370; previewPane.y = 15; addChildAt(previewPane, (numChildren - 2)); aced.visible = false; var _local1:Font = new TinyBoxFont(); var _local2:TextFormat = new TextFormat(); _local2.font = _local1.fontName; _local2.color = 0xFFFFFF; _local2.size = 16; btn_Play.setStyle("textFormat", _local2); btn_MainMenu.setStyle("textFormat", _local2); btn_Browse.setStyle("textFormat", _local2); btn_Play.setStyle("embedFonts", true); btn_MainMenu.setStyle("embedFonts", true); btn_Browse.setStyle("embedFonts", true); levelList.rowHeight = 24; levelList.setStyle("contentPadding", 4); levelList.setStyle("cellRenderer", PyroCellRenderer); btn_Play.addEventListener(MouseEvent.CLICK, handleClick); btn_MainMenu.addEventListener(MouseEvent.CLICK, handleClick); btn_Browse.addEventListener(MouseEvent.CLICK, handleClick); btn_SubmitInfo.addEventListener(MouseEvent.CLICK, handleClick); btn_Sponsor.addEventListener(MouseEvent.CLICK, handleClick); btn_Sponsor.visible = Protection.sponsorVisible; levelList.dataProvider = new DataProvider(playerLevelData); levelList.selectedIndex = 0; currentLevelIndex = 0; currentLevelData = Base64.decodeToByteArray(levelList.getItemAt(0).data); drawPreview(); levelList.addEventListener(Event.CHANGE, handleLevelSelect); winSound = new Win(); __setProp_btn_Play_PlayerLevelSelectorScreen_Layer3_0(); __setProp_btn_MainMenu_PlayerLevelSelectorScreen_Layer3_0(); __setProp_btn_Browse_PlayerLevelSelectorScreen_Layer3_0(); } private function handleClick(_arg1:Event):void{ switch (_arg1.target.name){ case "btn_Play": currentLevelIndex = levelList.selectedIndex; currentLevelData = Base64.decodeToByteArray(levelList.selectedItem.data); startLevel(); break; case "btn_MainMenu": transitionTo(screens.MainMenu); break; case "btn_Sponsor": Protection.toSponsor(); break; case "btn_Browse": if (Protection.domain == "Kongregate"){ Protection.kongAPI.sharedContent.browse("Level"); } else { Protection.toLevelSharing(); }; break; case "btn_SubmitInfo": Protection.toLevelSharing(); break; }; } private function drawPreview():void{ var idx:int; var data:Object; var txt:String; var preview:GameLevelSnapshot; var mtx:Matrix; var bmp:BitmapData; idx = levelList.selectedItem.id; data = saveGame.so.data.playerData[idx]; aced.visible = data.aced; txt = (("Difficulty: " + playerLevelData.level.(id == idx).difficulty.toString()) + "\n"); txt = (txt + ("Best Time: " + convertTime(data.time))); time.text = txt; preview = new GameLevelSnapshot(); preview.draw(currentLevelData); mtx = new Matrix(); mtx.scale((150 / 400), (190 / 500)); bmp = new BitmapData(150, 190); bmp.draw(preview, mtx); if (previewPane.bitmapData){ previewPane.bitmapData.dispose(); }; previewPane.bitmapData = bmp; } private function handleReset(_arg1:Event=null):void{ if (isTransitioning){ return; }; stopLevel(); startLevel(); } function __setProp_btn_Browse_PlayerLevelSelectorScreen_Layer3_0(){ try { btn_Browse["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Browse.emphasized = false; btn_Browse.enabled = true; btn_Browse.label = "Kong Levels"; btn_Browse.labelPlacement = "right"; btn_Browse.selected = false; btn_Browse.toggle = false; btn_Browse.visible = true; try { btn_Browse["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_btn_MainMenu_PlayerLevelSelectorScreen_Layer3_0(){ try { btn_MainMenu["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_MainMenu.emphasized = false; btn_MainMenu.enabled = true; btn_MainMenu.label = "Main Menu"; btn_MainMenu.labelPlacement = "right"; btn_MainMenu.selected = false; btn_MainMenu.toggle = false; btn_MainMenu.visible = true; try { btn_MainMenu["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleLevelSelect(_arg1:Event=null):void{ currentLevelIndex = levelList.selectedIndex; currentLevelData = Base64.decodeToByteArray(levelList.selectedItem.data); levelList.scrollToSelected(); drawPreview(); } override public function fadeIn():void{ super.fadeIn(); handleLevelSelect(); } public function stopLevel():void{ var _local1:GameLevelScreen = GameLevelScreen(screens.GameLevel); _local1.removeEventListener(GameLevelScreen.ACED, handleAceComplete); _local1.removeEventListener(GameLevelScreen.WIN, handleWin); _local1.removeEventListener(GameLevelScreen.RESET, handleReset); _local1.removeEventListener(GameLevelScreen.QUIT, handleQuit); } private function handleWin(_arg1:Event):void{ var _local2:GameLevelScreen = GameLevelScreen(screens.GameLevel); var _local3:Boolean = ((_local2.shotTaken == 1)) ? true : false; var _local4:int = currentLevelIndex; var _local5:int = levelList.getItemAt(_local4).id; var _local6:Object = saveGame.so.data.playerData[_local5]; if (_local3){ _local6.aced = true; }; if (_local2.winTime < _local6.time){ _local6.time = _local2.winTime; }; if (_local6.aced){ playerLevelData.level[_local4].type = "aced"; levelList.getItemAt(_local4).type = "aced"; } else { playerLevelData.level[_local4].type = "normal"; levelList.getItemAt(_local4).type = "normal"; }; saveGame.flush(); winSound.play(0, 0); if (_local3){ _local2.addEventListener(GameLevelScreen.ACED, handleAceComplete); _local2.playAced(-1); } else { nextLevel(); }; } protected function convertTime(_arg1:int):String{ if ((((_arg1 >= 600000)) || ((_arg1 <= 0)))){ return ("--:--:---"); }; var _local2:int = (_arg1 / 1000); var _local3:int = (_local2 / 60); var _local4:int = (_arg1 - (_local2 * 1000)); _local2 = (_local2 - (_local3 * 60)); var _local5:String = ((_local4 < 100)) ? ((_local4 < 10)) ? ("00" + _local4) : ("0" + _local4) : _local4.toString(); var _local6:String = ((_local2 < 10)) ? ("0" + _local2) : _local2.toString(); var _local7:String = ((_local3 < 10)) ? ("0" + _local3) : _local3.toString(); return (((((_local7 + ":") + _local6) + ":") + _local5)); } private function nextLevel():void{ currentLevelIndex++; levelList.selectedIndex = currentLevelIndex; levelList.scrollToSelected(); currentLevelData = Base64.decodeToByteArray(levelList.selectedItem.data); stopLevel(); startLevel(); } private function handleAceComplete(_arg1:Event):void{ nextLevel(); } private function startLevel():void{ var _local1:GameLevelScreen = new GameLevelScreen(); _local1.addEventListener(GameLevelScreen.WIN, handleWin); _local1.addEventListener(GameLevelScreen.RESET, handleReset); _local1.addEventListener(GameLevelScreen.QUIT, handleQuit); _parent.addChild(_local1); _local1.init(currentLevelData, levelList.selectedItem.label); transitionTo(_local1); } function __setProp_btn_Play_PlayerLevelSelectorScreen_Layer3_0(){ try { btn_Play["componentInspectorSetting"] = true; } catch(e:Error) { }; btn_Play.emphasized = false; btn_Play.enabled = true; btn_Play.label = "Play >"; btn_Play.labelPlacement = "right"; btn_Play.selected = false; btn_Play.toggle = false; btn_Play.visible = true; try { btn_Play["componentInspectorSetting"] = false; } catch(e:Error) { }; } private function handleQuit(_arg1:Event=null):void{ stopLevel(); transitionTo(screens.PlayerLevelSelector); } } }//package screen
Section 194
//ScreenList (screen.ScreenList) package screen { public class ScreenList { public var PlayerLevelSelector:AbstractScreen; public var LevelSelector:AbstractScreen; public var FlameLoader:AbstractScreen; public var Instruction:AbstractScreen; public var LevelEditor:AbstractScreen; public var GameLevel:AbstractScreen; public var Win:AbstractScreen; public var DamijinIntro:AbstractScreen; public var MainMenu:AbstractScreen; public var Credits:AbstractScreen; public var GregIntro:AbstractScreen; } }//package screen
Section 195
//WinScreen (screen.WinScreen) package screen { import flash.display.*; import flash.events.*; import effects.*; public class WinScreen extends AbstractScreen { var flame:CreditFlame; var scrollMax:int; public var creditScroll:MovieClip; public function WinScreen():void{ if (!screens.Win){ screens.Win = this; } else { throw (new Error("There can only be one credits screen.")); }; creditScroll.btn_Back.addEventListener(MouseEvent.CLICK, handleBack); } override public function fadeIn():void{ super.fadeIn(); flame = new CreditFlame(558, 50); flame.x = -4; flame.y = 458; flame.smoothing = false; scrollMax = (-(creditScroll.height) + 250); creditScroll.y = 500; addChild(flame); addEventListener(Event.ENTER_FRAME, updateScreen); } function updateScreen(_arg1:Event):void{ if (creditScroll.y > scrollMax){ creditScroll.y = (creditScroll.y + -1); }; flame.update(); } override protected function fadeOutComplete():void{ super.fadeOutComplete(); removeEventListener(Event.ENTER_FRAME, updateScreen); if (flame){ flame.dispose(); }; flame = null; } private function handleBack(_arg1:Event):void{ flame.running = false; transitionTo(screens.MainMenu); } } }//package screen
Section 196
//Darkroom (theme.Darkroom) package theme { import fl.controls.*; import fl.managers.*; import flash.text.*; public class Darkroom { public static function apply():void{ var _local1:TextFormat = new TextFormat(); _local1.font = "_sans"; _local1.color = 0xFFFFFF; _local1.size = 11; StyleManager.setComponentStyle(Label, "textFormat", _local1); StyleManager.setComponentStyle(CheckBox, "textFormat", _local1); StyleManager.setComponentStyle(Button, "textFormat", _local1); StyleManager.setComponentStyle(Button, "disabledSkin", Button_disabledSkin); StyleManager.setComponentStyle(Button, "downSkin", Button_downSkin); StyleManager.setComponentStyle(Button, "overSkin", Button_overSkin); StyleManager.setComponentStyle(Button, "upSkin", Button_upSkin); StyleManager.setComponentStyle(Button, "selectedDisabledSkin", Button_disabledSkin); StyleManager.setComponentStyle(Button, "selectedDownSkin", Button_upSkin); StyleManager.setComponentStyle(Button, "selectedOverSkin", Button_downSkin); StyleManager.setComponentStyle(Button, "selectedUpSkin", Button_downSkin); StyleManager.setComponentStyle(Button, "focusRectSkin", null); } } }//package theme
Section 197
//BlueFlamePalette (BlueFlamePalette) package { import flash.display.*; public dynamic class BlueFlamePalette extends Sprite { } }//package
Section 198
//BounceSnap (BounceSnap) package { import flash.display.*; public dynamic class BounceSnap extends Sprite { } }//package
Section 199
//BounceUpZone (BounceUpZone) package { import game.*; public dynamic class BounceUpZone extends BounceUpPowerUp { } }//package
Section 200
//BrickBitmap (BrickBitmap) package { import flash.display.*; public dynamic class BrickBitmap extends BitmapData { public function BrickBitmap(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 201
//Burn_00 (Burn_00) package { import flash.display.*; public dynamic class Burn_00 extends BitmapData { public function Burn_00(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 202
//Burn_01 (Burn_01) package { import flash.display.*; public dynamic class Burn_01 extends BitmapData { public function Burn_01(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 203
//Burn_02 (Burn_02) package { import flash.display.*; public dynamic class Burn_02 extends BitmapData { public function Burn_02(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 204
//Burn_03 (Burn_03) package { import flash.display.*; public dynamic class Burn_03 extends BitmapData { public function Burn_03(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 205
//Burn_04 (Burn_04) package { import flash.display.*; public dynamic class Burn_04 extends BitmapData { public function Burn_04(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 206
//Button_disabledSkin (Button_disabledSkin) package { import flash.display.*; public dynamic class Button_disabledSkin extends MovieClip { } }//package
Section 207
//Button_downSkin (Button_downSkin) package { import flash.display.*; public dynamic class Button_downSkin extends MovieClip { } }//package
Section 208
//Button_emphasizedSkin (Button_emphasizedSkin) package { import flash.display.*; public dynamic class Button_emphasizedSkin extends MovieClip { } }//package
Section 209
//Button_overSkin (Button_overSkin) package { import flash.display.*; public dynamic class Button_overSkin extends MovieClip { } }//package
Section 210
//Button_selectedDisabledSkin (Button_selectedDisabledSkin) package { import flash.display.*; public dynamic class Button_selectedDisabledSkin extends MovieClip { } }//package
Section 211
//Button_selectedDownSkin (Button_selectedDownSkin) package { import flash.display.*; public dynamic class Button_selectedDownSkin extends MovieClip { } }//package
Section 212
//Button_selectedOverSkin (Button_selectedOverSkin) package { import flash.display.*; public dynamic class Button_selectedOverSkin extends MovieClip { } }//package
Section 213
//Button_selectedUpSkin (Button_selectedUpSkin) package { import flash.display.*; public dynamic class Button_selectedUpSkin extends MovieClip { } }//package
Section 214
//Button_upSkin (Button_upSkin) package { import flash.display.*; public dynamic class Button_upSkin extends MovieClip { } }//package
Section 215
//ButtonDisplay (ButtonDisplay) package { import flash.display.*; public dynamic class ButtonDisplay extends Sprite { } }//package
Section 216
//ButtonHitArea (ButtonHitArea) package { import flash.display.*; public dynamic class ButtonHitArea extends Sprite { } }//package
Section 217
//CellRenderer_disabledSkin (CellRenderer_disabledSkin) package { import flash.display.*; public dynamic class CellRenderer_disabledSkin extends MovieClip { } }//package
Section 218
//CellRenderer_downSkin (CellRenderer_downSkin) package { import flash.display.*; public dynamic class CellRenderer_downSkin extends MovieClip { } }//package
Section 219
//CellRenderer_overSkin (CellRenderer_overSkin) package { import flash.display.*; public dynamic class CellRenderer_overSkin extends MovieClip { } }//package
Section 220
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip { } }//package
Section 221
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedDownSkin extends MovieClip { } }//package
Section 222
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedOverSkin extends MovieClip { } }//package
Section 223
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedUpSkin extends MovieClip { } }//package
Section 224
//CellRenderer_upSkin (CellRenderer_upSkin) package { import flash.display.*; public dynamic class CellRenderer_upSkin extends MovieClip { } }//package
Section 225
//CheckBox_disabledIcon (CheckBox_disabledIcon) package { import flash.display.*; public dynamic class CheckBox_disabledIcon extends MovieClip { } }//package
Section 226
//CheckBox_downIcon (CheckBox_downIcon) package { import flash.display.*; public dynamic class CheckBox_downIcon extends MovieClip { } }//package
Section 227
//CheckBox_overIcon (CheckBox_overIcon) package { import flash.display.*; public dynamic class CheckBox_overIcon extends MovieClip { } }//package
Section 228
//CheckBox_selectedDisabledIcon (CheckBox_selectedDisabledIcon) package { import flash.display.*; public dynamic class CheckBox_selectedDisabledIcon extends MovieClip { } }//package
Section 229
//CheckBox_selectedDownIcon (CheckBox_selectedDownIcon) package { import flash.display.*; public dynamic class CheckBox_selectedDownIcon extends MovieClip { } }//package
Section 230
//CheckBox_selectedOverIcon (CheckBox_selectedOverIcon) package { import flash.display.*; public dynamic class CheckBox_selectedOverIcon extends MovieClip { } }//package
Section 231
//CheckBox_selectedUpIcon (CheckBox_selectedUpIcon) package { import flash.display.*; public dynamic class CheckBox_selectedUpIcon extends MovieClip { } }//package
Section 232
//CheckBox_upIcon (CheckBox_upIcon) package { import flash.display.*; public dynamic class CheckBox_upIcon extends MovieClip { } }//package
Section 233
//Circ_Icon (Circ_Icon) package { import flash.display.*; public dynamic class Circ_Icon extends Sprite { } }//package
Section 234
//ComboBox_disabledSkin (ComboBox_disabledSkin) package { import flash.display.*; public dynamic class ComboBox_disabledSkin extends MovieClip { } }//package
Section 235
//ComboBox_downSkin (ComboBox_downSkin) package { import flash.display.*; public dynamic class ComboBox_downSkin extends MovieClip { } }//package
Section 236
//ComboBox_overSkin (ComboBox_overSkin) package { import flash.display.*; public dynamic class ComboBox_overSkin extends MovieClip { } }//package
Section 237
//ComboBox_upSkin (ComboBox_upSkin) package { import flash.display.*; public dynamic class ComboBox_upSkin extends MovieClip { } }//package
Section 238
//Crackle (Crackle) package { import flash.media.*; public dynamic class Crackle extends Sound { } }//package
Section 239
//Crate (Crate) package { import game.*; public dynamic class Crate extends Burnable { } }//package
Section 240
//Crate_Icon (Crate_Icon) package { import flash.display.*; public dynamic class Crate_Icon extends Sprite { } }//package
Section 241
//CrateBitmap (CrateBitmap) package { import flash.display.*; public dynamic class CrateBitmap extends BitmapData { public function CrateBitmap(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 242
//CrateBurnBitmap (CrateBurnBitmap) package { import flash.display.*; public dynamic class CrateBurnBitmap extends BitmapData { public function CrateBurnBitmap(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 243
//CT_Icon (CT_Icon) package { import flash.display.*; public dynamic class CT_Icon extends Sprite { } }//package
Section 244
//DarkDis_00 (DarkDis_00) package { import flash.display.*; public dynamic class DarkDis_00 extends BitmapData { public function DarkDis_00(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 245
//DarkDis_01 (DarkDis_01) package { import flash.display.*; public dynamic class DarkDis_01 extends BitmapData { public function DarkDis_01(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 246
//DarkDis_02 (DarkDis_02) package { import flash.display.*; public dynamic class DarkDis_02 extends BitmapData { public function DarkDis_02(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 247
//DarkDis_03 (DarkDis_03) package { import flash.display.*; public dynamic class DarkDis_03 extends BitmapData { public function DarkDis_03(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 248
//DarkDis_04 (DarkDis_04) package { import flash.display.*; public dynamic class DarkDis_04 extends BitmapData { public function DarkDis_04(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 249
//DarkWood_00 (DarkWood_00) package { import flash.display.*; public dynamic class DarkWood_00 extends BitmapData { public function DarkWood_00(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 250
//DarkWood_01 (DarkWood_01) package { import flash.display.*; public dynamic class DarkWood_01 extends BitmapData { public function DarkWood_01(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 251
//DarkWood_02 (DarkWood_02) package { import flash.display.*; public dynamic class DarkWood_02 extends BitmapData { public function DarkWood_02(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 252
//DarkWood_03 (DarkWood_03) package { import flash.display.*; public dynamic class DarkWood_03 extends BitmapData { public function DarkWood_03(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 253
//DarkWood_04 (DarkWood_04) package { import flash.display.*; public dynamic class DarkWood_04 extends BitmapData { public function DarkWood_04(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 254
//Dis_00 (Dis_00) package { import flash.display.*; public dynamic class Dis_00 extends BitmapData { public function Dis_00(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 255
//Dis_01 (Dis_01) package { import flash.display.*; public dynamic class Dis_01 extends BitmapData { public function Dis_01(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 256
//Dis_02 (Dis_02) package { import flash.display.*; public dynamic class Dis_02 extends BitmapData { public function Dis_02(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 257
//Dis_03 (Dis_03) package { import flash.display.*; public dynamic class Dis_03 extends BitmapData { public function Dis_03(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 258
//Dis_04 (Dis_04) package { import flash.display.*; public dynamic class Dis_04 extends BitmapData { public function Dis_04(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 259
//DisplayScreenHit (DisplayScreenHit) package { import flash.display.*; public dynamic class DisplayScreenHit extends Sprite { } }//package
Section 260
//DragHandle (DragHandle) package { import flash.display.*; public dynamic class DragHandle extends Sprite { public var gauge:MovieClip; } }//package
Section 261
//DummyBody (DummyBody) package { import flash.display.*; public dynamic class DummyBody extends Sprite { } }//package
Section 262
//Edit_Icon (Edit_Icon) package { import flash.display.*; public dynamic class Edit_Icon extends Sprite { } }//package
Section 263
//FlamePalette (FlamePalette) package { import flash.display.*; public dynamic class FlamePalette extends Sprite { } }//package
Section 264
//Flare (Flare) package { import flash.media.*; public dynamic class Flare extends Sound { } }//package
Section 265
//focusRectSkin (focusRectSkin) package { import flash.display.*; public dynamic class focusRectSkin extends MovieClip { } }//package
Section 266
//Glass1 (Glass1) package { import flash.media.*; public dynamic class Glass1 extends Sound { } }//package
Section 267
//Glass2 (Glass2) package { import flash.media.*; public dynamic class Glass2 extends Sound { } }//package
Section 268
//Glass3 (Glass3) package { import flash.media.*; public dynamic class Glass3 extends Sound { } }//package
Section 269
//GreenFlamePalette (GreenFlamePalette) package { import flash.display.*; public dynamic class GreenFlamePalette extends Sprite { } }//package
Section 270
//HalfSizeSnap (HalfSizeSnap) package { import flash.display.*; public dynamic class HalfSizeSnap extends Sprite { } }//package
Section 271
//HalfSizeZone (HalfSizeZone) package { import game.*; public dynamic class HalfSizeZone extends HalfSizePowerUp { } }//package
Section 272
//Humm (Humm) package { import flash.media.*; public dynamic class Humm extends Sound { } }//package
Section 273
//Keyboard_Click_0 (Keyboard_Click_0) package { import flash.media.*; public dynamic class Keyboard_Click_0 extends Sound { } }//package
Section 274
//Keyboard_Click_1 (Keyboard_Click_1) package { import flash.media.*; public dynamic class Keyboard_Click_1 extends Sound { } }//package
Section 275
//Keyboard_Click_2 (Keyboard_Click_2) package { import flash.media.*; public dynamic class Keyboard_Click_2 extends Sound { } }//package
Section 276
//Keyboard_Spacebar_0 (Keyboard_Spacebar_0) package { import flash.media.*; public dynamic class Keyboard_Spacebar_0 extends Sound { } }//package
Section 277
//Keyboard_Spacebar_1 (Keyboard_Spacebar_1) package { import flash.media.*; public dynamic class Keyboard_Spacebar_1 extends Sound { } }//package
Section 278
//Keyboard_Spacebar_2 (Keyboard_Spacebar_2) package { import flash.media.*; public dynamic class Keyboard_Spacebar_2 extends Sound { } }//package
Section 279
//Kong_Logo (Kong_Logo) package { import flash.display.*; public dynamic class Kong_Logo extends MovieClip { public function Kong_Logo(){ addFrameScript(128, frame129); } function frame129(){ stop(); } } }//package
Section 280
//Kong_Logo_Pyro (Kong_Logo_Pyro) package { import flash.display.*; public dynamic class Kong_Logo_Pyro extends MovieClip { public var logo:Kong_Logo; public function Kong_Logo_Pyro(){ addFrameScript(6, frame7); } function frame7(){ stop(); } } }//package
Section 281
//List_skin (List_skin) package { import flash.display.*; public dynamic class List_skin extends MovieClip { } }//package
Section 282
//LongLineSnap (LongLineSnap) package { import flash.display.*; public dynamic class LongLineSnap extends Sprite { } }//package
Section 283
//LongLineZone (LongLineZone) package { import game.*; public dynamic class LongLineZone extends LongLinePowerUp { } }//package
Section 284
//LT_Icon (LT_Icon) package { import flash.display.*; public dynamic class LT_Icon extends Sprite { } }//package
Section 285
//LTorch (LTorch) package { import game.*; public dynamic class LTorch extends TorchBase { } }//package
Section 286
//Metal1 (Metal1) package { import flash.media.*; public dynamic class Metal1 extends Sound { } }//package
Section 287
//Metal2 (Metal2) package { import flash.media.*; public dynamic class Metal2 extends Sound { } }//package
Section 288
//Metal3 (Metal3) package { import flash.media.*; public dynamic class Metal3 extends Sound { } }//package
Section 289
//Metal4 (Metal4) package { import flash.media.*; public dynamic class Metal4 extends Sound { } }//package
Section 290
//MetalBitmap (MetalBitmap) package { import flash.display.*; public dynamic class MetalBitmap extends BitmapData { public function MetalBitmap(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 291
//MonitorOff (MonitorOff) package { import flash.media.*; public dynamic class MonitorOff extends Sound { } }//package
Section 292
//NoiseGenerator (NoiseGenerator) package { import flash.display.*; public dynamic class NoiseGenerator extends Sprite { } }//package
Section 293
//Play_Click (Play_Click) package { import flash.media.*; public dynamic class Play_Click extends Sound { } }//package
Section 294
//Play_Out (Play_Out) package { import flash.media.*; public dynamic class Play_Out extends Sound { } }//package
Section 295
//Play_Over (Play_Over) package { import flash.media.*; public dynamic class Play_Over extends Sound { } }//package
Section 296
//PlayerSnap (PlayerSnap) package { import flash.display.*; public dynamic class PlayerSnap extends Sprite { } }//package
Section 297
//PlusOneSnap (PlusOneSnap) package { import flash.display.*; public dynamic class PlusOneSnap extends Sprite { } }//package
Section 298
//PlusOneZone (PlusOneZone) package { import game.*; public dynamic class PlusOneZone extends PlusOnePowerUp { } }//package
Section 299
//Poly_Icon (Poly_Icon) package { import flash.display.*; public dynamic class Poly_Icon extends Sprite { } }//package
Section 300
//Pow1_Icon (Pow1_Icon) package { import flash.display.*; public dynamic class Pow1_Icon extends MovieClip { } }//package
Section 301
//Pow2_Icon (Pow2_Icon) package { import flash.display.*; public dynamic class Pow2_Icon extends MovieClip { } }//package
Section 302
//Pow3_Icon (Pow3_Icon) package { import flash.display.*; public dynamic class Pow3_Icon extends MovieClip { } }//package
Section 303
//Pow4_Icon (Pow4_Icon) package { import flash.display.*; public dynamic class Pow4_Icon extends MovieClip { } }//package
Section 304
//Protection (Protection) package { import flash.net.*; import com.kongregate.*; public class Protection { private static const instructionURL:String = "http://www.kongregate.com/forums/3/topics/50004/?gamereferral=pyro2"; public static const URL:Object = {Kongregate:"http://www.kongregate.com/?gamereferral=pyro2", Mike:"http://www.kongregate.com/accounts/damijin?gamereferral=pyro2", Greg:"http://www.kongregate.com/?gamereferral=pyro2", BubbleBox:"http://www.kongregate.com/?gamereferral=pyro2", Andkon:"http://www.kongregate.com/?gamereferral=pyro2", Addicting:"http://www.kongregate.com/?gamereferral=pyro2", Armor:"http://www.kongregate.com/?gamereferral=pyro2", BigFish:"http://www.kongregate.com/?gamereferral=pyro2", CrazyMonkey:"http://www.kongregate.com/?gamereferral=pyro2", unknown:"http://www.kongregate.com/?gamereferral=pyro2", localhost:"http://www.kongregate.com/?gamereferral=pyro2"}; private static const levelSharingURL:String = "http://www.kongregate.com/forums/3/topics/52949/?gamereferral=pyro2"; private static const guideURL:String = "http://www.kongregate.com/forums/3/topics/52948/?gamereferral=pyro2"; public static const debug:Boolean = false; private static var _domain:String = ""; private static var _url:String = "http://www.kongregate.com/?gamereferral=pyro2"; public static var kongAPI:ApiConnection; public function Protection():void{ } public static function get domain():String{ if (_domain == ""){ _domain = domainCheck(); _url = URL[_domain]; }; return (_domain); } public static function get showMochi():Boolean{ switch (domain){ case "Kongregate": return (false); }; return (true); } public static function toGuide():void{ navigateToURL(new URLRequest(guideURL), "_blank"); } public static function toInstruction():void{ navigateToURL(new URLRequest(instructionURL), "_blank"); } public static function get skipable():Boolean{ return (true); } public static function toLevelSharing():void{ navigateToURL(new URLRequest(levelSharingURL), "_blank"); } public static function toSponsor():void{ navigateToURL(new URLRequest(url), "_blank"); } private static function domainCheck():String{ var _local1:String = new LocalConnection().domain.toLowerCase(); if (_local1 == "localhost"){ return ("localhost"); }; var _local2:String = _local1.substr(-14); if (_local2 == "kongregate.com"){ return ("Kongregate"); }; _local2 = _local1.substr(-19); if (_local2 == "kongregatestage.com"){ return ("Kongregate"); }; _local2 = _local1.substr(-19); if (_local2 == "kongregatetrunk.com"){ return ("Kongregate"); }; _local2 = _local1.substr(-14); if (_local2 == "armorgames.com"){ return ("Armor"); }; _local2 = _local1.substr(-15); if (_local2 == "samplerinfo.com"){ return ("Greg"); }; _local2 = _local1.substr(-18); if (_local2 == "addictinggames.com"){ return ("Addicting"); }; _local2 = _local1.substr(-20); if (_local2 == "crazymonkeygames.com"){ return ("CrazyMonkey"); }; _local2 = _local1.substr(-13); if (_local2 == "bubblebox.com"){ return ("BubbleBox"); }; _local2 = _local1.substr(-10); if (_local2 == "andkon.com"){ return ("Andkon"); }; switch (_local1){ case "games.bigfishgames.com": case "bigfishgames.com": case "bigfishgames.de": case "bigfishgames.fr": case "bigfishgames.es": case "bigfishgames.mx": case "bigfishgames.jp": return ("BigFish"); }; return ("unknown"); } public static function get url():String{ if (_domain == ""){ _domain = domainCheck(); _url = URL[_domain]; }; return (_url); } public static function get sponsorVisible():Boolean{ return (true); } } }//package
Section 305
//Pyro2 (Pyro2) package { import screen.*; import flash.display.*; import flash.events.*; import flash.utils.*; import mochi.as3.*; import theme.*; import com.kongregate.*; import flash.system.*; import flash.ui.*; public class Pyro2 extends MovieClip { public var mochiClip:MovieClip; public var loader:FlameLoaderScreen; private var connectTimer:Timer; public var _mochiads_game_id:String;// = "4675da57e1f418a9" public function Pyro2():void{ connectTimer = new Timer(5000); super(); addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4); Security.allowDomain("*"); addEventListener(Event.ENTER_FRAME, connectToKong); } private function connectToKong(_arg1:Event):void{ removeEventListener(Event.ENTER_FRAME, connectToKong); Protection.kongAPI = new ApiConnection(stage); if ((((((Protection.domain == "localhost")) && (Protection.debug))) || ((Protection.domain == "Kongregate")))){ }; connectTimer.addEventListener(TimerEvent.TIMER, checkConnection); Protection.kongAPI.connect(); } function frame2(){ stop(); } function frame4(){ stop(); if (Protection.debug){ if (Protection.kongAPI.userLevelAvailable){ loader.loadUserLevel(); } else { loader.transitionTo(AbstractScreen.screens.MainMenu); }; } else { loader.transitionTo(AbstractScreen.screens.DamijinIntro); }; } function frame1(){ init(); } private function checkConnection(_arg1:TimerEvent):void{ if (((!(Protection.kongAPI.connected)) && ((Protection.domain == "Kongregate")))){ Protection.kongAPI.connect(); } else { connectTimer.stop(); connectTimer.removeEventListener(TimerEvent.TIMER, checkConnection); connectTimer = null; }; } function init():void{ stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; var _local1:ContextMenu = new ContextMenu(); _local1.hideBuiltInItems(); this.contextMenu = _local1; if (((Protection.showMochi) && (!(Protection.debug)))){ MochiAd.showPreGameAd({id:_mochiads_game_id, res:"550x500", clip:mochiClip, no_bg:true, ad_finished:mochiFinished}); stop(); }; } function mochiFinished():void{ play(); } function frame3(){ initScreens(); } private function initScreens():void{ var _local1:AbstractScreen; Darkroom.apply(); AbstractScreen._parent = this; _local1 = new DamijinIntroScreen(); _local1 = new GregIntroScreen(); _local1 = new MainMenuScreen(); _local1 = new LevelSelectorScreen(); _local1 = new PlayerLevelSelectorScreen(); _local1 = new LevelEditorScreen(); _local1 = new CreditsScreen(); _local1 = new WinScreen(); } } }//package
Section 306
//Rect_Icon (Rect_Icon) package { import flash.display.*; public dynamic class Rect_Icon extends Sprite { } }//package
Section 307
//RedFlamePalette (RedFlamePalette) package { import flash.display.*; public dynamic class RedFlamePalette extends Sprite { } }//package
Section 308
//RT_Icon (RT_Icon) package { import flash.display.*; public dynamic class RT_Icon extends Sprite { } }//package
Section 309
//RTorch (RTorch) package { import game.*; public dynamic class RTorch extends TorchBase { } }//package
Section 310
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_disabledSkin extends MovieClip { } }//package
Section 311
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_downSkin extends MovieClip { } }//package
Section 312
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_overSkin extends MovieClip { } }//package
Section 313
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_upSkin extends MovieClip { } }//package
Section 314
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_disabledSkin extends MovieClip { } }//package
Section 315
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_downSkin extends MovieClip { } }//package
Section 316
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_overSkin extends MovieClip { } }//package
Section 317
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_upSkin extends MovieClip { } }//package
Section 318
//ScrollBar_thumbIcon (ScrollBar_thumbIcon) package { import flash.display.*; public dynamic class ScrollBar_thumbIcon extends MovieClip { } }//package
Section 319
//ScrollThumb_downSkin (ScrollThumb_downSkin) package { import flash.display.*; public dynamic class ScrollThumb_downSkin extends MovieClip { } }//package
Section 320
//ScrollThumb_overSkin (ScrollThumb_overSkin) package { import flash.display.*; public dynamic class ScrollThumb_overSkin extends MovieClip { } }//package
Section 321
//ScrollThumb_upSkin (ScrollThumb_upSkin) package { import flash.display.*; public dynamic class ScrollThumb_upSkin extends MovieClip { } }//package
Section 322
//ScrollTrack_disabledSkin (ScrollTrack_disabledSkin) package { import flash.display.*; public dynamic class ScrollTrack_disabledSkin extends MovieClip { } }//package
Section 323
//ScrollTrack_skin (ScrollTrack_skin) package { import flash.display.*; public dynamic class ScrollTrack_skin extends MovieClip { } }//package
Section 324
//TextArea_disabledSkin (TextArea_disabledSkin) package { import flash.display.*; public dynamic class TextArea_disabledSkin extends MovieClip { } }//package
Section 325
//TextArea_upSkin (TextArea_upSkin) package { import flash.display.*; public dynamic class TextArea_upSkin extends MovieClip { } }//package
Section 326
//TextInput_disabledSkin (TextInput_disabledSkin) package { import flash.display.*; public dynamic class TextInput_disabledSkin extends MovieClip { } }//package
Section 327
//TextInput_upSkin (TextInput_upSkin) package { import flash.display.*; public dynamic class TextInput_upSkin extends MovieClip { } }//package
Section 328
//TextMask (TextMask) package { import flash.display.*; public dynamic class TextMask extends Sprite { } }//package
Section 329
//Thock_0 (Thock_0) package { import flash.media.*; public dynamic class Thock_0 extends Sound { } }//package
Section 330
//Thock_1 (Thock_1) package { import flash.media.*; public dynamic class Thock_1 extends Sound { } }//package
Section 331
//Thunk_0 (Thunk_0) package { import flash.media.*; public dynamic class Thunk_0 extends Sound { } }//package
Section 332
//Thunk_1 (Thunk_1) package { import flash.media.*; public dynamic class Thunk_1 extends Sound { } }//package
Section 333
//Thunk_2 (Thunk_2) package { import flash.media.*; public dynamic class Thunk_2 extends Sound { } }//package
Section 334
//Thunk_3 (Thunk_3) package { import flash.media.*; public dynamic class Thunk_3 extends Sound { } }//package
Section 335
//TinyBoxFont (TinyBoxFont) package { import flash.text.*; public dynamic class TinyBoxFont extends Font { } }//package
Section 336
//TitleFlamePalette (TitleFlamePalette) package { import flash.display.*; public dynamic class TitleFlamePalette extends Sprite { } }//package
Section 337
//TitleTextMaskII (TitleTextMaskII) package { import flash.display.*; public dynamic class TitleTextMaskII extends Sprite { } }//package
Section 338
//Torch (Torch) package { import game.*; public dynamic class Torch extends TorchBase { } }//package
Section 339
//Torch_0 (Torch_0) package { import flash.media.*; public dynamic class Torch_0 extends Sound { } }//package
Section 340
//Torch_1 (Torch_1) package { import flash.media.*; public dynamic class Torch_1 extends Sound { } }//package
Section 341
//Torch_2 (Torch_2) package { import flash.media.*; public dynamic class Torch_2 extends Sound { } }//package
Section 342
//Torch_3 (Torch_3) package { import flash.media.*; public dynamic class Torch_3 extends Sound { } }//package
Section 343
//TorchHitArea (TorchHitArea) package { import flash.display.*; public dynamic class TorchHitArea extends Sprite { } }//package
Section 344
//TransparentBlueFlamePalette (TransparentBlueFlamePalette) package { import flash.display.*; public dynamic class TransparentBlueFlamePalette extends Sprite { } }//package
Section 345
//TransparentCreditFlamePalette (TransparentCreditFlamePalette) package { import flash.display.*; public dynamic class TransparentCreditFlamePalette extends Sprite { } }//package
Section 346
//TransparentFlamePalette (TransparentFlamePalette) package { import flash.display.*; public dynamic class TransparentFlamePalette extends Sprite { } }//package
Section 347
//TransparentGreenFlamePalette (TransparentGreenFlamePalette) package { import flash.display.*; public dynamic class TransparentGreenFlamePalette extends Sprite { } }//package
Section 348
//TransparentRedFlamePalette (TransparentRedFlamePalette) package { import flash.display.*; public dynamic class TransparentRedFlamePalette extends Sprite { } }//package
Section 349
//Win (Win) package { import flash.media.*; public dynamic class Win extends Sound { } }//package
Section 350
//Wood_00 (Wood_00) package { import flash.display.*; public dynamic class Wood_00 extends BitmapData { public function Wood_00(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 351
//Wood_01 (Wood_01) package { import flash.display.*; public dynamic class Wood_01 extends BitmapData { public function Wood_01(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 352
//Wood_02 (Wood_02) package { import flash.display.*; public dynamic class Wood_02 extends BitmapData { public function Wood_02(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 353
//Wood_03 (Wood_03) package { import flash.display.*; public dynamic class Wood_03 extends BitmapData { public function Wood_03(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 354
//Wood_04 (Wood_04) package { import flash.display.*; public dynamic class Wood_04 extends BitmapData { public function Wood_04(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package

Library Items

Symbol 1 GraphicUsed by:Timeline
Symbol 2 MovieClipUsed by:Timeline
Symbol 3 FontUsed by:4
Symbol 4 EditableTextUses:3Used by:Timeline
Symbol 5 MovieClip {fl.core.ComponentShim}Used by:103 104 119 138 161 187 188 193 201 202
Symbol 6 GraphicUsed by:44
Symbol 7 GraphicUsed by:35
Symbol 8 GraphicUsed by:34
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClipUses:9Used by:27 34
Symbol 11 GraphicUsed by:12
Symbol 12 MovieClipUses:11Used by:26 34
Symbol 13 GraphicUsed by:14
Symbol 14 MovieClipUses:13Used by:21 26 27 34
Symbol 15 GraphicUsed by:16
Symbol 16 MovieClipUses:15Used by:21 26 27 34
Symbol 17 GraphicUsed by:18
Symbol 18 MovieClipUses:17Used by:21 26 27 34
Symbol 19 GraphicUsed by:20
Symbol 20 MovieClipUses:19Used by:21 26 27 34
Symbol 21 MovieClipUses:14 16 18 20Used by:34
Symbol 22 GraphicUsed by:23
Symbol 23 MovieClipUses:22Used by:34
Symbol 24 GraphicUsed by:27
Symbol 25 GraphicUsed by:27
Symbol 26 MovieClipUses:12 14 16 18 20Used by:27
Symbol 27 MovieClipUses:24 10 25 26 14 16 18 20Used by:34
Symbol 28 GraphicUsed by:29
Symbol 29 MovieClipUses:28Used by:34
Symbol 30 FontUsed by:32
Symbol 31 FontUsed by:32
Symbol 32 TextUses:30 31Used by:33
Symbol 33 MovieClipUses:32Used by:34
Symbol 34 MovieClip {Kong_Logo}Uses:8 10 12 21 23 14 16 18 20 27 29 33Used by:35
Symbol 35 MovieClip {Kong_Logo_Pyro}Uses:7 34Used by:44
Symbol 36 Font {TinyBoxFont}Used by:37 206 222 366 380 384 582 584 586 590 592 594 597 598 599
Symbol 37 EditableTextUses:36Used by:44
Symbol 38 GraphicUsed by:44
Symbol 39 MovieClipUsed by:44
Symbol 40 GraphicUsed by:41
Symbol 41 MovieClip {TransparentFlamePalette}Uses:40Used by:44 635
Symbol 42 GraphicUsed by:43
Symbol 43 MovieClipUses:42Used by:44
Symbol 44 MovieClip {screen.FlameLoaderScreen}Uses:6 35 37 38 39 41 43Used by:Timeline
Symbol 45 Bitmap {Wood_04}
Symbol 46 Bitmap {Wood_03}
Symbol 47 Bitmap {Wood_02}
Symbol 48 Bitmap {Wood_01}
Symbol 49 Bitmap {Wood_00}
Symbol 50 Bitmap {Dis_04}
Symbol 51 Bitmap {Dis_03}
Symbol 52 Bitmap {Dis_02}
Symbol 53 Bitmap {Dis_01}
Symbol 54 Bitmap {Dis_00}
Symbol 55 Bitmap {DarkWood_04}
Symbol 56 Bitmap {DarkWood_03}
Symbol 57 Bitmap {DarkWood_02}
Symbol 58 Bitmap {DarkWood_01}
Symbol 59 Bitmap {DarkWood_00}
Symbol 60 Bitmap {DarkDis_04}
Symbol 61 Bitmap {DarkDis_03}
Symbol 62 Bitmap {DarkDis_02}
Symbol 63 Bitmap {DarkDis_01}
Symbol 64 Bitmap {DarkDis_00}
Symbol 65 Bitmap {Burn_04}
Symbol 66 Bitmap {Burn_03}
Symbol 67 Bitmap {Burn_02}
Symbol 68 Bitmap {Burn_01}
Symbol 69 Bitmap {Burn_00}
Symbol 70 GraphicUsed by:71
Symbol 71 MovieClip {DisplayScreenHit}Uses:70Used by:87 635
Symbol 72 GraphicUsed by:73
Symbol 73 MovieClipUses:72Used by:87
Symbol 74 BitmapUsed by:75
Symbol 75 GraphicUses:74Used by:76 635
Symbol 76 MovieClip {ButtonDisplay}Uses:75Used by:79
Symbol 77 GraphicUsed by:78
Symbol 78 MovieClip {ButtonHitArea}Uses:77Used by:79 635
Symbol 79 MovieClip {com.leveleditor.SpawnerEditor}Uses:76 78Used by:87 391 635
Symbol 80 GraphicUsed by:81
Symbol 81 MovieClipUses:80Used by:82 635
Symbol 82 MovieClipUses:81Used by:85
Symbol 83 GraphicUsed by:84 198 232 391 415 435 487 497 601 635
Symbol 84 MovieClipUses:83Used by:85 86 87
Symbol 85 MovieClipUses:82 84Used by:87 372
Symbol 86 MovieClipUses:84Used by:87 372
Symbol 87 MovieClip {com.leveleditor.EditorDisplay}Uses:71 73 79 85 86 84Used by:204 635
Symbol 88 BitmapUsed by:89
Symbol 89 GraphicUses:88Used by:90
Symbol 90 MovieClipUses:89Used by:194 379
Symbol 91 GraphicUsed by:92
Symbol 92 MovieClipUses:91Used by:194 203 221 223 379
Symbol 93 GraphicUsed by:94
Symbol 94 MovieClipUses:93Used by:194 203 379
Symbol 95 GraphicUsed by:96
Symbol 96 MovieClipUses:95Used by:103 104 119 138 188 193 201 202 635
Symbol 97 GraphicUsed by:98 199
Symbol 98 MovieClip {TextInput_disabledSkin}Uses:97Used by:103 635
Symbol 99 GraphicUsed by:100 200
Symbol 100 MovieClip {TextInput_upSkin}Uses:99Used by:103 635
Symbol 101 GraphicUsed by:102
Symbol 102 MovieClip {focusRectSkin}Uses:101Used by:103 119 138 187 188 193 201 202 635
Symbol 103 MovieClip {fl.controls.TextInput}Uses:96 5 98 100 102Used by:193 194 635
Symbol 104 MovieClip {fl.controls.Label}Uses:96 5Used by:194 203 379 635
Symbol 105 GraphicUsed by:106
Symbol 106 MovieClip {CheckBox_upIcon}Uses:105Used by:119 635
Symbol 107 GraphicUsed by:108
Symbol 108 MovieClip {CheckBox_overIcon}Uses:107Used by:119 635
Symbol 109 GraphicUsed by:110 111
Symbol 110 MovieClip {CheckBox_downIcon}Uses:109Used by:119 635
Symbol 111 MovieClip {CheckBox_disabledIcon}Uses:109Used by:119 635
Symbol 112 GraphicUsed by:113 114
Symbol 113 MovieClip {CheckBox_selectedUpIcon}Uses:112Used by:119 635
Symbol 114 MovieClip {CheckBox_selectedOverIcon}Uses:112Used by:119 635
Symbol 115 GraphicUsed by:116
Symbol 116 MovieClip {CheckBox_selectedDownIcon}Uses:115Used by:119 635
Symbol 117 GraphicUsed by:118
Symbol 118 MovieClip {CheckBox_selectedDisabledIcon}Uses:117Used by:119 635
Symbol 119 MovieClip {fl.controls.CheckBox}Uses:96 5 106 108 110 111 113 114 116 118 102Used by:194 635
Symbol 120 GraphicUsed by:121
Symbol 121 MovieClip {Button_disabledSkin}Uses:120Used by:138 635
Symbol 122 GraphicUsed by:123
Symbol 123 MovieClip {Button_downSkin}Uses:122Used by:138 635
Symbol 124 GraphicUsed by:125
Symbol 125 MovieClip {Button_emphasizedSkin}Uses:124Used by:138 635
Symbol 126 GraphicUsed by:127
Symbol 127 MovieClip {Button_overSkin}Uses:126Used by:138 635
Symbol 128 GraphicUsed by:129
Symbol 129 MovieClip {Button_selectedDisabledSkin}Uses:128Used by:138 635
Symbol 130 GraphicUsed by:131
Symbol 131 MovieClip {Button_selectedDownSkin}Uses:130Used by:138 635
Symbol 132 GraphicUsed by:133
Symbol 133 MovieClip {Button_selectedOverSkin}Uses:132Used by:138 635
Symbol 134 GraphicUsed by:135
Symbol 135 MovieClip {Button_selectedUpSkin}Uses:134Used by:138 635
Symbol 136 GraphicUsed by:137
Symbol 137 MovieClip {Button_upSkin}Uses:136Used by:138 635
Symbol 138 MovieClip {fl.controls.Button}Uses:96 5 121 123 125 127 129 131 133 135 137 102Used by:194 203 221 223 371 378 379 381 414 435 635
Symbol 139 GraphicUsed by:140
Symbol 140 MovieClip {ComboBox_upSkin}Uses:139Used by:193 635
Symbol 141 GraphicUsed by:142
Symbol 142 MovieClip {ComboBox_disabledSkin}Uses:141Used by:193 635
Symbol 143 GraphicUsed by:144
Symbol 144 MovieClip {List_skin}Uses:143Used by:188 635
Symbol 145 GraphicUsed by:146
Symbol 146 MovieClip {CellRenderer_upSkin}Uses:145Used by:161 635
Symbol 147 GraphicUsed by:148
Symbol 148 MovieClip {CellRenderer_disabledSkin}Uses:147Used by:161 635
Symbol 149 GraphicUsed by:150
Symbol 150 MovieClip {CellRenderer_downSkin}Uses:149Used by:161 635
Symbol 151 GraphicUsed by:152
Symbol 152 MovieClip {CellRenderer_overSkin}Uses:151Used by:161 635
Symbol 153 GraphicUsed by:154
Symbol 154 MovieClip {CellRenderer_selectedDisabledSkin}Uses:153Used by:161 635
Symbol 155 GraphicUsed by:156
Symbol 156 MovieClip {CellRenderer_selectedDownSkin}Uses:155Used by:161 635
Symbol 157 GraphicUsed by:158
Symbol 158 MovieClip {CellRenderer_selectedOverSkin}Uses:157Used by:161 635
Symbol 159 GraphicUsed by:160
Symbol 160 MovieClip {CellRenderer_selectedUpSkin}Uses:159Used by:161 635
Symbol 161 MovieClip {fl.controls.listClasses.CellRenderer}Uses:146 5 148 150 152 154 156 158 160Used by:188 635
Symbol 162 GraphicUsed by:163
Symbol 163 MovieClip {ScrollTrack_skin}Uses:162Used by:187 201 635
Symbol 164 GraphicUsed by:167 175 176
Symbol 165 GraphicUsed by:166 169 173 180 635
Symbol 166 MovieClipUses:165Used by:167 175 176 635
Symbol 167 MovieClip {ScrollArrowUp_downSkin}Uses:164 166Used by:187 201 635
Symbol 168 GraphicUsed by:169
Symbol 169 MovieClip {ScrollArrowDown_downSkin}Uses:168 165Used by:187 201 635
Symbol 170 GraphicUsed by:171 174
Symbol 171 MovieClip {ScrollThumb_downSkin}Uses:170Used by:187 201 635
Symbol 172 GraphicUsed by:173
Symbol 173 MovieClip {ScrollArrowDown_overSkin}Uses:172 165Used by:187 201 635
Symbol 174 MovieClip {ScrollThumb_overSkin}Uses:170Used by:187 201 635
Symbol 175 MovieClip {ScrollArrowUp_overSkin}Uses:164 166Used by:187 201 635
Symbol 176 MovieClip {ScrollArrowUp_upSkin}Uses:164 166Used by:187 201 635
Symbol 177 GraphicUsed by:178
Symbol 178 MovieClip {ScrollThumb_upSkin}Uses:177Used by:187 201 635
Symbol 179 GraphicUsed by:180
Symbol 180 MovieClip {ScrollArrowDown_upSkin}Uses:179 165Used by:187 201 635
Symbol 181 GraphicUsed by:182
Symbol 182 MovieClip {ScrollArrowDown_disabledSkin}Uses:181Used by:187 201 635
Symbol 183 GraphicUsed by:184
Symbol 184 MovieClip {ScrollArrowUp_disabledSkin}Uses:183Used by:187 201 635
Symbol 185 GraphicUsed by:186
Symbol 186 MovieClip {ScrollBar_thumbIcon}Uses:185Used by:187 201 635
Symbol 187 MovieClip {fl.controls.ScrollBar}Uses:163 5 102 167 169 171 173 174 175 176 178 180 182 184 186Used by:188 635
Symbol 188 MovieClip {fl.controls.List}Uses:96 5 144 161 102 187Used by:193 221 223 635
Symbol 189 GraphicUsed by:190
Symbol 190 MovieClip {ComboBox_overSkin}Uses:189Used by:193 635
Symbol 191 GraphicUsed by:192
Symbol 192 MovieClip {ComboBox_downSkin}Uses:191Used by:193 635
Symbol 193 MovieClip {fl.controls.ComboBox}Uses:96 5 102 140 142 103 188 190 192Used by:194 635
Symbol 194 MovieClip {com.leveleditor.EditorPanel}Uses:90 92 94 103 104 119 138 193Used by:204 635
Symbol 195 GraphicUsed by:203 381
Symbol 196 GraphicUsed by:198
Symbol 197 GraphicUsed by:198
Symbol 198 ButtonUses:196 197 83Used by:203 635
Symbol 199 MovieClip {TextArea_disabledSkin}Uses:97Used by:202 635
Symbol 200 MovieClip {TextArea_upSkin}Uses:99Used by:202 635
Symbol 201 MovieClip {fl.controls.UIScrollBar}Uses:96 5 102 163 167 169 171 173 174 175 176 178 180 182 184 186Used by:202
Symbol 202 MovieClip {fl.controls.TextArea}Uses:96 5 199 200 102 201Used by:203 635
Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204}Uses:195 94 92 198 202 138 104Used by:204
Symbol 204 MovieClip {screen.LevelEditorScreen}Uses:87 194 203
Symbol 205 GraphicUsed by:221 223
Symbol 206 EditableTextUses:36Used by:221
Symbol 207 FontUsed by:208 209 376 377 420 421 422 423 424 427 430 431 432 433
Symbol 208 TextUses:207Used by:211
Symbol 209 TextUses:207Used by:211
Symbol 210 GraphicUsed by:211
Symbol 211 ButtonUses:208 209 210Used by:221 635
Symbol 212 GraphicUsed by:213
Symbol 213 MovieClipUses:212Used by:215
Symbol 214 GraphicUsed by:215
Symbol 215 ButtonUses:213 214Used by:221 361
Symbol 216 GraphicUsed by:220
Symbol 217 FontUsed by:218 388 411
Symbol 218 TextUses:217Used by:220
Symbol 219 GraphicUsed by:220
Symbol 220 MovieClipUses:216 218 219Used by:221 223 635
Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen}Uses:205 206 138 92 211 215 188 220
Symbol 222 EditableTextUses:36Used by:223
Symbol 223 MovieClip {screen.LevelSelectorScreen}Uses:205 222 138 92 188 220
Symbol 224 GraphicUsed by:356
Symbol 225 FontUsed by:226 227
Symbol 226 TextUses:225Used by:356
Symbol 227 TextUses:225Used by:356
Symbol 228 FontUsed by:229 230 231 370 474
Symbol 229 TextUses:228Used by:232
Symbol 230 TextUses:228Used by:232
Symbol 231 TextUses:228Used by:232
Symbol 232 ButtonUses:229 230 231 83Used by:356 472 635
Symbol 233 SoundUsed by:356 635
Symbol 234 BitmapUsed by:235
Symbol 235 GraphicUses:234Used by:356
Symbol 236 BitmapUsed by:237
Symbol 237 GraphicUses:236Used by:356
Symbol 238 BitmapUsed by:239
Symbol 239 GraphicUses:238Used by:356
Symbol 240 BitmapUsed by:241
Symbol 241 GraphicUses:240Used by:356
Symbol 242 BitmapUsed by:243
Symbol 243 GraphicUses:242Used by:356
Symbol 244 BitmapUsed by:245
Symbol 245 GraphicUses:244Used by:356
Symbol 246 BitmapUsed by:247
Symbol 247 GraphicUses:246Used by:356
Symbol 248 BitmapUsed by:249
Symbol 249 GraphicUses:248Used by:356
Symbol 250 BitmapUsed by:251
Symbol 251 GraphicUses:250Used by:356
Symbol 252 BitmapUsed by:253
Symbol 253 GraphicUses:252Used by:356
Symbol 254 BitmapUsed by:255
Symbol 255 GraphicUses:254Used by:356
Symbol 256 BitmapUsed by:257
Symbol 257 GraphicUses:256Used by:356
Symbol 258 BitmapUsed by:259
Symbol 259 GraphicUses:258Used by:356
Symbol 260 BitmapUsed by:261
Symbol 261 GraphicUses:260Used by:356
Symbol 262 BitmapUsed by:263
Symbol 263 GraphicUses:262Used by:356
Symbol 264 BitmapUsed by:265
Symbol 265 GraphicUses:264Used by:356
Symbol 266 BitmapUsed by:267
Symbol 267 GraphicUses:266Used by:356
Symbol 268 BitmapUsed by:269
Symbol 269 GraphicUses:268Used by:356
Symbol 270 BitmapUsed by:271
Symbol 271 GraphicUses:270Used by:356
Symbol 272 BitmapUsed by:273
Symbol 273 GraphicUses:272Used by:356
Symbol 274 BitmapUsed by:275
Symbol 275 GraphicUses:274Used by:356
Symbol 276 BitmapUsed by:277
Symbol 277 GraphicUses:276Used by:356
Symbol 278 BitmapUsed by:279
Symbol 279 GraphicUses:278Used by:356
Symbol 280 BitmapUsed by:281
Symbol 281 GraphicUses:280Used by:356
Symbol 282 BitmapUsed by:283
Symbol 283 GraphicUses:282Used by:356
Symbol 284 BitmapUsed by:285
Symbol 285 GraphicUses:284Used by:356
Symbol 286 BitmapUsed by:287
Symbol 287 GraphicUses:286Used by:356
Symbol 288 BitmapUsed by:289
Symbol 289 GraphicUses:288Used by:356
Symbol 290 BitmapUsed by:291
Symbol 291 GraphicUses:290Used by:356
Symbol 292 BitmapUsed by:293
Symbol 293 GraphicUses:292Used by:356
Symbol 294 BitmapUsed by:295
Symbol 295 GraphicUses:294Used by:356
Symbol 296 BitmapUsed by:297
Symbol 297 GraphicUses:296Used by:356
Symbol 298 BitmapUsed by:299
Symbol 299 GraphicUses:298Used by:356
Symbol 300 BitmapUsed by:301
Symbol 301 GraphicUses:300Used by:356
Symbol 302 BitmapUsed by:303
Symbol 303 GraphicUses:302Used by:356
Symbol 304 BitmapUsed by:305
Symbol 305 GraphicUses:304Used by:356
Symbol 306 BitmapUsed by:307
Symbol 307 GraphicUses:306Used by:356
Symbol 308 BitmapUsed by:309
Symbol 309 GraphicUses:308Used by:356
Symbol 310 BitmapUsed by:311
Symbol 311 GraphicUses:310Used by:356
Symbol 312 BitmapUsed by:313
Symbol 313 GraphicUses:312Used by:356
Symbol 314 BitmapUsed by:315
Symbol 315 GraphicUses:314Used by:356
Symbol 316 BitmapUsed by:317
Symbol 317 GraphicUses:316Used by:356
Symbol 318 BitmapUsed by:319
Symbol 319 GraphicUses:318Used by:356
Symbol 320 BitmapUsed by:321
Symbol 321 GraphicUses:320Used by:356
Symbol 322 BitmapUsed by:323
Symbol 323 GraphicUses:322Used by:356
Symbol 324 BitmapUsed by:325
Symbol 325 GraphicUses:324Used by:356
Symbol 326 BitmapUsed by:327
Symbol 327 GraphicUses:326Used by:356
Symbol 328 BitmapUsed by:329
Symbol 329 GraphicUses:328Used by:356
Symbol 330 BitmapUsed by:331
Symbol 331 GraphicUses:330Used by:356
Symbol 332 BitmapUsed by:333
Symbol 333 GraphicUses:332Used by:356
Symbol 334 BitmapUsed by:335
Symbol 335 GraphicUses:334Used by:356
Symbol 336 BitmapUsed by:337
Symbol 337 GraphicUses:336Used by:356
Symbol 338 BitmapUsed by:339
Symbol 339 GraphicUses:338Used by:356
Symbol 340 BitmapUsed by:341
Symbol 341 GraphicUses:340Used by:356
Symbol 342 BitmapUsed by:343
Symbol 343 GraphicUses:342Used by:356
Symbol 344 BitmapUsed by:345
Symbol 345 GraphicUses:344Used by:356
Symbol 346 BitmapUsed by:347
Symbol 347 GraphicUses:346Used by:356
Symbol 348 BitmapUsed by:349
Symbol 349 GraphicUses:348Used by:356
Symbol 350 BitmapUsed by:351
Symbol 351 GraphicUses:350Used by:356
Symbol 352 BitmapUsed by:353
Symbol 353 GraphicUses:352Used by:356
Symbol 354 BitmapUsed by:355
Symbol 355 GraphicUses:354Used by:356
Symbol 356 MovieClip {screen.DamijinIntroScreen}Uses:224 226 227 232 233 235 237 239 241 243 245 247 249 251 253 255 257 259 261 263 265 267 269 271 273 275 277 279 281 283 285 287 289 291 293 295 297 299 301 303 305 307 309 311 313 315 317 319 321 323 325 327 329 331 333 335 337 339 341 343 345 347 349 351 353 355
Symbol 357 GraphicUsed by:358
Symbol 358 MovieClip {TextMask}Uses:357Used by:360 635
Symbol 359 GraphicUsed by:360
Symbol 360 MovieClipUses:358 359Used by:371
Symbol 361 MovieClipUses:215Used by:371
Symbol 362 GraphicUsed by:363
Symbol 363 MovieClip {TitleTextMaskII}Uses:362Used by:365
Symbol 364 GraphicUsed by:365
Symbol 365 MovieClipUses:363 364Used by:371 635
Symbol 366 TextUses:36Used by:371
Symbol 367 GraphicUsed by:368
Symbol 368 MovieClip {NoiseGenerator}Uses:367Used by:369 635
Symbol 369 MovieClipUses:368Used by:371 635
Symbol 370 EditableTextUses:228Used by:371
Symbol 371 MovieClip {screen.MainMenuScreen}Uses:360 361 138 365 366 369 370
Symbol 372 MovieClipUses:85 86Used by:391 440
Symbol 373 GraphicUsed by:378
Symbol 374 FontUsed by:375
Symbol 375 EditableTextUses:374Used by:378
Symbol 376 EditableTextUses:207 412Used by:378
Symbol 377 EditableTextUses:207 412Used by:378
Symbol 378 MovieClip {Pyro2_fla.Tip_194}Uses:373 375 376 377 138Used by:379
Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193}Uses:90 94 92 138 104 378Used by:391
Symbol 380 TextUses:36Used by:381
Symbol 381 MovieClip {Pyro2_fla.LooseScreen_57}Uses:195 380 138Used by:391 635
Symbol 382 GraphicUsed by:383
Symbol 383 MovieClipUses:382Used by:390 635
Symbol 384 EditableTextUses:36Used by:385
Symbol 385 MovieClipUses:384Used by:390 635
Symbol 386 GraphicUsed by:387
Symbol 387 MovieClipUses:386Used by:390 635
Symbol 388 TextUses:217Used by:390 635
Symbol 389 SoundUsed by:390 635
Symbol 390 MovieClip {Pyro2_fla.AcedScreen_70}Uses:383 385 387 388 389Used by:391 635
Symbol 391 MovieClip {screen.GameLevelScreen}Uses:79 372 379 381 83 390
Symbol 392 GraphicUsed by:393
Symbol 393 MovieClipUses:392Used by:398
Symbol 394 FontUsed by:395
Symbol 395 EditableTextUses:394Used by:398
Symbol 396 GraphicUsed by:397
Symbol 397 MovieClipUses:396Used by:398
Symbol 398 MovieClip {com.PyroCellRenderer}Uses:393 395 397
Symbol 399 BitmapUsed by:400
Symbol 400 GraphicUses:399Used by:401
Symbol 401 MovieClip {HalfSizeSnap}Uses:400
Symbol 402 BitmapUsed by:403
Symbol 403 GraphicUses:402Used by:404
Symbol 404 MovieClip {BounceSnap}Uses:403
Symbol 405 BitmapUsed by:406
Symbol 406 GraphicUses:405Used by:407
Symbol 407 MovieClip {PlusOneSnap}Uses:406
Symbol 408 BitmapUsed by:409
Symbol 409 GraphicUses:408Used by:410
Symbol 410 MovieClip {LongLineSnap}Uses:409
Symbol 411 TextUses:217Used by:414
Symbol 412 FontUsed by:376 377 413 420 421 422 423 425 426 428 429
Symbol 413 TextUses:412Used by:414
Symbol 414 MovieClip {Pyro2_fla.WinScroll_184}Uses:411 413 138Used by:415
Symbol 415 MovieClip {screen.WinScreen}Uses:83 414
Symbol 416 GraphicUsed by:434
Symbol 417 BitmapUsed by:418
Symbol 418 GraphicUses:417Used by:419
Symbol 419 ButtonUses:418Used by:434
Symbol 420 TextUses:207 412Used by:434
Symbol 421 TextUses:207 412Used by:434
Symbol 422 TextUses:207 412Used by:434
Symbol 423 TextUses:207 412Used by:434
Symbol 424 TextUses:207Used by:434
Symbol 425 TextUses:412Used by:434
Symbol 426 TextUses:412Used by:434
Symbol 427 TextUses:207Used by:434
Symbol 428 TextUses:412Used by:434
Symbol 429 TextUses:412Used by:434
Symbol 430 TextUses:207Used by:434
Symbol 431 TextUses:207Used by:434
Symbol 432 TextUses:207Used by:434
Symbol 433 TextUses:207Used by:434
Symbol 434 MovieClipUses:416 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433Used by:435
Symbol 435 MovieClip {screen.CreditsScreen}Uses:83 434 138
Symbol 436 BitmapUsed by:437
Symbol 437 GraphicUses:436Used by:438
Symbol 438 MovieClip {PlayerSnap}Uses:437Used by:440
Symbol 439 GraphicUsed by:440 468 472
Symbol 440 MovieClip {screen.GameLevelSnapshot}Uses:439 438 372Used by:635
Symbol 441 GraphicUsed by:442
Symbol 442 MovieClipUses:441Used by:468
Symbol 443 GraphicUsed by:467
Symbol 444 GraphicUsed by:467
Symbol 445 GraphicUsed by:467
Symbol 446 GraphicUsed by:467
Symbol 447 GraphicUsed by:467
Symbol 448 GraphicUsed by:467
Symbol 449 GraphicUsed by:467
Symbol 450 GraphicUsed by:467
Symbol 451 GraphicUsed by:467
Symbol 452 GraphicUsed by:467
Symbol 453 GraphicUsed by:467
Symbol 454 GraphicUsed by:467
Symbol 455 GraphicUsed by:467
Symbol 456 GraphicUsed by:467
Symbol 457 GraphicUsed by:467
Symbol 458 GraphicUsed by:467
Symbol 459 GraphicUsed by:467
Symbol 460 GraphicUsed by:467
Symbol 461 GraphicUsed by:467
Symbol 462 GraphicUsed by:467
Symbol 463 GraphicUsed by:467
Symbol 464 GraphicUsed by:467
Symbol 465 GraphicUsed by:467
Symbol 466 GraphicUsed by:467
Symbol 467 MovieClip {screen.GregIntroTypeEffect}Uses:443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466Used by:468 635
Symbol 468 MovieClip {Pyro2_fla.GregLogo_Screen_52}Uses:439 442 467Used by:472
Symbol 469 GraphicUsed by:470
Symbol 470 MovieClipUses:469Used by:472
Symbol 471 Sound {MonitorOff}Used by:472 635
Symbol 472 MovieClip {screen.GregIntroScreen}Uses:439 468 232 470 471Used by:635
Symbol 473 GraphicUsed by:475
Symbol 474 TextUses:228Used by:475
Symbol 475 MovieClip {com.leveleditor.Pow1Editor}Uses:473 474Used by:485
Symbol 476 GraphicUsed by:477
Symbol 477 MovieClip {com.leveleditor.Pow3Editor}Uses:476Used by:484
Symbol 478 GraphicUsed by:479
Symbol 479 MovieClip {com.leveleditor.Pow4Editor}Uses:478Used by:483
Symbol 480 GraphicUsed by:481
Symbol 481 MovieClip {com.leveleditor.Pow2Editor}Uses:480Used by:482
Symbol 482 MovieClip {BounceUpZone}Uses:481Used by:635
Symbol 483 MovieClip {HalfSizeZone}Uses:479Used by:635
Symbol 484 MovieClip {LongLineZone}Uses:477Used by:635
Symbol 485 MovieClip {PlusOneZone}Uses:475Used by:635
Symbol 486 GraphicUsed by:488
Symbol 487 MovieClip {TorchHitArea}Uses:83Used by:488 490 492 635
Symbol 488 MovieClip {LTorch}Uses:486 487Used by:635
Symbol 489 GraphicUsed by:490
Symbol 490 MovieClip {RTorch}Uses:489 487Used by:635
Symbol 491 GraphicUsed by:492
Symbol 492 MovieClip {Torch}Uses:491 487Used by:635
Symbol 493 Bitmap {CrateBitmap}Used by:494 538 559 574 635
Symbol 494 MovieClipUses:493Used by:495 635
Symbol 495 MovieClip {Crate}Uses:494Used by:635
Symbol 496 Bitmap {CrateBurnBitmap}Used by:635
Symbol 497 MovieClipUses:83Used by:500 635
Symbol 498 GraphicUsed by:500
Symbol 499 GraphicUsed by:500
Symbol 500 MovieClip {DragHandle}Uses:497 498 499Used by:635
Symbol 501 MovieClip {DummyBody}Used by:635
Symbol 502 Bitmap {BrickBitmap}Used by:604 635
Symbol 503 Bitmap {MetalBitmap}Used by:635
Symbol 504 GraphicUsed by:505
Symbol 505 MovieClip {BlueFlamePalette}Uses:504Used by:635
Symbol 506 GraphicUsed by:507
Symbol 507 MovieClip {FlamePalette}Uses:506Used by:635
Symbol 508 GraphicUsed by:509
Symbol 509 MovieClip {GreenFlamePalette}Uses:508Used by:635
Symbol 510 GraphicUsed by:511
Symbol 511 MovieClip {RedFlamePalette}Uses:510Used by:635
Symbol 512 GraphicUsed by:513
Symbol 513 MovieClip {TransparentBlueFlamePalette}Uses:512Used by:635
Symbol 514 GraphicUsed by:515
Symbol 515 MovieClip {TransparentGreenFlamePalette}Uses:514Used by:635
Symbol 516 GraphicUsed by:517
Symbol 517 MovieClip {TransparentRedFlamePalette}Uses:516Used by:635
Symbol 518 GraphicUsed by:519
Symbol 519 MovieClip {TitleFlamePalette}Uses:518Used by:635
Symbol 520 GraphicUsed by:521
Symbol 521 MovieClip {TransparentCreditFlamePalette}Uses:520Used by:635
Symbol 522 GraphicUsed by:523
Symbol 523 MovieClipUses:522Used by:635
Symbol 524 GraphicUsed by:525
Symbol 525 MovieClip {ScrollTrack_disabledSkin}Uses:524Used by:635
Symbol 526 GraphicUsed by:635
Symbol 527 GraphicUsed by:530
Symbol 528 GraphicUsed by:529
Symbol 529 MovieClipUses:528Used by:530 532 534 536 538 540 542 544 546 548 550
Symbol 530 MovieClip {com.leveleditor.Pow1Cursor}Uses:527 529Used by:635
Symbol 531 GraphicUsed by:532
Symbol 532 MovieClip {com.leveleditor.Pow2Cursor}Uses:531 529Used by:635
Symbol 533 GraphicUsed by:534
Symbol 534 MovieClip {com.leveleditor.Pow3Cursor}Uses:533 529Used by:635
Symbol 535 GraphicUsed by:536
Symbol 536 MovieClip {com.leveleditor.Pow4Cursor}Uses:535 529Used by:635
Symbol 537 GraphicUsed by:538
Symbol 538 MovieClip {com.leveleditor.CrateCursor}Uses:493 537 529Used by:635
Symbol 539 GraphicUsed by:540
Symbol 540 MovieClip {com.leveleditor.LTCursor}Uses:539 529Used by:635
Symbol 541 GraphicUsed by:542
Symbol 542 MovieClip {com.leveleditor.RTCursor}Uses:541 529Used by:635
Symbol 543 GraphicUsed by:544
Symbol 544 MovieClip {com.leveleditor.CTCursor}Uses:543 529Used by:635
Symbol 545 GraphicUsed by:546
Symbol 546 MovieClip {com.leveleditor.CircCursor}Uses:545 529Used by:635
Symbol 547 GraphicUsed by:548
Symbol 548 MovieClip {com.leveleditor.RectCursor}Uses:547 529Used by:635
Symbol 549 GraphicUsed by:550
Symbol 550 MovieClip {com.leveleditor.PolyCursor}Uses:549 529Used by:635
Symbol 551 GraphicUsed by:552
Symbol 552 MovieClip {Pow2_Icon}Uses:551Used by:635
Symbol 553 GraphicUsed by:554
Symbol 554 MovieClip {Pow4_Icon}Uses:553Used by:635
Symbol 555 GraphicUsed by:556
Symbol 556 MovieClip {Pow3_Icon}Uses:555Used by:635
Symbol 557 GraphicUsed by:558
Symbol 558 MovieClip {Pow1_Icon}Uses:557Used by:635
Symbol 559 MovieClip {Crate_Icon}Uses:493Used by:635
Symbol 560 GraphicUsed by:561
Symbol 561 MovieClip {Rect_Icon}Uses:560Used by:635
Symbol 562 GraphicUsed by:563
Symbol 563 MovieClip {Circ_Icon}Uses:562Used by:635
Symbol 564 GraphicUsed by:565
Symbol 565 MovieClip {Poly_Icon}Uses:564Used by:635
Symbol 566 GraphicUsed by:567
Symbol 567 MovieClip {LT_Icon}Uses:566Used by:635
Symbol 568 GraphicUsed by:569
Symbol 569 MovieClip {RT_Icon}Uses:568Used by:635
Symbol 570 GraphicUsed by:571
Symbol 571 MovieClip {Edit_Icon}Uses:570Used by:635
Symbol 572 GraphicUsed by:573
Symbol 573 MovieClip {CT_Icon}Uses:572Used by:635
Symbol 574 MovieClip {com.leveleditor.CrateEditor}Uses:493Used by:635
Symbol 575 GraphicUsed by:576
Symbol 576 MovieClip {com.leveleditor.LTEditor}Uses:575Used by:635
Symbol 577 GraphicUsed by:578
Symbol 578 MovieClip {com.leveleditor.RTEditor}Uses:577Used by:635
Symbol 579 GraphicUsed by:580
Symbol 580 MovieClip {com.leveleditor.CTEditor}Uses:579Used by:635
Symbol 581 GraphicUsed by:588
Symbol 582 TextUses:36Used by:588
Symbol 583 GraphicUsed by:588
Symbol 584 TextUses:36Used by:588
Symbol 585 GraphicUsed by:588
Symbol 586 TextUses:36Used by:588
Symbol 587 GraphicUsed by:588
Symbol 588 ButtonUses:581 582 583 584 585 586 587Used by:635
Symbol 589 GraphicUsed by:596 600
Symbol 590 TextUses:36Used by:596
Symbol 591 GraphicUsed by:596 600
Symbol 592 TextUses:36Used by:596
Symbol 593 GraphicUsed by:596 600
Symbol 594 TextUses:36Used by:596
Symbol 595 GraphicUsed by:596 600
Symbol 596 ButtonUses:589 590 591 592 593 594 595Used by:635
Symbol 597 TextUses:36Used by:600
Symbol 598 TextUses:36Used by:600
Symbol 599 TextUses:36Used by:600
Symbol 600 ButtonUses:589 597 591 598 593 599 595Used by:635
Symbol 601 MovieClipUses:83Used by:635
Symbol 602 GraphicUsed by:603
Symbol 603 MovieClipUses:602Used by:635
Symbol 604 MovieClipUses:502Used by:635
Symbol 605 Sound {Crackle}Used by:635
Symbol 606 Sound {Flare}Used by:635
Symbol 607 Sound {Thock_0}Used by:635
Symbol 608 Sound {Thock_1}Used by:635
Symbol 609 Sound {Thunk_0}Used by:635
Symbol 610 Sound {Thunk_1}Used by:635
Symbol 611 Sound {Thunk_2}Used by:635
Symbol 612 Sound {Thunk_3}Used by:635
Symbol 613 Sound {Torch_0}Used by:635
Symbol 614 Sound {Torch_1}Used by:635
Symbol 615 Sound {Torch_2}Used by:635
Symbol 616 Sound {Torch_3}Used by:635
Symbol 617 Sound {Win}Used by:635
Symbol 618 Sound {Metal1}Used by:635
Symbol 619 Sound {Metal2}Used by:635
Symbol 620 Sound {Metal3}Used by:635
Symbol 621 Sound {Metal4}Used by:635
Symbol 622 Sound {Glass1}Used by:635
Symbol 623 Sound {Glass2}Used by:635
Symbol 624 Sound {Glass3}Used by:635
Symbol 625 Sound {Keyboard_Click_0}Used by:635
Symbol 626 Sound {Keyboard_Click_1}Used by:635
Symbol 627 Sound {Keyboard_Click_2}Used by:635
Symbol 628 Sound {Keyboard_Spacebar_0}Used by:635
Symbol 629 Sound {Keyboard_Spacebar_1}Used by:635
Symbol 630 Sound {Keyboard_Spacebar_2}Used by:635
Symbol 631 Sound {Humm}Used by:635
Symbol 632 Sound {Play_Click}Used by:635
Symbol 633 Sound {Play_Out}Used by:635
Symbol 634 Sound {Play_Over}Used by:635
Symbol 635 MovieClip {Pyro2_fla.AssetsHolder_20}Uses:83 482 483 484 485 488 490 492 495 496 368 494 500 501 502 358 503 493 41 505 507 509 511 513 515 517 519 521 365 472 381 390 103 104 119 138 188 193 202 467 487 78 106 108 110 111 113 114 116 118 523 102 96 98 100 121 123 125 127 129 131 133 135 137 140 142 190 192 144 146 148 150 152 154 156 158 160 525 163 167 169 171 173 174 175 176 178 180 182 184 186 166 165 526 199 200 161 187 530 532 534 536 538 540 542 544 546 548 550 552 554 556 558 559 561 563 565 567 569 571 573 574 576 578 580 79 71 87 194 211 198 75 81 232 588 596 600 369 601 388 220 497 603 604 383 385 387 440 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 471 233 389Used by:Timeline

Instance Names

"mochiClip"Frame 1Symbol 2 MovieClip
"loader"Frame 2Symbol 44 MovieClip {screen.FlameLoaderScreen}
"logo"Symbol 35 MovieClip {Kong_Logo_Pyro} Frame 1Symbol 34 MovieClip {Kong_Logo}
"logo"Symbol 44 MovieClip {screen.FlameLoaderScreen} Frame 1Symbol 35 MovieClip {Kong_Logo_Pyro}
"txt_status"Symbol 44 MovieClip {screen.FlameLoaderScreen} Frame 1Symbol 37 EditableText
"flameContainer"Symbol 44 MovieClip {screen.FlameLoaderScreen} Frame 1Symbol 39 MovieClip
"play_hitArea"Symbol 44 MovieClip {screen.FlameLoaderScreen} Frame 1Symbol 43 MovieClip
"background"Symbol 79 MovieClip {com.leveleditor.SpawnerEditor} Frame 1Symbol 76 MovieClip {ButtonDisplay}
"spawnHitArea"Symbol 79 MovieClip {com.leveleditor.SpawnerEditor} Frame 1Symbol 78 MovieClip {ButtonHitArea}
"_mask"Symbol 85 MovieClip Frame 1Symbol 82 MovieClip
"overlay"Symbol 85 MovieClip Frame 1Symbol 84 MovieClip
"_mask"Symbol 86 MovieClip Frame 1Symbol 84 MovieClip
"overlay"Symbol 86 MovieClip Frame 1Symbol 84 MovieClip
"editorHitArea"Symbol 87 MovieClip {com.leveleditor.EditorDisplay} Frame 1Symbol 71 MovieClip {DisplayScreenHit}
"gridBG"Symbol 87 MovieClip {com.leveleditor.EditorDisplay} Frame 1Symbol 73 MovieClip
"ballSpawner"Symbol 87 MovieClip {com.leveleditor.EditorDisplay} Frame 1Symbol 79 MovieClip {com.leveleditor.SpawnerEditor}
"brick"Symbol 87 MovieClip {com.leveleditor.EditorDisplay} Frame 1Symbol 85 MovieClip
"metal"Symbol 87 MovieClip {com.leveleditor.EditorDisplay} Frame 1Symbol 86 MovieClip
"glass"Symbol 87 MovieClip {com.leveleditor.EditorDisplay} Frame 1Symbol 86 MovieClip
"overlay"Symbol 87 MovieClip {com.leveleditor.EditorDisplay} Frame 1Symbol 84 MovieClip
"txt_torch"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 103 MovieClip {fl.controls.TextInput}
"txt_life"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 103 MovieClip {fl.controls.TextInput}
"__id0_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id1_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id2_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id3_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id4_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"txt_opt1"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 103 MovieClip {fl.controls.TextInput}
"txt_opt2"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 103 MovieClip {fl.controls.TextInput}
"__id5_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id6_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"txt_opt3"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 103 MovieClip {fl.controls.TextInput}
"txt_opt4"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 103 MovieClip {fl.controls.TextInput}
"label_opt3"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"label_opt4"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id7_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id8_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id9_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"__id10_"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"txt_name"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 103 MovieClip {fl.controls.TextInput}
"check_longGuide"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 119 MovieClip {fl.controls.CheckBox}
"btn_torchL"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_torchC"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_torchR"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_crate"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_rect"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_circ"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_edit"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_pow1"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_pow2"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_pow3"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_pow4"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_test"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_load"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_save"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"cb_Material"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 193 MovieClip {fl.controls.ComboBox}
"btn_MainMenu"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"check_grid"Symbol 194 MovieClip {com.leveleditor.EditorPanel} Frame 1Symbol 119 MovieClip {fl.controls.CheckBox}
"btn_close"Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204} Frame 1Symbol 198 Button
"txt_dialog"Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204} Frame 1Symbol 202 MovieClip {fl.controls.TextArea}
"btn_OK"Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"txt_title"Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"txt_desc"Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"btn_copy"Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_submit"Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"editor"Symbol 204 MovieClip {screen.LevelEditorScreen} Frame 1Symbol 87 MovieClip {com.leveleditor.EditorDisplay}
"editPanel"Symbol 204 MovieClip {screen.LevelEditorScreen} Frame 1Symbol 194 MovieClip {com.leveleditor.EditorPanel}
"dialog"Symbol 204 MovieClip {screen.LevelEditorScreen} Frame 1Symbol 203 MovieClip {Pyro2_fla.DialogWindow_204}
"time"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 206 EditableText
"btn_Play"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_MainMenu"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Browse"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_SubmitInfo"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 211 Button
"btn_Sponsor"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 215 Button
"levelList"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 188 MovieClip {fl.controls.List}
"aced"Symbol 221 MovieClip {screen.PlayerLevelSelectorScreen} Frame 1Symbol 220 MovieClip
"time"Symbol 223 MovieClip {screen.LevelSelectorScreen} Frame 1Symbol 222 EditableText
"btn_Play"Symbol 223 MovieClip {screen.LevelSelectorScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_MainMenu"Symbol 223 MovieClip {screen.LevelSelectorScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Sponsor"Symbol 223 MovieClip {screen.LevelSelectorScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Guide"Symbol 223 MovieClip {screen.LevelSelectorScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"levelList"Symbol 223 MovieClip {screen.LevelSelectorScreen} Frame 1Symbol 188 MovieClip {fl.controls.List}
"aced"Symbol 223 MovieClip {screen.LevelSelectorScreen} Frame 1Symbol 220 MovieClip
"btn_Skip"Symbol 356 MovieClip {screen.DamijinIntroScreen} Frame 1Symbol 232 Button
"flameMask"Symbol 360 MovieClip Frame 1Symbol 358 MovieClip {TextMask}
"agButton_btn"Symbol 361 MovieClip Frame 1Symbol 215 Button
"flameMask"Symbol 365 MovieClip Frame 1Symbol 363 MovieClip {TitleTextMaskII}
"flameMask"Symbol 369 MovieClip Frame 1Symbol 368 MovieClip {NoiseGenerator}
"maskedFlame"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 360 MovieClip
"btn_Sponsor"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 361 MovieClip
"btn_NewGame"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Editor"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Instruction"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Credits"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"maskedFlameII"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 365 MovieClip
"btn_PlayerLevels"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"maskedBall1_L"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall2_L"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall3_L"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall4_L"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall5_L"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall1_R"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall2_R"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall3_R"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall4_R"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"maskedBall5_R"Symbol 371 MovieClip {screen.MainMenuScreen} Frame 1Symbol 369 MovieClip
"brick"Symbol 372 MovieClip Frame 1Symbol 85 MovieClip
"metal"Symbol 372 MovieClip Frame 1Symbol 86 MovieClip
"glass"Symbol 372 MovieClip Frame 1Symbol 86 MovieClip
"txt_Head"Symbol 378 MovieClip {Pyro2_fla.Tip_194} Frame 1Symbol 375 EditableText
"txt_Content"Symbol 378 MovieClip {Pyro2_fla.Tip_194} Frame 1Symbol 376 EditableText
"txt_Footer"Symbol 378 MovieClip {Pyro2_fla.Tip_194} Frame 1Symbol 377 EditableText
"btn_Guide"Symbol 378 MovieClip {Pyro2_fla.Tip_194} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"level"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 92 MovieClip
"btn_StopPreview"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Restart"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"label_life"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"label_torch"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"lifeText"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"percentText"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"txt_levelName"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 104 MovieClip {fl.controls.Label}
"btn_Mute"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Suicide"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Sponsor"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Browse"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"tip"Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193} Frame 1Symbol 378 MovieClip {Pyro2_fla.Tip_194}
"btn_Retry"Symbol 381 MovieClip {Pyro2_fla.LooseScreen_57} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_LevelSelect"Symbol 381 MovieClip {Pyro2_fla.LooseScreen_57} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Sponsor"Symbol 381 MovieClip {Pyro2_fla.LooseScreen_57} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"btn_Browse"Symbol 381 MovieClip {Pyro2_fla.LooseScreen_57} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"text"Symbol 385 MovieClip Frame 1Symbol 384 EditableText
"unlockBackground"Symbol 390 MovieClip {Pyro2_fla.AcedScreen_70} Frame 1Symbol 383 MovieClip
"unlockText"Symbol 390 MovieClip {Pyro2_fla.AcedScreen_70} Frame 1Symbol 385 MovieClip
"ballSpawner"Symbol 391 MovieClip {screen.GameLevelScreen} Frame 1Symbol 79 MovieClip {com.leveleditor.SpawnerEditor}
"background"Symbol 391 MovieClip {screen.GameLevelScreen} Frame 1Symbol 372 MovieClip
"hud"Symbol 391 MovieClip {screen.GameLevelScreen} Frame 1Symbol 379 MovieClip {Pyro2_fla.HUDPanel_193}
"looseScreen"Symbol 391 MovieClip {screen.GameLevelScreen} Frame 1Symbol 381 MovieClip {Pyro2_fla.LooseScreen_57}
"acedScreen"Symbol 391 MovieClip {screen.GameLevelScreen} Frame 1Symbol 390 MovieClip {Pyro2_fla.AcedScreen_70}
"acedIcon"Symbol 398 MovieClip {com.PyroCellRenderer} Frame 1Symbol 393 MovieClip
"textField"Symbol 398 MovieClip {com.PyroCellRenderer} Frame 1Symbol 395 EditableText
"divider"Symbol 398 MovieClip {com.PyroCellRenderer} Frame 1Symbol 397 MovieClip
"btn_Back"Symbol 414 MovieClip {Pyro2_fla.WinScroll_184} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"creditScroll"Symbol 415 MovieClip {screen.WinScreen} Frame 1Symbol 414 MovieClip {Pyro2_fla.WinScroll_184}
"btn_Kong"Symbol 434 MovieClip Frame 1Symbol 419 Button
"creditScroll"Symbol 435 MovieClip {screen.CreditsScreen} Frame 1Symbol 434 MovieClip
"btn_Back"Symbol 435 MovieClip {screen.CreditsScreen} Frame 1Symbol 138 MovieClip {fl.controls.Button}
"ballSpawner"Symbol 440 MovieClip {screen.GameLevelSnapshot} Frame 1Symbol 438 MovieClip {PlayerSnap}
"background"Symbol 440 MovieClip {screen.GameLevelSnapshot} Frame 1Symbol 372 MovieClip
"anim_text"Symbol 468 MovieClip {Pyro2_fla.GregLogo_Screen_52} Frame 1Symbol 467 MovieClip {screen.GregIntroTypeEffect}
"anim_text"Symbol 472 MovieClip {screen.GregIntroScreen} Frame 1Symbol 468 MovieClip {Pyro2_fla.GregLogo_Screen_52}
"btn_Skip"Symbol 472 MovieClip {screen.GregIntroScreen} Frame 1Symbol 232 Button
"powerUpHitArea"Symbol 482 MovieClip {BounceUpZone} Frame 1Symbol 481 MovieClip {com.leveleditor.Pow2Editor}
"powerUpHitArea"Symbol 483 MovieClip {HalfSizeZone} Frame 1Symbol 479 MovieClip {com.leveleditor.Pow4Editor}
"powerUpHitArea"Symbol 484 MovieClip {LongLineZone} Frame 1Symbol 477 MovieClip {com.leveleditor.Pow3Editor}
"powerUpHitArea"Symbol 485 MovieClip {PlusOneZone} Frame 1Symbol 475 MovieClip {com.leveleditor.Pow1Editor}
"torchHitArea"Symbol 488 MovieClip {LTorch} Frame 1Symbol 487 MovieClip {TorchHitArea}
"torchHitArea"Symbol 490 MovieClip {RTorch} Frame 1Symbol 487 MovieClip {TorchHitArea}
"torchHitArea"Symbol 492 MovieClip {Torch} Frame 1Symbol 487 MovieClip {TorchHitArea}
"dummy"Symbol 495 MovieClip {Crate} Frame 1Symbol 494 MovieClip
"gauge"Symbol 500 MovieClip {DragHandle} Frame 1Symbol 497 MovieClip
"disabledIcon"Symbol 530 MovieClip {com.leveleditor.Pow1Cursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 532 MovieClip {com.leveleditor.Pow2Cursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 534 MovieClip {com.leveleditor.Pow3Cursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 536 MovieClip {com.leveleditor.Pow4Cursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 538 MovieClip {com.leveleditor.CrateCursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 540 MovieClip {com.leveleditor.LTCursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 542 MovieClip {com.leveleditor.RTCursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 544 MovieClip {com.leveleditor.CTCursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 546 MovieClip {com.leveleditor.CircCursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 548 MovieClip {com.leveleditor.RectCursor} Frame 1Symbol 529 MovieClip
"disabledIcon"Symbol 550 MovieClip {com.leveleditor.PolyCursor} Frame 1Symbol 529 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS3.




http://swfchan.com/24/118873/info.shtml
Created: 6/3 -2019 06:02:35 Last modified: 6/3 -2019 06:02:35 Server time: 22/12 -2024 12:01:09