ActionScript 3 更改HTML背景颜色

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 更改HTML背景颜色相关的知识,希望对你有一定的参考价值。

import flash.external.*;  

btn.addEventListener(MouseEvent.CLICK, function() { 
	var jsCall:String;
	jsCall = String(ExternalInterface.call("changeBgColor", "#fffecb"));  
	trace("Click")
});


//And in the HTML code
<script language="JavaScript">  
function changeBgColor(newBgColor)  
{  
if (window.document && window.document.bgColor)  
   {  
      document.bgColor = newBgColor;  
   }  
}  
</script>

以上是关于ActionScript 3 更改HTML背景颜色的主要内容,如果未能解决你的问题,请参考以下文章