Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Yeah, sorry, my bad. I forgot to explicitly set swf-version.
Copy link to clipboard
Copied
That'll do it. Glad you got it working, good luck!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now