code: protected String buildFlashVarsString(Map<String, String> flashVars) {
      try {
        StringBuilder flashvarsString = new StringBuilder();
        Iterator<Map.Entry<String, String>> flashvarsIterator = flashVars.entrySet().iterator();
        while (flashvarsIterator.hasNext()) {
          Map.Entry<String, String> entry = flashvarsIterator.next();
          flashvarsString.append(URLEncoder.encode(entry.getKey(), CharEncoding.UTF_8));
          flashvarsString.append('=');
          flashvarsString.append(URLEncoder.encode(entry.getValue(), CharEncoding.UTF_8));
          if (flashvarsIterator.hasNext()) {
            flashvarsString.append('&');
          }
        }
        return flashvarsString.toString();
      }
      catch (UnsupportedEncodingException ex) {
        throw new RuntimeException("Unsupported encoding.", ex);
      }
    }
docs: Build flashvars string to be used on HTML object element for flash embedding.
  @param flashVars flashvars map
  @return flashvars string with proper encoding