Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

working with an external file 1

Status
Not open for further replies.

TaiChi56

Technical User
Mar 6, 2002
188
US
I have made a box and in that box I want my words to appear. I have been able to do that with an external text file. The problem is I cannot seem to change the font color or size. Here is the code I have been using.

box1text.loadVariables("Boxtext1.txt", "/");
boxtext1.textColor = 0xffffff;
boxtext1.textSize = 10;
boxtext1.selectable = false' The secret in education lies in respecting the student. {Ralph Waldo Emerson}.
 
Flash 5 or MX? Regards,

oldman3.gif
 
Sorry. It is Flash MX. The secret in education lies in respecting the student. {Ralph Waldo Emerson}.
 
use loadvars instead of loadvariables like this

mydata = new loadvars()
mydata.onload = SetBox;
function setbox(){
boxtext1.multiline = true;
boxtext1.wordWrap = true;
boxtext1.type = "dynamic";
boxtext1.background = true;
boxtext1.backgroundColor = "0x87cefa";
boxtext1.border = true;
boxtext1.borderColor = "0x000000";
boxtext1.html = true; boxtext1.htmlText = mydata.text;
}
mydata.load("boxtext1.txt");

Change the above to suit. For a full list of textbox properties look at the actionscript dictionary.
 
Excellent. Thank you. The secret in education lies in respecting the student. {Ralph Waldo Emerson}.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top