topical media & game development

talk show tell print

professional-javascript-18-FlashExample3.htm / htm

          <title>Flash Example</title>
          <script type="text/javascript">
              function setMessage() {
                  var oFlashMovie = document.getElementById("ExampleMovie");
                  var txtMessage = document.getElementById("txtMessage");
                  oFlashMovie.SetVariable("/:jsMessage", txtMessage.value);
              function getMessage() {
                  var oFlashMovie = document.getElementById("ExampleMovie");
                  alert("The current message is \"" + oFlashMovie.GetVariable("/:jsMessage") + "\".");
          <object type="application/x-shockwave-flash" data="ExampleMovie2.swf" 
          width="200" height="200" id="ExampleMovie">
              <param name="movie" value="ExampleMovie2.swf" />
          <p><input type="text" id="txtMessage" value="New Message" /><input type="button" value="Set Message" onclick="setMessage()" /><br />
          <input type="button" value="Get Current Message" onclick="getMessage()" /></p>

(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.