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, but it’s not successful. Here’s my code:
//Importing component classes
import mx.controls.*;

//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”);“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.onLoad = function(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*;
			chk = chk.substring(0, chk.length-4) + "";
		};//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;

Any help is greatly appreciated.