Does anything get added to the display list? If nothing else I think you'll need addChild(fc), or something similar.
----- Original Message ----- From: "specdout" <[email protected]> To: <[email protected]> Sent: Thursday, January 15, 2009 5:42 PM Subject: [flexcoders] Populating a Flex Container in Flash > 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. > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > >

