Skip to main content
Inspiring
May 2, 2006
Question

building a "switch" condition

  • May 2, 2006
  • 1 reply
  • 205 views
Hiya!

Im trying to build a little "switch" function, similiar to this one...

on(release) {
if(testing = "a"){
testing = "b"
} else {
testing = "a"
}
}

The result will always return "a"
its annoying

Any tips?
This topic has been closed for replies.

1 reply

Inspiring
May 2, 2006
Yes. I've done this many times myself.

When doing a comparison you need to use the comparison operator not the assignment operator. In other words.

if(testing="a")

is not the same as

if(testing == "a")

It will make all the difference.