Starling项目启动时报错This application is not correctly embedded (wrong wmode value)

时间:2023-03-10 05:26:50
Starling项目启动时报错This application is not correctly embedded (wrong wmode value)

这个其实是Flash报的“ErrorEvent:。 text=Error #3702: Context3D 不可用”错误被Starling变了一下。

解决方法:找到项目文件夹中的html-template,并找到index.template.html,右键使用TextEditor编辑,在

params.allowfullscreen=”true”;后面加上params.wmode = "direct";最好下面的embed也这样配置下 <param name="allowFullScreen" value="true" />后面加 <param name="wmode" value="direct" />

如果是手机项目,没有index.template.html文件,则在项目的app.xml里面改(一般是项目名-app.xml文件)。在“</initialWindow>”前面增加两行
        <renderMode>direct</renderMode>
        <fullScreen>true</fullScreen>
就算已经有<fullScreen>true</fullScreen>了也要在renderMode后面加一行,要不然会出现不报错的白屏。
------------------------------------------------------------------------------------------------
PS:附加正常运行的手机项目的-app.xml的initialWindow配置:
        <aspectRatio>landscape</aspectRatio>
        <renderMode>direct</renderMode>
<fullScreen>true</fullScreen>
        <visible>true</visible>