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

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

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 03.03.2007, 14:00
enepx вне форума Посмотреть профиль Отправить личное сообщение для enepx Посетить домашнюю страницу enepx Найти все сообщения от enepx
  № 1  
Ответить с цитированием
enepx
 
Аватар для enepx

Регистрация: Aug 2006
Адрес: Мюнхен
Сообщений: 509
Отправить сообщение для enepx с помощью ICQ Отправить сообщение для enepx с помощью Yahoo Отправить сообщение для enepx с помощью Skype™
Question второй ComboBox тормозит при складывании

Есть два ComboBox'а area_combobox и carrier_combobox. Присваиваю им свойства так:
Код:
...
function setComboBoxStyle(target:ComboBox) {
	target.setStyle("themeColor","haloGreen");
	target.setStyle("selectionColor",0xF7C655);
	target.setStyle("rollOverColor",0xF9D686);
	target.setStyle("borderStyle", "alert");
	target.setStyle("backgroundColor", 0xFFFACA);
	target.setStyle("fontFamily", "Verdana");
	target.setStyle("fontWeight", "bold");
	target.setStyle("fontSize", 12);
	target.setStyle("color", 0x547700);
	target.setStyle("textSelectedColor", 0x764701);
	target.setStyle("textRollOverColor", 0x764701);
	target.setStyle("marginLeft", 5);
	target.setStyle("openDuration", 200);
	target.setStyle("openEasing", Bounce.easeIn);
}
...
setComboBoxStyle(area_combobox);
setComboBoxStyle(carrier_combobox);
...
Все нормально, только вот второй (carrier_combobox) тормозит при складывании. Не могу понять, ведь первый комбик работает на ура!

Старый 03.03.2007, 14:07
etc вне форума Посмотреть профиль Найти все сообщения от etc
  № 2  
Ответить с цитированием
etc
Et cetera
 
Аватар для etc

Регистрация: Sep 2002
Сообщений: 30,787
Показывай исходник.

Старый 03.03.2007, 15:08
enepx вне форума Посмотреть профиль Отправить личное сообщение для enepx Посетить домашнюю страницу enepx Найти все сообщения от enepx
  № 3  
Ответить с цитированием
enepx
 
Аватар для enepx

Регистрация: Aug 2006
Адрес: Мюнхен
Сообщений: 509
Отправить сообщение для enepx с помощью ICQ Отправить сообщение для enepx с помощью Yahoo Отправить сообщение для enepx с помощью Skype™
да в исходнике вроде ничего нету страшного:
все что я делаю с комбами - это заполняю их из xml. может это из-за того, что я это делаю в первом кадре и он циклится? щас проверю )

Старый 03.03.2007, 15:09
etc вне форума Посмотреть профиль Найти все сообщения от etc
  № 4  
Ответить с цитированием
etc
Et cetera
 
Аватар для etc

Регистрация: Sep 2002
Сообщений: 30,787
Вот в этих троеточиях ищи ошибку.

Старый 03.03.2007, 15:10
enepx вне форума Посмотреть профиль Отправить личное сообщение для enepx Посетить домашнюю страницу enepx Найти все сообщения от enepx
  № 5  
Ответить с цитированием
enepx
 
Аватар для enepx

Регистрация: Aug 2006
Адрес: Мюнхен
Сообщений: 509
Отправить сообщение для enepx с помощью ICQ Отправить сообщение для enepx с помощью Yahoo Отправить сообщение для enepx с помощью Skype™
Cool исходник

проверил, не так...
Код:
stop();

import mx.controls.TextInput;
import mx.controls.ComboBox;
import mx.controls.Button;

function setTextInputStyle(target:TextInput) {
	target.setStyle("borderStyle", "alert");
	target.setStyle("borderColor", 0x363C0B);
	target.setStyle("backgroundColor", 0xFFFACA);
	target.setStyle("fontFamily", "Verdana");
	target.setStyle("fontWeight", "bold");
	target.setStyle("fontSize", 12);
	target.setStyle("color", 0x547700);
}
function setTextInputPhoneStyle(target:TextInput) {
	target.setStyle("borderStyle", "alert");
	target.setStyle("borderColor", 0x363C0B);
	target.setStyle("backgroundColor", 0xFFFACA);
	target.setStyle("fontFamily", "Verdana");
	target.setStyle("fontWeight", "bold");
	target.setStyle("fontSize", 20);
	target.setStyle("color", 0x547700);
}
function setComboBoxStyle(target:ComboBox) {
	target.setStyle("themeColor","haloGreen");
	target.setStyle("selectionColor",0xF7C655);
	target.setStyle("rollOverColor",0xF9D686);
	target.setStyle("borderStyle", "alert");
	target.setStyle("backgroundColor", 0xFFFACA);
	target.setStyle("fontFamily", "Verdana");
	target.setStyle("fontWeight", "bold");
	target.setStyle("fontSize", 12);
	target.setStyle("color", 0x547700);
	target.setStyle("textSelectedColor", 0x764701);
	target.setStyle("textRollOverColor", 0x764701);
	target.setStyle("marginLeft", 5);
	target.setStyle("openDuration", 200);
	target.setStyle("openEasing", Bounce.easeIn);
}
function setButtonStyle(target:Button) {
	target.setStyle("borderStyle", "alert");
	target.setStyle("borderColor", 0x363C0B);
	target.setStyle("backgroundColor", 0xFFFACA);
	target.setStyle("fontFamily", "Verdana");
	target.setStyle("fontWeight", "bold");
	target.setStyle("fontSize", 13);
	target.setStyle("color", 0x547700);
}
setTextInputStyle(name_edit1);
setTextInputStyle(name_edit2);
setTextInputPhoneStyle(phone_edit1);
setTextInputPhoneStyle(phone_edit2);
setTextInputPhoneStyle(phone_edit3);
setComboBoxStyle(area_combobox);
setComboBoxStyle(carrier_combobox);
setButtonStyle(send_btn);
//setButtonStyle(unsubscribe_btn);
//unsubscribe_btn.setStyle("fontWeight", "normal");
name_edit1.setFocus();
name_edit1.tabIndex = 1;
name_edit2.tabIndex = 2;
phone_edit1.tabIndex = 3;
phone_edit2.tabIndex = 4;
phone_edit3.tabIndex = 5;
area_combobox.tabIndex = 6;
carrier_combobox.tabIndex = 7;
send_btn.tabIndex = 8;

var answer_xml:XML = new XML();
answer_xml.ignoreWhite = true;
answer_xml.load("params.xml");
answer_xml.onLoad = function(success:Boolean) {
	trace
	if (success) {
		for (var i=0; i<this.firstChild.childNodes.length; i++) {
			if (this.firstChild.childNodes[i].nodeName=="headline") {
				text_txt.text = this.firstChild.childNodes[i].attributes.text;
				subtext_txt.text = this.firstChild.childNodes[i].attributes.subtext;
			}
			if (this.firstChild.childNodes[i].nodeName=="areas") {
				area_combobox.removeAll();
				area_combobox.addItem({data:0, label:"please select"});
				for (var j=0; j<this.firstChild.childNodes[i].childNodes.length; j++) {
					area_combobox.addItem({data:this.firstChild.childNodes[i].childNodes[j].attributes.id, label:this.firstChild.childNodes[i].childNodes[j].attributes.title});
				}
			}
			if (this.firstChild.childNodes[i].nodeName=="carriers") {
				carrier_combobox.removeAll();
				carrier_combobox.addItem({data:0, label:"please select"});
				for (var j=0; j<this.firstChild.childNodes[i].childNodes.length; j++) {
					carrier_combobox.addItem({data:this.firstChild.childNodes[i].childNodes[j].attributes.id, label:this.firstChild.childNodes[i].childNodes[j].attributes.title});
				}
			}
		}
	} else {trace("INCORRECT LOADING!");trace(answer_xml)}
}

function redBlink(fFields:Array) {
	var p:Number=0;
	hlColor = 0xFED6C5;
	stdColor = 0xFFFACA;
//	trace(fFields);
	this.onEnterFrame = function () {
		if (p==13) {
			delete this.onEnterFrame;
		}
		if (p%3==0) {
			if (fFields[0]=="1") name_edit1.setStyle("backgroundColor",hlColor);
			if (fFields[1]=="1") name_edit2.setStyle("backgroundColor",hlColor);
			if (fFields[2]=="1") phone_edit1.setStyle("backgroundColor",hlColor);
			if (fFields[3]=="1") phone_edit2.setStyle("backgroundColor",hlColor);
			if (fFields[4]=="1") phone_edit3.setStyle("backgroundColor",hlColor);
			if (fFields[5]=="1") area_combobox.setStyle("backgroundColor",hlColor);
			if (fFields[6]=="1") carrier_combobox.setStyle("backgroundColor",hlColor);
		} else {
			if (fFields[0]=="1") name_edit1.setStyle("backgroundColor",stdColor);
			if (fFields[1]=="1") name_edit2.setStyle("backgroundColor",stdColor);
			if (fFields[2]=="1") phone_edit1.setStyle("backgroundColor",stdColor);
			if (fFields[3]=="1") phone_edit2.setStyle("backgroundColor",stdColor);
			if (fFields[4]=="1") phone_edit3.setStyle("backgroundColor",stdColor);
			if (fFields[5]=="1") area_combobox.setStyle("backgroundColor",stdColor);
			if (fFields[6]=="1") carrier_combobox.setStyle("backgroundColor",stdColor);
		}
		p++;
	}
}
function checkEmpty():Boolean {
	var failedFields = new Array(7);
	for (var i=0; i<7; i++) failedFields[i] = "0";
//	trace(failedFields);
	if (name_edit1.text=="") failedFields[0] = "1";
	if (name_edit2.text=="") failedFields[1] = "1";
	if (phone_edit1.text=="") failedFields[2] = "1";
	if (phone_edit2.text=="") failedFields[3] = "1";
	if (phone_edit3.text=="") failedFields[4] = "1";
	if (area_combobox.selectedIndex==0) failedFields[5] = "1";;
	if (carrier_combobox.selectedIndex==0) failedFields[6] = "1";
	
	redBlink(failedFields);

	var flag:Boolean = false;
	for (var i=0; i<7; i++) if(failedFields[i]=="1") flag = true;
	return flag;
}
function onLoginReply() {
//	trace(loginReplyXML);
}

//"continue" button click
send_btn.toggle = true;
var loginForm:Object = new Object(); 
loginForm.click = function(eventObj:Object) {
	eventObj.target.selected = false;
	if (checkEmpty()) return;	//check fields
	loginXML = new XML("<subscribe first_name=\""+name_edit1.text+"\" last_name=\""+name_edit2.text+"\" phone_number=\""+phone_edit1.text+phone_edit2.text+phone_edit3.text+"\" area=\""+area_combobox.selectedItem.data+"\" carrier=\""+carrier_combobox.selectedItem.data+"\" />");
	trace(loginXML);
	loginReplyXML = new XML();
	loginReplyXML.onLoad = onLoginReply;
//	loginXML.sendAndLoad("http://moon/akharitonov/recector/receptor.php",loginReplyXML);
};
send_btn.addEventListener("click", loginForm);
///////////////////////////////

//"phone1" change
var phone1change:Object = new Object(); 
phone1change.change = function(eventObj:Object) {
	eventObj.target.selected = false;
	if (eventObj.target.length == 3) phone_edit2.setFocus();
};
phone_edit1.addEventListener("change", phone1change);
///////////////////////////////

//"phone2" change
var phone2change:Object = new Object(); 
phone2change.change = function(eventObj:Object) {
	eventObj.target.selected = false;
	if (eventObj.target.length == 3) phone_edit3.setFocus();
};
phone_edit2.addEventListener("change", phone2change);
///////////////////////////////

Старый 03.03.2007, 15:12
etc вне форума Посмотреть профиль Найти все сообщения от etc
  № 6  
Ответить с цитированием
etc
Et cetera
 
Аватар для etc

Регистрация: Sep 2002
Сообщений: 30,787
Проверь с одинаково заполненными боксами установку стилей.

Старый 05.03.2007, 13:44
enepx вне форума Посмотреть профиль Отправить личное сообщение для enepx Посетить домашнюю страницу enepx Найти все сообщения от enepx
  № 7  
Ответить с цитированием
enepx
 
Аватар для enepx

Регистрация: Aug 2006
Адрес: Мюнхен
Сообщений: 509
Отправить сообщение для enepx с помощью ICQ Отправить сообщение для enepx с помощью Yahoo Отправить сообщение для enepx с помощью Skype™
пробовал заполнить одинаковым текстом типа:
item1
item2
item3
item4
item5

Один фиг, от данных не зависит ИМХО.

Старый 05.03.2007, 14:01
etc вне форума Посмотреть профиль Найти все сообщения от etc
  № 8  
Ответить с цитированием
etc
Et cetera
 
Аватар для etc

Регистрация: Sep 2002
Сообщений: 30,787
А без стилей всё ОК?
Вообще, давай рабочий исходник.

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

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

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


 


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


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