1 Reply Latest reply on May 4, 2006 12:39 PM by TimSymons

    radio button label

    veiky
      Hi,

      I have 3 radiobuttons(radio0,radio1,radio2)on the stage.I am trying to concatinate name of radio button(i.e. "radio" with value of i)_ with the value of i and etting error.
      I am adding values to radiobutton labels through xml.


      This is the code:

      function loadRadio():Void
      {
      var radioval:String;
      var try1:String;
      q1_txt.text=RootNode.childNodes[0].childNodes[0].firstChild;
      for(var i:Number=0; i<=RootNode.childNodes.length; i++)
      {
      radioval=RootNode.childNodes[0].childNodes[i+1].firstChild.nodeValue;
      // I am getting all the values in variable called radioval, but the problem is how will i add these values to radio button labels.
      radio+i.label=radioval;
      //radio + value of i=radioval;....this is just to make u understand
      }
      }
        • 1. Re: radio button label
          TimSymons Level 1
          Instead of:

          radio+1.label = radioval;

          try:

          this["radio"+i].label = radioval;

          This will set the label of the each radio button (radio0, raio1, radio2, etc) to the current value of radioval. If I have misunderstood your question please let me know.

          Tim