Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Haxe port of "CASA Lib for ActionScript", a great collection of helpful classes that streamline your coding.

branch: master

Ported from…

Casalib (SVN Revision 421)

Download and Install

The most easy and proper way is from haxelib:

haxelib install casalib

Or you can download/checkout the source from github repo .


Please refer to CASA Lib for AS3 documentation . Info specific to this Haxe port is expained below.


For targets other than Flash, some of the casahx classes needs nme.

To compile test.hxml, remember to modify the path to your local test server first.

Cross-target Inconsistancy

All the codes in the repo is maintained to be already tested and is consistant on ALL Haxe targets, except:


Due to inconsistence of Std.parseFloat() between targets, some weired expression may fail on some platform. But normal integer/float is ok and consistant(Please check the test cases in test.TestUtil.testNumberUtil()).


Is not avalible on PHP. Assume JS is running in the web. Assume C++/Neko is not in the web.

AlignUtil, FlashVarUtil, FrameUtil, LibraryManager, UrlVariablesUtil , AudioLoad, VideoLoad, Distribution

Only available on Flash target.

All classes that related to DisplayObject and other visual stuff

Not available on PHP target.

Different from the original casalib


Added for internal use to make casahx usable in non-Flash targets.


  • added indexOf(): Same as AS3’s Array.
  • added lastIndexOf(): Same as AS3’s Array.
  • added filter(): Same as AS3’s Array.
  • added sortOn(): Same as AS3’s Array.
    • Options are:
      • ArrayUtil.SORT_DESCENDING
      • ArrayUtil.SORT_UNIQUESORT
      • ArrayUtil.SORT_NUMERIC
    • For fieldNames, it must be an Array. Even if you use only single field, you need to put it into an Array.
    • When using SORT_RETURNINDEXEDARRAY and two elements are the same, instead of return 0, it returns [];
  • added sortOnLite() and indicesOfSorted():
    • Same as sortOn() but one is ingoring ArrayUtil.SORT_RETURNINDEXEDARRAY and one is always ArrayUtil.SORT_RETURNINDEXEDARRAY.
    • Good thing is their returns are typed as inputArray and Array<Int>.
    • Performance should be better than sortOn().


Added getTimezoneOffset() : Same as AS3’s Date. If date is not supplied, it use 1970-1-1, which gives best performance.


It does not have getManager method in non-Flash targets because of lack of Dictionary. Instead, its constuctor is now public (in all targets).


Seems that it is a bug of NME, it cannot detect the mouse move event in JS target.


Due to a limitation of Haxe, gotoAndPlay() / gotoAndStop() is not overridded. You need to call play() / stop() to stop reversing before calling gotoAndPlay() / gotoAndStop().


Added stripTags() : Same as php strip_tags, ported from phpjs .

Something went wrong with that request. Please try again.