Using the "show" and "hide" features in App Lab


I’m working on this project as a trial because my student is planning something similar.

What I expected to happen:

I expected the program to hide all the ghosts when the game starts. It does.

I expected to be able to “mouseover” or roll my mouse over the place where the ghost is planted to be able to reveal it with the “showElement” command, but that is not working as expected. It does nothing.

Does the “mouseover” command only work when the element is shown? Or should the mouse be “sensing” the area where the graphic is planted to respond to the command to “showElement” when the mouse runs over it? (Like I thought it should)

What should I have done differently?

My student is having this same problem.

Thank you!

Amy Magaw

Here is the link to my project:

Hi @amagaw.code,

Gosh - a great deal of work has been done so I know that is frustrating but I do think you are correct. When I put a console.log on the event for mouseOver a ghost when it is hidden, it does not output a console message when I mouseOver where I know the ghost exists; however, when I do the same when the ghost is not hidden, it does output a console message.

A workarounds that I have seen is to make the image really small initially in design mode and then on mouseOver, change the ghosts height and width to regular size using the setSize block. FYI - playing around I noticed if you change the width to very small but keep a regular height, the ghost is basically invisible (at least to me) but easier to mouseOver. I changed the width to 5px and kept height the same, I couldn’t see the ghost.

Perhaps there are other workarounds that others will share.


That is a GREAT idea! I will also share that with my student to help with his game as well.

Thank you!