browsers not picking up new files
Hi there
I have tried looking for the answer to this online but I obviously don't know what to search for as I can find much.
I have a flash container that calls other swf files and loads them and plays them one after the other.
I upload/overwrite those files each month as new promos happen.
the file names stay the same as they are defined in the container file.
Im trying to find a way to add some kind of variable into the action script so it finds the file and adds the date in as well. This way when the browser looks at the files it will see new dates and then load the new file from the server as opposed to the local cache.
Is there an elegant way to do this?
Im using CS5, but it looks like the action scrip was written in an older version.
My AS looks like this right now
Code:
stop();
//System.security.allowDomain("*");
//System.security.allowInsecureDomain("*");
//////////////////////////// CENTER PROMO*/
index_image_1 = "personaldefense-1.swf";
index_image_2 = "personaldefense-2.swf";
index_image_3 = "personaldefense-3.swf";
///////////////INIT VARIABLES
init = true;
totalSlides = 3;
active_slidenum = 1;
btn1_mc.Id = 1;
btn2_mc.Id = 2;
btn3_mc.Id = 3;
timerstatus = "play";
xxx = 0;
yyy = 0;
///////////////////////////////////
function loadImages() {
img_mc.gotoAndStop(1);
text_mc.gotoAndStop(1);
setBtns();
////Loads images
miListener = new Object();
mainImage = new MovieClipLoader();
mainImage.addListener(miListener);
//mainImage.loadClip(_root["index_image_"+_root.active_slidenum],"img_mc.image_loader");
mainImage.loadClip("../images/personaldefense/"+_root["index_image_"+_root.active_slidenum],"img_mc.image_loader");
mainImage.onLoadInit = function() {
//_root.mainphoto_preloader_mc.gotoAndStop("start");
};
mainImage.onLoadProgress = function() {
pause_btn.gotoAndStop("inactive");
filesize = img_mc.image_loader.getBytesTotal();
loaded = img_mc.image_loader.getBytesLoaded();
//_root.img_mc.preloader._visible = true;
if (loaded != filesize) {
trace("LOADING: "+100*loaded/filesize);
_root.img_mc.preloader.gotoAndStop(int(100*loaded/filesize));
_root.img_mc.preloader.display_txt.text = int(100*loaded/filesize)+"%";
} else {
//_root.img_mc.preloader._visible = false;
}
};
mainImage.onLoadComplete = function() {
//typeOn();
//trace("The main image has been loaded ");
pause_btn.gotoAndStop(1);
xxx = _root["btn"+_root.active_slidenum+"_mc"]._x;
yyy = btn1_mc._y;
progress_mc._x = xxx;
progress_mc._y = yyy;
_root.img_mc.gotoAndPlay("in");
};
}
function setBtns() {
btn1_mc.gotoAndStop("active");
btn2_mc.gotoAndStop("active");
btn3_mc.gotoAndStop("active");
btn4_mc.gotoAndStop("active");
btn5_mc.gotoAndStop("active");
_root["btn"+_root.active_slidenum+"_mc"].gotoAndStop("inactive");
}
function toggletimer(statusVar) {
if (statusVar == "on") {
timerstatus = "play";
progress_mc.gotoAndPlay("on");
pause_btn.gotoAndStop(1);
} else {
timerstatus = "pause";
progress_mc.gotoAndStop(1);
pause_btn.gotoAndStop(2);
}
}
loadImages();
Any tips would be much appriciated