You cannot access a file that has been unloaded.
Oh, I will only run that function when the file is loaded.
I mean the unload happens after the function.
Look at the UILoader's content property in the help documentation. Check out all of its properties, methods, and events while you're at it to become more familiar with it.