I am trying to figure out how to execute one last command in my Flash movie when the user closes the browser. I am working with socket servers to monitor users currently online (like in a chat room), so I need to send a "logout" bit to the server when the browser is closed.
In reading forums all day, I've come up with calling a JS function onUnload that sends data to my Flash movie. When I run this page and close the window, I get " 'movie' is null or not an object". I've tried defining movie and the function both above and below the body tag. Maybe I'm just tired and missing something, but I would appreciate it if someone could take a look.
<TITLE>ACTIVITY_monitor</TITLE>
<script language="JavaScript" type="text/JavaScript">
<!--
var movie = window.document.movie;
function callFlash() {
movie.GotoFrame(8);
}
//-->
</script>
</HEAD>
<BODY background="lines.gif" onUnload="callFlash()">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<!--ShadowActivity Monitor-->
<p>
<OBJECT classid="clsid
27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=" WIDTH="300" HEIGHT="410" id="ACTIVITY_monitor" ALIGN="" id="movie">
<PARAM NAME=movie VALUE="ACTIVITY_monitor.swf">
<PARAM NAME=loop VALUE=false>
<PARAM NAME=quality VALUE=high>
<PARAM NAME=salign VALUE=LT>
<PARAM NAME=bgcolor VALUE=#FDF7DE>
<EMBED src="ACTIVITY_monitor.swf" loop=false quality=high salign=LT bgcolor=#FDF7DE WIDTH="300" HEIGHT="410" name="movie" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="</OBJECT>
<Úò*ý>
In reading forums all day, I've come up with calling a JS function onUnload that sends data to my Flash movie. When I run this page and close the window, I get " 'movie' is null or not an object". I've tried defining movie and the function both above and below the body tag. Maybe I'm just tired and missing something, but I would appreciate it if someone could take a look.
<TITLE>ACTIVITY_monitor</TITLE>
<script language="JavaScript" type="text/JavaScript">
<!--
var movie = window.document.movie;
function callFlash() {
movie.GotoFrame(8);
}
//-->
</script>
</HEAD>
<BODY background="lines.gif" onUnload="callFlash()">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<!--ShadowActivity Monitor-->
<p>
<OBJECT classid="clsid
codebase=" WIDTH="300" HEIGHT="410" id="ACTIVITY_monitor" ALIGN="" id="movie">
<PARAM NAME=movie VALUE="ACTIVITY_monitor.swf">
<PARAM NAME=loop VALUE=false>
<PARAM NAME=quality VALUE=high>
<PARAM NAME=salign VALUE=LT>
<PARAM NAME=bgcolor VALUE=#FDF7DE>
<EMBED src="ACTIVITY_monitor.swf" loop=false quality=high salign=LT bgcolor=#FDF7DE WIDTH="300" HEIGHT="410" name="movie" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="</OBJECT>
<Úò*ý>