8 Replies Latest reply on Jun 10, 2006 5:24 PM by kglad

    sending string to automation controller

    jmankd
      I am developing an interface for controlling my house. The controller Can recognize URL encoded commands. My test button worked flawlessly using get URL function, but returns with opening a new browser and displaying the results. So I have been trying load vars. I created a texfile with the Command embedded. The controller needs to see the URL encoding, but looking at the output panel trace,flash Strips the encoding when it loads the text.So I have "double encoded" the text file and it looks good with the exception of a few spaces. My action Script is as follows:
      Frame
      quad = new LoadVars ();
      quad.load("quadbutton.txt");
      quad.onLoad = function (success) {
      if (success) {
      trace (" variables loaded ");
      for( var prop in this ) {
      trace (" key " + prop + " = " + this[prop]);
      }
      } else {
      trace (" Error loading variables ");
      }
      }

      Resulting output
      variables loaded
      key sendcommand.cgi?var1 = %23%23%25286C0685F509010100&var2=str&var3=%23%230
      key onLoad = [type Function]

      the spaces before and after l=l @ var 1 are a concern.
      Here is the text from the quadbutton.txt file that is loading:
      &sendcommand.cgi?var1=%2523%2523%2525286C0685F509010100%26var2=str%26var3=%2523%25230
      &

      Finally the button in the frame:
      Button
      on (release) {quad.send(" http://my_website.com:9876/");}
      It does not work, what gives?