[SFS 1.x | AS3] How to handle failure to connect

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

GalaxyDoomMaster
Posts: 19
Joined: 20 Mar 2018, 01:14

[SFS 1.x | AS3] How to handle failure to connect

Postby GalaxyDoomMaster » 19 Oct 2019, 05:04

When the user clicks a button, it runs fox.connect("127.0.0.1", 9339); etc..

But upon connecting, even if the server is on or off, it goes to the next scene. I saw in the sfs 1.x API / docs that there was an example but it was in AS2 and for whatever reason I wasn't able to get it to work in as3..

How can I make it so if the connection fails, it goes back a scene instead of forward? Currently it has no checks for this , thanks!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [SFS 1.x | AS3] How to handle failure to connect

Postby Lapo » 19 Oct 2019, 07:12

Hi,
usually you use "frames" not "scenes". Meaning that you can send the playhead to another frame with different content.
In either case you should use the gotoAndPlay() or gotoAndStop() functions to jump to a different frame.

Does that help?
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 48 guests