# AS3 OOP in FlashCS3, need an explanation

**URL:** https://forum.kirupa.com/t/as3-oop-in-flashcs3-need-an-explanation/267593
**Category:** flash
**Created:** [August 3, 2008, 4:24pm UTC](https://forum.kirupa.com/t/as3-oop-in-flashcs3-need-an-explanation/267593 "2008-08-03T16:24:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zhangxiaorui](https://avatars.discourse-cdn.com/v4/letter/z/e495f1/32.png) [@zhangxiaorui](https://forum.kirupa.com/u/zhangxiaorui)
#### Post date: [August 3, 2008, 4:24pm UTC](https://forum.kirupa.com/t/as3-oop-in-flashcs3-need-an-explanation/267593/1 "2008-08-03T16:24:08Z")

</div>

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!
