Queueing in jQuery UI Dialog

Queueing in jQuery UI Dialog

Hi,

I'm using the uploadify plugin for uploading multiple files, it work pretty well but i'm stuck with jQuery UI Dialog.
In fact, I would like to queueing severals Dialog, one for each uploaded files.

Here my HTML :

             
  1.  <div id="prompt" title="Ajouter une image"> 
  2.    <form> 
  3.    <fieldset>
  4.       <label for="name">Nom de l'image : </label> 
  5.       <input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" value="" /><br />
  6.       <label for="description">Description de l'image : </label> 
  7.       <input type="text" name="description" id="description" value="" class="text ui-widget-content ui-corner-all" /> 
  8.       <img id="image" src="" alt="" />
  9.    </fieldset> 
  10.    </form> 
  11. </div>

(It's in French).







And my JS :

         
  1.     var imagesNames = [];
  2.    var imagesDates = [];
  3.    var images = [];
  4.    
  5.    $("#uploaderImages").uploadify({
  6.       'uploader'       : getBaseURL()+'/public/scripts/uploadify.swf',
  7.       'script'         : getBaseURL()+'/public/scripts/uploadGallery.php',
  8.       'queueID'        : 'fileQueue',
  9.       'buttonText'     : 'Parcourir',
  10.       'multi'          : true,
  11.       'auto'          : true,
  12.       onComplete: function(event, queueId, fileObj, response, data) {
  13.          imagesNames.push(fileObj.name);
  14.          imagesDates.push(fileObj.name);
  15.          images.push(getBaseURL()+'/public/pictures/'+fileObj.name);
  16.       },
  17.       onAllComplete: function(event, data) {
  18.          uploadImages(data.filesUploaded);
  19.       },
  20.    });
  21.    
  22.    function uploadImages(nb)
  23.    {
  24.       for (var i = 0; i < nb ; i++){
  25.          var image = images[i];
  26.          var name = imagesNames[i];
  27.          var date = imagesDates[i];
  28.          var description;
  29.          $('#image').attr({ 'src': image, 'alt': 'name' });
  30.          $('#name').attr({ 'value': name });
  31.          $('#prompt').dialog('open');
  32.       };
  33.    }

I would like to stop the for at the "$('#prompt').dialog('open');" and restart it when the prompt is close.

Any ideas ? Thanks :)