      *  Therefore we decided to dispense with strict typing for
      *  'application'.
      */
+    [Deprecated(replacement="FlexGlobals.topLevelApplication", since="4.0")]
+    
     public static function get application():Object
     {
-        return ApplicationGlobals.application;
+        return FlexGlobals.topLevelApplication as Application;
     }
 
     //--------------------------------------------------------------------------

            Singleton.getInstance("mx.managers::ILayoutManager"));
        UIComponentGlobals.layoutManager.usePhasedInstantiation = true;

        if (!ApplicationGlobals.application)
            ApplicationGlobals.application = this;

        super();


    override public function get id():String
    {
        if (!super.id &&
            this == FlexGlobals.topLevelApplication && 
            ExternalInterface.available)
        {
            return ExternalInterface.objectID;
