# How to access MC's creating in a custom class?

**URL:** <https://forum.kirupa.com/t/how-to-access-mcs-creating-in-a-custom-class/310940>\
**Category:** flash\
**Created:** [June 23, 2010, 4:26pm UTC](https://forum.kirupa.com/t/how-to-access-mcs-creating-in-a-custom-class/310940 "2010-06-23T16:26:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cablestein](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cablestein](https://forum.kirupa.com/u/Cablestein)\
**Post date:** [June 23, 2010, 4:26pm UTC](https://forum.kirupa.com/t/how-to-access-mcs-creating-in-a-custom-class/310940/1 "2010-06-23T16:26:21Z")

</div>

I have a custom class which creates a new MC using a library MC. The library MC contains a dynamic textfield called productName.

The custom class object gets created fine and is displaying on the stage. It’s also holding custom properties I set as well.

How do I control the dynamic textfield inside the MC, which is inside the custom class object?

My Product.as:

```auto

package {
    
    import flash.display.MovieClip;

    public class Product extends MovieClip {
    
        public var prodName:String;
        public var prodCategory:String;
        public var prodQuality:String;
        
        public function Product():void {
            var productMC:MovieClip = new cellMC();
            addChild(productMC);
        }
    }
}

```

My .FLA first frame:

```auto
var myProd1:Product = new Product();
myProd1.prodCategory = "Heaters";
myProd1.x = 150;
myProd1.y = 140;
addChild(myProd1);

// THE FOLLOWING DOES NOT WORK
myProd1.productMC.productName.text = "ABC 123";

```

I figure something like this would work, but with lots of variations, still nothing works:  
myProd1.productMC.productName.text = “ABC 123”;

I get errors telling me it can’t find productMC.
