Shockwave causes crash on htm page using SMUS
Shockwave causes crash on htm page using SMUS
(OP)
I am currently working on a multiuser chat program that is to be embedded into a webpage. I am running into a problem though after the program connects to the server. For the most part it works fine during run mode, but when you try to quit the program by closing the window, going to another website, or in any other way that I've found causes the browser to crash (the standard Internet Explorer has encountered a problem and needs to close error) When I click for more information on the error it lists dirapi.dll as the source of the problem. Dirapi.dll is part of shockwave, so I can't be sure if it's just saying that shockwave in general crashed or shockwave overall crashed, but in any case, it lists it as the problem.
I've tried everything I can think of to solve this problem and I just can't figure it out. I've tried rerouting all xtras to local files, tried a whole lot of things to clear globals and connections before quitting, letting the movie just run out into nothingness... I'm out of ideas. Your help would be greatly appreciated
Thanks,
Johnathon
I've tried everything I can think of to solve this problem and I just can't figure it out. I've tried rerouting all xtras to local files, tried a whole lot of things to clear globals and connections before quitting, letting the movie just run out into nothingness... I'm out of ideas. Your help would be greatly appreciated
Thanks,
Johnathon
RE: Shockwave causes crash on htm page using SMUS
Again, your help would be greatly appreciated!
RE: Shockwave causes crash on htm page using SMUS
Upon even further research I have determined that the actual error occurs once a sendNetMessage command is sent to the server from the client. (for example, if I were to run the following code on the client in the browser it would cause the crash when you quit the game):
errCode = sConnect.sendNetMessage([#recipients:"system.script", #subject:"LoadChar",#content:AcctDat])
Is there a way to clear it somehow in the on stopmovie method?
RE: Shockwave causes crash on htm page using SMUS
global sConnect, MuteCountdown
on stopmovie
sConnect = 0
clearglobals
end stopMovie
on DefaultMessageHandler
global sConnect, uname, passphrase, IAmAdmin, IAmMod, IAmGuide, MuteCountdown
newMessage = sConnect.getNetMessage()
errCode = newMessage.errorCode
if errCode <> 0 then
alert "Error: "& errCode & " : " & sConnect.getNetErrorString(errCode)
else
if newMessage.Subject = "OkayToLog" then
play frame 30
end if
if newMessage.SenderID = "System" AND newMessage.Subject = "ConnectToNetServer" then
play frame 5
end if
end if
end
-----------------------------------------------------------------------------------
-- LoadMeUp
-- Command lines that run when the login button is pressed
-- Creates the multiuser xtra instance and the connection to the server.
-----------------------------------------------------------------------------------
on LoadMeUp
set uname = field (member "username" of castlib "Internal")
set passphrase = field (member "password" of castlib "Internal")
sConnect = new(xtra "Multiuser")
errCode = sConnect.setNetMessageHandler(#DefaultMessageHandler, script 1)
errCode = sConnect.ConnectToNetServer( uname, passphrase, "server.theserv", 1626, "MainMovie" )
play frame 4
end
-----------------------------------------------------------------------------------
-- LoadCharacterCommand
-- The script below is the problem causer. I'm not sure how to clear it
-- in the on StopMovie command.
-----------------------------------------------------------------------------------
on LoadCharacterCommand
set uname = field(member "Username" of castlib "Internal")
set passphrase = field(member "Password" of castlib "Internal")
set CharDt = uname & ":" & passphrase
-- The Commented line below is how I would normally send a command like this, the one below is how I have it set now, it makes no difference which I use. They both cause the crash in the end.
-- errCode = sConnect.sendNetMessage([#recipients:"system.script", #subject:"LoadChar", #content:CharDt])
errCode = sConnect.sendNetMessage("system.script", "LoadChar", CharDt)
end
RE: Shockwave causes crash on htm page using SMUS
Kenneth Kawamoto
www.materiaprima.co.uk