10 Replies Latest reply on Sep 15, 2008 12:07 PM by ntsiii

    Binding to XML elements at runtime

    Groky
      Hello,

      I have some code simliar to this:

      var xml:XML = <example>foo</example>
      var t:TextInput = new TextInput();
      t.text = xml; // displays "foo" in the TextInput

      But I want to bind this at runtime so that the TextInput writes its value back to the XML. However, I cannot work out how to specify this using BindingUtils as I'm not using a property of "xml", I'm using the value itself.

      I've tried this:

      BindingUtils.bindProperty(t, "text", xml, "");

      But I don't even get "foo" displayed in the TextInput. How do I achieve this?

      Thanks,
      Steven