Java代碼
- import flash.external.ExternalInterface;
- function hello(){
- return "測試成功了哦~~";
- }
- //允許flash調用js函數 參數1:js函數名稱 參數2:向js函數傳遞的參數
- ExternalInterface.call("hello", "jacky");
- //允許js調用flash中的函數 參數1:要調用flash函數的js函數,參數2:被調用flash函數
- ExternalInterface.addCallback("helloas",hello);
import flash.external.ExternalInterface;function hello(){return "測試成功了哦~~";}//允許flash調用js函數 參數1:js函數名稱 參數2:向js函數傳遞的參數ExternalInterface.call("hello", "jacky");//允許js調用flash中的函數 參數1:要調用flash函數的js函數,參數2:被調用flash函數ExternalInterface.addCallback("helloas",hello);
接下來是 JSP頁面
把你產生SWF 檔案放入工程相應的目錄下 把路徑自己的路徑就可以了
當然
Java代碼
-
- String path = request.getContextPath();
- String basePath = request.getScheme() + "://"
- + request.getServerName() + ":" + request.getServerPort()
- + path + "/";
- %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- pluginspage="http://www.macromedia.com/go/getflashplayer"
- type="application/x-shockwave-flash" width="560" height="270" allowScriptAccess="always" wmode="transparent" >
-
-
-
-