_visible not retaining value between scenes
Hi, all.
I am having a problem where the _visible value I am setting is not being retained between scenes. My first scene is four frames with different collision detections on each:
Quote:
onClipEvent (enterFrame) {
if((this.hitTest(_root.char)) and (this._visible == true)){
this._visible = false;
_root.retframe = "_1_1";
_root.charx = _root.char._x;
_root.chary = _root.char._y;
_root.gotoAndPlay("start_2");
}
if (upper>this._x) {
gotoAndStop(2);
this.xDir = 1;
} else if (lower<this._x) {
gotoAndStop(1);
this.xDir = -1;
}
this._x += 4*this.xDir;
}
"start_2" is the label on the first frame of the second scene. Everything otherwise works fine - when the movie clip is visible and collides with the movie clip "char" - the game progresses to "start_2". However, the _visible = false command is not kept when returning from the second scene to the original frame.
The movie clip should be visible at first, after collision be flagged as invisible and go to scene 2, then stay invisible when the project returns to scene 1. For some reason, though, it is losing the _visible = false property and staying true when returning from a different scene.