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

Layer Parenting, Child Layers Not Moving with Parent Layer That's Being Moved by ActionScript

Participant ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

ActionscriptWithLayerParentingIssue.jpg

I have a Movieclip symbol for a character and within it are multiple symbols of body parts that are linked together using Layer Parenting. 

Please see my linked .fla here if needed. I can't seem to upload it directly to the forum for some reason.


When I rotate one of the body parts such as the torso symbol using the below ActionScript 3.0 code, the torso rotates, but its linked child layers do not rotate with it.

 

 

 

MovieClip(root).character.torso.rotation = 45;

 

 

How can I get the linked layers to move along with the torso symbol which is being moved with ActionScript?



While I know a workaround would be to place all the other body part symbols inside the "torso" symbol and then rotate it, I would still like to know if layer-parented symbols can be moved with ActionScript while moving the rest of its linked layers with it.

Thank you for any input or assistance with this!

TOPICS
ActionScript

Views

329

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
Engaged ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

It seems to me that when managing instances with code, you may not be able to take advantage of the parent-child relationships between the layers simply because the concept of a "layer" exists as a convenient UI abstraction only in authoring mode.

If your project is primarily code-focused, you might consider using Bones instead of Parented layers. Please refer to the following chapters in the AS3 documentation: IKArmature, IKBone, IKEvent, IKJoint, IKManager, and IKMover.


- Vlad: UX and graphic design, Flash user since 1998
Member of Flanimate Power Tools team - extensions for character animation

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 ,
Oct 26, 2023 Oct 26, 2023

Copy link to clipboard

Copied

LATEST

Thank you for your suggestion!

I typically avoid using Adobe Animate's Bones as they can be quite buggy, but it might be a better workaround than coding a tweening system that moves other linked or child symbols with a chosen parent symbol.

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