Load movie wont keep my variables!

I am sort of a newbie to actionscript…
but here is the problem…
I have two movies; movie1.swf and movie2.swf
with a click of a button in movie1.swf, movie2.swf is loaded into a target MovieClip. However, in movie 2 there are buttons that load dynamic text from a text from a text file. I can load the variables fine when just testing movie2.swf, however, when loaded into movie1.swf the text does not show up.

Here is the code from the button in movie2.swf

on (release) {
loadText=new loadVars();
loadText.load(“read-list.txt”);
//creating the loadVarsText function
loadText.onload= function() {
_root.scroller.text = this.list;
};

}

(where “scroller” is the instance name of my text box.)
I have also tried _root.content.scroller.text = this.list;
where “content” is the instance name of the empty MC that movie2 is loaded into.

Any suggestions to make this work?
thanks in advance

Welcome to kirupa forum!! :beam:

Try this:
[AS]scroller.text = this.list;
// if you’re using a MovieClip as a Button
_parent.scroller.text = this.list;[/AS]

I tried it still doesnt work…
and no I have a movieclip called buttonMC which houses the buttons and the script stated above… so i needed the _root statement so the link would work in movie2.swf

[AS]_parent.scroller.text = this.list;[/AS]
That should work… :-\

Could you attach the FLA?

thanks Kax…
It was just that easy… thank goodness for brothers like you !

:stuck_out_tongue: - No problem. :wink: