### getError

Syntax: | `getError (member` `whichFlashMember``)`
Type: | Function
Description: | This function indicates if an error occurred while the specified Flash movie cast member was streaming into memory. If an error did occur, the `getError` function indicates the type of error. The `getError` function returns these values:

| `FALSE` No error occurred.
| `#memory` There is not enough memory to load the cast member.
| `#fileNotFound` The file containing the cast member's assets could not be found.
| `#network` A network error prevented the cast member from loading.
| `#fileFormat` The file was found, but it appears to be of the wrong type, or an error occurred while reading the file.
| `#other` Some other error occurred.

| 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.
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 load and 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, `clearError` function

Previous | Next