Reputation: 6931
I'm working on an app where users can switch between several fairly large swf files and make changes to them. I need those swf files to keep state as they are switched back and forth.
When the user navigates to a different swf file, we keep the current swf object in the DOM but hide it (with display:none), the new one is loaded, and a class "selected" is applied to the new one, to make it visible.
The problem is we can't get the swf files to keep state. They reload completely every time we go back and forth between files.
The kicker is: IE handles all of this properly. None of the other browsers do. Which leads me to think this has something to do with our approach to embedding the files: nesting SWF objects, with IE conditional comments.
Below is a screenshot from Chrome Dev Tools of several swf objects that have been loaded into the DOM, while only one is 'selected' and thus visible. You'll notice that there are three levels of nesting per visible swf file.
Do you think that has something to do with why we're having trouble caching swf files in the DOM?
Anyone have any experience with keeping state with multiple swf files?
Upvotes: 0
Views: 57
Reputation: 12431
Not 100% sure, but it may be a sensible optimisation choice by the browser to prevent the Flash from continuing to consume resources when it's hidden.
I think if you set the width and height of the containing div to 1 pixel you should get the results you're looking for.
Upvotes: 1