reference display object of subclass from parent class without error 1152

Pretty standard here. Say you’ve a class which you wish to extend a parent class – but you want that parent class to be able to access all the display objects within the child class.

You might get a 1152 error – naming conflict between the two.

A way around this is to make that name a private variable of the parent class, then define it like so:

private var contentField:TextField; // define it as private

contentField = TextField(this.getChildByName("contentField")); //get it like so
Tech Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑