# Issue with button alpha?

**URL:** <https://phaser.discourse.group/t/issue-with-button-alpha/4684>\
**Category:** Phaser 3\
**Created:** [December 22, 2019, 10:07pm UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684 "2019-12-22T22:07:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thundros](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/thundros/32/2057_2.png) [@Thundros](https://phaser.discourse.group/u/Thundros)\
**Post date:** [December 22, 2019, 10:07pm UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684/1 "2019-12-22T22:07:18Z")

</div>

so I’m trying to get my buttons to fade in at a given time, then when CLICKED, fade out, wait until the fade out has reached `'0'` for `'all'` buttons, then i want the button to do what it normally does which is change scenes. the above is the problem i’m having.

the code i’m looking at is in `'TitleScene.js'`, line{s} : `'103-142'`, `'265-283'` & `'344-360'`,

the direct link to `'TitleScene.js'`, is : [https://thundros.github.io/menu-system-doosan/src/Scenes/TitleScene.js](https://thundros.github.io/menu-system-doosan/src/Scenes/TitleScene.js)

the direct link to `'Button.js'`, is : [https://thundros.github.io/menu-system-doosan/src/Objects/Button.js](https://thundros.github.io/menu-system-doosan/src/Objects/Button.js)

the direct link to the `'demo'`, is : [https://thundros.github.io/menu-system-doosan/](https://thundros.github.io/menu-system-doosan/)

Any help as always, is GREATLY appreciated!

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 22, 2019, 10:22pm UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684/2 "2019-12-22T22:22:29Z")

</div>

Are you stepping through the code?

Most of the tween `targets` are undefined.

![Console log of tween config arguments](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/e/e4402a35dfad15fdc5d4d971ed1c98faf2257066.png)

---

<div class="post-metadata">

**Author:** ![Thundros](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/thundros/32/2057_2.png) [@Thundros](https://phaser.discourse.group/u/Thundros)\
**Post date:** [December 22, 2019, 10:23pm UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684/3 "2019-12-22T22:23:07Z")

</div>

How are they undefined? what the?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 22, 2019, 11:48pm UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684/4 "2019-12-22T23:48:27Z")

</div>

I think this must be a mistake:

> <https://github.com/Thundros/menu-system-doosan/blob/671f32b2331ef2ca117896f2a85225c3edef28c1/src/Scenes/TitleScene.js#L279-L280>

---

<div class="post-metadata">

**Author:** ![Thundros](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/thundros/32/2057_2.png) [@Thundros](https://phaser.discourse.group/u/Thundros)\
**Post date:** [December 22, 2019, 11:49pm UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684/5 "2019-12-22T23:49:37Z")

</div>

how?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 23, 2019, 1:04am UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684/6 "2019-12-23T01:04:58Z")

</div>

Maybe not, it just looked unusual. `this.__fadeInMenu()` is the one passing undefined targets.

TitleScene has two `__fadeOutMenu()` methods (duplicate names).

[Stepping through the code](https://developers.google.com/web/tools/chrome-devtools/javascript#code-stepping) should help with debugging.

---

<div class="post-metadata">

**Author:** ![Thundros](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/thundros/32/2057_2.png) [@Thundros](https://phaser.discourse.group/u/Thundros)\
**Post date:** [December 23, 2019, 3:48pm UTC](https://phaser.discourse.group/t/issue-with-button-alpha/4684/7 "2019-12-23T15:48:21Z")

</div>

so I almost have it working with my demo. What am I doing wrong here?

For some reason, it is only unlocking the 1st button `'Play'` when the alpha is = to `'1.0'`. It should be unlocking all 3 buttons. Then when all 3 buttons are unlocked, it should activate the fadeout then after that, switch scenes.

Here is the direct link to : `'Button.js'` :

[https://thundros.github.io/menu-system-doosan/src/Objects/Button.js](https://thundros.github.io/menu-system-doosan/src/Objects/Button.js)

See line{s} `'63-79'` in : `'Button.js'`

Here is the direct link to : `'TitleScene.js'` :

[https://thundros.github.io/menu-system-doosan/src/Scenes/TitleScene.js](https://thundros.github.io/menu-system-doosan/src/Scenes/TitleScene.js)

See line{s} `'230-287'` & `'337-353'`, in : `'TitleScene.js'`

Here is the direct link to the demo :

[https://thundros.github.io/menu-system-doosan/](https://thundros.github.io/menu-system-doosan/)

Any help as always is GREATLY appreciated & MERRY CHRISTMAS! \<3
