开发者

Adding time to flash movie

i call a flash script from another flash script with the following code:

m开发者_如何学Cy_sample.onLoad = function(succes){ if(succes){ sample = this.sample_id sample_url = "http://www.zzzzzzzzzzzz.com/sample/sample_"+sample+".swf?page="+page+"&dmn="+dn; loadMovie(sample_url, "_root.zzz_load", "GET"); } else trace ("Error loading data")

i need to change it so that it will call a different movie clip each time the clip is viewed, using the time (so that the movieclip will be a new one every time a user refreshes the page or sees the flash again).

How can i do that? what changes should i do to the code?

Thanks


You can add a querystring parameter whose value is almost unique. I used Date.getTime() for that. Sample code would be:

my_sample.onLoad = function(succes)
{
    if(succes)
    { 
        sample = this.sample_id;
        sample_url = "http://www.zzzzzzzzzzzz.com/sample/sample_"+sample+".swf?page="+page+"&dmn="+dn+"&_dtakj=" + (new Date()).getTime(); 
        loadMovie(sample_url, "_root.zzz_load", "GET"); 
    } 
    else trace ("Error loading data")
};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜