Not a very good description I think :-( A custom component uses XML
data to build itself. With xml embedded within the AS component
everything flies:

var layoutXML:XML =
   <layouts>
      <layout name='View1' description='Single View'>
         <item id='1'>
            <orientation>v</orientation>
            <panes>1</panes>
         </item>
      </layout> etc

Moving the xml to an external document causes a situation where I
cannot get the xml in before the component needs it! Earliest I think
is preInitialize, right? Still not there in time. Not sure there is a
way to pause the AS component construct? Since this actually is static
data - 17 different view configs - shall I just leave it embedded?
Curious to know if there is a way to do the external thing?

private function loadXML():void{
   var XML_URL:String = "../xml/layouts.xml";
   var myXMLURL:URLRequest = new URLRequest(XML_URL);
   myLoader = new URLLoader(myXMLURL);
   myLoader.addEventListener("complete", xmlLoaded);
}

private function xmlLoaded(event:Event):void{
   layoutXML = XML(myLoader.data);
   trace("Data loaded.");
}

As always much TIA,

Mic.

Reply via email to