# Here goes one for you

**URL:** <https://forum.kirupa.com/t/here-goes-one-for-you/261529>\
**Category:** flash\
**Created:** [May 28, 2008, 3:01pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529 "2008-05-28T15:01:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![digitalmatt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalmatt/32/694_2.png) [@digitalmatt](https://forum.kirupa.com/u/digitalmatt)\
**Post date:** [May 28, 2008, 3:01pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/1 "2008-05-28T15:01:04Z")

</div>

I’m currently building a Flash CS3 app that pulls dynamically generated XML data. The XML data is generated with PHP.

And everything works fine until…

…I make changes to the PHP script. For some reason after I make changes to the PHP script and then test my Flash movie, Flash doesn’t recognize the changes. I have to completely restart Flash in order for it to see the changes I made in the PHP script. Not really a huge deal, but it gets mighty annoying. Plus, I interrupts workflow.

I suspect Flash is caching the PHP script that I’m loading? And I looked around the Flash interface and couldn’t find any option to clear the cache. Any ideas?

---

<div class="post-metadata">

**Author:** ![buginajar](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@buginajar](https://forum.kirupa.com/u/buginajar)\
**Post date:** [May 28, 2008, 3:11pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/2 "2008-05-28T15:11:19Z")

</div>

Not sure if this works but try doing this for the path when you load your php script…

“[http://mydomain.com/theXMLParser.php?x=](http://mydomain.com/theXMLParser.php?x=)” + Math.random() \* 100000000

---

<div class="post-metadata">

**Author:** ![digitalmatt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalmatt/32/694_2.png) [@digitalmatt](https://forum.kirupa.com/u/digitalmatt)\
**Post date:** [May 28, 2008, 3:34pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/3 "2008-05-28T15:34:51Z")

</div>

[quote=buginajar;2332369]Not sure if this works but try doing this for the path when you load your php script…

“[http://mydomain.com/theXMLParser.php?x=](http://mydomain.com/theXMLParser.php?x=)” + Math.random() \* 100000000[/quote]

Thanks for your reply. No, that didn’t work. I’m not sure what that was intended to do though. If my URL parameter is to get a specific category of images and I pass something like getCategory?cat\_id=2, why would I toss in a Math.random()?

---

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [May 28, 2008, 3:42pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/4 "2008-05-28T15:42:23Z")

</div>

So that flash thinks the url is unique, and therefore won’t try and use a cached response. But if it doesn’t work then it doesn’t matter!

---

<div class="post-metadata">

**Author:** ![digitalmatt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalmatt/32/694_2.png) [@digitalmatt](https://forum.kirupa.com/u/digitalmatt)\
**Post date:** [May 28, 2008, 3:47pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/5 "2008-05-28T15:47:47Z")

</div>

> [@Iamthejuggler;2332380](#):
>
> So that flash thinks the url is unique, and therefore won’t try and use a cached response. But if it doesn’t work then it doesn’t matter!

Right, I realized that after I thought about it a little more, however, the flaw is that it’s not going to retrieve the category I need if it’s concatenating some random number on to the end of my url parameter 😕 Though I could be stating the obvious…thanks for trying at least.

Any other ideas?

---

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [May 28, 2008, 3:58pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/6 "2008-05-28T15:58:07Z")

</div>

You could pass the cat\_id as well as the random number.

getCategory?cat\_id=2;x=the random number

---

<div class="post-metadata">

**Author:** ![digitalmatt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalmatt/32/694_2.png) [@digitalmatt](https://forum.kirupa.com/u/digitalmatt)\
**Post date:** [May 28, 2008, 4:07pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/7 "2008-05-28T16:07:46Z")

</div>

[quote=Iamthejuggler;2332398]You could pass the cat\_id as well as the random number.

getCategory?cat\_id=2;x=the random number[/quote]

Wow, my apologies, I didn’t even think of passing it as a second parameter. It worked beautifully.

That’s awesome thank you. One question though, would you consider this more of a “trick” rather than standard protocol? You would think there would be some sort of option in the Flash IDE to clear the cache.

---

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [May 28, 2008, 4:10pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/8 "2008-05-28T16:10:49Z")

</div>

I don’t use the flash IDE so i wouldn’t be able to say. But yes i see it is a hack to save you time whilst developing. Just remember to remove it before you publish it. And glad i could help, although the real thanks should go to buginajar. 🙂

---

<div class="post-metadata">

**Author:** ![digitalmatt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalmatt/32/694_2.png) [@digitalmatt](https://forum.kirupa.com/u/digitalmatt)\
**Post date:** [May 28, 2008, 4:15pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/9 "2008-05-28T16:15:12Z")

</div>

I was thanking both of you 🙂

---

<div class="post-metadata">

**Author:** ![digitalmatt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalmatt/32/694_2.png) [@digitalmatt](https://forum.kirupa.com/u/digitalmatt)\
**Post date:** [May 28, 2008, 4:16pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/10 "2008-05-28T16:16:28Z")

</div>

> [@Iamthejuggler;2332408](#):
>
> I don’t use the flash IDE so i wouldn’t be able to say. But yes i see it is a hack to save you time whilst developing. Just remember to remove it before you publish it. And glad i could help, although the real thanks should go to buginajar. 🙂

What do you use? FlashDevelop?

---

<div class="post-metadata">

**Author:** ![buginajar](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@buginajar](https://forum.kirupa.com/u/buginajar)\
**Post date:** [May 28, 2008, 6:38pm UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/11 "2008-05-28T18:38:07Z")

</div>

No problem. I have run into that issue multiple times. 😉 Glad you got it fixed.

---

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [May 29, 2008, 8:53am UTC](https://forum.kirupa.com/t/here-goes-one-for-you/261529/12 "2008-05-29T08:53:32Z")

</div>

[QUOTE=digitalmatt;2332412]What do you use? FlashDevelop?[/QUOTE]

Flashdevelop at home, and flex builder at work.
