/ Published in: ActionScript 3
Expand |
Embed | Plain Text
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>
Comments
Subscribe to comments
You need to login to post a comment.

For some reason the actionscript is giving me errors. Any idea why?
For some reason the actionscript is giving me errors. Any idea why?
There was a " missing and it also was in AS2. Now it's updated.