flash listeners
- Started
- Last post
- 5 Responses
- mtgentry
Is it possible to create a listener for the scrollbar on my web browser? I'm creating 1 long page and I want several movie clips to get triggered at certain points when the scroll bar is moved down.
Or maybe I'm approaching this the wrong way?
- normal0
That's exactly what you'd want to do. Something like this:
var stageListener = new Object();
stageListener.onResize = function () {
if (movieholder._height >= yourmovies._height) {
noScroll();
}
else {
scrollerFunction();
}
};
Stage.addListener(stageListener...
- enjine0
no i don't think there are any built-in listeners for the browser scrollbar. there are listeners for the scrollButton, but that's because it comes from the input device.
if javascript can detect it (which i doubt), then you could use the javascript integration kit to broadcast scroll actions to your swf.
i think you're probably thinking about it the wrong way though.
- enjine0
normal, scrolling won't trigger the Stage.onResize function
- normal0
Whoops, sorry, i was mistaken, i thought he was discussing creating a flash movie that would simply replace the scrollbar on the right putting it within the flash movie instead.
- mtgentry0
thanks for the feedback guys. Enjine, if I have to use javascript I was thinking of detecting the amount of pixels scrolled down and then using that info to tell the .swf what to do. Something like this:
http://codepunk.hardwar.org.uk/s…
You dont think this will work?