I want to have a label update it's text when the cursor is over a button.. kind of like a tool tip. I have it working just fine, but am wondering if there is a more efficient way to do it. Here is what I'm using now:
I'm just setting up vars with the needed strings then using them based on what button is rolled over. But it seems a bit inefficient to have rollover and rollout functions for every button doesn't it?
Code:
var SPtip:String = "Rehearse in single player mode"; BtnSP.addEventListener("rollOver", this, "UpdateSPTooltipOver"); BtnSP.addEventListener("rollOut", this, "UpdateSPTooltipOut"); BtnSP.focused = false; function UpdateSPTooltipOver() { lblTooltip.text = SPtip; } function UpdateSPTooltipOut() { lblTooltip.text = ""; }
Comment