2 Replies Latest reply on May 23, 2006 8:34 AM by skot:317

    flash to html to flash

    skot:317 Level 1
      I've read how to send a variable TO html and how to retrieve a variable FROM html, but how do I do this in one swoop? I'm just testing now, but I want to send text to a variable (to html) by clicking a button in flash, then have another text field show that same text at the same time.

      I know that it is being sent by testing (an alert()) but the textfield is not updating. Please help.

      * The Javascript part shows how I could use <PARAM><EMBED> and flash.swf?var=

      go_btn.onRelease = function(){
      if(comment_add!=""){ //the textfield which you type

      comment_txt = comment_fv; //the textfield that shows the text you wrote
      comment_txt = "Nothing has been typed";

      var whatswf = "flashvars";
      var swf_w = "550";
      var swf_h = "400";
      var comment_html = "";
      //var rannum = "";
      function update(comment)
      comment_html = comment;

      //var paramst = "?comment_fv=" + comment_html + "&rannum=" + Math.floor(Math.random() * 65000); //FlashVars
      var newtext = "<CENTER><OBJECT classid='clsid 27CDB6E-AE6D-11cf-96B8-444553540000' ";
      newtext+= " codebase=' http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' ";
      newtext+= " ID='" + whatswf + "' WIDTH='" + swf_w + "' HEIGHT='" + swf_h + "' ALIGN=''>";
      newtext+= " <PARAM NAME=movie VALUE=" + whatswf + ".swf>";// + paramst + ">";
      newtext+= " <PARAM NAME=quality VALUE=high>";
      newtext+= " <PARAM NAME=scale VALUE=noborder>";
      newtext+= " <PARAM NAME=bgcolor VALUE=#FFFFFF>";
      newtext+= " <PARAM NAME=FlashVars VALUE=comment_fv=" + comment_html +">"; //FlashVars
      newtext+= " <EMBED src=" + whatswf + ".swf";// + paramst;
      newtext+= " quality=high scale=noborder bgcolor=#FFFFFF";
      nnst += " FlashVars='comment_fv=" + comment_html + "'"; //FlashVars
      newtext+= " WIDTH='" + swf_w + "' HEIGHT='" + swf_h + "' swLiveConnect=true ID='" + whatswf + "' NAME='" + whatswf + "' ALIGN='' ";
      newtext+= " TYPE='application/x-shockwave-flash' ";
      newtext+= " PLUGINSPAGE=' http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT></CENTER>";

        • 1. Re: flash to html to flash
          zensoldier Level 1
          I'm not sure I understand what you are trying to do from what the user sees where.

          It sounds like you want hte user click a button in flash and have a piece of text appear in flash and also be sent to javascript.

          Is that accurate?
          • 2. Re: flash to html to flash
            skot:317 Level 1
            That is correct. This is just a test for functionality, ultimately it's preparing for LMS/tracking project.

            The user clicks the button, and text is sent to javascript. At the same time, flash reads that variable and displays the text. That variable is saved somewhere for later use.

            I have it working now, but I can only send text once, then on a second click I get an HTML error.