[fmx] How do I keep my variables past the onload call?

I’ve created a multi-framed flash file that’s calling multiple variables from an external php (text) file. I’m using an onload command to do this and for some reason the variables seem to “disappear” once I leave the first frame (where the onload and load commands are).

I’m figuring that my problem has to do with ‘variables scope’. I’ve read the article on this site but I don’t know actionscript well enough to proceed.

I ultimately want to do away with using multiple frames by using multidemsional arrays and for…next loops, but this is what I have to work with (for now). I’m going crazy trying to get THIS to work.

Thanks for your help.

[AS]
// ##################################
// FRAME 1
// ##################################
externalVars = new LoadVars ();
externalVars.onLoad = function(success){
if(success){
strTemp = this.mydata;
strTokens = strTemp.split("<>");
if (strTokens.length > 2) {

	// Anything to the left is our headline and to the right is our link
	firstHeadline.text = strTokens[0].substr(0, strTokens[0].indexOf("|"));
	firstLink.text = strTokens[0].substr(strTokens[0].indexOf("|") + 1, strTokens[0].length);
	
	secondHeadline.text = strTokens[1].substr(0, strTokens[1].indexOf("|"));
	secondLink.text = strTokens[1].substr(strTokens[1].indexOf("|") + 1, strTokens[1].length);

	thirdHeadline.text = strTokens[2].substr(0, strTokens[2].indexOf("|"));
	thirdLink.text = strTokens[2].substr(strTokens[2].indexOf("|") + 1, strTokens[2].length);
	
	fourthHeadline.text = strTokens[3].substr(0, strTokens[3].indexOf("|"));
	fourthLink.text = strTokens[3].substr(strTokens[3].indexOf("|") + 1, strTokens[3].length);
	}

}
}

externalVars.load(“http://www.site.com/headlines_flash.php”);

// #######################################
// HERE’S HOW MYDATA IS FORMATTED IN THE PHP(TEXT) FILE:
// #######################################
<?
header(“Expires: Mon<> 26 Jul 1997 05:00:00 GMT”); // Date in the past
header(“Last-Modified: " . gmdate(“D<> d M Y H:i:s”) . " GMT”); // always modified
header(“Cache-Control: no-store<> no-cache<> must-revalidate”); // HTTP/1.1
header(“Cache-Control: post-check=0<> pre-check=0”<> false);
header(“Pragma: no-cache”); // HTTP/1.0
header(“Content-type: text/plain”);
?>
mydata=head1|link1<>head2|link2<>head3|link3<>head4|link4
// #######################################
[/AS]

Frame 2 has a text box with the instance name “firstHeadline”. Frame 3 has a text box with the instance name “secondHeadline”, etc.