RE: [Flashcoders] Delegate scope - superclass issue?

2005-11-29 Thread Nikolaj Selvik
Yes, turns out an older version of the superclass was compiled into a different 
loaded swf. Sorry bout that.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas
Sent: den 28 november 2005 18:07
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Delegate scope - superclass issue?

I've never had that problem.

Try removing the "this" from "this.myFunction". Shouldn't make any
difference - but I don't use it, and, as I said, I don't have the problem.
:-)

HTH,
  Ian

On 11/28/05, Nikolaj Selvik <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Thanks for welcoming me to your list!
>
> I´ve run into a problem using MM's delegate class, couldn't find any info
> on this particular issue so here goes:
>
> Example:
>
> "mySubClass" inherits from "mySuperClass"
>
> In "mySubClass" I have:
>
> myObject.addEventListener("click",Delegate.create(this, this.myFunction));
>
> works fine if "myFunction" is defined in "mySubclass", just as it should,
> but not if Its defined in "mySuperClass". Why?
>
>
> Best Regards,
>
> Nick
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Delegate scope - superclass issue?

2005-11-28 Thread Nick Griffiths
are you expecting it to call mySuperClass.myFunction, or 
mySubClass.myFunction?


As far as I know, if you have overridden myFunction in the subclass, 
that will be called, rather than the super class's definition.  I 
usually get around this with naming conventions, i.e. prefixing my 
private functions with the initials of the class.  It's ugly, but safer, 
especially when you do a lot of inheritance.


Nikolaj Selvik wrote:


Hi,

Thanks for welcoming me to your list!

I´ve run into a problem using MM's delegate class, couldn't find any info on 
this particular issue so here goes:

Example:

"mySubClass" inherits from "mySuperClass"

In "mySubClass" I have:

myObject.addEventListener("click",Delegate.create(this, this.myFunction));

works fine if "myFunction" is defined in "mySubclass", just as it should, but not if Its 
defined in "mySuperClass". Why?


Best Regards,

Nick
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Delegate scope - superclass issue?

2005-11-28 Thread Ian Thomas
I've never had that problem.

Try removing the "this" from "this.myFunction". Shouldn't make any
difference - but I don't use it, and, as I said, I don't have the problem.
:-)

HTH,
  Ian

On 11/28/05, Nikolaj Selvik <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Thanks for welcoming me to your list!
>
> I´ve run into a problem using MM's delegate class, couldn't find any info
> on this particular issue so here goes:
>
> Example:
>
> "mySubClass" inherits from "mySuperClass"
>
> In "mySubClass" I have:
>
> myObject.addEventListener("click",Delegate.create(this, this.myFunction));
>
> works fine if "myFunction" is defined in "mySubclass", just as it should,
> but not if Its defined in "mySuperClass". Why?
>
>
> Best Regards,
>
> Nick
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Delegate scope - superclass issue?

2005-11-28 Thread Nikolaj Selvik
Hi,

Thanks for welcoming me to your list!

I´ve run into a problem using MM's delegate class, couldn't find any info on 
this particular issue so here goes:

Example:

"mySubClass" inherits from "mySuperClass"

In "mySubClass" I have:

myObject.addEventListener("click",Delegate.create(this, this.myFunction));

works fine if "myFunction" is defined in "mySubclass", just as it should, but 
not if Its defined in "mySuperClass". Why?


Best Regards,

Nick
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders