Hello :)

you can show your mx package in Flash installation : C:\Program
Files\Macromedia\Flash 8\en\First Run\Classes

In this directory you find mx.utils.Delegate class !

Now in flash you can use this class :

[code]

import mx.utils.Delegate ;

var o = {} ;
o.toString = function () {
   return "myCustomScope" ;
}

var action:Function = function () {
   trace(" > " + this + " : action") ;
}

// test1 - scope is the _root
action() ;

// test2 - scope is "o" your custom scope.
var myAction:Function = Delegate.create(o, action) ;
myAction() ;

// test3 - scope is a MovieClip with "mc" this instance's name

mc.onRelease = action ; // if you release your mc, use action with mc scope
(classic)

mc.onPress = Delegate.create(o, action) ; // if you press your mc, use
custom scope

[/code]

EKA+ :)

2006/6/14, Stephen Ford <[EMAIL PROTECTED]>:

Hello All,

Can anyone confirm that the Delegate class is only helpful when using
components ?

Or should it also be used for events outside the component framework ?

No doubt it depends on what your trying to achieve, but just generally
speaking, what do you think.

Thanks,
Stephen.

_______________________________________________
[email protected]
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

_______________________________________________
[email protected]
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