Help with a Scroll box

Hi everyone, I need some help. For my site I want to make a scroll box that scrolls news and info from top to bottom, and when you put your mouse over it it pauses so you can read that section. Does anyone know where I can find a tutorial to do this or can anyone help me out???

I haven’t tried it yet & I am new to the game but this should work. Make your text a news a movie clip, drag it to the scene & include this script on the text & news clip

onClipEvent (enterFrame) {
//Check to see if your mouse is positioned over
// The clip. If it is the scolling stops
if (_root.ins_newsandinfo.hitTest(_root._xmouse, _root._ymouse, true)) {
&nbsp &nbsp &nbsp &nbsp this._y = _y

// If your mouse is not position over the clip
// Your news & info clip will scroll&nbsp &nbsp &nbsp &nbsp
}else{
y = 1
this._y -= y
y = y + 3
}
}
// You’ll also need to mask the new & info clip
// to give it a true scrolling effect

I appericate you quick responce, I have to say I like coming to these forums because everyone is so helpful, and no one tries to make you feel like an idiot because your just starting out in flash. Thanks again man.

No problem buddy. I hope that helps out.
LMK if it works

You’ll want to set up boundaries so the clip
doesn’t just doesn’t scroll of the page. If you
need help just shout.

onClipEvent (enterFrame) {
// get the original y position of this
y = _y
// hitTest to see if mouse is over this object
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
// If it is do not scroll the clip
this._y = y;

// if the mouse is NOT over this object
}else{
// Start Scrolling the Clip
y = 1
this._y -= y
y +=3
}
}

Just on that note, i tested your codes and it works really well hey. But when it leaves the screen, how do you make it start again? Loop?

Im also new to flash soo… hehe

:slight_smile:

This should do it:

onClipEvent (enterFrame) {
// get the original y position of this
y = _y
// hitTest to determine if the mouse is over this
if (this.hitTest(_root._xmouse,_root._ymouse, false)) {
// do not scroll the clip
this._y = y;

}else{
// set the value of y
y = 1
//subtract y from this._y
this._y -= y
// add 3 to y
y +=3
// if the clip travel outside the mask parameter . . .
if (this._y < 35) {
// put it back within the mask parameter
this._y = 327
}
}
}

Let me know if you have any trouble,

Take care.

I need to get a book on action script so I can start putting together formulas like the one you just posted 91. I want to be able to look at that and know what ima looking at. I also want to be able to sit down and write my own code withone having to keep looking at tutorials to know what im doing. What book should I buy so i can start learing Action Script??

Hey, Honestly I own a few books & have learnt more from this site then all of them combined. The tutorials are totally the way to go. You can try them out & post your questions here as most people are familiar with them & can anwer you quick. If you are looking for comments be sure & ask that whoever answers you please comment the code line by line. There’s also a great forum for actionscript at Macromedia.com where you can post questions & get answers fast. Try all the tutorials on kirupa. I was practically tearning my hair out last week on the draggable menu tutorial but if you stick with it long enough it will eventually click. I did tha tutorial over like 10 times before i beat it into my head. Keep @ it & I you will get it.

91stealth>>

I tried that code and it does loop back, but it loops back to early. I mean while the MC is scrolling across, not all the info scrolls off the screen before it starts again. Do u get me? Does this depend on how much info you have? Or is the scroller seet on a time to reset?

Because what i was hoping for is to have a row of pictures… And they continuously scroll across/vertical (doesn’t matter)… So when you get to the LAST picture the FIRST picture follows STRAIGHT afterwards so it just seems like a stream? Does that make sence?

If it’s too much trouble then not to worry hey :slight_smile: Sounds like im asking for alot hey. hehe But if it’s not possible, then we’ll just stick to the first one how it all scrolls off the screen and just resets itself at the end.

Thanks heaps
Jakatta…
:slight_smile:

Hi,
Sorry so late in getting back to you on this. Just read your post this min.

The looping effect is controlled by this section of the code:

// if the clip travel outside the mask parameter . . .
if (this._y < 35) {
// put it back within the mask parameter
this._y = 327

The values set here will vary depending on the size of the movie clip that you are scrolling & the size of the mask you are using. You’ll have to play around with these values to suit your particular application. Simply change the #'s above “35 & 327” to find that which suits your needs best. If i am not making any sense just post again & I’ll try to explain further.

You can download the .fla from the example I did here:
members.aol.com/webclickusa/fla
if it helps you.

Good luck