Hallg3/FlashCS5:Importing text

Introduction - Importing Text and CSS to a TextBox and using scroll commands to veiw the text
Linking Text and CSS to a TextBox and applying scroll buttons with AS3

Text Document
Create a text document named text.xml using notepad or similar (you could name this text.txt but will need to rename this within the AS3 code).

Add required text to this document and formate it with HTML code such as

CSS Document
Create a CSS document named styles.css using notepad or similar.

Formate styles using HTML code

Flash Movie
Create a new flash movie with 2 layers.

Name one layer text_field and place a text box in it. Give the Text box an Instance name of tField in the properties box and select Dynamic Text. Ensure the Render text as HTML box is activated.

Name the other layer as actions and add the following script

Press control/enter and the text should be seen in the text box.

Using scroll commands to veiw imported text
Applying up and down scroll buttons to a text box with AS3

Scroll Arrows
In Flash, create a new layer and call it buttons Open windows/Common Libraries/Buttons and choose and place a button with an arrow on it on the stage. Rotate the button so the arrow is pointing up and give it an instance name scrollUp

Copy the button onto the same layer (so there are two buttons) and rotate the new istance 180 degrees so the arrow is pointing down and give it an instance name scrollDown

Position the up button at the top right of the text box and the down button at the bottom right of the text box

Click on the actions layer, open the actionscript box and enter the following code

Press control/enter and the text should be seen in the text box and scrollable. Hallg3 22:17, 4 May 2011 (EDT)

Resources

 * Software training & tutorials - The Online Training Library®. (n.d.). . Retrieved August 27, 2010, from http://www.lynda.com/home/otl.aspx