HELP WITH INVENTORIES!!!

Ok, some simple scripting here, which I got from this tut. website:

http://www.dmu.com/flashy/fl5.html

The code below basically tells the program to hide the key(the object to be found) and show the second movie clip which is the other key(in the inventory(key333, but hidden at first)

onClipEvent(enterFrame){
this.onPress=function(){
this._visible = false;
_root.key333._visible = true;
_root.haskey = 1;
}
}



When I do this for the key object or the 'haskey' I tested the movie and it was still there!


Could anyone help me, PLEASE

Also could someone tell me what a flag is, and what the _root.haskey = 1; means exactly