Getting code to commicate with other code really well help?

alright, ive ran into this problem so many times now, because i dont really understand the overall communication with as3, and how to get code from one place to communicate with code in another place.
for example.
say i have code on 3 different keyframes, the first frame has code that assigns a variable
var isShotgun:boolean = false;
and i want code on frame 2 to pay attension to that snippit of code, and act accordingly to whether isShotgun is true or false.
its hard to really find a good example. but basically im struggling right now to get further with my coding because something wont know what im talking about when i enter in certain code that would act according to another piece of code, or even just getting an .as file to work really well with other .as files.
can anyone help?