Difference between revisions of "MovieClip Event.COMPLETE"

From GiderosMobile
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''<translate>Available since</translate>:''' Gideros 2012.2.1<br/>
+
'''Available since:''' Gideros 2012.2.1<br/>
'''<translate>Value</translate>:''' complete<br/>
+
'''Value:''' complete<br/>
'''<translate>Defined by</translate>:''' [[Special:MyLanguage/MovieClip|MovieClip]]<br/>
+
'''Defined by:''' [[MovieClip]]<br/>
  
 
=== Description ===
 
=== Description ===
This event is dispatched when a [[Special:MyLanguage/MovieClip|MovieClip]] object finishes playing (by reaching its final frame or a frame with stop action).
+
This event is dispatched when a '''MovieClip''' object finishes playing (by reaching its final frame or a frame with stop action).
 +
 
 +
=== Example ===
 +
<syntaxhighlight lang="lua">
 +
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)
 +
</syntaxhighlight>
  
 
{{MovieClip}}
 
{{MovieClip}}

Latest revision as of 20:16, 22 August 2024

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)