1 Reply Latest reply on May 15, 2006 10:00 AM by kglad

    Array.prototype problems

      i wrote an array.prototype function which added an unique element, but then all the comboboxes behaved strange. i tracked the problem down to this

      Array.prototype.doesntmatter = function(element) {
      for (var i in element) {
      trace(i + ' ' + element );
      this.push('wuzaa'); // this adds extra lines on combobox component. doesn't work with this[this.length] either

      , and add a combobox named list1. somehow, this function is called whenever i click on the combo, (which add extra items) and afterwards every time i hit a key. outputs things like this

      target _level0.depthChild0
      type reveal

      target _level0.list1
      type keyDown
      code 17
      ascii 0
      shiftKey false
      ctrlKey true

      does somebody know how to fix this, other than creating a function with the array and new element as parameters?
      flash mx 2004, v7.2