Export all classes to simple codeless graphical shells.
Export tree movie clip to Tree_design. Do not make it have any base class besides MovieClip. Or Sprite.
Separate all code from graphics.
You need a more careful way of using Flash as a simple level editor for tree placement, if you do not want to mix code with game graphics. Otherwise you won't be able to compile your project without recompiling the art part of it every time.
I recommend using containers for just carrying data.
Let's say you have 3 different kinds of trees placed inside a some exported level symbol. The trees are just there, no instance names, nothing fancy set to them, no base classes. Then in FD you have code to read this data, using:
for(i=0;i<numChildren;i++){
var tree:DisplayObject=getChildAt(i);
if(tree is Tree1_design)new Tree(Tree1_design,tree);
if(tree is Tree2_design)new Tree(Tree2_design,tree);
if(tree is Tree3_design)new Tree(Tree3_design,tree);
}
A more compact and maintainable code of the same thing would be:
var allowedTreeTypes:Array=[Tree1_design,Tree2_design,Tree3_design];
for(i=0;i<numChildren;i++){
var tree:DisplayObject=getChildAt(i);
for(j=0;j<allowedTreeTypes.length;j++){
if(tree is allowedTreeTypes[j])
new Tree(allowedTreeTypes[i],tree);
}
}
But I'm not sure if it will even compile because of "is" operator.
Then you have the Tree class something like this:
package{
public class Tree extends Sprite{
public function Tree(type:Class, position:DisplayObject){
x=position.x; y=position.y;
addChild(new type());
}
}
}
But MSGHero probably knows a better way to do this, and has more knowledge working with SWCs/FD than me.