5 Replies Latest reply on Aug 28, 2008 10:37 PM by anirudhs

    Accessing Form Elements with mx:HTML Control

    KurtBoyer
      I'm very new to Adobe Air, but am an experienced developer. I've been struggling with understanding how to populate a web form when a button is pressed. I've made a small test application that illustrates what I'm trying to accomplish (you click the button and the username field on the html form should be given the value "Test"). Can anyone lead me in the right direction? I just can't seem to find the username form element in the document object model and I'm going crazy...

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:HTML id="myBrowser"
      location=" http://www.vfkgadget.com/testform.html"
      height="295" width="400" y="44" x="61"/>
      <mx:Button x="203" y="7" label="Fill In Username" click="populateUsername();"/>

      <mx:Script>
      <![CDATA[
      private function populateUsername():void {
      myBrowser.htmlLoader.window.document.getElementById('username').value = "Test"
      }
      ]]>
      </mx:Script>

      </mx:WindowedApplication>