Compiling with variable components

I’m using the same document class for two different flash deliverables.
We’ll call my document class Template.

I have a 300x250 deliverable and a 300x600 deliverable. The 300x600 has a component that’s been created in designer called myPanel., the 300x250 doesn’t have it. The 300x600 displays some extra data in the panel. What it displays doesn’t matter.

I also determine the sizes of the deliverables in the code so that I can do different things based on size, like positioning and sizing.


if (docSize == "250") {
 ... do small size stuff ...
} else {
 ... do big size stuff ...
 also: do stuff with myPanel
}

This compiles fine on the large sized deliverable, but dies on the small one.

I tried instantiating a dummy panel in the small size, so the code would see it existed, but then when compiling and running the large size, the panel was treated as null.

Is there anything I can do programmatically to rectify this?

In the mean time, I’ll just comment out what I don’t need, but I’d rather that not be the case.