Tag Archives: source code

Webcam motion detection in AS3

I converted the old webcam motion detection thing to AS3 today. Not that it improves the performance much, just wanted to play around with it (source).


 

XML within a class

I was recently asked about the problem of loading XML from within a class to trigger an arbitrary method. The problem was: the onLoad event triggers on the XML instance, not the class creating it. This could probably be worked around with the Delegate class, but in the past I’ve simply extended the XML class itself, overriding the onLoad handler and adding a callback object that’s passed in (along with some error checking). It’s partnered with an XMLLoader class, the source and simple demo of which you can download here.