title: Actionscript error #1056 in flash game
body: <p>I have a flash game and it's showing error in the below code</p>
  
  <pre><code>private function onAddingTimer(event:TimerEvent) : void
         {
             var _loc_2:int = 0;
             var _loc_3:MovieClip = null;
             var _loc_4:MovieClip = null;
             var _loc_5:String = this;
             var _loc_6:* = this.timerAddCounter + 1;
             _loc_5.timerAddCounter = _loc_6;
             this.bonusIntervalDiff = int(this.levelData[this.level].enemyCount / this.levelData[this.level].bonusCount);
             if (this.timerAddCounter &gt;= this.levelData[this.level].createDelay)
             {
                 var _loc_5:String = this;
                 var _loc_6:* = this.timerAddCount + 1;
                 _loc_5.timerAddCount = _loc_6;
                 if (int(this.timerAddCount % this.bonusIntervalDiff) == 0)
                 {
                     _loc_2 = this.rangeRandom(0, this.LIFE_CLASSES.length);
                     trace("Ran:: " + _loc_2);
                     _loc_3 = new this.LIFE_CLASSES[_loc_2].className() as MovieClip;
                     this.spLifeGround.addChild(_loc_3);
                     _loc_3.y = 500;
                     this.previousX = this.rangeRandomWithPreviousDifference(100, 700, 210, this.previousX);
                     _loc_3.x = this.previousX;
                     this.lifes.push({mc:_loc_3, score:this.LIFE_CLASSES[_loc_2].score, cls:this.LIFE_CLASSES[_loc_2].className});
                 }
                 else
                 {
                     _loc_4 = new this.EMENY_CLASSES[this.rangeRandom(0, this.EMENY_CLASSES.length)] as MovieClip;
                     this.spEnemyGround.addChild(_loc_4);
                     _loc_4.y = 450;
                     this.previousX = this.rangeRandomWithPreviousDifference(75, 725, 210, this.previousX);
                     _loc_4.x = this.previousX;
                     this.enemys.push(_loc_4);
                 }
                 this.timerAddCounter = 0;
             }
             return;
         }// end function
  </code></pre>
  
  <p>Error from the console is</p>
  
  <blockquote>
    <p>ReferenceError: Error #1056: Cannot create property timerAddCounter on
    String.
           at JuegoGame/onAddingTimer()
           at flash.utils::Timer/_timerDispatch()
           at flash.utils::Timer/tick()</p>
  </blockquote>
  
  <p>Does any know, why it is not working properly.</p>