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:
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:
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.