Flash-Movie_object abfragen, Ladestatus
muckinger
- javascript
Hallo,
leider hatte ich keine endgültige Antwort auf mein letztes Posting erhalten, darum probier ichs noch mal.
Ich möchte den Ladestatus eines Flashmovies abfragen, damit ich erst nach dem 100%igen laden eine weitere js-function ausführen kann. Sollte laut Macromedia und anderen Foren auch ohne Probleme funktionieren, aber IE führt nichts aus und mozilla schmeisst Fehler (Object nicht definiert).
Sieht hier jemand nen Fehler? Danke für eure Hilfe.
<HTML>
<HEAD>
<TITLE>JavaScript controls Flash</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
var movieName = "testmovie";
function thisMovie(movieName) {
// IE and Netscape refer to the movie object differently.
// This function returns the appropriate syntax depending on the browser.
if (navigator.appName.indexOf ("Microsoft") !=-1) {
alert('msie');
return window[movieName]
}else {
alert('anderer Browser');
return document[movieName]
}
}
// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
if (typeof(theMovie) != "undefined") {
alert('object undefiniert--');
return theMovie.PercentLoaded() == 100;
}else {
alert('Movieload ist false');
return false;
}
}
if (movieIsLoaded(thisMovie(movieName))) {
alert('geladen--');
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<OBJECT
CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="100%"
HEIGHT="100%"
CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"
ID="testmovie">
<PARAM NAME="MOVIE" VALUE="tower.swf">
<PARAM NAME="PLAY" VALUE="true">
<PARAM NAME="LOOP" VALUE="false">
<PARAM NAME="QUALITY" VALUE="high">
<PARAM NAME="SCALE" VALUE="SHOWALL">
<EMBED
NAME="testmovie"
SRC="tower.swf"
WIDTH="100%"
HEIGHT="100%"
PLAY="true"
LOOP="false"
QUALITY="high"
SCALE="SHOWALL"
swLiveConnect="true"
PLUGINSPAGE="http://www.macromedia.com/go/flashplayer">
</EMBED>
</OBJECT>
</BODY>
</HTML>
if (movieIsLoaded(thisMovie(movieName))) {
alert('geladen--');
Du kannst das erst aufrufen, wenn das Dokument geladen ist. Da das Objekt natürlich nicht definiert ist.
Struppi.
if (movieIsLoaded(thisMovie(movieName))) {
alert('geladen--');Du kannst das erst aufrufen, wenn das Dokument geladen ist. Da das Objekt natürlich nicht definiert ist.
Struppi.
Hi Struppi,
hast natürlich recht, muss ich onload aufrufen...ich depp.
Leider findet Mozilla die function percentLoaded() immer noch nicht, aber ich such mal weiter.