Copy link to clipboard
Copied
Has anyone got this to work when using ActionScript 3 classes, ie not having code on the timeline.
It seems to me that Virtual Camera can work with Actionscript if the only actioscript is in the timeline frames Actions windows.
As soon as you add a Document class eg Main.as - it starts to thriw weird errors.
I tried to import an external class into Actionscript in the timeline (eg seeing frame 1 Actions as Main.as)
but didnt work.
Any suggestions help, appreciated.
Tommy Banana
Copy link to clipboard
Copied
OK- I take it back. Got it working.
I moved entire Actionscript based app;ication into a movieclip MC1 - with all code as an external MC1.as class- - and added it to stage. I am treating frame 1 actions as Main.as and putting the cameraObj code in there and triggering camera functions from MC1 by reference to MovieClip(root).cameraFunction(null). seems to be working - woop woop !
Copy link to clipboard
Copied
You have been a few seconds faster than me. Haha
Anyway, I'm glad it worked!
Copy link to clipboard
Copied
Hi.
What version of Animate are you using?
Some previous releases indeed had some issues with the Virtual Camera, but these issues have been fixed in the most recent versions as far as I can tell.
And I just ran a test here using a Document Class and a Virtual Camera and everything worked as expected.
Regards,
JC
Copy link to clipboard
Copied
Using Aimate CC 2020. Are you able to put the VirtualCAmera code into an external class and get it to work without throwing type 1010 errors.
Copy link to clipboard
Copied
Yeah, I am.
This is how my Document Class code looks.
package
{
import flash.display.MovieClip;
import fl.VirtualCamera;
public class Main extends MovieClip
{
public function Main()
{
var camera:VirtualCamera = VirtualCamera.getCamera(root);
camera.setZoom(200);
}
}
}
Copy link to clipboard
Copied
Do you get any "ReferenceError: Error #1069: Property containertype not found" errors when adding children?
Best Tommy B.
Copy link to clipboard
Copied
I mean when adding a child movieclip to the document class?
Copy link to clipboard
Copied
I am getting this if I have the camera switched on - ie the camera layer added in timeline - even if no virtual camera code used. If I switch camera off errors dissappear....