Search code examples
flashdompopupreload

How to show flash in popup without reloading it


Is it possible somehow to show flash object in a popup, without copying DOM "object"? I need same instance of flash in the popup.

I guess something similar Stop reloading flash file when using show and hide methods, but I really haven't found yet any good solution for popuping in that case.


Solution

  • OK, I found how to do it, at least it works in FF (I guess in other browsers it works too).

    I used jquery tools, because it's simple and powerful (hope author will come back soon to make some changes, merge pulls and just update some status for it).

    Next you should have the same position, if you will change it, then flash object will be reloaded.

    Next think you need to do is to do left: -10000px, so it will be invisible.

    Jquery tools overlay used fixed positioning by default, so set your container with flash object to position: fixed (you also can use absolute if you will set fixed = false in jquery tools plugin).

    To invoke jquery tools overlay you need to do so:

    $('#flash_wrapper').overlay({
      load: true,
      closeOnClick: true
    });
    

    In my case I'm "closing" toolbox using

    $('#flash_wrapper').css('left', '-10000px');
    

    At least works in FF... Good to be tested in other browsers, but I guess only one browser that can take the pain is IE.

    Hope that helps to someone.