DX: Any way to set child?

I know you can query whether or not an object is a child with object.child. It basically returns true or false. I figured maybe the reverse was possible; being able to set object.child = true (or false) for an object, but so far no luck.

Anyone tried this and is it at all possible?

11,584 views 14 replies
Reply #1 Top
Not that i have seen.. its like there is a way from the standard menu to set the z-order to on-top, but not in the code. Can we get a list of things for the next release???
Reply #2 Top
Bummer...that's frustrating. Looks like I'll have to create two sets of objects; children and not children, which is extremely impractical for what I want to do.  ;p 

+1 Loading…
Reply #3 Top
sViz, I am not sure as to what you are asking. There is a way to set parent/child relationships in DX. If you ask what I am thinking, it is easy. Elaborate on it a little.
Reply #4 Top
I think he wants to set a parent to a child or some such thing through a gadget/widget script live .. not in the builder.
Reply #5 Top
I think he wants to set a parent to a child or some such thing through a gadget/widget script live .. not in the builder.


Correct.

Found a work around....woot! :) I'll post a streamlined version of the fix as soon as possible.
Reply #6 Top
Isn't there a setParent method?
Reply #7 Top
Cool.. cant wait to see. sounds like something we need to add to the DesktopX.info Site!
Reply #9 Top
I think he wants to
she


I knew that! Dagnabit!
+1 Loading…
Reply #10 Top
i did the same thing on the skincast.. i should never assume.. sorry sViz!
Reply #11 Top
Was going to suggest the parent option last night but, there are a few things I've encountered using it.

If your cloned object isn't contained and you want to make it a contained child then you must remember to move it to within the dimensions of the container.
Reply #12 Top
i did the same thing on the skincast.. i should never assume.. sorry sViz!


No worries, DA (and Zubaz), at least you pronounced my nick right.


I guess I should clarify that setting or assigning a parent wasn't the problem. I can do that. The specific problem was setting object.child = "yes" or object.child = "no". The distinction was important because, as you know, that allows/disallows the child object to be visible outside the parent's boundaries.


sounds like something we need to add to the DesktopX.info Site!


I'll be sure to put it in the tutorial section on the site, because it requires a good deal of explaining.




For what it's worth:

My idea was, on dragfinish, depending on where I dropped an object, it would either:

1. create a new object, which was not a child

2. if I drop it on another object it would automatically set the parent and make it a child.


To create the object as a child I had to clone a template object which was already a child of another object and then just change the parent (I did this before with my eZbrowser). The problem was making it not a child after cloning.

I could set the parent to nothing but then, checking its properties, it was still set to child = "yes". So it was a child of nothing and it wasn't visible!

After fuddling around I decided to clone the clone again and see what happens....it worked. The 2nd clone, without a parent, was automatically set to child = "no"


Crazy, huh? Well, all in a day's work.
Reply #13 Top
The tut on this is now up on DesktopX.info....HERE

+1 Loading…
Reply #14 Top
You got it. :D Thanks for letting us know.