flash animation video tutorials

 

 

 

START LEARNING
FLASH NOW

Get instant access to over
45 minutes of FREE Flash tutorials on video
 and our newsletter.

Name:
E-Mail:
Phone:
Describe

.

.

.

 
Web video-animation.com

.

.

flash tutorials flash tutorials flash tutorials flash tutorials

Loading external HTML in Flash 8

This Flash 8 tutorial will show you how to load in external html using the LoadVars command. You will load the html from an external text file so that you can change the html whenever you want.
First off lets create a text file with some html in it. Put it in the same folder as your flash file. You will need to assign a variable to the text. Do not leave any spaces between the variable name and the equals sign. eg.
someVariable=This is the text of the string

Flash Tutorials in Video Format - Watch them now at LearnFlash.com  

You will put the html content into the text file something like this:

myVariable=If you want to use html in Flash 8 then you need to do it a certain way. <b>It is a bit clunky</b> and not all of the html tags work. <a href="dunno.htm">Here is a link </a>but you do not seem to be able to see it properly. You may have to <br> Change the font colour <i>and underline it </i>but you can <font color="#ff0000">change the font color at least</font> and the new line tag seems to work ok. Double check to see if your formatting of your text file is working properly or not.

 

Once you have created your text file, create a flash file, and drag a TextField to the stage.
Make it the size you want, and give it the instance name of stage_txt.
Make sure it is dynamic text and multiline.
Then go to menu item Window - Components - User Interface.
And drag a UIScrollBar onto the textfield. It should snap to the side and become the correct size and somehow be connected to the textbox.

Create a new layer, call it actions and put this code on frame 1.


// declare the LoadVars object that 
// loads in the external text
myData = new LoadVars();
// load event 
myData.onLoad = function() {
	// allow text to use html 
	stage_txt.html = true;
	stage_txt.htmlText = this.myVariable;

};
// load text file 
myData.load("mytext.txt");

And that is it. You will need to test which HTML tags work, and how it does the formatting. But it does allow the HTML to be external and that is a good thing for maintainability.

Flash 8 Resources

.

.

flash 8