The help docs recommend the following code to instantiate all controls for every panel in the accordion container when the application starts:

<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml">
    <mx:Accordion id="myAccordion" creationPolicy="all">
    ...
    </mx:Accordion>
    ...
</mx:Application>

In this sample: http://www.iepl.net/cairngorm2viewStates.html, there is an accordion container (Application View State 1 at 800X600) with the following code: 

<?xml version="1.0" encoding="utf-8"?>
<mx:Accordion xmlns:mx="
http://www.adobe.com/2006/mxml"
     width="100%" height="100%" creationPolicy="all"
     xmlns:content="code.view.content.*">
     <content:Content1 label="Content 1"/>
     <content:Content2 label="Content 2"/>
     <content:Content3 label="Content 3"/>
     <content:Content4 label="Content 4"/>
</mx:Accordion>

The content components are just colored VBox's:

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"
      horizontalAlign="center" verticalAlign="middle" 
      width="100%" height="100%" creationPolicy="all"
     
styleName="content2">
      <mx:Text text="Content 2" width="100%" styleName="contentText"/> 
</mx:VBox>

The first time that the accordion panels are selected, you can physically see that the components are being created.  After that, there isn't a delay or flicker.  Is this the way that is supposed to be used to make sure that the children are created before they are displayed?

Thanks,
Tim Hoff



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to