Adobe Animate - Scroll up
Hi guys,
I'm working on a project where I have an animation that activate when scrolling down. I have different shapes, when scrolling down the shape morphs into the next one.
My problem is that I can't figure out how to make the shapes morph bacwards, so basically I need the piece of code who tells the timeline to go backwards when scrolling up.
I attached the piece of code I wrote to make it scroll down (it works exactly I want it).
Thanks in advance!
var f = this;
stage.enableMouseOver();
stage.addEventListener("mouseover",h);
function h(){
document.getElementById("canvas").addEventListener("mousewheel",k);
}
function k(e){
if(e.wheelDelta < 0){
if(f.pock.currentFrame == 145){
f.pock.gotoAndStop(145);
}else{
f.pock.play();
}
}
if(e.wheelDelta > 0){
if(this.pock.currentFrame == 0){
f.pock.gotoAndStop(0);
}else{
f.pock.play();
}
}
}