[flexcoders] Re: Populating a Flex Container in Flash

2009-01-20 Thread specdout
Hi Tracey,

Thanks for your response.

 So you have a browser hosting the Flash Player, running a Flex app 
that contains a SWFLoader that loads a Flash SWF.
Sorry, I should have been more specific: I'm developing an AIR
application. The SWFLoader is used to hold Flash content that's used
as an animated background for the app's main window. In some cases I
do use TitleWindows as dialogs for collecting and displaying
information and in other cases I use Canvas-based components as direct
children of the main window. With respect to the problem I'm
describing here, I'm trying to display Flex content so that it appears
to be completely integrated with the Flash background.

 
 Is the Flex framework available from within the Flash SWF?
No. I do hook and receive events from the Flash SWF as well as control
various animations but that's all done from Flex.

  Also,
 UIComponent is not a container and will not do any automatic sizing or
 layout of the content.  You will have to do that yourself.  That means
 implementing the lifecycle, layout and measurement functionality.  Say
 again why you want to do this?  I'm not saying it is bad, just trying to
 be sure you have a god reason.
One of the issues I've experienced in trying to get this to work is
runtime errors that claim the Flex content I'm trying to set on the
ContainerMovieClip (in Flash) isn't a UIComponent (or doesn't
implement IUIComponent).  As I understand it, the ContainerMovieClip
is supposed to be able to hold a single Flex child, which can then
hold additional children.  Ultimately I wouldn't use a UIComponent - I
was just trying to make sure that the ContainerMovieClip instance in
Flash didn't have a valid claim that I wasn't passing in a UIComponent ;)

 
 
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of specdout
 Sent: Monday, January 19, 2009 12:05 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Populating a Flex Container in Flash
 
  
 
 Does anyone else have any thoughts on this problem?
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , specdout raturne@ wrote:
 
  Thanks for your reply, Paul.
  
  --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com , Paul Andrews paul@ wrote:
  
   Does anything get added to the display list?
  When the example code executes I do see the FlexContentHolder symbol
  (Fx) on the display where I would expect it to be, i.e. positioned
  where I would expect, with the dimensions I would expect, so I think
  it's already on the DisplayList. As well, I can make it invisible if
  I want, so it does appear to be available and active - it's just the
  Flex content that doesn't show.
  
   
   - Original Message - 
   From: specdout raturne@
   To: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
   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
 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
 https://share.acrobat.com/adc

[flexcoders] Re: Populating a Flex Container in Flash

2009-01-19 Thread specdout
Does anyone else have any thoughts on this problem?

--- In flexcoders@yahoogroups.com, specdout ratu...@... wrote:

 Thanks for your reply, Paul.
 
 --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote:
 
  Does anything get added to the display list?
 When the example code executes I do see the FlexContentHolder symbol
 (Fx) on the display where I would expect it to be, i.e. positioned
 where I would expect, with the dimensions I would expect, so I think
 it's already on the DisplayList.  As well, I can make it invisible if
 I want, so it does appear to be available and active - it's just the
 Flex content that doesn't show.
 
  
  - Original Message - 
  From: specdout raturne@
  To: flexcoders@yahoogroups.com
  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
  
  
  
 





[flexcoders] Populating a Flex Container in Flash

2009-01-15 Thread specdout
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] Re: Populating a Flex Container in Flash

2009-01-15 Thread specdout
Thanks for your reply, Paul.

--- In flexcoders@yahoogroups.com, Paul Andrews p...@... wrote:

 Does anything get added to the display list?
When the example code executes I do see the FlexContentHolder symbol
(Fx) on the display where I would expect it to be, i.e. positioned
where I would expect, with the dimensions I would expect, so I think
it's already on the DisplayList.  As well, I can make it invisible if
I want, so it does appear to be available and active - it's just the
Flex content that doesn't show.

 
 - Original Message - 
 From: specdout ratu...@...
 To: flexcoders@yahoogroups.com
 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