1 Reply Latest reply: Jun 10, 2011 7:37 AM by JcFx.Eu RSS

    Adding content to a Loaded movie.

    JcFx.Eu Community Member

      I've got an application which loads anexternal swf, then needs to add content to a specific depth in it. It does this by finding a named placeholder clip and replacing it with a UIComponent, using addChildAt(); This seems to work fine - I have a trace utility that walks back up the display list and it shows my UIComponent right where I expect it, then the parent movie clip, then all the containers up to the stage. At each level the container is a) visible b) 1.0 alpha and c) the size I expect it to be, and from my trace I can see that I have a structure which looks something like this:

       

      [root - an mx.application]

      -- [canvas]

      ---- [Loaded SWF - moved from its Loader and attached to the canvas]

      -------[UIComponent - added at the right depth in the Loaded SWF]

       

      All well and good, but if I draw a rectangle on the graphics of the UIComponent (or add an image to it, or do anything else), nothing is visible. I can trace any parameters of the UIComponent, I can use it to make changes to its parent SWF, I can even note that if I draw a rectangle on the UIComponent which is larger than the Loaded SWF, then the SWF changes size to accommodate the new bounds - but I can't see a thing.

       

      Any idea what this might be? I was wondering if some security stopped the parent application adding content to the Loaded SWF, or if there was some other issue.

       

      Many thanks in advance for any assistance.

       

      JcFx

        • 1. Re: Adding content to a Loaded movie.
          JcFx.Eu Community Member

          Hmm. I think I've answered my own question. It seems you can't add an mx.core.UIComponent to the display list of a non-Flex AS3 movie. There's no error, and some functionality seems to work fine, but nothing displays. If I change the UIComponent to a Sprite, everything works fine. Odd.