PDA

View Full Version : Problems with IF/Else


Nite
11-24-2003, 01:11 AM
I am trying to get a movie clip to disappear after a certain number of clicks.I am new at actionscripting so I am having a little bit of problem with the code. Here is the if else code I am using right now.
newcount=0
count=0

thickver_mc.onPress= function(){
if(newcount = 10){
thickver_mc._visible = false;
}else{
newcount = count+1;
}
}




Please use the proper code syntax to format the code.
Read this page (http://www.actionscript.org/forums/misc.php3?action=bbcode#buttons) to find out more about the tag information

oldnewbie
11-24-2003, 01:16 AM
Setting a variable requires only 1 "=", but a conditional if statement requires 2 "=="...

thickver_mc.onPress= function(){
if(newcount == 10){
thickver_mc._visible = false;
} else {
newcount = count+1;
// or simply... newcount +=1;
}
};

Nite
11-24-2003, 01:54 AM
Excellent, that nailed it now it works. Thanks man I really appreciate the help.