Storyboard, firing "enterScene" event twice when using "fade" effect. New Composer Class?

I’ve noticed, if you use “fade” effect in transitions between storyboard scenes, the enterScene event is firing twice… This can affect the behavior of the game, as we use enterScene to run other functions to init the game…

Besides, with the latest Daily Build, when I create a new game using the template, I’ve noticed it uses a new class “composer”, very similar to storyboard, but undocumented, and which have a new behavior in enter scene event -->> if event.phase == “will” then, and elseif phase == “did” then.

With this event.phase property I could avoid firing enterScene functions twice, as I can use event.phase, buy storyboard doesn’t have this property in enterScene event.

I don’t know if this is a bug or a misunderstanding of the API, could anyone clarify why is enterScene firing twice and what is this composer? will it replace storyboard?

Thank you!

Check out the Corona blog. They announced composer as storyboards sucessor and did a tutorial on the composer api.

Thanks

Hi Gremlin Interactive, thank you, i was reading it. I was expecting to see it in the documentation instead the Blog.

Thank you for your answer!

It’s in the docs too :smiley:

Here: http://docs.coronalabs.com/daily/api/library/composer/index.html

Just in case you have the direct link, if you go to the Docs page it doesn’t show in the list.

I see it here: http://docs.coronalabs.com/daily/api/

Do a search for “composer” cmd+f and you will see it listed on the main page/index.

It’s not in the public docs yet because it’s only available in daily builds.

Nice! I was checking public docs.

Thank you!

I use Storyboard all the time with fades and I’ve never seen this double firing event unless you’re doing something to trigger a storyboard.gotoScene() call twice, like not catching the began and ended phase on a button press.

Now Composer will call scene:show() twice and you have to program for the “will” and “did” phase or else your code will execute twice.

Rob

Hi Rob, I wrote you on other post related with a bug in transitions. It seems the problem of enterScene firing twice triggers when canceling a transition using the object handle instead a transition handle.

Here is an example:

https://www.dropbox.com/s/8xww9vnd1medyom/Bug.zip

Check out the Corona blog. They announced composer as storyboards sucessor and did a tutorial on the composer api.

Thanks

Hi Gremlin Interactive, thank you, i was reading it. I was expecting to see it in the documentation instead the Blog.

Thank you for your answer!

It’s in the docs too :smiley:

Here: http://docs.coronalabs.com/daily/api/library/composer/index.html

Just in case you have the direct link, if you go to the Docs page it doesn’t show in the list.

I see it here: http://docs.coronalabs.com/daily/api/

Do a search for “composer” cmd+f and you will see it listed on the main page/index.

It’s not in the public docs yet because it’s only available in daily builds.

Nice! I was checking public docs.

Thank you!

I use Storyboard all the time with fades and I’ve never seen this double firing event unless you’re doing something to trigger a storyboard.gotoScene() call twice, like not catching the began and ended phase on a button press.

Now Composer will call scene:show() twice and you have to program for the “will” and “did” phase or else your code will execute twice.

Rob

Hi Rob, I wrote you on other post related with a bug in transitions. It seems the problem of enterScene firing twice triggers when canceling a transition using the object handle instead a transition handle.

Here is an example:

https://www.dropbox.com/s/8xww9vnd1medyom/Bug.zip

I found this bug today in my app today too.

I can create a case that composer’s “did show” event is fired twice.

Try the attached project,

(1) Start the app

(2) Click on the red box immediately right after you see it (within 2 seconds because composer 1 is still in transition (fading) to show up)

(3) You can see “did show” event is fired twice when going into composer2.

Looks like a bug, can you file it please?

Thanks

Rob

I filed the bug #32631

but in the bug report, my mind wasn’t very clear, so I wrote “will show” event fired twice instead of “did show”.

Are you able to add a note to it.