|
|
|||||
не читает <br>
флеш читает ХТМЛ теги типа <b>,<i> но не видит <br>.
Как быть? скрипт стандартный var my_fmt:TextFormat = new TextFormat(); my_fmt.font = "Arial"; this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 500, 500); my_txt.border = true; my_txt.html = true; my_txt.wordWrap = true; my_txt.embedFonts = true; my_txt.htmlText = theAuthor; my_txt.setTextFormat(my_fmt); |
|
|||||
[гнилой базар]
Регистрация: Oct 2005
Сообщений: 8
|
Это тут не причем. Покажи текст загрузчика текста.
|
|
|||||
Регистрация: May 2004
Адрес: Kiev
Сообщений: 704
|
Флэш понимает <br> в том случае, если есть и закрывающий тэг </br>.
Есть в твоем тексте </br>? |
|
|||||
[+ 1.1 30.08.2005]
|
Если ВЫ открываете в TextField тогда ВАМ сюда
Flash 2004MX\Samples\TextEnhancements\TextEnhancements.fla (Она быстрее и стильнее чем в твоем примере... наверное)
__________________
не надо читать, это подпись(все-таки прочли, да?) |
|
|||||
Вот скрипт, который читает ХМЛ
myXML = new XML(); myXML.ignoreWhite = true; myXML.load("menu.xml"); myXML.onLoad = function(success) { if (success == true) { rootNode = myXML.firstChild; autorTag = rootNode.firstChild; theAuthor = autorTag.firstChild; widthtag = theAuthor.firstChild; gotoAndStop(2); } }; вот сама строка ХМЛ <navigation><dimension>Hello<br>Hello again</br></dimension><name>name of smth</name><width>width of smth</width></navigation> Должна выводить Hello Hello again а выводит в одну строку |
|
|||||
Flash Aксакал
Регистрация: Jun 2005
Сообщений: 636
|
есть такое понятие как <![CDATA[тут ваш html text]]>
то есть выглядеть должно типа такого |
|
|||||
И ка обратиться к такой структуре? <![CDATA[Hello <br> Hello again <br>]]>
ведь стандартными приёмами они текст не увидит |
|
|||||
Вернее видит, но <br> не воспринимает как тег
|
|
|||||
Негуру
администратор
Регистрация: Jan 2000
Адрес: Кёнигсберг in Moscow
Сообщений: 21,879
Записей в блоге: 7
|
theAuthor = autorTag.firstChild.nodeValue;
вот пример myXML = new XML ("<navigation><dimension><![CDATA[Hello <br> Hello again <br>]]></dimension><name> name of smth </name><width>width of smth </width></navigation>"); myXML.ignoreWhite = true; rootNode = myXML.firstChild; autorTag = rootNode.firstChild; theAuthor = autorTag.firstChild.nodeValue; var my_fmt = new TextFormat (); my_fmt.font = "Arial"; my_fmt.color =0xff0000 this.createTextField ("my_txt", 1, 10, 10, 500, 500); my_txt.setTextFormat (my_fmt); my_txt.border = true; my_txt.html = true; my_txt.wordWrap = true; //my_txt.embedFonts = true; my_txt.htmlText = theAuthor; trace (theAuthor) |
Часовой пояс GMT +4, время: 17:00. |
|
« Предыдущая тема | Следующая тема » |
|
|