Change a variable object in another method

I am creating a flash program to open other flash programs (load swf files), and change their textfields to my own extended textfield class. This is to capture all text written to screen using a textfield object. Here is what I am doing:

  1. If a textfield has been created, the event is captured
  2. I want to replace the textfield with my own class extending textfield
    *3. Any further access to the original textfield for value changes can be captured, and would update the replaced extended textfield object

The problem is if in their original code, at sometime, the text value of textfield is changed (mainly through textFieldObj.text = some_value) , I don’t know how to capture this event.

NOTE: This cannot be captured by event.CHANGE which requires the user input (ie: keyboard strokes) into the actual text field and changing the text through the code: textFieldObj.text = some_value does not trigger the event.

Here is a simplified example:

// FlashMovie.fla START -------------------------------------------

// any DisplayObjects (such as a created textfield) created will be captured
// by ChildAdded()

this.addEventListener(Event.ADDED, ChildAdded);
var tf = new TextField();
tf.text = “init”;
this.addChild(tf); // --> Calls the event handler, which replaces tf with another obj

// PROBLEM HERE: read below after the code
// tf has already been replaced by another obj in the display
tf.text = “new value”;

// Event handler when Textfield was added to the movie clip for display
// In this example, child would be type textfield, since I added a child of type
// TextField. TextFieldExtended is a custom class that extends TextField

function ChildAdded(event:Event){
var textf:TextField = TextField(event.target);
var tfe:TextFieldExt = new TextFieldExt();
tfe.text = textf.text;

    // Remove the TextField object from display and replace with TextFieldExtended 
    var mc:MovieClip = MovieClip(textf.parent);
    var index = mc.getChildIndex(textf);
    mc.removeChild(textf);
  mc.addChildAt(tfe,index);

}

// Movie_name.fla FINISH -------------------------------------------------

At the line–> tf.text = “new value”;

the string “new value” won’t show, because TextField variable, tf, has already been taken off the display list and it is replaced by my own object tfe (textfieldextended object).

If the original “tf” textfield was altered, how do I get a changed value or even the variable name (tf, in this case) because I only get the object from the DisplayObjectList in the movieclip object?

Is there a way to get variable list of the movie clip?

I know that:
this[“tf”].txt = “some text”;

is the same as
tf.text = “some text”;

Is there a way to search for all variable names being used, so that in my listener I can add a code snippet to my event:

// event handler method Changed to change the variable, tf, to point to my new object
function ChildAdded(event:Event){
var textf:TextField = TextField(event.target);
var tfe:TextFieldExt = new TextFieldExt();
tfe.text = textf.text;
var mc:MovieClip = MovieClip(textf.parent);
var index = mc.getChildIndex(textf);
mc.removeChild(textf);
mc.addChildAt(tfe,index);

// Some function to retrieve a variable name for the textfield being used
// we can test this simply by comparing if the variable is the same as textf
var textfield_var_name = findTextFieldVarName(textf);
mc[textfield_var_name] = tfe; // legal since my tfe extends TextField
}

mc[textfield_var_name] would be mc[“tf”], and this would change the original variable to point at my new object tfe.

Can anyone give any pointers?