Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scroll

New Here ,
Jul 04, 2017 Jul 04, 2017

Anyone know how to make an Animate CC HTML5 animation become a scrolling site rather than a movie that plays?

Like this (or the hundreds of other sites that advance when you scroll)?

Make Your Money Matter

1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 04, 2017 Jul 04, 2017

use something like,

this.stop();

canvas.addEventListener("mousewheel", MouseWheelHandler.bind(this));

canvas.addEventListener("DOMMouseScroll", MouseWheelHandler.bind(this));

function MouseWheelHandler(e) {

    if(e.wheelDelta>0){

        this.gotoAndStop(this.currentFrame+1);

    } else {

        this.gotoAndStop(this.currentFrame-1);

    }

}

Translate
Community Expert ,
Jul 04, 2017 Jul 04, 2017

use a mousewheel event listener, Edit fiddle - JSFiddle

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 04, 2017 Jul 04, 2017

Thanks for the quick reply.

That code works well.

Only problem is that I don't know how to edit the code to make it scroll the timeline rather than scale an object. I don't know how to code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2017 Jul 04, 2017

use something like,

this.stop();

canvas.addEventListener("mousewheel", MouseWheelHandler.bind(this));

canvas.addEventListener("DOMMouseScroll", MouseWheelHandler.bind(this));

function MouseWheelHandler(e) {

    if(e.wheelDelta>0){

        this.gotoAndStop(this.currentFrame+1);

    } else {

        this.gotoAndStop(this.currentFrame-1);

    }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 04, 2017 Jul 04, 2017

Wow, that works perfect.

Thank you, that's very kind.

Except it doesn't work on a touch device (?)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2017 Jul 04, 2017

what touch device has a mousewheel?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 04, 2017 Jul 04, 2017

You are right.

But these days there's not much use of a website that doesn't work on touch screens.

Would you happen to know how to make it work on them too so that when you scroll with your finger rather than the mouse wheel, it does the same thing?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2017 Jul 04, 2017

you can use mousedown to work on touch screens on computers, start a loop that updates based on the mouse position and use mouseup to terminate the loop.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2017 Jul 05, 2017

Thanks again kglad, but I'm not sure how to do that as I can't code 😞 Apologies.

And thanks for the advice Clay regarding scrolling sites, I know what you mean. But the goal in my particular case is not "ooh-aah" - this website is telling a story and it's merely to give the viewer more precise control over the timing of it than a play / pause button will ever allow.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2017 Jul 05, 2017

Perhaps mobile users would appreciate just having Back and Next buttons.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2017 Jul 05, 2017

var this_var = this;

this.ticker = createjs.Ticker;

this.ticker.addEventListener('tick',loopF);

this.ticker.paused = true;

stage.addEventListener('stagemousedown',downF);

stage.addEventListener('stagemouseup',upF);

function downF(){

     this_var.ticker.paused = false;

}

function upF(){

    this_var.ticker.paused = true;

}

function loopF(){

    if(!this_var.ticker.paused){

        console.log(this_var.ticker.paused+": "+stage.mouseX+" "+stage.mouseY);

    }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2017 Jul 05, 2017

Thanks.

But it doesn't seem to work. I tried it on a few different files with no luck.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2017 Jul 05, 2017

what doesn't work?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2017 Jul 05, 2017

It won't scroll on touch screens with the code - I tried it on an iPhone and an iPad.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2017 Jul 05, 2017

i supplied that snippet in an effort to teach how to code your project.  is that what you want, or are you looking for someone to code your project for you?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2017 Jul 05, 2017

I really appreciate all your help.

I'll try and find a coder who can help. I'm not ready to learn code yet, I only started learning the Adobe suite three months ago.

I'm sorry if I came off badly there, I guess I was just hoping that it was a simple case of cut and paste into the actions panel.

Thanks again for your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2017 Jul 06, 2017

if you're looking to hire someone, send me an email via http://www.kglad.com > contact.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 07, 2017 Jul 07, 2017
LATEST

Thanks.

Can you send me your email address. Your contact form isn't working (when I hit submit, it says "there's been a problem")

Regards,

Ethan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 04, 2017 Jul 04, 2017

jond58666664  wrote


Like this (or the hundreds of other sites that advance when you scroll)?

Make Your Money Matter

Usability expert Donald Norman has an expression that can be applied to sites designed like that: "It probably won an award."

It's not a compliment.

Something like that should have just been turned into a video. The need to constantly crank on the scroll wheel like an organ grinder monkey adds nothing positive to the experience. But it does have an immediate ooh-ahh effect on clients, which is probably why sites like it keep getting made.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines