|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with if (...) {gotoAndStop(...);}
Hello,
i'm having trouble with Flash code... I want to have a mask that follow the mouse (that works fine), but i also want that depending on the position of the mouse the movie goes to a specific frame. Here is the code i use: onClipEvent (enterFrame) { _x+=(_parent._xmouse-_x)*.5; _y+=(_parent._ymouse-_y)*.5; if (_x<210) { if (_y<180) {gotoAndStop(57);} if (_y>180) { if (_y<330) {gotoAndStop(58);}}} if (_y>330) {gotoAndStop(59);} } } I can't understand why this isn't woking. Anyone has an idea? If you anyone could help me it would be much appreciated. |
|
#2
|
|||
|
|||
|
Hi, its a little hard to tell exactly what your doing. I copied your code into flash and it had a bit of a problem with the number of closing braces you had used. maybe that was a problem when you typed it in here though. I played with the code snippet a bit:
onClipEvent (enterFrame) { _x += (_parent._xmouse-_x)*.5; _y += (_parent._ymouse-_y)*.5; if (_x<210) { if (_y<180) { gotoAndStop(57); } if (_y>=180) { if (_y<330) { gotoAndStop(58); } else { gotoAndStop(59); } } } } I noticed that you didnt deal with 180. you said if it was above or below but not if it was equal to. the last if statement(jump to 59 one) was outside the x<210 condition. dont know if this is what you want. hope it helps -Tann |
|
#3
|
|||
|
|||
|
Thx it helps...
Finally i found a total different way to do what i wanted. Thx anyway. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Problem with if (...) {gotoAndStop(...);} |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|