Imajine Blog Imajine Articles
Contact Me

Text Enhancement / using styles and HTML pages in Flash


When we say we are enhancing text in flash by implementing ‘styles’ to it, We certainly mean we have a styles (.css) page and an HTML page, which is loaded into flash.

To Begin with, create an external styles page and an HTML page.

  • Using dreamweaver, I created a styles page (styles.css) with style tags I require for my text formatting / enhancement.
  • Then I created an HTML page. Retained only body tag, deleted other tags like "<html> and  <head>".
  • Insert text and styles in body tag.

Now coming back to flash file,

  • I imported background image which I had created in Fireworks and placed it as background.
  • Then I created a Dynamic text field and gave an instance name ‘content_txt’.
  • To begin with actionscript,
    Create a new layer and name it ‘actions’.
    Select ‘Frame1’ of this ‘actions’ layer and paste the below script in actions window. If your actions window is not open, press ‘F9’ or select ‘Windows > Actions’ from menu bar.

    var myStyle:TextField.StyleSheet = new TextField.StyleSheet();

    myStyle.load("styles.css");
    content_txt.styleSheet = myStyle;
    content_txt.multiline= true;
    content_txt.wordWrap = true;
    content_txt.html = true;

    var story:XML = new XML();
    story.ignoreWhite = true;
    story.load("content.html");
    story.onLoad = function ()
    {
    content_txt.htmlText = story;
    }



    Code above, you see,

    story.ignoreWhite = true;

    Which is used to prevent white space such as tabs and spaces used in formatting in your XML to be interpreted as text nodes

Now all you will have to do is test your file, : ). Yes, exactly, this tutorial ends here. Isn’t it simple to enhance text in flash.

Click here to download source file

Tags : Text Enhancement in flash, CSS in Flash, Import HTML page in Flash , CSS and HTML in Flash 

Download Free Photo Gallery

Download Free Photo Gallery

You can download Imajine's Scrapbook Photo Gallery absolutely free of cost and to customize , you need no knowledge of Adobe Flash.  Click here to view Scrapbook Photo Gallery / download

Tutorials
Flash Tutorials
Horizontal 3D Carousel
MP3 Player
Scrapbook Photo Gallery
Text Enhancement
Color object
Glow effect using actionscript
Drawing with actionscript
Blur Effect
Load external .mp3 file
Preload external .mp3 file
Sound Controller
Set volume of externally .mp3 file
View MP3 song details
Actionscript blur effect
Actionscript fade in / out effect
Fireworks Tutorials
Custom Stroke
Typography / Ink blot effect
Photograph focus effect
Rainbow Pattern
Inset Text Effect
Fuzzy Light Blending Mode
Little bulb effect
Old paper effect
'Post it' effect
Hand drawn designs
Black/White and Sepia tone
Water color painting effect
Vintage effect on vector graphics
Solid color, black/white
Photoshop Tutorials
Photo editing
Purple Haze

Portfolio

Logos
Website design
CMS Customization
Flash
Web development
Print


Download free textures and patterns and use it for your personal use.

Click here to download Textures and Patterns.

Download free birthday cards

Free Birthday Cards
Click here to view Imajine's free downloadable birthday cards for personal and corporate use. Imajine's birthday cards are in jpeg format so it is faster to download and send in your wishes to your friends and family.
Bookmark and Share Tell a Friend jayanthi.varma@imajine.in  |  © 2008 Imajine