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

Parent a layer inside a symbol with an external object.

Contributor ,
Jun 04, 2021 Jun 04, 2021

Is it possible to parent a layer that is inside a symbol, with another symbol that is in the main scene? For example for some pupils that are inside the eye symbol, control them from a controller in the main scene.


____
2D vector animator since 2000 & PhD
TOPICS
Timeline
529
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 ,
Jun 04, 2021 Jun 04, 2021

layers don't exist once you publish, so you can't do anything with layers outside the ide (like control with code). 

 

otoh, there's no need for that.  you can always copy and paste a layer (or layers) into a movieclip timeline and, of course, movieclips are controllable outside the ide (eg, with code including reparenting).

 

 

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
Contributor ,
Jun 04, 2021 Jun 04, 2021

If it can be done with the movieclip, I am interested, because a pupil of one eye, does not have so many changes of pose, and if needed, it can be swapped symbol and without problems. Now it is how to make this script.


____
2D vector animator since 2000 & PhD
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 ,
Jun 04, 2021 Jun 04, 2021

what script?

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
Contributor ,
Jun 05, 2021 Jun 05, 2021

I refer to "code including reparenting".


____
2D vector animator since 2000 & PhD
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 ,
Jun 05, 2021 Jun 05, 2021

if you're asking for code to reparent a movieclip, as3 or canvas/js?

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
Contributor ,
Jun 06, 2021 Jun 06, 2021

To work with characters, it is better in as3. Currently to use the pupil is to work with two windows, one from the stage and one that is inside the symbol, which is where I move the pupils.


____
2D vector animator since 2000 & PhD
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 ,
Jun 06, 2021 Jun 06, 2021
LATEST

use addChild().

 

for example, if pupils is a child of character and character is a child of the main timeline and you want to reparent pupils from the main timeline (after it exists), use:

 

newparent.addChild(character.pupils);

 

note: even though pupils is now a child of newparent, you still reference it (from the main timeline) as character.pupils, not newparent.pupils.

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