Hello !
I develops a program which uses swfupload. My program works very well on IE7, firefox2 and firefox 3. But on IE6, i've got an error on the settings of swfupload. The error is : swfUploadLoaded is undefined.
Can somebody help me ?
Thank for your response. And excuse me for my bad english...
Code
Sounds like you have a type-o or undefined function that you are trying to assign to an event handler in your settings.
A code snippet or you settings and handlers would be helpful.
That's my code when I
That's my code when I initializes swfupload in my javascript. I uses also the swfobject plugin. Don't care about "Explorer", it's an object that I creates for my program. I don't understand why my program works on IE7, firefox2 and 3, and not on IE6. It's very strange...
Explorer.swfu;
SWFUpload.onload = function ()
{
Explorer.settings =
{
flash_url : Explorer.basePath+"public/file/fla/gfx/swfupload_f9.swf",
upload_url: Explorer.basePath+"file/explorer/upload", // Relative to the SWF file
post_params: {},
file_size_limit : Explorer.maxsize+" KB",
file_types : Explorer.ext,
file_types_description : "All Files",
file_upload_limit : 100,
file_queue_limit : 0,
custom_settings :
{
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: true,
// The event handler functions are defined in handlers.js
swfupload_loaded_handler : swfUploadLoaded,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete, /// Queue plugin event
// SWFObject settings
minimum_flash_version : "9.0.28",
swfupload_pre_load_handler : swfUploadPreLoad,
swfupload_load_failed_handler : swfUploadLoadFailed
};
Explorer.swfu = new SWFUpload(Explorer.settings);
}
After that, I tries to replace all my settings of event handlers by : "this.swfUploadLoaded this.fileQueued, ... . I've got an exception in SWFUpload.prototype.initSWFUpload when loadFlash() is called... !!!
event functions
In fact, I think it doesn't recognize function handlers because if I delete the line "swfupload_loaded_handler : swfUploadLoaded,", i've got the same error with the line under : "fileQueued is undefined".
Functions
Do you have a handlers.js file or have your functions all defined. Since you are using SWFObject you should make sure that your functions are declared early or included near the top so you can be IE realizes they are there before it tries to kick off SWFUpload.
Somewhere you need to declare your event handlers:
function swfUploadLoaded() {
}
function fileQueued() {
}
P.S. If you aren't specifically using those events for anything then do not include them in your settings.
re
I've got a handlers.js of the application demo and my librairies are declared before :
basePath ?>public/file/js/swfupload/swfupload.js">
basePath ?>public/file/js/swfupload/swfupload.swfobject.js">
basePath ?>public/file/js/swfupload/swfupload.queue.js">
basePath ?>public/file/js/swfupload/fileprogress.js">
basePath ?>public/file/js/swfupload/handlers.js">
basePath ?>public/file/js/ext/ext-base.js">
basePath ?>public/file/js/ext/ext-all-debug.js">
basePath ?>public/file/js/tree.js">
basePath ?>public/file/js/explorerExt.js">
Explorer.initialize();
And the SWFUpload.onLoad is in the Explorer.initialize.