-
AS3 does not interpret HTML into XML
hello!
the title is auto explanatory. this doesn´t work,
it shows plain text, not formatted:
xml:
Code:
<image link="slides/pic2.jpg" title="TÃ*tulo">
<desc>
<![CDATA[<font color='#"+990000+"'><b>First line Text in Bold Red color</b><font>]]>
</desc>
</image>
as3:
Code:
descriptionTF.htmlText = my_items[intCurrentSlide].desc;
thanks !!
-
Senior Member
This may seem a bit unorthodox but I use xml everyday and this works for me. Just take out your CData
Code:
<image link="slides/pic2.jpg" title="TÃ*tulo">
<desc>
<font color='#990000'><b>First line Text in Bold Red color</b><font>
</desc>
</image>
Hope this helps. Let me know if it doesn't and I'll look further into it.
-
hey fellows, I´ve got it to work using it like this:
Code:
<desc>
<![CDATA[O Floripa Music Hall traz a maior banda de heavy metal do Brasil. Ingressos ja a venda <font color='#990000'><a href='www.google.com'>Saiba mais</a></font>]]>.
</desc>
but the tags <b> as well as <strong> don´t work !
i wonder why..
thankS!
Thanks!
-
hey jweeks123, thjanks for answering,
I took of the [[CDATA like this:
Code:
<image link="slides/pic1.jpg" title="Descubra o Floripa Music Hall">
<desc>
O Floripa Music Hall traz a maior banda de heavy metal do Brasil. Ingressos ja a venda <font color='#990000'><a href='www.google.com'>Saiba mais</a></font>.
</desc>
</image>
and it not only doesn´t interpret the html at all, but it also shows a blank line in the textfield, before the text..
like i posted previously, with the "CDATA" i´ve managed to work the 'font' and 'a' tags, but not the 'b'.
Thanks !
-
Senior Member
Interesting. Well, do you get the correct HTML string when you trace out the nodes value?
-
trace shows:
O Floripa Music Hall traz a maior banda de heavy metal do Brasil. Ingressos ja a venda <b><font color='#990000'><a href='www.google.com'>Saiba mais</a></font></b>.
funny...
-
Senior Member
Very Interesting Indeed.
If I make a textfield and set its text to that, it works as it should for me. Perhaps yours is getting reset somewhere? Perhaps a textformat is interfering? Not sure, but another idea would be to load that string into a string variable and then assign it to the textfield as HTML text.
-
that shows the same results as before :
Code:
var descString:String = my_items[intCurrentSlide].desc;
if (descriptionTF)
descriptionTF.htmlText = descString;
and there is no text format..
textfield settings in flash ide:
anti alias for animation , render text as html, embedded characters, multiline...
tried with other settings (device fonts, etc) and Arial , tag <strong> instead of <b> in the xml file...no success!
really intriguing !
-
Senior Member
Hmmm...I wonder if it's your flash player. Sometimes I see different flash results on different machines. Do you have a source file you could attach so I may see what I get with it?
-
sure, how could I send it to you ?
-
Senior Member
Shoot me an email if you'd like. jonathon.weeks@gmail.com
-
-
Senior Member
I actually need your entire source,
the xml
fla
and swf if you could.
-
sorry, i had sent only the swf by mistake. i´ve sent it to ur mail
-
Senior Member
It's all good. I've got it, and made some changes. I've sent you a new source compilation, but I'm thinking the problem lays within the font that your using on the textfields themselves.
-
Cmon fellas, leavin me outta the loop!
Attach is there for a reason ziriguidum
I (Love | Hate) Flash.
----
Save a version back so others may help you!
-
Senior Member
LOL, you didn't miss much Phix. Our statements here pretty much sum it up, but in the end ziriguidum ended up removed the <b> tag as it wasn't working well unless device fonts were in use.
-
Long as it got solved.
Just givin' you hell
I (Love | Hate) Flash.
----
Save a version back so others may help you!
-
Senior Member
Nothing wrong with a bit of hell raisin, LOL.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|