Flash中本地缓存

一.SharedObject
1.类似浏览器的cookies,可以在本地存储数据,但没有过期期限,也不会传送到服务器。
创建该对象会在本地创建.sol文件,该文件在22.用户主目录下:用户主目录/随机名/localhost/SWF程序目录/SWF文件名/so名,在线状态会是#localhost
3.无法跨沙箱访问共享对象。
Flash为不同域的SWF文件创建了各自不同的目录,所以不会有命名冲突。
对于本地沙箱的文件,Flash会根据可不可以访问分配2个不同目录。

4.创建共享对象getlocal(name,local,security)
name:表示so对应的sol文件名(包含/时会创建目录)
local:表示创建SO的SWf文件的完整目录或者部分目录。默认null是完整路径,为/表示在localhost根目录下,可以被其他程序访问共享。
security:确定对该so的访问是否仅限于通过https链接的文件,如果该值为true,则通过http链接的SWf文件使用该方法时返回空。
5.销毁共享对象clear
会清除数据并且从磁盘上删除共享对象。
6.存储数据flush
Flash会在关闭应用的时候自动存储共享对象数据,也可以调用该方法显示存储。

二.应用到资源缓存
1.存储资源数据时不立即执行,而是加入到等待列表,然后没一段时间间隔存储一个文件数据。
2.更新资源
deleteFile(url):更新单个资源
deleteByFormat(format,updateSub):
更新某一目录下的某格式的文件
deleteByName(name,updateSub):更新某一目录下的指定名名字的文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1.<html> 2.<body> 3.<% 4. //SysDownloadFlashFashion等于0时就是本地下载 5. if(SysDownloadFlashFashion==0){%> 6. <div id="LoGo" solid #606080;cursor:pointer;" align="center"> 7. <div id="hideMarquee">正在检测插件<br><br></div> 8. <marquee id="marquee" 0px; white-space: nowrap;border:1px solid #606080;' direction="right" scrollamount=20 height='20' width='220'> 9. <div>■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■</div> 10. </marquee> 11. </div> 12. <div id="Chrome" 13. <%}else{%> 14. <div id="Chrome"> 15. <%}%> 16. <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 17. id="uploadfile" width="800" height="435" 18. <%if(SysDownloadFlashFashion==1){%> 19. codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" 20. <%}else{ %> 21. codebase"plugins"> 22. <% } %> 23. <param name="wmode" value="opaque" /> 24. <param name="movie" value="uploadfile.swf" /> 25. <param name="quality" value="high" /> 26. <param name="bgcolor" value="#869ca7" /> 27. <param name="allowScriptAccess" value="sameDomain" /> 28. <embed src="uploadfile.swf" wmode="opaque" quality="high" bgcolor="#869ca7" 29. width="800" height="435" name="uploadfile" align="middle" id="uploadfile" 30. play="true" 31. loop="false" 32. quality="high" 33. allowScriptAccess="sameDomain" 34. type="application/x-shockwave-flash" 35. <%if(SysDownloadFlashFashion==1){%> 36. pluginspage="http://www.adobe.com/go/getflashplayer" 37. <% }else{%> 38. pluginspage="<%=context%>/plugins/Install_Flash_Player_9_Plugin.exe"> 39. <% } %> 40. </embed> 41. </object> 42. </div> 43.</body> 44.[removed] 45.var tishi=0; 46.function InstallFlash() 47.{ 48. if((brower().isIE) || (brower().isIE7) || (brower().isIE8) && <%=SysDownloadFlashFashion%>==0) 49. { 50. LoGo.onclick=function() 51. { 52. if(tishi==0) 53. { 54. [removed].href="plugins/install_flash_player_10_active_x.exe"; 55. alert(message.uploadfile_js_IE_plugins_downLoad_remind); 56. tishi=-1; 57. } 58. } 59. } 60. if(brower().isFirefox && <%=SysDownloadFlashFashion%>==0) 61. { 62. uploadfile.onclick=function() 63. { 64. if(tishi==0) 65. { 66. [removed].href="plugins/Install_Flash_Player_9_Plugin.exe"; 67. alert(message.uploadfile_js_fireFox_plugins_downLoad_remind); 68. tishi=-1; 69. } 70. } 71. } 72. if(brower().isChrome && <%=SysDownloadFlashFashion%>==0) 73. { 74. Chrome.onmouseover=function() 75. { 76. if(tishi==0) 77. { 78. [removed].href="plugins/Install_Flash_Player_9_Plugin.exe"; 79. alert(message.uploadfile_js_Chrome_plugins_downLoad_remind); 80. tishi=-1; 81. } 82. } 83. } 84.} 85.[removed] 86.[removed] 87.var swf = false; 88.if((brower().isIE) || (brower().isIE7) || (brower().isIE8)) 89.{ 90. try 91. { 92. swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');//IE已经安装Flash插件 93. if(swf) 94. { 95. LoGo.style.display="none"; 96. Chrome.style.display="block"; 97. } 98. } 99. catch(e)//没有安装Flash插件 100. { 101. swf = false; 102. marquee.style.display="none"; 103. hideMarquee[removed]=message.uploadfile_js_hideMarquee_remind; 104. hideMarquee.style.cursor="hand"; 105. } 106.} 107.else if((brower().isFirefox) || (brower().isChrome)) 108.{ 109. LoGo.style.display="none"; 110. Chrome.style.display="block"; 111. swf = navigator.plugins["Shockwave Flash"];//FireFox,Chrome 112.} 113.if(!swf) 114.{ 115. InstallFlash(); 116.} 117.[removed] 118.</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值