Hello :)

You can use my Delegate implementation too in VEGAS Framework :

-
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/events/Delegate.as(
vegas.events.Delegate class)
- http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/vegas/events/(example
with Delegate and Event Model EventDispatcher, etc..)
- http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/events/ (package
vegas.events)

More information about VEGAS : http://osflash.org/vegas

EKA+ :)

2006/6/15, Ian Thomas <[EMAIL PROTECTED]>:

On 6/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> Alot of people complain that you can't pass parameters with delegate.
Well
> you can, a multiple of ways, and if you structure your code with some
> forethought, you can have it pass params if you are delegating a
function
> structured do so.

Alternatively you could use (or write, as I did) a slightly more
advanced version of Delegate which takes function passing into
account.

A couple of popular variants are:

http://www.dynamicflash.co.uk/2005/02/delegate-class-refined/

and

http://www.person13.com/articles/proxy/Proxy.htm

They let you write things like:

myButton1.onRelease=Delegate.create(this,onSomeButtonPressed,"green");
myButton2.onRelease=Delegate.create(this,onSomeButtonPressed,"red");

:

function onSomeButtonPressed(colour:String)
{
   trace("The "+red+" button was pressed!");
}

and also to pass additional parameters to existing callback function.

HTH,
  Ian
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to