DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> Flash圖片上傳組件 swfupload使用指南
Flash圖片上傳組件 swfupload使用指南
編輯:關於JavaScript     

swfupload上傳編輯器是一款支持本地上傳、預覽、視頻拍照和網絡加載的flash頭像編輯上傳插件,可縮放、裁剪、旋轉、定位和調色等,同時支持asp、asp.net、jsp、php等多語種

復制代碼 代碼如下:
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("頁面成功加載了組件!");break;
                           case 2 : alert("已成功加載默認指定的圖片到編輯面板。");break;
                           case 3 :
                               if(msg.type == 0)
                               {
                                   alert("攝像頭已准備就緒且用戶已允許使用。");
                               }
                               else if(msg.type == 1)
                               {
                                   alert("攝像頭已准備就緒但用戶未允許使用!");
                               }
                               else
                               {
                                   alert("攝像頭被占用!");
                               }
                           break;
                           case 5 :
                               if(msg.type == 0)
                               {
                                   if(msg.content.sourceUrl)
                                   {
                                       alert("原圖已成功保存至服務器,url為:\n" + msg.content.sourceUrl);
                                   }
                                   alert("頭像已成功保存至服務器,url為:\n" + msg.content.avatarUrls.join("\n"));
                               }
                           break;
                       }
                   }
               );
               document.getElementById("upload").onclick=function(){
                   swf.call("upload");
               };
           });

演示圖:

以上就是本文關於swfupload的簡單使用示例了,希望對大家能夠有所幫助。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved