A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How to prevent SWF caching?

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    11

    How to prevent SWF caching?

    Hi.

    I have a problem here, I've been searching on google and through forums for hours now trying to find a way to prevent my site from cache in browsers. I know it's not possible to "prevent" it from caching, but it's a way to trick the browser into thinking it needs to load the SWF again instead of just getting the one from the cache.

    Now I've tried many types but I can't get it to work. I don't understand how to implement it into AS or Javascript and what goes where..

    My site is set up by one parent SWF combined with a HTML script and 6 child SWF's, and they are updating all the time so I really need this function.

    See it here: http://www.vgn.no

    The most used one is this I think or something close:

    myIdentifier=Math.round(Math.random()*10000);
    loadMovie("myAnim.swf?uniq="+myIdentifier,1)
    ;

    If someone knows a better please tell.

    But how do I use it? Can someone please explain where it goes and will it work on several child SWF's?

    Thanks in advance.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    That code is good. Use it when loading your swfs. You'll need to test online.

    gparis

  3. #3
    Junior Member
    Join Date
    May 2010
    Posts
    11
    Ok, thanks! But where do I paste it to make it work?

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    where you load your swfs. just change myAnim.swf to your swf's names.

    gparis

  5. #5
    Junior Member
    Join Date
    May 2010
    Posts
    11
    It worked yes. Thanks!

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