Skip to main content
Known Participant
July 22, 2011
Question

flashvars

  • July 22, 2011
  • 1 reply
  • 576 views

In Dreamweaver I have set up a parameter to insert->media->swf:

<param name="flashVars" value="userName=mc1" />

I need to retrive this in AS 3 and can't get it to work.  Here I am trying to view the variable in a text field.

myText.text = root.loaderInfo.parameters.userName;

This isn't working.

Ideas?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 23, 2011

you are opening your html file in your browser, correct?  if no, do so to test.  if yes, copy and paste your html.

rjhAuthor
Known Participant
July 23, 2011

Here you go:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
</style>
<link href="questionpage.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
<script src="../Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>

<body>
<div id="container">
  <div id="header">Course Title</div>
  <div id="contentarea">
    <div id="question">
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="300" id="FlashID" title="Multiple Choice">
        <param name="movie" value="multipleChoice.swf" />
        <param name="quality" value="high" />
        <param name="swfversion" value="6.0.65.0" />
        <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
        <param name="expressinstall" value="../Scripts/expressInstall.swf" />
        <param name="flashVars" value="userName=mc1" />
        <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="multipleChoice.swf" width="600" height="300">
          <!--<![endif]-->
          <param name="quality" value="high" />
          <param name="swfversion" value="6.0.65.0" />
          <param name="expressinstall" value="../Scripts/expressInstall.swf" />
          <param name="flashVars" value="userName=mc1" />
          <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
          <div>
            <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
            <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
          </div>
          <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>
    </div>
  </div>
  <div id="footer">&copy; 2011 Acme Technologies</div>
</div>
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
</body>
</html>

kglad
Community Expert
Community Expert
July 23, 2011

That is what Dreamweaver5.5  creates when using insert>media>swf.


it's still incorrect.  that's why your flashvars isn't working.

you could google swfobject and see how to define flashvars parameters when using swfobject, add that to you current two flashvars param tags and see if that works.