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

Creating a button with zoom in/out functionality in Animate cc

New Here ,
Jun 28, 2017 Jun 28, 2017

I need to create a zoom in and zoom out button in addition to a play, stop and pause button for an animation created in Animate canvas. The play, stop and pause buttons are fine, but the zoom buttons are presenting a challenge.  The zoom has to occur on the whole canvas, not just an image. Can anyone direct me to a tutorial that might help?

850
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

Adobe Employee , Jun 28, 2017 Jun 28, 2017

I assume you want to zoom around the Center point. Here's to code to achieve that:

this.zoomBtn.addEventListener("click", clickHandler);

exportRoot.x = exportRoot.regX = lib.properties.width/2;

exportRoot.y = exportRoot.regY = lib.properties.height/2;

function clickHandler(e) {

  exportRoot.scaleX *= 1.2;

  exportRoot.scaleY *= 1.2;

}

Translate
Adobe Employee ,
Jun 28, 2017 Jun 28, 2017

I assume you want to zoom around the Center point. Here's to code to achieve that:

this.zoomBtn.addEventListener("click", clickHandler);

exportRoot.x = exportRoot.regX = lib.properties.width/2;

exportRoot.y = exportRoot.regY = lib.properties.height/2;

function clickHandler(e) {

  exportRoot.scaleX *= 1.2;

  exportRoot.scaleY *= 1.2;

}

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 ,
Jun 28, 2017 Jun 28, 2017
LATEST

Thank you so much for your time, it is really appreciated!

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