Flash Reloads on Javascript show/hide
I don’t work that much with flash, especially I don’t tend to show and hide objects on a website with Javascript. Today was an exception.
Apparently, when you hide an flash object with Javascript and then show it again, toggle the visibility if I may, the flash will reload every time you show it. That’s quite annoying, especially if loading the flash involves server calls and such.
It took me a while to confirm that this was actually my problem but once I knew exactly where the problem lie I already had a solution in mind.
Instead of showing/hiding the flash object I move it out of the view by setting the left margin to -10000px. Only doing this will however make sure that the flash still occupies the space it was in and I want to swap the content where the flash was for another div. By positioning all these divs absolute that problem was taken care of. Great news for my end users
I won’t post example code as all you really need to do is set position: absolute in the css and then toggle margin-left between 0 and 10000px (or any other value that you like and is enough to hide it) in your Javascript code.










