can't typecast a parent object with adobe animate camera active

Community Beginner ,
Jan 05, 2022 Jan 05, 2022

Copy link to clipboard

Copied

Hello, the following code will run when I am using a VCam for a camera. However, if i try bringing in the animate camera, the code breaks and gives me an error. What is causing the issue?

 

(MovieClip)(parent.getChildByName("minecraft_particles_bottom"))
.addChild(newParticle);

 

ypeError: Error #1009: Cannot access a property or method of a null object reference.
at movieclipASissue_Scene1_fla::MinecraftPotionParticleCreateArea_4_0_2/createParticle()
at movieclipASissue_Scene1_fla::MinecraftPotionParticleCreateArea_4_0_2/onEnterFrame()

Views

43

Likes

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
Adobe Community Professional ,
Jan 05, 2022 Jan 05, 2022

Copy link to clipboard

Copied

This part seems wrong:

(MovieClip)(parent.getChildByName("minecraft_particles_bottom")).addChild(newParticle);

It may need to be this:

MovieClip(parent.getChildByName("minecraft_particles_bottom")).addChild(newParticle());

Likes

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 Beginner ,
Jan 05, 2022 Jan 05, 2022

Copy link to clipboard

Copied

I tried that, bu didn't have any luck, other than continuing to use newParticle.

 

I really don't understand why the adobe animate camera would cause this code to error out.

Likes

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 Beginner ,
Jan 06, 2022 Jan 06, 2022

Copy link to clipboard

Copied

LATEST

Is there a way to communicate from one object to the top layer within adobe animate? I basically just want a character who is walking to trigger things at the top level such as foodsteps and dust.

Likes

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