Skip to main content
Liereman
Known Participant
December 19, 2018
Answered

Slider in Adobe Animate Canvas doesn't work in Google Chrome

  • December 19, 2018
  • 1 reply
  • 386 views

I use a simple slider which makes it possible to 'slide' to different frames.

The HTML output works fine with Microsoft IE, Microsoft Edge and Safari, but doesn't work with Google Chrome.

Does anybody know how to solve this?

You can see the code I use below:

this.stop();

createjs.Touch.enable(stage); // this line is needed if you want to use it on touch devices

var _this = this;
this.railX = this.rail.x;
this.railW = this.rail.frameBounds[0].width;

_this.thumb.on("pressmove", function(e) {
    var newX = e.stageX / _this.stage.scaleX;
    if(newX >= _this.railX && newX <= (_this.railW + _this.railX)){
        e.currentTarget.x = newX;
        var frameRatio = (e.target.parent.x - _this.railX) / _this.railW;
        var newFrame = Math.round(frameRatio * (_this.totalFrames-1));
        _this.gotoAndStop(newFrame);
    }
});

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

    I tried your code with Chrome for Windows here and it worked.

    Is the console logging some error or warning?

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    December 19, 2018

    Hi.

    I tried your code with Chrome for Windows here and it worked.

    Is the console logging some error or warning?

    Regards,

    JC

    Liereman
    LieremanAuthor
    Known Participant
    December 19, 2018

    Hello, thnx for response. I tried the animation AFTER publishing on the web, than it works. When I open the HTML directly on my PC it doesn't. So it probably is a Chrome memory issue? Most important for me is that it works after publishing. Thank you for putting me in the right direction  (and testing the code)!

    JoãoCésar17023019
    Community Expert
    Community Expert
    December 19, 2018

    The important thing is that it works now!

    And you're welcome!