Skip navigation
M.G.S.
Currently Being Moderated

XML reading problem

Dec 29, 2012 1:05 PM

Tags: #xml #read

Hi;

 

I have a basic XML file.

 

<?xml version="1.0"  encoding="UTF-8"?>

<ams>

          <settings>

                    <servicesname>telephony</servicesname>

                    <rtmpurl>rtmp://192.168.92.31/telephony</rtmpurl>

                    <codec>nm22k</codec>

          </settings>

</ams>

 

I want to assign 3 variables XML to flax.

 

How can i read this XML variables with flex ??

 
Replies
  • Currently Being Moderated
    Jan 1, 2013 2:56 AM   in reply to M.G.S.

    Hi MGS,

     

    var xml:XML =

    <ams>

              <settings>

                        <servicesname>telephony</servicesname>

                        <rtmpurl>rtmp://192.168.92.31/telephony</rtmpurl>

                        <codec>nm22k</codec>

              </settings>

    </ams>;

     

    You can read the above XML using the following code:

     

    var sname:String = xml..servicesname; //holds the value "telephony"

    var rurl:String = xml..rtmpurl; //holds the value "rtmp://192.168.92.31/telephony"

    var cod:String = xml..codec; //holds the value "nm22k"

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points