views:

96

answers:

2

I'm not sure if it's a bug, but is there any way to target the "class" or "id" identifier to style heading tags (h1 to h6) using ActionScript 3.0 CSS? It works fine with all the other tags.

eg.:

<p class="style1">text</p> // I can use .style1 or p in the CSS

<h1 class="style2">text</h1> // I can't use .style2 in the CSS, only h1

+1  A: 

It looks like h1 is not supported by the TextField class. Look in the docs for the htmlText property for a list of supported tags.

Subb
A: 

h1 is an html-element that implies some kind of hierarchy. In flash there are no such tags as they only use them for how things look like and not how they are structured.

You can achieve what you might want to with something similar to the following:

The html:

<p style="headline">Headline</p>
<p style="text">Text</p>

The css:

p.headline {font-size: 20pt; font-weight: bold;}
p.text {font-size: 12pt;}
Kevin D.
This is actually the solution I am going for; except for the fact that I need the tags to remain h[1..6] in the source, so I replace them after the import. Thanks for your input.
Mexican Seafood