1

when i debug my program stage.stage3Ds is empty ( length 0 ) this gives me an error when i try to use it for programming. When I push a new Stage3D on to stage.stage3Ds and then use the requestContext3D() function, I never get the context3d_create event that allows me to move forward with program

1 Answers1

2

In the Adobe AIR Application Descriptor XML file, set the following elements:

<renderMode>direct</renderMode>
<depthAndStencil>true</depthAndStencil>

Render Mode

Specifies whether to use graphics processing unit (GPU) acceleration, if supported on the current computing device.

In order to leverage GPU acceleration of Flash content with AIR for mobile platforms, Adobe recommends that you use renderMode="direct" (that is, Stage3D) rather than renderMode="gpu". Adobe officially supports and recommends the following Stage3D based frameworks: Starling (2D) and Away3D (3D). For more details on Stage3D and Starling/Away3D, see http://gaming.adobe.com/getstarted/.

Depth and stencil

Indicates that the application requires the use of the depth or stencil buffer. You typically use these buffers when working with 3D content. By default, the value of this element is false to disable the depth and stencil buffers. This element is necessary because the buffers must be allocated on application startup, before any content loads.

The setting of this element must match the value passed for the enableDepthAndStencil argument to the Context3D.configureBackBuffer() method. If the values do not match, AIR issues an error.

This element is only applicable when renderMode = direct. If renderMode does not equal direct, ADT throws error 118:

Jason Sturges
  • 15,855
  • 14
  • 59
  • 80
  • I get this Error when i try to debug on device with the changes added. `code` Error occurred while packaging the application: D:\Flash\Mobile Test\bin-debug\Main-app.xml(105): error 103: application.initialWindow.depthAndStencil is an unexpected element/attribute `code` – David Wilson May 15 '13 at 16:12
  • From [your other question](http://stackoverflow.com/questions/16570554/depthandstencil-throws-error-103-in-application-xml), it looks like depth and stencil was set to `false` instead of `true`. Also, AIR SDK must be 3.2 or higher; whereas you are using AIR 3.1. – Jason Sturges May 15 '13 at 22:14
  • yeah any other ideas for my problem – David Wilson May 15 '13 at 23:29
  • Update your AIR SDK, or [overlay an updated AIR SDK](http://www.jasonsturges.com/2012/08/overlay-adobe-air-3-4-sdk-in-flash-builder-4-6/). – Jason Sturges May 16 '13 at 00:42
  • The only problem is I won't be able to debug on the device, because I have to include the new version of AIR with the program, which I believe means that I can't debug on the device. – David Wilson May 16 '13 at 03:07
  • 1
    The only problem is this "Adobe AIR version 3.1 is pre-installed on the Kindle Fire (2nd Generation) and Kindle Fire HD tablets. You can publish Adobe AIR 3 apps for the Kindle Fire tablets by packaging them as "captive runtime" apps. However, these captive runtime apps will not support on-device debugging." – David Wilson May 16 '13 at 03:13