2 Replies Latest reply on Oct 30, 2016 10:30 PM by stevicm62515914

    Vcam in Adobe Animate CC is not working correctly. PLEASE HELP :(

    becwhite92

      Hi guys,
      I used to use Vcams with my animations in all versions of flash and they worked fine. Now that Adobe has renamed flash "Animate CC" and scrapped AS2 (AS3 is the only thing available) no Vcams seem to be working. I have tried a bunch of different ones from all over the web including from forum posts here and from "Draw with Jazza".

      Yes, I have been using AS3 ones. I have tried resizing the rectangle inside the symbol as some have suggested but it just warps the artwork.

      This is what Draw with Jazza's AS3 Vcam does in animate CC in a 1920px x 1080px stage. AS Code is at the bottom too.

      1. this is how I have it set up: https://s11.postimg.org/uf8s88a6r/Vcam_setup.png

      2. This is how it displays when I preview my movie: https://s11.postimg.org/oscfar7o3/Vcam_Result.png

      3. You can see here the settings of the Vcam: https://s11.postimg.org/flyq17rtf/Vcam_settings.png

      4. And this shows the inside of the symbol - the registration is in the centre already (but it acts as though it's in the bottom right or something when I preview it??): https://s11.postimg.org/7hqlwh5eb/Vcam_symbol_settings.png

      5. And finally, this is how it is exporting... not playing correctly either: https://s14.postimg.org/buawvz2gx/Export_settings.png

      I don't know ActionScript so cannot recognize any mistakes in the code, but I have used his Vcam many times before with old versions of flash and it has worked fine. But here is the code below:

      import flash.events.Event;
      import flash.geom.Matrix;
      import flash.geom.Rectangle;
      import flash.geom.Point;

      visible = false;

      addEventListener(Event.ENTER_FRAME, handleEnterFrame);
      function handleEnterFrame(event:Event):void {
      if (parent) {
      parent.scaleX = 1 / scaleX;
      parent.scaleY = 1 / scaleY;

      if (rotation == 0) {
      parent.x = (width / 2 - x) / scaleX;
      parent.y = (height / 2 - y) / scaleY;
      parent.rotation = 0;
      } else {
      var bounds:Rectangle = getBounds(this);
      var angle:Number = rotation * Math.PI / 180;

      var midX:Number = -x / scaleX;
      var midY:Number = -y / scaleY;
      var rx:Number = -bounds.width / 2;
      var ry:Number = -bounds.height / 2;

      var cos:Number = Math.cos(angle);
      var sin:Number = Math.sin(angle);
      var rotatedX:Number = rx * cos - ry * sin;
      var rotatedY:Number = ry * cos + rx * sin;
      var cornerX:Number = midX - rotatedX;
      var cornerY:Number = midY - rotatedY;

      cos = Math.cos(-angle);
      sin = Math.sin(-angle);
      parent.x = cornerX * cos - cornerY * sin;
      parent.y = cornerY * cos + cornerX * sin;

      parent.rotation = -rotation;
      }
      }
      }

      addEventListener(Event.REMOVED, handleRemoved, false, 0, true);
      function handleRemoved(event:Event):void {
      removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
      removeEventListener(Event.REMOVED, handleRemoved);
      }

      Thank you for any help

        • 1. Re: Vcam in Adobe Animate CC is not working correctly. PLEASE HELP :(
          becwhite92 Level 1

          Hi all!

          Update, I have gotten this working!!! Not with this code though... I had to make my own vcam using this tutorial: http://bitey.com/smf/index.php/topic,705.0.html

           

           

          In animate CC, it appears you can't choose a registration point when making a new symbol. So, make sure when you draw your rectangle inside your symbol, align vertical and horiztonal centres so the crosshairs is in the centre of the rectangle. and voila! Also be sure to put the below code on the same frame as the rectangle inside the symbol

           

           

          <strong>I used this AS3 code:</strong>

           

           

          var cameraTrans:Transform = new Transform(this);

          var stageTrans:Transform = new Transform(parent);

          visible = false;

           

           

          stage.addEventListener(Event.ENTER_FRAME, updateStage);

          function updateStage(...rest) {

            parent.filters = filters;

            stageTrans.colorTransform = cameraTrans.colorTransform;

            var stageMatrix:Matrix = cameraTrans.matrix;

            stageMatrix.invert();

            stageMatrix.translate(stage.stageWidth*.5, stage.stageHeight*.5);

            stageTrans.matrix = stageMatrix;

          };

          updateStage();

           

           

          addEventListener(Event.REMOVED_FROM_STAGE, resetStage);

          function resetStage(...rest) {

            stage.removeEventListener(Event.ENTER_FRAME, updateStage);

            stageTrans.matrix = new Matrix();

            stageTrans.colorTransform = new ColorTransform();

            parent.filters = new Array();

          }

          • 2. Re: Vcam in Adobe Animate CC is not working correctly. PLEASE HELP :(
            stevicm62515914

            Hey Bec,


            I am a total noob with this stuff and found your post because I'm looking for a ready made VCAM for Adobe Animate CC 2015.2 release (adobe cloud) . . . Just really basic animation for fun.

             

            Action Script looks like chinese to me - is there anything you're aware of that's plug - n - play for idiots like me?

             

            Many thanks,

            Stevic