# Getting undefined back for an array value

**URL:** <https://forum.kirupa.com/t/getting-undefined-back-for-an-array-value/213929>\
**Category:** flash\
**Created:** [January 24, 2007, 11:10am UTC](https://forum.kirupa.com/t/getting-undefined-back-for-an-array-value/213929 "2007-01-24T11:10:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenisfam](https://avatars.discourse-cdn.com/v4/letter/k/b9bd4f/32.png) [@kenisfam](https://forum.kirupa.com/u/kenisfam)\
**Post date:** [January 24, 2007, 11:10am UTC](https://forum.kirupa.com/t/getting-undefined-back-for-an-array-value/213929/1 "2007-01-24T11:10:25Z")

</div>

Hi folks,

This is really weird,  
im getting undefined back for my link value.

pal.onPress = function(){  
getURL(links[counter],"\_self");  
trace(links[counter]);

// here is my problem

// gives undefined  
}

my code:

```auto
 
 
var textarray = new Array ('inicio','quien somos','donde estamos','contactenos','busca trabajo');
var mylinks = new Array('index.html','quienes-somos.html','donde-estamos.html','contactenos.html','busca-trabajo.html');
 
 
MovieClip.prototype.ease = function(to:Number , speed:Number ){ 
var previousPosition:Number = this._x; 
if( isNaN( speed ) || Number(speed) !== speed || speed <= 1 ) speed = 1.2; 
this.onEnterFrame = function(){ 
holdme = to-(to - this._x);
 
this._x = (holdme/speed)+130; 
if( this._x == previousPosition ){ 
this._x = to - 130; 
delete this.onEnterFrame; 
} 
previousPosition = this._x ; 
} 
} ;
 
MovieClip.prototype.makeVisible = function() {
    clearInterval(this.interval);
    this._visible = true;
    this.play();
};
 
 
function AttachMc(counter)
{
 
 pal = Container.attachMovie("twee","item"+counter, counter);
return pal;
}
itemspacing = 130;
counter = 0;
for (var x=0; x < 5; x++)
{
 var pal = AttachMc(counter);
 
 //trace (pal.btntxt.instance+counter.text + textarray[counter]);
       pal.btntxt.text = textarray[counter];  
 
 pal._x = counter * 130;
 trace (pal._x);
 pal.stop()
    pal._visible = false;
 pal.interval = setInterval(pal, "makeVisible", 1000*counter);
 trace(counter);
 
  pal.onRollOver = function() {
  this._alpha = 70;
// works 
 //this.ease(-10,1); 
}
pal.onPress = function(){ 
getURL(links[counter],"_self"); 
trace(links[counter]);
 
// here is my problem
 
// gives undefined
 
 
 
 
 
} 
pal.onRollOut = function() {
  this._alpha = 100;
 this.ease(10,1); 
 // works
}
 counter++;
}

```

Thanks for looking,

Luck
