Skip to content
This repository

HTTPS clone URL

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
README.textile

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 .

Documentation

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

Note

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:

NumberUtil.isNumber()

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()).

LocationUtil

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

org.casalib.core.UInt

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

ArrayUtil

  • 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_CASEINSENSITIVE
      • ArrayUtil.SORT_DESCENDING
      • ArrayUtil.SORT_UNIQUESORT
      • ArrayUtil.SORT_RETURNINDEXEDARRAY
      • 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().

DateUtil

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

ListenerManager

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

Inactivity

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

ReversibleMovieClip

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

StringUtil

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

Something went wrong with that request. Please try again.