0 Replies Latest reply on Nov 20, 2007 3:54 PM by scootdown

    passing variables to .swf from url

    scootdown
      I have a flash menu I'm using for html web pages. The testing menu has 4 buttons (Spring,Summer, Fall, Winter). On Frame 1 of the .swf menu loads an external background.swf into an empty mc on the root timeline. Actionscript:

      var myMCL:MovieClipLoader = new MovieClipLoader();

      myMCL.loadClip("img/spring.swf", "emptyMC");

      This is a good start but, I would like FLASH to read the url value from the address bar url and apply that value to a variable to load different background.swf's into to the emptyMC movie clip.

      I believe it's FlashVars which can be used to accomplish this by passing in variables when a .swf file loads, and without forcing the browser to download the .swf menu file again. I have also read about the SWFObject javascript function which allows you to pull variable values from the url string.

      <script type="text/javascript">
      var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
      so.addVariable("variable1", getQueryParamValue("variable1"));
      so.addVariable("variable2", getQueryParamValue("variable2"));
      so.write("flashcontent");
      </script>

      I'm just having a little difficulty putting it all together, and cannot find any reference for the actionscript required on frame 1 of the menu.swf, and how to assign the variables? Thanks for any help with this...
      SD