Lingo Dictionary > G-K > imageEnabled |  |

imageEnabled

Syntax

    sprite(whichVectorOrFlashSprite).imageEnabled
    the imageEnabled of sprite whichVectorOrFlashSprite
    member(whichVectorOrFlashMember).imageEnabled
    the imageEnabled of member whichVectorOrFlashMember

Description

Cast member property and sprite property; controls whether a Flash movie or vector shape's 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:

    global gStreamingSprite
    on beginSprite me
    	 gStreamingSprite = me.spriteNum
    	 sprite(gStreamingSprite).imageEnabled = 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 100% of the movie has streamed into memory. It then sets the `imageEnabled` property to `TRUE` so that the graphics appear and lets the playback head continue to the next frame in the Score.

    global gStreamingSprite
    on exitFrame me
    	if sprite(gStreamingSprite).member.percentStreamed < 100 then
    		go to frame
    	else
    		sprite(gStreamingSprite).imageEnabled = TRUE
    		updatestage
    	end if
    end