Hi, I have a Flash file with the following code in it:
// Create a new style sheet object and set styles for it.
var styles:TextField.StyleSheet = new TextField.StyleSheet ();
styles.setStyle ("html",{fontFamily:'Arial,Helvetica,sans-serif', fontSize:'12px', color:'#0000FF'});
styles.setStyle ("body",{color:'#00CCFF'});
styles.setStyle ("h1",{fontFamily:'Arial,Helvetica,sans-serif', fontSize:'24px', color:'#006600'});
styles.setStyle ("p",{color:'#000000', fontSize:'14px'});
styles.setStyle ("a",{color:'#0000FF', fontSize:'14px', fontWeight:'bold', textDecoration:'underline'});
//
/* Assign the style sheet object to myTextArea component. Set html property to true, set styleSheet property to the style sheet object. */
myTextArea.styleSheet = styles;
myTextArea.html = true;
myTextArea.focusTextField = null;
//
var myVars:LoadVars = new LoadVars ();
// Define onData handler and load text to be displayed.
myVars.onData = function (myStr:String):Void {
if (myStr != undefined) {
myTextArea.text = myStr;
} else {
trace ("Unable to load text file.");
}
};
//
myVars.load ("references.htm");
//
Then, I have the file references.htm to be loaded:
<p>Text text text. <br/>[<img src='images/imagepopup.gif' width='15' height='15' vspace='0' hspace='0'/><a href="http://www.cnn.com" target="_blank">Link to CNN</a>]</p>
The problem is that the image that is in the HTML code does not appear in the same line with the text (inside the []). Instead, it appears in a line below.
It looks like this:
Text text text.
[ Link]
Image
But it should look like this:
Text text text.
[Image Link]
Is there anything wrong with the code? Please advice.
Thanks,
CH