在不使用外部 CSS 文件 (AS2) 的情况下设计 Flash 文件中的 HTML 链接样式?

发布于 2024-10-20 06:59:24 字数 622 浏览 0 评论 0原文

我正在经历一场噩梦,使用 CSS 在 Flash 文档的动态文本字段中设置 HTML 样式。经过多次尝试、错误和在线阅读后,我现在了解到,CSS 甚至无法在 Flash 中正常工作,即使对于它确实理解的标签也是如此(无论如何,这些标签很少而且相差很远)。由于某种原因,当我将鼠标悬停在链接(在外部 CSS 文件中设置样式)上时,我的布局在某些情况下(主要是当也存在图像时)完全搞砸了。如果我删除外部 CSS 样式(仅包含以下简单代码):

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

那么一切正常(但没有链接作为标准或悬停时带有下划线)。有谁知道有什么方法可以在不使用外部CSS文件的情况下设置链接样式(我想做的就是没有下划线作为标准,然后在悬停时给它们下划线)。由于这是用户输入到文本编辑器中的结果,因此我无法将这些链接手动放置在 Flash 页面上,因为它们可能位于任何地方,因此我需要一种解析 HTML 并相应地显示它的方法。

非常感谢任何人提供的任何帮助和建议,因为这让我完全困惑:)

戴夫

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 anyone 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

咽泪装欢 2024-10-27 06:59:24
var styles:TextField.StyleSheet = new TextField.StyleSheet();
styles.setStyle("html",{color:'#666666'});
styles.setStyle("a",{color:'#bf1f23'});

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

text.styleSheet = styles;
text.html = true;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文