tags:

views:

24

answers:

1

I bought this program that created a pretty nice imageuploader flash script however I can't get the Javascript function close window to close the popup and redirect the original page.

here is the XML piece that defines the url's:

<urls urlToUpload="upload.php?" urlOnUploadSuccess="http://www.home.com/purchase.html" 
urlOnUploadFail="http://www.home.com/tryagain.html"  
urlUpdateFlashPlayer="http://www.home.com/flashalternative.html"        
jsFunctionNameOnUpload=""/>

This last line calls a javascript function on upload. The problem is I don't know what to call and where to put it.

Here is the HTML file that is the popup:

<HEAD>
    <title>Baublet Uploader</title>
    <script type="text/javascript" src="swfobject.js"></script> 
</HEAD>
<BODY>
<!-- Q-ImageUploader  www.quadroland.com -->
<div id="QImageUploader">
 Flash Player stuff here        
</div>
<script type="text/javascript">
// <![CDATA[
    var so = new SWFObject("q_image_uploader.swf", "imageuploader", "650", "430", "9", "#FFFFFF");
    so.addParam("scale", "noscale");
    so.addParam("salign", "TL");
    so.addVariable("AdditionalStringVariable","pass additional data here");              
    so.write("QImageUploader");
// ]]>
</script>

I found this Closing script I thought might work:

<script language="javascript">
function close_window(page) {
window.opener.location.href=page
setTimeout(function(){window.close()},10);
}
</script>

Does this go into the Popup HTML page above or would it be a separate close.js file in the root?

Thanks,

I'm really confused.

A: 

It looks like that bit of script belongs to the popup. It changes the parent window's location and then closes itself after a ~10ms delay. The function close_window most likely is being called by the Flash applet.

Ates Goral
Bingo, I tried that... but I had the script in the body and not in the header. NooBE. Thanks for your time.
Michael Robinson