PDA

View Full Version : Motion on website is "chunky"


shaftbond
09-21-2003, 11:55 PM
Hi, I just put up my first website :) www.toddhamilton.net It was alot of fun putting it together, especially the coding of the main menu. But looking at it online, the motion of the slider and the rotating triangles in the portfolio submenu is pretty jerky. I'm assuming that is it requiring more bandwidth than available or something.

All of the "pages" that come up are movies that load when a certain variable is switched to a specific number. If they were seperate swfs that loaded individually, would that help? Any ideas on how to make the motion more smooth? Thanks.

Colin Campbell
09-22-2003, 12:12 AM
Hey shaftbond, welcome to the forums,

I have a similar code, thanks to the guys here, and I'll post it. I was using it for onRollOver, and you were using it for onRelease or Press, whichever one. But they should be similar.


function slideTo(goalPos) {
_root.mySlider.onEnterFrame = function() {
if (this._x>goalPos+8) {
this._x -= 8;
} else if (this._x<goalPos-8) {
this._x += 8;
} else {
this._x = goalPos;
delete this.onEnterFrame;
}
};
}
//
//
buttons_ar = [Nucleus_mc, Port_mc, About_mc, Testing_mc, Connect_mc];
for (i in buttons_ar) {
buttons_ar[i].onRollOut = function() {
slideTo(143);
};
buttons_ar[i].onRollOver = function() {
slideTo(this._x);
};
}


This code would make the slider move over on mouse over, and move back to "home base" when on mouse out, but it has the same general principles. Post your code if you want to, or use this for reference... I don't have a .swf or .fla ready to show you, if I get the time, I'll post it

slowpoke
09-22-2003, 08:13 AM
you could avoid that 'jerkiness' by not loading the content utill the "Selector head" or whatever you call it is in position. I'm not going to write it for becuase you can obviously do it yourself but for newbies reading this for a similar problem the structure should be something like

if selectorHead._x = where it needs to be

load content

else

don't load anything.

shaftbond
09-23-2003, 02:34 PM
slowpoke...yeah that's how i originally had all the animation set up: dependent on the _x of the slider. It gave me problems, but I think if I keep that interaction still dependant on a variable AND add the dependance on the _x it might work. I'll try it and let you know. Thanks!

spriggan
09-23-2003, 02:41 PM
This may be an overaly simple answer, but have you messed around with the frame rate? lowering it or raseing it to see if it makes a difference. Also messing around with the number if pixels that the slider moves with each interval could also work. You might want to also use setInterval so the slider runs at a differnt speed then the rest of the site. I'd give it a fast interval and lower the _x speed.