ComboBoxHelper.as 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.imt.intimamedia.helpers
  2. {
  3. import mx.collections.ArrayCollection;
  4. import mx.controls.Alert;
  5. public class ComboBoxHelper
  6. {
  7. public function ComboBoxHelper()
  8. {
  9. }
  10. public static function findIndex( value: Object, provider : ArrayCollection ) : int
  11. {
  12. var index : int = 0;
  13. for each( var object : Object in provider )
  14. {
  15. if( object.code == value )
  16. {
  17. return index;
  18. }
  19. index++;
  20. }
  21. return -1;
  22. }
  23. public static function findIndexFromLabel( value: Object, provider : ArrayCollection ) : int
  24. {
  25. var index : int = 0;
  26. for each( var object : Object in provider )
  27. {
  28. if( object.label == value )
  29. {
  30. return index;
  31. }
  32. index++;
  33. }
  34. return -1;
  35. }
  36. }
  37. }