blog.marchaemmerle.com

Static initializers in AS3

with 2 comments

From time to time - expecially after asking google - you stumble upon gems like this one. If you ever wanted to generate lookup-tables for static methods without the need to check if they’re already full of tasty values then static initializers in AS3 are for you:

package
{
	// static initializer
	{
		fillLookupTable();
	}

	internal function fillLookupTable():void
	{
		// do some math, array pushing etc. here :]
	}
}

Via barneyb

Written by Marc

February 18th, 2008 at 12:03 pm

Posted in Flash, Flex

2 Responses to 'Static initializers in AS3'

Subscribe to comments with RSS or TrackBack to 'Static initializers in AS3'.

  1. ufutopipejar

    21 Aug 09 at 11:25 am

  2. enyciva

    24 Sep 09 at 11:31 am

Leave a Reply