FancyUpload 2.0 - problem returning values from JS methods to Flash in IE after ExternalInterface.call()

15 views
Skip to first unread message

temuri

unread,
Nov 11, 2008, 8:30:32 PM11/11/08
to MooTools Users
Hi all,

I've been trying to customize FancyUpload to pass extra data via POST
with every upload (file title and description fields).

Everything works fine in FF, but in IE6 & 7 POST is not sent to the
server.

After many hours of debugging I discovered, that the problem lies in
this method:

onBeforeOpen: function(file, options) {
this.log('Initialize upload for "{name}".', file);
var fn = this.options.fileUpload;
var obj = (fn) ? fn.call(this, this.getFile(file), options) :
options;
return obj;
},

`obj` contains additional data for POST - title and description. It is
not received by Flash caller in IE, thus it's not sent to the server.

It appears that IE occasionally has problems with
ExternalInterface.call() calls and loses values returned by Javascript
functions.

I found a link on the web that describes similar behaviour:
http://scott.harwell.me/?p=108. There the author claims that <embed />
tags should be used. However, Swiff only uses <object /> tag. Could
this be a problem?

There is another place in FancyUpload code that creates problem with a
similar symptoms.

Open the following in IE: http://digitarald.de/project/fancyupload/2-0/showcase/photoqueue-fixed/

Check"Images only" checkbox, click "Browse File" link. You will see
that filter was not applied and file mask is set to *.* (in FF you are
going to see image file extensions).

In this case, the problem lies in:

initialize: function(options){

....

if (!callBacks.onBrowse) {
callBacks.onBrowse = function() {
return this.options.typeFilter;
}
}
}

See "return this.options.typeFilter;" there? Well, that's exactly what
does not go back to Flash in IE.

I have Flash 10 and I've tested this in Flash 9 as well. IE gets it
all wrong on both cases.

The problem looks quite serious, this essentially renders external
interface calls unusable.

Any help offered will be greatly appreciated.

Thanks,
Temuri

Harald

unread,
Nov 27, 2008, 12:06:46 PM11/27/08
to MooTools Users
I'm looking into that for a long time. My latest guess, is that IE
probably needs <embed> for that (not <object>, like it is now for all
browsers). It is a really weird problem and I had no solution for now.
I'd be happy about any ideas.

temuri

unread,
Nov 27, 2008, 6:34:03 PM11/27/08
to MooTools Users
I managed to get SWFUpload.org working. They are using
ExternalInterface.callI() too. But, no Mootools (or swfobject) to
embed flash.

I tend to think that it's the lack of "embed" that makes IE go
crazy...

I suppose the right thing to test is to override Swiff's SWF injection
and try different tags.

Temuri

temuri

unread,
Nov 29, 2008, 2:48:09 PM11/29/08
to MooTools Users
Harald,

actually, it looks like a bug report for Mootools development team.

do you have time to create a test page and submit it?

Temuri
Reply all
Reply to author
Forward
0 new messages