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
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
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
, 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: [
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!!!
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
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
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
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
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
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
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()'
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
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
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
__
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
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
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
Hi there
Can you write dynamic methods in a class?
for example
for (var i:Number = 0; i < 11; i++)
{
function onBtnPress + i()
{
trace("Button number: " + i + "was pressed");
}
}
So then that would essentially create 10 methods (onBtnPress0 to
onBtnPress9) to be used by va
19 matches
Mail list logo