Here goes one for you

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?

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

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

[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=” + 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()?

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 :confused: Though I could be stating the obvious…thanks for trying at least.

Any other ideas?

You could pass the cat_id as well as the random number.

getCategory?cat_id=2;x=the random number

[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.

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. :slight_smile:

I was thanking both of you :slight_smile:

What do you use? FlashDevelop?

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

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

Flashdevelop at home, and flex builder at work.