Показать сообщение отдельно
Старый 01.08.2005, 14:23
Der Grossen вне форума Посмотреть профиль Отправить личное сообщение для Der Grossen Посетить домашнюю страницу Der Grossen Найти все сообщения от Der Grossen
  № 3  
Ответить с цитированием
Der Grossen
 
Аватар для Der Grossen

Регистрация: Jun 2005
Адрес: spb
Сообщений: 84
Офигенный пример из хэлпа к Flash MX Pro 7.2

Код:
this.createTextField("output_txt", this.getNextHighestDepth(), 0, 0, 300, 200);
output_txt.multiline = true;
output_txt.wordWrap = true;
output_txt.border = true;
output_txt.type = "input";
output_txt.text = "Enter your text here";
var my_cm:ContextMenu = new ContextMenu();
my_cm.customItems.push(new ContextMenuItem("Uppercase...", doUppercase));
function doUppercase():Void {
  var startIndex:Number = Selection.getBeginIndex();
  var endIndex:Number = Selection.getEndIndex();
  var stringToUppercase:String = output_txt.text.substring(startIndex, endIndex);
  output_txt.replaceText(startIndex, endIndex, stringToUppercase.toUpperCase());
}
output_txt.menu = my_cm;