Skip to main content
Participating Frequently
January 6, 2014
Question

Requesting BASELINE_EXTENDED profile in air 3.9 or 4.0 causes error

  • January 6, 2014
  • 1 reply
  • 653 views

This line of code

stage.stage3Ds[0].requestContext3D( Context3DRenderMode.AUTO, Context3DProfile.BASELINE_EXTENDED );

causes error "Error #2008: Parameter profile must be one of the accepted values." if app is compiled for desktop with air sdk 3.9 or air sdk 4.0 beta (didn't tried another sdk's). Compiling for web works fine. So what is this error? Where can I find information?

This topic has been closed for replies.

1 reply

sinious
Legend
January 6, 2014

Just made a quick test on 3.9, Application, set to direct render of course, no issue:

package

{

          import flash.display.Sprite;

          import flash.display.Stage3D;

          import flash.display.StageAlign;

          import flash.display.StageScaleMode;

          import flash.display3D.Context3D;

          import flash.display3D.Context3DProfile;

          import flash.display3D.Context3DRenderMode;

          import flash.events.ErrorEvent;

          import flash.events.Event;

          public class CX3D extends Sprite

          {

                    private var s3d:Stage3D;

                    private var rc:Context3D;

                    public function CX3D()

                    {

                              stage.align = StageAlign.TOP_LEFT;

                              stage.scaleMode = StageScaleMode.NO_BORDER;

                              s3d = this.stage.stage3Ds[0];

                              s3d.addEventListener(Event.CONTEXT3D_CREATE, onContextF);

                              s3d.addEventListener(ErrorEvent.ERROR, contextErrorF );

                              s3d.requestContext3D(Context3DRenderMode.AUTO, Context3DProfile.BASELINE_EXTENDED);

                    }

                    private function contextErrorF(e:Event):void

                    {

                              trace('Error ' + e);

                    }

                    private function onContextF(e:Event):void

                    {

                              trace('Created ' + e);

                              rc = Stage3D( e.target ).context3D;

               trace(rc);

                    }

          }

}

Trace:

Created [Event type="context3DCreate" bubbles=false cancelable=false eventPhase=2]

[object Context3D]

(used a TextField for output in my finished .exe)

edit:

Although unlikely, if your desktop GPU is old enough it very well may not support that mode.

Participating Frequently
January 7, 2014

Yeah, sorry, my bad. I forgot to explicitly set swf-version.

sinious
Legend
January 7, 2014

That'll do it. Glad you got it working, good luck!