<javascript snippet>
...
var flashObj = document.getElementById("theXULFlashObject");
alert (flashObj); //not null
alert (flashObj.getAttribute("src")); //shows correct value
flashObj.setAttribute("src", "newFlashFile.swf");
alert (flashObj.getAttribute("src")); //shows correct new value
...
but the original flash file still plays.
Many thanks for some pointers.
Bob
Ah, we had something of the same problem in Songbird when we first
started working with media plugins and migrating from HTML to XUL.
>From what I was told, plugins initialize differently with an
<html:object> in a XUL file than from <object> in an HTML file. You
apparently can't actually get them with their real JS API available
until the onload event or later.
Also I've found in some cases setting an attribute directly on a
plugin locks it to that value, while leaving it blank in the xml and
setting it in js allows it to change freely. That's probably
something dumb on the plugin implementer's part.
Lastly, there might likely be a better native API on the flash plugin
to tell it to load a different asset, I don't know flash that well.
We only used a single .swf file when we were testing with a
crossplatform flash-based core, but it was written to extend itself
into javascript and accept different MP3 urls for full playback
control -- at worst you could probably do something similar. Or maybe
use an <iframe> instead of an <html:object> and switch urls on that?
Good luck!
mig
> flashObj.setAttribute("src", "newFlashFile.swf");
> but the original flash file still plays.
Maybe you can try create a new element. So, instead of changing old html:object you can create a new object with other
@src and replace the old one with the new one.
In our flashblock.xbl we do this:
current.StopPlay();
current.LoadMovie(0, "");
Phil
--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Make sure to include BUGS=OFF in your config.sys!
* TagZilla 0.059.4