View Full Version : Scrolling horizontal movie clip continued...
s_e_b_design
03-10-2005, 11:22 AM
Further to previous, if I have a movie clip which is 1200 px wide for example (e.g. the menu bar twice) and I want it to scroll continuously depending on mouse position what values do I need to put into code to get the menu bar to appear continuous and where should I position it for the initial x value? at 0?
Thanks to the posting I can get the movement working but experiencing large gap between end of one and beginning of other.
Also if I then want it to stop scrolling with a mouse over where does this fit into the scripting?
Thanks
Sarah
Hi,
You can put in some trace actions to determine the exact coordinates that need to be set for the scroll to loop precisely....
Pseudo code example...set boundaries
_root.onEnterFrame = function () {
trace(_root.scrollMC._x );
// set the scroll
if (_root._xmouse>300) {
_root.scrollMC._x -= 5;
} else if (_root._xmouse<300) {
_root.scrollMC._x += 5;
}
//set the bounds
if (_root.scrollMC._x<=-50) {
_root.scrollMC._x = -50;
} else if (_root.scrollMC._x>=500) {
_root.scrollMC._x = 500;
}
Pseudo code...Continuous scroll
onClipEvent (enterFrame) {
trace(_root.scrollMC._x);
if (_root._xmouse>100) {
_root.scrollMC._x -= 10;
}
if (_root._xmouse<100) {
_root.scrollMC._x += 10;
}
if (_root.scrollMC._x<-450) {
_root.scrollMC._x = 850;
}
if (_root.scrollMC._x>950) {
_root.scrollMC._x = -350;
}
}
Powered by vBulletin™ Version 4.1.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.