Well im new to actionscripting but programming isnt very new to me, ive had javascript experience and know how object/class oriented AS is and how general working concepts flow…etc
But enough of me, here is my problem. I set up empty movie clip containers to hold my external .swf files when i load them in. I have 9 different external files that all load correctly. My issue is that when people view my website and cache the files after dynamically loading them, my changes that i make and upload dont take effect because their computers just pull the cached files from the last time they viewed it. This is critical for my site to work because of the amount of text updating and news that i do on it.
Add a random number or the date to the end of the name for the file you are loading ie.
One of the files is called myFile.swf
Put this in flash:
loadMovie(“myFile.swf?”+Math.random()*1000);
that should give you enough different files that whenever they load your movie they will get the newest version
with the Math.random thing how would i specify the button to load the file if its going to be some random number, or will it just point to the right file
the date thing may work but it would be annoying to update every time
The question mark after the file name makes the browser think it is sending a variable to the program, the to be loaded Flash file in this case, it will load the file that is before the question mark no problem, the only thing the random number does is make it new when compared to the cached version.
hmmmm should have worked, I must have forgotten to include something, unfortunately I don’t have access to flash right now, and it’s gonna be a couple of days before I do, let me see what I can find…thanks for your patience
movieHolder.loadMovie(“movieBiengLoaded.swf?param=” + (new Date()).getTime());
okay all I changed was the path from an AS file I now works, this one uses the date so it will alwyas be different
your going to have to use the date method:
theMC.loadMovie(“theFile.swf?param=” + (new Date()).getTime());
just make sure you have the “?” in there or it won’t work, I think the random method was like this;
theMC.loadMovie(“theFile.swf?param=” + Math.floor(Math.random()*1000);
That way you don’t get the point (".") in the variable
yah i know how xml and php deal with it because they are trying to fill variables when you give the time=12312 function, flash is looking for a file name that includes time=12312 (as far as i know)