Показать сообщение отдельно
Старый 27.03.2012, 09:44
Inet_PC вне форума Посмотреть профиль Отправить личное сообщение для Inet_PC Посетить домашнюю страницу Inet_PC Найти все сообщения от Inet_PC
  № 4  
Ответить с цитированием
Inet_PC
 
Аватар для Inet_PC

Регистрация: Feb 2009
Адрес: Гы...поди, найди!
Сообщений: 853
Записей в блоге: 1
Как-то так:
Код AS3:
private var textArray: Array = [];
//...
for (var i:int = 0; i < xml.news.item.length(); i++) 
{
 
	//Creating the textfield object and naming it "myTextField"  
	var myTextField:TextField = new TextField();  
 
	//Here we add the new textfield instance to the stage with addchild()  
	page_mc.addChild(myTextField);  
	//textArray.push(myTextField);
 
	//Here we define some properties for our text field, starting with giving it some text to contain.  
	//A width, x and y coordinates.  
	//myTextField.name = i;
	myTextField.htmlText = XML(xml.news).item[i].zag;
	myTextField.width = 250;  
 
	if (i == 0) 
	{ 
		myTextField.x = int(myTextField.width / 2 - myTextField.width + stage.stageWidth / 2) - 211;
		myTextField.y = int(myTextField.height / 2 - myTextField.height + stage.stageHeight / 2) + 70;
	}
	if (i == 1) 
	{ 
		myTextField.x = int(myTextField.width / 2 - myTextField.width + stage.stageWidth / 2) + 174;
		myTextField.y = int(myTextField.height / 2 - myTextField.height + stage.stageHeight / 2) + 70;
	}
	if (i == 2) 
	{ 
		myTextField.x = int(myTextField.width / 2 - myTextField.width + stage.stageWidth / 2) - 205;
		myTextField.y = int(myTextField.height / 2 - myTextField.height + stage.stageHeight / 2)+230;
	}
	if (i == 3) 
	{ 
		myTextField.x = int(myTextField.width / 2 - myTextField.width + stage.stageWidth / 2) + 174;
		myTextField.y = int(myTextField.height / 2 - myTextField.height + stage.stageHeight / 2) + 230;
	}
	//
	//myTextField.alpha = 0;
 
//Here are some great properties to define, first one is to make sure the text is not selectable, then adding a border.  
	myTextField.selectable = false;  
	myTextField.border = false;  
 
//This last property for our textfield is to make it autosize with the text, aligning to the left.  
	myTextField.autoSize = TextFieldAutoSize.LEFT;  
 
//This is the section for our text styling, first we create a TextFormat instance naming it myFormat  
 
	var myFormat:TextFormat = new TextFormat();  
 
//Giving the format a hex decimal color code  
	myFormat.color = 0x000000;  
 
	myFormat.font = "Myriad Pro";
 
//Adding some bigger text size  
	myFormat.size = 14;  
 
//Last text style is to make it italic.  
	myFormat.bold = true;  
 
//Now the most important thing for the textformat, we need to add it to the myTextField with setTextFormat.  
	//myTextField.setTextFormat(myFormat);
 
 
 
	textArray.push(myTextField);
				////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
 
//....
textArray[0].x = 500;
__________________
http://www.chessmax.ru