title: Adobe Animate CC Camera and Advanced Layer tools won't work with AS3 class
body: <p>I have an AIR iOS project which contains Camera and Advanced layer switched on. All animations and camera movements is finished, but when time comes for coding in AS3 class it gives me a tons of errors starting with Error#1056 below: </p>
  
  <p>Error #1056: Cannot create property _layerDepthEnabled___</p>
  
  <p>I put all necessary related libraries inside the package but the problem still exists. I guess this relates to loading libraries, but I can't figure out what I missed? Anyone please explain me the cause of the error and a possible fix? Thank you.</p>
  
  <pre><code>package  {
  
  import flash.display.MovieClip;
  import flash.display.Stage;
  import fl.transitions.Tween;
  import fl.transitions.easing.*;
  import fl.transitions.TweenEvent;
  import flash.events.Event;
  import flash.events.MouseEvent;
  import fl.Layer;
  import fl.ImportFlashClasses;
  import fl.VirtualCamera;
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I have followed similar case <a href="https://stackoverflow.com/questions/48673142/actionscript3-main-class-is-the-root-but-does-not-allow-the-animate-virtual-cam">here</a> by declaring <strong><em>public dynamic class</em></strong>, but obviously it brings another conflict with existing codes. Below is the copy of the error message:</p>
  
  <pre><code>TypeError: Error #1009: Cannot access a property or method of a null object reference.
  at mainclass/__setProp_sky_Scene1_sky_obj__0()[mainclass::__setProp_sky_Scene1_sky_obj__0:7]
  at mainclass()[/Volumes/DUO/FLASH/mainclass.as:265]
  at building()[/Volumes/DUO/FLASH/building.as:12]
  at flash.display::Sprite/constructChildren()
  at flash.display::Sprite()
  at flash.display::MovieClip()
  at flash.display::Sprite/constructChildren()
  at flash.display::Sprite()
  at flash.display::MovieClip()
  at townduas()[/Volumes/DUO/FLASH/mainclass.as:27]
  </code></pre>
  
  <p>I'm controlling Camera and Advanced Layer with code in AS3. Everything works fine if I turn off Advanced Layer or remove the Camera. I have no idea what is causing the problem.</p>