# For and with statements

**URL:** https://forum.kirupa.com/t/for-and-with-statements/195619
**Category:** flash
**Created:** [August 1, 2006, 11:03pm UTC](https://forum.kirupa.com/t/for-and-with-statements/195619 "2006-08-01T23:03:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![brndn](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@brndn](https://forum.kirupa.com/u/brndn)
#### Post date: [August 1, 2006, 11:03pm UTC](https://forum.kirupa.com/t/for-and-with-statements/195619/1 "2006-08-01T23:03:13Z")

</div>

Hey can any tell me why this is not working?  
It sould correspond with the maskbttn being on frame 2  
that the dot will be visilbe

```auto

_root.validate.onPress = function() {
    for (i=1; i<19; i++) {
        with (["maskbttn"+i]._currentframe == 2) {
            _root["dot"+i]._alpha = 100;
        }
    }
};

```

or in a long version

```auto

_root.validate.onPress = function() {
       if maskbttn1._currentframe == 2) {
           _root.dot1._alpha = 100;

   if maskbttn2._currentframe == 2) {
            _root.dot2._alpha = 100;

   if maskbttn3._currentframe == 2) {
            _root.dot3._alpha = 100;

```
