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

adobe animate html5 canvas virtual camera

New Here ,
Mar 08, 2024 Mar 08, 2024

Copy link to clipboard

Copied

Hello, 

I am working in a project using HTML5 canvas and Javascript, 

The adobe animate virtual camera does not seem to be working with objects that are added using code.

For example

If I added the object from a libarary

var SomeObject = new lib.SomeObject ();

this object will be automatically pinned to the virtual camera,

I tried to unpin it for example using 

AdobeAn.VirtualCamera.getCamera(exportRoot).unpinCamera();

But I will get this error: 

Uncaught TypeError: Cannot create property 'parent' on number '10'

Any ideas?

Thank you

TOPICS
Code

Views

61

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

correct answers 1 Correct answer

Community Expert , Mar 08, 2024 Mar 08, 2024

Hi.

 

One way of solving this is to add your instance to a layer instead of adding it directly to the root. For example:

 

 

this.yourAttachedLayer.addChild(someObject);

 

 

image.png

 

I hope this helps.

 

Regards,

JC

Votes

Translate

Translate
Community Expert ,
Mar 08, 2024 Mar 08, 2024

Copy link to clipboard

Copied

Hi.

 

One way of solving this is to add your instance to a layer instead of adding it directly to the root. For example:

 

 

this.yourAttachedLayer.addChild(someObject);

 

 

image.png

 

I hope this helps.

 

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
New Here ,
Mar 08, 2024 Mar 08, 2024

Copy link to clipboard

Copied

Yes that worked, thank you for your help 😃

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 ,
Mar 08, 2024 Mar 08, 2024

Copy link to clipboard

Copied

LATEST

You're welcome!

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