views:

701

answers:

1

I have a Google Web Toolkit (GWT) application that utilizes a Flash/PaperVision3D component that I have created. The GWT app places instances of the Flash component on different tabs in a tab panel. During execution of the app, everything works great until the user starts clicking in between tabs. At the GWT level, the JavaScript is changing the style.display attribute to hide and show the contents of the 'tabs'. It appears that the Flash component (included in the page by scripting an 'embed' tag) is reloading/restarting each time that it is made visible.

How can I prevent it from restarting/reloading? I don't have much control at all over the fact that the DIV tag is getting set to style.display = 'none', as that is being controlled by the autogenerated GWT code. Is there some setting perhaps in the Flex/Flash development to allow it to do this? Or maybe in the Embed tag? Or even at the JavaScript level?

+2  A: 

Apparently this is a Firefox bug. It doesn't appear to be a problem in Internet Explorer.

A possible solution would be to already have the Flash elements hidden and positioned absolutely ("position: absolute; visibility: hidden;") and then bring them into visibility via a JavaScript function called when the user clicks on a tab.

Depending on the complexity of the Flash files, you could also use the ExternalInterface object, which allows for communication between JavaScript functions and ActionScript. You could save the current state of the movie and then dump this state information back in when the the user clicks on the tab.

Sorry I couldn't be more help.

attack