# \[FMX\] dynamic if problem

**URL:** <https://forum.kirupa.com/t/fmx-dynamic-if-problem/23860>\
**Category:** flash\
**Created:** [June 23, 2003, 1:59pm UTC](https://forum.kirupa.com/t/fmx-dynamic-if-problem/23860 "2003-06-23T13:59:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dns](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@dns](https://forum.kirupa.com/u/dns)\
**Post date:** [June 23, 2003, 1:59pm UTC](https://forum.kirupa.com/t/fmx-dynamic-if-problem/23860/1 "2003-06-23T13:59:36Z")

</div>

I tried to make a dynamic if, but it just doesn’t work…

line = “a == 1”  
for (i = 2; i\<=5;i++){  
line += " || a == " + i;  
}

a = 1;  
if (line) {  
trace(“works”)  
}

but if I use the concatenated final line, it works:

line = “a == 1”  
for (i = 2; i\<=5;i++){  
line += " || a == " + i;  
}  
a = 1;  
if (a == 1 || a == 2 || a == 3 || a == 4 || a == 5) {  
trace(“works”)  
}

who knows what’s going on??

---

<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:** [June 23, 2003, 3:01pm UTC](https://forum.kirupa.com/t/fmx-dynamic-if-problem/23860/2 "2003-06-23T15:01:40Z")

</div>

what im sure of is your second one is always going to return an ok value:

```auto
line = "a == 1"
for (i = 2; i<=5;i++){
line += " || a == " + i;
}
a = 1;
if (a == 1 || a == 2 || a == 3 || a == 4 || a == 5) {
trace("works")
}

```

since you tell flash that a=1 and then say if a ==1 then trace “works”

the problem is that:

```auto

line += " || a == " + i

```

it’s supposed to turn into a true of false argument, there it will turn into a string text since you have to brackets

try to do that:

```auto

line = "a == 1"
for (i = 2; i<=5;i++){
line += " || a == " + i;
// i added this line below, to check what
//the 'line' var becomes
trace(line)
}

a = 1;
if (line) {
trace("works")
}

```
