Unkown identifier when compiling

When I try compiling I get this error:

source/PlayState.hx:4545: characters 4-15 : Unknown identifier : stageyellow
source/PlayState.hx:4547: characters 4-15 : Unknown identifier : stageyellow
source/PlayState.hx:4552: characters 4-15 : Unknown identifier : stageyellow
source/PlayState.hx:4554: characters 4-15 : Unknown identifier : stageyellow

This is what it looks like at those lines:

if (SONG.song.toLowerCase() == ‘Plastic-funk’)
{
if (curStep == 312)
{
stageyellow.visible = false;
glowswitch.visible = true;
}
if (curStep == 330)
{
stageyellow.visible = true;
glowswitch.visible = false;
}}

I’m new to coding and don’t really understand why it can’t identify the stage.

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;
	}
}

I fixed the lower case stuff, but how would I declare var stageyellow? I wrote it like this earlier

var stageyellow:FlxSprite = new FlxSprite(-519, 628).loadGraphic(Paths.image(‘stageyellow’));

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
	}
}

You should read through the haxe manual