3 Replies Latest reply on Jun 17, 2009 11:13 PM by kglad

    object not embedded error whenever i tried to access actionscript function from js

    PurpleArts Level 1

      hi,

       

      i badly need help in embedding my swf in html , because it keeps saying that my object is undefined.

      object undefined error.

       

      i am trying to pass values from js to actionscript and then i embedded it.

      i tried to embed it using embed and object tags only, but the javascript functions are not working.

      It keeps saying that object is expected.

       

      <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        codebase="http://download.macromedia.com/" WIDTH="500" HEIGHT="500" id="flaMovie1">
        <PARAM NAME=movie VALUE="dwpPlayer.swf">
        <PARAM NAME="allowScriptAccess" value="always" />
        <PARAM NAME=quality VALUE=high>
        <EMBED src="dwpPlayer.swf"
          quality=high bgcolor="#aaaaaa" WIDTH="400" HEIGHT="200"
          TYPE="application/x-shockwave-flash"
          PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
        </EMBED>
      </OBJECT>

       

       

      i am trying to embed it that way, the swf is showing but the javascripts and functions are not working..

       

      please help. i already tried using the AC FL RunContent, yes it is showing but i can't postion my items using this

       

      <table>
                              <td>
                              hoy!
                              </td>
                          </tr>
                          <tr>
                              <td>
                                  <div visibility:visible>

       

                                  <script language="JavaScript" type="text/javascript">
                                  AC_FL_RunContent(
                                  'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
                                  'width', '400',
                                  'height', '400',
                                  'src', 'dwpPlayer',
                                  'quality', 'high',
                                  'pluginspage', 'http://www.adobe.com/go/getflashplayer',
                                  'align', 'middle',
                                  'play', 'true',
                                  'loop', 'true',
                                  'scale', 'showall',
                                  'wmode', 'window',
                                  'devicefont', 'false',
                                  'id', 'dwpPlayer',
                                  'bgcolor', '#ffffff',
                                  'name', 'dwpPlayer',
                                  'menu', 'true',
                                  'allowFullScreen', 'false',
                                  'allowScriptAccess','always',
                                  'movie', 'dwpPlayer',
                                  'salign', ''
                                  ); //end AC code
                                  </script>
                                  </div>
                              </td>

        • 1. Re: object not embedded error whenever i tried to access actionscript function from js
          kglad Adobe Community Professional & MVP

          you shouldn't have any div tags surrounding your ac_fl_runcontent() function.

           

          to position your swf, use divs around your object tags.

           

          and you need all three param and embed tags and the ac_fl_runcontent() to correctly embed a swf (or use swfobject).  and then you need the correct js.

          • 2. Re: object not embedded error whenever i tried to access actionscript function from js
            PurpleArts Level 1

            i'm quite confused with this..

            i need the Object Tag, the Embed Tag and the AC FL Content to fully use the swf? but what happens is whenever i tried to do that, the swf duplicates.

             

            can you please give me some samples on how to do that properly because, i'm so confused with the behavior, because locally, i made the embed object tags work to pass variables from javascript to as and vice versa but whenever i tried to place it in a server, it doesn't work properly. i mean it only works in mozilla, but then again its not working in IE.

             

            you can refer to the attached file for my sample.

            • 3. Re: object not embedded error whenever i tried to access actionscript function from js
              kglad Adobe Community Professional & MVP

              here's a sample of correct embedding html.  you'll need AC_RunActiveContent.js, too:

               

              <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
              <head>
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
              <title>Bday-flowers_Preview_NoMusic</title>
              <script language="javascript">AC_FL_RunContent = 0;</script>
              <script src="AC_RunActiveContent.js" language="javascript"></script>
              </head>
              <body bgcolor="#cdb4a7">
              <!--url's used in the movie-->
              <!--text used in the movie-->
              <!--
              <p align="center"><font face="Arial" size="40" color="#2d3271" letterSpacing="0.000000" kerning="1">Preview Only</font></p><p align="center"></p><p align="center"><font face="Arial" size="40" color="#2d3271" letterSpacing="0.000000" kerning="1">(Your message will </font></p><p align="center"><font face="Arial" size="40" color="#2d3271" letterSpacing="0.000000" kerning="1">appear here.)</font></p><p align="center"></p><p align="center"></p><p align="center"></p><p align="center"></p><p align="center"></p><p align="center"></p>
              -->
              <!-- saved from url=(0013)about:internet -->
              <script language="javascript">
                  if (AC_FL_RunContent == 0) {
                      alert("This page requires AC_RunActiveContent.js.");
                  } else {
                      AC_FL_RunContent(
                          'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                          'width', '990',
                          'height', '680',
                          'src', 'Bday-flowers_Preview_NoMusic',
                          'quality', 'high',
                          'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                          'align', 'middle',
                          'play', 'true',
                          'loop', 'true',
                          'scale', 'showall',
                          'wmode', 'window',
                          'devicefont', 'false',
                          'id', 'Bday-flowers_Preview_NoMusic',
                          'bgcolor', '#cdb4a7',
                          'name', 'Bday-flowers_Preview_NoMusic',
                          'menu', 'true',
                          'allowFullScreen', 'true',
                          'allowScriptAccess','sameDomain',
                          'movie', 'Bday-flowers_Preview_NoMusic',
                          'salign', ''
                          ); //end AC code
                  }
              </script>
              <noscript>
                  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="990" height="680" id="Bday-flowers_Preview_NoMusic" align="middle">
                  <param name="allowScriptAccess" value="sameDomain" />
                  <param name="allowFullScreen" value="true" />
                  <param name="movie" value="Bday-flowers_Preview_NoMusic.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#cdb4a7" />    <embed src="Bday-flowers_Preview_NoMusic.swf" quality="high" bgcolor="#cdb4a7" width="990" height="680" name="Bday-flowers_Preview_NoMusic" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
                  </object>
              </noscript>
              </body>
              </html>