User Guide

810 Chapter 14: Properties
// JavaScript syntax
put(_movie.imageCompression);
See also
imageQuality, Movie
imageEnabled
Usage
-- Lingo syntax
memberOrSpriteObjRef.imageEnabled
// JavaScript syntax
memberOrSpriteObjRef.imageEnabled;
Description
Cast member property and sprite property; controls whether a Flash movie or vector shapes
graphics are visible (
TRUE, default) or invisible (FALSE).
This property can be tested and set.
Example
This beginSprite script sets up a linked Flash movie sprite to hide its graphics when it first
appears on the Stage and begins to stream into memory and saves its sprite number in a global
variable called
gStreamingSprite for use in a frame script later in the Score:
-- Lingo syntax
global gStreamingSprite
on beginSprite me
gStreamingSprite = me.spriteNum
sprite(gStreamingSprite).imageEnabled = FALSE
end
// JavaScript syntax
function beginSprite() {
_global.gStreamingSprite = this.spriteNum;
sprite(_global.gStreamingSprite).imageEnabled = 0;
}
In a later frame of the movie, this frame script checks to see if the Flash movie sprite specified by
the global variable
gStreamingSprite has finished streaming into memory. If it has not, the
script keeps the playhead looping in the current frame until 100% of the movie has streamed into
memory. It then sets the
imageEnabled property to TRUE so that the graphics appear and lets the
playhead continue to the next frame in the Score.
-- Lingo syntax
global gStreamingSprite
on exitFrame me
if sprite(gStreamingSprite).member.percentStreamed < 100 then
_movie.go(_movie.frame)
else
sprite(gStreamingSprite).imageEnabled = TRUE
_movie.updatestage()
end if
end