Lingo Dictionary > D-F > on enterFrame

 

on enterFrame

Syntax

on enterFrame
	statement(s)
end

Description

System message and event handler; contains statements that run each time the playback head enters the frame.

Place on enterFrame handlers in behavior, frame, or movie scripts, as follows:

To assign the handler to an individual sprite, put the handler in a behavior attached to the sprite.

To assign the handler to an individual frame, put the handler in the frame script.

To assign the handler to every frame (unless you explicitly instruct the movie otherwise), put the on enterFrame handler in a movie script. The handler executes every time the playback head enters a frame unless the frame script has its own handler. If the frame script has its own handler, the on enterFrame handler in the frame script overrides the on enterFrame handler in the movie script.

The order of frame events is stepFrame, prepareFrame, enterFrame, and exitFrame.

This event is passed the object reference me if used in a behavior.

Example

This handler turns off the puppet condition for sprites 1 through 5 each time the playback head enters the frame:

on enterFrame
	repeat with i = 1 to 5
		puppetSprite i, FALSE
	end repeat
end