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")
};
精彩评论