RE: [flexcoders] Could the Flex Gurus shed some light on this behavior?
Actually, looking at it like that, it makes total sense. I didn't realize by setting the Source property of another control, I was stealing away a Child from another Control. Thanks for clearing that up for me :) Mike From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Gold Sent: Wednesday, April 23, 2008 10:14 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Could the Flex Gurus shed some light on this behavior? I believe since the content is a DisplayObject, it's just falling under normal Flex parenting rules, a child can only have a single parent, so using the same content actually re-parents the content object to the new SWFLoader. If your navigation window is just a small preview of the total app, like it sounds like, you could actually create a new Bitmap from the content of your main SWFLoader and use that as a new UIComponent in your navigation window. Not sure if you'd run into effeciency problems with how often you'd have to re-copy the data, but sounds like it could work in your situation. On Wed, Apr 23, 2008 at 12:06 PM, Mike Anderson [EMAIL PROTECTED] wrote: Hello All, For the longest time, I've been wondering why 2 Loader Controls, are unable to share the same content. Then again this may be by design, and my lack of knowledge relating to Flex could be why I don't understand this. For example, I have a SWFLoader Control which comprises the majority of my Application's desktop. It displays a loaded Map, in which users can drag icons onto the desktop, pan, zoom, as well as many other functions. I have a small navigator window that stays on top in a static position, in which the same content displayed in the SWFLoader, also gets displayed in the Navigator Control. The Navigator Control just gives the user an indication of the Map portion being displayed in the main window. In order to avoid having to load the SWF File TWICE, I thought I could set the content property of the Navigator Control, to the SWFLoader.contentLoaderInfo.content property - but when I do this, the loaded SWF disappears from the main screen, and appears in the small Navigator Window. Is this literally how things work in Flex? 2 data aware components can share the same ArrayCollection for their dataProvider Property, but 2 graphical display components, cannot share the same content? I would be grateful to hear the experts explanation on how this type of thing works within Flex. Thanks in advance for all your incredible help, Mike
RE: [flexcoders] Could the Flex Gurus shed some light on this behavior?
Mike, From a performance point of view - you wouldn't want to be loading external assets twice. It's good that you see this: load what you need. need what you load. load it once. use it many times. What will help is to think more about where that data ends up. accessing the raw data is always nice - but in Flex you have all the visual data you need right in front of your eyes (BitmapData). Once you've loaded your map use BitmapData (with matrix) to push maga-map pixels to your mini-map. This will give you ultimate control of sizing, key-holing, panning, etc. Rick Winscot From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson Sent: Wednesday, April 23, 2008 1:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Could the Flex Gurus shed some light on this behavior? Hello All, For the longest time, I've been wondering why 2 Loader Controls, are unable to share the same content. Then again this may be by design, and my lack of knowledge relating to Flex could be why I don't understand this. For example, I have a SWFLoader Control which comprises the majority of my Application's desktop. It displays a loaded Map, in which users can drag icons onto the desktop, pan, zoom, as well as many other functions. I have a small navigator window that stays on top in a static position, in which the same content displayed in the SWFLoader, also gets displayed in the Navigator Control. The Navigator Control just gives the user an indication of the Map portion being displayed in the main window. In order to avoid having to load the SWF File TWICE, I thought I could set the content property of the Navigator Control, to the SWFLoader.contentLoaderInfo.content property - but when I do this, the loaded SWF disappears from the main screen, and appears in the small Navigator Window. Is this literally how things work in Flex? 2 data aware components can share the same ArrayCollection for their dataProvider Property, but 2 graphical display components, cannot share the same content? I would be grateful to hear the experts explanation on how this type of thing works within Flex. Thanks in advance for all your incredible help, Mike image001.jpgimage002.jpg
Re: [flexcoders] Could the Flex Gurus shed some light on this behavior?
I believe since the content is a DisplayObject, it's just falling under normal Flex parenting rules, a child can only have a single parent, so using the same content actually re-parents the content object to the new SWFLoader. If your navigation window is just a small preview of the total app, like it sounds like, you could actually create a new Bitmap from the content of your main SWFLoader and use that as a new UIComponent in your navigation window. Not sure if you'd run into effeciency problems with how often you'd have to re-copy the data, but sounds like it could work in your situation. On Wed, Apr 23, 2008 at 12:06 PM, Mike Anderson [EMAIL PROTECTED] wrote: Hello All, For the longest time, I've been wondering why 2 Loader Controls, are unable to share the same content. Then again this may be by design, and my lack of knowledge relating to Flex could be why I don't understand this. For example, I have a SWFLoader Control which comprises the majority of my Application's desktop. It displays a loaded Map, in which users can drag icons onto the desktop, pan, zoom, as well as many other functions. I have a small navigator window that stays on top in a static position, in which the same content displayed in the SWFLoader, also gets displayed in the Navigator Control. The Navigator Control just gives the user an indication of the Map portion being displayed in the main window. In order to avoid having to load the SWF File TWICE, I thought I could set the content property of the Navigator Control, to the SWFLoader.contentLoaderInfo.content property - but when I do this, the loaded SWF disappears from the main screen, and appears in the small Navigator Window. Is this literally how things work in Flex? 2 data aware components can share the same ArrayCollection for their dataProvider Property, but 2 graphical display components, cannot share the same content? I would be grateful to hear the experts explanation on how this type of thing works within Flex. Thanks in advance for all your incredible help, Mike