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

Virtual Camera in Animate with Actionscript

Participant ,
Feb 17, 2020 Feb 17, 2020

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

TOPICS
ActionScript

Views

955

Translate

Translate

Report

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

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 !

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

You have been a few seconds faster than me. Haha

 

Anyway, I'm glad it worked!

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

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

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

Best Tommy B.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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