can’t get mesh off my view.scene

Software: Away3D 4.x

Biegzie, Jr. Member
Posted: 20 June 2012 04:24 PM   Total Posts: 39

For some reason, the objects won’t get off scene with view.scene.removeChild()

Funny thing is that some will be removed, others are removed in the memory because I can’t remove them twice (error) but are still visible on the scene.. say what?

Anyone knows why and how to avoid/handle it?

Thx

   

Richard Olsson, Administrator
Posted: 20 June 2012 06:27 PM   Total Posts: 1192   [ # 1 ]

Are you calling render() again after you’ve removed the objects?

   

Biegzie, Jr. Member
Posted: 20 June 2012 08:11 PM   Total Posts: 39   [ # 2 ]

ofcourse

   

Richard Olsson, Administrator
Posted: 20 June 2012 08:17 PM   Total Posts: 1192   [ # 3 ]

What is the exact code that you’re using to remove your objects?

   

Biegzie, Jr. Member
Posted: 20 June 2012 08:21 PM   Total Posts: 39   [ # 4 ]

view_.scene.removeChild(anArray)

I added the shizzle with: view_.scene.addChild(something)

then i put that something in the array
anArray.push(something)

then, if i loop the array to remove, some do well, others don’t

   

Richard Olsson, Administrator
Posted: 20 June 2012 08:23 PM   Total Posts: 1192   [ # 5 ]

Sounds like you might be making the common mistake of looping over an array while removing elements from the array, and hence skipping every other element. Could that be the case? It would really be able to help if you would post the code for the entire loop and not just snippets.

   

Biegzie, Jr. Member
Posted: 20 June 2012 08:25 PM   Total Posts: 39   [ # 6 ]

no.. i let all the elements of the array exist
only removing them from the scene, not from the array

flash doesn’t show an error as well.. the object is gone as a child, so i can’t remove it a second time, but visually, still on the scene confused

   

Richard Olsson, Administrator
Posted: 20 June 2012 08:27 PM   Total Posts: 1192   [ # 7 ]

This sounds like a very weird issue, and since I have never heard about it before you’ll have to forgive me for being a little skeptical about it being a bug in Away3D. Hence, I really need to see your code to be able to help you. Both the code used to add the objects, and the code used to remove them again.

Thank you.

   

Biegzie, Jr. Member
Posted: 20 June 2012 08:38 PM   Total Posts: 39   [ # 8 ]

hmmm.. it’s on another pc, tomorrow i’ll try to remove the object directly after adding it on stage with the same array pointer. if that result is positive, it is really weird. If not, i’ll send you that peace of code. can’t send you the project… it’s a super secret one grin

   

Biegzie, Jr. Member
Posted: 21 June 2012 08:52 AM   Total Posts: 39   [ # 9 ]

I fixed the problem, seems that the pointer wasn’t that good, sorry to bother.. but can’t really understand why… the object was exactly the same..

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X