# Q: Help on multiple buttons\_loop\_arrays

**URL:** <https://forum.kirupa.com/t/q-help-on-multiple-buttons-loop-arrays/278564>\
**Category:** flash\
**Created:** [January 1, 2009, 10:58pm UTC](https://forum.kirupa.com/t/q-help-on-multiple-buttons-loop-arrays/278564 "2009-01-01T22:58:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nolomaru](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@nolomaru](https://forum.kirupa.com/u/nolomaru)\
**Post date:** [January 1, 2009, 10:58pm UTC](https://forum.kirupa.com/t/q-help-on-multiple-buttons-loop-arrays/278564/1 "2009-01-01T22:58:54Z")

</div>

Hello friends, i`m a simple user of as2. Now when beginning a new year, I would want to begin to know a little more as3(because as3 is very powerfull)  
but i have a mega problem ☹

i  
my

in AS2 I wrote of the following way:

ap…of course…i work in timeline, and buttons on stage

```auto

myURLs = new Array("www.google.com","www.altavista.com",....) 
for (var i = 1; i<7; i++) { 
   var btn = this["but"+i]; 
   btn.id = i; 
   btn.url=myURLs* 

   btn.onRelease = function() { 
      trace(this.id)
      getURL(this.url) 
   } 

 btn.onRollOver = function() { 
      this.gotoAndPlay(2)
   } 

} 

deactivateItem=function(boton){ 
  for (var i = 1; i<7; i++) { 
    var btn = this["but"+i]; 
    if (btn==boton){ 
           btn.enabled=false
           btn._alpha=50
    }else{ 

           btn.enabled=true 
           btn._alpha=100 
    } 
  } 
} 

   btn.onRelease = function() { 
             deactivateItem(this) 
   }

```

i know the basic way to call button in as3  
//\*\*\*over mc1  
function OverFunction(event:MouseEvent):void {  
MC1.gotoAndPlay(2)  
}  
MC1.addEventListener(MouseEvent.MOUSE\_OVER, OverFunction);

but i don`t know some way for work with arrays and loops

thanks in advance for any assistance  
sorry for mi english…and…  
happy new year for all  
🙂
