Hi All,

I'm currently developing a Flex application that loads a Flash SWF for
use as a background image. In other words, the app's main window has
as its first child a SWFLoader component into which I've loaded a SWF
developed in Flash. So far, so good.

Now, rather than open up dialogs or create direct child windows of the
main window, I want to host Flex content within the Flash SWF itself.
I installed the Flex Component Kit in my Flash CS3 environment and
proceeded to created a MovieClip symbol that contains a
FlexContentHolder. From Flex, I can access the symbol and set Flex
content on that symbol but the Flex content never appears. An example
of how I've attempted to do this is as follows:

   // get a reference to the Flex Content MovieClip
   var swf:MovieClip = _swfLoader.content as MovieClip;
   var fc:Object = swf["flexContainer"];
                                    
   // create some Flex content to display
   var button:Button = new Button();
   button.width = 200;
   button.height = 100;
   button.label = "Click me!";
            
   // create a top-level container for the Flex content
   var uiComponent:UIComponent = new UIComponent();
   uiComponent.width = fc.width;
   uiComponent.height = fc.height;
   uiComponent.alpha = 1.0;
   uiComponent.addChild(button);
   uiComponent.visible = true;
            
   fc.content = uiComponent;

Am I doing something wrong here? Conceptually, am I on the right
track? In other words, should what I'm trying to do be possible? I'd
appreciate any help or insight anyone might be able to offer.

Reply via email to