|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Else if statement not working! PLEASE HELP!
Hi All,
I have a menu system that animates as you roll over the button and resets itself when you roll off. The buttons change as to where your mouse has been (for want of a better solution, I have made a movie clip with all the different combinations of animations and labelled them so I can play them when needed). So this code is on the keyframe of the movie clip that holds the buttons and the movie clip with the animation(menubg): Code:
qualbtn.onRollOver = function () {
if (menubg._currentframe == 105 or 120 or 165){
menubg.gotoAndPlay("serv2qual");
} else if (menubg._currentframe == 15 or 60){
menubg.gotoAndPlay("tech2qual");
} else menubg.gotoAndPlay("qualrollover");
}
The code is working for the first line on each button but stops working for the second and third line. Can anyone tell me what might be wrong with this??? Thankyou!! |
|
#2
|
|||
|
|||
|
try this:
qualbtn.onRollOver = function() { if (menubg._currentframe == 105 or 120 or 165) { menubg.gotoAndPlay("serv2qual"); } else if (menubg._currentframe == 15 || menubg._currentframe == 60) { menubg.gotoAndPlay("tech2qual"); } else { menubg.gotoAndPlay("qualrollover"); } }; |
|
#3
|
|||
|
|||
|
Thanks for your help but that didn't work either!
It still doesn't play any of the animations after the IF statement. I've tried so many different combinations and none work - I tried swapping the code around and no matter what, the first animation is the only one that ever gets to play. |
|
#4
|
|||
|
|||
|
Code:
qualbtn.onRollOver = function () {
with(_root){
if (menubg._currentframe == 105 || menubg._currentframe == 120 || menubg._currentframe == 165){
menubg.gotoAndPlay("serv2qual");
} else if (menubg._currentframe == 15 || menubg._currentframe == 60){
menubg.gotoAndPlay("tech2qual");
} else menubg.gotoAndPlay("qualrollover");
}
}
try this. it's alittle bit longer, of course, but it might work. I'm just guessing, but it's probably not working because the script might not be finding the target in the if statement (ie. instead of menubg, use a direct address to the movie clip, _root.menubg, or wherever it is. If this don't work either, email me the file you're working on and I'll have a look. It might just be a matter of structure and location of the movie clips, like I said. |
|
#5
|
|||
|
|||
|
I tried that and it didn't work either - I have attached the file so you can have a look.
Thanks!!! |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Else if statement not working! PLEASE HELP! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|