Realtime global variable!?

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Post Reply
hassanayoub85
Posts: 21
Joined: 17 Jan 2012, 17:50

Realtime global variable!?

Post by hassanayoub85 »

Hello,
Can I setup a global variable in the server, which will be available for all connected users in real time?
If yes, how to do this and access it?
Thx
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Hi.

I suggest you to use a variable stored in a Zone-Level Extension so every user that is logged in that zone can access it. Then, for retrieving that variable, you have 2 options available:

1. You just send an ExtensionRequest from the client to that extension, which sends back the value of that variable

2. Schedule a new task on the Server-Side which runs at a specific rate, and each time it runs, it sends the value of that variable to everyone that is connected.

Of course this all depends on your application and the kind of variable you're dealing with. Please keep in mind that sending data to a lot of people can use significant network resources.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
hassanayoub85
Posts: 21
Joined: 17 Jan 2012, 17:50

Post by hassanayoub85 »

I am yhniking of using this variable to move the cars while racing.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Hmm? So what kind of global variable are you referring to?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
hassanayoub85
Posts: 21
Joined: 17 Jan 2012, 17:50

Post by hassanayoub85 »

for now all what i want is to create a string with 10 characters. and how to access it from clients and change it too.
Post Reply