imageEnabled

Syntax: the imageEnabled of sprite whichFlashSprite
the imageEnabled of member whichFlashMember
Type: Cast member property; sprite property
Description: This property controls whether a Flash movie's graphics are visible. The imageEnabled property can have these values:
TRUE The movie's graphics are visible.
FALSE The movie's graphics are invisible.
The imageEnabled property can be tested and set. The default setting is TRUE.
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. It also saves its sprite number in a global variable called gStreamingSprite for use in a frame script later in the score.
global gStreamingSprite

on beginSprite me
	set gStreamingSprite = the spriteNum of me
	set the imageEnabled of sprite gStreamingSprite = FALSE
end

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 playback head looping in the current frame until the movie finishes streaming into memory. When 100 percent of the movie is in memory, the script sets the imageEnabled property to TRUE so the graphics appear and then lets the playback head continue to the next frame in the score.
global gStreamingSprite

on exitFrame me
	if the percentStreamed of sprite gStreamingSprite < 100 then
		go to the frame
	else
		set the imageEnabled of sprite gStreamingSprite = TRUE
		updatestage
	end if
end


Previous | Next