In this tutorial it will be explained how to format an Adobe Flash 8 website text by using CSS.
Cascading Style Sheets (CSS) save a lot of time because a you can use an external .css file for formatting a large amount of .html, .xml and even Adobe Flash 8 documents. Another advantage is that you can use the same .css file for display data in your both html and Flash versions of your website.
Let’s start our example by creating a new Flash 8 document with 550x400 dimensions and Frame rate 12 fps.
Draw a text field on the stage using the Text tool from the Tools panel. In the Properties Inspector set the following formatting for the text field: W:450, H:375, Arial, size 14, color #000000, from Text Type choose Dynamic Text and from Line Style drop down list select Multiline. Give to the text field the instance name css_txt.
Save the document as csstext.fla.
Now create a .css file in the same directory with your csstext.fla file, name it csstext.css, and put this code in:
AnaS {
color:#009900;
font-size: 25px;
font-family: Georgia , "Times New Roman", Times, serif;
font-weight:bold;
}
Great! Now go back to csstext.fla, open the Action Panel (F9) and write the following code:
//set the html property of the text field to true
news_txt.html = true;
//create a StyleSheet object
var myCSS:TextField.StyleSheet = new TextField.StyleSheet();
myCSS.onLoad = function(success){
if(success){
css_txt.styleSheet = myCSS;
css_txt.htmlText = "<AnaS>This is AnaS formatting!</AnaS><br><br><red>This is a red text.</red><br><br><beautiful>This is a beautiful text!</beautiful>";
}else{
trace("Sorry! There was an error!");
}
}
myCSS.load("csstext.css");
Now see the result:
You need to Register in order to download the FLA file.
In this article I will be
discussing the TrustRank and how you can promote your website on a
different level, building trust around your website and investing in
what really matters.
Beginners guide in Virtual Hosts on Apache Host more then one site on your Linux Apache web server using Virtual Hosts. This tutorial will walk you through the basics of how Apache and Vhosts work and include examples.
CSS Borders A border can be a visual separator between the margin on the outside, and the padding on the inside. You can set the width, color, and style of the entire border, or you can set each of these properties individually for each side.
Add Watermarks to images using CSS and PNG This tutorial explains a simple way of using PNG image files and CSS Coding to apply a simple Watermark effect on your images.
By using this simple technique in collaboration with a Photo Gallery you can very easily auto apply watermarks to all your pictures.