# Array function not working!

**URL:** https://forum.kirupa.com/t/array-function-not-working/270065
**Category:** Uncategorized
**Created:** [September 4, 2008, 8:58pm UTC](https://forum.kirupa.com/t/array-function-not-working/270065 "2008-09-04T20:58:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)
#### Post date: [September 4, 2008, 8:58pm UTC](https://forum.kirupa.com/t/array-function-not-working/270065/1 "2008-09-04T20:58:38Z")

</div>

i have the following 2 functions

```auto

function peopleOffBus():Void {
    
    for (var i:Number = 0; i<21; i++) {
        this["p"+i]._visible = false;
        this["p"+i].id = i;
    }
}

function peopleOnBus():Void {
    trace("yo");
    for (var i:Number = 0; i<21; i++) {
        this["p"+i]._visible = true;
        this["p"+i].id = i;
    }
}

```

when i called the first function it works… peopleOffBus(); but then when i call the other function to make p visible true, the function peopleOnBus(); doesn’t work… it is calling the function but somehow my array is not working or something… not sure… any ideas?
