Maybe it's a silly question, but with:
var a = {
scrolled: false
};
var handler = function() {
a.scrolled = true;
console.log(a.scrolled); // always "true"
};
window.addEventListener('scroll', handler);
console.log(a.scrolled); // always "false"
There is not a chance to change the value of a.scrolled from inside the event to the "outside" context?
Thanks....