RE: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-14 Thread Robin Burrer
= new CustomClickBehavior(); myFoo.setClickBehavior(myCustomClickBehavior); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dnk Sent: Monday, 14 August 2006 1:47 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] |:::| can you write dynamic

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-14 Thread Tyler Wright
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dnk Sent: Monday, 14 August 2006 5:17 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] |:::| can you write dynamic meathods in a class? Ramon Miguel M. Tayag wrote: Sometimes some events pass their own args and you dont even see them

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-13 Thread Jeroen Beckers
Give us the code of the dispatching of the event ... dnk wrote: Ramon Miguel M. Tayag wrote: http://board.flashkit.com/board/showthread.php?t=662329highlight=delegate How do you call this class? I tried import com.includingatree.utils.Delegate; //use the delegate

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-13 Thread dnk
Ramon Miguel M. Tayag wrote: Sometimes some events pass their own args and you dont even see them.. Try changing your function to this: function onHit1(o:Object, n:Number) //the o object is passed by the listener { trace(it was hit with the number: + n); } That worked perfect!!!

RE: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-13 Thread Bjorn Schultheiss
, Bjorn Schultheiss Senior Flash Developer QDC Technologies -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dnk Sent: Monday, 14 August 2006 5:17 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] |:::| can you write dynamic meathods in a class

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-13 Thread dnk
Bjorn Schultheiss wrote: Hey Guys, check this out Var clickHandler:Function = MyClass.staticMethod; var args:Array = ['Can', 'pass', 'in', 'any', 'amount']; newBtn.addEventListener(click, Delegate.create(this, function(evt:Object, meth:Function, args:Array) { meth.apply(null, args) },

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-12 Thread dnk
On 8/11/06, Jeroen Beckers [EMAIL PROTECTED] wrote: Just to be complete: Yes, it is possible! Example: var myFoo = new Foo(); myFoo[test+5] = function() { trace(hello world!); } myFoo.test5(); //Foo.as dynamic class Foo { } And to your second question: Delegate returns a function.

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-12 Thread dnk
Ramon Miguel M. Tayag wrote: http://board.flashkit.com/board/showthread.php?t=662329highlight=delegate How do you call this class? I tried import com.includingatree.utils.Delegate; //use the delegate this.menuBtn.addEventListener(click, Delegate.create(this, onHit1, 1)); //create the

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-12 Thread Ramon Miguel M. Tayag
Sometimes some events pass their own args and you dont even see them.. Try changing your function to this: function onHit1(o:Object, n:Number) //the o object is passed by the listener { trace(it was hit with the number: + n); } On 8/13/06, dnk [EMAIL PROTECTED] wrote: Ramon Miguel M.

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Ramon Miguel M. Tayag
I don't think you can create dynamic functions.. even if you could, I don't see the need to. use your arguments to make your functions all-purpose. Ex. function onBtnPress(n:Number):Void { trace(n + was pressed.); } button0.onRelease = Delegate.create(this, onBtnPress, 0); button1.onRelease

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Bbt Lists
Ramon Miguel M. Tayag wrote: I don't think you can create dynamic functions.. even if you could, I don't see the need to. use your arguments to make your functions all-purpose. Ex. function onBtnPress(n:Number):Void { trace(n + was pressed.); } button0.onRelease = Delegate.create(this,

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Ramon Miguel M. Tayag
Sorry, I'm using a custom delegate class.. I completely forgot. Let me dig up that post that has what you need... On 8/12/06, Bbt Lists [EMAIL PROTECTED] wrote: Ramon Miguel M. Tayag wrote: I don't think you can create dynamic functions.. even if you could, I don't see the need to. use

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Ramon Miguel M. Tayag
http://board.flashkit.com/board/showthread.php?t=662329highlight=delegate On 8/12/06, Ramon Miguel M. Tayag [EMAIL PROTECTED] wrote: Sorry, I'm using a custom delegate class.. I completely forgot. Let me dig up that post that has what you need... -- Ramon Miguel M. Tayag

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Bbt Lists
Ramon Miguel M. Tayag wrote: Sorry, I'm using a custom delegate class.. I completely forgot. Let me dig up that post that has what you need... I was just reading a reference to a proxy class that does similar to delegate, but allows args to the functions. So I was not entirely insane (as in

Re: Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread John Mark Hawley
Subject: Re: [Flashcoders] |:::| can you write dynamic meathods in a class? Ramon Miguel M. Tayag wrote: Sorry, I'm using a custom delegate class.. I completely forgot. Let me dig up that post that has what you need... I was just reading a reference to a proxy class that does similar

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Jeroen Beckers
Just to be complete: Yes, it is possible! Example: var myFoo = new Foo(); myFoo[test+5] = function() { trace(hello world!); } myFoo.test5(); //Foo.as dynamic class Foo { } And to your second question: Delegate returns a function. Setting the onRelease to 'Delegate.create()' is

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Jim Kremens
Also, look into __resolve. The Flash docs have excellent examples. Jim Kremens On 8/11/06, Jeroen Beckers [EMAIL PROTECTED] wrote: Just to be complete: Yes, it is possible! Example: var myFoo = new Foo(); myFoo[test+5] = function() { trace(hello world!); } myFoo.test5(); //Foo.as