Manually Declared Stage instances

With your handy dandy object-oriented skills, you know that it's always wise to separate the implementation from its structure, allowing for flexibility. Having disabled automatic stage instance declarations, you have to declare the reference yourself; otherwise, when you compile your code, a ReferenceError occurs:

        ReferenceError: Error #1056: Cannot create property inner_mc on TestClip.         at flash.display::Sprite/constructChildren()         at flash.display::Sprite()         at flash.display::MovieClip()         at TestClip()         at DocumentClass()

To add a variable representing the nested clip, open the TestClip class and add private var inner_mc. But you find that again, at compile time, ...

Get AdvancED ActionScript 3.0: Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.