├── CamTools └── COMING_SOON.txt ├── Chunker ├── ChunkerTest.fla ├── ChunkerTest.swf ├── README.txt ├── Stats.as └── com │ └── gskinner │ └── utils │ └── Chunker.as ├── CircularCollision └── COMING_SOON.txt ├── CollisionDetection ├── CollisionDetectionTest.as ├── CollisionDetectionTest.fla ├── CollisionDetectionTest.swf ├── README.txt └── com │ └── gskinner │ └── sprites │ ├── CollisionDetection.as │ └── CollisionEngine.as ├── ColorMatrix ├── .flashProjectProperties ├── ColorMatrixDemo.as ├── ColorMatrixDemo.fla ├── ColorMatrixDemo.swf ├── README.txt └── com │ └── gskinner │ └── geom │ └── ColorMatrix.as ├── FireFX ├── FireFXexamples.jpg ├── README.txt ├── Sample.fla ├── Sample.swf └── com │ └── gskinner │ └── effects │ └── FireFX.as ├── FrameScriptManager ├── FrameScriptManagerTest.as ├── FrameScriptManagerTest.fla ├── FrameScriptManagerTest.swf ├── README.txt ├── com │ └── gskinner │ │ └── utils │ │ └── FrameScriptManager.as └── experimentalVersion │ ├── FrameScriptManager.as │ ├── FrameScriptManagerTest.as │ ├── FrameScriptManagerTest.fla │ └── FrameScriptManagerTest.swf ├── Kaleidoscope ├── README.txt ├── docs.html ├── docs │ ├── all-classes.html │ ├── all-index-A.html │ ├── all-index-B.html │ ├── all-index-C.html │ ├── all-index-D.html │ ├── all-index-E.html │ ├── all-index-F.html │ ├── all-index-G.html │ ├── all-index-H.html │ ├── all-index-I.html │ ├── all-index-J.html │ ├── all-index-K.html │ ├── all-index-L.html │ ├── all-index-M.html │ ├── all-index-N.html │ ├── all-index-O.html │ ├── all-index-P.html │ ├── all-index-Q.html │ ├── all-index-R.html │ ├── all-index-S.html │ ├── all-index-T.html │ ├── all-index-U.html │ ├── all-index-V.html │ ├── all-index-W.html │ ├── all-index-X.html │ ├── all-index-Y.html │ ├── all-index-Z.html │ ├── appendixes.html │ ├── asdoc.js │ ├── class-summary.html │ ├── com │ │ └── gskinner │ │ │ └── effects │ │ │ ├── Kaleidoscope.html │ │ │ ├── class-list.html │ │ │ └── package-detail.html │ ├── cookies.js │ ├── images │ │ ├── collapsed.gif │ │ ├── detailHeaderRule.jpg │ │ ├── detailSectionHeader.jpg │ │ ├── expanded.gif │ │ ├── inherit-arrow.gif │ │ ├── inheritedSummary.gif │ │ ├── logo.jpg │ │ ├── titleTableBottom.jpg │ │ ├── titleTableMiddle.jpg │ │ └── titleTableTop.jpg │ ├── index-list.html │ ├── index.html │ ├── mxml-tags.html │ ├── package-frame.html │ ├── package-list.html │ ├── package-summary.html │ ├── print.css │ ├── style.css │ └── title-bar.html └── src │ ├── KaleidoscopeTest.as │ ├── KaleidoscopeTest.fla │ ├── KaleidoscopeTest.swf │ └── com │ └── gskinner │ └── effects │ └── Kaleidoscope.as ├── MusicViz └── COMING_SOON.txt ├── PathFinding └── COMING_SOON.txt ├── PatternRecognition └── COMING_SOON.txt ├── PerformanceTest ├── BarGraph.as ├── BarGraphLogger.as ├── BarGraphTest.fla ├── BarGraphTest.swf ├── Dashboard.as ├── Main_CS3.as ├── Main_CS3.fla ├── Main_CS3.swf ├── Main_CS4.as ├── Main_CS4.fla ├── Main_CS4.swf ├── PatternRect.as ├── PerformanceTestDashboard.as ├── PerformanceTestDashboard.fla ├── PerformanceTestDashboard.swf ├── README.txt ├── com │ └── gskinner │ │ ├── geom │ │ └── ColorMatrix.as │ │ ├── motion │ │ ├── GTween.as │ │ ├── GTweenTimeline.as │ │ ├── GTweener.as │ │ └── plugins │ │ │ ├── AutoHidePlugin.as │ │ │ ├── BlurPlugin.as │ │ │ ├── ColorAdjustPlugin.as │ │ │ ├── ColorTransformPlugin.as │ │ │ ├── CurrentFramePlugin.as │ │ │ ├── IGTweenPlugin.as │ │ │ ├── MotionBlurPlugin.as │ │ │ ├── SmartRotationPlugin.as │ │ │ └── SnappingPlugin.as │ │ └── utils │ │ └── PerformanceTest.as ├── docs │ ├── PerformanceTest.html │ ├── asdoc.js │ ├── cookies.js │ ├── images │ │ ├── collapsed.gif │ │ ├── detailHeaderRule.jpg │ │ ├── detailSectionHeader.jpg │ │ ├── expanded.gif │ │ ├── inherit-arrow.gif │ │ ├── inheritedSummary.gif │ │ ├── logo.jpg │ │ ├── titleTableBottom.jpg │ │ ├── titleTableMiddle.jpg │ │ └── titleTableTop.jpg │ ├── print.css │ └── style.css ├── mx │ ├── core │ │ └── Version.as │ └── effects │ │ └── easing │ │ ├── Back.as │ │ ├── Bounce.as │ │ ├── Circular.as │ │ ├── Cubic.as │ │ ├── Elastic.as │ │ ├── Exponential.as │ │ ├── Linear.as │ │ ├── Quadratic.as │ │ ├── Quartic.as │ │ ├── Quintic.as │ │ ├── Sine.as │ │ └── easing_readme.txt └── performancetests │ ├── ArrLength.as │ ├── Bitwise.as │ ├── Casting.as │ ├── CastingPromotion.as │ ├── CollectionIteration.as │ ├── CollectionSplice.as │ ├── Collections.as │ ├── Conditional.as │ ├── Events.as │ ├── FunctionScope.as │ ├── FunctionScopeTest.as │ ├── Functions.as │ ├── GraphicsTests.as │ ├── InlineFunction.as │ ├── Literals.as │ ├── LoopHoisting.as │ ├── Loops.as │ ├── MultDiv.as │ ├── Scope.as │ ├── StrongTyping.as │ ├── TryCatch.as │ └── numeric │ ├── ArrayIterators.as │ └── VectorIterators.as ├── ProximityManager ├── README.txt ├── docs.html ├── docs │ ├── all-classes.html │ ├── all-index-A.html │ ├── all-index-B.html │ ├── all-index-C.html │ ├── all-index-D.html │ ├── all-index-E.html │ ├── all-index-F.html │ ├── all-index-G.html │ ├── all-index-H.html │ ├── all-index-I.html │ ├── all-index-J.html │ ├── all-index-K.html │ ├── all-index-L.html │ ├── all-index-M.html │ ├── all-index-N.html │ ├── all-index-O.html │ ├── all-index-P.html │ ├── all-index-Q.html │ ├── all-index-R.html │ ├── all-index-S.html │ ├── all-index-T.html │ ├── all-index-U.html │ ├── all-index-V.html │ ├── all-index-W.html │ ├── all-index-X.html │ ├── all-index-Y.html │ ├── all-index-Z.html │ ├── appendixes.html │ ├── asdoc.js │ ├── class-summary.html │ ├── com │ │ └── gskinner │ │ │ └── utils │ │ │ ├── ProximityManager.html │ │ │ ├── class-list.html │ │ │ └── package-detail.html │ ├── cookies.js │ ├── images │ │ ├── collapsed.gif │ │ ├── detailHeaderRule.jpg │ │ ├── detailSectionHeader.jpg │ │ ├── expanded.gif │ │ ├── inherit-arrow.gif │ │ ├── inheritedSummary.gif │ │ ├── logo.jpg │ │ ├── titleTableBottom.jpg │ │ ├── titleTableMiddle.jpg │ │ └── titleTableTop.jpg │ ├── index-list.html │ ├── index.html │ ├── mxml-tags.html │ ├── package-frame.html │ ├── package-list.html │ ├── package-summary.html │ ├── print.css │ ├── style.css │ └── title-bar.html └── src │ ├── ProximityTest.as │ ├── ProximityTest.fla │ ├── ProximityTest.swf │ ├── READ ME.txt │ └── com │ └── gskinner │ └── utils │ └── ProximityManager.as ├── README.txt ├── Rndm ├── README.txt ├── RndmTest.as ├── RndmTest.fla ├── RndmTest.swf └── com │ └── gskinner │ └── utils │ ├── Rnd.as │ ├── Rndm.as │ └── RndmBmpd.as ├── SharpenFilter ├── README.txt ├── SharpenDemo.as ├── SharpenDemo.fla ├── SharpenDemo.swf └── com │ └── gskinner │ └── filters │ └── SharpenFilter.as ├── TextFlow ├── README.txt ├── TextFlow │ ├── TextFlowDemo.fla │ ├── TextFlowDemo.swf │ ├── TextFlowDemo2.fla │ ├── TextFlowDemo2.swf │ └── com │ │ └── gskinner │ │ └── text │ │ └── TextFlow.as ├── TextFlowLite │ ├── TextFlowLiteDemo.fla │ ├── TextFlowLiteDemo.swf │ └── com │ │ └── gskinner │ │ └── text │ │ └── TextFlowLite.as └── TextFlowPro │ ├── TextFlowProDemo.fla │ ├── TextFlowProDemo.swf │ ├── TextFlowProDemo2.fla │ ├── TextFlowProDemo2.swf │ └── com │ └── gskinner │ └── text │ ├── TextFlowEntry.as │ └── TextFlowPro.as ├── Wander ├── README.txt ├── docs.html ├── docs │ ├── all-classes.html │ ├── all-index-A.html │ ├── all-index-B.html │ ├── all-index-C.html │ ├── all-index-D.html │ ├── all-index-E.html │ ├── all-index-F.html │ ├── all-index-G.html │ ├── all-index-H.html │ ├── all-index-I.html │ ├── all-index-J.html │ ├── all-index-K.html │ ├── all-index-L.html │ ├── all-index-M.html │ ├── all-index-N.html │ ├── all-index-O.html │ ├── all-index-P.html │ ├── all-index-Q.html │ ├── all-index-R.html │ ├── all-index-S.html │ ├── all-index-T.html │ ├── all-index-U.html │ ├── all-index-V.html │ ├── all-index-W.html │ ├── all-index-X.html │ ├── all-index-Y.html │ ├── all-index-Z.html │ ├── appendixes.html │ ├── asdoc.js │ ├── class-summary.html │ ├── com │ │ └── gskinner │ │ │ └── motion │ │ │ ├── Wander.html │ │ │ ├── class-list.html │ │ │ └── package-detail.html │ ├── cookies.js │ ├── images │ │ ├── collapsed.gif │ │ ├── detailHeaderRule.jpg │ │ ├── detailSectionHeader.jpg │ │ ├── expanded.gif │ │ ├── inherit-arrow.gif │ │ ├── inheritedSummary.gif │ │ ├── logo.jpg │ │ ├── titleTableBottom.jpg │ │ ├── titleTableMiddle.jpg │ │ └── titleTableTop.jpg │ ├── index-list.html │ ├── index.html │ ├── mxml-tags.html │ ├── package-frame.html │ ├── package-list.html │ ├── package-summary.html │ ├── print.css │ ├── style.css │ └── title-bar.html └── src │ ├── READ ME.txt │ ├── WanderDemo.swf │ ├── WanderFollow.as │ ├── WanderFollow.fla │ ├── WanderFollow.swf │ ├── WanderTest.as │ ├── WanderTest.fla │ ├── WanderTest.swf │ └── com │ └── gskinner │ └── motion │ └── Wander.as └── _Sketches ├── CurvedLines ├── CurveTest.fla ├── CurveTest.swf ├── DoubleCurveTest.fla ├── DoubleCurveTest.swf ├── DoubleCurveTest2.fla ├── DoubleCurveTest2.swf └── README.txt ├── DragManager ├── Dragging.fla ├── Dragging.swf ├── README.txt └── com │ └── gskinner │ └── ui │ ├── Drag.as │ └── Drag_STATIC.as ├── FloatyPods └── COMING_SOON.txt ├── HeatMap ├── README.txt ├── alphaHeatmapTest.fla ├── alphaHeatmapTest.swf ├── com │ └── gskinner │ │ └── misc │ │ └── HeatMap.as ├── heatmapTest.fla └── heatmapTest.swf ├── HexMap ├── HexMap.as ├── HexMap.fla ├── HexMap.swf ├── HexTile.as └── README.txt ├── PaintBlobs ├── Paint.fla ├── Paint.swf ├── Paint2.fla ├── Paint2.swf ├── Paint3.fla ├── Paint3.swf ├── Paint4.fla ├── Paint4.swf ├── Paint5.fla ├── Paint5.swf └── README.txt ├── SimpleTagCloud ├── README.txt ├── TagCloud.as ├── TagCloudTest.as ├── TagCloudTest.fla └── TagCloudTest.swf ├── Swarming ├── README.txt ├── Test2.fla ├── Test2.swf ├── Test4.fla ├── Test4.swf ├── Test7.fla └── Test7.swf └── VersionStringComparison ├── README.txt ├── VersionStringComparison.as ├── VersionStringComparison.fla └── VersionStringComparison.swf /CamTools/COMING_SOON.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Chunker/ChunkerTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Chunker/ChunkerTest.fla -------------------------------------------------------------------------------- /Chunker/ChunkerTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Chunker/ChunkerTest.swf -------------------------------------------------------------------------------- /Chunker/README.txt: -------------------------------------------------------------------------------- 1 | ** Chunker ** 2 | Simple library for breaking intensive tasks up across frames to maintain UI responsiveness (simple green threads). -------------------------------------------------------------------------------- /Chunker/com/gskinner/utils/Chunker.as: -------------------------------------------------------------------------------- 1 | /** * Chunker by Grant Skinner. Apr 17, 2011 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2011 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package com.gskinner.utils { import flash.display.Shape; import flash.events.Event; import flash.utils.getTimer; public class Chunker { static protected var shape:Shape; // broadcasts ENTER_FRAME // Constants: // Public Properties: public var method:Function; public var time:uint; public var data:Object; // Protected Properties: protected var _paused:Boolean; // Initialization: public function Chunker(time:uint, method:Function, data:Object=null) { if (shape == null) { shape = new Shape(); } this.time = time; this.method = method; this.data = data; paused = false; } // Public getter / setters: public function get paused():Boolean { return _paused; } public function set paused(value:Boolean):void { _paused = value; if (value) { shape.removeEventListener(Event.ENTER_FRAME, tick); } else { shape.addEventListener(Event.ENTER_FRAME, tick, false, 0, true); } } // Public Methods: // Protected Methods: public function tick(evt:Event):void { var t:uint = getTimer(); while (getTimer() < t+time && !_paused) { method(this); } } } } -------------------------------------------------------------------------------- /CircularCollision/COMING_SOON.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /CollisionDetection/CollisionDetectionTest.as: -------------------------------------------------------------------------------- 1 | package { import com.gskinner.sprites.CollisionDetection; import flash.display.Bitmap; import flash.geom.Rectangle; import flash.display.Shape; import flash.display.Sprite; import flash.events.MouseEvent; public class CollisionDetectionTest extends Sprite { // Protected Properties: protected var canvas:Shape; protected var previewBmp:Bitmap; // Initialization: public function CollisionDetectionTest() { stage.addEventListener(MouseEvent.MOUSE_MOVE,handleMove); canvas = new Shape(); addChild(canvas); previewBmp = new Bitmap(CollisionDetection.bitmapData); previewBmp.x = previewBmp.y = 10; addChild(previewBmp); } // Protected Methods: protected function handleMove(evt:MouseEvent):void { ball.x = stage.mouseX; ball.y = stage.mouseY; canvas.graphics.clear(); var intersection:Rectangle = CollisionDetection.check(ball,outer.thing); previewBmp.visible = (intersection != null); if (intersection == null) { return; } canvas.graphics.lineStyle(1,0xFF0000,1); canvas.graphics.drawRect(intersection.x,intersection.y,intersection.width,intersection.height); } } } -------------------------------------------------------------------------------- /CollisionDetection/CollisionDetectionTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/CollisionDetection/CollisionDetectionTest.fla -------------------------------------------------------------------------------- /CollisionDetection/CollisionDetectionTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/CollisionDetection/CollisionDetectionTest.swf -------------------------------------------------------------------------------- /CollisionDetection/README.txt: -------------------------------------------------------------------------------- 1 | ** CollisionDetection ** 2 | Pixel-perfect shape based collision detection. 3 | 4 | Also includes CollisionEngine, which is an untested collision detection engine which combines grid based proximity with shape based collision detection. 5 | 6 | ex. 7 | var intersection:Rectangle = CollisionDetection.check(foo, bar); 8 | if (intersection) { 9 | trace("collision!"); 10 | } -------------------------------------------------------------------------------- /ColorMatrix/.flashProjectProperties: -------------------------------------------------------------------------------- 1 | 2 | 1302898628230 3 | ColorMatrixDemo 4 | 0 5 | file:///Macintosh HD/Users/grant/Library/Application Support/Adobe/Flash CS5/en_US/Configuration/ActionScript 3.0/Templates/boundClass_as3.as 6 | file:///Macintosh HD/Users/grant/Library/Application Support/Adobe/Flash CS5/en_US/Configuration/ActionScript 3.0/Templates/standardClass_as3.as 7 | . 8 | file:///Macintosh HD/Users/grant/Documents/flash/AS3Libs/ColorMatrix/ColorMatrixDemo.fla 9 | file:///Macintosh HD/Users/grant/Documents/flash/AS3Libs/ColorMatrix/ 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ColorMatrix/ColorMatrixDemo.as: -------------------------------------------------------------------------------- 1 | package { import com.gskinner.geom.ColorMatrix; import flash.filters.ColorMatrixFilter; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import fl.controls.Button; import fl.controls.NumericStepper; public class ColorMatrixDemo extends Sprite { // Public Properties: public var resetButton:Button; public var brightnessStepper:NumericStepper; public var contrastStepper:NumericStepper; public var saturationStepper:NumericStepper; public var hueStepper:NumericStepper; // Protected Properties: protected var colorMatrix:ColorMatrix; protected var colorMatrixFilter:ColorMatrixFilter; // Initialization: public function ColorMatrixDemo() { resetButton.addEventListener(MouseEvent.CLICK, onReset, false, 0, true); brightnessStepper.addEventListener(Event.CHANGE, handleChange, false, 0, true); contrastStepper.addEventListener(Event.CHANGE, handleChange, false, 0, true); saturationStepper.addEventListener(Event.CHANGE, handleChange, false, 0, true); hueStepper.addEventListener(Event.CHANGE, handleChange, false, 0, true); colorMatrix = new ColorMatrix(); colorMatrixFilter = new ColorMatrixFilter(colorMatrix); } // Protected Methods: protected function handleChange(e:Event) { update(); } protected function onReset(e:MouseEvent) { brightnessStepper.value = contrastStepper.value = saturationStepper.value = hueStepper.value = 0; update(); } protected function update() { colorMatrix.reset(); colorMatrix.adjustColor(brightnessStepper.value, contrastStepper.value, saturationStepper.value, hueStepper.value); colorMatrixFilter.matrix = colorMatrix; clip.filters = [colorMatrixFilter]; } } } -------------------------------------------------------------------------------- /ColorMatrix/ColorMatrixDemo.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ColorMatrix/ColorMatrixDemo.fla -------------------------------------------------------------------------------- /ColorMatrix/ColorMatrixDemo.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ColorMatrix/ColorMatrixDemo.swf -------------------------------------------------------------------------------- /ColorMatrix/README.txt: -------------------------------------------------------------------------------- 1 | ** ColorMatrix ** 2 | Provides common color adjustment methods for use with ColorMatrixFilter. Uses the same math / values as the Flash Pro IDE's "Adjust Color" filter. -------------------------------------------------------------------------------- /FireFX/FireFXexamples.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/FireFX/FireFXexamples.jpg -------------------------------------------------------------------------------- /FireFX/README.txt: -------------------------------------------------------------------------------- 1 | ** FireFX ** 2 | Flash component that creates animated fire effects on any display object. Should be simple to use the provided source code to use it in pure AS3 projects or Flex as well. -------------------------------------------------------------------------------- /FireFX/Sample.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/FireFX/Sample.fla -------------------------------------------------------------------------------- /FireFX/Sample.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/FireFX/Sample.swf -------------------------------------------------------------------------------- /FrameScriptManager/FrameScriptManagerTest.as: -------------------------------------------------------------------------------- 1 | /** * FrameScriptManagerTest by Grant Skinner. November 13, 2007 * Visit www.gskinner.com/blog for documentation, updates and more free code. */ package { import flash.events.EventDispatcher; import com.gskinner.utils.FrameScriptManager; import flash.display.MovieClip; public class FrameScriptManagerTest extends MovieClip { // constructor: public function FrameScriptManagerTest() { super(); var fsm:FrameScriptManager = new FrameScriptManager(this); fsm.setFrameScript("lbl1",newLbl1Funct); fsm.setFrameScript("lbl2",newLbl2Funct); trace("frame number for label 'lbl1': "+fsm.getFrameNumber("lbl1")); } // public getter/setters: // public methods: private function newLbl1Funct():void { trace("new lbl1 trace"); } private function newLbl2Funct():void { trace("new lbl2 trace"); stop(); } // private methods: } } -------------------------------------------------------------------------------- /FrameScriptManager/FrameScriptManagerTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/FrameScriptManager/FrameScriptManagerTest.fla -------------------------------------------------------------------------------- /FrameScriptManager/FrameScriptManagerTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/FrameScriptManager/FrameScriptManagerTest.swf -------------------------------------------------------------------------------- /FrameScriptManager/README.txt: -------------------------------------------------------------------------------- 1 | ** FrameScriptManager ** 2 | Inject ActionScript into a movieclip timeline at a specific frame number or label. Great for separating code and design. 3 | 4 | ex. 5 | var foo:FrameScriptManager = new FrameScriptManager(mc); 6 | foo.setFrameScript("label1", myFunction1); 7 | foo.setFrameScript(12, myFunction2); -------------------------------------------------------------------------------- /FrameScriptManager/com/gskinner/utils/FrameScriptManager.as: -------------------------------------------------------------------------------- 1 | /** * FrameScriptManager by Grant Skinner. Nov 13, 2007 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2011 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package com.gskinner.utils { import flash.display.MovieClip; public class FrameScriptManager { // constants: // private properties: private var target:MovieClip; private var labels:Object; // public properties: // constructor: public function FrameScriptManager(target:MovieClip) { this.target = target; updateLabels(); } // public getter/setters: // public methods: public function setFrameScript(frame:*, funct:Function):void { var frameNum:uint = getFrameNumber(frame); if (frameNum == 0) { return; } target.addFrameScript(frameNum-1,funct); } public function getFrameNumber(frame:*):uint { var frameNum:uint = uint(frame); if (frameNum) { return frameNum; } var label:String = String(frame); if (label == null) { return 0; } frameNum = labels[label]; return frameNum; } // private methods: private function updateLabels():void { var lbls:Array = target.currentLabels; labels = {}; for (var i:uint=0; i 2 | 3 | 4 | 5 | 6 | 7 | Redirecting... 8 | 9 | 17 | 18 | 19 | 20 | 21 | 22 | Redirecting... 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/all-classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Classes - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | All Classes 13 |

14 | 15 | 16 | 17 | 18 |
Kaleidoscope
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/appendixes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Appendixes 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 |
 AppendixDescription
39 |

40 | 42 |
43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/com/gskinner/effects/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.gskinner.effects - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package com.gskinner.effects 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Classes
Kaleidoscope
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/com/gskinner/effects/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.gskinner.effects Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 |
 ClassDescription
 Kaleidoscope 43 | Kaleidoscope ©2009 Grant Skinner, gskinner.com.
46 |

47 |
48 |

49 | 51 |
52 |
53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/cookies.js: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // ADOBE SYSTEMS INCORPORATED 4 | // Copyright 2006-2007 Adobe Systems Incorporated 5 | // All Rights Reserved. 6 | // 7 | // NOTICE: Adobe permits you to use, modify, and distribute this file 8 | // in accordance with the terms of the license agreement accompanying it. 9 | // 10 | //////////////////////////////////////////////////////////////////////////////// 11 | 12 | /** 13 | * Read the JavaScript cookies tutorial at: 14 | * http://www.netspade.com/articles/javascript/cookies.xml 15 | */ 16 | 17 | /** 18 | * Sets a Cookie with the given name and value. 19 | * 20 | * name Name of the cookie 21 | * value Value of the cookie 22 | * [expires] Expiration date of the cookie (default: end of current session) 23 | * [path] Path where the cookie is valid (default: path of calling document) 24 | * [domain] Domain where the cookie is valid 25 | * (default: domain of calling document) 26 | * [secure] Boolean value indicating if the cookie transmission requires a 27 | * secure transmission 28 | */ 29 | function setCookie(name, value, expires, path, domain, secure) 30 | { 31 | document.cookie= name + "=" + escape(value) + 32 | ((expires) ? "; expires=" + expires.toGMTString() : "") + 33 | ((path) ? "; path=" + path : "") + 34 | ((domain) ? "; domain=" + domain : "") + 35 | ((secure) ? "; secure" : ""); 36 | } 37 | 38 | /** 39 | * Gets the value of the specified cookie. 40 | * 41 | * name Name of the desired cookie. 42 | * 43 | * Returns a string containing value of specified cookie, 44 | * or null if cookie does not exist. 45 | */ 46 | function getCookie(name) 47 | { 48 | var dc = document.cookie; 49 | var prefix = name + "="; 50 | var begin = dc.indexOf("; " + prefix); 51 | if (begin == -1) 52 | { 53 | begin = dc.indexOf(prefix); 54 | if (begin != 0) return null; 55 | } 56 | else 57 | { 58 | begin += 2; 59 | } 60 | var end = document.cookie.indexOf(";", begin); 61 | if (end == -1) 62 | { 63 | end = dc.length; 64 | } 65 | return unescape(dc.substring(begin + prefix.length, end)); 66 | } 67 | 68 | /** 69 | * Deletes the specified cookie. 70 | * 71 | * name name of the cookie 72 | * [path] path of the cookie (must be same as path used to create cookie) 73 | * [domain] domain of the cookie (must be same as domain used to create cookie) 74 | */ 75 | function deleteCookie(name, path, domain) 76 | { 77 | if (getCookie(name)) 78 | { 79 | document.cookie = name + "=" + 80 | ((path) ? "; path=" + path : "") + 81 | ((domain) ? "; domain=" + domain : "") + 82 | "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/collapsed.gif -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/detailHeaderRule.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/detailHeaderRule.jpg -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/detailSectionHeader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/detailSectionHeader.jpg -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/expanded.gif -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/inherit-arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/inherit-arrow.gif -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/inheritedSummary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/inheritedSummary.gif -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/logo.jpg -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/titleTableBottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/titleTableBottom.jpg -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/titleTableMiddle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/titleTableMiddle.jpg -------------------------------------------------------------------------------- /Kaleidoscope/docs/images/titleTableTop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/docs/images/titleTableTop.jpg -------------------------------------------------------------------------------- /Kaleidoscope/docs/index-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

Index

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
AN
BO
CP
DQ
ER
FS
GT
HU
IV
JW
KX
LY
MZ
117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <body> 46 | 47 | <h2>Frame Alert</h2> 48 | 49 | <p> 50 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 51 | <br> 52 | Link to <a href="package-summary.html">Non-frame version.</a> 53 | 54 | </p> 55 | 56 | </body> 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/mxml-tags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | MXML Only Components - Adobe Flex 2 Language Reference 10 | 11 | 12 | 13 | 14 | 15 | 16 |

MXML Only Components

17 | 18 | <mx:Binding> 19 |
20 | 21 | <mx:Component> 22 |
23 | 24 | <mx:Metadata> 25 |
26 | 27 | <mx:Model> 28 |
29 | 30 | <mx:Script> 31 |
32 | 33 | <mx:Style> 34 |
35 | 36 | <mx:XML> 37 |
38 | 39 | <mx:XMLList> 40 |
41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <body> 20 | 21 | <h2>Frame Alert</h2> 22 | 23 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 24 | <br> 25 | Link to<a href="package-summary.html">Non-frame version.</a> 26 | 27 | </p> 28 | 29 | </body> 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/package-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Package List - API Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | Packages 14 |

15 | 16 | 17 | 18 | 19 |
com.gskinner.effects
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Packages 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
 PackageDescription
 com.gskinner.effects 
42 |

43 | 45 |
46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Kaleidoscope/docs/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | //////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // ADOBE SYSTEMS INCORPORATED 5 | // Copyright 2005-2007 Adobe Systems Incorporated 6 | // All Rights Reserved. 7 | // 8 | // NOTICE: Adobe permits you to use, modify, and distribute this file 9 | // in accordance with the terms of the license agreement accompanying it. 10 | // 11 | //////////////////////////////////////////////////////////////////////////////// 12 | */ 13 | 14 | body { 15 | color: #000000; 16 | background: #ffffff; 17 | font-family: "Times New Roman", Times, serif; 18 | font-size: 12pt; 19 | } 20 | a { 21 | text-decoration: none; 22 | color: #000000; 23 | } 24 | pre { 25 | white-space: -moz-pre-wrap; /* Mozilla */ 26 | white-space: -pre-wrap; /* Opera 4-6 */ 27 | white-space: -o-pre-wrap; /* Opera 7 */ 28 | word-wrap: break-word; /* IE */ 29 | } 30 | .titleTableTopNav, .titleTableSubNav, .logoImage { 31 | display: none; 32 | } 33 | .packageFrame { 34 | display: none; 35 | } 36 | .titleTableSubTitle { 37 | font-weight: bold; 38 | } 39 | .classHeaderTableLabel { 40 | padding-right: 10px; 41 | vertical-align: top; 42 | } 43 | .showHideLinks { 44 | display: none; 45 | } 46 | html>body code { 47 | font-size: 10pt; 48 | } 49 | .summaryTableTitle, .detailSectionHeader { 50 | font-size: 14pt; 51 | font-weight: bold; 52 | padding-top: 15px; 53 | padding-bottom: 5px; 54 | } 55 | .summaryTable { 56 | border: 1px solid #000000; 57 | border-collapse: collapse; 58 | width: 100%; 59 | } 60 | .summaryTableDescription { 61 | padding-bottom: 20px; 62 | } 63 | .summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol { 64 | border: 1px solid #000000; 65 | } 66 | .summaryTablePaddingCol { 67 | border: 1px solid #000000; 68 | border-right: 0px; 69 | } 70 | .summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol { 71 | border: 1px solid #000000; 72 | border-left: 0px; 73 | } 74 | .summaryTableLastCol { 75 | vertical-align: top; 76 | } 77 | .detailHeader { 78 | font-size: 13pt; 79 | padding-top: 100px; 80 | } 81 | .detailHeaderName { 82 | font-weight: bold; 83 | } 84 | .detailHeaderType { 85 | padding-left: 5px; 86 | } 87 | .detailHeaderRule { 88 | background: #FF0000; 89 | } 90 | .seeAlso { 91 | padding-bottom: 20px; 92 | margin-top: -20px; 93 | } 94 | .innertable { 95 | border-collapse: collapse; 96 | } 97 | .innertable td,.innertable th { 98 | border: 1px solid #000000; 99 | padding-left: 5px; 100 | padding-right: 5px; 101 | } 102 | .listing { 103 | font-size: 10pt; 104 | } 105 | .feedbackLink { 106 | display: none; 107 | } 108 | .copyright { 109 | font-size: 10pt; 110 | } -------------------------------------------------------------------------------- /Kaleidoscope/src/KaleidoscopeTest.as: -------------------------------------------------------------------------------- 1 | /* 2 | Note that much of the CPU cost of this demo is generating the perlin noise. 3 | */ 4 | 5 | package { 6 | import com.gskinner.effects.Kaleidoscope; 7 | 8 | import flash.display.BitmapData; 9 | import flash.display.Sprite; 10 | import flash.filters.GlowFilter; 11 | import flash.geom.Point; 12 | 13 | [SWF(frameRate="20", backgroundColor="#000000")] 14 | public class KaleidoscopeTest extends Sprite { 15 | 16 | protected var ks:Kaleidoscope; 17 | protected var src:BitmapData; 18 | protected var count:uint=0; 19 | 20 | public function KaleidoscopeTest() { 21 | stage.scaleMode = "noScale"; 22 | stage.align = "tl"; 23 | 24 | src = new BitmapData(400,100,false,0); 25 | 26 | ks = new Kaleidoscope(src,200,10,true); 27 | ks.onChange = update; 28 | ks.x = stage.stageWidth>>1; 29 | ks.y = stage.stageHeight>>1; 30 | ks.offsetX = -src.width/2; 31 | ks.offsetY = -src.height/2; 32 | ks.rotation = 18; 33 | addChild(ks); 34 | 35 | ks.filters = [new GlowFilter(0xFFFFFF, 1, 8, 8, 32, 1)]; 36 | } 37 | 38 | protected function update(ks:Kaleidoscope):void { 39 | count++; 40 | src.perlinNoise(150,50,2,0,false,false,7,false,[new Point(count,count),new Point(count*1.7,-count*2.7),new Point(-count*4.1,count*8.1)]); 41 | ks.offsetRotation = -count%360; 42 | } 43 | 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /Kaleidoscope/src/KaleidoscopeTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/src/KaleidoscopeTest.fla -------------------------------------------------------------------------------- /Kaleidoscope/src/KaleidoscopeTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Kaleidoscope/src/KaleidoscopeTest.swf -------------------------------------------------------------------------------- /MusicViz/COMING_SOON.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /PathFinding/COMING_SOON.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /PatternRecognition/COMING_SOON.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /PerformanceTest/BarGraphLogger.as: -------------------------------------------------------------------------------- 1 | package { import com.gskinner.utils.PerformanceTest; public class BarGraphLogger { // Constants: // Public Properties: // Protected Properties: protected var _barGraph:BarGraph; protected var index:int=-1; protected var performanceTest:PerformanceTest; protected var maxValue:Number=0; protected var values:Array; protected var _paused:Boolean; // Initialization: public function BarGraphLogger(barGraph:BarGraph, testSuite:Object) { values = []; _barGraph = barGraph; var hasTare:Boolean = testSuite.methods.indexOf("tare") > -1; barGraph.labels = "methodLabels" in testSuite ? testSuite.methodLabels.slice(hasTare?1:0) : testSuite.methods.slice(hasTare?1:0); performanceTest = new PerformanceTest(); performanceTest.logger = this; var l:uint = testSuite.methods.length; for (var i:uint=0; i 0) { label += " "; } label += "["+testSuite.loops.toExponential(0).split("+").join("")+" loops]"; } barGraph.label = label; } // Public getter / setters: public function get paused():Boolean { return _paused; } public function set paused(value:Boolean):void { performanceTest.paused = _paused = value; } // Public Methods: public function logBegin(name:String,description:String,iterations:uint):void { if (name == "tare") { return; } _barGraph.setValueLabelAt("running",index+1); } public function logError(name:String,details:Error):void { throw(details); } public function logMethod(name:String, time:uint, iterations:uint, details:*):void { if (name == "tare") { return; } time /= iterations; index++; maxValue = Math.max(time,maxValue); _barGraph.setValueLabelAt(Math.round(time)+"ms",index); values[index] = time; } public function logEnd(name:String):void { if (index < _barGraph.labels.length-1) { return; } _barGraph.data = values; } // Protected Methods: protected function formatNumber(num:Number,decimal:uint=2):String { var m:Number = Math.pow(10,decimal); var str:String = String( (Math.round(num*m)+0.5)/m ); return str.substr(0,str.length-1); } } } -------------------------------------------------------------------------------- /PerformanceTest/BarGraphTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/BarGraphTest.fla -------------------------------------------------------------------------------- /PerformanceTest/BarGraphTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/BarGraphTest.swf -------------------------------------------------------------------------------- /PerformanceTest/Dashboard.as: -------------------------------------------------------------------------------- 1 | package { import flash.display.Sprite; public class Dashboard extends Sprite { // Constants: // Public Properties: // Protected Properties: protected var logger:BarGraphLogger; protected var timer:Timer; // Initialization: public function Dashboard() { setupPatterns(); layout(); timer = new Timer(1000,1); timer.addEventListener(TimerEvent.TIMER,handleTimer); timer.start(); } // Public getter / setters: // Public Methods: public function setTestSuites(testSuites:Array):void { if (this.testSuites) { throw(new Error("You can only call setTestSuites once.")); } this.testSuites = testSuites; start(); } // Protected Methods: protected function setupPatterns():void { var l:uint = 4; var diagonalPattern:BitmapData = new BitmapData(l,l,true,0); for (var i:uint=0; i>16&0xFF,value>>8&0xFF,value&0xFF,0); } // Public Methods: // Protected Methods: protected function draw():void { graphics.clear(); var bmpd:BitmapData = patterns[_pattern]; graphics.beginBitmapFill(bmpd); graphics.drawRect(0,0,_width,_height); } } } -------------------------------------------------------------------------------- /PerformanceTest/PerformanceTestDashboard.as: -------------------------------------------------------------------------------- 1 | package { import flash.display.Sprite; import performancetests.*; import Dashboard; public class PerformanceTestDashboard extends Sprite { // Constants: // Public Properties: // Protected Properties: protected var dashboard:Dashboard; // Initialization: public function PerformanceTestDashboard() { stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(Event.RESIZE, handleResize); dashboard = new Dashboard(); dashboard.x = dashboard.y = 5; addChild(dashboard); layout(); setTestSuites(); } // Public getter / setters: // Public Methods: // Protected Methods: protected function setTestSuites():void { var suiteClasses:Array = [Events,Functions,Literal]; var suites:Array = []; for (var i:uint=0; i 0); } return value; } } } -------------------------------------------------------------------------------- /PerformanceTest/com/gskinner/motion/plugins/BlurPlugin.as: -------------------------------------------------------------------------------- 1 | package com.gskinner.motion.plugins { import com.gskinner.motion.GTween; import flash.filters.BlurFilter; import com.gskinner.motion.plugins.IGTweenPlugin; public class BlurPlugin implements IGTweenPlugin { public static var enabled:Boolean=true; protected static var instance:BlurPlugin; public static function install():void { if (instance) { return; } instance = new BlurPlugin(); GTween.installPlugin(instance,"blurX"); GTween.installPlugin(instance,"blurY"); GTween.installPlugin(instance,"blur"); } public function init(tween:GTween, name:String, value:Number):Number { // try to find a blur filter: var f:Array = tween.target.filters; for (var i:uint=0; i>24&0xFF; var rA:uint = initValue>>16&0xFF; var gA:uint = initValue>>8&0xFF; var bA:uint = initValue&0xFF; var tint:uint = initValue+rangeValue>>0; var a:uint = aA+ratio*((tint>>24&0xFF)-aA); var r:uint = rA+ratio*((tint>>16&0xFF)-rA); var g:uint = gA+ratio*((tint>>8&0xFF)-gA); var b:uint = bA+ratio*((tint&0xFF)-bA); var mult:Number = 1-a/0xFF; tween.target.transform.colorTransform = new ColorTransform(mult,mult,mult,ct.alphaMultiplier,r,g,b,ct.alphaOffset); } else { ct[name] = value; tween.target.transform.colorTransform = ct; } // tell GTween not to use the default assignment behaviour: return NaN; } } } -------------------------------------------------------------------------------- /PerformanceTest/com/gskinner/motion/plugins/CurrentFramePlugin.as: -------------------------------------------------------------------------------- 1 | package com.gskinner.motion.plugins { import com.gskinner.motion.GTween; import com.gskinner.motion.plugins.IGTweenPlugin; public class CurrentFramePlugin implements IGTweenPlugin { public static var enabled:Boolean=true; protected static var instance:CurrentFramePlugin; public static function install():void { if (instance) { return; } instance = new CurrentFramePlugin(); GTween.installPlugin(instance,"currentFrame"); } public function init(tween:GTween, name:String, value:Number):Number { return value; } public function tween(tween:GTween, name:String, value:Number, initValue:Number, rangeValue:Number, ratio:Number, end:Boolean):Number { if (!(tween.pluginData.CurrentFrameEnabled || enabled)) { return NaN; } var frame:uint = Math.round(initValue+rangeValue*ratio); if (tween.target.currentFrame != frame) { tween.target.gotoAndStop(frame); } return NaN; } } } -------------------------------------------------------------------------------- /PerformanceTest/com/gskinner/motion/plugins/MotionBlurPlugin.as: -------------------------------------------------------------------------------- 1 | package com.gskinner.motion.plugins { import com.gskinner.motion.GTween; import flash.filters.BlurFilter; import com.gskinner.motion.plugins.IGTweenPlugin; public class MotionBlurPlugin implements IGTweenPlugin { public static var enabled:Boolean=true; public static var strength:Number = 0.5; protected static var instance:MotionBlurPlugin; public static function install():void { if (instance) { return; } instance = new MotionBlurPlugin(); GTween.installPlugin(instance,"x"); GTween.installPlugin(instance,"y"); } public function init(tween:GTween, name:String, value:Number):Number { return value; } public function tween(tween:GTween, name:String, value:Number, initValue:Number, rangeValue:Number, ratio:Number, end:Boolean):Number { if (!(tween.pluginData.MotionBlurEnabled || enabled)) { return value; } var data:Object = tween.pluginData.MotionBlurData; if (data == null) { data = initTarget(tween); } var f:Array = tween.target.filters; var blurF:BlurFilter = f[data.index] as BlurFilter; if (blurF == null) { return value; } if (end) { f.splice(data.index,1); } else { var blur:Number = Math.abs((tween.ratioOld-ratio)*rangeValue*strength); if (name == "x") { blurF.blurX = blur; } else { blurF.blurY = blur; } } tween.target.filters = f; return value; } protected function initTarget(tween:GTween):Object { var f:Array = tween.target.filters; f.push(new BlurFilter(0,0,1)); tween.target.filters = f; return tween.pluginData.MotionBlurData = {index:f.length-1}; } } } -------------------------------------------------------------------------------- /PerformanceTest/com/gskinner/motion/plugins/SmartRotationPlugin.as: -------------------------------------------------------------------------------- 1 | package com.gskinner.motion.plugins { import com.gskinner.motion.GTween; import com.gskinner.motion.plugins.IGTweenPlugin; public class SmartRotationPlugin implements IGTweenPlugin { public static var enabled:Boolean=true; protected static var instance:SmartRotationPlugin; public static function install(properties:Array=null):void { if (instance) { return; } instance = new SmartRotationPlugin(); if (properties == null) { properties = ["rotation","rotationX","rotationY","rotationZ"]; } for each (var n:String in properties) { GTween.installPlugin(instance,n,true); } } public function init(tween:GTween, name:String, value:Number):Number { return value; } public function tween(tween:GTween, name:String, value:Number, initValue:Number, rangeValue:Number, ratio:Number, end:Boolean):Number { if (!(tween.pluginData.SmartRotationEnabled || enabled)) { return value; } rangeValue %= 360; if (rangeValue > 180) { rangeValue -= 360; } else if (rangeValue < -180) { rangeValue += 360; } return initValue+rangeValue*ratio; } } } -------------------------------------------------------------------------------- /PerformanceTest/com/gskinner/motion/plugins/SnappingPlugin.as: -------------------------------------------------------------------------------- 1 | package com.gskinner.motion.plugins { import com.gskinner.motion.GTween; import com.gskinner.motion.plugins.IGTweenPlugin; public class SnappingPlugin implements IGTweenPlugin { public static var enabled:Boolean=true; protected static var instance:SnappingPlugin; public static function install(propertiesToSnap:Array=null):void { if (instance) { return; } instance = new SnappingPlugin(); if (propertiesToSnap == null) { propertiesToSnap = ["x","y"]; } for each (var n:String in propertiesToSnap) { GTween.installPlugin(instance,n,true); } } public function init(tween:GTween, name:String, value:Number):Number { return value; } public function tween(tween:GTween, name:String, value:Number, initValue:Number, rangeValue:Number, ratio:Number, end:Boolean):Number { if (!(tween.pluginData.SnappingEnabled || enabled)) { return value; } return Math.round(value); } } } -------------------------------------------------------------------------------- /PerformanceTest/docs/cookies.js: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // ADOBE SYSTEMS INCORPORATED 4 | // Copyright 2006-2007 Adobe Systems Incorporated 5 | // All Rights Reserved. 6 | // 7 | // NOTICE: Adobe permits you to use, modify, and distribute this file 8 | // in accordance with the terms of the license agreement accompanying it. 9 | // 10 | //////////////////////////////////////////////////////////////////////////////// 11 | 12 | /** 13 | * Read the JavaScript cookies tutorial at: 14 | * http://www.netspade.com/articles/javascript/cookies.xml 15 | */ 16 | 17 | /** 18 | * Sets a Cookie with the given name and value. 19 | * 20 | * name Name of the cookie 21 | * value Value of the cookie 22 | * [expires] Expiration date of the cookie (default: end of current session) 23 | * [path] Path where the cookie is valid (default: path of calling document) 24 | * [domain] Domain where the cookie is valid 25 | * (default: domain of calling document) 26 | * [secure] Boolean value indicating if the cookie transmission requires a 27 | * secure transmission 28 | */ 29 | function setCookie(name, value, expires, path, domain, secure) 30 | { 31 | document.cookie= name + "=" + escape(value) + 32 | ((expires) ? "; expires=" + expires.toGMTString() : "") + 33 | ((path) ? "; path=" + path : "") + 34 | ((domain) ? "; domain=" + domain : "") + 35 | ((secure) ? "; secure" : ""); 36 | } 37 | 38 | /** 39 | * Gets the value of the specified cookie. 40 | * 41 | * name Name of the desired cookie. 42 | * 43 | * Returns a string containing value of specified cookie, 44 | * or null if cookie does not exist. 45 | */ 46 | function getCookie(name) 47 | { 48 | var dc = document.cookie; 49 | var prefix = name + "="; 50 | var begin = dc.indexOf("; " + prefix); 51 | if (begin == -1) 52 | { 53 | begin = dc.indexOf(prefix); 54 | if (begin != 0) return null; 55 | } 56 | else 57 | { 58 | begin += 2; 59 | } 60 | var end = document.cookie.indexOf(";", begin); 61 | if (end == -1) 62 | { 63 | end = dc.length; 64 | } 65 | return unescape(dc.substring(begin + prefix.length, end)); 66 | } 67 | 68 | /** 69 | * Deletes the specified cookie. 70 | * 71 | * name name of the cookie 72 | * [path] path of the cookie (must be same as path used to create cookie) 73 | * [domain] domain of the cookie (must be same as domain used to create cookie) 74 | */ 75 | function deleteCookie(name, path, domain) 76 | { 77 | if (getCookie(name)) 78 | { 79 | document.cookie = name + "=" + 80 | ((path) ? "; path=" + path : "") + 81 | ((domain) ? "; domain=" + domain : "") + 82 | "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /PerformanceTest/docs/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/collapsed.gif -------------------------------------------------------------------------------- /PerformanceTest/docs/images/detailHeaderRule.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/detailHeaderRule.jpg -------------------------------------------------------------------------------- /PerformanceTest/docs/images/detailSectionHeader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/detailSectionHeader.jpg -------------------------------------------------------------------------------- /PerformanceTest/docs/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/expanded.gif -------------------------------------------------------------------------------- /PerformanceTest/docs/images/inherit-arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/inherit-arrow.gif -------------------------------------------------------------------------------- /PerformanceTest/docs/images/inheritedSummary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/inheritedSummary.gif -------------------------------------------------------------------------------- /PerformanceTest/docs/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/logo.jpg -------------------------------------------------------------------------------- /PerformanceTest/docs/images/titleTableBottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/titleTableBottom.jpg -------------------------------------------------------------------------------- /PerformanceTest/docs/images/titleTableMiddle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/titleTableMiddle.jpg -------------------------------------------------------------------------------- /PerformanceTest/docs/images/titleTableTop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/PerformanceTest/docs/images/titleTableTop.jpg -------------------------------------------------------------------------------- /PerformanceTest/docs/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | //////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // ADOBE SYSTEMS INCORPORATED 5 | // Copyright 2005-2007 Adobe Systems Incorporated 6 | // All Rights Reserved. 7 | // 8 | // NOTICE: Adobe permits you to use, modify, and distribute this file 9 | // in accordance with the terms of the license agreement accompanying it. 10 | // 11 | //////////////////////////////////////////////////////////////////////////////// 12 | */ 13 | 14 | body { 15 | color: #000000; 16 | background: #ffffff; 17 | font-family: "Times New Roman", Times, serif; 18 | font-size: 12pt; 19 | } 20 | a { 21 | text-decoration: none; 22 | color: #000000; 23 | } 24 | pre { 25 | white-space: -moz-pre-wrap; /* Mozilla */ 26 | white-space: -pre-wrap; /* Opera 4-6 */ 27 | white-space: -o-pre-wrap; /* Opera 7 */ 28 | word-wrap: break-word; /* IE */ 29 | } 30 | .titleTableTopNav, .titleTableSubNav, .logoImage { 31 | display: none; 32 | } 33 | .packageFrame { 34 | display: none; 35 | } 36 | .titleTableSubTitle { 37 | font-weight: bold; 38 | } 39 | .classHeaderTableLabel { 40 | padding-right: 10px; 41 | vertical-align: top; 42 | } 43 | .showHideLinks { 44 | display: none; 45 | } 46 | html>body code { 47 | font-size: 10pt; 48 | } 49 | .summaryTableTitle, .detailSectionHeader { 50 | font-size: 14pt; 51 | font-weight: bold; 52 | padding-top: 15px; 53 | padding-bottom: 5px; 54 | } 55 | .summaryTable { 56 | border: 1px solid #000000; 57 | border-collapse: collapse; 58 | width: 100%; 59 | } 60 | .summaryTableDescription { 61 | padding-bottom: 20px; 62 | } 63 | .summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol { 64 | border: 1px solid #000000; 65 | } 66 | .summaryTablePaddingCol { 67 | border: 1px solid #000000; 68 | border-right: 0px; 69 | } 70 | .summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol { 71 | border: 1px solid #000000; 72 | border-left: 0px; 73 | } 74 | .summaryTableLastCol { 75 | vertical-align: top; 76 | } 77 | .detailHeader { 78 | font-size: 13pt; 79 | padding-top: 100px; 80 | } 81 | .detailHeaderName { 82 | font-weight: bold; 83 | } 84 | .detailHeaderType { 85 | padding-left: 5px; 86 | } 87 | .detailHeaderRule { 88 | background: #FF0000; 89 | } 90 | .seeAlso { 91 | padding-bottom: 20px; 92 | margin-top: -20px; 93 | } 94 | .innertable { 95 | border-collapse: collapse; 96 | } 97 | .innertable td,.innertable th { 98 | border: 1px solid #000000; 99 | padding-left: 5px; 100 | padding-right: 5px; 101 | } 102 | .listing { 103 | font-size: 10pt; 104 | } 105 | .feedbackLink { 106 | display: none; 107 | } 108 | .copyright { 109 | font-size: 10pt; 110 | } -------------------------------------------------------------------------------- /PerformanceTest/mx/core/Version.as: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // ADOBE SYSTEMS INCORPORATED 4 | // Copyright 2005-2007 Adobe Systems Incorporated 5 | // All Rights Reserved. 6 | // 7 | // NOTICE: Adobe permits you to use, modify, and distribute this file 8 | // in accordance with the terms of the license agreement accompanying it. 9 | // 10 | //////////////////////////////////////////////////////////////////////////////// 11 | -------------------------------------------------------------------------------- /PerformanceTest/mx/effects/easing/easing_readme.txt: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // ADOBE SYSTEMS INCORPORATED 4 | // Copyright 2003-2006 Adobe Systems Incorporated 5 | // All Rights Reserved. 6 | // 7 | // NOTICE: Adobe permits you to use, modify, and distribute this file 8 | // in accordance with the terms of the license agreement accompanying it. 9 | // 10 | //////////////////////////////////////////////////////////////////////////////// 11 | 12 | ============================================================================================ 13 | Easing Equations v2.0 14 | September 1, 2003 15 | (c) 2003 Robert Penner, all rights reserved. 16 | This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html. 17 | ============================================================================================ 18 | 19 | These tweening functions provide different flavors of 20 | math-based motion under a consistent API. 21 | 22 | Types of easing: 23 | 24 | Linear 25 | Quadratic 26 | Cubic 27 | Quartic 28 | Quintic 29 | Sinusoidal 30 | Exponential 31 | Circular 32 | Elastic 33 | Back 34 | Bounce 35 | 36 | Changes: 37 | 3.0 - ported to ActionScript 3.0; Added ASDoc comments 38 | 2.0 - ported to ActionScript 2.0; functions now in packages and use strong typing 39 | 1.5 - added bounce easing 40 | 1.4 - added elastic and back easing 41 | 1.3 - tweaked the exponential easing functions to make endpoints exact 42 | 1.2 - inline optimizations (changing t and multiplying in one step)--thanks to Tatsuo Kato for the idea 43 | 44 | Discussed in Chapter 7 of 45 | Robert Penner's Programming Macromedia Flash MX 46 | (including graphs of the easing equations) 47 | 48 | http://www.robertpenner.com/profmx 49 | http://www.amazon.com/exec/obidos/ASIN/0072223561/robertpennerc-20 50 | -------------------------------------------------------------------------------- /PerformanceTest/performancetests/ArrLength.as: -------------------------------------------------------------------------------- 1 | /** * PerformanceTest by Grant Skinner. Apr 21, 2009 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2009 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package performancetests { public class ArrLength { // Constants: // Public Properties: // optional property specifying the default number of iterations to run each test in the suite. public var iterations:uint=2; // optional property specifying a description to be used when reporting on this test suite: public var description:String = "" public var methods:Array = ["tare","push", "length", "iterator"]; public var methodLabels:Array = ["", "arr.push(i)", "arr[arr.length]=i", "arr[i]=i"]; // the number of elements in each collection: public var loops:uint = 1000000; // Protected Properties: // set up some variables used in the test: // Initialization: // Public getter / setters: // Public Methods: public function ArrLength() { } // tare method that will be run to calculate the base time required to run the loop // so it can be subtracted from the other test results. public function tare():void { var arr:Array = []; for (var i:uint=0; i = new Vector.(loops); //var arr:Array = []; for (var i:uint=0; i = new Vector.(loops); //var arr:Array = []; for (var i:uint=0; i = new Vector.(loops); //var arr:Array = []; for (var i:uint=0; i>1; } } // Protected Methods: } } -------------------------------------------------------------------------------- /PerformanceTest/performancetests/Casting.as: -------------------------------------------------------------------------------- 1 | /** * PerformanceTest by Grant Skinner. Apr 21, 2009 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2009 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package performancetests { import flash.geom.Point; public class Casting { // Constants: // Public Properties: // optional property specifying the default number of iterations to run each test in the suite. public var iterations:uint=2; // optional property specifying a description to be used when reporting on this test suite: public var description:String = "" public var methods:Array = ["tare","none", "constructorCasting", "asCasting"]; public var methodLabels:Array = ["", "o", "Point(o)", "o as Point"]; // the number of elements in each collection: public var loops:uint = 1000000; // Protected Properties: protected var points:Array; // set up some variables used in the test: // Initialization: // Public getter / setters: // Public Methods: public function Casting() { points = []; for (var i:uint=0; i = new Vector.(length); // Initialization: // Public getter / setters: // Public Methods: public function uintTest():void { for (var i:uint=0; i 2 | 3 | 4 | 5 | 6 | 7 | Redirecting... 8 | 9 | 17 | 18 | 19 | 20 | 21 | 22 | Redirecting... 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ProximityManager/docs/all-classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Classes - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | All Classes 13 |

14 | 15 | 16 | 17 | 18 |
ProximityManager
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ProximityManager/docs/appendixes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Appendixes 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 |
 AppendixDescription
39 |

40 | 42 |
43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ProximityManager/docs/com/gskinner/utils/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.gskinner.utils - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package com.gskinner.utils 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Classes
ProximityManager
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ProximityManager/docs/cookies.js: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // ADOBE SYSTEMS INCORPORATED 4 | // Copyright 2006-2007 Adobe Systems Incorporated 5 | // All Rights Reserved. 6 | // 7 | // NOTICE: Adobe permits you to use, modify, and distribute this file 8 | // in accordance with the terms of the license agreement accompanying it. 9 | // 10 | //////////////////////////////////////////////////////////////////////////////// 11 | 12 | /** 13 | * Read the JavaScript cookies tutorial at: 14 | * http://www.netspade.com/articles/javascript/cookies.xml 15 | */ 16 | 17 | /** 18 | * Sets a Cookie with the given name and value. 19 | * 20 | * name Name of the cookie 21 | * value Value of the cookie 22 | * [expires] Expiration date of the cookie (default: end of current session) 23 | * [path] Path where the cookie is valid (default: path of calling document) 24 | * [domain] Domain where the cookie is valid 25 | * (default: domain of calling document) 26 | * [secure] Boolean value indicating if the cookie transmission requires a 27 | * secure transmission 28 | */ 29 | function setCookie(name, value, expires, path, domain, secure) 30 | { 31 | document.cookie= name + "=" + escape(value) + 32 | ((expires) ? "; expires=" + expires.toGMTString() : "") + 33 | ((path) ? "; path=" + path : "") + 34 | ((domain) ? "; domain=" + domain : "") + 35 | ((secure) ? "; secure" : ""); 36 | } 37 | 38 | /** 39 | * Gets the value of the specified cookie. 40 | * 41 | * name Name of the desired cookie. 42 | * 43 | * Returns a string containing value of specified cookie, 44 | * or null if cookie does not exist. 45 | */ 46 | function getCookie(name) 47 | { 48 | var dc = document.cookie; 49 | var prefix = name + "="; 50 | var begin = dc.indexOf("; " + prefix); 51 | if (begin == -1) 52 | { 53 | begin = dc.indexOf(prefix); 54 | if (begin != 0) return null; 55 | } 56 | else 57 | { 58 | begin += 2; 59 | } 60 | var end = document.cookie.indexOf(";", begin); 61 | if (end == -1) 62 | { 63 | end = dc.length; 64 | } 65 | return unescape(dc.substring(begin + prefix.length, end)); 66 | } 67 | 68 | /** 69 | * Deletes the specified cookie. 70 | * 71 | * name name of the cookie 72 | * [path] path of the cookie (must be same as path used to create cookie) 73 | * [domain] domain of the cookie (must be same as domain used to create cookie) 74 | */ 75 | function deleteCookie(name, path, domain) 76 | { 77 | if (getCookie(name)) 78 | { 79 | document.cookie = name + "=" + 80 | ((path) ? "; path=" + path : "") + 81 | ((domain) ? "; domain=" + domain : "") + 82 | "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ProximityManager/docs/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/collapsed.gif -------------------------------------------------------------------------------- /ProximityManager/docs/images/detailHeaderRule.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/detailHeaderRule.jpg -------------------------------------------------------------------------------- /ProximityManager/docs/images/detailSectionHeader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/detailSectionHeader.jpg -------------------------------------------------------------------------------- /ProximityManager/docs/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/expanded.gif -------------------------------------------------------------------------------- /ProximityManager/docs/images/inherit-arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/inherit-arrow.gif -------------------------------------------------------------------------------- /ProximityManager/docs/images/inheritedSummary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/inheritedSummary.gif -------------------------------------------------------------------------------- /ProximityManager/docs/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/logo.jpg -------------------------------------------------------------------------------- /ProximityManager/docs/images/titleTableBottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/titleTableBottom.jpg -------------------------------------------------------------------------------- /ProximityManager/docs/images/titleTableMiddle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/titleTableMiddle.jpg -------------------------------------------------------------------------------- /ProximityManager/docs/images/titleTableTop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/docs/images/titleTableTop.jpg -------------------------------------------------------------------------------- /ProximityManager/docs/index-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

Index

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
AN
BO
CP
DQ
ER
FS
GT
HU
IV
JW
KX
LY
MZ
117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /ProximityManager/docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <body> 46 | 47 | <h2>Frame Alert</h2> 48 | 49 | <p> 50 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 51 | <br> 52 | Link to <a href="package-summary.html">Non-frame version.</a> 53 | 54 | </p> 55 | 56 | </body> 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /ProximityManager/docs/mxml-tags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | MXML Only Components - Adobe Flex 2 Language Reference 10 | 11 | 12 | 13 | 14 | 15 | 16 |

MXML Only Components

17 | 18 | <mx:Binding> 19 |
20 | 21 | <mx:Component> 22 |
23 | 24 | <mx:Metadata> 25 |
26 | 27 | <mx:Model> 28 |
29 | 30 | <mx:Script> 31 |
32 | 33 | <mx:Style> 34 |
35 | 36 | <mx:XML> 37 |
38 | 39 | <mx:XMLList> 40 |
41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ProximityManager/docs/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <body> 20 | 21 | <h2>Frame Alert</h2> 22 | 23 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 24 | <br> 25 | Link to<a href="package-summary.html">Non-frame version.</a> 26 | 27 | </p> 28 | 29 | </body> 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ProximityManager/docs/package-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Package List - API Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | Packages 14 |

15 | 16 | 17 | 18 | 19 |
com.gskinner.utils
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ProximityManager/docs/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Packages 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
 PackageDescription
 com.gskinner.utils 
42 |

43 | 45 |
46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ProximityManager/docs/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | //////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // ADOBE SYSTEMS INCORPORATED 5 | // Copyright 2005-2007 Adobe Systems Incorporated 6 | // All Rights Reserved. 7 | // 8 | // NOTICE: Adobe permits you to use, modify, and distribute this file 9 | // in accordance with the terms of the license agreement accompanying it. 10 | // 11 | //////////////////////////////////////////////////////////////////////////////// 12 | */ 13 | 14 | body { 15 | color: #000000; 16 | background: #ffffff; 17 | font-family: "Times New Roman", Times, serif; 18 | font-size: 12pt; 19 | } 20 | a { 21 | text-decoration: none; 22 | color: #000000; 23 | } 24 | pre { 25 | white-space: -moz-pre-wrap; /* Mozilla */ 26 | white-space: -pre-wrap; /* Opera 4-6 */ 27 | white-space: -o-pre-wrap; /* Opera 7 */ 28 | word-wrap: break-word; /* IE */ 29 | } 30 | .titleTableTopNav, .titleTableSubNav, .logoImage { 31 | display: none; 32 | } 33 | .packageFrame { 34 | display: none; 35 | } 36 | .titleTableSubTitle { 37 | font-weight: bold; 38 | } 39 | .classHeaderTableLabel { 40 | padding-right: 10px; 41 | vertical-align: top; 42 | } 43 | .showHideLinks { 44 | display: none; 45 | } 46 | html>body code { 47 | font-size: 10pt; 48 | } 49 | .summaryTableTitle, .detailSectionHeader { 50 | font-size: 14pt; 51 | font-weight: bold; 52 | padding-top: 15px; 53 | padding-bottom: 5px; 54 | } 55 | .summaryTable { 56 | border: 1px solid #000000; 57 | border-collapse: collapse; 58 | width: 100%; 59 | } 60 | .summaryTableDescription { 61 | padding-bottom: 20px; 62 | } 63 | .summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol { 64 | border: 1px solid #000000; 65 | } 66 | .summaryTablePaddingCol { 67 | border: 1px solid #000000; 68 | border-right: 0px; 69 | } 70 | .summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol { 71 | border: 1px solid #000000; 72 | border-left: 0px; 73 | } 74 | .summaryTableLastCol { 75 | vertical-align: top; 76 | } 77 | .detailHeader { 78 | font-size: 13pt; 79 | padding-top: 100px; 80 | } 81 | .detailHeaderName { 82 | font-weight: bold; 83 | } 84 | .detailHeaderType { 85 | padding-left: 5px; 86 | } 87 | .detailHeaderRule { 88 | background: #FF0000; 89 | } 90 | .seeAlso { 91 | padding-bottom: 20px; 92 | margin-top: -20px; 93 | } 94 | .innertable { 95 | border-collapse: collapse; 96 | } 97 | .innertable td,.innertable th { 98 | border: 1px solid #000000; 99 | padding-left: 5px; 100 | padding-right: 5px; 101 | } 102 | .listing { 103 | font-size: 10pt; 104 | } 105 | .feedbackLink { 106 | display: none; 107 | } 108 | .copyright { 109 | font-size: 10pt; 110 | } -------------------------------------------------------------------------------- /ProximityManager/src/ProximityTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/src/ProximityTest.fla -------------------------------------------------------------------------------- /ProximityManager/src/ProximityTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/ProximityManager/src/ProximityTest.swf -------------------------------------------------------------------------------- /ProximityManager/src/READ ME.txt: -------------------------------------------------------------------------------- 1 | ProximityTest.as will work as an ActionScript project without modifications. -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | A collection of AS3 libraries and sketches I have built over the years. At present, many of the folders are empty, as I am in the process of retesting and cleaning up the different items as I add them. 2 | 3 | All class files are released under MIT. Other assets are copyright their respective copyright holders. 4 | 5 | Here is a list of the libraries you will find here: 6 | 7 | ** _Sketches ** 8 | Smaller sketches that are incomplete or less significant, but still worth sharing. 9 | * CurvedLines: draws curves from a series of points 10 | * DragManager: simple drag management 11 | * FloatyPods: rectangular pods arrange themselves via repulsion 12 | * HeatMap: a simple heat map implementation 13 | * HexMap: the start of a hex map drawing / interaction model 14 | * PaintBlobs: draws splashes of paint 15 | * SimpleTagCloud: extremely simple/limited tag cloud 16 | * Swarming 17 | * VersionStringComparison: compares common version string formats 18 | 19 | ** CamTools ** 20 | A collection of tools for working with webcam input. 21 | 22 | ** Chunker ** 23 | Simple library for breaking intensive tasks up across frames to maintain UI responsiveness (simple green threads). 24 | 25 | ** CollisionDetection ** 26 | Pixel-perfect shape based collision detection. 27 | 28 | ** ColorMatrix ** 29 | Provides common color adjustment methods for use with ColorMatrixFilter. Uses the same math / values as the Flash Pro IDE's "Adjust Color" filter. 30 | 31 | ** FireFX ** 32 | Creates animated fire effects on any display object. 33 | 34 | ** FrameScriptManager ** 35 | Inject ActionScript into a movieclip timeline at a specific frame number or label. Great for separating code and design. 36 | 37 | ** Kaleidoscope ** 38 | Create a kaledoscope effect using any display object as the source. 39 | 40 | ** PerformanceSuite ** 41 | Create performance tests for actionscript and graphics, then log the results. Includes tools to integrate performance tests into unit tests for TDD. 42 | 43 | ** ProximityManager ** 44 | Grid based proximity system for tracking the distance between large numbers of similarly sized elements. 45 | 46 | ** Rndm ** 47 | Provides simple methods for working with random values, such as Rndm.float(min, max), and Rndm.sign(). Also includes a seeded random version. 48 | 49 | ** SharpenFilter ** 50 | Extends and abstracts ConvolutionFilter to provide an easy to use sharpen filter. 51 | 52 | ** TextFlow ** 53 | Enables multi-field text using TextFields for applications like multicolumn text and flowing text around an image. Multiple versions with different capabilities. 54 | 55 | ** Wander ** 56 | A feature rich class for implementing wander motion (heading + velocity), including simple flocking. -------------------------------------------------------------------------------- /Rndm/README.txt: -------------------------------------------------------------------------------- 1 | ** Rndm ** 2 | Provides simple methods for working with random values, such as Rndm.float(min, max), and Rndm.sign(). Also includes a seeded random version. 3 | 4 | There are three versions of the Rndm class included: 5 | 6 | Rnd - uses Math.random() as it's generator. Not seeded. Recommended for most uses. 7 | 8 | Rndm - seeded mathematical "random" numbers. Generally adequate for games / experiments, but not more critical uses. 9 | 10 | RndmBmpd - uses noise in a BitmapData object to generate random values. 11 | 12 | ex. 13 | if (Math.boolean(0.2)) { 14 | foo.x = Math.sign()*Math.float(20,40); 15 | } -------------------------------------------------------------------------------- /Rndm/RndmTest.as: -------------------------------------------------------------------------------- 1 | package { import com.gskinner.utils.Rndm; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; public class RndmTest extends Sprite { // Constants: // Public Properties: // Protected Properties: protected var count:uint=0; // Initialization: public function RndmTest() { Rndm.seed = 10; reset(); } // Protected Methods: protected function reset(evt:Event=null):void { Rndm.reset(); addEventListener(Event.ENTER_FRAME,tick); stage.addEventListener(MouseEvent.CLICK,reset); graphics.clear(); graphics.moveTo(Rndm.integer(550),Rndm.integer(400)); count = 0; Rndm.seed = Math.random()*0xFFFFFF; } protected function tick(evt:Event):void { graphics.lineStyle(Rndm.integer(1,5),Rndm.integer(0xFFFFFF),Rndm.float(0.2,1)); graphics.lineTo(Rndm.integer(550),Rndm.integer(400)); if (++count == 50) { removeEventListener(Event.ENTER_FRAME,tick); } } } } -------------------------------------------------------------------------------- /Rndm/RndmTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Rndm/RndmTest.fla -------------------------------------------------------------------------------- /Rndm/RndmTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Rndm/RndmTest.swf -------------------------------------------------------------------------------- /SharpenFilter/README.txt: -------------------------------------------------------------------------------- 1 | ** SharpenFilter ** 2 | Extends and abstracts ConvolutionFilter to provide an easy to use sharpen filter. 3 | 4 | ex. 5 | myBmp.filters = [new SharpenFilter(0.5)]; -------------------------------------------------------------------------------- /SharpenFilter/SharpenDemo.as: -------------------------------------------------------------------------------- 1 | package { import com.gskinner.filters.SharpenFilter; import flash.display.Sprite; import flash.display.MovieClip; public class SharpenDemo extends Sprite { // Public Properties: public var pic1:MovieClip; public var pic2:MovieClip; public var pic3:MovieClip; // Initialization: public function SharpenDemo() { var sf1:SharpenFilter = new SharpenFilter(0.2); pic1.filters = [sf1]; var sf2:SharpenFilter = new SharpenFilter(0.5); pic2.filters = [sf2]; var sf3:SharpenFilter = new SharpenFilter(1); pic3.filters = [sf3]; } } } -------------------------------------------------------------------------------- /SharpenFilter/SharpenDemo.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/SharpenFilter/SharpenDemo.fla -------------------------------------------------------------------------------- /SharpenFilter/SharpenDemo.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/SharpenFilter/SharpenDemo.swf -------------------------------------------------------------------------------- /SharpenFilter/com/gskinner/filters/SharpenFilter.as: -------------------------------------------------------------------------------- 1 | /** * SharpenFilter by Grant Skinner. Oct 4, 2005 * AS3 version Apr 15, 2011 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2011 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package com.gskinner.filters { import flash.filters.ConvolutionFilter; public class SharpenFilter extends ConvolutionFilter { // Protected Properties: protected var _amount:Number; // Initialization: /** * Constructs a new SharpenFilter instance. **/ public function SharpenFilter(amount:Number) { super(3,3,[0,0,0,0,1,0,0,0,0],1); this.amount = amount; } // Public getter / setters: /** * A number between 0 and 1 indicating the amount of sharpening to apply. **/ public function set amount(amount:Number):void { _amount = amount; var a:Number = amount/-1; var b:Number = amount/-2; var c:Number = a*-4+b*-4+1; matrix = [b,a,b, a,c,a, b,a,b]; } public function get amount():Number { return _amount; } } } -------------------------------------------------------------------------------- /TextFlow/README.txt: -------------------------------------------------------------------------------- 1 | ** TextFlow ** 2 | Enables multi-field text using TextFields for applications like multicolumn text and flowing text around an image. Multiple versions with different capabilities. 3 | 4 | TextFlowLite - basic text flow capability 5 | 6 | TextFlow - adds support for widows / orphans and overflow text. 7 | 8 | TextFlowPro - supports selection and editing with some limitations (ex. right click editing menu works improperly). 9 | 10 | ex. 11 | var tf:TextFlow = new TextFlow([textField1, textField2, textField3]); -------------------------------------------------------------------------------- /TextFlow/TextFlow/TextFlowDemo.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/TextFlow/TextFlow/TextFlowDemo.fla -------------------------------------------------------------------------------- /TextFlow/TextFlow/TextFlowDemo.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/TextFlow/TextFlow/TextFlowDemo.swf -------------------------------------------------------------------------------- /TextFlow/TextFlow/TextFlowDemo2.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/TextFlow/TextFlow/TextFlowDemo2.fla -------------------------------------------------------------------------------- /TextFlow/TextFlow/TextFlowDemo2.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/TextFlow/TextFlow/TextFlowDemo2.swf -------------------------------------------------------------------------------- /TextFlow/TextFlowLite/TextFlowLiteDemo.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/TextFlow/TextFlowLite/TextFlowLiteDemo.fla -------------------------------------------------------------------------------- /TextFlow/TextFlowLite/TextFlowLiteDemo.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/TextFlow/TextFlowLite/TextFlowLiteDemo.swf -------------------------------------------------------------------------------- /TextFlow/TextFlowLite/com/gskinner/text/TextFlowLite.as: -------------------------------------------------------------------------------- 1 | /** * TextFlowLite by Grant Skinner. Sep 9, 2007 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2007 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package com.gskinner.text { import flash.text.TextField; public class TextFlowLite { protected var flds:Array; protected var _text:String; public function TextFlowLite(textFields:Array, text:String=null) { flds = textFields; this.text = (text == null) ? flds[0].text : text; } public function get text():String { return _text; } public function set text(value:String):void { _text = value; reflow(); } public function reflow():void { flds[0].text = _text; var l:int = flds.length-1; for (var i:int=0;i 2 | 3 | 4 | 5 | 6 | 7 | Redirecting... 8 | 9 | 17 | 18 | 19 | 20 | 21 | 22 | Redirecting... 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Wander/docs/all-classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Classes - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | All Classes 13 |

14 | 15 | 16 | 17 | 18 |
Wander
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Wander/docs/appendixes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Appendixes 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 |
 AppendixDescription
39 |

40 | 42 |
43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Wander/docs/com/gskinner/motion/class-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.gskinner.motion - API Documentation 6 | 7 | 8 | 9 | 10 | 11 |

12 | Package com.gskinner.motion 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Classes
Wander
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Wander/docs/com/gskinner/motion/package-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.gskinner.motion Summary 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 |
35 | 36 |
Classes
37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 |
 ClassDescription
 Wander 43 | Wander ©2009 Grant Skinner, gskinner.com.
46 |

47 |
48 |

49 | 51 |
52 |
53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Wander/docs/cookies.js: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // ADOBE SYSTEMS INCORPORATED 4 | // Copyright 2006-2007 Adobe Systems Incorporated 5 | // All Rights Reserved. 6 | // 7 | // NOTICE: Adobe permits you to use, modify, and distribute this file 8 | // in accordance with the terms of the license agreement accompanying it. 9 | // 10 | //////////////////////////////////////////////////////////////////////////////// 11 | 12 | /** 13 | * Read the JavaScript cookies tutorial at: 14 | * http://www.netspade.com/articles/javascript/cookies.xml 15 | */ 16 | 17 | /** 18 | * Sets a Cookie with the given name and value. 19 | * 20 | * name Name of the cookie 21 | * value Value of the cookie 22 | * [expires] Expiration date of the cookie (default: end of current session) 23 | * [path] Path where the cookie is valid (default: path of calling document) 24 | * [domain] Domain where the cookie is valid 25 | * (default: domain of calling document) 26 | * [secure] Boolean value indicating if the cookie transmission requires a 27 | * secure transmission 28 | */ 29 | function setCookie(name, value, expires, path, domain, secure) 30 | { 31 | document.cookie= name + "=" + escape(value) + 32 | ((expires) ? "; expires=" + expires.toGMTString() : "") + 33 | ((path) ? "; path=" + path : "") + 34 | ((domain) ? "; domain=" + domain : "") + 35 | ((secure) ? "; secure" : ""); 36 | } 37 | 38 | /** 39 | * Gets the value of the specified cookie. 40 | * 41 | * name Name of the desired cookie. 42 | * 43 | * Returns a string containing value of specified cookie, 44 | * or null if cookie does not exist. 45 | */ 46 | function getCookie(name) 47 | { 48 | var dc = document.cookie; 49 | var prefix = name + "="; 50 | var begin = dc.indexOf("; " + prefix); 51 | if (begin == -1) 52 | { 53 | begin = dc.indexOf(prefix); 54 | if (begin != 0) return null; 55 | } 56 | else 57 | { 58 | begin += 2; 59 | } 60 | var end = document.cookie.indexOf(";", begin); 61 | if (end == -1) 62 | { 63 | end = dc.length; 64 | } 65 | return unescape(dc.substring(begin + prefix.length, end)); 66 | } 67 | 68 | /** 69 | * Deletes the specified cookie. 70 | * 71 | * name name of the cookie 72 | * [path] path of the cookie (must be same as path used to create cookie) 73 | * [domain] domain of the cookie (must be same as domain used to create cookie) 74 | */ 75 | function deleteCookie(name, path, domain) 76 | { 77 | if (getCookie(name)) 78 | { 79 | document.cookie = name + "=" + 80 | ((path) ? "; path=" + path : "") + 81 | ((domain) ? "; domain=" + domain : "") + 82 | "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Wander/docs/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/collapsed.gif -------------------------------------------------------------------------------- /Wander/docs/images/detailHeaderRule.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/detailHeaderRule.jpg -------------------------------------------------------------------------------- /Wander/docs/images/detailSectionHeader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/detailSectionHeader.jpg -------------------------------------------------------------------------------- /Wander/docs/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/expanded.gif -------------------------------------------------------------------------------- /Wander/docs/images/inherit-arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/inherit-arrow.gif -------------------------------------------------------------------------------- /Wander/docs/images/inheritedSummary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/inheritedSummary.gif -------------------------------------------------------------------------------- /Wander/docs/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/logo.jpg -------------------------------------------------------------------------------- /Wander/docs/images/titleTableBottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/titleTableBottom.jpg -------------------------------------------------------------------------------- /Wander/docs/images/titleTableMiddle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/titleTableMiddle.jpg -------------------------------------------------------------------------------- /Wander/docs/images/titleTableTop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/docs/images/titleTableTop.jpg -------------------------------------------------------------------------------- /Wander/docs/index-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

Index

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
AN
BO
CP
DQ
ER
FS
GT
HU
IV
JW
KX
LY
MZ
117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /Wander/docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <body> 46 | 47 | <h2>Frame Alert</h2> 48 | 49 | <p> 50 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 51 | <br> 52 | Link to <a href="package-summary.html">Non-frame version.</a> 53 | 54 | </p> 55 | 56 | </body> 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Wander/docs/mxml-tags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | MXML Only Components - Adobe Flex 2 Language Reference 10 | 11 | 12 | 13 | 14 | 15 | 16 |

MXML Only Components

17 | 18 | <mx:Binding> 19 |
20 | 21 | <mx:Component> 22 |
23 | 24 | <mx:Metadata> 25 |
26 | 27 | <mx:Model> 28 |
29 | 30 | <mx:Script> 31 |
32 | 33 | <mx:Style> 34 |
35 | 36 | <mx:XML> 37 |
38 | 39 | <mx:XMLList> 40 |
41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Wander/docs/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Adobe Flex 2 Language Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <body> 20 | 21 | <h2>Frame Alert</h2> 22 | 23 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 24 | <br> 25 | Link to<a href="package-summary.html">Non-frame version.</a> 26 | 27 | </p> 28 | 29 | </body> 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Wander/docs/package-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Package List - API Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | Packages 14 |

15 | 16 | 17 | 18 | 19 |
com.gskinner.motion
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Wander/docs/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Packages 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
 PackageDescription
 com.gskinner.motion 
42 |

43 | 45 |
46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Wander/docs/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | //////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // ADOBE SYSTEMS INCORPORATED 5 | // Copyright 2005-2007 Adobe Systems Incorporated 6 | // All Rights Reserved. 7 | // 8 | // NOTICE: Adobe permits you to use, modify, and distribute this file 9 | // in accordance with the terms of the license agreement accompanying it. 10 | // 11 | //////////////////////////////////////////////////////////////////////////////// 12 | */ 13 | 14 | body { 15 | color: #000000; 16 | background: #ffffff; 17 | font-family: "Times New Roman", Times, serif; 18 | font-size: 12pt; 19 | } 20 | a { 21 | text-decoration: none; 22 | color: #000000; 23 | } 24 | pre { 25 | white-space: -moz-pre-wrap; /* Mozilla */ 26 | white-space: -pre-wrap; /* Opera 4-6 */ 27 | white-space: -o-pre-wrap; /* Opera 7 */ 28 | word-wrap: break-word; /* IE */ 29 | } 30 | .titleTableTopNav, .titleTableSubNav, .logoImage { 31 | display: none; 32 | } 33 | .packageFrame { 34 | display: none; 35 | } 36 | .titleTableSubTitle { 37 | font-weight: bold; 38 | } 39 | .classHeaderTableLabel { 40 | padding-right: 10px; 41 | vertical-align: top; 42 | } 43 | .showHideLinks { 44 | display: none; 45 | } 46 | html>body code { 47 | font-size: 10pt; 48 | } 49 | .summaryTableTitle, .detailSectionHeader { 50 | font-size: 14pt; 51 | font-weight: bold; 52 | padding-top: 15px; 53 | padding-bottom: 5px; 54 | } 55 | .summaryTable { 56 | border: 1px solid #000000; 57 | border-collapse: collapse; 58 | width: 100%; 59 | } 60 | .summaryTableDescription { 61 | padding-bottom: 20px; 62 | } 63 | .summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol { 64 | border: 1px solid #000000; 65 | } 66 | .summaryTablePaddingCol { 67 | border: 1px solid #000000; 68 | border-right: 0px; 69 | } 70 | .summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol { 71 | border: 1px solid #000000; 72 | border-left: 0px; 73 | } 74 | .summaryTableLastCol { 75 | vertical-align: top; 76 | } 77 | .detailHeader { 78 | font-size: 13pt; 79 | padding-top: 100px; 80 | } 81 | .detailHeaderName { 82 | font-weight: bold; 83 | } 84 | .detailHeaderType { 85 | padding-left: 5px; 86 | } 87 | .detailHeaderRule { 88 | background: #FF0000; 89 | } 90 | .seeAlso { 91 | padding-bottom: 20px; 92 | margin-top: -20px; 93 | } 94 | .innertable { 95 | border-collapse: collapse; 96 | } 97 | .innertable td,.innertable th { 98 | border: 1px solid #000000; 99 | padding-left: 5px; 100 | padding-right: 5px; 101 | } 102 | .listing { 103 | font-size: 10pt; 104 | } 105 | .feedbackLink { 106 | display: none; 107 | } 108 | .copyright { 109 | font-size: 10pt; 110 | } -------------------------------------------------------------------------------- /Wander/src/READ ME.txt: -------------------------------------------------------------------------------- 1 | WanderTest.as and WanderFollow.as will work as ActionScript projects without modifications. -------------------------------------------------------------------------------- /Wander/src/WanderDemo.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/src/WanderDemo.swf -------------------------------------------------------------------------------- /Wander/src/WanderFollow.as: -------------------------------------------------------------------------------- 1 | package { 2 | 3 | 4 | import com.gskinner.motion.Wander; 5 | 6 | import flash.display.Sprite; 7 | import flash.events.Event; 8 | 9 | [SWF(frameRate="30", backgroundColor="#FFFFFF")] 10 | public class WanderFollow extends Sprite { 11 | 12 | protected var w:Number; 13 | protected var h:Number; 14 | 15 | public function WanderFollow() { 16 | stage.scaleMode = "noScale"; 17 | stage.align = "tl"; 18 | init(); 19 | } 20 | 21 | protected function init():void { 22 | 23 | w = stage.stageWidth; 24 | h = stage.stageHeight; 25 | 26 | var superDude:Sprite = getDude(0xFF0000); 27 | superDude.scaleX = superDude.scaleY = 2; 28 | new Wander(superDude,{speed:9,outerRadius:h,innerRadius:h*0.5,targetY:h*0.5,targetX:w*0.5,varyRotation:0.5}); 29 | 30 | var oldDude:Sprite = superDude; 31 | for (var i:uint=0; i<200; i++) { 32 | 33 | var dude:Sprite = getDude(0x000000); 34 | new Wander(dude,{speed:8+i*0.02,strength:Math.random()*0.1,outerRadius:Math.random()*400+200,innerRadius:20,varyRotation:0.05,targetObject:superDude,rotationLimit:Math.random()*5+5}); 35 | } 36 | } 37 | 38 | protected function getDude(color:uint):Sprite { 39 | var dude:Sprite = new Sprite(); 40 | dude.graphics.beginFill(color,1); 41 | dude.graphics.moveTo(-3,-1); 42 | dude.graphics.lineTo(-3,1); 43 | dude.graphics.lineTo(3,0); 44 | 45 | dude.x = -100; 46 | dude.y = -100; 47 | 48 | addChild(dude); 49 | 50 | return dude; 51 | } 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /Wander/src/WanderFollow.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/src/WanderFollow.fla -------------------------------------------------------------------------------- /Wander/src/WanderFollow.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/src/WanderFollow.swf -------------------------------------------------------------------------------- /Wander/src/WanderTest.as: -------------------------------------------------------------------------------- 1 | package { import com.gskinner.motion.Wander; import flash.display.Sprite; [SWF(frameRate="30", width="550", height="550", backgroundColor="#000000")] public class WanderTest extends Sprite { public function WanderTest() { stage.scaleMode = "noScale"; stage.align = "tl"; init(); } protected function init():void { var w:Number = stage.stageWidth; var h:Number = stage.stageHeight; var canvas:Sprite = new Sprite(); addChild(canvas); for (var i:uint=0; i<500; i++) { var dude:Sprite = new Sprite(); dude.graphics.beginFill(0xFFFFFF,1); dude.graphics.moveTo(-3,-1); dude.graphics.lineTo(-3,1); dude.graphics.lineTo(3,0); dude.rotation = (Math.random()*360/180|0)*180; dude.x = w*0.5; dude.y = h*0.5; new Wander(dude,{speed:Math.random()*3+2,strength:0.02,outerRadius:350,innerRadius:225,targetRotation:-90,targetY:h*0.5,targetX:w*0.5,varyRotation:Math.random()*0.1}); canvas.addChild(dude); } } } } -------------------------------------------------------------------------------- /Wander/src/WanderTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/src/WanderTest.fla -------------------------------------------------------------------------------- /Wander/src/WanderTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/Wander/src/WanderTest.swf -------------------------------------------------------------------------------- /_Sketches/CurvedLines/CurveTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/CurvedLines/CurveTest.fla -------------------------------------------------------------------------------- /_Sketches/CurvedLines/CurveTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/CurvedLines/CurveTest.swf -------------------------------------------------------------------------------- /_Sketches/CurvedLines/DoubleCurveTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/CurvedLines/DoubleCurveTest.fla -------------------------------------------------------------------------------- /_Sketches/CurvedLines/DoubleCurveTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/CurvedLines/DoubleCurveTest.swf -------------------------------------------------------------------------------- /_Sketches/CurvedLines/DoubleCurveTest2.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/CurvedLines/DoubleCurveTest2.fla -------------------------------------------------------------------------------- /_Sketches/CurvedLines/DoubleCurveTest2.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/CurvedLines/DoubleCurveTest2.swf -------------------------------------------------------------------------------- /_Sketches/CurvedLines/README.txt: -------------------------------------------------------------------------------- 1 | Sketch for drawing curved lines connecting a series of points. -------------------------------------------------------------------------------- /_Sketches/DragManager/Dragging.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/DragManager/Dragging.fla -------------------------------------------------------------------------------- /_Sketches/DragManager/Dragging.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/DragManager/Dragging.swf -------------------------------------------------------------------------------- /_Sketches/DragManager/README.txt: -------------------------------------------------------------------------------- 1 | ** DragManager ** 2 | Class to provide simple drag management in AS3 (not drag and drop). 3 | 4 | ex. 5 | new Drag(thing, boundsRect); -------------------------------------------------------------------------------- /_Sketches/FloatyPods/COMING_SOON.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /_Sketches/HeatMap/README.txt: -------------------------------------------------------------------------------- 1 | ** HeatMap ** 2 | Sketch of a heat map implementation. I'll try to clean this up one day. -------------------------------------------------------------------------------- /_Sketches/HeatMap/alphaHeatmapTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/HeatMap/alphaHeatmapTest.fla -------------------------------------------------------------------------------- /_Sketches/HeatMap/alphaHeatmapTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/HeatMap/alphaHeatmapTest.swf -------------------------------------------------------------------------------- /_Sketches/HeatMap/heatmapTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/HeatMap/heatmapTest.fla -------------------------------------------------------------------------------- /_Sketches/HeatMap/heatmapTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/HeatMap/heatmapTest.swf -------------------------------------------------------------------------------- /_Sketches/HexMap/HexMap.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/HexMap/HexMap.fla -------------------------------------------------------------------------------- /_Sketches/HexMap/HexMap.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/HexMap/HexMap.swf -------------------------------------------------------------------------------- /_Sketches/HexMap/HexTile.as: -------------------------------------------------------------------------------- 1 | package { public class HexTile { // Constants: // Public Properties: public var art:uint=1; // Protected Properties: // Initialization: public function HexTile(art:uint=1) { this.art = art; } // Public getter / setters: // Public Methods: // Protected Methods: } } -------------------------------------------------------------------------------- /_Sketches/HexMap/README.txt: -------------------------------------------------------------------------------- 1 | ** HexMap ** 2 | The start of a hex map drawing / interaction model. Contains a lot of hex map math, and demonstrates low cost updating of tiles. 3 | 4 | ex. 5 | var map:HexMap = new HexMap(tileData, cols, rows, tileSize); -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint.fla -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint.swf -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint2.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint2.fla -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint2.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint2.swf -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint3.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint3.fla -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint3.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint3.swf -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint4.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint4.fla -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint4.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint4.swf -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint5.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint5.fla -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/Paint5.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/PaintBlobs/Paint5.swf -------------------------------------------------------------------------------- /_Sketches/PaintBlobs/README.txt: -------------------------------------------------------------------------------- 1 | Sketch for drawing paint blobs. Uses logic from CurvedLines sketch. -------------------------------------------------------------------------------- /_Sketches/SimpleTagCloud/README.txt: -------------------------------------------------------------------------------- 1 | ** TagCloud ** 2 | Demonstrates building a simple, but fully functional tag cloud using a TextField and ~50 lines of code. 3 | 4 | I might clean this up a bit when I have some time. -------------------------------------------------------------------------------- /_Sketches/SimpleTagCloud/TagCloud.as: -------------------------------------------------------------------------------- 1 | /** * TagCloud by Grant Skinner. Jul 16, 2008 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2011 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package { import flash.display.Sprite; import flash.text.TextField; import flash.events.TextEvent; public class TagCloud extends Sprite { // Constants: // Public Properties: public var minFontSize:Number=9; public var maxFontSize:Number=36; public var minCount:Number=0; public var cloudFld:TextField; // Private Properties: protected var _data:Array; // Initialization: public function TagCloud() { cloudFld.addEventListener(TextEvent.LINK, clickTag); } // Public getter / setters: public function set data(value:Array):void { _data = value.slice(); _data.sortOn("count",Array.NUMERIC|Array.DESCENDING); buildTagCloud(); } public function get selected():Array { var arr:Array = []; for (var i:int=0; i<_data.length; i++) { if (_data[i].selected) { arr.push(_data[i]); } } return arr; } // Public Methods: // Private Methods: protected function buildTagCloud():void { if (!_data) { cloudFld.htmlText = ""; return; } var arr:Array = _data.slice(); var l:Number = arr.length; var minValue:Number = Math.max(minCount,arr[l-1].count); var maxValue:Number = arr[0].count; var range:Number = maxValue-minValue; var html:String = ""; for (var i:uint=0;i"+item.word.split(" ").join(" ")+" "; } cloudFld.htmlText = html; } protected function clickTag(evt:TextEvent):void { var keys:Array = evt.text.split(" "); var index:uint = parseInt(keys[0]); var word:String = keys[1]; for (var i:int=0; i<_data.length; i++) { if (_data[i].word == word) { _data[i].selected = !Boolean(_data[i].selected); } } buildTagCloud(); } } } -------------------------------------------------------------------------------- /_Sketches/SimpleTagCloud/TagCloudTest.as: -------------------------------------------------------------------------------- 1 | package { import flash.display.Sprite; public class TagCloudTest extends Sprite { // Constants: // Public Properties: public var cloud:TagCloud; // Protected Properties: // Initialization: public function TagCloudTest() { var data:Array = [ {word:"Entrepreneur",count:500}, {word:"Stink",count:223}, {word:"My Horse",count:114}, {word:"Five Cows",count:30}, {word:"Grant",count:620}, {word:"Wonderful",count:9}, {word:"Spow Food",count:323}, {word:"Spam",count:873}, {word:"Spork",count:119}, {word:"Sputnik",count:456}, {word:"Clouds",count:519}, {word:"Doughnuts",count:666} ]; cloud.data = data; } // Public getter / setters: // Public Methods: // Protected Methods: } } -------------------------------------------------------------------------------- /_Sketches/SimpleTagCloud/TagCloudTest.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/SimpleTagCloud/TagCloudTest.fla -------------------------------------------------------------------------------- /_Sketches/SimpleTagCloud/TagCloudTest.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/SimpleTagCloud/TagCloudTest.swf -------------------------------------------------------------------------------- /_Sketches/Swarming/README.txt: -------------------------------------------------------------------------------- 1 | ** Swarming ** 2 | A short series of experiments into simple swarming. Wasn't designed to model real swarming behaviour, just to give an interesting visual output. 3 | 4 | The code is a mess, but you're free to use and extend it. -------------------------------------------------------------------------------- /_Sketches/Swarming/Test2.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/Swarming/Test2.fla -------------------------------------------------------------------------------- /_Sketches/Swarming/Test2.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/Swarming/Test2.swf -------------------------------------------------------------------------------- /_Sketches/Swarming/Test4.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/Swarming/Test4.fla -------------------------------------------------------------------------------- /_Sketches/Swarming/Test4.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/Swarming/Test4.swf -------------------------------------------------------------------------------- /_Sketches/Swarming/Test7.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/Swarming/Test7.fla -------------------------------------------------------------------------------- /_Sketches/Swarming/Test7.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/Swarming/Test7.swf -------------------------------------------------------------------------------- /_Sketches/VersionStringComparison/README.txt: -------------------------------------------------------------------------------- 1 | ** VersionStringComparison ** 2 | A method for comparing version strings. I'll likely clean this up and move it into a class one day. 3 | 4 | ex. 5 | var result:int = checkVersion("v1.0.2.1b3","1.1 a5"); -------------------------------------------------------------------------------- /_Sketches/VersionStringComparison/VersionStringComparison.as: -------------------------------------------------------------------------------- 1 | /** * checkVersion() by Grant Skinner. Feb 20, 2008 * Visit www.gskinner.com/blog for documentation, updates and more free code. * * * Copyright (c) 2011 Grant Skinner * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. **/ package { import flash.display.Sprite; public class VersionStringComparison extends Sprite { // Initialization: public function VersionStringComparison() { trace(checkVersion("1.0","1.0")); trace(checkVersion("v1.0","1.0")); trace(checkVersion("1.0.2","1.0.1")); trace(checkVersion("1.0.12","1.0.2")); trace(checkVersion("1.0.2","1.0b1")); trace(checkVersion("1.0.2","1.0.b1")); trace(checkVersion("1.0","1.0b1")); trace(checkVersion("1.0.2.1","1.0.2")); trace(checkVersion("1.0 b2","1.0 a5")); } // Public Methods: // returns 1 if the first version number is greater than the second, -1 if it is lesser or 0 if it is equal: // works with most common versions strings: ex. 1.0.2.27 < 1.0.3.2, 1.0b3 < 1.0b5, 1.0a12 < 1.0b7, 1.0b3 < 1.0 public function checkVersion(v1:String, v2:String):int { var arr1:Array = v1.replace(/^v/i,"").match(/\d+|[^\.,\d\s]+/ig); var arr2:Array = v2.replace(/^v/i,"").match(/\d+|[^\.,\d\s]+/ig); var l:uint = Math.max(arr1.length,arr2.length); for (var i:uint=0; i v2) ? 1 : -1; } else if (isNaN(num2)) { return 1; } else if (isNaN(num1)) { return -1; } else { return (num1 > num2) ? 1 : -1; } } } } -------------------------------------------------------------------------------- /_Sketches/VersionStringComparison/VersionStringComparison.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/VersionStringComparison/VersionStringComparison.fla -------------------------------------------------------------------------------- /_Sketches/VersionStringComparison/VersionStringComparison.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gskinner/AS3Libs/7681b9c47530faa02140d056ce3ac314d60871d3/_Sketches/VersionStringComparison/VersionStringComparison.swf --------------------------------------------------------------------------------