      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public function apply(parent:UIComponent):void
-    {
-        var obj:* = relativeTo = getOverrideContext(relativeTo, parent);
-
+    override public function apply(parent:UIComponent):void
+    {
+        var obj:* = getOverrideContext(relativeTo, parent);
+
+        parentContext = parent;
         added = false;
-
+        
         // Early exit if child is null or not a valid container.
         if (!target || !(obj is DisplayObjectContainer))
+        {
+            if (relativeTo != null && !applied)
+            {
+                // Our destination context is unavailable so we attempt to register
+                // a listener on our parent document to detect when/if it becomes
+                // valid.
+                addContextListener(relativeTo);
+            }
+            applied = true;
             return;
-
+        }
+
+        applied = true;
+        relativeTo = obj;
+        
         // Can't reparent. Must remove before adding.
         if (target.parent)
         {

            }
        }

        added = false;
    }
}


     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */
    override public function initialize():void
    {
        if (creationPolicy == ContainerCreationPolicy.AUTO)
            createInstance();
