Wonderfl – An Actionscript goldmine


February 10, 2009

I’ve spent the last couple of weeks reading Colin Moock’s latest 900 page epic – Essential ActionScript 3.0 so it was great to stumble upon Wonderfl. The concept behind the site of sharing and developing code online is genius.

Compared with 99% of tutorial sites (this included) the Wonderfl approach is the way forward and it’s certainly an idea that can be applied to many community based web applications.

Truly Wonderfl.

A Simple Actionscript Class Definition


July 30, 2008

I know I’m a little late to the party on this one but I finally cracked Flash Classes last weekend – yay!

To be honest there wasn’t really a whole lot to crack, just the definitions of private and public functions.

Essentially a public function will execute when the class is initialised, and a private function will wait to be called, and that’s all there is to it .

Try this out:

In a text editor create a file and name it TestClass.as

Type the following:

class TestClass{

	public function foo(){
		trace(“Hello from Foo”);
	}

	private function baa(){
		trace(“Hello from Baa”);
	}

}

Now create a new Flash document and save it in the same folder as TestClass.as

On frame one (or any other) type:

var myTestClass = new TestClass();

now publish your movie and you should get the output “Hello from Foo”

If you now add the following line:

myTestClass.baa();

publish your movie and you should get the output “Hello from Foo”, “Hello from Baa”

Yes, it really is that easy!