Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > ActionScript 1,2 > проблемы с наложением слоев..


Автор: belka 16.2.2007, 09:51
вообщем: я делаю XML меню - т.е. строю его программно, затем создаю новый клип и аттачу туда некий символ из библиотеки. XML меню ложится на глубины от 1 до 12, а  символ на 100 глубину.. но почему то получается, что злополучное меню оказывается сверху.. в чем моя ошибка???

Добавлено @ 09:54 
О получилось!! я совсем забыла про чудесное св-во this.getNextHighestDepth()!!

топик пока не закрою.. чувствую, что очередные подводные камни близко ))

Добавлено @ 10:03 
вот он.. новые камни: почему не срабатывает 
Код

_root.header.swapDepths(this.getNextHighestDepth());
????????
здесь _root.header - это НЕ программно созданный символ, но положенный на самый верхний слой в тайм лайне..

Автор: AlDev 16.2.2007, 13:17
Цитата(belka @  16.2.2007,  14:51 Найти цитируемый пост)
О получилось!! я совсем забыла про чудесное св-во this.getNextHighestDepth()!!

это метод )

_root.header.swapDepths(this.getNextHighestDepth());

_root и this тут одно и то же?

Автор: belka 18.2.2007, 20:03
вопрос впринципе не про слои.. но слишком мал, чтоб новый топик создавать: почему-то мое XML-меню глючит в плане руссого языка.. если он выгружет в динамик текст англицкий - то все Ok!, а если русские слова - то получаются квадратики???  smile 
(в динамик тексте стоит шрифтец - Verdana)

Автор: AlDev 19.2.2007, 13:56
UTF-8 используй кодировку в xml

Автор: belka 19.2.2007, 14:14
Цитата(AlDev @  19.2.2007,  13:56 Найти цитируемый пост)
UTF-8 используй кодировку в xml 

нет.. не помогает, вот мой XML:
Код

<?xml version="1.0" encoding="UTF-8"?>
<menu>
<button text="Преза 1" url="xml/menu1.xml" target="_parent"></button>
<button text="Present 2" url="xml/menu2.xml" target="_parent"></button>
<button text="Present 3" url="xml/menu3.xml" target="_parent"></button>
<button text="Present 4" url="xml/menu4.xml" target="_parent"></button>
<button text="Present 5" url="xml/menu5.xml" target="_parent"></button>
</menu>

Автор: AntonioBanderaz 20.2.2007, 10:15
В первом кадре )
Код

System.useCodepage = true;

Автор: belka 20.2.2007, 11:06
AntonioBanderaz, спасиба! буду знать!!  smile 

Автор: AlDev 20.2.2007, 12:38
AntonioBanderaz, это если не utf юзать

Автор: AntonioBanderaz 20.2.2007, 15:01
тоже прокатит, это штука говорит flash что надо использовать кодовые таблицы... 
тоесть если у xml будет стоять <?xml version="1.0" encoding="CP1251"?>, то должно прокатить, но только на машинах, у которых эта кодировка является дефолтной. ) как-то так...

Добавлено @ 15:05 
ну да, давно as2 не занимался )
Цитата

A Boolean value that tells Flash Player whether to use Unicode or the traditional code page of the operating system running the player to interpret external text files. The default value of System.useCodepage is false. 

When the property is set to false, Flash Player interprets external text files as Unicode. (These files must be encoded as Unicode when you save them.) 
When the property is set to true, Flash Player interprets external text files using the traditional code page of the operating system running the player. 
Text that you load as an external file (using the loadVariables() or getURL() statements, or the LoadVars class or XML class) must be encoded as Unicode when you save the text file in order for Flash Player to recognize it as Unicode. To encode external files as Unicode, save the files in an application that supports Unicode, such as Notepad on Windows 2000.

If you load external text files that are not Unicode-encoded, you should set System.useCodepage to true. Add the following code as the first line of code in the first frame of the SWF file that is loading the data:

System.useCodepage = true;


When this code is present, Flash Player interprets external text using the traditional code page of the operating system running Flash Player. This is generally CP1252 for an English Windows operating system and Shift-JIS for a Japanese operating system. If you set System.useCodepage to true, Flash Player 6 and later treat text as Flash Player 5 does. (Flash Player 5 treated all text as if it were in the traditional code page of the operating system running the player.)

If you set System.useCodepage to true, remember that the traditional code page of the operating system running the player must include the characters used in your external text file in order for the text to display. For example, if you load an external text file that contains Chinese characters, those characters cannot display on a system that uses the CP1252 code page because that code page does not include Chinese characters.

To ensure that users on all platforms can view external text files used in your SWF files, you should encode all external text files as Unicode and leave System.useCodepage set to false by default. This way, Flash Player 6 and later interprets the text as Unicode.


тоесть если текст содержит не unicode символы, то эту переменную надо поставить в true

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)