function FileSubmit(FileURL) {
    var win = tinyMCE.getWindowArg("window");
    var editorID = tinyMCE.getWindowArg("editorID");
    win.document.getElementById(tinyMCE.getWindowArg("input")).value = FileURL;
    if (win.getImageData) {
        win.getImageData(FileURL);
    }
    win.tinyMCE.setWindowArg('editor_id', editorID);
    tinyMCEPopup.close();
}

@@ -37,32 +37,37 @@
 ar win = tinyMCE
+Popup
 .getWindowArg(%22w
@@ -97,24 +97,29 @@
 ID = tinyMCE
+Popup
 .getWindowAr
@@ -172,16 +172,21 @@
 (tinyMCE
+Popup
 .getWind
@@ -302,16 +302,21 @@
 .tinyMCE
+Popup
 .setWind
@@ -373,8 +373,737 @@
 se();%0A%7D%0A
+%0Avar FileBrowserDialogue = %7B%0A    init : function () %7B%0A        // Here goes your code for setting your custom things onLoad.%0A    %7D,%0A    fileSubmit : function (FileURL) %7B%0A        var URL = FileURL;%0A        var win = tinyMCEPopup.getWindowArg(%22window%22);%0A%0A        // insert information now%0A        win.document.getElementById(tinyMCEPopup.getWindowArg(%22input%22)).value = URL;%0A%0A        // for image browsers: update image dimensions%0A        if (win.ImageDialog.getImageData) win.ImageDialog.getImageData();%0A        if (win.ImageDialog.showPreviewImage) win.ImageDialog.showPreviewImage(URL);%0A%0A        // close popup window%0A        tinyMCEPopup.close();%0A    %7D%0A%7D%0A%0AtinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);%0A%0A

update to tinymce 3.0