Unity3d Flash find object issue

Hi there!

I’m trying to build my project for Flash but I’ve stumbled upon some problems.
Every now and then objects on the scene try to find components of other objects in the scene. Works flawlessly in editor and other builds but I just can’t get it to work in Flash.

I have tested with something like this:

private GameManager gm { get { return GameObject.Find("GameManager").GetComponent<GameManager>(); } }

then later on i have:

if (GUILayout.Button(gm.audio.isPlaying.ToString(), mojSkin.GetStyle("ButtonMusicOn")))
{
	gm.audio.Stop();
}

the string in the button is just to test what happens and does it even find the object I need.

Results: in editor, on the button it says “true” since the music is actualy playing. When I build and test the flash in browser the button does not render. However, if I remove the string in the button completely, then it renders the button in flash without issues. There are some other similar situations where the code just stops because it’s trying to access a component of a different object which led me to a conclusion that GameObject.Find does not work.

Any help is appreciated due to contest deadline. Thank you.

Do not name your objects and/or classes “GameManager” as it appears to be a keyword.