A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Data binding in pure AS3

  1. #1
    Senior Member
    Join Date
    Dec 2010
    Posts
    121

    Data binding in pure AS3

    In MXML Flex, you can use {} to bind data. In AS3, how do you bind data?

    For example, I have a text input box and when I click the Submit button, it writes the text of the the input box into a child node in an XML file.

  2. #2
    Senior Member
    Join Date
    Dec 2010
    Posts
    121
    So, no one knows this stuff?

  3. #3
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    I believe binding like that is a flex feature, not an AS3 feature. It generates AS3 code in the background. The AS3 would look something like this:
    Code:
    submitButton.addEventListener(MouseEvent.CLICK, doSubmit);
    private function doSubmit(e:MouseEvent):void{
      var text:String = textbox.text;
      someXML += XML("<someNode>"+text+"</someNode>");
    }

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