How CASA for AS2 is similar to AS3 · Apr 28, 04:30 PM

I’m finally migrating to AS3 and so far it’s been a breeze after working with the CASA Framework for AS2. AS3 seems to implore you to program in an Object Oriented (OO) manner. While AS2 already supports the use of classes, I never really used them much until CASA encouraged me to use classes along with OO programming techniques. (By no means does CASA force the programmer to go OO. In this sense, it’s actually more of a utility library than a framework compared to some of the other frameworks out there.) I discovered how much easier programming with Flash could be when I started subclassing CASA classes. I felt my OO Flash programming experience helped me jump into AS3.

So I’ll try to list some important features that made the drastic changes in AS3 seem not so drastic:

Instantiation of new movie clips

AS2
attachMovie(‘myMC’, ‘MyMovieclipSymbol’, getNextHighestDepth() );

CASA
MyMovieclipClass.create( this, ‘myMC’ );

AS3
var myMC = new MyMovieclipClass();
addChild(myMc);

Adding Event Listeners

AS2
myMC.onMouseMove = function() { … }

CASA
event_mc.addEventObserver(this, EventMovieClip.EVENT_MOUSE_MOVE, “myMouseMoveHandler”);

AS3
sprite.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);

CASA framework for AS2 seems to be geared towards making the language into what it could have been (better). It should come as no surprise that AS3 is based on the concepts of this framework and to some extent eliminates the need for the framework. It should be interesting to see what CASA for AS3 looks like (if it ever gets released).

Links for Migrating to AS3

Tips for migrating your Flash applications to ActionScript 3.0

Migrating from AS2 to AS3

Using XML (E4X) in AS3

Great Reference List of Changes in AS2 and the AS3 equivalents

A List of Notes and Procedures from a Migrated Flash Application

— Pickle

---

Comment

Textile Help