Loader for Content

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

Moderators: Lapo, Bax

Post Reply
iiitttaaa
Posts: 28
Joined: 07 Apr 2010, 16:47
Location: shh
Contact:

Loader for Content

Post by iiitttaaa »

Hey well i dont know if this is the topic, but i would like to know
if you could tell me where to look at to acomplish this:

I have my smartfox and I want to have a Loader, when an action like changeroom is received an extension should be called
The extension should set all new vars and make the laoder load the new swf of the room and grab all users online in the room
with its vars, as clothes, etc.

I havent found a method with the Documentation.
Could you help me?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Loader for Content

Post by rjgtav »

Hi.
The most practical way of accomplishing that is by storing the relative path to the room's graphic swf inside a RoomVariable.
Then, on the client, when you join a new room, you retrieve that variable's value, and load the swf.
You don't need a server-side extension for that, that's why I'm going to move this topic to the SFS Pro General Discussion forum.
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.
iiitttaaa
Posts: 28
Joined: 07 Apr 2010, 16:47
Location: shh
Contact:

Re: Loader for Content

Post by iiitttaaa »

Could you write how to retrvie that var because is not working like this:

Code: Select all

smartfox.onRoomListUpdate = function(roomList:Object)
{
	roomList_lb.removeAll()
	for (var i:String in roomList){
   var room:Room = roomList[i]
   var roomVars:Object = room.getVariables();
   trace("roomVars: "+roomVars)
   }
	// Join the default room
	this.autoJoin()
	trace("atuojoin true");
	
}

// Handle roomListUpdate events that occurred before the playhead was moved to this frame
if (evtQueue.length > 0)
{
	smartfox.onRoomListUpdate(evtQueue[0])
	delete evtQueue
}

smartFox.onRoomVariablesUpdate = onRoomVariablesUpdateHandler

function onRoomVariablesUpdateHandler(room:Room, changedVars:Array):Void
{
        // Iterate on the 'changedVars' array to check which variables were updated
        for (var v:String in changedVars)
            trace(v + " room variable was updated; new value is: " + room.getVariable(v))
}
Could you tell me how to look for that var, I have already set the flag to true in RoomListVars in config file, look:

Code: Select all

		<Zone name="simpleChat" customLogin="true" buddyList="20" uCountUpdate="true" maxUsers="10000" roomListVars="true">
       <AutoReloadExtensions>true</AutoReloadExtensions>
			<Rooms>
        
                                <Room name="Room2" maxUsers="12" isPrivate="false" isTemp="false">
	                       <Vars>
		               <Var name="path" type="s" private="true">room/water.swf</Var>
	                        </Vars>
                                 </Room>
                                 
                                <Room name="Room1" maxUsers="12" isPrivate="false" autoJoin="true" isTemp="false">
	                       <Vars>
		               <Var name="path" type="s" private="true">room/lagoon.swf</Var>
	                        </Vars>
                                 </Room>
                               
                               
                               
                                
			</Rooms>
how can i get the var "path" in my flash so i load the room externally?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Loader for Content

Post by rjgtav »

I've answered to this in your other topic. Please do not mix topics
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.
Post Reply