# Works = False :(

**URL:** <https://forum.kirupa.com/t/works-false/21403>\
**Category:** flash\
**Created:** [May 21, 2003, 9:57am UTC](https://forum.kirupa.com/t/works-false/21403 "2003-05-21T09:57:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![beanboy](https://avatars.discourse-cdn.com/v4/letter/b/91b2a8/32.png) [@beanboy](https://forum.kirupa.com/u/beanboy)\
**Post date:** [May 21, 2003, 9:57am UTC](https://forum.kirupa.com/t/works-false/21403/1 "2003-05-21T09:57:01Z")

</div>

Hello,

I have only been using flash for 4 days so excuse my Excuse the crap syntax, I cannot remember my actual code and I am only interested in the concept for the moment.

Anyway, I have some buttons that call a main function called **‘status’** and set a variable (image) that is the file location of a jpeg. The jpeg (loaded into a MC called myclip) scrolls down after it has loaded by calling a function called **movedown** and back where it originated with a function called **moveup**.  
Another jpeg cannot load until the original has scrolled back up, this is all done by the **‘status’** function checking if the jpeg has scrolled down by true or false, and if it has (true) it makes it scroll back up to its starting position before it loads in the next jpeg and so on.

## kind of like this:

If down = true  
function moveup()

else

loadmovie (image.myclip)  
function movedown

* * *

The move up function sets: down=false

## the movedown function sets: down=true

The problem is that flash hangs when I run this. I believe that the true and false variables are just creating an endless loop, so how could I do this and make it work?

Cheers!

---

<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:** [May 21, 2003, 10:04am UTC](https://forum.kirupa.com/t/works-false/21403/2 "2003-05-21T10:04:57Z")

</div>

4 days? You must either be really smart, or like a challenge…

I ain’t no flash master, but if you want to check the status of a variable you have to use == instead of a single = (because a single equal assigns information to a variable instead of checking it.)

---

<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:** [May 21, 2003, 10:19am UTC](https://forum.kirupa.com/t/works-false/21403/3 "2003-05-21T10:19:41Z")

</div>

Hi,

So I guess that my statements that check with ‘If’ would have to have == to test the variable, while the others would stay as = to set the variable. Makes sense, but I think that this loop would keep on running, or am I wrong?

Thanks.

---

<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:** [May 21, 2003, 11:19am UTC](https://forum.kirupa.com/t/works-false/21403/4 "2003-05-21T11:19:22Z")

</div>

I have figured this out, instead of using if…else, is this better?

//\* checks the status of down variable  
Switch (down)  
{  
case true:  
moveup(); break;

default:  
loadmovie(image.myclip);  
movedown();  
}

Thanks.

Ps. Am I making any sense here?
