This file shows how to change the textformat using a button and how to scroll text with a button.
Script
Text sizing
//Loading the text file. For Flash MX //movies use only loadVars and give the textfield an instance name. //Do not use loadvariables.
loadVarsText = new loadVars();
loadVarsText.load("text.txt");
loadVarsText.onLoad = function(success) {
if (success) {
headline.html = true;
headline.htmlText = this.headText;
//We format the textfield.
headline.border = true;
headline.borderColor = 0xff0000;
headline.background = true;
headline.backgroundColor = 0xffff00;
//we set the textsize.
myTextFormat = new TextFormat();
myTextFormat.size = 14;
headline.setTextFormat(myTextFormat);
}else{
trace("text not loaded,try again")
}
}
Text size button
//We reset the textsize.
on (release) {
myTextFormat = new TextFormat();
myTextFormat.size = 18;
headline.setTextFormat(myTextFormat);
}
In the button change format add the following script:
on (release) {
myTextFormat = new TextFormat();
myTextFormat.size = 18;
_root.headline.setTextFormat(myTextFormat);
}
The script for the two scroll buttons is this:
on (release) {
_root.headline.scroll = headline.scroll + 1;
}
and for the lower button
on (release) {
_root.headline.scroll = headline.scroll - 1;
}