3 Replies Latest reply on Jan 7, 2009 9:55 AM by Cgull

    FlashVars help

    Cgull
      Hi,

      I'm trying for days now to find a solution for my problem.

      I'm transferring flashvars from my html to the swf file but I don't know how to read them in the flash file.

      I search lots of forums and used the example in flash help but it doesn't work.

      I use Flash CS3 with actionscript 2.

      My code in the first frame is:

      if (_level0.xmlFile == undefined) {
      xmlFiles = "xml/albuminfo.xml";
      } else {
      xmlFiles = _level0.xmlFile;
      }

      My code in the html file is:

      <noscript>
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="590" height="300" id="iTunesAlbumArt" align="middle">
      <param name="allowScriptAccess" value="sameDomain" />
      <param name="allowFullScreen" value="false" />
      <param name="movie" value="iTunesAlbumArt.swf" />
      <param name="FlashVars" value="xmlFile=xml/albuminfo2.xml">
      <param name="quality" value="high" /><param name="bgcolor" value="#000000" />
      <embed src="iTunesAlbumArt.swf" FlashVars="xml/albuminfo2.xml" quality="high" bgcolor="#000000" width="590" height="300" name="iTunesAlbumArt" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />
      </object>
      </noscript>

      The variable the flash file gets is always undefined.

      Can someone please help me and tell me what am I doing wrong?

      Thank you,

      Cgull

        • 1. Re: FlashVars help
          kglad Adobe Community Professional & MVP
          use:

          <embed src="iTunesAlbumArt.swf" FlashVars="xmlFile=xml/albuminfo2.xml" quality="high"

          • 2. Re: FlashVars help
            Cgull Level 1
            Thanks, I tried that too, and still, the var is undefined. :(

            <noscript>
            <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="590" height="300" id="iTunesAlbumArt" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="allowFullScreen" value="false" />
            <param name="movie" value="iTunesAlbumArt.swf" />
            <param name="FlashVars" value="xmlFile=xml/albuminfo2.xml">
            <param name="quality" value="high" /><param name="bgcolor" value="#000000" />
            <embed src="iTunesAlbumArt.swf" FlashVars="xmlFile=xml/albuminfo2.xml" quality="high" bgcolor="#000000" width="590" height="300" name="iTunesAlbumArt" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />
            </object>
            </noscript>
            • 3. Re: FlashVars help
              Cgull Level 1
              HA !!!

              I found it, I needed to add the flashvars in the JS part of the html too !!!

              YEY, at last ! :)

              <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=8,0,0,0',
              'width', '590',
              'height', '300',
              'src', 'iTunesAlbumArt',
              'quality', 'high',
              'pluginspage', ' http://www.macromedia.com/go/getflashplayer',
              'align', 'middle',
              'play', 'true',
              'loop', 'true',
              'scale', 'showall',
              'wmode', 'window',
              'devicefont', 'false',
              'id', 'iTunesAlbumArt',
              'FlashVars','xmlFile=xml/albuminfo2.xml',
              'bgcolor', '#000000',
              'name', 'iTunesAlbumArt',
              'menu', 'true',
              'allowFullScreen', 'false',
              'allowScriptAccess','sameDomain',
              'movie', 'iTunesAlbumArt',
              'salign', ''
              ); //end AC code
              }
              </script>