Skip navigation
brianfs
Currently Being Moderated

Running an application launched from another application

Nov 7, 2011 2:39 PM

I'm running into issues launching a game application with 3D content from a game launcher application which maintains a list of games to launch.

 

The game application is an existing 2D game that I'm trying to add 3D content to.As a test, to this 2D game application, I've added an instance of the the BasicDemo class from the ProcesiumSamplesFlex demo and attached it to my stage an example 3D content. I've also added the following, lifted from the Tutorial01_SimpleShapes demo:

   

_sphere = MeshUtils.createSphere( 3, 50, 50, null##, "sphere" );

_basicDemo.instance.scene.addChild( _sphere );

_sphere.setPosition( -10, 2, 0 );

 

 

When I run this game application standalone, using the html created using the index.template.html, with wmode = "direct" added, the game runs successfully. I can see both 2D and 3D content, with the 3D content layered behind the 2D content as expected. So far, so good.

 

The game launcher application is a separate application which gets the name of a game to run from a drop-down menu and then issues an ExternalInterface call to run some javascript to launch the game application in a new window. The javascript runs the window.open method to launch the game application.

 

When I try running the game from the game launcher, the game launches successfully, but only the 2D content is visible. I can tell that in the HTML for the game being launched, the wmode is being set to direct, because if I remove it, the game throws an error saying "Context3D not available", as expected.

 

I've also tried using the game launcher to run the Test3DTestProject from the ProsceniumSamplesFlex project. In this case, the Test3DTestProject application runs and 3D content is visible.

 

I noticed that if I remove the TransparentApplicationSkin from the Test3DTestProject, and run it standalone, the 3D content doesn't show up. My game application, which is currently an mx.core.Application as opposed to spark.components.Application, doesn't include the TransparentApplicationSkin, so maybe this is related. But it runs standalone, showing 3D content without it, just not from the game launcher, so I don't know if TransparentApplicationSkin or something similar is needed.

 

Any suggestions? Thanks for your help!

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points