Using listeners with dynamic textBoxes

  • DrGonzo
  • Beginner
  • Beginner
  • DrGonzo
  • Posts: 36

Post 3+ Months Ago

Hello all!
I'm trying to put an onChanged listener on a dynamic texbox... does anyone know how to do this?
I've tried:

Code: [ Select ]
flag._visible = false;
dynamicBox.onChanged = function(){
    flag._visible = true;
}
  1. flag._visible = false;
  2. dynamicBox.onChanged = function(){
  3.     flag._visible = true;
  4. }


But that only works for input text...

and i've also tried:

Code: [ Select ]
flag._visible = false;
var myListener:Object = new Object();
myListener.onChanged = function(){
    flag._visible = true;
}
dynamicBox.addListener(myListener);
  1. flag._visible = false;
  2. var myListener:Object = new Object();
  3. myListener.onChanged = function(){
  4.     flag._visible = true;
  5. }
  6. dynamicBox.addListener(myListener);

any ideas....

Thanks.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Code: [ Select ]
var onChanged:Function = function(prop, _undefined_, newVal, obj){
    trace(prop + " changed from " + obj[prop] + " to " + newVal);
    return newVal;
}
one.watch("text", onChanged, one);

but.onPress = function(){
    one.text = 'Two';
}
  1. var onChanged:Function = function(prop, _undefined_, newVal, obj){
  2.     trace(prop + " changed from " + obj[prop] + " to " + newVal);
  3.     return newVal;
  4. }
  5. one.watch("text", onChanged, one);
  6. but.onPress = function(){
  7.     one.text = 'Two';
  8. }
  • DrGonzo
  • Beginner
  • Beginner
  • DrGonzo
  • Posts: 36

Post 3+ Months Ago

Perfect - thanks joebert.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 20 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.