AS3 CASALib Useful Library of Common Functions and Tools for Flash
When you do lots of any language you build up libraries over time that are time savers that are repetitive and tedious if you do not consoildate into a library. Taking a look at the CASALib, an as3 library of common functions for flash that was released I have many of the same things in my libraries but CASALib just has lots of extras that go a bit deeper than some libraries, is very clean and is organized pretty well.
One cool thing about it is the IDestroyable interface and the CasaMovieClip, CasaSprite, CasaTextField , etcthat all have a destroy() method that cleans up all events, removed instances and even removes it from the parent display object. Gets me thinking why this isn’t just part of DisplayObject in the first place.
From the release:
Here are a few of our favorite things in CASA Lib AS3:
- Standardized external load API
- Easily remove listeners with IRemovableEventDispatcher
destroymethods make garbage collection easy- Large group of utility classes for common manipulations
We will be elaborating further the power of CASA Lib in future blog posts.
As with any new release there will be bugs that emerge, but with your help we promise to release updates often to keep CASA Lib as stable as possible.
1.0.0 Downloads & Documentation
ZIP: http://as3.casalib.org/releases/1.0.0/1.0.0.zip
SVN: http://svn.as3.casalib.org/releases/1.0.0/
Documentation: http://as3.casalib.org/releases/1.0.0/docs/[source]
- AlignUtil
- Provides utility functions aligning DisplayObjects.
- ArguementTypeError
- ArrayContentsError
- ArrayUtil
- Utilities for sorting, searching and manipulating Arrays.
- AudioLoad
- Provides an easy and standardized way to load audio files.
- BaseLoadItem
- Base class used by load classes.
- CasaBitmap
- A base Bitmap that implements IRemovableEventDispatcher and IDestroyable.
- casalib
- Creates an easy way to determine what version/release of CASA is being used.
- CasaMovieClip
- A base MovieClip that implements IRemovableEventDispatcher and IDestroyable.
- CasaSprite
- A base Sprite that implements IRemovableEventDispatcher and IDestroyable.
- CasaTextField
- A base TextField that implements IRemovableEventDispatcher and IDestroyable.
- ColorUtil
- Provides utility functions for dealing with color.
- ConversionUtil
- Utilities for converting units.
- DataLoad
- Provides an easy and standardized way to load data.
- DateUtil
- Provides utility functions for formatting and manipulating
Dateobjects.
- Provides utility functions for formatting and manipulating
- Destroyable
- Base class for objects that are destroyable.
- Distribution
- Creates the mechanism to distribute DisplayObjects to a vertical or horzontal grid of columns and rows.
- DrawUtil
- Utilities for drawing shapes.
- Ellipse
- Stores position and size of an ellipse (circle or oval).
- EnterFrame
- Creates a centralized
enterFrameevent.
- Creates a centralized
- FlashVarUtil
- Utility for providing easy access to HTML embeded FlashVars.
- FrameDelay
- Creates a callback after one or more frames.
- FrameTime
- Creates a common time which isn’t affected by delays caused by code execution; the time is only updated every frame.
- FrameTimeStopwatch
- FrameUtil
- Utilities for determining label positions and adding and removing frame scripts.
- GeomUtil
- Utilities for positioning, calculating and manipulating geometeric shapes.
- GraphicLoad
- Provides an easy and standardized way to load images or SWF files.
- GroupLoad
- Allows multiple loads to be grouped and treated as one larger load.
- IDestroyable public interface
- IList public interface
- Interface for list collections.
- Inactivity
- Detects user inactivity by checking for a void in mouse movement and key presses.
- InactivityEvent
- An event dispatched from Inactivity.
- Interval
- To be used instead of
flash.utils.setIntervalandflash.utils.setTimeoutfunctions.
- To be used instead of
- IRemovableEventDispatcher public interface
- IResumable public interface
- IRunnable public interface
- Key
- Key class that simplifies listening to global key strokes and adds additional keyboard events.
- KeyCombo
- Class for storing keyboard key code combinations.
- KeyComboEvent
- List
- An ordered or sequence collection that can contain duplicates.
- ListenerManager
- Creates an easy way to implement IRemovableEventDispatcher when you cannot extend directly from RemovableEventDispatcher.
- LoadEvent
- An event dispatched during loading.
- LoadItem
- Base class used by load classes.
- LoadUtil
- Utilities for calculating a load’s speed and progress.
- LocationUtil
- Utilities for determining the location of the SWF and the type of runtime environment.
- NumberUtil
- Provides utility functions for manipulating numbers.
- ObjectUtil
- Utilities for working with Objects.
- Percent
- Creates a standardized way of describing and storing percentages.
- Point3d
- Stores location of a point in a three-dimensional coordinate system, where x represents the horizontal axis, y represents the vertical axis, z represents the axis that is vertically perpendicular to the x/y axis or depth.
- Process
- Base process class.
- ProcessEvent
- An event dispatched during a Process.
- ProcessGroup
- Manages and threads processes.
- PropertySetter
- Creates a setter function for properties.
- PropertyTween
- A simple property tween class that extends Tween.
- QueryStringUtil
- Utility for providing easy access to the browser query string.
- Range
- Creates a standardized way of describing and storing an extent of variation/a value range.
- RatioUtil
- Provides utility functions for ratio scaling.
- RemovableEventDispatcher
- Extends
EventDispatcherto allow for simple and quick removal of event listeners.
- Extends
- RetryEvent
- An event dispatched when a load request is retried after previously failing.
- ReversibleMovieClip
- Provides additional timeline controlling functions: reverse and gotoAndReverse.
- Sequence
- Creates a sequence of methods calls that wait for a specified event and/or delay.
- SequenceEvent
- An event dispatched from Sequence.
- StageReference
- Stores a reference to Stage for classes that cannot easily access it.
- Stopwatch
- Simple stopwatch class that records elapsed time in milliseconds.
- StringUtil
- Utilities for manipulating and searching Strings.
- TextFieldUtil
- Utilities for working with TextFields.
- Tween
- Simple and easily extendable tween/transition class.
- TweenEvent
- An event dispatched from Tween.
- UniqueList
- An ordered or sequence collection that contains no duplicates.
- ValidationUtil
- Utilities for validating common string formats.
- VideoInfoEvent
- An event dispatched when meta data, or cue point is received from the VideoLoad.
- VideoLoad
- Provides an easy and standardized way to load video files.
- VideoLoadEvent
- An event dispatched from VideoLoad.
Tags: ACTIONSCRIPT, ACTIONSCRIPT3, AS3, casalib, library, TOOLS, utility







