loadMovieNum and cache

Out of context: Reply #4

  • Started
  • Last post
  • 18 Responses
  • SmilingBuddh0

    The random number trick will work for loadMovieNum just fine. I usually just use getTimer to give me a 'random' number:

    loadMovie(filename + "?r=" + getTimer());

    same as:

    loadMovie(filename + "?r=" + Math.random());

    That should take care of the problem, but as you've noticed, it doesn't work when you're testing it locally.

    If you're doing a lot of testing and it's a pain in the ass, you can do something like this:

    MovieClip.prototype.loadMovieNum... = function(url,level) {
    var append = (_url = "http://www.mysite.com/myswf.swf... ? ("?r=" + getTimer()):("");
    loadMovieNum(url + append, level);
    }

    This will only append the random bit if the file is on your server; you can use it just like loadMovie:

    mymc.loadMovieNum2("myswf", 50);

View thread