Re: [flexcoders] override not overriding????

2008-02-17 Thread Sherif Abdou
try overriding the getter too


- Original Message 
From: dbronk <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Sunday, February 17, 2008 9:59:56 AM
Subject: [flexcoders] override not overriding

I have a class hierarchy of classes as follows:

MyBaseTextInput extends TextInput
{
override public function set text(value:String) :void
{
// my base code here
}
}

MySpecialTextInput extends MyBaseTextInput
{
override public function set text(value:String) :void
{
// my special code here
}
}

Okay, in MySpecialTextInput I am overriding the set text function and
NOT calling super.text = value; So, why when I have
MySpecialTextInput on an mxml view does the set text in
MyBaseTextInput get called? This is causing me to copy/paste the code
from MyBaseInputText into MySpecialTextInput, modifying as needed, and
then have MySpecialTextInput extend TextInput instead of
MyBaseTextInput. I REALLY HATE COPY/PASTE PROGRAMMING!

Can someone please shed some light on why the super class function is
being called even when I'm not calling super?

Thanks,
Dale





  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

[flexcoders] override not overriding????

2008-02-17 Thread dbronk
I have a class hierarchy of classes as follows:

MyBaseTextInput extends TextInput
{
override public function set text(value:String):void
{
// my base code here
}
}

MySpecialTextInput extends MyBaseTextInput
{
override public function set text(value:String):void
{
// my special code here
}
}

Okay, in MySpecialTextInput I am overriding the set text function and
NOT calling super.text = value;  So, why when I have
MySpecialTextInput on an mxml view does the set text in
MyBaseTextInput get called?  This is causing me to copy/paste the code
from MyBaseInputText into MySpecialTextInput, modifying as needed, and
then have MySpecialTextInput extend TextInput instead of
MyBaseTextInput.  I REALLY HATE COPY/PASTE PROGRAMMING!

Can someone please shed some light on why the super class function is
being called even when I'm not calling super?

Thanks,
Dale