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

2006-08-14 Thread Tyler Wright
rray) { meth.apply(null, args) }, clickHandler, args ) ); Regards, 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: R

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

2006-08-13 Thread Robin Burrer
ckBehavior = 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 wri

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) }, clickHa

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

2006-08-13 Thread Bjorn Schultheiss
, args:Array) { meth.apply(null, args) }, clickHandler, args ) ); Regards, 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: [

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 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=662329&highlight=delegate >> >> > How do you call this class? > > I tried > > > import com.includingatree.utils.Delegate; > //use the delegate > th

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

2006-08-13 Thread Jeroen Beckers
Why yes, that is possible too: dynamic class Foo { function Foo() { this["test"+5] = function() { trace("Hello World"); } } } //fla file var myFoo = new Foo(); myFoo.test5(); But I really wouldn't do it like that... I would rather store a ref

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. T

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=662329&highlight=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 th

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 functio

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

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()'

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

2006-08-11 Thread John Mark Hawley
ect: 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

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: [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=662329&highlight=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 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. > > us

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, on

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.onReleas