handlers.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. function preLoad() {
  2. if (!this.support.loading) {
  3. alert("You need the Flash Player 9.028 or above to use SWFUpload.");
  4. return false;
  5. }
  6. }
  7. function loadFailed() {
  8. alert("Something went wrong while loading SWFUpload. If this were a real application we'd clean up and then give you an alternative");
  9. }
  10. /* **********************
  11. Event Handlers
  12. These are my custom event handlers to make my
  13. web application behave the way I went when SWFUpload
  14. completes different tasks. These aren't part of the SWFUpload
  15. package. They are part of my application. Without these none
  16. of the actions SWFUpload makes will show up in my application.
  17. ********************** */
  18. function fileDialogComplete(numFilesSelected, numFilesQueued) {
  19. this.startUpload();
  20. }
  21. function uploadSuccess(file, serverData) {
  22. try {
  23. document.getElementById("divStatus").innerHTML = this.getStats().successful_uploads + " files uploaded";
  24. var p = document.createElement("p");
  25. p.innerHTML = "FlashCookie set to " + serverData;
  26. document.getElementById("divCookieValues").appendChild(p);
  27. } catch (ex) {
  28. }
  29. }