|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
else if not working
on my movie I have buttons that move when clicked and then move again when clicked and so on. I have used the if command which is working but for some reason the else if is not. What should I be looking for to fix the mistake? if you think you can help i will send the swf. Thank you!
|
|
#2
|
|||
|
|||
|
why not post some code or pseudo code that is not working?
Code:
var bret="dork";
if(bret == "dork"){
trace("bret is a dork");
} else if(bret == "dorkus"){
trace("bret is a big dorkus");
} else {
trace("bret is not a dork");
}
-bret |
|
#3
|
|||
|
|||
|
The code looks something like this:
on (release){ if (_root.movPH._currentframe=1){ _root.movPH.gotoAndPlay("original"); _root.movGD.gotoAndPlay("original"); _root.movCT.gotoAndPlay("original"); _root.movNM.gotoAndPlay("original"); } else if(_root.movPH._currentframe=42){ _root.movPH.gotoAndPlay("blank"); _root.movGD.gotoAndPlay("static"); _root.movCT.gotoAndPlay("blank"); _root.movNM.gotoAndPlay("static"); } else if(_root.movPH._currentframe=50){ _root.movPH.gotoAndPlay("original"); _root.movGD.gotoAndPlay("original"); _root.movCT.gotoAndPlay("original"); _root.movNM.gotoAndPlay("original"); } Each movie clip has a button embedded in it and the action is on the button. So when a button is clicked they each do soemthing different. Lemme know if you can help. Thanks! |
|
#4
|
|||
|
|||
|
when you are comparing two results, you need to use the double equals notation, otherwise, you are just setting the variable in each if statement (which always returns true).
Notice in my if statements, i have "==". Chance yours to that and it should work as planned. -bret |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > else if not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|