# How to make a movie clip invisible depending on a value in another layer?

**URL:** <https://forum.kirupa.com/t/how-to-make-a-movie-clip-invisible-depending-on-a-value-in-another-layer/331894>\
**Category:** flash\
**Created:** [November 17, 2013, 11:06pm UTC](https://forum.kirupa.com/t/how-to-make-a-movie-clip-invisible-depending-on-a-value-in-another-layer/331894 "2013-11-17T23:06:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![razer56](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@razer56](https://forum.kirupa.com/u/razer56)\
**Post date:** [November 17, 2013, 11:06pm UTC](https://forum.kirupa.com/t/how-to-make-a-movie-clip-invisible-depending-on-a-value-in-another-layer/331894/1 "2013-11-17T23:06:05Z")

</div>

[COLOR=#000000][FONT=Arial]I am trying to make an “achievements” page for my game, where if the user has a high score greater than 100, then the achievement can be unlocked. I tried using a code like this, but it didn’t seem to work![/FONT][/COLOR]

```auto
[COLOR=#00008B]function[/COLOR] [COLOR=#2B91AF]Check[/COLOR]();
[COLOR=#00008B]if[/COLOR](endscreen_mc.highscore_txt > [COLOR=#800000]100[/COLOR])
{
medals.roachLock.visible = [COLOR=#00008B]false[/COLOR];
}
[COLOR=#00008B]else[/COLOR] [COLOR=#00008B]if[/COLOR](endscreen_mc.highscore_txt < [COLOR=#800000]100[/COLOR])
{
medals.roachLock.visible = [COLOR=#00008B]true[/COLOR];
}
[COLOR=#00008B]else[/COLOR] [COLOR=#00008B]if[/COLOR](endscreen_mc.visible == [COLOR=#800000]100[/COLOR])
{
medals.roachLock.visible = [COLOR=#00008B]true[/COLOR];
}

```

[COLOR=#000000][FONT=Arial]The high score value is saved inside a shared object. What’s wrong with my code, and what can I do to fix it?[/FONT][/COLOR]
