# Eval() not working

**URL:** <https://discourse.processing.org/t/eval-not-working/34248>\
**Category:** Beginners\
**Created:** [December 22, 2021, 3:36pm UTC](https://discourse.processing.org/t/eval-not-working/34248 "2021-12-22T15:36:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoonAlien822](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Post date:** [December 22, 2021, 3:36pm UTC](https://discourse.processing.org/t/eval-not-working/34248/1 "2021-12-22T15:36:34Z")

</div>

```auto
var x;

var y;
var z;

var alpha;

function setup() {
  createCanvas(600,600);
  
  x = "if(millis() % 1000 = 0){ eval(alpha);}";
  
  y = "hello world";
  z = "text(y, width/2, height/2);";
  
  alpha = "background(random(0,255),random(0,255),random(0,255));";
  
}

function draw() {
  eval(z);
  eval(x);
}

```

this is the code I have so far, the problem is that the background is not changing.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 22, 2021, 3:46pm UTC](https://discourse.processing.org/t/eval-not-working/34248/2 "2021-12-22T15:46:51Z")

</div>

> [@MoonAlien822](#):
>
> `x = "if(millis() % 1000 = 0){ eval(alpha);}";`

`x = "if (millis() % 1000 == 0) eval(alpha);";`

Alternative:  
`x = "millis() % 1000 || eval(alpha)";`
