开发者

Styling HTML links within a flash file without using an external CSS file (AS2)?

开发者 https://www.devze.com 2023-02-14 22:36 出处:网络
I am having a nightmare using CSS to style HTML within a dynamic textfield in my flash doc. From what i now understand after much trial and error and reading online, CSS doesn\'t even work properly in

I am having a nightmare using CSS to style HTML within a dynamic textfield in my flash doc. From what i now understand after much trial and error and reading online, CSS doesn't even work properly in flash even for the tags that it does understand (which are few and far between anyway). For some reason my layout is getting completely screwed up in certain scenarios (predominantly when there are images present too) when i hover over links (which are styled in an external CSS file). If i remove the external CSS styling (which only contains the following simple code):

a:link {text-decoration: none;}
a:active {text-decoration: none;}
a:visited {text-decoration: none;}
a:hover {text-decoration: underline;}

Then everything works fine (but no links are underlined as standard or on hover). Does an开发者_如何学运维yone know of any way to style the links without using an external CSS file (all i want to do is have no underline as standard and then underline them on hover). As this is from user input into a text editor I cannot place these links manually on the page in flash as they could be anywhere, I need a way of parsing the HTML and then displaying it accordingly.

Thanks so much for any help and advice anyone could offer as this has got me completely confused :)

Dave


var styles:TextField.StyleSheet = new TextField.StyleSheet();
styles.setStyle("html",{color:'#666666'});
styles.setStyle("a",{color:'#bf1f23'});

text.styleSheet = styles;
text.html = true;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号