local thisActor = ...

local animation = scaleform.Actor.component_by_name(thisActor, "animation")

local tile1 = scaleform.ContainerComponent.actor_by_name(animation, "tile1")
local tile1Anim = scaleform.Actor.component_by_name(tile1, "animation")

local tile2 = scaleform.ContainerComponent.actor_by_name(animation, "tile2")
local tile2Anim = scaleform.Actor.component_by_name(tile2, "animation")

local tile3 = scaleform.ContainerComponent.actor_by_name(animation, "tile3")
local tile3Anim = scaleform.Actor.component_by_name(tile3, "animation")

local tile4 = scaleform.ContainerComponent.actor_by_name(animation, "tile4")
local tile4Anim = scaleform.Actor.component_by_name(tile4, "animation")

local timelineTriggerListener = scaleform.EventListener.create(timelineTriggerListener, function(e)
	if e.name == "start" then
		scaleform.AnimationComponent.goto_frame(tile1Anim, 60)
		scaleform.AnimationComponent.play(tile1Anim)
		
		scaleform.AnimationComponent.goto_frame(tile2Anim, 30)
		scaleform.AnimationComponent.play(tile2Anim)
		
		scaleform.AnimationComponent.goto_frame(tile3Anim, 20)
		scaleform.AnimationComponent.play(tile3Anim)
		
		scaleform.AnimationComponent.goto_frame(tile4Anim, 10)
		scaleform.AnimationComponent.play(tile4Anim)
	end
end )

scaleform.EventListener.connect(timelineTriggerListener, thisActor, scaleform.EventTypes.TimelineTrigger)