Skip to main content
Participant
May 4, 2022
Answered

circle object not appearing in scene for hazard spotting game

  • May 4, 2022
  • 1 reply
  • 130 views

Picture Reference

 

 

The idea is that when the popup box closes (code works), the red ring will appear around each kitchen object and remains there. The issue i am having is the red circle isn't visible after clicking the closebutton.

 

Any help is much appreciated, many thanks!

 

Code is below:

 

 

My current code:

 

stage.enableMouseOver();

//PAN

var root = this;
root.infobox.visible = false;
root.hazard_pan.visible = false;

root.infobox.closebtn.addEventListener("click", closeInfoBox);
this.pan.addEventListener("click", panClick);


function panClick()
{
root.infobox.visible = true;
//root.infobox.title.text = "Monkey";
//root.infobox.description.text = "Information about the monkey.";
}

function closebtnClick()
{
this.hazard_pan.visible = true;
root.hazard_pan.visible = true;
}

function closeInfoBox()
{
root.infobox.visible = false;
}

 

This topic has been closed for replies.
Correct answer JoãoCésar17023019

Hi.

 

Inside of the closeInfoBox function, you could set the visibility of the red circle to true like this:

function closeInfoBox()
{
    root.infobox.visible = false;
    root.redCircle.visible = true; // suggestion
}

 

Have you tried this?

 

Please let us know.

 

Regards,

JC

1 reply

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
May 4, 2022

Hi.

 

Inside of the closeInfoBox function, you could set the visibility of the red circle to true like this:

function closeInfoBox()
{
    root.infobox.visible = false;
    root.redCircle.visible = true; // suggestion
}

 

Have you tried this?

 

Please let us know.

 

Regards,

JC