clearError

Syntax: clearError (member whichFlashMember)
Type: Command
Description: Use this command to reset the error state of a streaming Flash cast member back to 0.
When an error occurs while a cast member is streaming into memory, Director sets the cast member's state property to -1 to indicate that an error occurred. You can use the getError function to determine what type of error occurred. You can then use the clearError command to reset the cast member's error state to 0. After you clear the member's error state, Director can try to open the member again if it is needed again in the Director movie. Setting a cast member's pathName, linked, and preload properties also automatically clears the error condition.
Example: This handler checks to see if an out-of-memory error occurred for a Flash cast member named Dali, which was streaming into memory. If there was a memory error, the script uses the unloadCast command to try to free some memory; it then branches the playback head to a frame in the Director movie named Artists, where the Flash movie sprite first appears, so Director can again try to play the Flash movie. If something other than an out-of-memory error occurred, the script goes to a frame named "Sorry," which explains that the requested Flash movie can't be played.
on CheckFlashStatus 
	if getError(member "Dali") = #memory then
		clearError(member "Dali")
		unloadCast
		go to frame "Artists"
	else
		go to frame "Sorry"
end

Related Lingo: state of member property, getError function

Previous | Next