Эффективный Count() == n
тест:
public static bool CountIsEqualTo<T>(this IEnumerable<T> enumerable, int c)
{
using (var enumerator = enumerable.GetEnumerator())
{
for(var i = 0; i < c ; i++)
if (!enumerator.MoveNext())
return false;
return !enumerator.MoveNext();
}
}
вы устанавливаете редактировать значения tabIndex элементов в любое время, когда хотите
, например, устанавливая их одинаковыми для childIndex
for (var i:int=0;i<container.numChildren;++i) {
container.getChildAt(i).tabIndex = i; //=i or anything you want
}
Следующее работает для меня
iButton1.tabIndex = 1;
iButton2.tabIndex = 2;
iButton3.tabIndex = 3;
iButton1.tabEnabled = true;
iButton2.tabEnabled = true;
iButton3.tabEnabled = true;
function fnClick (pME:MouseEvent):void {
iButton1.tabIndex = 3;
iButton2.tabIndex = 2;
iButton3.tabIndex = 1;
}
iButton3.addEventListener(MouseEvent.CLICK, fnClick);
, вы можете скачать образец fla здесь http://matrixoft.infunity.com/agents/calvin/flash/tab.rar
нажмите третью кнопку, и порядок вкладок изменится. Вам может потребоваться «Control-> Disable keyboard shortcuts» при нажатии Ctrl-Enter, чтобы проверить fla