PDA

View Full Version : CSS Style Sheet Not Working on Dynamic Text!


markisr
03-06-2005, 07:16 PM
I'm having trouble getting my html text (dynmically generated from a .txt file) to reflect the style in the CSS Sheet.
The CSS is pretty simple: I have a:link, hover, active, visited to be bold and blue, and the body to be a different font and smaller.

To see the flash and the text, go to: http://www.markisr.com - my homepage The text below the picture is not responding to the CSS styles.

Here's my code: :rolleyes:

varReceiver = new LoadVars();
varReceiver.load("http://www.markisr.com/frontpage/story_retriever.php"); // file that generates the text

varReceiver.onLoad = function() {

var my_pic_loc = "http://www.markisr.com/frontpage"+this.f_PicLoc;
loadMovie(my_pic_loc,_root.mainpic); //
_root.mainpic._x = 9;
_root.mainpic._y = 92;
_root.mytitle.text = this.f_Title;

_root.thedate.text = this.mytime;

//Create a new style sheet object
myCSS = new TextField.StyleSheet();
myCSS.load("../commoncss/flash-css.css");

_root.body.bodytext.styleSheet = myCSS;
_root.body.bodytext.html = true;
_root.body.bodytext.htmltext = this.f_story;

};

stop();

http://www.markisr.com/frontpage/story_maker.fla to download the flash file, if necessary.

Thank you!!!!

merlinvicki
03-07-2005, 05:26 AM
hi;
try using this;

var css:TextField.StyleSheet = new TextField.StyleSheet();
css.load("../commoncss/flash-css.css");
_root.body.bodytext.styleSheet = css;
_root.body.bodytext.multiline = true;
_root.body.bodytext.wordWrap = true;
_root.body.bodytext.html = true;
externalText = new XML();
externalText .ignoreWhite = true;
externalText .load(your external html filename);
externalText .onLoad = function() {
root.body.bodytext.htmlText = externalText;
};

may not work in Netscape