LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


  #1  
Old 07-09-2004, 12:57 PM
SRICHARDS00 SRICHARDS00 is offline
Registered User
 
Join Date: May 2004
Location: Detroit, Michigan
Posts: 17
Rep Power: 0
SRICHARDS00 is on a distinguished road
Onmousewheel help!!!

Im pretty much a beginner when i comes to actionscript... so i was wondering if anybody ould help me out with this. I have a movie clip that i want to be scrollable withe the mouse wheel. It works fine but i want to be able to add boundries ont he y axis where it has to stop and wont be able to scroll anymore.

right now i have this code applied to it on my actions layer:

Actionscript:
// Creating the listener object

mouseListener = new Object();

// Create onMouseWheel function


mouseListener.onMouseWheel = function (delta) {
	linksmov._y += delta; 
} 

// Registering the listener to the Mouse object

Mouse.addListener(mouseListener);

/*
so thats the jist of it hope you guys can help me out. Ive included the fla so you guys can see for yourself. If you keep scrolling it just keeps going even off the stage. Make sure that you click on the circle first to enable the mouswheel funciton.

Attached Files
File Type: zip mcwheel roll.zip (4.4 KB, 6 views)
Reply With Quote
  #2  
Old 07-10-2004, 02:27 AM
prisma prisma is offline

Super Moderator
 
Join Date: May 2001
Location: Munich, Germany
Posts: 1,668
Rep Power: 14
prisma is on a distinguished road
Simply add a condition construct:
Actionscript:
mouseListener.onMouseWheel = function (delta) {
   if (((linksmov._y>0) and (delta<0))  or  ((linksmov._y<400) and (delta>0))) {
      linksmov._y += delta;
   }
}
__________________
... take me to your coder.
Reply With Quote
  #3  
Old 07-10-2004, 03:31 AM
SRICHARDS00 SRICHARDS00 is offline
Registered User
 
Join Date: May 2004
Location: Detroit, Michigan
Posts: 17
Rep Power: 0
SRICHARDS00 is on a distinguished road
Rejoice Thanks!!!!!!!!!!!!!!!!!!!!!!!

Thank you much im gonna try this right ow
Reply With Quote
  #4  
Old 07-10-2004, 04:21 AM
SRICHARDS00 SRICHARDS00 is offline
Registered User
 
Join Date: May 2004
Location: Detroit, Michigan
Posts: 17
Rep Power: 0
SRICHARDS00 is on a distinguished road
Works but w/ a problem!

ok so it works fine but with one problem i have multiple movies on different frames that need to be scrollable thing is when i apply the code to a different frame it negates all scrolling.

i switched around the instance names and everyhting but that didnt work any ideas prisma since your the only one that helped me!
Reply With Quote
  #5  
Old 07-10-2004, 06:13 AM
SRICHARDS00 SRICHARDS00 is offline
Registered User
 
Join Date: May 2004
Location: Detroit, Michigan
Posts: 17
Rep Power: 0
SRICHARDS00 is on a distinguished road
Nevermind!

i fixed it thanx for the code though!
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump




All times are GMT. The time now is 04:47 PM.