         // Check for selected or not selected
         if (currentState != null)
         {
-            if (currentState == "up")
-                currentStateIconClass = upIconClass;
-            else if (currentState == "down")
+            var currentStateIconClass:Class = upIconClass;
+            if (currentState == "down")
                 currentStateIconClass = downIconClass;
             else if (currentState == "upAndSelected")
                 currentStateIconClass = upSelectedIconClass;

                currentStateIconClass = downSelectedIconClass;
            else if (currentState.indexOf("AndSelected") != -1)
                currentStateIconClass = upSelectedIconClass;
            else
                currentStateIconClass = upIconClass;
                        
            if (!(iconInstance is currentStateIconClass))
            {
                changeFXGSkin = true;
                invalidateProperties();
                invalidateSize();
                invalidateDisplayList();
            }
        }
    }
    
    /**
     *  @private 
     */
    override protected function commitProperties():void
    {
        super.commitProperties();
        
        if (changeFXGSkin)
        {
            changeFXGSkin = false;
            
            if (currentStateIconClass)
            {
                // Remove iconDisplay
                if (iconInstance != null)
                    removeChild(iconInstance);
                
                iconInstance = new currentStateIconClass();  
                
                addChild(iconInstance);
            }
        }
    }
    
    /**
     *  @private 
     */

        graphics.drawRect(0,0,unscaledWidth, unscaledHeight);
        graphics.endFill();
    }
}
}