DX: Any way to set child?
Sunday, May 18, 2008 by sViz | Discussion: DesktopX
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?
Reply #2 Sunday, May 18, 2008 10:07 PM
Reply #3 Sunday, May 18, 2008 10:47 PM
Reply #4 Sunday, May 18, 2008 11:07 PM
Reply #5 Sunday, May 18, 2008 11:24 PM
Correct.
Found a work around....woot!
Reply #7 Monday, May 19, 2008 6:00 AM
Reply #10 Monday, May 19, 2008 10:35 AM
Reply #11 Monday, May 19, 2008 1:42 PM
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 Monday, May 19, 2008 8:02 PM
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.
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.
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Sunday, May 18, 2008 7:04 PM