Lingo Dictionary > A-C > clearError |  |

clearError

Syntax

    member(whichFlashMember).clearError()
    clearError (member whichFlashMember)

Description

Flash command; resets the error state of a streaming Flash cast member 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. When this happens, you can use the `getError` function to determine what type of error occurred and then use the `clearError` command to reset the cast member's error state to 0. After you clear the member's error state, Director tries to open the cast member 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 a memory error occurred, 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 member("Dali").getError() = #memory then
    		member("Dali").clearError()
    		unloadCast
    		go to frame "Artists"
    	else
    		go to frame "Sorry"
    	end if
    end

See also

`state`, `getError()`