I'm having a text box with scroll bar point to an external txt file for it's contents. In part of the txt file I have a web link. I'd like to make this a different color than the other text.
Here are the contents of my txt file named "ScrollBar_Text.txt":
&Title=Scroll Bar with Text File&
&myText=<b>Scrollable Text field with Exteral File</b>
This example shows you how to use a scrollbar with external text - in a text file. The important thing to remember is not to give your Text Field a variable Name. But make sure to give it an Instance name. This is the biggest difference between Flash 5 and MX when using text fields and components.
<b>Using Style's and Formats</b>
The Code also goes over how to use Style's and formats to change just about everything having to do with your ScrollBar and dynamic Text field.
<b>Example HTML Formatting</b><br>
<b>Bold</b> - tags shown in source.
<i>italic</i> - tags shown in source.
<a href=" target="_blank">URL Link</a>
Here is the action script code I have in Frame 1:
myData = new LoadVars();
myData.onLoad = addItems;
myData.load("Files/ScrollBar_Text.txt"
;
function addItems() {
// Set the Title from Text File.
Title = myData.Title;
myText.multiline = true;
myText.wordWrap = true;
myText.type = "dynamic";
myText.background = true;
myText.backgroundColor = "0x000000";
myText.border = false;
myText.html = true;
myText.htmlText = myData.myText;
ScrollBar.setScrollTarget(myText);
textFormat = new TextFormat();
textFormat.color = "0xffffff";
textFormat.bullet = false;
textFormat.underline = false;
textFormat.bullet = false;
textFormat.size = 11;
textFormat.font = "arial";
myText.setTextFormat(textFormat);
}
Would really just like to chang the color of the text enclosed in the "<a href=" tags in the text file.
Rod
Here are the contents of my txt file named "ScrollBar_Text.txt":
&Title=Scroll Bar with Text File&
&myText=<b>Scrollable Text field with Exteral File</b>
This example shows you how to use a scrollbar with external text - in a text file. The important thing to remember is not to give your Text Field a variable Name. But make sure to give it an Instance name. This is the biggest difference between Flash 5 and MX when using text fields and components.
<b>Using Style's and Formats</b>
The Code also goes over how to use Style's and formats to change just about everything having to do with your ScrollBar and dynamic Text field.
<b>Example HTML Formatting</b><br>
<b>Bold</b> - tags shown in source.
<i>italic</i> - tags shown in source.
<a href=" target="_blank">URL Link</a>
Here is the action script code I have in Frame 1:
myData = new LoadVars();
myData.onLoad = addItems;
myData.load("Files/ScrollBar_Text.txt"
function addItems() {
// Set the Title from Text File.
Title = myData.Title;
myText.multiline = true;
myText.wordWrap = true;
myText.type = "dynamic";
myText.background = true;
myText.backgroundColor = "0x000000";
myText.border = false;
myText.html = true;
myText.htmlText = myData.myText;
ScrollBar.setScrollTarget(myText);
textFormat = new TextFormat();
textFormat.color = "0xffffff";
textFormat.bullet = false;
textFormat.underline = false;
textFormat.bullet = false;
textFormat.size = 11;
textFormat.font = "arial";
myText.setTextFormat(textFormat);
}
Would really just like to chang the color of the text enclosed in the "<a href=" tags in the text file.
Rod