A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: browsers not picking up new files

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    2

    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

  2. #2
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    Do you want to flash to read the date-timestamp of file ?
    As ever,
    Vinayak Kadam

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    im not sure, is that what you recommend to force the browser to read the latest version of the file off the server every time?

    I don't really mind how its done, I just want to make sure users are seeing the latest versions of the flash files without having to re build the container file every time I update the banners.

    thanks for the response! :-)

  4. #4
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    Do correct files load after you clear your browser cache ?

    I am asking this because to my knowledge no browser loads SWf files from cache. Browser caching should'nt be an issue here!
    As ever,
    Vinayak Kadam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center