Posts

Visual Reflections in ActionScript 3

I migrated the actionscript 2 version of my reflection class some time ago, but hadn’t gotten to posting it yet. I managed to whip up some examples of this new as 3 version. It’s not as feature rich as the as 2 version due to some changes between as 2 and as 3, but just as easy to use.

Some features:

  • simple setup, just do addChild (new Reflection (myContent)); and you are done
  • respects masks, scaling, etc and automatically adjusts to the correct position
  • allows you to grab (live) bitmap data of the reflection for those times you only need a bitmap
  • can be updated manually or automatically
  • simple samples included

Download the sources and examples here: As3 Reflection (736 downloads)

NOTE: the examples are FlashDevelop projects. The security is set to network, so they won’t run locally unless you compile and run them once through flashdevelop (FlashDevelop will update your security settings while running).

Injection Swf Class hook

Also known as:

  • keeping your sources out of the injection swf
  • decoupling your main class from your injection swf

If you are developing your actionscript 2 apps in FlashDevelop, in a lot of cases this means you are using an injection swf.

This injection swf contains all your assets. There are two options to start your program once it’s loaded:

  • tell MTASC to execute your main class once all classes are initialized
  • call your main class method from the swf once everything is loaded

Note that these two points might not be the same. I use a simple fla template which Read more