# Registry doesn't work when scenes start later

**URL:** <https://phaser.discourse.group/t/registry-doesnt-work-when-scenes-start-later/7172>\
**Category:** Phaser 3\
**Created:** [August 13, 2020, 2:42am UTC](https://phaser.discourse.group/t/registry-doesnt-work-when-scenes-start-later/7172 "2020-08-13T02:42:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hcakar](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hcakar/32/459_2.png) [@hcakar](https://phaser.discourse.group/u/hcakar)\
**Post date:** [August 13, 2020, 2:42am UTC](https://phaser.discourse.group/t/registry-doesnt-work-when-scenes-start-later/7172/1 "2020-08-13T02:42:53Z")

</div>

Hi everyone,

While trying some stuff, I found out that registry doesn’t work when you start scene later on.

So here is an example code about it. Just try this one on [labs](http://labs.phaser.io/view.html?src=src%5Cscenes%5Cregistry%20data%20exchange.js).

On the link you can see it’s working when you add scenes as `active: true` but it doesn’t work when i use it like below.

So any ideas?

```javascript
var SceneA = new Phaser.Class({
    Extends: Phaser.Scene,
    initialize: function SceneA() {
        Phaser.Scene.call(this, { key: 'SceneA' });
        this.score = 0;
    },
    create: function() {
        this.scene.start('SceneB');
        this.registry.set('score', this.score);
        this.time.addEvent({
            delay: 500,
            callback: this.onEvent,
            callbackScope: this,
            loop: true,
        });
    },
    onEvent: function() {
        this.score++;
        this.registry.set('score', this.score);
    },
});
var SceneB = new Phaser.Class({
    Extends: Phaser.Scene,
    initialize: function SceneB() {
        Phaser.Scene.call(this, { key: 'SceneB' });
        this.text;
    },
    create: function() {
        this.text = this.add.text(100, 100, 'Monitoring Registry');
        this.registry.events.on('changedata', this.updateScore, this);
    },
    updateScore: function(parent, key, data) {
        this.text.setText('Score: ' + data);
    },
});
var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    backgroundColor: '#2d2d2d',
    parent: 'phaser-example',
    //scene: [SceneA, SceneB]
};
const game = new Phaser.Game(config);
game.scene.add('SceneA', SceneA, true);
game.scene.add('SceneB', SceneB);

```

_I also opened a github issue on [here](https://github.com/photonstorm/phaser/issues/5266)._

---

<div class="post-metadata">

**Author:** ![Telinc1](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/telinc1/32/60_2.png) [@Telinc1](https://phaser.discourse.group/u/Telinc1)\
**Post date:** [August 13, 2020, 8:30am UTC](https://phaser.discourse.group/t/registry-doesnt-work-when-scenes-start-later/7172/2 "2020-08-13T08:30:16Z")

</div>

Doesn’t look like a bug, actually. `this.scene.start`, which you use in `SceneA`, [shuts down the scene that called it](https://photonstorm.github.io/phaser3-docs/Phaser.Scenes.ScenePlugin.html#start__anchor), which removes your timer event. If you use `this.scene.launch`, which [starts a new scene in parallel](https://photonstorm.github.io/phaser3-docs/Phaser.Scenes.ScenePlugin.html#launch__anchor), it works correctly no matter how you add the scenes.

---

<div class="post-metadata">

**Author:** ![hcakar](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hcakar/32/459_2.png) [@hcakar](https://phaser.discourse.group/u/hcakar)\
**Post date:** [August 13, 2020, 8:44am UTC](https://phaser.discourse.group/t/registry-doesnt-work-when-scenes-start-later/7172/3 "2020-08-13T08:44:33Z")

</div>

Oh i really don’t know how i missed this… Thank you @Telinc1
