November 15th, 2005

Learn something new every day

That's what I love about Flash and the Flash community. Not a day goes by that I don't learn something new that somehow I missed.

I had a few minutes today and was just poking through George Medve's TweenExtended Class [LINK] in SEPY and noticed "OnEnterFrameBeacon.init();". Hmm.. I hadn't seen that before.. So curious as I am, I researched it and came up with blog article written by Darron Schall back in Jan. 2004 [LINK]. Wow! How did I miss that? Or maybe I saw it and at the time didn't have time to absorb it.

Anyhow.. the jist is that you can attach onEnterFrame's to objects without having to hassle with creating your own movieclips and managing them. Pretty cool.

Actionscript:

  1. import mx.transitions.OnEnterFrameBeacon;
  2.  
  3. OnEnterFrameBeacon.init();
  4.  
  5. var myObject:Object = new Object();
  6. myObject.onEnterFrame = function() {
  7.     trace("nice!");
  8. }
  9. MovieClip.addListener(myObject);

That's the 2nd Kudo's to Darron this week. DateFormatter Class

3 Responses to “Learn something new every day”

  • When is it triggered then?

  • My bad. I left out a very important line of code in my haste to post.

    MovieClip.addListener(myObject);

    Original code above has been updated.

  • hey, just curious if you use that TweenExtended class with mtasc. I have issues with getting it to compile from SEPY, it cant seem to find the class no matter what.