This goes to my lack of understanding in this area, but your saying create my own container type, correct? My logic sets the x, y, width, and height, so I don't know that I need all the measure and other items found in the ContainerLayout scripting associated with the standard container.
Any good examples, tutorials on this? I'm just not up on base class and subclasses, etc. --- In [email protected], Alex Harui <aha...@...> wrote: > > Sounds like you need a base class with the layout logic, then 20+ subclasses > of that base class. You may not need to start with Canvas, mx.core.Container > might be good enough. Then you can follow the model of how Box, VBox and > HBox and their layout code is configured. > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: [email protected] [mailto:[email protected]] On > Behalf Of jmfillman > Sent: Friday, September 04, 2009 11:23 AM > To: [email protected] > Subject: [flexcoders] Coding Best Practices/Accessing Using External AS > > > > I have a series of component canvas containers that have children added and > updated based on data in an ArrayCollection. The logic for the layout of the > children in the container is identical for each canvas. > > What I am struggling with is where to put the logic for the layout. If I put > it inside the custom canvas container, I'm loading all this code each time I > add the custom canvas container to the parent application, and there could be > 20+ canvas containers added to the application. If I leave the layout logic > in the parent container, then the layout for each canvas occurs in sequential > order as I loop through all the canvas containers. I need the layout logic to > run simultaneous and independantly for each canvas. > > So the question is, how do I externalize my layout logic so each container > can use it, and not have the code internal to the component? What is the best > practice? The canvas container has to pass an Array of data to the script and > it will need to add and update children within the canvas container. > > To may way of thinking, each container shouldn't contain the same 400 lines > of layout logic code. Instead, each instance of the container should be able > to call the code, which is only loaded into the application 1 time. That > seem's like the efficient way to go, but I'm not sure how to do this or if > it's the right way to do it. > > I'm using Flex 3. >

