views:

273

answers:

2

I have a flash gallery that uses a dynamic swf file to load data from xml and load images. This same swf files is used over several times for different clients in the portfolio section.

But now it apears that the swf is loaded everytime a different client is clicked even though they all access the same swf file, any ideas?

A: 

The SWF file being the same isn't the important part. The important part is the URL used to access the SWF.

If the URL for the SWF includes query parameters and those parameters are different each time the client accesses it then the browser won't know that it's the same file and will re-download it.

Herms
That is the case yes, it reads in query parameters to set up the proper state. Any way around this like using flashvars instead?
Take a look at the swfobject js library. That's what I use to add SWFs to the page, and you can use that to define the flashvars w/o having to use query parameters.
Herms
+1  A: 

Well if all it does it load and display data the performance should be negligible.

If byte transfer is paramount to you, then you might be able to recoup the losses by storing some of your XML in a LocalSharedObject with a plausible expiration timer.

Otherwise, don't over-engineer yourself into a headache.

Jasconius
Yeah, i tend to create headache situations for myself. Byte transfer is not important, the only thing that bothers me is the couple of seconds it takes for the swf to appear each time. I thought i could avoid that by setting up the same swf to handle different scenarios.