Dynamic Flash

Confessions of a serial code abuser
  • rss
  • Home
  • MTASC
  • Archives
  • About me
  • Goodies
    • Base64 encoder/decoder class
  • My Bookshelf
  • My Talks

Delegate version 1.0.1

Monday, 02 May 2005

I’ve updated my Delegate class to version 1.0.1 to add compatibility for MTASC. There are no functional changes, so if you’re not using MTASC there’s no need to download the updated class file.

See Delegate class refined for more information about the Delegate class.

–Update–

The Delegate class is licensed under the MIT licence. This is about as liberal a license as I could find which allows you to do pretty much anything with this code. I wouldn’t have bothered at all except some people were wondering whether they could use the code in commercial projects. The answer under the MIT license is a definitive yes.

Categories
General
Comments rss
Comments rss
Trackback
Trackback

« MTASC 1.05 OS X MTASC 1.06 Linux »

4 responses

Just trying it our with F.A.M.E. Works like a

adampasz | Saturday, 14 May 2005 | 1:45 pm

Just trying it our with F.A.M.E. Works like a charm. Thanks!

[...] The initBroadcaster() method is from my Object Prototypes and

MAB Blog » Blog Archive » Determining When A MC Is Initialized | Thursday, 21 July 2005 | 12:57 pm

[...] The initBroadcaster() method is from my Object Prototypes and simple initialized the object that the method is applied on as a EventDispatcher. If you dont know anything about EventDispatcher or listeners, I suggest you learn about them; they are one of the most helpful things in AS, this tutorial should give you what you need to know about EventDispatcher if you haven’t used it already. So after initializing the box MC as a EventDispatcher I added a function listener to the “inited” event that will be broadcasted by the box once it is fully initialized. The function is executed in the scope of the box, because of this the ‘this’ variable equals the box MC, thus this.play() will cause the box MC to start playing. If you didn’t want that function to exact in the boxes scope you can use the Delegate class to execute a function is different scope (Flash 7.2 also comes with a Delegate class but Steve’s Delegate class that I linked to is better). If you want to learn more about Delegates and how to use them read this tutorial. You can get both the updated animation initialization and the textfield initialization files here. [...]

class Delegate extends Object { static function create(obj:Object,

Maurits van der Schee | Wednesday, 22 February 2006 | 12:59 pm

class Delegate extends Object
{
static function create(obj:Object, func:Function):Function
{
return function () { return(func.apply(obj, arguments)); };
}
}

Maurits: Umm... that's a very simple version of the Delegate

Steve | Wednesday, 22 February 2006 | 1:06 pm

Maurits: Umm… that’s a very simple version of the Delegate class, though you’ve needlessly extended Object on a class that has only static methods.

However, it doesn’t serve the same purpose as my delegate class, which is designed to allow you to pass extra arguments to the delegated function and also pass a reference to the delegate itself to make it easy, for example, to remove delegated event handlers.

Please see Delegate class refined for more information.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

About Dynamic Flash

Steve Webster is a Senior Web Developer for Yahoo! in London, UK.

He is more than a little concerned that he defines himself in terms of his career, and that he talks about himself in the third person.

Find out more

Recent Posts

  • Read and write local files with Flash Player 10
  • The problem with SproutCore
  • Yahoo! London seeks Junior Developers
  • I am Singularity
  • Yahoo! Astra component library 1.1 released

Tags

Accessibility ActionScript actionscript3 actionscript 3.0 air apple astro book conference designer filereference file upload Flash flex framework internet internet explorer JavaScript jobs junior microsoft opportunities ria singularity08 skin tutorial urlrequest web developer web development Web Standards Yahoo!

del.icio.us-ed

Stuff

Singularity?
Flex.org - The Directory for Flex
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox