RE: [Flashcoders] Problem extending inherited function

2007-03-22 Thread Danny Kodicek
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Winterhalder Sent: 21 March 2007 23:41 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Problem extending inherited function Importance: High snip big explanation Mark

[Flashcoders] Problem extending inherited function

2007-03-21 Thread Johan Nyberg
Hi, I have a problem extending an inherited function. I put all the files described here in a zip if you want to test it yourselves: http://www.webguidepartner.com/~johan/super-problem.zip I have this mother-class: class Mother extends MovieClip { public var txt:TextField; public

Re: [Flashcoders] Problem extending inherited function

2007-03-21 Thread Mark Winterhalder
I have some clue that the problem must have something to do with that it is the text field that triggers the event, and not the movie clip. But you would expect the super.killingFocus(); to work anyway, regardless of what calls the function?! Yes, this is a scope issue -- it tries to call

Re: [Flashcoders] Problem extending inherited function

2007-03-21 Thread R�kos Attila
This is a simple scope issue. The problem is caused exactly by that what you talked about. When assigning killingFocus to the textfield's event, use some kind of delegation (e.g. mx.util.Delegate): txt.onKillFocus = mx.utils.Delegate.create(this, killingFocus); (off: actually, this is not

RE: [Flashcoders] Problem extending inherited function

2007-03-21 Thread Rost, Andrew
PROTECTED] Sent: Wednesday, March 21, 2007 3:10 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Problem extending inherited function Hi, I have a problem extending an inherited function. I put all the files described here in a zip if you want to test it yourselves: http

RE: [Flashcoders] Problem extending inherited function

2007-03-21 Thread Danny Kodicek
The way you had your code, the Child class will never receive the killingFocus call. Add a Delegate within the Mother Class to put the onKillFocus event into scope with Child... import mx.utils.Delegate; class Mother extends MovieClip { public var txt:TextField; public

Re: [Flashcoders] Problem extending inherited function

2007-03-21 Thread Mark Winterhalder
On 3/21/07, Danny Kodicek [EMAIL PROTECTED] wrote: Hmm - this seems to go against the stuff we've been talking about recently (see 'super and this' thread) where people have been saying that inherited classes are essentially wrapped into one. This is an example where the ancestor is being