local thisActor = ... -- our stamina bar

local scoreAnimation = scaleform.Actor.component_by_name(thisActor, "animation")
local blue = scaleform.ContainerComponent.actor_by_name(scoreAnimation, "text_blue")
local blueText = scaleform.Actor.component_by_name(blue, "text")

local red = scaleform.ContainerComponent.actor_by_name(scoreAnimation, "text_red")
local redText = scaleform.Actor.component_by_name(red, "text")

local customListener = scaleform.EventListener.create(customListener, function(e)
    if e.name == "score_changed" then
        local valueText = tostring(math.floor(e.data.value))
        scaleform.TextComponent.set_text(redText, valueText)
        scaleform.TextComponent.set_text(blueText, valueText)
    end    
end );

scaleform.EventListener.connect(customListener, thisActor,scaleform.EventTypes.Custom)