Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Virtual Camera in Animate with Actionscript

Participant ,
Feb 17, 2020 Feb 17, 2020

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

TOPICS
ActionScript
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 17, 2020 Feb 17, 2020

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 !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2020 Feb 17, 2020

You have been a few seconds faster than me. Haha

 

Anyway, I'm glad it worked!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2020 Feb 17, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 17, 2020 Feb 17, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2020 Feb 17, 2020

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);
		}
	}
}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 01, 2020 Mar 01, 2020

Do you get any "ReferenceError: Error #1069: Property containertype not found" errors when adding children?

 

Best Tommy B.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 01, 2020 Mar 01, 2020

I mean when adding a child movieclip to the document class?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 01, 2020 Mar 01, 2020
LATEST

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....

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines