Lingo Dictionary > S > state

 

state

Syntax

member(whichCastMember).state
state of member whichCastMember

Description

Cast member property; for Shockwave Audio (SWA) streaming cast members and Flash movie cast members, determines the current state of the streaming file. The properties streamName, URL, and preLoadTime can be changed only when the SWA sound is stopped.

The following properties for the SWA file return meaningful information only after the file begins streaming: cuePointNames, cuePointTimes, currentTime, duration, percentPlayed, percentStreamed, bitRate, sampleRate, and numChannels.

For SWA streaming cast members, the following values are possible:

0—Cast streaming has stopped.

1—The cast member is reloading.

2—Preloading ended successfully.

3—The cast member is playing.

4—The cast member is paused.

5—The cast member has finished streaming.

9—An error occurred.

10—There is insufficient CPU space.

For Flash movie cast members, this property returns a valid value only when the Director movie is running. The following values are possible:

0—The cast member is not in memory.

1—The header is currently loading.

2—The header has finished loading.

3—The cast member's media is currently loading.

4—The cast member's media has finished loading.

-1An error occurred.

This property can be tested but not set.

Example

This statement issues an alert if an error is detected for the SWA streaming cast member:

on mouseDown
	if member("Ella Fitzgerald").state = 9 then
		alert "Sorry, can't find an audio file to stream."
	end if
end

Example

This frame script checks to see if a Flash movie cast member named Intro Movie has finished streaming into memory. If it hasn't, the script reports in the Message window the current state of the cast member and keeps the playback head looping in the current frame until the movie finishes loading into memory.

on exitFrame
	if member("Intro Movie").percentStreamed < 100 then
		put "Current download state:" && member("Intro Movie").state
		go the frame
	end if
end

See also

clearError, getError()