4 Replies Latest reply on May 20, 2008 4:52 PM by Gregory Lafrance

    Flex XML

    [DNA]
      I am trying this a long time now.
      I want to make variable settings for a fileupload.
      Via a XML file i want to define the label texts for the buttons.

      But how can i do this?
      I have searched and tried a long time. All the tutorials i have read are about arraylists and load xml in a datagrid etc.
      But how can i do it just simpel and read out 1 line of XML and set this to a label?

      my sample xml:
      <settings>
      <button1>Button1</button1>
      </settings>
        • 1. Re: Flex XML
          Gregory Lafrance Level 6
          Perhaps a more complete, but still very simple example of how you are trying to actually access and apply the data would make this easier to resolve.
          • 2. Re: Flex XML
            ddgasdgr
            In actionscript use the URLRequest() and URLLoader() classes to load data from an external file and then parse the xml within actionscript. Sorry I haven't got time to write a more complex example of how to accomplish this.
            • 3. Flex XML
              [DNA] Level 1
              After a long time, i have now a working code.

              however. The XML url via flashvars isnt working.
              Even if i set the flashvars before the httpservice is sent.

              MXML:
              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="initApp();dataFinder.send();">

              <mx:Script source="FlexFileUpload_cb.as"/>
              <mx:HTTPService
              id="dataFinder"
              url="{xmlFile}"
              resultFormat="e4x"
              />


              AS:
              [Bindable]
              public var xmlFile:String = Application.application.parameters.xmlFile;
              public function initApp():void{
              datafinder.Send()
              }
              • 4. Re: Flex XML
                Gregory Lafrance Level 6
                Have you used trace() to verify the flashvar url is coming in okay?