PDA

View Full Version : Another simple script that doesnt work


2.0 freak
01-17-2005, 02:00 AM
on (release)
{
if (_root.tri_mc._alpha == 0)
{
_root.tri_mc._alpha = 100;
}

if (_root.tri_mc._alpha == 100)
{
_root.tri_mc._alpha = 0;
}
}

Clox
01-17-2005, 02:17 AM
works fine for me.
u sure the path and the name of the mc is right?

2.0 freak
01-17-2005, 02:19 AM
Ya its right, maybee do something else than an if statement, got any ideas?

2.0 freak
01-17-2005, 02:22 AM
Wanted to add: it makes it dissapear but doesnt make it re apear when clicked again

Clox
01-17-2005, 02:25 AM
just noticed it doesnt go visible again.
i worked out why.

first when u click it, it checks if its alpha is 0, and if it is, it changes it to 100. then after it has done that, it checks if the alpha is 100. and if it is, it changes it to 0. so when u click on it when the alpha is 0, both falls true. so it first changes the alpha to 100, and then to 0.

i fixed it like this.
now it will only do the second thing if the first thing is false.

on (release)
{
if (_root.tri_mc._alpha == 0)
{
_root.tri_mc._alpha = 100;
}

else if (_root.tri_mc._alpha == 100)
{
_root.tri_mc._alpha = 0;
}
}


there u go =)