• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

my cursor change if I'm going out of the window

Contributor ,
Dec 14, 2013 Dec 14, 2013

Copy link to clipboard

Copied

e

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 :

        viseur = new Viseur(stage); stage.addChild(viseur); viseur.visible = false;

So it's not visible unless the player goes to the particular scene "room3"

var isMap:Boolean = thisBack == "room3"; if (isMap) { viseur.visible = true;

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,

TOPICS
ActionScript

Views

707

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2013 Dec 14, 2013

Copy link to clipboard

Copied

what triggers that if-statement to execute?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 14, 2013 Dec 14, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2013 Dec 14, 2013

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 14, 2013 Dec 14, 2013

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);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2013 Dec 14, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 14, 2013 Dec 14, 2013

Copy link to clipboard

Copied

LATEST

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 !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines