Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-11-2006, 07:37 PM   #1
qristopher
Registered User
 
qristopher's Avatar
 
Join Date: Mar 2004
Posts: 59
Send a message via AIM to qristopher
Default Help me dumb down this code...

I'm finishing up a site for this guy, and I have this infinite menu that scrolls images slowly, and is also mouse dependant.

After all the work, and a lot of help from oldNewbie, the guy would now like to remove ALL mouse dependancy on the menu.

Basically, the menu just scrolls along slowly, and nothing changes if you mouse over.

This is the code right now:

onClipEvent (load) {
xcenter = 400;
speed = 1/10;
}
onClipEvent (enterFrame) {
if ((_root._xmouse > 20 && _root._xmouse < 780) && (_root._ymouse > 20 && _root._ymouse < 120)) {
var distance = _root._xmouse-xcenter;
_x -= Math.round(distance*speed);
if(_x < -1800){
_x = 0;
}
if(_x > 0){
_x = 1800;
}
}
else{
if(distance > 0)
{
_x +=4;
}
else{
_x -=4;
}
_x -= Math.round(distance*speed);
if(_x < -1800){
_x = 0;
}
if(_x > 0){
_x = -1800;
}
}
}
qristopher is offline   Reply With Quote
Old 06-11-2006, 08:22 PM   #2
svenjoypro
DontJustEnjoyIt,SvEnjoyIt
 
svenjoypro's Avatar
 
Join Date: Sep 2005
Location: California
Posts: 1,389
Default

I think all you need is :
Code:
onClipEvent (enterFrame) {
if(_x < -1800){
_x = 0;
}
if(_x > 0){
_x = -1800;
}
 _x +=4; // OR  _x -=4;
}
svenjoypro is offline   Reply With Quote
Old 06-12-2006, 04:07 PM   #3
qristopher
Registered User
 
qristopher's Avatar
 
Join Date: Mar 2004
Posts: 59
Send a message via AIM to qristopher
Talking

Thank you so much. That was exactly what I needed to put in. Problem was, my eyes were bleeding from looking at the screen for 4 hours in a meeting that should have lasted 10 minutes.

Sigh... what we do for love.

Thanks again!
qristopher is offline   Reply With Quote
Reply


Thread Tools
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Always get desired FPS in browser jasonoda ActionScript 1.0 (and below) 10 01-06-2011 01:52 PM
Persistant Code Problem CisTrans ActionScript 1.0 (and below) 0 06-11-2006 05:25 AM
Moving a cursor - Need help with my code e39m5 ActionScript 1.0 (and below) 2 01-11-2006 08:20 PM
Adding code to a component event handler? BlueTree ActionScript 1.0 (and below) 0 12-02-2002 11:17 PM
code not working jaredly ActionScript 1.0 (and below) 6 06-05-2002 07:56 PM


All times are GMT. The time now is 06:10 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.