Panels in panels in panels (my own class) confusion

Hi

I’m trying to create a class Panel which I can use to place content in or place panels in them.
I’m a bit stuck and I don’t know how to handle the following problem:

I want to make future positioning and creation of content as easy as possible. That’s why I’m using this Panel class (concept of java). I want my main .fla to contain this:


import Panel;

var myMainPanel:Panel = new Panel();
var myInlinePanel:Panel = new Panel();

myMainPanel.addPanel(myInlinePanel);
_root.addPanel(myMainPanel);

Of course this is prototype code :stuck_out_tongue: I want to give parameters with the panel constructor but I left them out for clearing the code.

At the moment I’m stuck in my Panel class. I already figured out that I need 3 MovieClips inside an instance of Panel, it doesn’t really matter what these 3 MovieClips do for my problem.

In the code above you see that I’m not drawing anything on the stage yet (when the constructors are called). I only know how to make MovieClips and fill them instantly.

So, my question: how do I create MovieClips without drawing them on the stage yet?

My current code for the Panel class:


class Panel extends MovieClip{
    private var myPanel:MovieClip;
    private var myPanelContent:MovieClip;
    private var myPanelViewport:MovieClip;
    private var myPanelMask:MovieClip
    
    public function Panel(){
        myPanelContent = myPanel.createEmptyMovieClip("panelContent_mc", myPanel.getNextHighestDepth());
        myPanelViewport = myPanel.createEmptyMovieClip("panelViewport_mc", myPanel.getNextHighestDepth());
        myPanelMask = myPanel.createEmptyMovieClip("panelMask_mc", myPanel.getNextHighestDepth());
    };
};

Thanks in advance
Arcko Drazen