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

swfchan turned sixteen years old today! (5may2024)

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

Main2.swf

This is the info page for
Flash #41700

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


ActionScript [AS3]
Section 1
//SceneContainer (de.popforge.revive.application.SceneContainer) package de.popforge.revive.application { import flash.events.*; import flash.display.*; import de.popforge.revive.member.*; import de.popforge.revive.forces.*; import de.popforge.revive.display.*; public class SceneContainer extends Sprite { public var simulation:Simulation; protected var mouseSpring:FixedSpring; protected var mShape:Shape; protected var mShapeImage:Shape; protected var iShape:Shape; public static const WIDTH:uint = 0x0200; public static const HEIGHT:uint = 0x0200; public static const COLOR_IMMOVABLE:uint = 0x878787; public static const COLOR_FORCE:uint = 13395507; public static const COLOR_MOVABLE:uint = 0xABABAB; protected static const MOUSE_CATCH_STRENGTH:Number = 0.5; protected static const MOUSE_CATCH_DISTANCE2:Number = 256; private static var instance:SceneContainer; public function SceneContainer(){ instance = this; iShape = new Shape(); mShape = new Shape(); mShapeImage = new Shape(); addChild(iShape); addChild(mShape); addChild(mShapeImage); simulation = new Simulation(); addEventListener(Event.ADDED, onAdded); addEventListener(Event.REMOVED, onRemoved); } protected function onMouseUp(_arg1:MouseEvent):void{ if (mouseSpring){ simulation.removeForce(mouseSpring); mouseSpring = null; }; } private function onAdded(_arg1:Event):void{ stage.addEventListener(Event.ENTER_FRAME, onEnterFrame); stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); } private function onRemoved(_arg1:Event):void{ stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame); stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp); } protected function drawImmovables():void{ var _local1:IDrawAble; iShape.graphics.lineStyle(0, COLOR_IMMOVABLE); for each (_local1 in simulation.immovables) { _local1.draw(iShape.graphics); }; } protected function createStageBounds():void{ var _local1:ImmovableGate; _local1 = new ImmovableGate(WIDTH, 0, 0, 0); simulation.addImmovable(_local1); _local1 = new ImmovableGate(0, HEIGHT, WIDTH, HEIGHT); simulation.addImmovable(_local1); _local1 = new ImmovableGate(0, 0, 0, HEIGHT); simulation.addImmovable(_local1); _local1 = new ImmovableGate(WIDTH, HEIGHT, WIDTH, 0); simulation.addImmovable(_local1); } public function onEnterFrame(_arg1:Event):void{ var _local2:IDrawAble; var _local3:Number; var _local4:Number; if (mouseSpring){ _local3 = (mouseSpring.movableParticle.x - mouseX); _local4 = (mouseSpring.movableParticle.y - mouseY); if (((_local3 * _local3) + (_local4 * _local4)) < (50 * 50)){ mouseSpring.x = mouseX; mouseSpring.y = mouseY; }; }; simulation.nextFrame(); simulation.nextFrame(); mShape.graphics.clear(); mShape.graphics.lineStyle(0, COLOR_MOVABLE); for each (_local2 in simulation.movables) { _local2.draw(mShape.graphics); }; mShape.graphics.lineStyle(0, COLOR_FORCE); for each (_local2 in simulation.forces) { _local2.draw(mShape.graphics); }; } protected function onMouseDown(_arg1:MouseEvent):void{ var _local2:Movable; var _local3:Number; var _local4:Number; for each (_local2 in simulation.movables) { if ((((_local2 is MovableParticle)) || ((_local2 is MovableCircle)))){ _local3 = (MovableParticle(_local2).x - mouseX); _local4 = (MovableParticle(_local2).y - mouseY); if (((_local3 * _local3) + (_local4 * _local4)) < MOUSE_CATCH_DISTANCE2){ mouseSpring = new FixedSpring(mouseX, mouseY, MovableParticle(_local2), MOUSE_CATCH_STRENGTH, 0); simulation.addForce(mouseSpring); break; }; }; }; } public static function debugStop():void{ instance.simulation.debugStop(); instance.onRemoved(null); } } }//package de.popforge.revive.application
Section 2
//Simulation (de.popforge.revive.application.Simulation) package de.popforge.revive.application { import de.popforge.revive.member.*; import de.popforge.revive.resolve.*; import de.popforge.revive.geom.*; import de.popforge.revive.forces.*; import flash.utils.*; public class Simulation { public var movables:Array; public var globalForce:Vector; public var forces:Array; public var immovables:Array; private var pause:Boolean;// = false public var globalDrag:Number;// = 0.0005 public static const MAX_FRAME_TIME:uint = 50; public function Simulation(){ globalForce = new Vector(0, 0.01); globalDrag = 0.0005; pause = false; super(); forces = new Array(); movables = new Array(); immovables = new Array(); } public function nextFrame():void{ applyEnvirons(); resolve(); } public function addMovable(_arg1:Movable):void{ removeMovable(_arg1); movables.push(_arg1); } public function removeForce(_arg1:IForce):void{ var _local2:int; _local2 = forces.length; while (--_local2 > -1) { if (forces[_local2] == _arg1){ forces.splice(_local2, 1); break; }; }; } public function addForce(_arg1:IForce):void{ removeForce(_arg1); forces.push(_arg1); } public function removeMovable(_arg1:Movable):void{ var _local2:int; _local2 = movables.length; while (--_local2 > -1) { if (movables[_local2] == _arg1){ movables.splice(_local2, 1); break; }; }; } private function getNearestDynamicIntersection(_arg1:Number):DynamicIntersection{ var _local2:Movable; var _local3:IDynamicIntersectionTestAble; var _local4:DynamicIntersection; var _local5:DynamicIntersection; var _local6:int; var _local7:int; _local6 = movables.length; while (--_local6 > -1) { _local2 = movables[_local6]; if ((_local2 is MovableCircle)){ _local7 = immovables.length; while (--_local7 > -1) { _local3 = immovables[_local7]; _local4 = _local3.dIntersectMovableCircle((_local2 as MovableCircle), _arg1); if (_local4){ if (_local4.dt < _arg1){ _arg1 = _local4.dt; _local5 = _local4; }; }; }; _local7 = _local6; while (--_local7 > -1) { _local3 = movables[_local7]; _local4 = _local3.dIntersectMovableCircle((_local2 as MovableCircle), _arg1); if (_local4){ if (_local4.dt < _arg1){ _arg1 = _local4.dt; _local5 = _local4; }; }; }; } else { if ((_local2 is MovableSegment)){ _local7 = immovables.length; while (--_local7 > -1) { _local3 = immovables[_local7]; _local4 = _local3.dIntersectMovableSegment((_local2 as MovableSegment), _arg1); if (_local4){ if (_local4.dt < _arg1){ _arg1 = _local4.dt; _local5 = _local4; }; }; }; _local7 = _local6; while (--_local7 > -1) { _local3 = movables[_local7]; _local4 = _local3.dIntersectMovableSegment((_local2 as MovableSegment), _arg1); if (_local4){ if (_local4.dt < _arg1){ _arg1 = _local4.dt; _local5 = _local4; }; }; }; }; }; }; return (_local5); } public function removeImmovable(_arg1:Immovable):void{ var _local2:int; _local2 = immovables.length; while (--_local2 > -1) { if (immovables[_local2] == _arg1){ immovables.splice(_local2, 1); break; }; }; } private function resolve():void{ var _local1:Number; var _local2:Number; var _local3:Movable; var _local4:DynamicIntersection; var _local5:uint; if (pause){ return; }; _local2 = 1; _local5 = getTimer(); while ((_local4 = getNearestDynamicIntersection(_local2))) { if ((getTimer() - _local5) > MAX_FRAME_TIME){ return; }; _local1 = _local4.dt; _local2 = (_local2 - _local1); for each (_local3 in movables) { _local3.integrate(_local1); }; if (pause){ _local4.resolvable.resolveMovableParticle(MovableParticle(_local3)); return; }; _local3 = _local4.movable; if ((_local3 is MovableCircle)){ _local4.resolvable.resolveMovableCircle((_local3 as MovableCircle)); } else { if ((_local3 is MovableParticle)){ _local4.resolvable.resolveMovableParticle((_local3 as MovableParticle)); } else { if ((_local3 is MovableSegment)){ _local4.resolvable.resolveMovableSegment((_local3 as MovableSegment)); continue; }; }; }; }; for each (_local3 in movables) { _local3.integrate(_local2); }; } public function addImmovable(_arg1:Immovable):void{ removeImmovable(_arg1); immovables.push(_arg1); } public function debugStop():void{ pause = true; } private function applyEnvirons():void{ var _local1:Movable; var _local2:IForce; for each (_local1 in movables) { _local1.applyGlobalEnvirons(globalForce, globalDrag); }; for each (_local2 in forces) { _local2.solve(); }; } } }//package de.popforge.revive.application
Section 3
//IDrawAble (de.popforge.revive.display.IDrawAble) package de.popforge.revive.display { import flash.display.*; public interface IDrawAble { function draw(_arg1:Graphics):void; } }//package de.popforge.revive.display
Section 4
//FixedSpring (de.popforge.revive.forces.FixedSpring) package de.popforge.revive.forces { import flash.display.*; import de.popforge.revive.member.*; import de.popforge.revive.display.*; public class FixedSpring implements IForce, IDrawAble { public var tension:Number; public var movableParticle:MovableParticle; public var x:Number; public var y:Number; public var restLength:Number; public function FixedSpring(_arg1:Number, _arg2:Number, _arg3:MovableParticle, _arg4:Number=0.5, _arg5:Number=-1){ var _local6:Number; var _local7:Number; super(); this.x = _arg1; this.y = _arg2; this.movableParticle = _arg3; this.tension = _arg4; if (_arg5 == -1){ _local6 = (_arg3.x - _arg1); _local7 = (_arg3.y - _arg2); _arg5 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); }; this.restLength = _arg5; } public function draw(_arg1:Graphics):void{ _arg1.moveTo(x, y); _arg1.lineTo(movableParticle.x, movableParticle.y); _arg1.drawCircle(x, y, 4); } public function solve():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; _local1 = ((movableParticle.x + movableParticle.velocity.x) - x); _local2 = ((movableParticle.y + movableParticle.velocity.y) - y); _local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2))); _local4 = ((tension * (_local3 - restLength)) / _local3); movableParticle.velocity.x = (movableParticle.velocity.x - (_local1 * _local4)); movableParticle.velocity.y = (movableParticle.velocity.y - (_local2 * _local4)); } } }//package de.popforge.revive.forces
Section 5
//IForce (de.popforge.revive.forces.IForce) package de.popforge.revive.forces { public interface IForce { function solve():void; } }//package de.popforge.revive.forces
Section 6
//Spring (de.popforge.revive.forces.Spring) package de.popforge.revive.forces { import flash.display.*; import de.popforge.revive.member.*; import de.popforge.revive.display.*; public class Spring implements IForce, IDrawAble { private var m0:MovableParticle; private var m1:MovableParticle; private var tension:Number; private var restLength:Number; public function Spring(_arg1:MovableParticle, _arg2:MovableParticle, _arg3:Number=0.5, _arg4:Number=-1){ var _local5:Number; var _local6:Number; super(); this.m0 = _arg1; this.m1 = _arg2; this.tension = _arg3; if (_arg4 == -1){ _local5 = (_arg1.x - _arg2.x); _local6 = (_arg1.y - _arg2.y); _arg4 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6))); }; this.restLength = _arg4; } public function draw(_arg1:Graphics):void{ _arg1.moveTo(m0.x, m0.y); _arg1.lineTo(m1.x, m1.y); } public function solve():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; _local1 = ((m1.x + m1.velocity.x) - (m0.x + m0.velocity.x)); _local2 = ((m1.y + m1.velocity.y) - (m0.y + m0.velocity.y)); _local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2))); _local4 = ((tension * (_local3 - restLength)) / _local3); _local1 = (_local1 * _local4); _local2 = (_local2 * _local4); m0.velocity.x = (m0.velocity.x + _local1); m0.velocity.y = (m0.velocity.y + _local2); m1.velocity.x = (m1.velocity.x - _local1); m1.velocity.y = (m1.velocity.y - _local2); } } }//package de.popforge.revive.forces
Section 7
//BoundingBox (de.popforge.revive.geom.BoundingBox) package de.popforge.revive.geom { public class BoundingBox { public var yMax:Number; public var xMax:Number; public var yMin:Number; public var xMin:Number; public function BoundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){ this.xMin = _arg1; this.yMin = _arg2; this.xMax = _arg3; this.yMax = _arg4; } public function intersect(_arg1:BoundingBox):Boolean{ if (xMin > _arg1.xMax){ return (false); }; if (yMin > _arg1.yMax){ return (false); }; if (xMax < _arg1.xMin){ return (false); }; if (yMax < _arg1.yMin){ return (false); }; return (true); } } }//package de.popforge.revive.geom
Section 8
//Vector (de.popforge.revive.geom.Vector) package de.popforge.revive.geom { public class Vector { public var x:Number; public var y:Number; public function Vector(_arg1:Number, _arg2:Number){ this.x = _arg1; this.y = _arg2; } public function unify():void{ var _local1:Number; _local1 = length(); x = (x / _local1); y = (y / _local1); } public function length():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function scale(_arg1:Number):void{ x = (x * _arg1); y = (y * _arg1); } public function toString():String{ return (((("Vector x: " + x) + " y: ") + y)); } public function clone():Vector{ return (new Vector(x, y)); } } }//package de.popforge.revive.geom
Section 9
//Immovable (de.popforge.revive.member.Immovable) package de.popforge.revive.member { import de.popforge.revive.geom.*; public class Immovable { public var drag:Number; public var elastic:Number; public var bounds:BoundingBox; static const MIN_REFLECTION:Number = 0.05; static const EPLISON_DT:Number = -1E-7; public function Immovable(){ elastic = 0.5; drag = 0.04; } public function setElastic(_arg1:Number):void{ if (_arg1 > 0){ this.elastic = _arg1; }; } public function setDrag(_arg1:Number):void{ this.drag = _arg1; } public function getDrag():Number{ return (drag); } public function getElastic():Number{ return (elastic); } } }//package de.popforge.revive.member
Section 10
//ImmovableGate (de.popforge.revive.member.ImmovableGate) package de.popforge.revive.member { import flash.display.*; import de.popforge.revive.resolve.*; import de.popforge.revive.display.*; public class ImmovableGate extends Immovable implements IDynamicIntersectionTestAble, IResolvable, IDrawAble { private var nx:Number; private var ny:Number; private var dx:Number; private var y0:Number; private var y1:Number; private var dy:Number; private var length:Number; private var x0:Number; private var x1:Number; public function ImmovableGate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){ this.x0 = _arg1; this.y0 = _arg2; this.x1 = _arg3; this.y1 = _arg4; precompute(); } public function dIntersectMovableParticle(_arg1:MovableParticle, _arg2:Number):DynamicIntersection{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; _local3 = _arg1.velocity.x; _local4 = _arg1.velocity.y; _local5 = ((_local4 * dx) - (_local3 * dy)); if (_local5 <= 0){ return (null); }; _local6 = (_arg1.x - x0); _local7 = (_arg1.y - y0); _local8 = (((_local4 * _local6) - (_local3 * _local7)) / _local5); if ((((_local8 < 0)) || ((_local8 > 1)))){ return (null); }; _local9 = (((dy * _local6) - (dx * _local7)) / _local5); if ((((_local9 > EPLISON_DT)) && ((_local9 < 0)))){ _local9 = 0; }; if ((((_local9 < 0)) || ((_local9 > _arg2)))){ return (null); }; return (new DynamicIntersection(this, _arg1, _local9)); } public function dIntersectMovableCircle(_arg1:MovableCircle, _arg2:Number):DynamicIntersection{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; _local3 = _arg1.velocity.x; _local4 = _arg1.velocity.y; _local5 = ((_local4 * dx) - (_local3 * dy)); if (_local5 <= 0){ return (null); }; _local6 = _arg1.r; _local7 = ((_arg1.x - x0) - (nx * _local6)); _local8 = ((_arg1.y - y0) - (ny * _local6)); _local9 = (((_local4 * _local7) - (_local3 * _local8)) / _local5); if ((((_local9 < 0)) || ((_local9 > 1)))){ return (null); }; _local10 = (((dy * _local7) - (dx * _local8)) / _local5); if ((((_local10 > EPLISON_DT)) && ((_local10 < 0)))){ _local10 = 0; }; if ((((_local10 < 0)) || ((_local10 > _arg2)))){ return (null); }; return (new DynamicIntersection(this, _arg1, _local10)); } public function draw(_arg1:Graphics):void{ var _local2:Number; var _local3:Number; _arg1.moveTo(x0, y0); _arg1.lineTo(x1, y1); _local2 = ((x0 + x1) / 2); _local3 = ((y0 + y1) / 2); _arg1.moveTo((_local2 - (ny * 3)), (_local3 + (nx * 3))); _arg1.lineTo((_local2 + (nx * 3)), (_local3 + (ny * 3))); _arg1.lineTo((_local2 + (ny * 3)), (_local3 - (nx * 3))); } public function resolveMovableSegment(_arg1:MovableSegment):void{ } public function resolveMovableParticle(_arg1:MovableParticle):void{ var _local2:Number; _local2 = ((1 + elastic) * ((nx * _arg1.velocity.x) + (ny * _arg1.velocity.y))); _arg1.velocity.x = (_arg1.velocity.x - (nx * _local2)); _arg1.velocity.y = (_arg1.velocity.y - (ny * _local2)); _arg1.velocity.x = (_arg1.velocity.x - (_arg1.velocity.x * drag)); _arg1.velocity.y = (_arg1.velocity.y - (_arg1.velocity.y * drag)); } public function resolveMovableCircle(_arg1:MovableCircle):void{ var _local2:Number; _local2 = ((1 + elastic) * ((nx * _arg1.velocity.x) + (ny * _arg1.velocity.y))); _arg1.velocity.x = (_arg1.velocity.x - (nx * _local2)); _arg1.velocity.y = (_arg1.velocity.y - (ny * _local2)); } public function dIntersectMovableSegment(_arg1:MovableSegment, _arg2:Number):DynamicIntersection{ return (null); } private function precompute():void{ dx = (x1 - x0); dy = (y1 - y0); length = Math.sqrt(((dx * dx) + (dy * dy))); nx = (dy / length); ny = (-(dx) / length); } } }//package de.popforge.revive.member
Section 11
//ImmovablePoint (de.popforge.revive.member.ImmovablePoint) package de.popforge.revive.member { import flash.display.*; import de.popforge.revive.resolve.*; import de.popforge.revive.display.*; public class ImmovablePoint extends Immovable implements IDynamicIntersectionTestAble, IResolvable, IDrawAble { private var x:Number; private var y:Number; public function ImmovablePoint(_arg1:Number, _arg2:Number){ this.x = _arg1; this.y = _arg2; } public function dIntersectMovableCircle(_arg1:MovableCircle, _arg2:Number):DynamicIntersection{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; _local3 = (x - _arg1.x); _local4 = (y - _arg1.y); _local5 = _arg1.velocity.x; _local6 = _arg1.velocity.y; _local7 = ((_local5 * _local5) + (_local6 * _local6)); _local8 = ((_local3 * _local6) - (_local4 * _local5)); _local9 = ((_local7 * (_arg1.r * _arg1.r)) - (_local8 * _local8)); if (_local9 < 0){ return (null); }; _local10 = (-(((Math.sqrt(_local9) - (_local4 * _local6)) - (_local3 * _local5))) / _local7); if ((((_local10 > EPLISON_DT)) && ((_local10 < 0)))){ _local10 = 0; }; if ((((_local10 < 0)) || ((_local10 > _arg2)))){ return (null); }; return (new DynamicIntersection(this, _arg1, _local10)); } public function draw(_arg1:Graphics):void{ _arg1.moveTo((x - 3), y); _arg1.lineTo((x + 3), y); _arg1.moveTo(x, (y - 3)); _arg1.lineTo(x, (y + 3)); } public function resolveMovableParticle(_arg1:MovableParticle):void{ trace("Never expected, that particle intersect each other."); } public function resolveMovableSegment(_arg1:MovableSegment):void{ } public function dIntersectMovableParticle(_arg1:MovableParticle, _arg2:Number):DynamicIntersection{ return (null); } public function resolveMovableCircle(_arg1:MovableCircle):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = _arg1.r; _local3 = ((_arg1.x - x) / _local2); _local4 = ((_arg1.y - y) / _local2); _local5 = ((1 + elastic) * ((_local3 * _arg1.velocity.x) + (_local4 * _arg1.velocity.y))); if (_local5 > -(MIN_REFLECTION)){ _local5 = -(MIN_REFLECTION); }; _arg1.velocity.x = (_arg1.velocity.x - (_local3 * _local5)); _arg1.velocity.y = (_arg1.velocity.y - (_local4 * _local5)); } public function dIntersectMovableSegment(_arg1:MovableSegment, _arg2:Number):DynamicIntersection{ return (null); } } }//package de.popforge.revive.member
Section 12
//Movable (de.popforge.revive.member.Movable) package de.popforge.revive.member { import de.popforge.revive.geom.*; public class Movable { static const EPLISON_DT:Number = -1E-7; public function integrate(_arg1:Number):void{ } public function applyGlobalEnvirons(_arg1:Vector, _arg2:Number):void{ } } }//package de.popforge.revive.member
Section 13
//MovableCircle (de.popforge.revive.member.MovableCircle) package de.popforge.revive.member { import flash.display.*; import de.popforge.revive.resolve.*; import de.popforge.revive.geom.*; import de.popforge.revive.display.*; public class MovableCircle extends MovableParticle implements IDynamicIntersectionTestAble, IResolvable, IDrawAble { public var r:Number; public function MovableCircle(_arg1:Number, _arg2:Number, _arg3:Number){ super(_arg1, _arg2); this.r = _arg3; } override public function dIntersectMovableCircle(_arg1:MovableCircle, _arg2:Number):DynamicIntersection{ 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; _local3 = (x - _arg1.x); _local4 = (y - _arg1.y); _local5 = (r + _arg1.r); _local6 = ((r + _arg1.r) * _local5); _local7 = (_arg1.velocity.x - velocity.x); _local8 = (_arg1.velocity.y - velocity.y); _local9 = ((_local7 * _local7) + (_local8 * _local8)); if (_local9 == 0){ return (null); }; _local10 = ((_local3 * _local8) - (_local4 * _local7)); _local11 = ((_local9 * _local6) - (_local10 * _local10)); if (_local11 < 0){ return (null); }; _local12 = (-(((Math.sqrt(_local11) - (_local4 * _local8)) - (_local3 * _local7))) / _local9); if ((((_local12 > EPLISON_DT)) && ((_local12 < 0)))){ _local12 = 0; }; if ((((_local12 < 0)) || ((_local12 > _arg2)))){ return (null); }; return (new DynamicIntersection(this, _arg1, _local12)); } override public function draw(_arg1:Graphics):void{ _arg1.drawCircle(x, y, Math.max(r, 3)); } override public function resolveMovableCircle(_arg1:MovableCircle):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Vector; var _local6:Vector; var _local7:Number; _local2 = (r + _arg1.r); _local3 = ((x - _arg1.x) / _local2); _local4 = ((y - _arg1.y) / _local2); _local5 = _arg1.velocity; _local6 = velocity; _local7 = (((((_local5.x * _local3) + (_local5.y * _local4)) - (_local6.x * _local3)) - (_local6.y * _local4)) * 1); if (_local7 < 0.0001){ _local7 = 0.0001; }; _local3 = (_local3 * _local7); _local4 = (_local4 * _local7); _local5.x = (_local5.x - _local3); _local5.y = (_local5.y - _local4); _local6.x = (_local6.x + _local3); _local6.y = (_local6.y + _local4); } override public function resolveMovableParticle(_arg1:MovableParticle):void{ var _local2:Number; var _local3:Number; var _local4:Vector; var _local5:Vector; var _local6:Number; _local2 = ((x - _arg1.x) / r); _local3 = ((y - _arg1.y) / r); _local4 = _arg1.velocity; _local5 = velocity; _local6 = (((((_local4.x * _local2) + (_local4.y * _local3)) - (_local5.x * _local2)) - (_local5.y * _local3)) * 1); if (_local6 < 0.0001){ _local6 = 0.0001; }; _local2 = (_local2 * _local6); _local3 = (_local3 * _local6); _local4.x = (_local4.x - _local2); _local4.y = (_local4.y - _local3); _local5.x = (_local5.x + _local2); _local5.y = (_local5.y + _local3); } override public function dIntersectMovableParticle(_arg1:MovableParticle, _arg2:Number):DynamicIntersection{ return (null); } } }//package de.popforge.revive.member
Section 14
//MovableParticle (de.popforge.revive.member.MovableParticle) package de.popforge.revive.member { import flash.display.*; import de.popforge.revive.resolve.*; import de.popforge.revive.geom.*; import de.popforge.revive.display.*; public class MovableParticle extends Movable implements IDynamicIntersectionTestAble, IResolvable, IDrawAble { public var y:Number; public var velocity:Vector; public var x:Number; public function MovableParticle(_arg1:Number, _arg2:Number){ this.x = _arg1; this.y = _arg2; velocity = new Vector(0, 0); } public function dIntersectMovableCircle(_arg1:MovableCircle, _arg2:Number):DynamicIntersection{ 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; _local3 = (x - _arg1.x); _local4 = (y - _arg1.y); _local5 = _arg1.r; _local6 = (_arg1.r * _local5); _local7 = (_arg1.velocity.x - velocity.x); _local8 = (_arg1.velocity.y - velocity.y); _local9 = ((_local7 * _local7) + (_local8 * _local8)); if (_local9 == 0){ return (null); }; _local10 = ((_local3 * _local8) - (_local4 * _local7)); _local11 = ((_local9 * _local6) - (_local10 * _local10)); if (_local11 < 0){ return (null); }; _local12 = (-(((Math.sqrt(_local11) - (_local4 * _local8)) - (_local3 * _local7))) / _local9); if ((((_local12 > EPLISON_DT)) && ((_local12 < 0)))){ _local12 = 0; }; if ((((_local12 < 0)) || ((_local12 > _arg2)))){ return (null); }; return (new DynamicIntersection(this, _arg1, _local12)); } public function draw(_arg1:Graphics):void{ _arg1.drawCircle(x, y, 1); } public function resolveMovableCircle(_arg1:MovableCircle):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Vector; var _local6:Vector; var _local7:Number; _local2 = _arg1.r; _local3 = ((x - _arg1.x) / _local2); _local4 = ((y - _arg1.y) / _local2); _local5 = _arg1.velocity; _local6 = velocity; _local7 = (((((_local5.x * _local3) + (_local5.y * _local4)) - (_local6.x * _local3)) - (_local6.y * _local4)) * 1); if (_local7 < 0.0001){ _local7 = 0.0001; }; _local3 = (_local3 * _local7); _local4 = (_local4 * _local7); _local5.x = (_local5.x - _local3); _local5.y = (_local5.y - _local4); _local6.x = (_local6.x + _local3); _local6.y = (_local6.y + _local4); } public function resolveMovableParticle(_arg1:MovableParticle):void{ } public function dIntersectMovableSegment(_arg1:MovableSegment, _arg2:Number):DynamicIntersection{ return (_arg1.dIntersectMovableParticle(this, _arg2)); } override public function applyGlobalEnvirons(_arg1:Vector, _arg2:Number):void{ velocity.x = (velocity.x + _arg1.x); velocity.y = (velocity.y + _arg1.y); velocity.x = (velocity.x - (velocity.x * _arg2)); velocity.y = (velocity.y - (velocity.y * _arg2)); } public function resolveMovableSegment(_arg1:MovableSegment):void{ _arg1.resolveMovableParticle(this); } override public function integrate(_arg1:Number):void{ x = (x + (velocity.x * _arg1)); y = (y + (velocity.y * _arg1)); } public function dIntersectMovableParticle(_arg1:MovableParticle, _arg2:Number):DynamicIntersection{ return (null); } } }//package de.popforge.revive.member
Section 15
//MovableSegment (de.popforge.revive.member.MovableSegment) package de.popforge.revive.member { import flash.display.*; import de.popforge.revive.resolve.*; import de.popforge.revive.display.*; public class MovableSegment extends Movable implements IDynamicIntersectionTestAble, IResolvable, IDrawAble { var m0:MovableParticle; var m1:MovableParticle; public function MovableSegment(_arg1:MovableParticle, _arg2:MovableParticle){ this.m0 = _arg1; this.m1 = _arg2; } public function resolveMovableSegment(_arg1:MovableSegment):void{ } public function dIntersectMovableCircle(_arg1:MovableCircle, _arg2:Number):DynamicIntersection{ return (null); } public function draw(_arg1:Graphics):void{ _arg1.moveTo(m0.x, m0.y); _arg1.lineTo(m1.x, m1.y); } public function resolveMovableCircle(_arg1:MovableCircle):void{ } public function resolveMovableParticle(_arg1:MovableParticle):void{ var _local2:Number; 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; _local2 = (m1.x - m0.x); _local3 = (m1.y - m0.y); _local4 = _local3; _local5 = -(_local2); _local6 = ((_local4 * _local4) + (_local5 * _local5)); _local7 = ((((_arg1.x - m0.x) * _local2) + ((_arg1.y - m0.y) * _local3)) / _local6); _local8 = (1 - _local7); _local6 = Math.sqrt(_local6); _local4 = (_local4 / _local6); _local5 = (_local5 / _local6); _local9 = ((m0.velocity.x * _local8) + (m1.velocity.x * _local7)); _local10 = ((m0.velocity.y * _local8) + (m1.velocity.y * _local7)); _local11 = (((((_local4 * _arg1.velocity.x) + (_local5 * _arg1.velocity.y)) - (_local4 * _local9)) - (_local5 * _local10)) * 1); if (_local11 < 0.01){ _local11 = 0.01; }; _arg1.velocity.x = (_arg1.velocity.x - (_local4 * _local11)); _arg1.velocity.y = (_arg1.velocity.y - (_local5 * _local11)); m0.velocity.x = (m0.velocity.x + ((_local4 * _local11) * _local8)); m0.velocity.y = (m0.velocity.y + ((_local5 * _local11) * _local8)); m1.velocity.x = (m1.velocity.x + ((_local4 * _local11) * _local7)); m1.velocity.y = (m1.velocity.y + ((_local5 * _local11) * _local7)); _local12 = 0.1; m0.velocity.x = (m0.velocity.x - (m0.velocity.x * _local12)); m0.velocity.y = (m0.velocity.y - (m0.velocity.y * _local12)); m1.velocity.x = (m1.velocity.x - (m1.velocity.x * _local12)); m1.velocity.y = (m1.velocity.y - (m1.velocity.y * _local12)); _arg1.velocity.x = (_arg1.velocity.x - (_arg1.velocity.x * _local12)); _arg1.velocity.y = (_arg1.velocity.y - (_arg1.velocity.y * _local12)); } public function dIntersectMovableSegment(_arg1:MovableSegment, _arg2:Number):DynamicIntersection{ return (null); } public function dIntersectMovableParticle(_arg1:MovableParticle, _arg2:Number):DynamicIntersection{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:Number; var _local38:Number; var _local39:Number; var _local40:Number; _local3 = _arg1.x; _local4 = _arg1.y; if ((((_arg1 == m0)) || ((_arg1 == m1)))){ return (null); }; _local5 = m0.x; _local6 = m0.y; _local7 = m1.x; _local8 = m1.y; _local9 = _arg1.velocity.x; _local10 = _arg1.velocity.y; _local11 = m0.velocity.x; _local12 = m0.velocity.y; _local13 = m1.velocity.x; _local14 = m1.velocity.y; _local15 = (((((2 * _local11) - (2 * _local9)) * _local14) + (((2 * _local9) - (2 * _local13)) * _local12)) + (((2 * _local13) - (2 * _local11)) * _local10)); if (_local15 == 0){ return (null); }; _local16 = (_local9 * _local9); _local17 = (_local11 * _local11); _local18 = (_local13 * _local13); _local19 = (_local10 * _local10); _local20 = (_local12 * _local12); _local21 = (_local14 * _local14); _local22 = (_local9 * _local11); _local23 = (_local10 * _local12); _local24 = (_local9 * _local13); _local25 = (_local9 - _local11); _local26 = (_local10 - _local12); _local27 = (_local9 - _local13); _local28 = (_local10 - _local14); _local29 = (_local11 - _local13); _local30 = (_local12 - _local14); _local31 = (_local9 + _local11); _local32 = (_local9 + _local13); _local33 = (_local11 + _local13); _local34 = ((((((((((((((_local17 - (2 * _local22)) + _local16) * _local8) * _local8) + (((((((2 * ((_local25 * _local13) + (_local22 - _local16))) * _local6) - ((2 * (((_local25 * _local13) + _local17) - _local22)) * _local4)) + ((2 * ((_local25 * _local12) - (_local25 * _local10))) * _local7)) + ((2 * (((_local25 * _local14) - ((2 * _local27) * _local12)) + ((_local31 - (2 * _local13)) * _local10))) * _local5)) + (((-2 * ((_local25 * _local14) + (((2 * _local13) - _local31) * _local12))) - ((4 * _local29) * _local10)) * _local3)) * _local8)) + ((((_local18 - (2 * _local24)) + _local16) * _local6) * _local6)) + ((((((2 * (((_local31 * _local13) - _local22) - _local18)) * _local4) + ((2 * (((_local27 * _local12) + ((_local32 - (2 * _local11)) * _local10)) - ((2 * _local25) * _local14))) * _local7)) + ((2 * ((_local27 * _local14) - (_local27 * _local10))) * _local5)) + ((2 * (((((_local13 - (2 * _local11)) + _local9) * _local14) - (_local27 * _local12)) + ((2 * _local29) * _local10))) * _local3)) * _local6)) + ((((_local18 - ((2 * _local11) * _local13)) + _local17) * _local4) * _local4)) + (((((2 * ((((2 * _local25) * _local14) + ((_local33 - (2 * _local9)) * _local12)) + (_local29 * _local10))) * _local7) + ((2 * (((((_local13 + _local11) - (2 * _local9)) * _local14) + ((2 * _local27) * _local12)) - (_local29 * _local10))) * _local5)) + ((2 * ((_local29 * _local14) - (_local29 * _local12))) * _local3)) * _local4)) + ((((_local20 - ((2 * _local10) * _local12)) + _local19) * _local7) * _local7)) + ((((2 * ((_local26 * _local14) + ((_local10 * _local12) - _local19))) * _local5) + ((2 * ((-(_local26) * _local14) - (_local20 - _local23))) * _local3)) * _local7)) + ((((_local21 - ((2 * _local10) * _local14)) + _local19) * _local5) * _local5)) - (((2 * ((_local21 - ((_local12 + _local10) * _local14)) + _local23)) * _local3) * _local5)) + ((((_local21 - ((2 * _local12) * _local14)) + _local20) * _local3) * _local3)); if (_local34 < 0){ return (null); }; _local35 = (-(((((((Math.sqrt(_local34) + (_local27 * _local6)) - (_local25 * _local8)) + (_local26 * _local7)) - (_local29 * _local4)) + (_local30 * _local3)) - (_local28 * _local5))) / _local15); if ((((_local35 < 0)) || ((_local35 > _arg2)))){ return (null); }; _local36 = (m1.x - m0.x); _local37 = (m1.y - m0.y); _local38 = ((_arg1.x + (_arg1.velocity.x * _local35)) - m0.x); _local39 = ((_arg1.y + (_arg1.velocity.y * _local35)) - m0.y); _local40 = (((_local38 * _local36) + (_local39 * _local37)) / ((_local36 * _local36) + (_local37 * _local37))); if ((((_local40 < 0)) || ((_local40 > 1)))){ return (null); }; return (new DynamicIntersection(this, _arg1, _local35)); } } }//package de.popforge.revive.member
Section 16
//DynamicIntersection (de.popforge.revive.resolve.DynamicIntersection) package de.popforge.revive.resolve { import de.popforge.revive.member.*; public class DynamicIntersection { public var dt:Number; public var resolvable:IResolvable; public var movable:Movable; public function DynamicIntersection(_arg1:IResolvable, _arg2:Movable, _arg3:Number){ this.resolvable = _arg1; this.movable = _arg2; this.dt = _arg3; } } }//package de.popforge.revive.resolve
Section 17
//IDynamicIntersectionTestAble (de.popforge.revive.resolve.IDynamicIntersectionTestAble) package de.popforge.revive.resolve { import de.popforge.revive.member.*; public interface IDynamicIntersectionTestAble { function dIntersectMovableSegment(_arg1:MovableSegment, _arg2:Number):DynamicIntersection; function dIntersectMovableCircle(_arg1:MovableCircle, _arg2:Number):DynamicIntersection; function dIntersectMovableParticle(_arg1:MovableParticle, _arg2:Number):DynamicIntersection; } }//package de.popforge.revive.resolve
Section 18
//IResolvable (de.popforge.revive.resolve.IResolvable) package de.popforge.revive.resolve { import de.popforge.revive.member.*; public interface IResolvable { function resolveMovableSegment(_arg1:MovableSegment):void; function resolveMovableCircle(_arg1:MovableCircle):void; function resolveMovableParticle(_arg1:MovableParticle):void; } }//package de.popforge.revive.resolve
Section 19
//DefaultTextFormat (de.popforge.surface.display.DefaultTextFormat) package de.popforge.surface.display { import flash.text.*; public class DefaultTextFormat extends TextFormat { public function DefaultTextFormat(){ color = 0x666666; size = 10; bold = true; font = "Verdana"; } } }//package de.popforge.surface.display
Section 20
//FPSCounter (de.popforge.surface.display.FPSCounter) package de.popforge.surface.display { import flash.events.*; import flash.text.*; import flash.utils.*; public class FPSCounter extends TextField { private var ms:int; private var fs:int; public function FPSCounter(){ textColor = 0xCECECE; autoSize = "left"; defaultTextFormat = new DefaultTextFormat(); ms = getTimer(); fs = 0; addEventListener(Event.ADDED, onAdded); addEventListener(Event.REMOVED, onRemoved); } private function onRemoved(_arg1:Event):void{ stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onAdded(_arg1:Event):void{ stage.addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(_arg1:Event):void{ if ((getTimer() - 1000) > ms){ ms = getTimer(); text = fs.toString(); fs = 0; } else { fs++; }; } } }//package de.popforge.surface.display
Section 21
//BitmapAsset (mx.core.BitmapAsset) package mx.core { import flash.display.*; public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject { mx_internal static const VERSION:String = "2.0.1.0"; public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } public function get measuredWidth():Number{ if (bitmapData){ return (bitmapData.width); }; return (0); } public function get measuredHeight():Number{ if (bitmapData){ return (bitmapData.height); }; return (0); } public function setActualSize(_arg1:Number, _arg2:Number):void{ width = _arg1; height = _arg2; } public function move(_arg1:Number, _arg2:Number):void{ this.x = _arg1; this.y = _arg2; } } }//package mx.core
Section 22
//FlexBitmap (mx.core.FlexBitmap) package mx.core { import flash.display.*; import mx.utils.*; public class FlexBitmap extends Bitmap { mx_internal static const VERSION:String = "2.0.1.0"; public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){ var bitmapData = _arg1; var pixelSnapping = _arg2; var smoothing = _arg3; super(bitmapData, pixelSnapping, smoothing); try { name = NameUtil.createUniqueName(this); } catch(e:Error) { }; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 23
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 24
//IFlexDisplayObject (mx.core.IFlexDisplayObject) package mx.core { import flash.events.*; import flash.display.*; public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher { function get name():String; function set width(_arg1:Number):void; function get measuredHeight():Number; function set height(_arg1:Number):void; function get scaleY():Number; function move(_arg1:Number, _arg2:Number):void; function get scaleX():Number; function set mask(_arg1:DisplayObject):void; function set scaleX(_arg1:Number):void; function set name(_arg1:String):void; function set scaleY(_arg1:Number):void; function get visible():Boolean; function get measuredWidth():Number; function set visible(_arg1:Boolean):void; function get alpha():Number; function get height():Number; function get width():Number; function get parent():DisplayObjectContainer; function get mask():DisplayObject; function set x(_arg1:Number):void; function setActualSize(_arg1:Number, _arg2:Number):void; function set y(_arg1:Number):void; function get x():Number; function get y():Number; function set alpha(_arg1:Number):void; } }//package mx.core
Section 25
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function set instanceIndices(_arg1:Array):void; function get isDocument():Boolean; function get repeaters():Array; function get instanceIndices():Array; function set repeaters(_arg1:Array):void; function initializeRepeaterArrays(_arg1:IRepeaterClient):void; function set repeaterIndices(_arg1:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 26
//mx_internal (mx.core.mx_internal) package mx.core { public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal"; }//package mx.core
Section 27
//NameUtil (mx.utils.NameUtil) package mx.utils { import flash.display.*; import mx.core.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "2.0.1.0"; private static var counter:int = 0; public static function displayObjectToString(_arg1:DisplayObject):String{ var _local2:String; var _local3:DisplayObject; var _local4:String; var _local5:Array; _local3 = _arg1; while (_local3 != null) { if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){ break; }; _local4 = _local3.name; if ((_local3 is IRepeaterClient)){ _local5 = IRepeaterClient(_local3).instanceIndices; if (_local5){ _local4 = (_local4 + (("[" + _local5.join("][")) + "]")); }; }; _local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2); _local3 = _local3.parent; }; return (_local2); } public static function createUniqueName(_arg1:Object):String{ var _local2:String; var _local3:int; var _local4:int; if (!_arg1){ return (null); }; _local2 = getQualifiedClassName(_arg1); _local3 = _local2.indexOf("::"); if (_local3 != -1){ _local2 = _local2.substr((_local3 + 2)); }; _local4 = _local2.charCodeAt((_local2.length - 1)); if ((((_local4 >= 48)) && ((_local4 <= 57)))){ _local2 = (_local2 + "_"); }; return ((_local2 + counter++)); } } }//package mx.utils
Section 28
//DanmenBody (scenes.DanmenBody) package scenes { import flash.events.*; import flash.display.*; import de.popforge.revive.member.*; import de.popforge.revive.resolve.*; import de.popforge.revive.geom.*; import de.popforge.revive.forces.*; import de.popforge.revive.application.*; import flash.text.*; import de.popforge.revive.display.*; import flash.utils.*; public class DanmenBody { public var pointBaseArr:Array; private var mSceneContainer:SceneContainer; public var config_flg:Boolean; public var pointArr:Array; private var BASE_TENSION:Number;// = 0.2 private var BODY_TENSION:Number;// = 0.4 private var center:Vector; public var drawArr:Array; public static const COLOR_MOVABLE:uint = 0xABABAB; public static const COLOR_IMMOVABLE:uint = 0x878787; public static const COLOR_FORCE:uint = 13395507; public function DanmenBody(_arg1:SceneContainer){ var _local2:uint; var _local3:Array; pointBaseArr = new Array(); pointArr = new Array(); drawArr = new Array(); BASE_TENSION = 0.2; BODY_TENSION = 0.4; super(); mSceneContainer = _arg1; center = new Vector((SceneContainer.WIDTH / 2), (SceneContainer.HEIGHT / 2)); config_flg = false; _local2 = 0; while (_local2 < 2) { _local3 = new Array(); pointBaseArr[_local2] = _local3; _local3 = new Array(); pointArr[_local2] = _local3; _local3 = new Array(); drawArr[_local2] = _local3; _local2++; }; createData(); } public function createData():void{ var _local1:Array; var _local2:Array; var _local3:Array; var _local4:Array; var _local5:IForce; var _local6:IForce; var _local7:MovableParticle; var _local8:MovableCircle; var _local9:uint; var _local10:int; var _local11:int; var _local12:Number; var _local13:Number; var _local14:int; _local1 = new Array(); _local2 = new Array(); _local3 = new Array(302, 332, 360, 383, 404, 420, 426, 411, 394, 350, 284, 253, 223, 183, 164, 162, 192, 226, 259, 323, 387, 411, 427, 440, 457, 465, 455, 436, 418, 379, 358, 342, 324, 309, 292, 283, 266, 250, 233, 215, 202, 199, 175, 141, 116, 99, 96, 105, 128, 161, 189, 213, 219, 215, 207, 215, 231, 241, 254, 271, 280, 295, 309, 327, 343, 361, 380, 401, 421, 440, 457, 462, 460, 437, 417, 390, 367, 346, 327, 316, 325, 352, 382, 406, 412, 396, 376, 391, 416, 437, 460, 460, 450, 435, 411); _local4 = new Array(26, 29, 38, 51, 66, 83, 102, 103, 100, 104, 116, 125, 124, 127, 143, 168, 179, 175, 165, 150, 135, 128, 117, 116, 130, 156, 175, 171, 178, 185, 185, 192, 189, 198, 195, 206, 205, 214, 207, 214, 215, 232, 225, 230, 243, 265, 288, 314, 333, 341, 340, 327, 302, 276, 0x0100, 244, 245, 235, 228, 234, 227, 225, 213, 216, 207, 209, 200, 203, 195, 195, 187, 210, 230, 225, 226, 231, 240, 250, 266, 290, 312, 324, 316, 304, 275, 260, 261, 245, 242, 240, 240, 276, 304, 329, 346); _local1[0] = _local3; _local2[0] = _local4; _local9 = 10; _local11 = 1; while (_local11 >= 0) { _local14 = ((_local11 == 1)) ? 0 : 1; _local10 = 0; while (_local10 < _local1[_local14].length) { _local12 = _local1[_local14][_local10]; _local13 = _local2[_local14][_local10]; _local7 = new MovableParticle(_local12, _local13); mSceneContainer.simulation.movables.push(_local7); pointArr[_local14].push(_local7); if (_local10 > 0){ _local6 = new Spring(pointArr[_local14][_local10], pointArr[_local14][(_local10 - 1)], BODY_TENSION); mSceneContainer.simulation.addForce(_local6); }; _local5 = new FixedSpring(_local12, _local13, _local7, BASE_TENSION); mSceneContainer.simulation.forces.push(_local5); pointBaseArr[_local14].push(_local5); _local10++; }; _local10 = 0; while (_local10 < pointArr[_local14].length) { drawArr[_local14][_local10] = new Vector(pointArr[_local14][_local10].x, pointArr[_local14][_local10].y); _local10++; }; _local11 = (_local11 - 2); }; } public function updateObj():void{ var i:int; var j:int; var offset:int; var a:*; var b:*; j = 0; while (j < 2) { offset = ((j == 0)) ? 1 : -1; i = 0; while (i < pointArr[j].length) { var _local2 = pointArr[j][i]; with (_local2) { a = (drawArr[j][i].x - x); b = (drawArr[j][i].y - y); drawArr[j][i].x = (drawArr[j][i].x - (a / 10)); drawArr[j][i].y = (drawArr[j][i].y - (b / 10)); }; i = (i + 1); }; j = (j + 1); }; } public function drawObj(_arg1:Graphics):void{ var _local2:int; var _local3:int; var _local4:Array; var _local5:int; _local3 = 0; while (_local3 < 1) { _local4 = SplineStream(drawArr[_local3], 4); _local5 = (5 * ((_local3 == 0)) ? 1 : -1); _arg1.beginFill(12263970); _arg1.lineStyle(1, 13391189); _arg1.moveTo((_local4[0].x + _local5), _local4[0].y); _local2 = 1; while (_local2 < (_local4.length - 1)) { _arg1.lineTo((_local4[_local2].x + _local5), _local4[_local2].y); _local2++; }; _arg1.lineTo(18, 389); _arg1.lineTo(19, 118); _arg1.endFill(); _arg1.lineStyle(30, 6689041); _local2 = 0; while (_local2 < (_local4.length - 1)) { _arg1.moveTo((_local4[_local2].x + _local5), _local4[_local2].y); _arg1.lineTo((_local4[(_local2 + 1)].x + _local5), _local4[(_local2 + 1)].y); _local2++; }; _arg1.lineStyle(26, 11149858); _local2 = 0; while (_local2 < (_local4.length - 1)) { _arg1.moveTo((_local4[_local2].x + _local5), _local4[_local2].y); _arg1.lineTo((_local4[(_local2 + 1)].x + _local5), _local4[(_local2 + 1)].y); _local2++; }; _local3++; }; } private function SplineStream(_arg1:Array, _arg2:int):Array{ var _local3:int; var _local4:int; var _local5:int; var _local6:Array; var _local7:Array; var _local8:Array; var _local9:Array; var _local10:Array; var _local11:int; var _local12:Vector; var _local13:Vector; 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; _local5 = _arg1.length; _local6 = new Array(); _local7 = new Array(); _local8 = new Array(); _local9 = new Array(); _local3 = 0; while (_local3 < (_local5 - 1)) { _local12 = _arg1[_local3]; _local13 = _arg1[(_local3 + 1)]; _local6[_local3] = Math.sqrt((((_local12.x - _local13.x) * (_local12.x - _local13.x)) + ((_local12.y - _local13.y) * (_local12.y - _local13.y)))); _local3++; }; _local7[0] = [0, 1, 0.5]; _local8[0] = {x:((3 / (2 * _local6[0])) * (_arg1[1].x - _arg1[0].x)), y:((3 / (2 * _local6[0])) * (_arg1[1].y - _arg1[0].y))}; _local7[(_local5 - 1)] = [1, 2, 0]; _local8[(_local5 - 1)] = {x:((3 / _local6[(_local5 - 2)]) * (_arg1[(_local5 - 1)].x - _arg1[(_local5 - 2)].x)), y:((3 / _local6[(_local5 - 2)]) * (_arg1[(_local5 - 1)].y - _arg1[(_local5 - 2)].y))}; _local3 = 1; while (_local3 < (_local5 - 1)) { _local14 = _local6[(_local3 - 1)]; _local15 = _local6[_local3]; _local7[_local3] = [_local15, (2 * (_local15 + _local14)), _local14]; _local8[_local3] = {x:(((3 * ((_local14 * _local14) * (_arg1[(_local3 + 1)].x - _arg1[_local3].x))) + (((3 * _local15) * _local15) * (_arg1[_local3].x - _arg1[(_local3 - 1)].x))) / (_local15 * _local14)), y:(((3 * ((_local14 * _local14) * (_arg1[(_local3 + 1)].y - _arg1[_local3].y))) + (((3 * _local15) * _local15) * (_arg1[_local3].y - _arg1[(_local3 - 1)].y))) / (_local15 * _local14))}; _local3++; }; _local3 = 1; while (_local3 < _local5) { _local16 = (_local7[(_local3 - 1)][1] / _local7[_local3][0]); _local7[_local3] = [0, ((_local7[_local3][1] * _local16) - _local7[(_local3 - 1)][2]), (_local7[_local3][2] * _local16)]; _local8[_local3].x = ((_local8[_local3].x * _local16) - _local8[(_local3 - 1)].x); _local8[_local3].y = ((_local8[_local3].y * _local16) - _local8[(_local3 - 1)].y); _local7[_local3][2] = (_local7[_local3][2] / _local7[_local3][1]); _local8[_local3].x = (_local8[_local3].x / _local7[_local3][1]); _local8[_local3].y = (_local8[_local3].y / _local7[_local3][1]); _local7[_local3][1] = 1; _local3++; }; _local9[(_local5 - 1)] = {x:_local8[(_local5 - 1)].x, y:_local8[(_local5 - 1)].y}; _local4 = (_local5 - 1); while (_local4 > 0) { _local9[(_local4 - 1)] = {x:(_local8[(_local4 - 1)].x - (_local7[(_local4 - 1)][2] * _local9[_local4].x)), y:(_local8[(_local4 - 1)].y - (_local7[(_local4 - 1)][2] * _local9[_local4].y))}; _local4--; }; _local10 = new Array(); _local11 = 0; _local3 = 0; while (_local3 < (_local5 - 1)) { _local14 = _local6[_local3]; _local17 = _arg1[_local3].x; _local18 = _local9[_local3].x; _local19 = ((((_arg1[(_local3 + 1)].x - _arg1[_local3].x) * 3) / (_local14 * _local14)) - ((_local9[(_local3 + 1)].x + (2 * _local9[_local3].x)) / _local14)); _local20 = (((_arg1[(_local3 + 1)].x - _arg1[_local3].x) * (-2 / ((_local14 * _local14) * _local14))) + ((_local9[(_local3 + 1)].x + _local9[_local3].x) * (1 / (_local14 * _local14)))); _local21 = _arg1[_local3].y; _local22 = _local9[_local3].y; _local23 = ((((_arg1[(_local3 + 1)].y - _arg1[_local3].y) * 3) / (_local14 * _local14)) - ((_local9[(_local3 + 1)].y + (2 * _local9[_local3].y)) / _local14)); _local24 = (((_arg1[(_local3 + 1)].y - _arg1[_local3].y) * (-2 / ((_local14 * _local14) * _local14))) + ((_local9[(_local3 + 1)].y + _local9[_local3].y) * (1 / (_local14 * _local14)))); _local25 = 0; _local4 = 0; while (_local4 < _arg2) { _local10[_local11] = {x:((((((_local20 * _local25) + _local19) * _local25) + _local18) * _local25) + _local17), y:((((((_local24 * _local25) + _local23) * _local25) + _local22) * _local25) + _local21)}; _local11++; _local25 = (_local25 + (_local14 / _arg2)); _local4++; }; _local3++; }; _local10[_local11] = {x:_arg1[(_local5 - 1)].x, y:_arg1[(_local5 - 1)].y}; return (_local10); } } }//package scenes
Section 29
//InsertObject (scenes.InsertObject) package scenes { import flash.events.*; import flash.display.*; import de.popforge.revive.member.*; import de.popforge.revive.resolve.*; import de.popforge.revive.geom.*; import de.popforge.revive.forces.*; import de.popforge.revive.application.*; import flash.text.*; import de.popforge.revive.display.*; import flash.geom.*; import flash.utils.*; public class InsertObject { private var BASE_TENSION:Number;// = 0.1 private var BALL_FILL_MATRIX:Matrix; private var BALL_RADIUS:uint;// = 25 private var BODY_TENSION:Number;// = 0.2 private var POINT_NUM:Number;// = 5 private var center:Vector; private var BALL_FILL_COLOR:uint; private var mSceneContainer:SceneContainer; public var config_flg:Boolean; public var pointArr:Array; private var drawArr:Array; private var BALL_SPRITE_ARRAY:Array; public static const COLOR_MOVABLE:uint = 0xABABAB; public static const COLOR_IMMOVABLE:uint = 0x878787; public static const COLOR_FORCE:uint = 13395507; public function InsertObject(_arg1:SceneContainer){ var _local2:uint; var _local3:Sprite; var _local4:Array; pointArr = new Array(); drawArr = new Array(); POINT_NUM = 5; BASE_TENSION = 0.1; BODY_TENSION = 0.2; BALL_RADIUS = 25; BALL_SPRITE_ARRAY = new Array(); super(); mSceneContainer = _arg1; center = new Vector((SceneContainer.WIDTH / 2), (SceneContainer.HEIGHT / 2)); config_flg = false; BALL_FILL_COLOR = 0; _local2 = 0; while (_local2 < POINT_NUM) { _local3 = new Sprite(); BALL_FILL_MATRIX = new Matrix(); BALL_FILL_MATRIX.createGradientBox((BALL_RADIUS * 2), (BALL_RADIUS * 2), (Math.PI / 2), 0, 0); _local3.graphics.beginGradientFill(GradientType.RADIAL, [0xFFFFFF, 0], [1, 1], [0, 0xFF], BALL_FILL_MATRIX, SpreadMethod.REPEAT, InterpolationMethod.LINEAR_RGB, 0); _local3.graphics.drawCircle(BALL_RADIUS, BALL_RADIUS, BALL_RADIUS); _local3.graphics.endFill(); BALL_SPRITE_ARRAY.push(_local3); _local2++; }; _local2 = 0; while (_local2 < 2) { _local4 = new Array(); pointArr[_local2] = _local4; _local4 = new Array(); drawArr[_local2] = _local4; _local2++; }; createData(); } public function createData():void{ var _local1:IForce; var _local2:MovableCircle; var _local3:int; var _local4:int; _local3 = 0; while (_local3 < POINT_NUM) { _local2 = new MovableCircle(600, (50 + ((BALL_RADIUS * 2) * _local3)), BALL_RADIUS); mSceneContainer.simulation.movables.push(_local2); pointArr[0].push(_local2); if (_local3 > 0){ _local1 = new Spring(pointArr[0][_local3], pointArr[0][(_local3 - 1)]); mSceneContainer.simulation.addForce(_local1); }; _local3++; }; } private function SplineStream(_arg1:Array, _arg2:int):Array{ var _local3:int; var _local4:int; var _local5:int; var _local6:Array; var _local7:Array; var _local8:Array; var _local9:Array; var _local10:Array; var _local11:int; var _local12:Vector; var _local13:Vector; 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; _local5 = _arg1.length; _local6 = new Array(); _local7 = new Array(); _local8 = new Array(); _local9 = new Array(); _local3 = 0; while (_local3 < (_local5 - 1)) { _local12 = _arg1[_local3]; _local13 = _arg1[(_local3 + 1)]; _local6[_local3] = Math.sqrt((((_local12.x - _local13.x) * (_local12.x - _local13.x)) + ((_local12.y - _local13.y) * (_local12.y - _local13.y)))); _local3++; }; _local7[0] = [0, 1, 0.5]; _local8[0] = {x:((3 / (2 * _local6[0])) * (_arg1[1].x - _arg1[0].x)), y:((3 / (2 * _local6[0])) * (_arg1[1].y - _arg1[0].y))}; _local7[(_local5 - 1)] = [1, 2, 0]; _local8[(_local5 - 1)] = {x:((3 / _local6[(_local5 - 2)]) * (_arg1[(_local5 - 1)].x - _arg1[(_local5 - 2)].x)), y:((3 / _local6[(_local5 - 2)]) * (_arg1[(_local5 - 1)].y - _arg1[(_local5 - 2)].y))}; _local3 = 1; while (_local3 < (_local5 - 1)) { _local14 = _local6[(_local3 - 1)]; _local15 = _local6[_local3]; _local7[_local3] = [_local15, (2 * (_local15 + _local14)), _local14]; _local8[_local3] = {x:(((3 * ((_local14 * _local14) * (_arg1[(_local3 + 1)].x - _arg1[_local3].x))) + (((3 * _local15) * _local15) * (_arg1[_local3].x - _arg1[(_local3 - 1)].x))) / (_local15 * _local14)), y:(((3 * ((_local14 * _local14) * (_arg1[(_local3 + 1)].y - _arg1[_local3].y))) + (((3 * _local15) * _local15) * (_arg1[_local3].y - _arg1[(_local3 - 1)].y))) / (_local15 * _local14))}; _local3++; }; _local3 = 1; while (_local3 < _local5) { _local16 = (_local7[(_local3 - 1)][1] / _local7[_local3][0]); _local7[_local3] = [0, ((_local7[_local3][1] * _local16) - _local7[(_local3 - 1)][2]), (_local7[_local3][2] * _local16)]; _local8[_local3].x = ((_local8[_local3].x * _local16) - _local8[(_local3 - 1)].x); _local8[_local3].y = ((_local8[_local3].y * _local16) - _local8[(_local3 - 1)].y); _local7[_local3][2] = (_local7[_local3][2] / _local7[_local3][1]); _local8[_local3].x = (_local8[_local3].x / _local7[_local3][1]); _local8[_local3].y = (_local8[_local3].y / _local7[_local3][1]); _local7[_local3][1] = 1; _local3++; }; _local9[(_local5 - 1)] = {x:_local8[(_local5 - 1)].x, y:_local8[(_local5 - 1)].y}; _local4 = (_local5 - 1); while (_local4 > 0) { _local9[(_local4 - 1)] = {x:(_local8[(_local4 - 1)].x - (_local7[(_local4 - 1)][2] * _local9[_local4].x)), y:(_local8[(_local4 - 1)].y - (_local7[(_local4 - 1)][2] * _local9[_local4].y))}; _local4--; }; _local10 = new Array(); _local11 = 0; _local3 = 0; while (_local3 < (_local5 - 1)) { _local14 = _local6[_local3]; _local17 = _arg1[_local3].x; _local18 = _local9[_local3].x; _local19 = ((((_arg1[(_local3 + 1)].x - _arg1[_local3].x) * 3) / (_local14 * _local14)) - ((_local9[(_local3 + 1)].x + (2 * _local9[_local3].x)) / _local14)); _local20 = (((_arg1[(_local3 + 1)].x - _arg1[_local3].x) * (-2 / ((_local14 * _local14) * _local14))) + ((_local9[(_local3 + 1)].x + _local9[_local3].x) * (1 / (_local14 * _local14)))); _local21 = _arg1[_local3].y; _local22 = _local9[_local3].y; _local23 = ((((_arg1[(_local3 + 1)].y - _arg1[_local3].y) * 3) / (_local14 * _local14)) - ((_local9[(_local3 + 1)].y + (2 * _local9[_local3].y)) / _local14)); _local24 = (((_arg1[(_local3 + 1)].y - _arg1[_local3].y) * (-2 / ((_local14 * _local14) * _local14))) + ((_local9[(_local3 + 1)].y + _local9[_local3].y) * (1 / (_local14 * _local14)))); _local25 = 0; _local4 = 0; while (_local4 < _arg2) { _local10[_local11] = {x:((((((_local20 * _local25) + _local19) * _local25) + _local18) * _local25) + _local17), y:((((((_local24 * _local25) + _local23) * _local25) + _local22) * _local25) + _local21)}; _local11++; _local25 = (_local25 + (_local14 / _arg2)); _local4++; }; _local3++; }; _local10[_local11] = {x:_arg1[(_local5 - 1)].x, y:_arg1[(_local5 - 1)].y}; return (_local10); } public function drawObj(_arg1:Graphics):void{ var _local2:int; var _local3:int; _arg1.lineStyle(5, 0); _local2 = 0; while (_local2 < (POINT_NUM - 1)) { _arg1.moveTo(drawArr[0][_local2].x, drawArr[0][_local2].y); _arg1.lineTo(drawArr[0][(_local2 + 1)].x, drawArr[0][(_local2 + 1)].y); _local2++; }; _arg1.moveTo(drawArr[0][_local2].x, drawArr[0][_local2].y); _arg1.lineStyle(1, 0); _arg1.beginFill(0); _local2 = 0; while (_local2 < POINT_NUM) { _arg1.drawCircle(drawArr[0][_local2].x, drawArr[0][_local2].y, 25); _local2++; }; _arg1.endFill(); _arg1.beginFill(0xFFFFFF); _local2 = 0; while (_local2 < POINT_NUM) { _arg1.drawCircle((drawArr[0][_local2].x - 10), (drawArr[0][_local2].y - 10), 5); _local2++; }; _arg1.endFill(); } public function updateObj():void{ var _local1:int; var _local2:int; _local1 = 0; while (_local1 < POINT_NUM) { drawArr[0][_local1] = new Vector(pointArr[0][_local1].x, pointArr[0][_local1].y); _local1++; }; } } }//package scenes
Section 30
//Test (scenes.Test) package scenes { import flash.events.*; import de.popforge.revive.member.*; import de.popforge.revive.forces.*; import de.popforge.revive.application.*; import de.popforge.revive.display.*; public class Test extends SceneContainer { public var insertObject:InsertObject; public var drawFlg:Boolean; public var editPoint:FixedSpring; public var danmenBody:DanmenBody; public var editFlg:Boolean; public function Test(){ drawFlg = true; editFlg = false; createScene(); createStageBounds(); danmenBody = new DanmenBody(this); insertObject = new InsertObject(this); } override protected function onMouseUp(_arg1:MouseEvent):void{ if (mouseSpring){ simulation.removeForce(mouseSpring); mouseSpring = null; }; if (editPoint){ editPoint.x = mouseX; editPoint.y = mouseY; editPoint = null; }; } private function createObj():void{ var _local1:MovableParticle; var _local2:Array; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:MovableParticle; var _local8:MovableParticle; var _local9:Spring; var _local10:MovableSegment; var _local11:int; var _local12:int; var _local13:int; _local2 = new Array(); _local3 = 100; _local4 = 400; _local5 = 200; _local6 = 50; _local1 = new MovableParticle(_local3, _local4); _local1.velocity.x = ((Math.random() * 2) - 1); _local1.velocity.y = ((Math.random() * 2) - 1); simulation.addMovable(_local1); _local2.push(_local1); _local1 = new MovableParticle((_local3 + _local5), _local4); _local1.velocity.x = ((Math.random() * 2) - 1); _local1.velocity.y = ((Math.random() * 2) - 1); simulation.addMovable(_local1); _local2.push(_local1); _local1 = new MovableParticle((_local3 + _local5), (_local4 + _local6)); _local1.velocity.x = ((Math.random() * 2) - 1); _local1.velocity.y = ((Math.random() * 2) - 1); simulation.addMovable(_local1); _local2.push(_local1); _local1 = new MovableParticle(_local3, (_local4 + _local6)); _local1.velocity.x = ((Math.random() * 2) - 1); _local1.velocity.y = ((Math.random() * 2) - 1); simulation.addMovable(_local1); _local2.push(_local1); _local11 = 4; _local13 = (_local11 - 1); _local12 = 0; while (_local12 < _local11) { _local7 = _local2[_local12]; _local8 = _local2[_local13]; _local9 = new Spring(_local7, _local8); simulation.addForce(_local9); _local10 = new MovableSegment(_local7, _local8); simulation.addMovable(_local10); _local13 = _local12; _local12++; }; _local9 = new Spring(_local2[0], _local2[2]); simulation.addForce(_local9); _local9 = new Spring(_local2[1], _local2[3]); simulation.addForce(_local9); } override protected function createStageBounds():void{ var _local1:ImmovableGate; var _local2:uint; var _local3:uint; _local2 = (WIDTH + 200); _local3 = (HEIGHT - 150); _local1 = new ImmovableGate(_local2, 0, 0, 0); simulation.addImmovable(_local1); _local1 = new ImmovableGate(0, _local3, _local2, _local3); simulation.addImmovable(_local1); _local1 = new ImmovableGate(0, 0, 0, _local3); simulation.addImmovable(_local1); _local1 = new ImmovableGate(_local2, _local3, _local2, 0); simulation.addImmovable(_local1); } override public function onEnterFrame(_arg1:Event):void{ var _local2:int; var _local3:Number; var _local4:Number; var _local5:IDrawAble; if (simulation == null){ return; }; if (mouseSpring){ _local3 = (mouseSpring.movableParticle.x - mouseX); _local4 = (mouseSpring.movableParticle.y - mouseY); mouseSpring.x = mouseX; mouseSpring.y = mouseY; }; simulation.nextFrame(); simulation.nextFrame(); danmenBody.updateObj(); insertObject.updateObj(); mShape.graphics.clear(); mShapeImage.graphics.clear(); if (drawFlg){ insertObject.drawObj(mShapeImage.graphics); danmenBody.drawObj(mShapeImage.graphics); } else { mShape.graphics.lineStyle(0, COLOR_IMMOVABLE); for each (_local5 in simulation.immovables) { _local5.draw(mShape.graphics); }; mShape.graphics.lineStyle(0, COLOR_MOVABLE); for each (_local5 in simulation.movables) { _local5.draw(mShape.graphics); }; mShape.graphics.lineStyle(0, COLOR_FORCE); for each (_local5 in simulation.forces) { _local5.draw(mShape.graphics); }; }; } override protected function onMouseDown(_arg1:MouseEvent):void{ var _local2:Number; var _local3:Number; var _local4:Movable; var _local5:FixedSpring; if (editFlg == false){ for each (_local4 in insertObject.pointArr[0]) { if ((((_local4 is MovableParticle)) || ((_local4 is MovableCircle)))){ _local2 = (MovableParticle(_local4).x - mouseX); _local3 = (MovableParticle(_local4).y - mouseY); if (((_local2 * _local2) + (_local3 * _local3)) < MOUSE_CATCH_DISTANCE2){ mouseSpring = new FixedSpring(mouseX, mouseY, MovableParticle(_local4), MOUSE_CATCH_STRENGTH, 0); simulation.addForce(mouseSpring); break; }; }; }; } else { for each (_local5 in danmenBody.pointBaseArr[0]) { _local2 = (FixedSpring(_local5).x - mouseX); _local3 = (FixedSpring(_local5).y - mouseY); if (((_local2 * _local2) + (_local3 * _local3)) < MOUSE_CATCH_DISTANCE2){ editPoint = _local5; break; }; }; }; } private function createWall():void{ var _local1:Immovable; _local1 = new ImmovableGate(277, 38, 380, 85); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(380, 85); simulation.addImmovable(_local1); _local1 = new ImmovableGate(380, 85, 172, 116); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(172, 116); simulation.addImmovable(_local1); _local1 = new ImmovableGate(172, 116, 149, 144); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(149, 144); simulation.addImmovable(_local1); _local1 = new ImmovableGate(149, 144, 156, 177); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(156, 177); simulation.addImmovable(_local1); _local1 = new ImmovableGate(156, 177, 191, 197); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(191, 197); simulation.addImmovable(_local1); _local1 = new ImmovableGate(191, 197, 316, 167); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(316, 167); simulation.addImmovable(_local1); _local1 = new ImmovableGate(316, 167, 438, 144); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(438, 144); simulation.addImmovable(_local1); _local1 = new ImmovableGate(438, 144, 438, 144); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(438, 144); simulation.addImmovable(_local1); _local1 = new ImmovableGate(438, 144, 191, 208); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(191, 208); simulation.addImmovable(_local1); _local1 = new ImmovableGate(191, 208, 116, 207); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(116, 207); simulation.addImmovable(_local1); _local1 = new ImmovableGate(116, 207, 81, 278); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(81, 278); simulation.addImmovable(_local1); _local1 = new ImmovableGate(81, 278, 116, 349); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(116, 349); simulation.addImmovable(_local1); _local1 = new ImmovableGate(116, 349, 198, 360); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(198, 360); simulation.addImmovable(_local1); _local1 = new ImmovableGate(198, 360, 247, 323); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(247, 323); simulation.addImmovable(_local1); _local1 = new ImmovableGate(247, 323, 235, 259); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(235, 259); simulation.addImmovable(_local1); _local1 = new ImmovableGate(235, 259, 319, 234); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(319, 234); simulation.addImmovable(_local1); _local1 = new ImmovableGate(319, 234, 446, 207); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(446, 207); simulation.addImmovable(_local1); _local1 = new ImmovableGate(446, 207, 447, 213); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(447, 213); simulation.addImmovable(_local1); _local1 = new ImmovableGate(447, 213, 326, 240); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(326, 240); simulation.addImmovable(_local1); _local1 = new ImmovableGate(326, 240, 298, 279); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(298, 279); simulation.addImmovable(_local1); _local1 = new ImmovableGate(298, 279, 314, 333); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(314, 333); simulation.addImmovable(_local1); _local1 = new ImmovableGate(314, 333, 350, 344); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(350, 344); simulation.addImmovable(_local1); _local1 = new ImmovableGate(350, 344, 418, 321); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(418, 321); simulation.addImmovable(_local1); _local1 = new ImmovableGate(418, 321, 440, 265); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(440, 265); simulation.addImmovable(_local1); _local1 = new ImmovableGate(440, 265, 449, 269); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(449, 269); simulation.addImmovable(_local1); _local1 = new ImmovableGate(449, 269, 427, 326); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(427, 326); simulation.addImmovable(_local1); _local1 = new ImmovableGate(427, 326, 280, 390); simulation.addImmovable(_local1); _local1 = new ImmovablePoint(280, 390); simulation.addImmovable(_local1); } public function createScene():void{ var _local1:Immovable; createWall(); } } }//package scenes
Section 31
//LabelButton (LabelButton) package { import flash.display.*; import de.popforge.revive.application.*; import flash.text.*; public class LabelButton extends Sprite { public var label:TextField; public var scene:SceneContainer; public function LabelButton(_arg1:String){ var _local2:TextFormat; label = new TextField(); super(); _local2 = new TextFormat(); _local2.font = "_����"; _local2.size = 10; _local2.color = 0; label.setTextFormat(_local2); label.text = _arg1; label.autoSize = TextFieldAutoSize.CENTER; label.border = true; label.background = true; label.backgroundColor = 0xDDDDDD; label.selectable = false; label.mouseEnabled = false; addChild(label); buttonMode = true; } } }//package
Section 32
//Main (Main) package { import flash.events.*; import flash.display.*; import de.popforge.revive.member.*; import de.popforge.revive.resolve.*; import de.popforge.revive.geom.*; import de.popforge.revive.forces.*; import de.popforge.revive.application.*; import scenes.*; import flash.text.*; import de.popforge.revive.display.*; import de.popforge.surface.display.*; import flash.utils.*; import flash.system.*; public class Main extends Sprite { private var img0000:Bitmap; private var btn3:LabelButton; private var btn2:LabelButton; private var btn4:LabelButton; private var img0010:Bitmap; private var btn1:LabelButton; private var img0020:Bitmap; private var scene:Test; private var img0030:Bitmap; private var pointText:TextField; private static const Image0030:Class = Main_Image0030; private static const Image0020:Class = Main_Image0020; private static const Image0010:Class = Main_Image0010; private static const Image0000:Class = Main_Image0000; public function Main(){ initAll(); } private function createChangeButton():void{ } private function onDragChange(_arg1:Event):void{ scene.simulation.globalDrag = _arg1.target.getValue(); } private function chg_btn1Mouse_upEventHandler(_arg1:MouseEvent):void{ if (scene.drawFlg){ scene.drawFlg = false; btn1.label.text = "NOWVIEW_MODEL"; } else { scene.drawFlg = true; btn1.label.text = "NOWVIEW_DRAW"; }; } private function initAll():void{ img0020 = (new Image0020() as Bitmap); addChild(img0020); stage.scaleMode = StageScaleMode.NO_SCALE; addChild(new FPSCounter()); scene = new Test(); scene.simulation.globalForce.y = 0.1; addChild(scene); img0010 = (new Image0010() as Bitmap); addChild(img0010); createChangeButton(); } private function chg_btn3Mouse_upEventHandler(_arg1:MouseEvent):void{ var _local2:FixedSpring; var _local3:uint; var _local4:String; var _local5:String; _local3 = 0; _local4 = "dataX = new Array("; _local5 = "dataY = new Array("; for each (_local2 in scene.danmenBody.pointBaseArr[0]) { _local4 = (_local4 + (FixedSpring(_local2).x + ", ")); _local5 = (_local5 + (FixedSpring(_local2).y + ", ")); _local3++; }; pointText.text = _local4.slice(0, (_local4.length - 2)); pointText.appendText(" );"); pointText.appendText(" \n"); pointText.appendText(_local5.slice(0, (_local5.length - 2))); pointText.appendText(" );"); pointText.appendText(" \n"); System.setClipboard(pointText.text); } protected function onMouseDown(_arg1:MouseEvent):void{ pointText.appendText((((mouseX + ", ") + mouseY) + "\n")); } private function onFpsChange(_arg1:Event):void{ stage.frameRate = _arg1.target.getValue(); } private function chg_btn4Mouse_upEventHandler(_arg1:MouseEvent):void{ } private function chg_btn2Mouse_upEventHandler(_arg1:MouseEvent):void{ if (scene.editFlg){ scene.editFlg = false; btn2.label.text = "NOWMODE_MOVE"; } else { scene.editFlg = true; btn2.label.text = "NOWMODE_EDIT"; }; } private function onGravityChange(_arg1:Event):void{ scene.simulation.globalForce.y = _arg1.target.getValue(); } } }//package
Section 33
//Main_Image0000 (Main_Image0000) package { import mx.core.*; public class Main_Image0000 extends BitmapAsset { } }//package
Section 34
//Main_Image0010 (Main_Image0010) package { import mx.core.*; public class Main_Image0010 extends BitmapAsset { } }//package
Section 35
//Main_Image0020 (Main_Image0020) package { import mx.core.*; public class Main_Image0020 extends BitmapAsset { } }//package
Section 36
//Main_Image0030 (Main_Image0030) package { import mx.core.*; public class Main_Image0030 extends BitmapAsset { } }//package

Library Items

Symbol 1 Bitmap {Main_Image0000}
Symbol 2 Bitmap {Main_Image0010}
Symbol 3 Bitmap {Main_Image0020}
Symbol 4 Bitmap {Main_Image0030}

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1457 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
SerialNumber (41)Timeline Frame 1

Labels

"Main"Frame 1




http://swfchan.com/9/41700/info.shtml
Created: 11/8 -2019 11:02:53 Last modified: 11/8 -2019 11:02:53 Server time: 06/05 -2024 05:28:25