Reputation: 185
I have no idea what's going on with this one. I have 2 placeholder elements that I replace with uploadify instances. The 2 placeholder html elements are exactly the same, and they are replaced with with the exact same uploadify code (loop through the 2 placeholders with a jquery .each). The only difference is that they have different IDs.
One of them works completely fine, the other one throws the exception 'cannot read property queueData of undefined'. I checked in the uploadify code and this is happening because it can't find the swfupload that should be stored. The relevant code within uploadify is here
if (flashInstalled) {
// Create the swfUpload instance
window['uploadify_' + settings.id] = new SWFUpload(swfUploadSettings);
var swfuploadify = window['uploadify_' + settings.id];
// Add the SWFUpload object to the elements data object
$this.data('uploadify', swfuploadify);
and the part where it's trying to retrieve it from the $this.data
// Start uploading files in the queue
upload : function() {
var args = arguments;
this.each(function() {
// Create a reference to the jQuery DOM object
var $this = $(this),
swfuploadify = $this.data('uploadify');
// Reset the queue information
swfuploadify.queueData.averageSpeed = 0;
swfuploadify.queueData.uploadSize = 0;
swfuploadify turns up as 'undefined'. I debugged into this as it was happening, and that first line where it set that data definitely happened, but it was undefined by the time the second part happened. I don't understand this at all.
Upvotes: 3
Views: 2218
Reputation: 113
It seems obvious but check that you have flash installed, I just ran across the exact bug on our development machine and that's resolved the issue.
Upvotes: 2