[Flash] Room Create options object

Hi, I triyng make room for 2 friendly players. 1-st player click on a button Create Room, copy roomid and give it his friend which insert roomid in input textfield and join in room with his friend for private friendly match. For this I must hide this room from others players who search simple quick match.

If I understand correctly, in settings Create Room I need use options object isVisible Boolean and set it false.


But I have error, maybe I write wrong code.
This my code: idnet.multiplayer.roomCreate('game', null, null, 'nowjoin', true, false, 2);

This error:

[Fault] exception, information=ArgumentError: Error #1063: Argument count mismatch on ID::Multiplayer/roomCreate(). Expected 1, got 7.

1 Like

Hi Tokar,

If I understand correctly, in settings Create Room I need use options object isVisible Boolean and set it false.

Yes, this is correct. Though the format is a little different since isVisible was added at a later point. You will want something like below.

var createOptions = { 
    isVisible: false,
    maxPlayers: 2
};
idnet.multiplayer.roomCreate('game', null, null, 'nowjoin', createOptions);

Note, that options is an object instead of a series of arguments. Above, I have seperated it for readability but it could be one line if that’s easier.

Thank you for explanation.

Y8 Games