3 Replies Latest reply on Sep 6, 2007 8:53 PM by kglad

    onRollOver function within a for loop not working.

    PKENGLISH
      I am trying to call button names from an array. I can get the button names to work but from within the function it calls onRollOver my i value does not work (See code below)

      buttons = new Array(blog, contact... etc);

      for(i=0; i<buttons.length; i++){
      this.buttons .onRollOver = function(){
      hover_on = "btn"+i; //this is where my i value doesn't appear
      }

      this.buttons
      .onRollOut = function(){
      hover_on = "none";
      }

      if("btn"+i == hover_on){
      this.button .gotoAndPlay(_currentframe+1); //animates button when rolled over
      }

      Is there a way to make my i value transfer into the onrollover function or another way to replicate what I'm doing? Thanks!