PDA

View Full Version : Textfield, CSS stylesheet external loading


Flash_Boi
04-03-06, 01:32 PM
Hi Everyone,

I got this tutorial from the Macromedia FLASH 8 Advanced book at a local library. It has helped me through some stuff. The example of loading external CSS stylesheet into a textfield works lovely, but they don't have an example of loading an external css and external text file into a dynamic text field. I have read numerous tutorials from macromedia's site and a quite a few others from users posting in forums. I seem to still not understand it.

With this actionscript code to load an external css stylesheet. How can I make it so it also loads the external text file dpmoreinfo.txt into the dynamic text field that I render as HTML?

Please incorporate the following ActionScript. Keep in mind to use the dpmoreinfo.txt file in this code.

import TextField.StyleSheet;
var myStyle:StyleSheet = new StyleSheet();
myStyle.load("mystyles.css");
myStyle.onLoad = function(success:Boolean) {
newsLetterTop_txt.styleSheet = myStyle;
newsLetterTop_txt.html = true;
newsLetterTop_txt.text = "<heading>I would like to display my external text file here! How would I do that?</heading>";
};


Thanks for your support!

Flash_Boi :confused: