开发者

AIR 3.0 NativeWindowRenderMode is not defined

I'm building an AIR application with Flash Builder 4. in the application descriptor I set the minimum AIR version to 3.0 I'm building against Flex SDK 4.5.1 which I overlayed with the AIR 3.0 SDK

I have this line of code in my app:

            var nativeWinOpt:NativeWindowInitOptions = 开发者_如何学编程new NativeWindowInitOptions();
            nativeWinOpt.renderMode = NativeWindowRenderMode.GPU;

this compiles fine, but when I run it in ADL, I get:

ReferenceError: Error #1065: Variable flash.display::NativeWindowRenderMode is not defined.

What's the problem? NativeWindowRenderMode should be available in AIR 3.0?


have you imported it?

import flash.display.NativeWindowRenderMode;

you can also try to simply assign the string as the value instead of using the constant:

nativeWinOpt.renderMode = "gpu";

i'll assume your AIR 3 setup is correct since it doesn't seem to be complaining about the renderMode property, but you can check to see if AIR 3 is being targeted with:

trace("AIR Version: " + NativeApplication.nativeApplication.runtimeVersion);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜