Not able to run this code

16 views
Skip to first unread message

Vishwas Gagrani

unread,
Dec 22, 2012, 3:53:49 PM12/22/12
to bindag...@googlegroups.com
The value of person.age doesnot get updated, when i enter text into the textinput placed on the stage. I am using Flash IDE calling the flash builder framework as swc..

import fl.controls.TextInput ;
import flash.events.Event;
import com.googlecode.bindagetools.Bind ;

  var input_Txt:TextInput ;
 var person:Object = new Object() ;
person.age = new Object();

 
Bind.fromProperty(input_Txt, "text")
      .toProperty(person, "age");
   
function greaterThanOrEqualTo(val)
{
   
    return val ;
}


addEventListener(Event.ENTER_FRAME,ats);

function ats(e:Event)
{
    trace(input_Txt.text);
    trace(person.age);
}

Vishwas Gagrani

unread,
Dec 23, 2012, 1:57:59 AM12/23/12
to bindag...@googlegroups.com
I got some success.. but still "binding" doesnot work. In the following, i expect that on changing the value in the textfield, the value of person.age should change and reflect in the trace window. But this doesnot work.


import fl.controls.TextInput ;
import flash.events.Event;
import com.googlecode.bindagetools.Bind ;

var input_Txt:TextInput ;
var person:Object = new Object() ;
person.age = 2443


 
Bind.fromProperty(input_Txt, "text")
      .toProperty(person, "age");
   
function greaterThanOrEqualTo(val)
{
   
    return val ;
}


addEventListener(Event.ENTER_FRAME,ats);

function ats(e:Event)
{
    //person.age = String( new Date().milliseconds) ;
    trace(person.age);
}
Reply all
Reply to author
Forward
0 new messages