= 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
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
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
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!!!
,
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
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) },
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.
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
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.
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
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,
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
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
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
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
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
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
17 matches
Mail list logo