i try to write a FF extension to control Flashmovies. I think it must be
simple, because the adope/macromedia flash plugin supports many
functions like Play, StopPlay, CurrentFrame, GotoFrame, ...
If i walk through the DOM with my extension and select the OBJECT/EMBED
tag with a flash-movie and try Stop(), i get an error.
If i write a webpage with a flash movie and i add some JS, then can i
get the movie with "var v = document['testcommand']" and can use
"v.StopPlay()" ('testcommand' is the ID of the OBJECT and the ID of the
EMBED inside the OBJECT)
You can view an example under:
credes.psiegmund.de/js4flash/javascript-to-flash.html
(many thanks to http://www.moock.org/webdesign/flash/fscommand/ for this
example!)
I have watched the Flashblock extension but they only cut the OBJECT out
of the DOM and replaced it with a DIV and if you click on the DIV they
reload the OBJECT and replace the DIV and the movie will be shown.
I can use functions like StopPlay(),... if i open a SWF file directly,
but i want to control the flashmovies that are embedded in a hmtl document.
I hope i could make myself clear and someone can help me.
Thanks Thomas
// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
// First make sure the movie's defined.
if (typeof(theMovie) != "undefined") {
// If it is, check how much of it is loaded.
return theMovie.PercentLoaded() == 100;
} else {
// If the movie isn't defined, it's not loaded.
return false;
}
}
Hi,
my extensions adds a menu entry and i only try to use the function
behinde the menu-entry if the flash movie is 100% loaded. I'm realy sure
that the flash movie is 100% loaded, because ist is running :-)
i have copied the Mook JS code into my extension and typeof(theMovie)
will always be return an undefined.
> I have watched the Flashblock extension but they only cut the OBJECT out
> of the DOM and replaced it with a DIV and if you click on the DIV they
> reload the OBJECT and replace the DIV and the movie will be shown.
That must be a very old version of flashblock. In current versions and
certain classes of flash object we do use StopPlay().
> I can use functions like StopPlay(),... if i open a SWF file directly,
> but i want to control the flashmovies that are embedded in a hmtl document.
> I hope i could make myself clear and someone can help me.
> Thanks Thomas
If you are accessing webcontent from chrome, you may need to use the
JSWrappedObject property to access unsafe methods.
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.
[ ]Truth is just another misconception.
* TagZilla 0.059
i have nothing found about JSWrapperObject. :-(
I make a bad smelling workaround. I add some javascript-code to the page
and add some hidden buttons. Now my extension calls HiddenButton.click()
and this button calls some javascript that was insert bevor. (something
like stopmovie() and stopmovie() gets the EMBED by ID and call
myembed.StopPlay())