This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=388 as retrieved on 1 Aug 2007 10:30:13 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:W63cpq2wFkQJ:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D388+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=26


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ Reset Sandy

Posted by: flipvisual Mar 16 2007, 07:52 PM

Hi Guys

I would like to create a new 3d world each time a user enters a section of the website and as such I would like to completley destroy the previous world. Any idea how this can be achieved?

Im using:

World3D.getInstance().addCamera(camera);
World3D.getInstance().setRootGroup(background);
createScene(background);
World3D.getInstance().render();

Thanks

Mark
Flip Visual

Posted by: Petit Mar 16 2007, 09:43 PM

QUOTE(flipvisual @ Mar 16 2007, 08:52 PM) *

I would like to create a new 3d world each time a user enters a section of the website and as such I would like to completley destroy the previous world. Any idea how this can be achieved?

Hi! Sounds like a Flash web site to me.
If so, you don't have to create new worlds or destroy old ones.
In a flash site one or more objects on the stage may link to other web pages or Flash movies ( SWF ).
This simply means navigating in the "main" world ( e.g. clicking an object ) links to another world ( another swf ), which is loaded into the browser. ( They probably doesn't have to be embedded in web pages.

What happens to the 'old' world?
Well it stops running, but is still stored in the browser cache.
If you close the browser, all your worlds are destroyed.

Oh, that sounds dangerous! Have no fear - only on the client side. cool.gif

Disclaimer: This is how I see it. I haven't tested it but believe it works this way.

Posted by: flipvisual Mar 17 2007, 01:44 AM

Thanks for your reply. But i think i may have not exlained myself correctly. I am not loading any new swfs or directing anyone away. I just wish to totally destroy the world so that if I create a new one and add objects to it, it doesnt slow everything down. Atm I am using:

World3D.getInstance().getRootGroup().destroy();
World3D.getInstance().getRootGroup().remove();
World3D.getInstance().stop();

Thanks in advance

Posted by: kiroukou Mar 17 2007, 09:25 AM

Hi,
Yes doing destroy on the root group should work. and doing World3D.setRootGroup( null ) after that.
But I'm not sure that it is really removing every ressources from memory. It would certainly not render aything, but I guess you'll have some "small" memory leaks doing this.

This feature would be improved in the next revision.

Posted by: flipvisual Mar 17 2007, 11:39 AM

QUOTE(kiroukou @ Mar 17 2007, 09:25 AM) *

Hi,
Yes doing destroy on the root group should work. and doing World3D.setRootGroup( null ) after that.
But I'm not sure that it is really removing every ressources from memory. It would certainly not render aything, but I guess you'll have some "small" memory leaks doing this.

This feature would be improved in the next revision.


Thanks guys. I solved the problem by using the code listed above and also using:

camera = World3D.getInstance().getCurrentCamera();

if (camera == undefined)
{
camera = new Camera3D(width, __world.screen);
World3D.getInstance().addCamera(camera);
}
else
{
camera.setFocal(width);
camera.setScreen(__world.screen);
}

Before I was adding a new camera each time which resulted in the slow down this ensures there is always only 1 camera.

smile.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)