Lingo Dictionary > O-R > ramNeeded()

 

ramNeeded()

Syntax

ramNeeded (firstFrame, lastFrame)

Description

Function; determines the memory needed, in bytes, to display a range of frames. For example, you can test the size of frames containing 32-bit artwork: if ramNeeded() is larger than freeBytes(), then go to frames containing 8-bit artwork and divide by 1024 to convert bytes to kilobytes (K).

Example

This statement sets the variable frameSize to the number of bytes needed to display frames 100 to 125 of the movie:

put ramNeeded (100, 125) into frameSize

Example

This statement determines whether the memory needed to display frames 100 to 125 is more than the available memory, and if it is, branches to the section using cast members that have lower color depth:

if ramNeeded (100, 125) > the freeBytes then play frame "8-bit"

See also

freeBytes(), size