+2  A: 

Edit: I think I finally figured it out! You simply have set the useExternalInterfaces to Yes.

So in your code you would change

<param 
  name="FlashVars"
  value="uploadButtonVisible=false&uploadUrl=../ReceiveBulkCases.aspx" />

to

<param 
  name="FlashVars"
  value="uploadButtonVisible=false&uploadUrl=../ReceiveBulkCases.aspx&useExternalInterface=Yes" />

and do the same for the <embed> tag.

If you visit the demo site and run the following code in Firebug it returns 0 before you select files and the correct count after you select files. Also, if you check the source, you'll see that the useExternalInterface option is set to Yes

alert(document.getElementById('MultiPowUpload').filesCount());

P.S. You should consider using the SWFObject script included with MultiPowUpload. It lets you set and change variables easily without having to worry about cross-browser issues and it also degrades gracefully for users without flash.


Further edit To answer your comment: Yes, I've got filesCount working on my machine.

One thing I forgot to mention is that you might be trying to retrieve filesCount before the flash control is fully loaded.

The following is the code I'm using. I copied your code exactly and added the useExternalInterface setting as well as my own javascript.

Note that my javascript code repeatedly checks the filesCount every 500 milliseconds using the setInterval function.

<object id="FlashFilesUpload1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" viewastext>
  <!-- Replace symbols " with the &quot; at all parameters values and
  symbols "&" with the "%26" at URL values or &amp; at other values!
  The same parameters values should be set for EMBED object below. -->
  <param name="FlashVars" value="uploadButtonVisible=false&uploadUrl=../ReceiveBulkCases.aspx&useExternalInterface=Yes" />
  <param name="BGColor" value="#F8F6E6" />
  <param name="Movie" value="ClientSideControls/ElementITMultiPowUpload2.1.swf" />
  <param name="Src" value="ClientSideControls/ElementITMultiPowUpload2.1.swf" />
  <param name="WMode" value="Window" />
  <param name="Play" value="-1" />
  <param name="Loop" value="-1" />
  <param name="Quality" value="High" />
  <param name="SAlign" value="" />
  <param name="Menu" value="-1" />
  <param name="Base" value="" />
  <param name="AllowScriptAccess" value="always" />
  <param name="Scale" value="ShowAll" />
  <param name="DeviceFont" value="0" />
  <param name="EmbedMovie" value="0" />
  <param name="SWRemote" value="" />
  <param name="MovieData" value="" />
  <param name="SeamlessTabbing" value="1" />
  <param name="Profile" value="0" />
  <param name="ProfileAddress" value="" />
  <param name="ProfilePort" value="0" />
  <!-- Embed for Netscape,Mozilla/FireFox browsers support. Flashvars parameters are the same.-->
  <!-- Replace symbols " with the &quot; at all parameters values and symbols "&" with the "%26" at URL values or &amp; at other values! -->
  <embed bgcolor="#F8F6E6" id="EmbedFlashFilesUpload" src="ClientSideControls/ElementITMultiPowUpload2.1.swf"
    quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash" width="450" height="350" flashvars="uploadButtonVisible=false&uploadUrl=../ReceiveBulkCases.aspx&useExternalInterface=Yes">
  </embed>
</object>


<script>
  function updateMessage() {
    var message = (new Date()).toLocaleTimeString() + ': ';

    try {
      var objectElement = document.getElementsByTagName('object')[0];
      var embedElement = document.getElementsByTagName('embed')[0];

      if (objectElement.filesCount) {
        message += 'We are in IE ' + objectElement.filesCount();
      }
      else if (embedElement.filesCount) {
        message += 'We are in Firefox ' + embedElement.filesCount();
      }
      else {
        message += "The flash object is not loaded or useExternalInterface is not set to 'Yes'";
      }
    }
    catch (exp) {
      message += 'An error occurred';
    }
    document.getElementById('message').innerHTML = message;
  }

  // Update the message every 500 milliseconds
  setInterval(updateMessage, 500);
</script>
brianpeiris
Thanks, I tried that, but that actually throws an exception.
Shaul
Hmm, you're right I should have realized that. From what you've said so far, it should work. Are you trying to access filesCount *before* you select files? Are you sure "FlashFilesUpload1" is the correct id for the flash object (especially if you are using multiple upload objects). It would help if you provided some sample HTML and javascript
brianpeiris
I've updated my answer with another suggestion.
brianpeiris
Thanks, I've updated the question now...
Shaul
I think I found the problem. I've updated my answer.
brianpeiris
Nope, that didn't make any difference... :( In any case, the default value of useExternalInterface is true. I'll try the object script provided by MultiPowUpload, see where that gets me... BTW, even if it's still not working out, your help is REALLY appreciated - THANK YOU!
Shaul
Well, I managed to get the control working using the embedSWF() stuff from the website, as suggested - but the javascript interface still doesn't work... I can't get a single member of the MultiPowUpload interface to work - not properties, not methods - and it doesn't seem to make any difference whether I do it by embedding it as an <object> or using embedSWF(). Did you manage to get it to respond to javascript calls, even in a simple "Hello World" type test?
Shaul
I've updated my answer with the code that I'm using to make it work. My code doesn't work if you don't set the useExternalInterface to Yes explicitly. Perhaps the documentation is wrong about it being true by default.
brianpeiris