This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > January 2004 > removeChildren





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author removeChildren
Unregistered

2004-01-18, 8:19 pm

Hi guys,

I have a question regarding removeChildren. Ok...in sum, my problem is I need to dynamically create display and then this can take place many times. For example first time, I need to create one set of display, then second time I need to create a second set of display. Now the thing is before I create the second set of display, I try to delete the first set but I failed. Using removeChildren doesn't seem to clear away my first set of display. The first set of display will appear to be cleared off but when I generate the second set of display, I still see the first set. Any idea? Below is a fragment of my code (I filtered away some declaration stuff as they are too long:



DEF GenDisplay Script {
directOutput TRUE
allpic USE AllPic //this is where it consists of all the children create
//from createstringfromvrml
field MFNode accumulatedNode []
field MFNode accumulatedNodeToClean []

url "vrmlscript:
function set_url() {

//Look for any children under allpic
while (allpic.children[pic_clean])
{
Browser.deleteRoute (allpic.children[pic_clean].children[0], 'touchTime', allpic.children[pic_clean].children[1], 'set_time');
Browser.deleteRoute (allpic.children[pic_clean].children[1], 'url_changed', fulldisplay, 'set_url');
accumulatedNodeToClean[pic_clean] = allpic.children[pic_clean];
pic_clean++;
}

if (pic_clean > 0)
{
allpic.removeChildren(accumulatedNodeToClean);
}

<after this section, I start to create second set of display>
}

Is there any thing else, I miss? Any cache or buffer I need to clear? A billion thanks!
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews