# Conditional statement problem

**URL:** <https://forum.kirupa.com/t/conditional-statement-problem/241084>\
**Category:** flash\
**Created:** [October 9, 2007, 9:36pm UTC](https://forum.kirupa.com/t/conditional-statement-problem/241084 "2007-10-09T21:36:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![timdenty76](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@timdenty76](https://forum.kirupa.com/u/timdenty76)\
**Post date:** [October 9, 2007, 9:36pm UTC](https://forum.kirupa.com/t/conditional-statement-problem/241084/1 "2007-10-09T21:36:25Z")

</div>

Having trouble with a conditional statement in Flash, although I really can’t see the error.

I’m pulling a number of variables from a text file -

```auto
&color01=3 
&color02=2
&color03=1
etc

```

In flash I have the following code on frame 1:

```auto
loadVariables("data.txt","_root");

```

Then I have a number of MCs to color based on the pulled data. I’ve attached this code to the MCs (where color01 is replaced each time respectively):

```auto
onClipEvent (enterFrame) {
    var my_color:Color = new Color(this);
    if (color01 == '1') {
        my_color.setRGB(0xFF0000);
    } else if (color01 == '2') {
        my_color.setRGB(0x0000FF);
    } else if (color01 == '3') {
        my_color.setRGB(0x00FF00);
    }
}

```

So the data is pulled in, and the color of the MC is changed according to the txt file. Doesn’t work though - even though I know the variables are being passed to Flash as I have a dynamic text field which displays one of the vars.

Any ideas what I am missing?

Thanks
