A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] dynamically call on a node

  1. #1
    AS3 N00B
    Join Date
    Feb 2002
    Location
    NYC
    Posts
    308

    resolved [RESOLVED] dynamically call on a node

    Here is my XML layout:
    Actionscript Code:
    <xml>
       <seriesA>
          <chart_form>
             <total_return>75.41%</total_return>
          </chart_form>
       </seriesA>
    </xml>

    I usually do this:

    Actionscript Code:
    function ParseSeriesData(seriesInput:XML):void {
        stats.htmlText = seriesInput.seriesA.chart_form.total_return;
    }

    But I want to do something like this:
    Actionscript Code:
    var mynode:String = "seriesA";

    function ParseSeriesData(seriesInput:XML):void {
        stats.htmlText = seriesInput.mynode.chart_form.total_return;
    }

    Thanks in advance.
    Last edited by neo1487; 03-11-2010 at 07:42 AM.
    -Neo

  2. #2
    AS3 N00B
    Join Date
    Feb 2002
    Location
    NYC
    Posts
    308
    Actionscript Code:
    stats.htmlText = seriesInput.child(mynode).chart_form.total_return;
    -Neo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center