Copy link to clipboard
Copied
I've created a second cursor named "viseur" that is visible only on a particular scene. I've called it in my Engine class like that :
So it's not visible unless the player goes to the particular scene "room3"
But, if the player use Alt+Tab during the game in order to go back to the desktop and come back to the game, "visor" is visible ! Even if he's not in room 3 ? Do you know what could cause this ? (to resume : if the cursor leave the game windows and come back, the new cursor "viseur" is visible even so it is no suppose to be) Thank you for your help, |
Copy link to clipboard
Copied
what triggers that if-statement to execute?
Copy link to clipboard
Copied
Sorry, I didn't write proprely the code.
So, I've got this that's been call at the begining of the game :
viseur = new Viseur(stage);
stage.addChild(viseur);
viseur.visible = false;
Then my variable :
var isMap:Boolean = thisBack == "room3";
Then the condition :
if (isMap) {
viseur.visible = true;
The if statement says that when the background is isMap (afk room3), "viseur" is visible.
In any other background , "viseur" is false.
Copy link to clipboard
Copied
yes, but where is that if-statement?
is it in a never-ending timer/enterframe loop or some kind of other loop?
Copy link to clipboard
Copied
It's in my createbackground function :
private function createBackground(thisBack:String):void{
trace("Creating new background: "+thisBack);
back = new Background(stage, thisBack);
addChild(back);
addChild(player);
Copy link to clipboard
Copied
you don't understand the issue so someone will probably need to download your file and fix this for you.
Copy link to clipboard
Copied
Oh I perfeclty understand the issue. There is none ! I'm just searching a way to force the engine to make "viseur" not visible all the times.
It's very unlikely that the player will return to the desktop and then come back to the game, so I'm not hunger to find a solution for this.
But if I do (or if someone help me), I'll take it !