Tracking a variable change from C++

Hey all,

I have a listbox that needs to be populated when a variable is sent to my .swf. What happens is…if the variable is already passed a value before my .swf loads, then it works fine, but the variable will be passed after the .swf loads, so that leaves the listbox empty.

I would like for the listbox to populate when it notices the variable has been changed. I used object.watch, but it’s not successful. Here’s my code:
[AS]
stop();
//Importing component classes
import mx.controls.*;
mx.accessibility.ListAccImpl.enableAccessibility();

//Variables for Listbox
var createVar_btn:Button;
var listBox_lst:mx.controls.List;

//Setting ListBox properties
listBox_lst.hScrollPolicy = “off”;
listBox_lst.maxHPosition = 200;
listBox_lst.iconField = “icon”;
//listBox_lst.setStyle(“themeColor”, “haloBlue”);
_path.watch(“text”, loadChecks());
//Setting up XML file
//var _pathUN = “Username_and_Password”;
var checksXML:XML = new XML();
var _path:String = “”;

function loadChecks(property, oldVal, newVal){

checksXML.ignoreWhite = true;
checksXML.load(checks.xml);

//checksXML.load(“checks.xml”);
checksXML.onLoad = function(pSuccess)
{
if(pSuccess)
{
_root.splash_mc.username_txt.text = _UN;

		//Populating ListBox with file in directory via XML
		for(var i:Number = 0; i < checksXML.firstChild.childNodes.length; i++)
		{
			//Setting XML location to variable 'chk', then getting rid of the file extension to display in ListBox
			var chk = checksXML.firstChild.childNodes*.attributes.name;
			chk = chk.substring(0, chk.length-4) + "";
			listBox_lst.addItem(chk);
		};//End of 'for' loop					
	//End of 'rollButton_mc' function		
};//End of 'if(success)' loop

};//End of ‘onLoad’ function
};

useCheck_btn.onRelease = function()
{ //Enter code to do something when an item is selected in the ListBox
var tVar = listBox_lst.selectedItem.label;
};
[/AS]

Any help is greatly appreciated.