Accessibility

TechNote

Clear out netMessageHandler callbacks to prevent crashes

It is important to clear out all Multiuser callback handlers and close all instances of the Multiuser Xtra when stopping the movie. Otherwise unplanned stop movie events (such as when a Shockwave user reloads a page) will not be accounted for and could possibly cause crashes.

The following sample script demonstrates clearing and closing:


on stopMovie

global gConnectionInstance

-- clear all callbacks by setting #handlerSymbol parameter to 0
errCode = setNetMessageHandler(gConnectionInstance,0)
errCode = setNetMessageHandler(gConnectionInstance,0,"ConnectToNetServer")
errCode = setNetMessageHandler(gConnectionInstance, 0,"SomeOtherMessageHandler")

-- clear instance of the Multiuser xtra
gConnectionInstance = 0

end stopMovie

Note:To clear Multiuser Xtra connections handled by parent/child scripts, it is first necessary to set any of the object's callbacks to 0. Otherwise the object may not be deleted.



AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_13731

Products Affected: