Bob,

Understand package isn't too difficult, but can be confusing until the moment you click and everything becomes clear. You're version is making a simple process a little more complicated than it needs to be.

First, let me show an example of a modified package.

PHP Code:
package classes
{
    
import flash.display.*;
    
import flash.utils.getDefinitionByName;
    
    public class 
SmileySwitch
    
{
        public function 
SmileySwitch(passedVar:String)
        {
            
/*
            *The variable passedVar was sent when this object (class) was instantiated
            *In this case we will say 'smiley1' is the content of the variable
            
            *Unless this is a class package, we are going to assume that it is an object is in the library
            */
            
            
var TempObjRef:Class = getDefinitionByName(passedVar) as Class;
            var 
tempObj:Object = new TempObjRef();
            
            
/*
             * I can return just the new class object and have it placed on the stage by the caller using
             * addChild
             */
            
             
return tempObj;
            
             
/*or I can make it easy on myself and just have it added now.  If you add it now, then it
             * will be associated with this class, and they gives you better control.
             */
            
             
this.addChild(tempObj);
        }
    }

First, you'll notice there are some differences between out code. The basic building blocks of a class package are all the same. You need the package, the class bounds and at least the class function. Of course, you can many functions with a class, but it is best to limit it to the function specific for this class.

In your class, you are using getters to retrieve information from a class without a class function. Notice that the class function, class bound and the file name match exactly. It is a requirement.

My version will accept a parameters, in this case a string, that represents anything you want, I guess mine is an object on the stage. Using getDefByName, I convert that object into a Class and then I can either, return the new class object to the caller or I immediately place it on the stage (class level). No need for any getters or setters, which I only use to protect variables within my class.