User Guide

streamSize 1019
Example
The following statement links the file BigBand.swa to an SWA streaming cast member. The
linked file is on the disk MyDisk in the folder named Sounds.
-- Lingo syntax
member("SWAstream").streamName = "MyDisk/sounds/BigBand.swa"
// JavaScript syntax
member("SWAstream").streamName = "MyDisk/sounds/BigBand.swa";
streamSize
Usage
-- Lingo syntax
memberObjRef.streamSize
// JavaScript syntax
memberObjRef.streamSize;
Description
Cast member property; reports an integer value indicating the total number of bytes in the stream
for the specified cast member. The
streamSize property returns a value only when the Director
movie is playing.
This property can be tested but not set.
Example
The following frame script checks to see if a Flash movie cast member named Intro Movie has
finished streaming into memory. If it hasnt, the script updates a field cast member to indicate the
number of bytes that have been streamed (using the
bytesStreamed member property) and the
total number of bytes for the cast member (using the
streamSize member property). The script
keeps the playhead looping in the current frame until the movie finishes loading into memory.
-- Lingo syntax
on exitFrame
if member("Intro Movie").percentStreamed < 100 then
member("Message Line").text = \
string(member("Intro Movie").bytesStreamed) && "of" && \
string(member("Intro Movie").streamSize) && \
"bytes have downloaded so far."
_movie.go(_movie.frame)
end if
end
// JavaScript syntax
function exitFrame() {
var pctStm = member("Intro Movie").percentStreamed;
var strSs = new String(member("Intro Movie").streamSize);
var strIm = new String(member("Intro Movie").bytesStreamed);
if (pctStm < 100) {
member("Message Line").text = strStm + " of " + strSS +
" bytes have downloaded so far.";
_ movie.go(_movie.frame);
}
}