Home  >  Article  >  Web Front-end  >  Flash image upload component swfupload usage guide_javascript skills

Flash image upload component swfupload usage guide_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:09:331010browse

swfupload upload editor is a flash avatar editing and uploading plug-in that supports local upload, preview, video shooting and network loading. It can be zoomed, cropped, rotated, positioned and color-adjusted. It also supports asp, asp.net, jsp , php and other multiple languages ​​

Copy code The code is as follows:

swfobject.addDomLoadEvent(function () {
              var swf = new fullAvatarEditor("swfContainer", {
                     id: 'swf',
                                  upload_url: 'asp/Upload.asp',
                         src_upload:2
                              }, function (msg) {
switch(msg.code)
                                                                                   case 1: alert("The page successfully loaded the component!");break;
case 2: alert("The default specified image has been successfully loaded into the editing panel.");break;
case 3:
If(msg.type == 0)
                                                                                              alert("The camera is ready and the user has allowed use.");
                                                                                                                         }                                                                                                                                                                                                                                                                                                                                           alert("The camera is ready but the user has not allowed it to be used!");
                                                                                                                         }                                                                                                                                                                                                                                                                           alert("Camera is occupied!");
                                                                                                                         } break;
                        case 5:
If(msg.type == 0)
                                                                                              If(msg.content.sourceUrl)
                                                                                                  alert("The original image has been successfully saved to the server, the url is: n" msg.content.sourceUrl);
                                                                                                                                           } alert("The avatar has been successfully saved to the server, the url is: n" msg.content.avatarUrls.join("n"));
                                                                                                                         } break;
                                                                                                                                             }
);
                 document.getElementById("upload").onclick=function(){
                     swf.call("upload");
               };
            });



Demo picture:

The above is a simple usage example of swfupload in this article. I hope it can be helpful to everyone.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn