# Keep on scrollin'

**URL:** <https://forum.kirupa.com/t/keep-on-scrollin/16258>\
**Category:** Uncategorized\
**Created:** [March 22, 2003, 8:41pm UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258 "2003-03-22T20:41:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hihabyte](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hihabyte](https://forum.kirupa.com/u/hihabyte)\
**Post date:** [March 22, 2003, 8:41pm UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/1 "2003-03-22T20:41:20Z")

</div>

I want to know how to keep scrolling a movieclip when you press a button.  
Now, you have to click and click and click, instead of just holding down your mousebutton.

This is my script:  
on (press) {  
setProperty("\_root.main.Scroll.Inhoud", \_y, getProperty("\_root.main.Scroll.Inhoud", \_y)+10);  
}

I can’t get a loop above the “on(press)…”  
How can I loop this peace of script?

Or is there a more effective script?

THanx!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 23, 2003, 1:46am UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/2 "2003-03-23T01:46:38Z")

</div>

hey **hihabyte** =)

if you are using mx … i think the easier way would be [dynamic event handlers](http://www.kirupa.com/developer/actionscript/tricks/dynamicevent.asp) 🙂

```auto
myButton.onPress = function() {
	_root.main.Scroll.Inhoud.onEnterFrame = function() {
		_y += 10;
	}
}
myButton.onRelease = myButton.onReleaseOutside = function() {
	delete _root.main.Scroll.Inhoud.onEnterFrame;
}

```

by the way, welcome to kiruaville! 😉

[size=1] **ps.** [please read before posting](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=7457)[/size]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 23, 2003, 10:17am UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/3 "2003-03-23T10:17:21Z")

</div>

And to what should I assign this script?  
Because, if I assign it to the button, he always puts “On release” in front of it…  
Help me, I’m feeling very stupid now ;(

eager to learn…

Thanx!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 23, 2003, 10:18am UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/4 "2003-03-23T10:18:54Z")

</div>

Ooooohhw, I forgot to say!

I use flash MX!!!

(aaarrrggghhhhh 🙂 )

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 23, 2003, 10:26am UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/5 "2003-03-23T10:26:17Z")

</div>

oh! sorry … i’m really used now to put all my scripts in the timeline 🙂

the script i posted should be in the timeline, being _myButton_ the instance name of your button 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 23, 2003, 10:09pm UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/6 "2003-03-23T22:09:58Z")

</div>

YeS!!! It works, at last!! Thank you very much for helping me with this peace of script, Kax!!

But I said I was eager to learn…so I would also like to understand this script completely.  
I think I do, except for the OnEnterFrame part.  
What does it do exactly? I don’t really understand the explanation in the Flash reference… so could you try to explain?

Thanx!! (again =) )

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 24, 2003, 6:48am UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/7 "2003-03-24T06:48:47Z")

</div>

no problem 😉 =)

and well, the _onEnterFrame_ handler basically executes the statement(s) at the frame rate of the movie.

so if the fps of your movie is at 24, the statements within the _onEnterFrame_ handler would be executed 24 times per second.

😛 =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 24, 2003, 5:01pm UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/8 "2003-03-24T17:01:13Z")

</div>

That’s just what I needed. Now I understand it completely!

thanx!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 24, 2003, 5:08pm UTC](https://forum.kirupa.com/t/keep-on-scrollin/16258/9 "2003-03-24T17:08:05Z")

</div>

😛

you’re welcome =)
