Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scrolling multiple movie clips

Status
Not open for further replies.

netchen

Technical User
Apr 19, 2005
21
AU
Hi everyone,

I have a question I don't seem to be able to get around.

What I want to do is have a scroll bar on the _root timeline of my movie that will act for 5 different movie clips (each is a the content of each section in my navigation). I have placed all the content in a movieclip called container and then have a frame for each section with another movie clip (i.e mc_content_home, mc_content_about, etc).

How can I code a scrolling bar (2 buttons, arrow up and arrow down) to work with all those movie clips instead of having to place a scroll bar into each content section.

I have no idea how to do it so I would be grateful if somebody could give me some advice!

Thanks!

netchen*
 
well i don't have only got a part of the scrollbar. i have an arrow up and and arrow down and i would like it to scroll on rollOver.

could you help?

the scroll bar sitts in its own movieclip on the root timeline and the code on each button that i've got looks like this:

on (rollOver) {
_parent.content.home._y += 5;
_parent.content.why._y += 5;
_parent.content.services._y += 5 ;
}

now it only scrolls a short fraction and than it stops. how can i continuosly make it scroll until it reaches an end (which is a bit tricky again cause it has to scroll 5 different content sections with different lengths.).

i am pretty stuck, so if you have any ideas - they are more than welcome!

THANKS!

 
Instead of moving them individually why don't you just move the container MovieClip? That's the point of putting MovieClips in a container.

So instead of:

_parent.content.home._y += 5;
_parent.content.why._y += 5;
_parent.content.services._y += 5;

You can do:

_parent.content._y += 5;

Try something like:
Code:
on (rollOver) {
	this.onEnterFrame = function():Void  {
		_parent.content._y += 5;
	};
}
on (rollOut) {
	delete this.onEnterFrame;
}


Kenneth Kawamoto
 
Thanks, that works.

But i do have one more question... it scrolls without stopping. How can I tell it to only scroll up and down if there is anything in the content?

At the moment it scroll up and down even if there is no more text in the content.

Thanks for your help!
 
You have to put a conditional test, e.g. "scroll down only if _y is less than N".
Code:
on (rollOver) {
	this.onEnterFrame = function():Void  {
		if (_parent.content._y<600) {
			_parent.content._y += 5;
		}
	};
}


Kenneth Kawamoto
 
Thank you so much! Works perfect!
 
Hi, actually I do have a few issues still... sorry!

I have this code on the scrolling up mc:

on (rollOver) {
this.onEnterFrame = function():Void {
if (_parent.content._y<200) {
_parent.content._y += 5;
}
};
}

and the opposite on scrolling down (_y -=5;) but i can't seem to stop the scrolling still. I have tried changing the values (using 100, 200, 600, etc) but it just keeps going and going. if i use a minus in front of it (for scrolling down) then it doesnt scroll at all... also i don't want it to scroll up if its the start of the text only once you scrolled down you will be able to scroll up again.

can you help? thanks lots...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top