SunQuest
           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 August 25th, 2003, 11:41 AM
jessicuh jessicuh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 jessicuh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Limiting a scroll using onEnterFrame

Hello all and thanks for checking this post out.
I have a scroll set up so that certain parts of a movie are "masked" out but can be scrolled to. I have 4 buttons to scroll north, south, east and west.

Example...
To scroll west I have this code:
on (press) {
delta_y = 0;
delta_x = 10;
}
on (release) {
delta_x = 0;
}

In Frame 1, I have this code ("map2" being the movieclip which is actually scrolling under the mask):
map2._y = map2._y+delta_y;
map2._x = map2._x+delta_x;

Right now, it will scroll as long as I have my mouse held down which ends up just displaying the bk color. I have been informed that I must use an onenterFrame command to check the position of the map2 movieclip before starting the movement. I have no experience with this command and am having a hard time even figuring out the correct syntax in writing. Does anyone have any advice for writing the onEnterFrame part?

Thanks so much!

Reply With Quote
  #2  
Old August 26th, 2003, 12:02 PM
dkkz dkkz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 50 dkkz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
put a limits on _x and _y.

here's an example to start you off:

// define the minimums and maximums
minX = -80;
maxX = 200;
minY = 0;
maxY = 350;

// if object reaches limits
if (map2._x >= maxX){
map2._x = maxX;
}

..... and so forth and so on.

Reply With Quote
  #3  
Old August 26th, 2003, 01:36 PM
jessicuh jessicuh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 jessicuh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks so much. I'm still having problems. This is driving me nuts.

So here's what I did....

In Frame 1 of my movie, I declared the variables for minX, etc.

Then on my button to scroll west, I wrote this:
on (press) {
while (map2._x>=minX) {
delta_y = 0;
delta_x = 10;
}
}
on (release) {
delta_x = 0;
}

I don't understand why this doesn't work. It seems like the logic is pretty simple. But it NEVER stops scrolling while your holding the button down.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Limiting a scroll using onEnterFrame


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 3 hosted by Hostway