Parenting objects

Software: Away3D 4.x

Avatar
Apprentice, Jr. Member
Posted: 27 July 2011 07:57 AM   Total Posts: 45

Hi,

It’s been two months since I’ve been working on a Away3D project (as I had to work on another project). Now I come back and performed all types of updates in FlashDevelop, Away3D (getting the last version from GIT) and FlashPlayer 11. Several things have broken, but that’s to be expected.

One of those things is parenting. It seems I no longer have write-access to the parent property of a model. I did see the ‘setParent’ function, but it appears to be ‘arcane’ (which apparently means it should only be used within the Away3D engine). So there doesn’t seem to be a way for me anymore to parent objects. I quickly tried changing ‘arcane’ to ‘public’ and then it seems to work fine. But I’d rather not make custom changes to the Away3D engine. Am I missing something?

—Apprentice

P.S. Preview post appears to post the message directly on forum

   

Avatar
David Lenaerts, Administrator
Posted: 27 July 2011 09:20 AM   Total Posts: 80   [ # 1 ]

Why would you want to set the parent manually. The idea is that you call addChild(child) on the parent, not the other way around.

   

Avatar
Apprentice, Jr. Member
Posted: 27 July 2011 09:35 AM   Total Posts: 45   [ # 2 ]

Ah of course.
I was just confused since in another project we always do parenting by setting the parent of the child and it worked fine for me in Away3D two months ago.
In the end it doesn’t matter I suppose.
Thanks.

—Apprentice

   

Richard Olsson, Administrator
Posted: 27 July 2011 02:56 PM   Total Posts: 1192   [ # 3 ]

In this sense, Away3D works (and is intended to work) the same way that Flash and the native display list does. The parent property is read-only, and parenting happens using addChild().

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X