Saturday, 19 May 2012

Wrong wmode value in Starling

A common issue that occurs when you have not set the wmode attribute in the HTML page is the following message "This application is not correctly embedded (wrong wmode value)".


The solution is very simple. Set the wmode attribute in the HTML to "direct". I have included my HTML code below as an example. I have embedded the swf using the swfobject. In the Starling framework in order for Stage 3D and GPU acceleration to work the wmode must to be set to direct. If it is not set to direct you may get a runtime exception when you compile the swf. You will most likely get the Error 3707: Context3D not available.

<!DOCTYPE HTML>
<head>
 
 <title>Wrong wmode value in Starling</title>
 
 <script src="swfobject.js"></script> 

 <script>

  var flashvars ={};
  var params = {};
  var attributes = { wmode:"direct" };
  
  swfobject.embedSWF("main.swf", "flashContent", "550", "400", "11", false, flashvars, params, attributes);

 </script> 

</head> 

<body> 
 <div id="flashContent"></div>
</body> 

</html>

1 comments:

Dominic Schumerth 11 May 2013 at 10:59  

Thanks this was exactly what I was looking for.

  COPYRIGHT © 2014 · ILIKE2FLASH · Theme by Ourblogtemplates

Back to TOP