# Array STUCK! HelP!

**URL:** https://forum.kirupa.com/t/array-stuck-help/14168
**Category:** Uncategorized
**Created:** [February 22, 2003, 8:09pm UTC](https://forum.kirupa.com/t/array-stuck-help/14168 "2003-02-22T20:09:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![indojepang](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/indojepang/32/39_2.png) [@indojepang](https://forum.kirupa.com/u/indojepang)
#### Post date: [February 22, 2003, 8:09pm UTC](https://forum.kirupa.com/t/array-stuck-help/14168/1 "2003-02-22T20:09:15Z")

</div>

I’m Stuck!!! please help me guys…

I want to make an ARRAY for this :

pos1 = mask.\_x-(0_holder.mc1.\_width);  
pos2 = mask.\_x-(1_holder.mc1.\_width);  
pos3 = mask.\_x-(2\*holder.mc1.\_width);  
b1.onRelease = function() {  
holder.slideX(pos1);  
};  
b2.onRelease = function() {  
holder.slideX(pos2);  
};  
b3.onRelease = function() {  
holder.slideX(pos3);  
};

but I always got the wrong results, help me please… thank u…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 26, 2003, 1:00pm UTC](https://forum.kirupa.com/t/array-stuck-help/14168/2 "2003-02-26T13:00:06Z")

</div>

hi  
i’m kind of newbie in flash but from what i see in your code i can tell you this:

1st- i don’t see any reference to an array,that is to make an array in flash action script you have to follow this steps

```
   -declare the array
        myarray=new array(number of items) or array 
        ("item1","item2","item3")
       
    -then you assingn data to your array this way
          myarray[1]=mydata; and so on the [1] is the position within the array where your data will be kept

     -to get your data out from the array you do this

           for example to assign a variable x the value of the 1st element in the array
                   x=myarray[1]

```

hope i was helpful  
bye

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 26, 2003, 3:38pm UTC](https://forum.kirupa.com/t/array-stuck-help/14168/3 "2003-02-26T15:38:37Z")

</div>

Maybe something like this:

```auto
pos=new Array();
for (var j=0;j<3;j++){
  pos[j] = mask._x-(j*holder.mc1._width);
}
b1.onRelease = function() {
	holder.slideX(pos[0]);
};
b2.onRelease = function() {
	holder.slideX(pos[1]);
};
b3.onRelease = function() {
	holder.slideX(pos[2]);
};

```

pom 🙂
