MovieClip Event.COMPLETE

From GiderosMobile
Revision as of 20:16, 22 August 2024 by MoKaLux (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2012.2.1
Value: complete
Defined by: MovieClip

Description

This event is dispatched when a MovieClip object finishes playing (by reaching its final frame or a frame with stop action).

Example

local pixel = Pixel.new(0xff0000, 1, 64, 64)
local timing2 = 300
local mc2 = MovieClip.new{
	{1, timing2, pixel, {x={10, 100, "easeOut"}}},
}
mc2:gotoAndPlay(1)
-- position
mc2:setPosition(128, 128)
-- scale
mc2:setScale(1.25, 1.25)
-- order
stage:addChild(mc2)
-- listeners
mc2:addEventListener(Event.COMPLETE, function()
	print("movie clip stopped")
end)