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.

Controlling the camera with code

Controlling the camera with code - Adobe Animate Tutorial

From the course: Adobe Animate CC New Features

Start my 1-month free trial

Controlling the camera with code

- [Instructor] Not only are all these neat camera and depth features part of the Animate CC user interface, but you can hand control of the camera over to the user or perform programmatic effects with the powerful virtual camera API. As you can see here, all I have is a very simple animation of a sunrise and I have no camera effects or layer effects or anything like that going on here, the camera is completely disabled. However, I do have some code here to control the virtual camera. Let's go to Window, Actions, and here you can see, since this is a ActionScript 3 document type, that we're importing from the FL package, the VirtualCamera class. We then create a new cameraObj type to VirtualCamera and set it to VirtualCamera.getCamera at the root. This gives us a camera object we can control. Note here that I've also placed in what you would use to define the camera object if you were using HTML5 Canvas as a document type and if you were using WebGL as a document type. Both…

Contents