I only know how this works in Gecko (Firefox's rendering engine). In that engine, no, you can't move an <object>
or <embed>
within the DOM tree without reloading the associated Flash object. It's actually worse than that: you can't do anything that would cause the CSS box drawn by the Flash object to be destroyed. Gecko treats CSS boxes as ephemeral; almost any DOM modification involving the subtree that contains the <object>
will destroy the associated CSS box, and so will any number of CSS manipulations ranging from the obvious (set display:none
) to the obscure (change opacity
or overflow
). But the state of the plugin is attached to the box tree rather than the DOM tree, so if the box is destroyed and recreated, the plugin gets reloaded.
This is agreed to be a bug — bug 90268, nine years old as of this writing. See, particularly, comment 80 for the really long explanation of why this is and why, sad to say, I would not be surprised if it went another nine years without getting fixed.
Possibly you could work around this by exporting all of your plugin state to JavaScript in the containing page.
UPDATE: Only two years later, the bug has been fixed! The fix will be in Firefox 13, currently scheduled for release on June 5, 2012; if you want it sooner, it'll be in "beta" on April 24, and "aurora" shortly after March 13 (which is today). Josh Aas deserves much credit for wrestling this one to the ground — the fix went through 54 revisions and modifies more than 3,000 lines of code.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…