View remains in stage even when its parent MC is removed..

Software: Away3D 4.x

Mr Margaret Scratcher, Sr. Member
Posted: 23 July 2012 05:02 PM   Total Posts: 344

Not sure if this a bug, or just a quirk of how stage3d works, but if I add the view to a movieclip, which is in turn added to the stage, when I remove the parent movieclip the view remains..

   

Richard Olsson, Administrator
Posted: 24 July 2012 08:00 AM   Total Posts: 1192   [ # 1 ]

Is the same not happening if you add the view straight to the root of the display list and then remove the view, though?

If by “the view remains”, you mean that the rendered output is still visible, that’s expected. The rendered output is not actually drawn in the view, but on the stage behind the view due to how Stage3D works.

To clear in such a way that you deallocate the view rectangle, thereby returning it to it’s SWF background color, you have to invoke View3D.dispose().

If you don’t want to dispose the view, and instead just show the view’s background color, you can render an empty scene.

   

Mr Margaret Scratcher, Sr. Member
Posted: 24 July 2012 02:09 PM   Total Posts: 344   [ # 2 ]

That is what i suspected, I just wanted to check that I was going a long route if there was a more straight forward method. What I have is a number of panes, or tabs, some of which have 3d content, some of which don’t so what I was trying to achieve was was obviously for the view3d to disappear when needed. Seems that I’m better off adding view3d to the stage itself, and specifying the dimensions and positions of it for each pane.

   

Richard Olsson, Administrator
Posted: 24 July 2012 02:14 PM   Total Posts: 1192   [ # 3 ]

Or you can just draw your tab panel content on top of the stage, in which case the 3D render will be occluded by it and “invisible” to the user.

   

Mr Margaret Scratcher, Sr. Member
Posted: 24 July 2012 03:12 PM   Total Posts: 344   [ # 4 ]

Ah yes, I forgot about that!

   

Mr Margaret Scratcher, Sr. Member
Posted: 24 July 2012 03:52 PM   Total Posts: 344   [ # 5 ]

What I ended up doing is moving the view.x to -1000, so that it was off the screen… Seems to do the trick!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X