var someValue:Number = 0;
var undesiredValues:Array = [12, 34, 21, 46, 52];

function getUpdatedValue(originalValue:Number):Number
{
  var updatedValue:Number = originalValue++;
  var isUpdatedValueUndesired:Boolean = false;
  this.undesiredValues.sort(Array.NUMERIC);
  for (var index:Number = 0; index < this.undesiredValues.length; index++)
  {
    if (this.undesiredValues[index] == updatedValue)
    {
      isUpdatedValueUndesired = true;
      break;
    }
  }
  return isUpdatedValueUndesired ? originalValue : updatedValue;
}

this.someValue = this.getUpdatedValue(this.someValue);


-
Jason
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to