# Compare 2 values in if statement

**URL:** <https://forum.kirupa.com/t/compare-2-values-in-if-statement/274056>\
**Category:** Uncategorized\
**Created:** [October 24, 2008, 8:45am UTC](https://forum.kirupa.com/t/compare-2-values-in-if-statement/274056 "2008-10-24T08:45:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakepeg](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@jakepeg](https://forum.kirupa.com/u/jakepeg)\
**Post date:** [October 24, 2008, 8:45am UTC](https://forum.kirupa.com/t/compare-2-values-in-if-statement/274056/1 "2008-10-24T08:45:33Z")

</div>

hi

whats wrong here?

```auto

if (_root.txt_1_a == _root.section_btn){
    trace("match");
}
trace(_root.txt_1_a);
trace(_root.section_btn);

```

the output is:

item\_1  
item\_1

but if I do it like this it does work…

```auto

if ("item_1" == "item_1"){
    trace("match");
}
trace(_root.txt_1_a);
trace(_root.section_btn);

```

the output it this:

match  
item\_1  
item\_1
