# Need Help

**URL:** <https://forum.kirupa.com/t/need-help/261014>\
**Category:** Uncategorized\
**Created:** [May 22, 2008, 4:06am UTC](https://forum.kirupa.com/t/need-help/261014 "2008-05-22T04:06:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ek\_design](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@ek\_design](https://forum.kirupa.com/u/ek_design)\
**Post date:** [May 22, 2008, 4:06am UTC](https://forum.kirupa.com/t/need-help/261014/1 "2008-05-22T04:06:10Z")

</div>

I am having an issue with my flash .swf. Say I upload a .swf but made some changes. I re-upload it to the updated flash document but it still shows me the old one. I have deleted it off my server and renamed the file but it still shows the old .swf. Why is it doing this? Why is it not showing my updated .swf?

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [May 22, 2008, 4:26am UTC](https://forum.kirupa.com/t/need-help/261014/2 "2008-05-22T04:26:02Z")

</div>

Your browser caches the .swf file on your computer so that you don’t waste bandwidth downloading it each time. There are ways to force your browser to clear its cache, but the method depends on which browser you’re using. You can also append a random query string to the end of the file URL (using JavaScript or a server-side language) to force a browser to download the .swf file again.

---

<div class="post-metadata">

**Author:** ![ek\_design](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@ek\_design](https://forum.kirupa.com/u/ek_design)\
**Post date:** [May 22, 2008, 8:22pm UTC](https://forum.kirupa.com/t/need-help/261014/3 "2008-05-22T20:22:19Z")

</div>

Do you happen to know the query string so that the .swf is forced to be downloaded each visit?

Thanks!

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [May 22, 2008, 8:43pm UTC](https://forum.kirupa.com/t/need-help/261014/4 "2008-05-22T20:43:58Z")

</div>

It doesn’t really matter what the query string is, it just matters that it is different every time the page loads (thus the need for a scripting language to change it).

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 22, 2008, 9:10pm UTC](https://forum.kirupa.com/t/need-help/261014/5 "2008-05-22T21:10:57Z")

</div>

I’m pretty sure he wants to know the code to embed a random number or something of that nature.

What language are you planning on using? JS, PHP, ASP or what?

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [May 22, 2008, 9:49pm UTC](https://forum.kirupa.com/t/need-help/261014/6 "2008-05-22T21:49:22Z")

</div>

JS:

```auto
var complete_url = swf_url + '?no_cache=' + new Date().getTime() + '' + Math.floor(Math.random() * 10000);

```

To use this JavaScript, you’ll probably want to embed the SWF using SWFObject or one of the other well-known JS Flash insertion scripts since you’ll already be using JavaScript then.

PHP:

```php
$complete_url = $swf_url . '?no_cache=' . time() . rand();

```

Using PHP would make more sense if you were already using PHP for some other dynamic content on the site.

---

<div class="post-metadata">

**Author:** ![ek\_design](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@ek\_design](https://forum.kirupa.com/u/ek_design)\
**Post date:** [May 23, 2008, 1:35am UTC](https://forum.kirupa.com/t/need-help/261014/7 "2008-05-23T01:35:45Z")

</div>

I am using PHP guys. I am new to flash so bare with me. That php code I am assuming will need to go in between the \<object\>\</object\> tag correct?

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [May 23, 2008, 3:18am UTC](https://forum.kirupa.com/t/need-help/261014/8 "2008-05-23T03:18:53Z")

</div>

Yep. Wherever you see something like ‘src="…swf"’, you can insert _$complete\_url_ instead. If the code you’re using to insert the SWF also has an _embed_ tag, then you’ll need to change the URL there, too.

---

<div class="post-metadata">

**Author:** ![ek\_design](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@ek\_design](https://forum.kirupa.com/u/ek_design)\
**Post date:** [May 23, 2008, 3:31am UTC](https://forum.kirupa.com/t/need-help/261014/9 "2008-05-23T03:31:22Z")

</div>

Thanks a lot Krilnon! This worked out just fine.
