FLASH BUILDER 清除图片缓存

很多时候需要清除图片缓存

经常的做法有两种

1 将 image里的cachePolicy 设为off

<mx:Image id="img"  visible="true" verticalAlign="middle" horizontalAlign="center"  
                                      hideEffect="{fadeOut}" showEffect="{fadeIn}" width="100%"  
                                      height="100%" scaleContent="true"  
                                      cachePolicy = "off"  
                                      >  

2 通过改变HTTPService方式

getInfoServive.url =    Properties.IP_valuse + serviceURL;
    getInfoServive.resultFormat="e4x";
    getInfoServive.addEventListener(ResultEvent.RESULT,jasononResult);
    getInfoServive.method="post"; 
    //使用post的方式,浏览器就可以重新提交数据

xml的话,结尾添加new XML("<xml></xml>?"+Math.random().toString());

图片的话:var str:String="image/1.jpg";更改成var str:String="image/1.jpg?"+Math.random().toString());

原文地址:https://www.cnblogs.com/LLLoveLL/p/3329358.html