From the course: Adobe Animate CC New Features

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Code snippets for components

Code snippets for components - Adobe Animate Tutorial

From the course: Adobe Animate CC New Features

Start my 1-month free trial

Code snippets for components

- [Instructor] We have this new set of interactive components for HTML5 Canvas, but how do we interact with them through JavaScript? Conveniently, there are a set of code snippets written for these new components we can use to really tie things together. So, here is our video document from before, and I'm gonna make some adjustments to my video component on the stage. For one thing, I'm going to give this an instance name of videoPlayer. We'll be able to interact with it through JavaScript so long as it has an instance name. I'm also going to disable autoplay and disable the controls. Now I want a button on the stage, so I'm gonna pull over my button component here from my components panel, and let's change the label on this button to play video, and we'll give this an instance name of playBtn for play button, and let's make it a little bigger, so 160 by 40. And we'll position it at about 390 along the y-axis and 30 on the x. I'm gonna hold down the Alt key and drag another instance…

Contents