Works = False :(

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!

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.)

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.

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?