Selinium
03-03-2004, 05:06 PM
I am trying to pas a variable $pageVar_str; to the centre_Txt.htmlText in a seperate movieclip.
Here is the code in frame one of the main time line.
stop();
var $pageVar_str; // Variable to display Page content
_global.$pageVar_str = "home";
Here is the code for the movie clip.
//this.createTextField("centre_Txt",0,250,20,300,560);
// Variable to display Page content
trace ($pageVar_str);
centre_Txt.border = false;
centre_Txt.wordWrap = true;
centre_Txt.borderColor = 0xcccccc;
centre_Txt.html = true;
_global.textVars = new LoadVars();
textVars.load("textVars.txt");
textVars.onLoad = function() {
centre_Txt.htmlText = textVars.$pageVar_str;
};
trace (textVars.$pageVar_str);
I have traced the value of $pageVar_str; and at this point it is equal to "home" as i want it.
what I am trying to acheive is the line 'in red' to dynamically read as :
centre_Txt.htmlText = textVars.home;
Where am I going wrong?
Any help gratefully received!
Cheers
James
Here is the code in frame one of the main time line.
stop();
var $pageVar_str; // Variable to display Page content
_global.$pageVar_str = "home";
Here is the code for the movie clip.
//this.createTextField("centre_Txt",0,250,20,300,560);
// Variable to display Page content
trace ($pageVar_str);
centre_Txt.border = false;
centre_Txt.wordWrap = true;
centre_Txt.borderColor = 0xcccccc;
centre_Txt.html = true;
_global.textVars = new LoadVars();
textVars.load("textVars.txt");
textVars.onLoad = function() {
centre_Txt.htmlText = textVars.$pageVar_str;
};
trace (textVars.$pageVar_str);
I have traced the value of $pageVar_str; and at this point it is equal to "home" as i want it.
what I am trying to acheive is the line 'in red' to dynamically read as :
centre_Txt.htmlText = textVars.home;
Where am I going wrong?
Any help gratefully received!
Cheers
James