0 Replies Latest reply: May 11, 2011 2:25 AM by liketanglung RSS

    How to call actionscript from javascript

    liketanglung Community Member

      My flash file embed in <applet>:

       

      <applet id="FlipPhone" archive="javaBase.jar" code="Core.class" width="418"
       height="418" align="" MAYSCRIPT>
           <param name="movie" value="flipphone.swf">
           <param name="Scale" value="showall">
           <param name="SAlign" value="">
      </applet>

       

       

       

      I have used 'ExternalInterface' to call a actionscript function in file flipphone.swf from javascript, but that don't work.
      Help me please :confused:

       


      All code in html file:

       

      <head>
      <title>Flipphone demo</title>
           <script type="text/javascript" language="javascript">    
                  function thisMovie(movieName) {
                      if (navigator.appName.indexOf("Microsoft") != -1) {
                          return window[movieName];
                      } else {
                          return document[movieName];
                      }
                  }
                   
                  function doWhat(value) {
                      thisMovie(value).Open_Close();
                  }
           </script>
      </head>
      <body scroll="no" bgcolor="#ffffff" text="#000000" leftmargin="0"
      topmargin="0" marginwidth="0" marginheight="0">
           <table height="100%" width="100%" border="0" cellpadding="0" 
      cellspacing="0">
           <tr>
           <td align="center" valign="middle">
                <applet id="FlipPhone" archive="javabase.jar" code="jcore.class" 
      width="418" height="418" align="" MAYSCRIPT>
                     <param name="movie" value="flipphone.swf">
                     <param name="Scale" value="showall">
                     <param name="SAlign" value="">
                 </applet>        
           </td>
           </tr>
           </table>
           <input type="button" value="Frame 2" onClick="doWhat('FlipPhone');" />
      </body>