Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 1.0/2.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 17.07.2009, 21:24
Altera Pars вне форума Посмотреть профиль Отправить личное сообщение для Altera Pars Найти все сообщения от Altera Pars
  № 1  
Ответить с цитированием
Altera Pars

Регистрация: May 2007
Сообщений: 46
По умолчанию loadVariablesNum

Пожалуйста, помогите... Не могу разобраться... Задача такова. Есть XML. В ней прописаны пути к картинкам и текстовым файлам.
Код:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<pics>
	<path header="stech/tech1/header.png">
		<pics image="stech/tech1/logo1.png" txt = "stech/tech1/logo1.txt"/>
		<pics image="stech/tech1/logo2.png" txt = "stech/tech1/logo2.txt"/>
		<pics image="stech/tech1/logo3.png" txt = "stech/tech1/logo3.txt"/>
		<pics image="stech/tech1/logo4.png" txt = "stech/tech1/logo4.txt"/>
		<pics image="stech/tech1/logo5.png" txt = "stech/tech1/logo5.txt"/>
		<pics image="stech/tech1/logo6.png" txt = "stech/tech1/logo6.txt"/>
		<pics image="stech/tech1/logo7.png" txt = "stech/tech1/logo7.txt"/>
		<pics image="stech/tech1/logo8.png" txt = "stech/tech1/logo8.txt"/>
		<pics image="stech/tech1/logo9.png" txt = "stech/tech1/logo9.txt"/>
		<pics image="stech/tech1/logo10.png" txt = "stech/tech1/logo10.txt"/>
		<pics image="stech/tech1/logo11.png" txt = "stech/tech1/logo11.txt"/>
	</path>
</pics>
По нажатию на клипы, в которые подгрузились картинки, должна грузится соответствующая html.

Код AS1/AS2:
	_root.createEmptyMovieClip("ahp",_root.getNextHighestDepth());
	_root.createEmptyMovieClip("bigLoader",_root.getNextHighestDepth());
	_root.createEmptyMovieClip("butt",_root.getNextHighestDepth());
	_root.createEmptyMovieClip("foon",_root.getNextHighestDepth());
	xml_source = new XML();
	xml_source.ignoreWhite = true;
	xml_source.onLoad = function(success) {
		if(success) {
		trace("Congratulations!");
		count = this.firstChild.childNodes.length;
		count_2 = this.firstChild.firstChild.childNodes.length;
		trace(count);
		trace(count_2);
		newPosY = 40;
		for(j=0;j<count;j++) {
		this.Root = ahp.createEmptyMovieClip("ahp"+j,_root.getNextHighestDepth());
		this.Root._x = 90;
		//this.Root._y = -510;
		this.Text = _root.createEmptyMovieClip("txtt",_root.getNextHighestDepth());
		this.textBox = txtt.createEmptyMovieClip("txt"+j,j);
		this.Text._x = 90;
			for(i=0;i<count_2;i++) {
				this.xmlNode = this.firstChild.childNodes[j].childNodes[i];
				this.newClip = this.Root.createEmptyMovieClip("new"+j+i,i);
				this.newClip.ld = this.xmlNode.attributes.txt;
				this.newClip.lds = String(this.newClip.ld);
				this.newClip.head = this.firstChild.childNodes[j].attributes.header;
				trace("Заголовок "+ this.newClip.head);
				trace("Текст "+this.newClip.ld);
				this.newThumb = this.newClip.createEmptyMovieClip("loads",i);
				trace("Контейнер "+this.newThumb);
				trace("ЛОГО "+this.firstChild.childNodes[j].childNodes[i].attributes.image);
				this.newThumb.loadMovie(this.firstChild.childNodes[j].childNodes[i].attributes.image);
				trace("КАРТИНКА "+this.firstChild.childNodes[j].childNodes[i].attributes.image)
				this.textBox.loadMovie(this.newClip.head);
				trace(this.newClip+" "+ahp["new"+j+i]);
				line = Math.floor(i/9);
				this.newClip._x = i%9*(80);
				this.newClip._y = line*70 + 100;
				trace("ЦИКЛ "+j);
				trace("ЦИКЛ "+i)
				this.newClip.onRollOver = function() {
					trace(this);
				}
				this.newClip.onRelease = function() {
					//foon.unloadMovie();
					foon.attachMovie("fon","fon0",100);
					loadVariablesNum(this.ld,this.getNextHighestDepth());
					bigLoader._x = 210;
					bigLoader._y = 100;
					bigLoader.createEmptyMovieClip("btn",this.getNextHighestDepth());
					butt.attachMovie("btn","btnn",this.getNextHighestDepth());
					butt._x = 740;
					butt._y = 105;
					butt.enabled = true;
					butt._visible = true;
				}
				butt.onRelease = function() {
					foon.unloadMovie();
					bigLoader.unloadMovie();
					this.enabled = false;
					this._visible  = false;
					trace(this.btnn);
					_root.butt.btnn.removeMovieClip();
					trace(this.btnn);
					geo.enabled = true;
					logics.enabled = true;
					clw.enabled = true;
					rival.enabled = true;
					proiz.enabled = true;
 
				}
			}
			rrr = line+1;
			bb = j*rrr*80;
			this.Root._y = bb
			trace("ОТСТУП "+bb);
			this.textBox._y = bb+80;
 
 
		}
				} else {
				trace("не удалось загрузить");
			}
 
 
	}
xml_source.load("stech/st.xml");
Происходит это здесь:
Код AS1/AS2:
this.newClip.onRelease = function() {
					//foon.unloadMovie();
					foon.attachMovie("fon","fon0",100);
					loadVariablesNum("stech/tech1/logo1.txt",this.getNextHighestDepth());
					bigLoader._x = 210;
					bigLoader._y = 100;
					bigLoader.createEmptyMovieClip("btn",this.getNextHighestDepth());
					butt.attachMovie("btn","btnn",this.getNextHighestDepth());
					butt._x = 740;
					butt._y = 105;
					butt.enabled = true;
					butt._visible = true;
				}
С помощью loadVariablesNum.
Но, текст не отображается никак.
Не могу понять, в чем дело


Последний раз редактировалось Altera Pars; 17.07.2009 в 21:27.
Старый 18.07.2009, 00:00
silin вне форума Посмотреть профиль Посетить домашнюю страницу silin Найти все сообщения от silin
  № 2  
Ответить с цитированием
silin
 
Аватар для silin

блогер
Регистрация: Mar 2003
Адрес: Моск. обл.
Сообщений: 5,269
Записей в блоге: 6
не стал разбираться где что должно отображаться, но есть подозрение что ты не по делу используешь loadVariablesNum
она грузит переменные из файла в указанный левел плеера, а у тебя там this.getNextHighestDepth() - глубина мувика, т.е. если ты ждешь переменные в руте или мувике на этой глубине, то зря..
пользуй LoadVars, он удобнее для этих целей

Создать новую тему Ответ Часовой пояс GMT +4, время: 17:05.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 17:05.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.