Author Topic: Multiple Scenes/External Swf - Best Approach?  (Read 167 times)

Sam Chau   «   on: April 17, 2012, 02:35:03 PM »
Hi,
I've got an app running a 3d world where the user can roam and access minigames. Although the user moves around in the 3d, the minigames are currently standard 2d flash, which are externally loaded whe access is needed.

We now want to build 3d minigames using flare3d, and published as individual swf files. These 3d minigames will then be loaded in just the same way as the 3d flash swfs. Ideally, we can swap or update these whenever without breaking the main 3d app. What is the best approach/practice for this?

Many thanks in advance.

Jason Huang   «   Reply #1 on: April 17, 2012, 04:01:34 PM »
Do not create the scene in your sub swfs. In your sub swfs try to use Device3D.scene or Device3D.camera to get access to the main swf.
Let me know if this helps, I had the same questions when I used Flare3D for my Flash site in the first time:)

Jason Huang   «   Reply #2 on: April 17, 2012, 04:02:25 PM »

And btw do not forget to dispose your models from your sub swfs every time when you swaping them:)

Sam Chau   «   Reply #3 on: April 18, 2012, 06:26:17 AM »
Thanks Jason!

I was having the scene referenced in the sub swf via a public function, but Device3D.stage works brilliantly.

So, do you dispose the models even if it might be re-used at a later time? I'm planning to create a container Pivot3D in the sub swf and toggling it's visibility, but if there is a performance boost from disposing instead, then I might take your advice.

Jason Huang   «   Reply #4 on: April 19, 2012, 12:03:49 AM »
Toggling it's visibility still has memory usage, I suggest dispose the models in any cases. I believe that there is a performance boost.:)