I’ve been involved in AS2 for years, so I am still a little puzzled with advanced OOP in AS3 with FlashCS3
Let me tell you what’s the situation:
I uesd FlashCS3, put MCA and MCB on my stage. MCA and MCB are both set base class to “flash.display.Sprite” in the linkage from Library.
I put an instance of SUBMCX in MCA
I put an instance of SUBMCX and an instance of SUBMCY in MCB
Then, I want the MCB to inherit from MCA, since MCA has already got a SUBMCX and I only need to take care of the SUBMCY in MCB.
I wrote the codes as follows:
public class MCA extends Sprite
{…}
// This one is okay
public class MCB extends MCA
{…}
// This got an error as follows:
1152: A conflict exists with inherited definition MCA.SUBMCX in namespace public.
I am really confused. Any suggestions on such situation?
Another Question:
If I only got MCA, I needn’t say “private/public var SUBMCX” to make my code work. So is it the FlashCS3 automatically find the instance on a custome Sprite/MovieClip’s stage? If yes, why I need to specify a name to some Sprite to make it work in my code? Take this question for example, I have to wrote:
public class MCA extends Sprite
{…}
to access the MCA.SUBMCX
I did even never declare a SUBMCX in the class file.
I need for some expanations in details, thanks very much in advance!