Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 17th, 2003, 03:07 AM
Rocca Rocca is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: switzerland
Posts: 12 Rocca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old November 17th, 2003, 08:05 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
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

Reply With Quote
  #3  
Old November 17th, 2003, 10:12 AM
Rocca Rocca is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: switzerland
Posts: 12 Rocca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thx it helps...
Finally i found a total different way to do what i wanted.
Thx anyway.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Problem with if (...) {gotoAndStop(...);}


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway