Stop reloading flash file when using show and hide methods

前端 未结 4 1167
无人及你
无人及你 2020-12-19 09:01

I have a web page where a flash file is embeded in that.The flash file is having a quiz consist of 4 questions.When user answer the first question the second question will b

4条回答
  •  忘掉有多难
    2020-12-19 09:20

    I know this is an old thread but I wanted to post an easy solution for those looking for one that won't require changes to existing JS code. In my case, I had a an existing Tabset component that was creating new tabs and dynamically loading the html that embedded the SWF.

    IMO, the easiest way to handle this is to place an iframe wrapper around the SWF - then it won't shut down/reload when you show/hide the Div container.

    To fix this problem, you just have to insert a simple html wrapper file.

    Old way:

    Main App -> HTML loader -> SWF file

    New way:

    Main App -> iframe loader -> HTML loader -> SWF file

    Simple example:

    
    

    then inside the swfContainer.html do something like this:

    
        
            
        
        
            
                
                
                
                
                
            
        
    
    

    This is just a simple code example, as you'd probably want to use swfobject to load the SWF, but I'll leave that up to you.

提交回复
热议问题