The errors mean you haven’t declared var stageyellow
Also, nothing in that block of code will execute since you’re comparing SONG.song.toLowerCase() == ‘Plastic-funk’
where the song is lowercase and Plastic-funk has an uppercase P in it. Try with plastic-funk
if (SONG.song.toLowerCase() == ‘plastic-funk’)
{
if (curStep == 312)
{
stageyellow.visible = false;
glowswitch.visible = true;
}
if (curStep == 330)
{
stageyellow.visible = true;
glowswitch.visible = false;
}
}
maybe you defined it in a different function? It would be out of scope. If you need to access a var from multiple functions, you declare it at class level.
class MyClass
{
// test is defined at class level here so it's
// available in all functions of this class.
private var test = "hey";
function one()
{
var localone = "this is a local var only available in this function, one()"
trace(test + ", " + localone ); // hey, this is a local var only available in this function, one()
}
function two()
{
trace(test); // hey
trace(localone); // error, localone is out of scope here
}
}