Archive for the ‘AS2’ Category

Dispatching events between AS3 and AS2

Saturday, May 9th, 2009

Even though AS3 has been out for some time now, there are still situations when you will need to load an AS2 compiled SWF into an AS3 compiled SWF and communicate with it. What if you could simply dispatch an event and listen for it on the other side? That’s what sugarcookie’s ASBridge does. Let’s see how it all works.
(more…)

OnEnterFrameBeacon rocks, Yo!

Monday, September 29th, 2008

For those of you still working with AS2, here’s a sweet little nugget of code. You can do some really cool things with this and helps to break your MovieClip dependence.

import mx.transitions.OnEnterFrameBeacon;
 
class NonMovieClipEnterFrameHavingClass {
	public function NonMovieClipEnterFrameHavingClass() {
		OnEnterFrameBeacon.init();
		MovieClip.addListener(this);
	}
 
	public function onEnterFrame():Void {
		trace('OnEnterFrameBeacon, Yo!');
	}
}